改进
This commit is contained in:
22
main.py
22
main.py
@@ -22,18 +22,18 @@ import auxiliary as aux
|
||||
import compositions as compo
|
||||
import builtins
|
||||
|
||||
_original_open = builtins.open
|
||||
# Hook python 的 open() 函数, 使用 utf-8 (兼容 Windows 万年 GBK)
|
||||
|
||||
_original_open = builtins.open
|
||||
|
||||
def _open(*args, **kwargs):
|
||||
if "encoding" not in kwargs:
|
||||
kwargs["encoding"] = "utf-8"
|
||||
return _original_open(*args, **kwargs)
|
||||
|
||||
|
||||
builtins.open = _open
|
||||
|
||||
ver = "0.3.0b"
|
||||
ver = "0.3.0"
|
||||
|
||||
config = aux.ConfigFile("config.toml")
|
||||
|
||||
@@ -43,19 +43,9 @@ class MemScreen(Screen):
|
||||
("d", "toggle_dark", "改变色调"),
|
||||
("q", "pop_screen", "返回主菜单"),
|
||||
("v", "play_voice", "朗读"),
|
||||
("0", "press('q0')", None),
|
||||
("1", "press('q1')", None),
|
||||
("2", "press('q2')", None),
|
||||
("3", "press('q3')", None),
|
||||
("4", "press('q4')", None),
|
||||
("5", "press('q5')", None),
|
||||
("[", "press('q5')", None),
|
||||
("]", "press('q4')", None),
|
||||
(";", "press('q3')", None),
|
||||
("'", "press('q2')", None),
|
||||
(".", "press('q1')", None),
|
||||
("/", "press('q0')", None),
|
||||
]
|
||||
if config.get("quick_pass"):
|
||||
BINDINGS.append(("k", "quick_pass", "快速通过[调试]"))
|
||||
btn = dict()
|
||||
|
||||
def __init__(
|
||||
@@ -148,6 +138,8 @@ class MemScreen(Screen):
|
||||
|
||||
threading.Thread(target=play).start()
|
||||
|
||||
def action_quick_pass(self):
|
||||
self._forward_judge(0)
|
||||
def action_toggle_dark(self):
|
||||
self.app.action_toggle_dark()
|
||||
|
||||
|
Reference in New Issue
Block a user