style: 格式化代码

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

View File

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

View File

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

View File

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

View File

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