完成 0.4.0 版本更新, 为了消除此前提交消息风格不一致与错误提交超大文件的问题, 维持代码统计数据的准确性和提交消息风格的一致性, 重新初始化仓库; 旧的提交历史在 HeurAMS-legacy 仓库(https://gitea.imwangzhiyu.xyz/ajax/HeurAMS-legacy) BREAKING CHANGE: 略
49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
from textual.app import ComposeResult
|
|
from textual.widgets import (
|
|
Header,
|
|
Footer,
|
|
Label,
|
|
Button,
|
|
Static,
|
|
ProgressBar,
|
|
)
|
|
from textual.containers import ScrollableContainer, Horizontal
|
|
from textual.containers import ScrollableContainer
|
|
from textual.screen import Screen
|
|
import pathlib
|
|
|
|
import heurams.kernel.particles as pt
|
|
import heurams.services.hasher as hasher
|
|
from heurams.context import *
|
|
from textual.worker import get_current_worker
|
|
|
|
|
|
class SyncScreen(Screen):
|
|
|
|
BINDINGS = [("q", "go_back", "返回")]
|
|
|
|
def __init__(self, nucleons: list = [], desc: str = ""):
|
|
super().__init__(name=None, id=None, classes=None)
|
|
|
|
def compose(self) -> ComposeResult:
|
|
yield Header(show_clock=True)
|
|
with ScrollableContainer(id="sync_container"):
|
|
pass
|
|
yield Footer()
|
|
|
|
def on_mount(self):
|
|
"""挂载时初始化状态"""
|
|
|
|
def update_status(self, status, current_item="", progress=None):
|
|
"""更新状态显示"""
|
|
|
|
def on_button_pressed(self, event: Button.Pressed) -> None:
|
|
event.stop()
|
|
|
|
def action_go_back(self):
|
|
self.app.pop_screen()
|
|
|
|
def action_quit_app(self):
|
|
self.app.exit()
|