style: 格式化代码

This commit is contained in:
2026-04-21 00:17:03 +08:00
parent 4246061c29
commit 6f183e4d9d
4 changed files with 12 additions and 11 deletions

View File

@@ -80,4 +80,3 @@ class HeurAMSApp(App):
def panic(self, *args): def panic(self, *args):
self._close_messages_no_wait() self._close_messages_no_wait()
raise self._exception raise self._exception

View File

@@ -35,7 +35,7 @@ class DashboardScreen(Screen):
("q", "go_back", "返回"), ("q", "go_back", "返回"),
] ]
CSS_PATH = rootdir / 'interface' / "css" / "screens" / "dashboard.tcss" CSS_PATH = rootdir / "interface" / "css" / "screens" / "dashboard.tcss"
def __init__( def __init__(
self, self,
@@ -78,9 +78,7 @@ class DashboardScreen(Screen):
yield ListView(id="repo_list", classes="repo-list") # 单元集选择 yield ListView(id="repo_list", classes="repo-list") # 单元集选择
yield Label( yield Label(f"版本 {version.ver} {version.stage.capitalize()}") # 版本信息
f'版本 {version.ver} {version.stage.capitalize()}'
) # 版本信息
yield Footer() yield Footer()
def _load_data(self): def _load_data(self):
@@ -108,7 +106,7 @@ class DashboardScreen(Screen):
} }
repo.preview = { repo.preview = {
"review": 0, "review": 0,
"new": repo.config['scheduled_num'], "new": repo.config["scheduled_num"],
} }
initial_time = float("inf") initial_time = float("inf")
for i in range(repo.data_length): for i in range(repo.data_length):
@@ -121,8 +119,8 @@ class DashboardScreen(Screen):
repo.progress["have_activated_ever"] = 1 repo.progress["have_activated_ever"] = 1
repo.progress["touched"] += 1 repo.progress["touched"] += 1
repo.nearest_review_time = min(repo.nearest_review_time, e.nextdate()) repo.nearest_review_time = min(repo.nearest_review_time, e.nextdate())
if (timer.get_daystamp() >= e.nextdate()): if timer.get_daystamp() >= e.nextdate():
repo.preview['review'] += 1 repo.preview["review"] += 1
# initial_time = min(initial_time, e.) # initial_time = min(initial_time, e.)
repo.need_review = timer.get_daystamp() >= repo.nearest_review_time repo.need_review = timer.get_daystamp() >= repo.nearest_review_time
repo.prompt = f"""{repo.manifest['title']} \\[{repo.config['algorithm']}] repo.prompt = f"""{repo.manifest['title']} \\[{repo.config['algorithm']}]

View File

@@ -44,8 +44,8 @@ class SettingScreen(Screen):
BINDINGS = [ BINDINGS = [
("q", "go_back", "返回"), ("q", "go_back", "返回"),
] ]
CSS_PATH = rootdir / 'interface' / "css" / "screens" / "setting.tcss" CSS_PATH = rootdir / "interface" / "css" / "screens" / "setting.tcss"
def __init__( def __init__(
self, self,
name: str | None = None, name: str | None = None,
@@ -67,7 +67,10 @@ class SettingScreen(Screen):
yield Collapsible( yield Collapsible(
*a, title=i + f'\n{config_var.get().get(f"_{i}_desc", "")}' *a, title=i + f'\n{config_var.get().get(f"_{i}_desc", "")}'
) )
yield Label("退出页面时, 所作的更改会立即保存, 但仍建议重启软件以确保新的配置得到应用", classes="foot") yield Label(
"退出页面时, 所作的更改会立即保存, 但仍建议重启软件以确保新的配置得到应用",
classes="foot",
)
yield Footer() yield Footer()
def _get_subcfg(self, parent_epath: str): def _get_subcfg(self, parent_epath: str):

View File

@@ -1,6 +1,7 @@
from collections.abc import MutableSequence from collections.abc import MutableSequence
from typing import Any, Iterator, Optional from typing import Any, Iterator, Optional
class Lict(MutableSequence): class Lict(MutableSequence):
""" "列典" 对象 """ "列典" 对象