h
This commit is contained in:
30
TUI.py
30
TUI.py
@@ -29,6 +29,8 @@ from textual.widgets import (
|
||||
)
|
||||
from textual.widgets.option_list import Option
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
BASE_DIR = Path(__file__).resolve().parent
|
||||
REPO_ROOT = BASE_DIR
|
||||
@@ -75,7 +77,7 @@ def _extract_tag_names(emitted: Sequence[Any]) -> List[str]:
|
||||
tags.append(val)
|
||||
continue
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Error extracting tag_name in _extract_tag_names")
|
||||
|
||||
if isinstance(obj, dict):
|
||||
# Prefer explicit tag lists
|
||||
@@ -107,7 +109,7 @@ def _extract_tag_names_from_table(table: Any) -> List[str]:
|
||||
if payloads:
|
||||
sources.extend(payloads)
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Error while calling table.get_payloads")
|
||||
rows = getattr(table, "rows", []) or []
|
||||
for row in rows:
|
||||
for col in getattr(row, "columns", []) or []:
|
||||
@@ -289,7 +291,7 @@ class TagEditorPopup(ModalScreen[None]):
|
||||
try:
|
||||
app.call_from_thread(app._append_log_line, msg)
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to append log line from background thread")
|
||||
|
||||
def _log_pipeline_command(stage: str, cmd: str) -> None:
|
||||
if not cmd:
|
||||
@@ -377,7 +379,7 @@ class TagEditorPopup(ModalScreen[None]):
|
||||
self._seeds,
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to refresh tag overlay")
|
||||
|
||||
try:
|
||||
app.call_from_thread(_refresh_overlay)
|
||||
@@ -513,7 +515,7 @@ class PipelineHubApp(App):
|
||||
config = load_config()
|
||||
SharedArgs._refresh_store_choices_cache(config)
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to refresh store choices cache")
|
||||
|
||||
self._populate_store_options()
|
||||
self._load_cmdlet_names()
|
||||
@@ -535,7 +537,7 @@ class PipelineHubApp(App):
|
||||
store_display = ", ".join(stores[:10]) + ("..." if len(stores) > 10 else "")
|
||||
self._append_log_line(f"Startup config: providers={len(provs)} ({prov_display or '(none)'}), stores={len(stores)} ({store_display or '(none)'}), db={db.db_path.name}")
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to produce startup config summary")
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Actions
|
||||
@@ -699,7 +701,7 @@ class PipelineHubApp(App):
|
||||
first = options[0]
|
||||
return str(getattr(first, "prompt", "") or "")
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Error retrieving first suggestion from suggestion list")
|
||||
return ""
|
||||
|
||||
def _populate_store_options(self) -> None:
|
||||
@@ -715,6 +717,7 @@ class PipelineHubApp(App):
|
||||
try:
|
||||
stores = StoreRegistry(config=cfg, suppress_debug=True).list_backends()
|
||||
except Exception:
|
||||
logger.exception("Failed to list store backends from StoreRegistry")
|
||||
stores = []
|
||||
|
||||
# Always offer a reasonable default even if config is missing.
|
||||
@@ -730,7 +733,7 @@ class PipelineHubApp(App):
|
||||
if (current is None) or (current == "") or (current is Select.BLANK):
|
||||
self.store_select.value = options[0][1]
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to set store select options")
|
||||
|
||||
def _get_selected_store(self) -> Optional[str]:
|
||||
if not self.store_select:
|
||||
@@ -969,7 +972,7 @@ class PipelineHubApp(App):
|
||||
subject=payload_subject,
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to emit tags as table")
|
||||
|
||||
def _load_cmdlet_names(self, force: bool = False) -> None:
|
||||
try:
|
||||
@@ -981,6 +984,7 @@ class PipelineHubApp(App):
|
||||
for n in names if str(n).strip()}
|
||||
)
|
||||
except Exception:
|
||||
logger.exception("Failed to load cmdlet names")
|
||||
self._cmdlet_names = []
|
||||
|
||||
def _update_syntax_status(self, text: str) -> None:
|
||||
@@ -1023,7 +1027,7 @@ class PipelineHubApp(App):
|
||||
# Fallback for older/newer Textual APIs.
|
||||
self.suggestion_list.options = [] # type: ignore[attr-defined]
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to clear suggestion list options via fallback")
|
||||
|
||||
try:
|
||||
self.suggestion_list.add_options(
|
||||
@@ -1035,7 +1039,7 @@ class PipelineHubApp(App):
|
||||
Option(m) for m in matches
|
||||
] # type: ignore[attr-defined]
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to set suggestion list options via fallback")
|
||||
|
||||
self.suggestion_list.display = True
|
||||
|
||||
@@ -1173,12 +1177,12 @@ class PipelineHubApp(App):
|
||||
if store_name and not str(seeds.get("store") or "").strip():
|
||||
seeds["store"] = store_name
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to set seed store value")
|
||||
try:
|
||||
if file_hash and not str(seeds.get("hash") or "").strip():
|
||||
seeds["hash"] = file_hash
|
||||
except Exception:
|
||||
pass
|
||||
logger.exception("Failed to set seed hash value")
|
||||
|
||||
self.push_screen(
|
||||
TagEditorPopup(seeds=seeds,
|
||||
|
||||
Reference in New Issue
Block a user