改进 🍰

This commit is contained in:
2025-08-28 13:08:37 +08:00
parent fc58f61dfe
commit beeb2fd318
21 changed files with 258 additions and 19 deletions

View File

@@ -205,7 +205,9 @@ class ElectronUnion:
all = toml.load(f)
lst = list()
for i in all.keys():
lst.append(Electron(i, all[i]))
if i != "total":
lst.append(Electron(i, all[i]))
self.total = all.get("total", {"last_date": 0})
self.electrons = lst
self.electrons_dict = {i.content: i for i in lst}
@@ -215,8 +217,10 @@ class ElectronUnion:
def save(self):
# print(1)
self.total["last_date"] = aux.get_daystamp()
with open(self.path, 'w') as f:
tmp = {i.content: i.metadata for i in self.electrons}
tmp["total"] = self.total
# print(tmp)
toml.dump(tmp, f)