now starts without display too

This commit is contained in:
Florian Streibelt 2011-10-19 01:45:57 +02:00
parent 8fd3a73d0a
commit fb80a1a70d
2 changed files with 3 additions and 4 deletions

View File

@ -28,11 +28,10 @@ class Display(threading.Thread):
self.serialport=None
def open_port(self):
self.mutex_get()
try:
self.serialport = serial.Serial(self.portname,9600,timeout=2,rtscts=True, dsrdtr=True)
#print ("Initializing display on port:\n %s\n" % self.serialport )
self.mutex_get()
self.cmd_reset()
self.mutex_release()
except Exception as e:
@ -40,8 +39,6 @@ class Display(threading.Thread):
#print ("Ignoring and trying to open it again later\n")
#print (e)
self.serialport = None
self.mutex_release()
pass
#Helper-Function, scrolls text in a specific line.

View File

@ -121,9 +121,11 @@ def item_info_page(item):
print('und kostet')
print()
if item.deposit > 0:
myDisplay.display_screen("PREISINFO","%s: %4.2f Euro (%4.2f Euro Pfand)" % (item.name,item.price,item.deposit))
print(indent + '%s%4.2f Euro%s (plus %4.2f Euro Pfand) .' \
% (COLOR_MUCH, item.price, COLOR_RESET, item.deposit))
else:
myDisplay.display_screen("PREISINFO","%s: %4.2f Euro" % (item.name,item.price))
print(indent + '%s%4.2f Euro%s .' \
% (COLOR_MUCH, item.price, COLOR_RESET))
print()