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