Author: dmeyer
Date: Tue Mar 21 15:56:39 2006
New Revision: 8121

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

Log:
let kaa.epg sort channels

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    Tue Mar 21 15:56:39 2006
@@ -45,9 +45,11 @@
 import time
 import config
 
+# kaa imports
+import kaa.epg
+
 # freevo core imports
 import freevo.ipc
-from freevo.ipc.epg import cmp_channel
 
 from area import Area
 from gui.widgets import Rectangle
@@ -76,8 +78,6 @@
     """
 
     def __init__(self):
-        # get tvserver interface
-        tvserver = freevo.ipc.Instance('freevo').tvserver
 
         Area.__init__(self, 'listing')
         self.last_choices = ( None, None )
@@ -90,10 +90,7 @@
         #       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 = tvserver.epg.get_channels()
-        self.channels.sort(lambda a, b: cmp(a.name, b.name))
-        self.channels.sort(lambda a, b: cmp_channel(a, b))
-
+        self.channels = kaa.epg.get_channels(sort=True)
 
         # objects on the area
         self.chan_obj   = []
@@ -407,8 +404,8 @@
         for channel in channel_list:
             try:
                 #for prg in channel[start_time:stop_time]:
-                for prg in tvserver.epg.search(channel=channel, 
-                                               time=(start_time, stop_time)):
+                for prg in kaa.epg.search(channel=channel, 
+                                          time=(start_time, stop_time)):
                     flag_left   = 0
                     flag_right  = 0
 

Modified: trunk/ui/src/tv/tvguide.py
==============================================================================
--- trunk/ui/src/tv/tvguide.py  (original)
+++ trunk/ui/src/tv/tvguide.py  Tue Mar 21 15:56:39 2006
@@ -39,7 +39,6 @@
 
 # freevo core imports
 import freevo.ipc
-from freevo.ipc.epg import cmp_channel
 
 # freevo imports
 import gui
@@ -78,10 +77,7 @@
 
     def get_channel(self, offset=0):
         co = self.channel_index + offset
-        channels = kaa.epg.get_channels()
-
-        channels.sort(lambda a, b: cmp(a.name, b.name))
-        channels.sort(lambda a, b: cmp_channel(a, b))
+        channels = kaa.epg.get_channels(sort=True)
 
         if co < 0:
             co = len(channels)+co


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