not all screens yet on the display. scroll text would be nice...
This commit is contained in:
parent
ed8659964c
commit
f9550712d8
|
@ -92,7 +92,6 @@ def delay(what, seconds):
|
||||||
|
|
||||||
def warn_balance():
|
def warn_balance():
|
||||||
print('Kontostand im Minus, bitte Geld aufladen.')
|
print('Kontostand im Minus, bitte Geld aufladen.')
|
||||||
print_display('\e\x0cKontostand im Minus,bitte Geld aufladen.')
|
|
||||||
|
|
||||||
|
|
||||||
def error_page(error_message, hint_message=None):
|
def error_page(error_message, hint_message=None):
|
||||||
|
@ -141,7 +140,7 @@ class Status:
|
||||||
if self.logged_in():
|
if self.logged_in():
|
||||||
print('Eingeloggt als: %s%s%s' % (COLOR_SOME, self.login_name, COLOR_RESET))
|
print('Eingeloggt als: %s%s%s' % (COLOR_SOME, self.login_name, COLOR_RESET))
|
||||||
print()
|
print()
|
||||||
print_display('\e\x0cBenutzer: %10s' %self.login_name[:10])
|
print_display('\x0cHallo %-14s' % (self.login_name[:13]+"!") )
|
||||||
if self.transfers:
|
if self.transfers:
|
||||||
initial_command, initial_balance = self.transfers[0]
|
initial_command, initial_balance = self.transfers[0]
|
||||||
|
|
||||||
|
@ -160,6 +159,11 @@ class Status:
|
||||||
show_item(i, command.difference(), command.label(), COLOR_DEPOSIT)
|
show_item(i, command.difference(), command.label(), COLOR_DEPOSIT)
|
||||||
i += 1
|
i += 1
|
||||||
show_bar()
|
show_bar()
|
||||||
|
|
||||||
|
if isinstance(command, BuyCommand):
|
||||||
|
print_display('\x0b%-15s %4.2f' % (command.commodity_label()[:15],abs(command.difference())));
|
||||||
|
print_display('\x0b\nSUMME: %2i %10.2f' % (i-1,initial_balance - self.balance));
|
||||||
|
|
||||||
if len(self.transfers) > 1:
|
if len(self.transfers) > 1:
|
||||||
show_total(self.balance - initial_balance, plus='+')
|
show_total(self.balance - initial_balance, plus='+')
|
||||||
show_bar()
|
show_bar()
|
||||||
|
@ -167,6 +171,7 @@ class Status:
|
||||||
|
|
||||||
if self.balance < 0:
|
if self.balance < 0:
|
||||||
warn_balance()
|
warn_balance()
|
||||||
|
print_display('\x0b\nKonto: %5.2f!' % (self.balance) )
|
||||||
print()
|
print()
|
||||||
|
|
||||||
print(COLOR_SOME + 'Committen nicht vergessen.' + COLOR_RESET)
|
print(COLOR_SOME + 'Committen nicht vergessen.' + COLOR_RESET)
|
||||||
|
@ -346,10 +351,10 @@ def handle(line, status):
|
||||||
item = status.find(line)
|
item = status.find(line)
|
||||||
except urllib2.HTTPError as e:
|
except urllib2.HTTPError as e:
|
||||||
if e.code == 404: # URL not found == item not found with REST
|
if e.code == 404: # URL not found == item not found with REST
|
||||||
print_display('\e\x0cFEHLER:\nAktion/ware unbekannt')
|
print_display('\x0cERROR:\nCode ist unbekannt!')
|
||||||
error_page('FEHLER: Aktion oder Ware "%s" nicht bekannt' % line)
|
error_page('FEHLER: Aktion oder Ware "%s" nicht bekannt' % line)
|
||||||
else:
|
else:
|
||||||
print_display('\e\x0cFEHLER: Server Error%20s' % str(e)[:20])
|
print_display('\x0cERROR: Server Error%20s' % str(e)[:20])
|
||||||
error_page('FEHLER bei Kommunikation mit Server "%s"' % str(e))
|
error_page('FEHLER bei Kommunikation mit Server "%s"' % str(e))
|
||||||
else:
|
else:
|
||||||
status.buy(item)
|
status.buy(item)
|
||||||
|
|
Loading…
Reference in New Issue