Author: rshortt
Date: Thu Mar  9 03:39:29 2006
New Revision: 8065

Modified:
   trunk/WIP/RobShortt/tvserver-epg2/bin/freevo-epg

Log:
Use config groups, add vdr support.


Modified: trunk/WIP/RobShortt/tvserver-epg2/bin/freevo-epg
==============================================================================
--- trunk/WIP/RobShortt/tvserver-epg2/bin/freevo-epg    (original)
+++ trunk/WIP/RobShortt/tvserver-epg2/bin/freevo-epg    Thu Mar  9 03:39:29 2006
@@ -99,33 +99,33 @@
         # once the update is finished.
         guide.signals["updated"].connect(sys.exit)
 
-        if epg.config.use_xmltv == 1 and \
-           os.path.isdir(os.path.dirname(epg.config.xmltv_file.split()[0])):
+        if epg.config.xmltv.activate == 1 and \
+           
os.path.isdir(os.path.dirname(epg.config.xmltv.data_file.split()[0])):
 
-            if epg.config.xmltv_grabber and \
-               os.path.isfile(epg.config.xmltv_grabber.split()[0]):
+            if epg.config.xmltv.grabber and \
+               os.path.isfile(epg.config.xmltv.grabber.split()[0]):
                 # NOTE: should the grabbing code be put into a seperate module
                 #       so other programs can cal it?
 
-                log.info('grabbing listings using %s', 
epg.config.xmltv_grabber)
+                log.info('grabbing listings using %s', 
epg.config.xmltv.grabber)
                 xmltvtmp = '/tmp/TV.xml.tmp'
-                ec = os.system('%s --output %s --days %s' % 
(epg.config.xmltv_grabber,
+                ec = os.system('%s --output %s --days %s' % 
(epg.config.xmltv.grabber,
                                                              xmltvtmp,
-                                                             
epg.config.xmltv_days))
+                                                             
epg.config.xmltv.days))
 
                 if os.path.exists(xmltvtmp) and ec == 0:
-                    if os.path.isfile(epg.config.xmltv_sort):
+                    if os.path.isfile(epg.config.xmltv.sort):
                         log.info('sorting listings')
-                        os.system('%s --output %s %s' % (epg.config.xmltv_sort,
+                        os.system('%s --output %s %s' % (epg.config.xmltv.sort,
                                                          xmltvtmp+'.1',
                                                          xmltvtmp))
 
                         shutil.move(xmltvtmp+'.1', xmltvtmp)
 
                     else:
-                        log.info('not configured to use xmltv_sort, skipping')
+                        log.info('not configured to use tv_sort, skipping')
 
-                    shutil.move(xmltvtmp, epg.config.xmltv_file)
+                    shutil.move(xmltvtmp, epg.config.xmltv.data_file)
 
                 else:
                     log.error('xmltv grabbing failed and returned exit code 
%d.', ec >> 8)
@@ -134,28 +134,40 @@
                               'updating your xmltv: http://www.xmltv.org/')
 
             else:
-                log.info('not configured to run xmltv_grabber')
+                log.info('not configured to run XMLTV grabber')
 
-            if not os.path.isfile(epg.config.xmltv_file):
-                log.error('problem with xmltv_file, not updating EPG')
+            if not os.path.isfile(epg.config.xmltv.data_file):
+                log.error('problem with xmltv.data_file, not updating EPG')
            
             else:
-                log.debug('xmltv_file: %s', epg.config.xmltv_file)
+                log.debug('xmltv_file: %s', epg.config.xmltv.data_file)
                 log.info('loading data into EPG...')
-                guide.update("xmltv", str(epg.config.xmltv_file))
+                guide.update("xmltv", str(epg.config.xmltv.data_file))
 
         else:
             log.info('not configured to use xmltv')
 
 
-        if epg.config.use_zap2it == 1:
-            guide.update("zap2it", username=str(epg.config.zap2it_username), 
-                                   passwd=str(epg.config.zap2it_password))
+        if epg.config.zap2it.activate == 1:
+            guide.update("zap2it", username=str(epg.config.zap2it.username), 
+                                   passwd=str(epg.config.zap2it.password))
 
         else:
             log.info('not configured to use Zap2it')
 
  
+        if epg.config.vdr.activate == 1:
+            guide.update("vdr", vdr_dir=epg.config.vdr.dir, 
+                         channels_file=epg.config.vdr.channels_file, 
+                         epg_file=epg.config.vdr.epg_file,
+                         host=epg.config.vdr.host, port=epg.config.vdr.port, 
+                         access_by=epg.config.vdr.access_by, 
+                         limit_channels=epg.config.vdr.limit_channels)
+
+        else:
+            log.info('not configured to use VDR')
+
+
         log.info('connecting to tvserver')
         mbus = freevo.ipc.Instance()
         mbus.signals['new-entity'].connect(new_entity)


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