Author: dmeyer
Date: Fri Mar 16 15:39:18 2007
New Revision: 9334

Modified:
   trunk/ui/src/gui/areas/tvlisting_area.py
   trunk/ui/src/tv/plugins/guide.py

Log:
fix crash when kaa.epg is connecting

Modified: trunk/ui/src/gui/areas/tvlisting_area.py
==============================================================================
--- trunk/ui/src/gui/areas/tvlisting_area.py    (original)
+++ trunk/ui/src/gui/areas/tvlisting_area.py    Fri Mar 16 15:39:18 2007
@@ -47,6 +47,7 @@
 
 # kaa imports
 import kaa.epg
+import kaa.notifier
 
 # freevo core imports
 import freevo.ipc
@@ -86,12 +87,6 @@
         self.last_start_time = 0
         self.last_channels = None
 
-        # TODO: it is ugly keeping a list of channels everywhere
-        #       it may be best to handle this in the guide object or
-        #       in the freevo epg module (there we can use config items
-        #       to determine sort order.
-        self.channels = kaa.epg.get_channels(sort=True)
-
         # objects on the area
         self.chan_obj   = []
         self.time_obj   = []
@@ -276,9 +271,11 @@
         n_cols   = 4
         col_time = 30
 
-        if not self.channels:
-            # FIXME: why?
-            self.channels = kaa.epg.get_channels(sort=True)
+        self.channels = kaa.epg.get_channels(sort=True)
+        if isinstance(self.channels, kaa.notifier.InProgress):
+            while not self.channels.is_finished:
+                kaa.notifier.step()
+            self.channels = self.channels()
             
         if self.last_settings == self.settings:
             # same layout, only clean 'objects'

Modified: trunk/ui/src/tv/plugins/guide.py
==============================================================================
--- trunk/ui/src/tv/plugins/guide.py    (original)
+++ trunk/ui/src/tv/plugins/guide.py    Fri Mar 16 15:39:18 2007
@@ -79,6 +79,11 @@
         
         # current channel is the first one
         self.channels = kaa.epg.get_channels(sort=True)
+        # FIXME: make it work without step()
+        if isinstance(self.channels, kaa.notifier.InProgress):
+            while not self.channels.is_finished:
+                kaa.notifier.step()
+            self.channels = self.channels()
         self.channel  = self.get_channel()
 
         # current program is the current running

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to