fix: 修复若干可用性问题

This commit is contained in:
2026-05-07 18:17:39 +08:00
parent 7bf78ecdff
commit dd2469b49a
11 changed files with 12 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
zmq_debug = true
zmq_debug = false
_zmq_debug_desc = "[调试] ZeroMQ 调试服务器, 这会在 zmq_debug_port 上打开一个服务器\n调试工具可远程在 HeurAMS 内执行任意 python 代码, 无必要请关闭"
zmq_debug_port = 5555
_zmq_debug_port_desc = "[调试] ZeroMQ 调试服务器端口"

View File

@@ -10,7 +10,7 @@ quick_pass = true
_quick_pass_desc = "[调试] 启用快速应答功能(跳过测验)"
auto_pass = false
_auto_pass_desc = "[调试] 自动通过测试模式"
scheduled_num = 420
scheduled_num = 35
_scheduled_num_desc = "默认记忆单元数量\n可被单元集设置覆盖"
refresh_on_resume = true
_refresh_on_resume_desc = "[调试] 每当 Screen 激活后都刷新状态"

View File

@@ -1,11 +0,0 @@
algorithm = "NSP-0"
_algorithm_desc = "记忆调度算法"
scheduled_num = 35
_scheduled_num_desc = "单次记忆单元数量"
[_algorithm_candidate]
NSP-0 = "筛选用非间隔重复调度器"
none = "不设置默认调度器"
SM-2 = "第二代 SuperMemo 简单间隔重复调度器"
SM-15M = "第15代 SuperMemo 复杂间隔重复调度器 (不稳定且逆向工程)"
FSRS = "先进开放间隔重复调度器"

View File

@@ -1,11 +0,0 @@
algorithm = "NSP-0"
_algorithm_desc = "记忆调度算法"
scheduled_num = 35
_scheduled_num_desc = "单次记忆单元数量"
[_algorithm_candidate]
NSP-0 = "筛选用非间隔重复调度器"
none = "不设置默认调度器"
SM-2 = "第二代 SuperMemo 简单间隔重复调度器"
SM-15M = "第15代 SuperMemo 复杂间隔重复调度器 (不稳定且逆向工程)"
FSRS = "先进开放间隔重复调度器"

View File

@@ -1,4 +1,4 @@
provider = "openai"
provider = "none"
_provider_desc = "模型接口类型"
[_provider_candidate]

View File

@@ -1,4 +1,4 @@
provider = "webdav"
provider = "none"
_provider_desc = "同步服务驱动类型"
[_provider_candidate]

View File

@@ -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()

View File

@@ -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",
)

View File

@@ -21,8 +21,8 @@ logger = get_logger(__name__)
# 全局 Scheduler 状态文件路径
_SCHEDULER_STATE_FILE = pathlib.Path(
config_var.get()["global"]["paths"]["data"]
) / "global" / "fsrs_scheduler_state.json"
config_var.get()["global"]["paths"]["misc"]
) / "fsrs_scheduler_state.json"
def _get_global_scheduler():

View File

@@ -600,9 +600,7 @@ class SM:
# Global state management
# ============================================================================
_GLOBAL_STATE_FILE = pathlib.Path(
config_var.get()["global"]["paths"]["data"]
) / "global" / "sm15m_global_state.json"
_GLOBAL_STATE_FILE = pathlib.Path(config_var.get()["global"]["paths"]["misc"]) / "sm15m_global_state.json"
def _get_global_sm():

4
uv.lock generated
View File

@@ -439,7 +439,6 @@ version = "0.5.0"
source = { editable = "." }
dependencies = [
{ name = "tabulate" },
{ name = "textual" },
{ name = "toml" },
{ name = "transitions" },
]
@@ -499,8 +498,7 @@ requires-dist = [
{ name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0.0" },
{ name = "pytest-cov", marker = "extra == 'dev'", specifier = ">=6.0.0" },
{ name = "tabulate", specifier = ">=0.10.0" },
{ name = "textual", specifier = ">=8.2.5" },
{ name = "textual", marker = "extra == 'interface'", specifier = ">=8.2.3" },
{ name = "textual", marker = "extra == 'interface'", specifier = ">=8.2.5" },
{ name = "toml", specifier = ">=0.10.2" },
{ name = "transitions", specifier = ">=0.9.3" },
{ name = "zmq", marker = "extra == 'dev'", specifier = ">=0.0.0" },