forked from Support/sp-hydra-veil-gui
Removed duplicate presenters folder
This commit is contained in:
parent
8d08d71a48
commit
332a84f187
3 changed files with 6 additions and 35 deletions
Binary file not shown.
|
|
@ -1,35 +0,0 @@
|
|||
def interpret_key_results(result: dict) -> str:
|
||||
if not isinstance(result, dict):
|
||||
return "There was an error with the format of the reply from the operation."
|
||||
|
||||
# unpack results:
|
||||
valid = result.get('valid', False)
|
||||
comparison = result.get('comparison', 'error')
|
||||
error_msg = result.get('message', None)
|
||||
|
||||
# errors:
|
||||
if error_msg:
|
||||
if error_msg == "api_connection_issue":
|
||||
return "There was a connection error with connecting to the API."
|
||||
elif error_msg == "invalid_key":
|
||||
return "Your original public key is in an invalid format to begin with."
|
||||
else:
|
||||
return "Unknown Error."
|
||||
|
||||
# comparison:
|
||||
if comparison == "same":
|
||||
first_sentence = "The key you had locally matched what the server had also."
|
||||
elif comparison == "different":
|
||||
first_sentence = "Your local key was different than the server's key."
|
||||
else:
|
||||
first_sentence = "There was an error with the comparison."
|
||||
|
||||
# validity:
|
||||
if valid:
|
||||
second_sentence = "The signature now matches with the new key."
|
||||
else:
|
||||
second_sentence = "But the signature still does not match, even with the new key. If you prepare tickets anyway, they might not verify when used."
|
||||
|
||||
# final return
|
||||
final_msg = first_sentence + " " + second_sentence
|
||||
return final_msg
|
||||
|
|
@ -36,6 +36,9 @@ def setup_observers(update_status):
|
|||
client_observer.subscribe('updated', lambda event: update_status(
|
||||
'Restart client to apply update.'))
|
||||
|
||||
client_observer.subscribe(
|
||||
'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}'))
|
||||
application_version_observer.subscribe('download_progressing', lambda event: update_status(
|
||||
|
|
@ -60,6 +63,9 @@ def setup_observers(update_status):
|
|||
connection_observer.subscribe(
|
||||
'tor_bootstrapped', lambda event: update_status('Tor connection established.'))
|
||||
|
||||
client_observer.subscribe(
|
||||
'custom_message', lambda event: update_status(f'{event.subject if event.subject else ""}'))
|
||||
|
||||
ticket_observer.subscribe('connecting', lambda event: update_status('Connecting to ticket server...'))
|
||||
ticket_observer.subscribe('sync_done', lambda event: update_status('Ticket prices synced.'))
|
||||
ticket_observer.subscribe('waiting', lambda event: update_status('Waiting for payment...'))
|
||||
|
|
|
|||
Loading…
Reference in a new issue