Show hint on Plugin permissions if user unknown
This commit is contained in:
parent
9a0206da97
commit
255c08d6c3
|
@ -19,6 +19,7 @@ import time
|
|||
import urllib2
|
||||
|
||||
|
||||
COLOR_HINT = Fore.YELLOW + Style.BRIGHT
|
||||
COLOR_ERROR = Fore.RED
|
||||
COLOR_DEPOSIT = Fore.GREEN + Style.BRIGHT
|
||||
COLOR_TO_GO = Fore.MAGENTA + Style.BRIGHT
|
||||
|
@ -72,11 +73,16 @@ def warn_balance():
|
|||
print('Kontostand im Minus, bitte Geld aufladen.')
|
||||
|
||||
|
||||
def error_page(message):
|
||||
def error_page(error_message, hint_message=None):
|
||||
clear()
|
||||
print(COLOR_ERROR + message + COLOR_RESET)
|
||||
print(COLOR_ERROR + error_message + COLOR_RESET)
|
||||
print()
|
||||
delay('Weiter', 3)
|
||||
delay_seconds = 3
|
||||
if hint_message is not None:
|
||||
print(COLOR_HINT + hint_message + COLOR_RESET)
|
||||
print()
|
||||
delay_seconds += 3
|
||||
delay('Weiter', delay_seconds)
|
||||
|
||||
|
||||
class Status:
|
||||
|
@ -324,7 +330,10 @@ def handle(line, status):
|
|||
status.login(line)
|
||||
except urllib2.HTTPError as e:
|
||||
if e.code == 404: # URL not found == user unknown
|
||||
error_page('FEHLER: Benutzer "%s" nicht bekannt' % line)
|
||||
error_page('FEHLER: Benutzer "%s" nicht bekannt' % line,
|
||||
hint_message='Ist in der WebApp unter "Einstellungen" ' \
|
||||
'für Ihren Account Plugin "BarcodePlugin" ' \
|
||||
'als erlaubt markiert?')
|
||||
else:
|
||||
error_page('FEHLER bei Kommunikation mit Server "%s"' % str(e))
|
||||
except urllib2.URLError as e:
|
||||
|
|
Loading…
Reference in New Issue