Author: dmeyer
Date: Tue Mar 21 14:06:40 2006
New Revision: 8118
Modified:
trunk/ui/src/gui/areas/tvlisting_area.py
trunk/ui/src/tv/program.py
trunk/ui/src/tv/tvguide.py
Log:
Start updating to new epg server in tvserver.
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 14:06:40 2006
@@ -47,7 +47,7 @@
# freevo core imports
import freevo.ipc
-from freevo.ipc.epg import connect as guide, cmp_channel
+from freevo.ipc.epg import cmp_channel
from area import Area
from gui.widgets import Rectangle
@@ -76,6 +76,9 @@
"""
def __init__(self):
+ # get tvserver interface
+ tvserver = freevo.ipc.Instance('freevo').tvserver
+
Area.__init__(self, 'listing')
self.last_choices = ( None, None )
self.last_settings = None
@@ -87,7 +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 = guide().get_channels()
+ 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))
@@ -404,8 +407,8 @@
for channel in channel_list:
try:
#for prg in channel[start_time:stop_time]:
- for prg in guide().search(channel=channel,
- time=(start_time, stop_time)):
+ for prg in tvserver.epg.search(channel=channel,
+ time=(start_time, stop_time)):
flag_left = 0
flag_right = 0
Modified: trunk/ui/src/tv/program.py
==============================================================================
--- trunk/ui/src/tv/program.py (original)
+++ trunk/ui/src/tv/program.py Tue Mar 21 14:06:40 2006
@@ -39,7 +39,6 @@
# freevo core imports
import freevo.ipc
-from freevo.ipc.epg import connect as guide
# freevo imports
import config
@@ -201,7 +200,7 @@
def channel_details(self):
items = []
- for prog in guide().search(channel=self.channel):
+ for prog in kaa.epg.search(channel=self.channel):
items.append(ProgramItem(prog, self))
cmenu = Menu(self.channel.name, items, item_types = 'tv program menu')
# FIXME: the percent values need to be calculated
Modified: trunk/ui/src/tv/tvguide.py
==============================================================================
--- trunk/ui/src/tv/tvguide.py (original)
+++ trunk/ui/src/tv/tvguide.py Tue Mar 21 14:06:40 2006
@@ -35,10 +35,13 @@
import time
import logging
-from kaa.epg.program import Program as EPGProgram
+import kaa.epg
+
+# freevo core imports
+import freevo.ipc
+from freevo.ipc.epg import cmp_channel
# freevo imports
-from freevo.ipc.epg import connect as guide, cmp_channel
import gui
import gui.areas
@@ -52,7 +55,6 @@
_guide = None
-
def get_singleton():
"""
return the global tv guide
@@ -76,10 +78,8 @@
def get_channel(self, offset=0):
co = self.channel_index + offset
- channels = guide().get_channels()
+ channels = kaa.epg.get_channels()
- # idea: make a guide().sort_channels() or something internal to the
guide
- # so we get sorted channels when guide loads its data
channels.sort(lambda a, b: cmp(a.name, b.name))
channels.sort(lambda a, b: cmp_channel(a, b))
@@ -101,27 +101,27 @@
time = self.current_time
log.debug('channel: %s', self.channel)
- p = guide().search(channel=self.channel, time=time)
+ p = kaa.epg.search(channel=self.channel, time=time)
if p:
# one program found, return it
return p[0]
# Now we are in trouble, there is no program item. We need to create a
fake
# one between the last stop and the next start time. This is very
slow!!!
- p = guide().search(channel=self.channel, time=(0, time))
+ p = kaa.epg.search(channel=self.channel, time=(0, time))
p.sort(lambda x,y: cmp(x.start, y.start))
if p:
start = p[-1].stop
else:
start = 0
- p = guide().search(channel=self.channel, time=(time, sys.maxint))
+ p = kaa.epg.search(channel=self.channel, time=(time, sys.maxint))
p.sort(lambda x,y: cmp(x.start, y.start))
if p:
stop = p[0].start
else:
stop = sys.maxint
- prg = EPGProgram(self.channel, start, stop, _('No Program'), '')
+ prg = kaa.epg.Program(self.channel, start, stop, _('No Program'), '')
prg.db_id = -1
return prg
-------------------------------------------------------
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