gnah.. i don't know yet if I hate or like that language

This commit is contained in:
Florian Streibelt 2011-10-19 00:22:14 +02:00
parent dd49d650fb
commit 4af7594490
2 changed files with 7 additions and 8 deletions

View File

@ -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

View File

@ -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