GUI's observers now do strings to be more neutral to what object type is being downloaded (application_version objects vs dependency)

This commit is contained in:
SimplifiedPrivacy 2026-08-12 14:18:48 -04:00
parent 184728a948
commit b023b9faf7

View file

@ -4,7 +4,7 @@ from core.observers.ConnectionObserver import ConnectionObserver
from core.observers.InvoiceObserver import InvoiceObserver from core.observers.InvoiceObserver import InvoiceObserver
from core.observers.ProfileObserver import ProfileObserver from core.observers.ProfileObserver import ProfileObserver
from core.observers.TicketObserver import TicketObserver from core.observers.TicketObserver import TicketObserver
from core.controllers.ApplicationController import ApplicationController # from core.controllers.ApplicationController import ApplicationController
from essentials.models.Event import Event from essentials.models.Event import Event
application_version_observer = ApplicationVersionObserver() application_version_observer = ApplicationVersionObserver()
@ -41,12 +41,21 @@ def setup_observers(update_status):
'custom_message', lambda event: update_status(f'{event.subject if event.subject else "Error, check logs"}')) 'custom_message', lambda event: update_status(f'{event.subject if event.subject else "Error, check logs"}'))
application_version_observer.subscribe('downloading', lambda event: update_status( application_version_observer.subscribe('downloading', lambda event: update_status(
f'Downloading {ApplicationController.get(event.subject.application_code).name}')) f'{event.subject if event.subject else "Downloading.."}'))
application_version_observer.subscribe('download_progressing', lambda event: update_status( application_version_observer.subscribe('download_progressing', lambda event: update_status(
f'Downloading {ApplicationController.get(event.subject.application_code).name} {event.meta.get('progress'):.2f}%')) f'{event.subject if event.subject else "Downloading.."}'))
application_version_observer.subscribe('downloaded', lambda event: update_status( application_version_observer.subscribe('downloaded', lambda event: update_status(
f'Downloaded {ApplicationController.get(event.subject.application_code).name}')) f'{event.subject if event.subject else "Downloaded"}'))
# application_version_observer.subscribe('downloading', lambda event: update_status(
# f'Downloading {ApplicationController.get(event.subject.application_code).name}'))
# application_version_observer.subscribe('download_progressing', lambda event: update_status(
# f'Downloading {ApplicationController.get(event.subject.application_code).name} {event.meta.get('progress'):.2f}%'))
# application_version_observer.subscribe('downloaded', lambda event: update_status(
# f'Downloaded {ApplicationController.get(event.subject.application_code).name}'))
connection_observer.subscribe('connecting', lambda event: update_status( connection_observer.subscribe('connecting', lambda event: update_status(
f'[{event.subject.get("attempt_count")}/{event.subject.get("maximum_number_of_attempts")}] Performing connection attempt...')) f'[{event.subject.get("attempt_count")}/{event.subject.get("maximum_number_of_attempts")}] Performing connection attempt...'))