修复 ElectronUnion 对象初始化问题
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# [调试] 将更改保存到文件
|
||||
save = 1
|
||||
# [调试] 覆写时间
|
||||
time_override = 12
|
||||
time_override = 11
|
||||
# 对于每个项目的新记忆核子数量
|
||||
tasked_number = 12
|
||||
# 竖屏适配
|
||||
|
@@ -144,6 +144,9 @@ class Nucleon:
|
||||
def __len__(self):
|
||||
return len(self.metadata)
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.content)
|
||||
|
||||
@staticmethod
|
||||
def placeholder():
|
||||
return Nucleon("核子对象样例内容", {})
|
||||
@@ -197,7 +200,7 @@ class ElectronUnion():
|
||||
for i in all.keys():
|
||||
lst.append(Electron(i, all[i]))
|
||||
self.electrons = lst
|
||||
self.electrons_dict = {i.content: i.metadata for i in lst}
|
||||
self.electrons_dict = {i.content: i for i in lst}
|
||||
|
||||
def sync(self):
|
||||
"""同步 electrons_dict 中新增对到 electrons 中"""
|
||||
|
@@ -38,7 +38,7 @@ class Reactor():
|
||||
self.atoms_new.append(atom)
|
||||
counter -= 1
|
||||
else:
|
||||
if atom[0]["next_date"] <= aux.get_daystamp():
|
||||
if int(atom[0]["next_date"]) <= aux.get_daystamp():
|
||||
atom[0]["last_date"] = aux.get_daystamp()
|
||||
self.atoms_review.append(atom)
|
||||
# 设置运行时
|
||||
@@ -64,6 +64,9 @@ class Reactor():
|
||||
2: "新记忆模式",
|
||||
3: "总复习模式"
|
||||
}
|
||||
print("Atoms New:", self.atoms_new)
|
||||
print("Atoms Review:", self.atoms_review)
|
||||
|
||||
processions = {
|
||||
1: self.atoms_review,
|
||||
2: self.atoms_new,
|
||||
|
Reference in New Issue
Block a user