You've already forked HeurAMS-legacy
fix: 完善
This commit is contained in:
@@ -51,11 +51,11 @@ class MemScreen(Screen):
|
||||
|
||||
def puzzle_widget(self):
|
||||
try:
|
||||
print(self.phaser.state)
|
||||
#print(self.phaser.state)
|
||||
self.fission = Fission(self.procession.current_atom, self.phaser.state)
|
||||
# print(1)
|
||||
puzzle_info = next(self.fission.generate())
|
||||
print(puzzle_info)
|
||||
#print(puzzle_info)
|
||||
return shim.puzzle2widget[puzzle_info["puzzle"]](
|
||||
atom=self.procession.current_atom, alia=puzzle_info["alia"]
|
||||
)
|
||||
@@ -90,7 +90,9 @@ class MemScreen(Screen):
|
||||
forwards = 1 if new_rating >= 4 else 0
|
||||
self.rating = -1
|
||||
if forwards:
|
||||
self.procession.forward(1)
|
||||
ret = self.procession.forward(1)
|
||||
if ret == 0:
|
||||
self.procession = self.phaser.current_procession() # type: ignore
|
||||
self.load_puzzle()
|
||||
|
||||
def action_play_voice(self):
|
||||
|
||||
@@ -4,14 +4,11 @@ from textual.widgets import (
|
||||
Header,
|
||||
Footer,
|
||||
Label,
|
||||
Input,
|
||||
Select,
|
||||
Button,
|
||||
Markdown,
|
||||
Static,
|
||||
ProgressBar,
|
||||
)
|
||||
from textual.containers import Container, Horizontal, Center
|
||||
from textual.containers import Container, Horizontal
|
||||
from textual.containers import Container
|
||||
from textual.screen import Screen
|
||||
import pathlib
|
||||
@@ -19,7 +16,7 @@ import pathlib
|
||||
import heurams.kernel.particles as pt
|
||||
import heurams.services.hasher as hasher
|
||||
from heurams.context import *
|
||||
from textual.worker import Worker, get_current_worker
|
||||
from textual.worker import get_current_worker
|
||||
|
||||
|
||||
class PrecachingScreen(Screen):
|
||||
|
||||
48
src/heurams/interface/screens/synctool.py
Normal file
48
src/heurams/interface/screens/synctool.py
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python3
|
||||
from textual.app import ComposeResult
|
||||
from textual.widgets import (
|
||||
Header,
|
||||
Footer,
|
||||
Label,
|
||||
Button,
|
||||
Static,
|
||||
ProgressBar,
|
||||
)
|
||||
from textual.containers import Container, Horizontal
|
||||
from textual.containers import Container
|
||||
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 Container(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()
|
||||
Reference in New Issue
Block a user