Author: dmeyer
Date: Sat Feb 25 21:13:48 2006
New Revision: 7944

Modified:
   trunk/dbox/src/ui/dbox.py

Log:
more bugfixes, still ugly

Modified: trunk/dbox/src/ui/dbox.py
==============================================================================
--- trunk/dbox/src/ui/dbox.py   (original)
+++ trunk/dbox/src/ui/dbox.py   Sat Feb 25 21:13:48 2006
@@ -18,6 +18,7 @@
         self.info = None
         self.item = None
         self.connected = False
+        self.stopped = False
         EventHandler(self.eventhandler).register()
         Timer(self.status).start(0.1)
         kaa.notifier.signals['shutdown'].connect(self.shutdown)
@@ -26,6 +27,8 @@
 
     @kaa.notifier.execute_in_thread('dbox')
     def check_startup(self, delayed=False):
+        if self.stopped:
+            return False
         try:
             if delayed:
                 self._send()
@@ -61,16 +64,26 @@
         t = time.strftime('%H:%M', time.localtime())
 
         if (name, info1, info2, pos, t) == self.info:
-            return
+            return True
+
+        self.info = name, info1, info2, pos, t
+
         self.update(name, info1, info2, pos, t)
 
 
     @kaa.notifier.execute_in_thread('dbox')
     def update(self, name, info1, info2, pos, t):
         if not self.connected:
+            print 'update without connection'
             return
+        
         try:
-            self.info = name, info1, info2, pos, t
+            if type(name) == unicode:
+                name = name.encode('utf-8')
+            if type(info1) == unicode:
+                info1 = info1.encode('utf-8')
+            if type(info2) == unicode:
+                info2 = info2.encode('utf-8')
             self._send(clear=1, rect='0,50,75,60,1,0', font=1, size=13,
                        text=name, xpos=1, ypos=12)
             if info1:
@@ -80,8 +93,8 @@
 
             self._send(rect='2,52,%s,58,1,1' % pos, text=t, font=1, size=14,
                        xpos=80, ypos=62, update=1)
-        except:
-            print 'lost dbox, trying to reconnect'
+        except Exception, e:
+            print 'lost dbox, trying to reconnect', e
             self.connected = False
             kaa.notifier.OneShotTimer(self.check_startup, True).start(1)
             
@@ -100,5 +113,8 @@
 
         
     def shutdown(self):
+        print 'stop all'
         if self.connected:
             self._send(lock=0)
+        self.stopped = True
+        print 'done'


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to