Update of /cvsroot/freevo/freevo/WIP/Aubin
In directory sc8-pr-cvs1:/tmp/cvs-serv10818

Added Files:
        xmltv-automatic.py 
Log Message:
This code uses a TV.xml generated by >= 0.5.15 to make a complete 
TV_CHANNELS table. We could easily integrate this right into the config
module.

The only thing I would like to do first is sort the channels by display_name[0]
but I have no idea how to sort a nested dictionary.


--- NEW FILE: xmltv-automatic.py ---
import xmltv
channels = xmltv.read_channels(open('/tmp/test.xml'))
print "TV_CHANNELS = ["
count = len(channels)
increment = 0
for a in channels:
    display_name = a['display-name'][0]
    tunerid = a['display-name'][1]
    id = a['id']
    #if a.has_key('icon'):
    #    print a['icon'][0]['src']
    print "('%s','%s','%i')" % (id,display_name,int(tunerid)),
    if (increment < count): print ","
    else: print
    increment = increment + 1
print  "]"





-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to