This commit is contained in:
2025-08-05 14:13:11 +08:00
parent c9185fbd0a
commit 961f0ba785
6 changed files with 88 additions and 60 deletions

20
main.py
View File

@@ -12,6 +12,20 @@ from reactor import Reactor, Apparatus
import auxiliary as aux
import compositions as compo
import builtins
# 保存原始的 open 函数
_original_open = builtins.open
# 定义新的 open 函数,默认使用 UTF-8
def _open(*args, **kwargs):
if 'encoding' not in kwargs:
kwargs['encoding'] = 'utf-8'
return _original_open(*args, **kwargs)
# 替换全局的 open
builtins.open = _open
ver = '0.3.0'
config = aux.ConfigFile("config.toml")
@@ -90,8 +104,10 @@ class MemScreen(Screen):
if nxt == -1:
if self.reactor.round_set == 0:
if self.stage == 4:
if config.get("save"):
self.reactor.save()
#if config.get("save"):
#self.reactor.save()
self.compo = compo.Finished(self, None, pt.Atom.placeholder())
self.refresh_ui()
#self._show_finished_screen("今日目标已完成")
else:
self.reactor.set_round_templated(self.stage)