from core.models.Result import Result, ResultError from core.controllers.SyncController import new_sync def external_logic_handler(navigator, user_action): if user_action == "go_to_settings": # Use the signal to request navigation navigator.request_navigation.emit("settings") def test() -> Result: print("test") return Result(valid=True) ENUM_MAP = { ResultError.UNKNOWN: (test), ResultError.NEED_SYNC: (new_sync), ResultError.INVALID_API_REPLY: None, ResultError.ENCRYPTION: None, # ResultError.NO_TICKETS: (start_billing), # ResultError.NO_PROFILE: (go_to_new_profile_page), # ResultError.ALREADY_EXISTS: (get_invoice), # bypass_existing: True # ResultError.BILLING_CODE_EXISTS: (get_invoice) # bypass_existing: True } AUTO_NAVIGATE_REGISTRY = { ResultError.WRONG_LOCATION: "edit_profile" }