fix(interface): 修复仪表盘详情
This commit is contained in:
@@ -74,7 +74,7 @@ class DashboardScreen(Screen):
|
||||
is_activated = 1
|
||||
nextdate = min(nextdate, i.nextdate())
|
||||
res[1] = f"下一次复习: {nextdate}\n"
|
||||
res[1] += f"{is_due if "需要复习" else "当前无需复习"}"
|
||||
res[1] += f"{"需要复习" if is_due else "当前无需复习"}"
|
||||
if not is_activated:
|
||||
res[1] = " 尚未激活"
|
||||
return res
|
||||
|
||||
@@ -18,18 +18,18 @@ class Electron:
|
||||
algo: 使用的算法模块标识
|
||||
"""
|
||||
logger.debug(
|
||||
"创建 Electron 实例, ident: '%s', algo_name: '%s'", ident, algo_name
|
||||
"创建 Electron 实例, ident: '%s', algo_name: '%s', algodata: %s", ident, algo_name, algodata
|
||||
)
|
||||
self.algodata = algodata
|
||||
self.ident = ident
|
||||
self.algo = algorithms[algo_name]
|
||||
logger.debug("使用的算法类: %s", self.algo.__name__)
|
||||
|
||||
if self.algo not in self.algodata.keys():
|
||||
if self.algo.algo_name not in self.algodata.keys():
|
||||
self.algodata[self.algo.algo_name] = {}
|
||||
logger.debug("算法键 '%s' 不存在, 已创建空字典", self.algo)
|
||||
if not self.algodata[self.algo.algo_name]:
|
||||
logger.debug("算法数据为空, 使用默认值初始化")
|
||||
logger.debug(f"算法数据为空, 使用默认值初始化{self.algodata[self.algo.algo_name]}")
|
||||
self._default_init(self.algo.defaults)
|
||||
else:
|
||||
logger.debug("算法数据已存在, 跳过默认初始化")
|
||||
|
||||
@@ -68,7 +68,7 @@ def load_electron(path: pathlib.Path, fmt="json") -> dict:
|
||||
logger.debug("JSON 解析成功, keys: %s", list(dictdata.keys()))
|
||||
dic = dict()
|
||||
for item, attr in dictdata.items():
|
||||
logger.debug("处理电子项目: %s", item)
|
||||
logger.debug("处理电子项目: %s, %s", item, attr)
|
||||
dic[item] = Electron(item, attr)
|
||||
logger.debug("load_electron 完成, 加载了 %d 个 Electron 对象", len(dic))
|
||||
return dic
|
||||
|
||||
Reference in New Issue
Block a user