OK, so neither one of these work correctly. I can't even begin to figure
out the sed to fix it but to fix the python script, add a , after the ) in
the print statement. i.e.

from: print "('%s', '%s', '%s')" % (host, foo, index, )

to:print "('%s', '%s', '%s')," % (host, foo, index, )

That will make it work correctly.

Jon

>
> #!/usr/bin/env python
>
> datafile = file('<filename>')
> data = datafile.read()
> datafile.close()
>
> map = {}
> lines = [eval(line)[0] for line in data.split('\n') if line]
> for host, foo, index in lines:
>     map[int(index)] = host, foo
>
> map = [(k, v, d) for k, (v, d) in map.items()]
> map.sort()
>
> for index, host, foo in map:
>     print "('%s', '%s', '%s')" % (host, foo, index, )
>
> Just replace <filename> with the file you have your TV_CHANNELS listings
> in and it will sort them out from (in my case) 1-953.
>
> Hope that helps someone else,
>
> Jon
>
> p.s. I am still having problems with sorting my XMLTV data, tv_sort is not
> adding the stop times if they are missing. Please,please help me with this
> one, I am so close to getting this to work smoothly. I am revisiting
> Freevo to shut my Mac friend up about his beloved ReplayTV and TiVo. :)
>
>
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> Freevo-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/freevo-users
>



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Freevo-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to