fix: 修复若干可用性问题
This commit is contained in:
@@ -7,24 +7,6 @@ import pickle
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
||||
def environment_check():
|
||||
from pathlib import Path
|
||||
|
||||
logger.debug("检查环境路径")
|
||||
subdir = ["cache/voice", "repo", "global", "config"]
|
||||
for i in subdir:
|
||||
i = Path(config_var.get()["global"]["paths"]["data"]) / i
|
||||
if not i.exists():
|
||||
logger.info("创建目录: %s", i)
|
||||
print(f"创建 {i}")
|
||||
i.mkdir(exist_ok=True, parents=True)
|
||||
else:
|
||||
logger.debug("目录已存在: %s", i)
|
||||
print(f"找到 {i}")
|
||||
logger.debug("环境检查完成")
|
||||
|
||||
|
||||
def start_debug_server(app):
|
||||
logger = get_logger("zmq_debug")
|
||||
context = zmq.Context()
|
||||
@@ -56,7 +38,6 @@ def start_debug_server(app):
|
||||
|
||||
|
||||
def main():
|
||||
environment_check()
|
||||
|
||||
app = HeurAMSApp()
|
||||
|
||||
|
||||
@@ -66,10 +66,10 @@ class DashboardScreen(Screen):
|
||||
Vertical(
|
||||
Label(f"已加载 {len(self.repos)} 个单元集"),
|
||||
Label(
|
||||
f"共计 {reduce(lambda x, y: x + y, map(lambda x: x.progress['total'], self.repos))} 个单元"
|
||||
f"共计 {reduce(lambda x, y: x + y, map(lambda x: x.progress['total'], self.repos)) if self.repos else 0} 个单元"
|
||||
),
|
||||
Label(
|
||||
f"已激活 {reduce(lambda x, y: x + y, map(lambda x: x.progress['touched'], self.repos))} 个单元"
|
||||
f"已激活 {reduce(lambda x, y: x + y, map(lambda x: x.progress['touched'], self.repos)) if self.repos else 0} 个单元"
|
||||
),
|
||||
Label(f""),
|
||||
classes="right",
|
||||
@@ -160,8 +160,8 @@ class DashboardScreen(Screen):
|
||||
repo_list_widget.append(
|
||||
ListItem(
|
||||
Static(
|
||||
f"在 {config_var.get()['global']['paths']['repo']} 中未找到任何仓库.\n"
|
||||
"请导入仓库后重启应用, 或者新建空的仓库."
|
||||
f"在 {config_var.get()['global']['paths']['repo']} 中未找到任何单元集仓库目录.\n"
|
||||
"请导入单元集后重启应用, 或者新建单元集."
|
||||
),
|
||||
id="not-found",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user