From 4af75944909b85c834c17910af409c53df0788b5 Mon Sep 17 00:00:00 2001 From: Florian Streibelt Date: Wed, 19 Oct 2011 00:22:14 +0200 Subject: [PATCH] gnah.. i don't know yet if I hate or like that language --- client-barcode/display.py | 8 +++----- client-barcode/freitagskasse.py | 7 ++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client-barcode/display.py b/client-barcode/display.py index d9ac0a7..b220bf6 100644 --- a/client-barcode/display.py +++ b/client-barcode/display.py @@ -21,7 +21,6 @@ class Display(threading.Thread): def __del__(self): if (not self.screensaver == None): - self.screensaver.terminate() self.screensaver = None if (not self.serialport == None): @@ -79,17 +78,15 @@ class Display(threading.Thread): #print "Starting Display thread" self.screensaver.start() while(self.runme): - #print("display thread loop\n") + print("display thread loop\n") self.mutex_get() #print("display got mutex and handles scroll\n") self.offset_line1 = self.display_handle_scroll(1,self.scroll_line1,self.offset_line1) self.offset_line2 = self.display_handle_scroll(2,self.scroll_line2,self.offset_line2) self.mutex_release() time.sleep(.5) - #print "Exiting Display thread" + print "Exiting Display thread" - def terminate(self): - self.runme = False @@ -223,6 +220,7 @@ class Display(threading.Thread): self.portlock.release() def terminate(self): + self.runme=False if (not self.screensaver == None): self.screensaver.terminate() self.screensaver = None diff --git a/client-barcode/freitagskasse.py b/client-barcode/freitagskasse.py index 80dc12d..b71bd47 100644 --- a/client-barcode/freitagskasse.py +++ b/client-barcode/freitagskasse.py @@ -239,7 +239,7 @@ class Status: try: command.run(self.login_name) except urllib2.HTTPError as e: - myDisplay.write('\x0cFEHLER: Server Error%20s' % str(e)[:20]) + myDisplay.display_screen("Server error",'Server Error: %s' % str(e)) error_page('FEHLER bei Kommunikation mit Server "%s"' % str(e)) break else: @@ -371,6 +371,7 @@ def handle(line, status): if line == 'exit': clear() myDisplay.write("\x0c") + myDisplay.terminate() sys.exit(0) if status.logged_in(): @@ -448,7 +449,7 @@ if __name__ == '__main__': try: main() except KeyboardInterrupt: - pass - myDisplay.write("\x1b\x40Goodbye!") myDisplay.terminate() + myDisplay.write("\x1b\x40Goodbye!") + pass