fix: silent pipeline log and server indexing progress
Three issues caused the Logs view to appear blank during a real pipeline run: 1. `from run import step_fetch, step_link` was outside the worker's try/except/finally. An import failure silently killed the thread, leaving _pipeline_done uncalled and the Run button stuck disabled forever. Now wrapped in its own try/except that posts the error to the log and resets the UI. 2. `build_server_index` makes N sequential HTTP requests (one per mod folder's meta.cpp) with no output during the scan. Added an optional `progress_fn(current, total, name)` callback; step_fetch wires it to print progress every 25 folders so the log never goes silent. 3. No immediate feedback after clicking Start — the log was blank until the worker thread started printing. Now posts a "Pipeline started" banner from the main thread before the worker launches.
This commit is contained in:
13
gui/app.py
13
gui/app.py
@@ -143,11 +143,22 @@ class ArmaModManagerApp(ctk.CTk):
|
||||
self._pipeline_running = True
|
||||
self._get_dashboard().set_pipeline_ui(running=True)
|
||||
self.navigate_to("Logs")
|
||||
# Post an immediate banner so the log is never blank after clicking Start.
|
||||
_sep = "=" * 50
|
||||
self.post_log(f"\n{_sep}\n {t('pipeline.starting')}\n{_sep}\n\n")
|
||||
|
||||
def worker() -> None:
|
||||
# run.py calls fix_console_encoding() at import time, which needs
|
||||
# the real sys.stdout.buffer. Import it before we redirect stdout.
|
||||
from run import step_fetch, step_link
|
||||
try:
|
||||
from run import step_fetch, step_link
|
||||
except Exception as _import_err:
|
||||
self.after(0, lambda: self.post_log(
|
||||
f"\n✗ Failed to load pipeline: {_import_err}\n"
|
||||
))
|
||||
self.after(0, self._pipeline_done)
|
||||
return
|
||||
|
||||
self._redirect_output()
|
||||
try:
|
||||
from arma_modlist_tools.parser import parse_modlist_html
|
||||
|
||||
Reference in New Issue
Block a user