[vdrpylib-cvslog] vdrpylib/vdr vdr.py,1.10,1.11
Status: Alpha
Brought to you by:
rshortt
From: Rob S. <rs...@us...> - 2005-04-28 01:32:52
|
Update of /cvsroot/vdrpylib/vdrpylib/vdr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9020/vdr Modified Files: vdr.py Log Message: -Removed ordered_channels, tv_channels, radio_channels lists. -Cleanup some junk. -Utilize in_conf and in_epg of Channel. Index: vdr.py =================================================================== RCS file: /cvsroot/vdrpylib/vdrpylib/vdr/vdr.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** vdr.py 7 Jan 2005 12:33:01 -0000 1.10 --- vdr.py 28 Apr 2005 01:32:41 -0000 1.11 *************** *** 101,107 **** self.recordings = [] self.timers = [] - self.ordered_channels = [] - self.radio_channels = [] - self.tv_channels = [] self.close_connection=close_connection --- 101,104 ---- *************** *** 246,268 **** the channel list of this VDR object is not modified. """ if self.getsvdrp() is None: return None ! chans={} ! self.radio_channels=[] ! self.tv_channels=[] ! self.ordered_channels = self.svdrp.lstc() ! if self.ordered_channels is None: ! return chans ! for c in self.ordered_channels: ! chans[c.id]=c ! if c.vpid=="0": ! self.radio_channels.append(c) ! else: ! self.tv_channels.append(c) ! ! if chans is not None: ! self.channels = chans ! return chans --- 243,258 ---- the channel list of this VDR object is not modified. """ + counter = 0 + if self.getsvdrp() is None: return None ! ! schans = self.svdrp.lstc() ! ! for c in schans: ! self.addchannel(c) ! counter += 1 ! return counter *************** *** 279,283 **** fh = open(self.channelsfile, 'r') counter = 0 ! chans = {} line = fh.readline() while line: --- 269,273 ---- fh = open(self.channelsfile, 'r') counter = 0 ! line = fh.readline() while line: *************** *** 285,298 **** if len(line) > 0 and line[0] != ':': counter = counter + 1 ! self.addchannel(channel.Channel(line, counter)) line = fh.readline() ! self.channels = chans ! return chans def addchannel(self, channel): ! key = string.join([channel.source, channel.nid, channel.tid, ! channel.sid, channel.rid], '-') if not channel.id: --- 275,289 ---- if len(line) > 0 and line[0] != ':': counter = counter + 1 ! c = channel.Channel(line, counter) ! c.in_conf = True ! self.addchannel(c) line = fh.readline() ! return counter def addchannel(self, channel): ! key = string.join([channel.source, channel.nid, channel.tid, ! channel.sid, channel.rid], '-') if not channel.id: *************** *** 345,348 **** --- 336,340 ---- ch.id = ch_id ch.name = tokens[2] + ch.in_epg = True elif line[0] == 'E': # event start *************** *** 381,385 **** ! def retrieveepg(self,channelid = None,classifier=None): """Retrieves EPG data via SVDRP from VDR and adds it to this VDR object. --- 373,377 ---- ! def retrieveepg(self, channelid=None, classifier=None): """Retrieves EPG data via SVDRP from VDR and adds it to this VDR object. *************** *** 393,411 **** """ counter = 0 if self.getsvdrp() is None: return None ! if self.channels is None: ! retrievechannels() ! cmd='lste' if channelid: ! cmd=cmd+' '+channelid ! else: ! for ch in self.ordered_channels: ! print ch.name ! self.retrieveepg(ch.id,classifier) ! return ! if classifier: ! cmd=cmd+' '+classifier result = self.svdrp.write_cmd(cmd) fh = cStringIO.StringIO(result) --- 385,399 ---- """ counter = 0 + if self.getsvdrp() is None: return None ! ! cmd = 'lste' if channelid: ! cmd = cmd+' '+channelid ! if classifier: ! cmd = cmd+' '+classifier ! result = self.svdrp.write_cmd(cmd) fh = cStringIO.StringIO(result) |