Update of /cvsroot/freevo/freevo/src/config
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20248/config

Modified Files:
        channels.py 
Log Message:
start extract channellist to be independed

Index: channels.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/config/channels.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** channels.py 5 Dec 2004 13:01:10 -0000       1.2
--- channels.py 5 Dec 2004 17:10:06 -0000       1.3
***************
*** 40,50 ****
  log = logging.getLogger('config')
  
  
  def refresh():
      log.info('Detecting TV channels.')
  
!     config.TV_CHANNELLIST = ChannelList()
      log.debug('got %d channels' % len(config.TV_CHANNELLIST.channel_list))
  
      # add all possible channels to the cards
      for card in config.TV_CARDS:
--- 40,92 ----
  log = logging.getLogger('config')
  
+ def add_uri(channel, uri):
+     """
+     Add a URI to the internal list where to find that channel.
+     Also save the access_id because many people, mostly North Americans,
+     like to use it (usually in the display).
+     """
+     if uri.find(':') == -1:
+         channel.access_id = uri
+         defaults = []
+         if isinstance(config.TV_DEFAULT_DEVICE, list) or \
+            isinstance(config.TV_DEFAULT_DEVICE, tuple):
+             for s in config.TV_DEFAULT_DEVICE:
+                 defaults.append(s)
+         else:
+             defaults.append(config.TV_DEFAULT_DEVICE)
+ 
+         for which in defaults:
+             try:
+                 int(which[-1:])
+             except ValueError: 
+                 # This means that TV_DEFAULT_DEVICE does NOT end with
+                 # a number (it is dvb/tv/ivtv) so we add this channel
+                 # to all matching TV_CARDS.
+                 for s in config.TV_CARDS:
+                     if s.find(which) == 0:
+                         add_uri(channel, '%s:%s' % (s, uri))
+                 return
+ 
+             channel.uri.append('%s:%s' % (which, uri))
+     else:
+         channel.access_id = uri.split(':')[1]
+         channel.uri.append(uri)
+ 
+ 
  
  def refresh():
      log.info('Detecting TV channels.')
  
!     config.TV_CHANNELLIST = ChannelList(config.TV_CHANNELS, 
config.TV_CHANNELS_EXCLUDE)
      log.debug('got %d channels' % len(config.TV_CHANNELLIST.channel_list))
  
+     for c in config.TV_CHANNELLIST:
+         c.uri = []
+         if isinstance(c.access_id, (list, tuple)):
+             for a_id in c.access_id:
+                 add_uri(c, a_id)
+         else:
+             add_uri(c, c.access_id)
+ 
      # add all possible channels to the cards
      for card in config.TV_CARDS:



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

Reply via email to