Author: dmeyer
Date: Thu Mar 23 19:34:04 2006
New Revision: 8132
Modified:
trunk/tvserver/src/config.py
Log:
config of the grabber is moved to kaa.epg
Modified: trunk/tvserver/src/config.py
==============================================================================
--- trunk/tvserver/src/config.py (original)
+++ trunk/tvserver/src/config.py Thu Mar 23 19:34:04 2006
@@ -5,6 +5,7 @@
import logging
from kaa.config import Var, Group, Dict, List, Config
+import kaa.epg
import freevo.conf
@@ -29,81 +30,22 @@
Var(name='dir', default='',
desc=_('directory where to store recordings')) ]),
-
# epg group
Group(name='epg', desc=_('EPG settings'), schema=[
Var(name='database', default=freevo.conf.datafile('epg.sqlite'),
- desc=_('epg database file')),
-
- # XMLTV settings
- Group(name='xmltv', desc=_('''
- XMLTV settings
-
- You can use a xmltv rabber to populate the epg database. To activate the
xmltv
- grabber you need to set 'activate' to True and specify a data_file which
already
- contains the current listing or define a grabber to fetch the listings.
- Optionally you can define arguments for that grabber and the location of a
- sort program to sort the data after the grabber has finished.
- '''), desc_type='group', schema = [
- Var(name='activate', default=False,
- desc=_('Use XMLTV file to populate database.')),
- Var(name='data_file', default='',
- desc=_('Location of XMLTV data file.')),
- Var(name='grabber', default='',
- desc=_('If you want to run an XMLTV grabber to fetch your listings\n'
- 'set this to the full path of your grabber program plus any\n'
- 'additional arguments.')),
- Var(name='days', default=5,
- desc=_('How many days of XMLTV data you want to fetch.')),
- Var(name='sort', default='',
- desc=_('Set this to the path of the tv_sort program if you need to\n'
- 'sort your listings.')),
- ]),
-
- # Zap2it settings
- Group(name='zap2it', desc=_('''
- Zap2it settings
-
- Add more doc here please!
- '''), desc_type='group', schema = [
- Var(name='activate', default=False,
- desc=_('Use Zap2it service to populate database.')),
- Var(name='username', default='',
- desc=_('Zap2it username.')),
- Var(name='password', default='',
- desc=_('Zap2it password.')),
- ]),
-
- # VDR settings
- Group(name='vdr', desc=_('''
- VDR settings
-
- Add more doc here please!
- '''), desc_type='group', schema = [
- Var(name='activate', default=False,
- desc=_('Use VDR to populate the database.')),
- Var(name='dir', default='/video',
- desc=_('VDR main directory.')),
- Var(name='channels_file', default='channels.conf',
- desc=_('VDR channels file name.')),
- Var(name='epg_file', default='epg.data',
- desc=_('VDR EPG file name.')),
- Var(name='host', default='localhost',
- desc=_('VDR SVDRP host.')),
- Var(name='port', default=2001,
- desc=_('VDR SVDRP port.')),
- Var(name='access_by', type=('name', 'sid' 'rid'), default='sid',
- desc=_('Which field to access channels by: name, sid (service id), \n'+
- 'or rid (radio id).')),
- Var(name='limit_channels', type=('epg', 'chan' 'both'), default='chan',
- desc=_('Limit channels added to those found in the EPG file, the \n'+
- 'channels file, or both. Values: epg, chan, both')),
- ]),
-
- # EPG mapping
- Dict(name='mapping', type=unicode, schema=Var(type=unicode),
- desc=_('EPG channel mapping'))])
+ desc=_('epg database file'))
+ ])
])
+# Now add the source config
+sources = kaa.epg.sources.items()
+sources.sort(lambda x,y: cmp(x[0], y[0]))
+for name, module in sources:
+ config.epg.add_variable(name, module.config)
+
+# EPG mapping
+config.epg.add_variable('mapping', Dict(name='mapping', type=unicode,
+ schema=Var(type=unicode),
+ desc=_('EPG channel mapping')))
config.load('/etc/freevo/tvserver.conf')
# if started as user add personal config file
-------------------------------------------------------
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