@@ -46,13 +46,14 @@ class SingleClickDataTable(DataTable):
4646 class RowClicked (Message ):
4747 """Fired on every single mouse click on a data row."""
4848
49- def __init__ (self , data_table : " SingleClickDataTable" , cursor_row : int ) -> None :
49+ def __init__ (self , data_table : SingleClickDataTable , cursor_row : int ) -> None :
5050 self .data_table = data_table
5151 self .cursor_row = cursor_row
5252 super ().__init__ ()
5353
5454 @property
55- def control (self ) -> "SingleClickDataTable" :
55+ def control (self ) -> SingleClickDataTable :
56+ """Return the data table that fired this event."""
5657 return self .data_table
5758
5859 async def _on_click (self , event : events .Click ) -> None : # type: ignore[override]
@@ -471,7 +472,6 @@ def _on_build_confirmed(self, confirmed: bool, server_name: str, image: str, hub
471472 @work (thread = True )
472473 def _run_build (self , server_name : str , image : str , hub_name : str ) -> None :
473474 """Build a Docker/Podman image in a background thread."""
474- import subprocess
475475 from fuzzforge_cli .tui .helpers import build_image , find_dockerfile_for_server
476476
477477 logs = self ._build_logs .setdefault (image , [])
@@ -481,7 +481,7 @@ def _run_build(self, server_name: str, image: str, hub_name: str) -> None:
481481 logs .append (f"ERROR: Dockerfile not found for '{ server_name } ' in hub '{ hub_name } '" )
482482 self ._build_results [image ] = False
483483 self ._active_builds .pop (image , None )
484- self .call_from_thread (self ._on_build_done , image , False )
484+ self .call_from_thread (self ._on_build_done , image , success = False )
485485 return
486486
487487 logs .append (f"Building { image } from { dockerfile .parent } " )
@@ -493,24 +493,25 @@ def _run_build(self, server_name: str, image: str, hub_name: str) -> None:
493493 logs .append (f"ERROR: { exc } " )
494494 self ._build_results [image ] = False
495495 self ._active_builds .pop (image , None )
496- self .call_from_thread (self ._on_build_done , image , False )
496+ self .call_from_thread (self ._on_build_done , image , success = False )
497497 return
498498
499499 self ._active_builds [image ] = proc # replace pending marker with actual process
500500 self .call_from_thread (self ._refresh_hub ) # show ⏳ in table
501501
502- assert proc .stdout is not None
502+ if proc .stdout is None :
503+ return
503504 for line in proc .stdout :
504505 logs .append (line .rstrip ())
505506
506507 proc .wait ()
507508 self ._active_builds .pop (image , None )
508509 success = proc .returncode == 0
509510 self ._build_results [image ] = success
510- self .call_from_thread (self ._on_build_done , image , success )
511+ self .call_from_thread (self ._on_build_done , image , success = success )
511512
512- def _on_build_done (self , image : str , success : bool ) -> None :
513- """Called on the main thread when a background build finishes ."""
513+ def _on_build_done (self , image : str , * , success : bool ) -> None :
514+ """Handle completion of a background build on the main thread ."""
514515 self ._refresh_hub ()
515516 if success :
516517 self .notify (f"✓ { image } built successfully" , severity = "information" )
0 commit comments