From fb80a1a70d6d186fd1e186c5dd6720d935eeac56 Mon Sep 17 00:00:00 2001 From: Florian Streibelt Date: Wed, 19 Oct 2011 01:45:57 +0200 Subject: [PATCH] now starts without display too --- client-barcode/display.py | 5 +---- client-barcode/freitagskasse.py | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client-barcode/display.py b/client-barcode/display.py index 42422d7..509cd6a 100644 --- a/client-barcode/display.py +++ b/client-barcode/display.py @@ -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. diff --git a/client-barcode/freitagskasse.py b/client-barcode/freitagskasse.py index 1c6159b..e3d2387 100644 --- a/client-barcode/freitagskasse.py +++ b/client-barcode/freitagskasse.py @@ -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()