[vdrpylib-devel] Confused with lstc
Status: Alpha
Brought to you by:
rshortt
From: Sebastien L. <seb...@gm...> - 2004-12-17 14:09:20
|
Hi, I had enought free time to have a look to the modifications you made to svdrp.lstc and vdr.retrievechannels() and I found some differences (And as I'm currently away from home because of my work, I can't test accurately). svdrp.lstc no longer return a hashtable (indexes by channel ID), that must break vdr.parseepg() wich use channels.has_key() ...... should not work with plain list. I think you've done that to have an sorted list. I've done that : self.listeChainesTriees = self.channels.values() self.listeChainesTriees.sort() and I added a __cmp__ method to Channel.py. EDIT : I'm stupid i should have read retrievechannels till the end. There is still a hashtable. Sorry. But I still find the use of sort prettier ;), anyway no big deal. In svdrp.lstc you use : c = channel.Channel(tokens[-1], counter) to create a new channel object. I personnally use : c = channel.Channel(tokens[-1], int (tokens[0])) With that the index of the channel represent exactly the channel number in VDR and it still allow to sort the channel list in vdr.parseepg, I changed a little the code to skip lines without correct channels (self.channel.has_key(ch_id) -> false). I don't see any interest in creating a new channel in this case. What do you think ? More news to come ... Bye Vlad |