Update of /cvsroot/freevo/freevo/src/config
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7306/src/config
Modified Files:
channels.py
Log Message:
Add get_uri() and player() which are also added to channel objects. There
may be a better way to hook these in but this works well.
Index: channels.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/config/channels.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** channels.py 10 Dec 2004 19:56:21 -0000 1.6
--- channels.py 13 Dec 2004 01:39:02 -0000 1.7
***************
*** 38,41 ****
--- 38,42 ----
import sysconfig
import config
+ import plugin
log = logging.getLogger('config')
***************
*** 75,78 ****
--- 76,103 ----
+ def get_uri(channel, card):
+ """
+ Return something to access this channel with based on a particular
+ card.
+ """
+ for u in channel.uri:
+ device, uri = u.split(':')
+ if device == card:
+ return uri
+
+ # If all else fails.
+ return channel.access_id
+
+
+ def player(channel):
+ for u in channel.uri:
+ device, uri = u.split(':')
+ # try all internal URIs
+ for p in plugin.getbyname(plugin.TV, True):
+ # FIXME: better handling for rate == 1 or 2
+ if p.rate(channel, device, uri):
+ return p, device, uri
+ return None
+
def refresh():
***************
*** 84,87 ****
--- 109,114 ----
for c in pyepg.channels:
c.uri = []
+ c.get_uri = get_uri
+ c.player = player
if isinstance(c.access_id, (list, tuple)):
for a_id in c.access_id:
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog