File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import os
8
8
9
- from rich .console import RenderableType
10
-
11
- from textual .app import App , ComposeResult
12
- from textual .containers import Container
13
- from textual .widgets import Button , Header , RichLog , Label
9
+ try :
10
+ from rich .console import RenderableType
11
+ from textual .app import App , ComposeResult
12
+ from textual .containers import Container
13
+ from textual .widgets import Button , Header , RichLog , Label
14
+ except ImportError :
15
+ print ("Please install the 'textual-dev' package before running this script." )
16
+ quit ()
14
17
15
18
from targets import TargetsScreen
16
19
from editor import EditorScreen
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ class TargetsScreen(Screen[dict]):
10
10
11
11
def update_targets (self ) -> None :
12
12
self .temp_target_dict = dict (self .app .target_dict )
13
+ print ("Targets updated:" )
14
+ print (self .temp_target_dict )
13
15
14
16
def on_button_pressed (self , event : Button .Pressed ) -> None :
15
17
"""Event handler called when a button is pressed."""
@@ -28,7 +30,6 @@ def on_button_pressed(self, event: Button.Pressed) -> None:
28
30
self .dismiss ({})
29
31
30
32
def compose (self ) -> ComposeResult :
31
- self .update_targets ()
32
33
yield Header ()
33
34
with Container (id = "target-selection-container" ):
34
35
with VerticalScroll (id = "target-scroll-container" ):
@@ -53,8 +54,6 @@ def on_mount(self) -> None:
53
54
def on_resume (self ) -> None :
54
55
print ("Targets screen resumed" )
55
56
self .update_targets ()
56
- print (self .temp_target_dict )
57
57
for checkbox in self .query ("Checkbox" ):
58
58
target_text = checkbox .id [:- 9 ]
59
59
checkbox .value = self .temp_target_dict [target_text ]
60
-
You can’t perform that action at this time.
0 commit comments