加入时间戳修正配置

This commit is contained in:
2025-09-29 23:30:51 +08:00
parent 8683693cd1
commit 9dada59c56
5 changed files with 7 additions and 4 deletions

View File

@@ -61,7 +61,7 @@ def get_daystamp() -> int:
if time_override != -1: if time_override != -1:
return int(time_override) return int(time_override)
return int(time.time() // (24 * 3600)) return int((time.time()+config.get("timezone_offset")) // (24 * 3600))
def get_md5(text): def get_md5(text):
return hashlib.md5(text.encode('utf-8')).hexdigest() return hashlib.md5(text.encode('utf-8')).hexdigest()

View File

@@ -6,3 +6,5 @@ time_override = -1
quick_pass = 0 quick_pass = 0
# 对于每个项目的新记忆核子数量 # 对于每个项目的新记忆核子数量
tasked_number = 6 tasked_number = 6
# UTC 时间戳修正 用于 UNIX 日时间戳的生成修正, 单位为秒
timezone_offset = +28800 # 中国标准时间 (UTC+8)

View File

@@ -4,7 +4,7 @@ import os
class AppLauncher(App): class AppLauncher(App):
CSS_PATH = "styles.css" CSS_PATH = "styles.css"
TITLE = "潜进 - 辅助记忆程序" TITLE = "潜进 - 辅助记忆调度器"
BINDINGS = [("escape", "quit", "退出"), ("d", "toggle_dark", "改变色调")] BINDINGS = [("escape", "quit", "退出"), ("d", "toggle_dark", "改变色调")]
SCREENS = { SCREENS = {
"dashboard": screens.DashboardScreen, "dashboard": screens.DashboardScreen,

View File

@@ -1,2 +1,2 @@
ver = "0.3.5" ver = "0.3.6"
stage = "late" stage = "prototype"

View File

@@ -197,6 +197,7 @@ class DashboardScreen(Screen):
yield Container( yield Container(
Label(f'欢迎使用 "潜进" 启发式辅助记忆调度器, 版本 {metadata.ver}', classes="title-label"), Label(f'欢迎使用 "潜进" 启发式辅助记忆调度器, 版本 {metadata.ver}', classes="title-label"),
Label(f"当前的 UNIX 日时间戳: {aux.get_daystamp()}"), Label(f"当前的 UNIX 日时间戳: {aux.get_daystamp()}"),
Label(f'包含时间戳修正: UTC+{config.get("timezone_offset")/3600}'),
Label("选择待学习的记忆单元:", classes="title-label"), Label("选择待学习的记忆单元:", classes="title-label"),
ListView(id="file-list", classes="file-list-view"), ListView(id="file-list", classes="file-list-view"),
Label(f"\"潜进\" 开放源代码软件项目 | 版本 {metadata.ver} {metadata.stage.capitalize()} | Wang Zhiyu 2025"), Label(f"\"潜进\" 开放源代码软件项目 | 版本 {metadata.ver} {metadata.stage.capitalize()} | Wang Zhiyu 2025"),