Compare commits
3 Commits
8683693cd1
...
v0.3.6
Author | SHA1 | Date | |
---|---|---|---|
0f342c96ee | |||
3022ada51a | |||
9dada59c56 |
@@ -61,7 +61,7 @@ def get_daystamp() -> int:
|
||||
if time_override != -1:
|
||||
return int(time_override)
|
||||
|
||||
return int(time.time() // (24 * 3600))
|
||||
return int((time.time()+config.get("timezone_offset")) // (24 * 3600))
|
||||
|
||||
def get_md5(text):
|
||||
return hashlib.md5(text.encode('utf-8')).hexdigest()
|
||||
|
@@ -6,3 +6,5 @@ time_override = -1
|
||||
quick_pass = 0
|
||||
# 对于每个项目的新记忆核子数量
|
||||
tasked_number = 6
|
||||
# UTC 时间戳修正 用于 UNIX 日时间戳的生成修正, 单位为秒
|
||||
timezone_offset = +28800 # 中国标准时间 (UTC+8)
|
2
main.py
2
main.py
@@ -4,7 +4,7 @@ import os
|
||||
|
||||
class AppLauncher(App):
|
||||
CSS_PATH = "styles.css"
|
||||
TITLE = "潜进 - 辅助记忆程序"
|
||||
TITLE = "潜进 - 辅助记忆调度器"
|
||||
BINDINGS = [("escape", "quit", "退出"), ("d", "toggle_dark", "改变色调")]
|
||||
SCREENS = {
|
||||
"dashboard": screens.DashboardScreen,
|
||||
|
@@ -1,2 +1,2 @@
|
||||
ver = "0.3.5"
|
||||
stage = "late"
|
||||
ver = "0.3.6"
|
||||
stage = "stable"
|
23
screens.py
23
screens.py
@@ -153,29 +153,25 @@ class PreparationScreen(Screen):
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header(show_clock=True)
|
||||
with Container(id="learning_screen_container"):
|
||||
yield Label(f"记忆项目: [b]{self.nucleon_file.name}[/b]\n")
|
||||
yield Label(
|
||||
f"核子文件对象: ./nucleon/[b]{self.nucleon_file.name}[/b].toml"
|
||||
)
|
||||
yield Label(
|
||||
f"电子文件对象: ./electron/[b]{self.electron_file.name}[/b].toml"
|
||||
)
|
||||
yield Label(f"核子数量:{len(self.nucleon_file)}")
|
||||
with Container(id="vice_container"):
|
||||
yield Label(f"准备就绪: [b]{self.nucleon_file.name}[/b]\n")
|
||||
yield Label(f"内容源文件对象: ./nucleon/[b]{self.nucleon_file.name}[/b].toml")
|
||||
yield Label(f"元数据文件对象: ./electron/[b]{self.electron_file.name}[/b].toml")
|
||||
yield Label(f"\n单元数量:{len(self.nucleon_file)}\n")
|
||||
yield Button(
|
||||
"开始记忆",
|
||||
id="start_memorizing_button",
|
||||
variant="primary",
|
||||
classes="start-button",
|
||||
)
|
||||
yield Static(f"\n全文如下:\n")
|
||||
yield Static(self._get_full_content().replace("/", ""), classes="full")
|
||||
yield Static(f"\n单元预览:\n")
|
||||
yield Markdown(self._get_full_content().replace("/", ""), classes="full")
|
||||
yield Footer()
|
||||
|
||||
def _get_full_content(self):
|
||||
content = ""
|
||||
for i in self.nucleon_file.nucleons:
|
||||
content += i["content"]
|
||||
content += " - " + i["content"] + " \n"
|
||||
return content
|
||||
|
||||
def action_go_back(self):
|
||||
@@ -197,6 +193,7 @@ class DashboardScreen(Screen):
|
||||
yield Container(
|
||||
Label(f'欢迎使用 "潜进" 启发式辅助记忆调度器, 版本 {metadata.ver}', classes="title-label"),
|
||||
Label(f"当前的 UNIX 日时间戳: {aux.get_daystamp()}"),
|
||||
Label(f'包含时间戳修正: UTC+{config.get("timezone_offset")/3600}'),
|
||||
Label("选择待学习的记忆单元:", classes="title-label"),
|
||||
ListView(id="file-list", classes="file-list-view"),
|
||||
Label(f"\"潜进\" 开放源代码软件项目 | 版本 {metadata.ver} {metadata.stage.capitalize()} | Wang Zhiyu 2025"),
|
||||
@@ -233,7 +230,7 @@ class DashboardScreen(Screen):
|
||||
))
|
||||
else:
|
||||
file_list_widget.append(
|
||||
ListItem(Static("在 ./nucleon/ 中未找到任何核子文件. 请放置文件后重启应用."))
|
||||
ListItem(Static("在 ./nucleon/ 中未找到任何内容源数据文件.\n请放置文件后重启应用."))
|
||||
)
|
||||
file_list_widget.disabled = True
|
||||
|
||||
|
@@ -8,14 +8,14 @@ Screen {
|
||||
width: 95%;
|
||||
height: auto;
|
||||
border: thick $primary-lighten-2;
|
||||
padding: 2;
|
||||
padding: 1;
|
||||
}
|
||||
|
||||
#vice_container {
|
||||
align: center middle;
|
||||
width: 95%;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding: 2;
|
||||
padding: 1;
|
||||
}
|
||||
|
||||
#sentence {
|
||||
|
Reference in New Issue
Block a user