diff --git a/gui/v2/infrastructure/setup_observers.py b/gui/v2/infrastructure/setup_observers.py index 41ab3d8..be58587 100755 --- a/gui/v2/infrastructure/setup_observers.py +++ b/gui/v2/infrastructure/setup_observers.py @@ -4,7 +4,7 @@ from core.observers.ConnectionObserver import ConnectionObserver from core.observers.InvoiceObserver import InvoiceObserver from core.observers.ProfileObserver import ProfileObserver from core.observers.TicketObserver import TicketObserver -from core.controllers.ApplicationController import ApplicationController +# from core.controllers.ApplicationController import ApplicationController from essentials.models.Event import Event 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"}')) 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( - 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( - 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( f'[{event.subject.get("attempt_count")}/{event.subject.get("maximum_number_of_attempts")}] Performing connection attempt...'))