Update of /cvsroot/vdrpylib/vdrpylib/vdr
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9053
Modified Files:
channel.py
Log Message:
Changes from Thomas Weber and myself.
Index: channel.py
===================================================================
RCS file: /cvsroot/vdrpylib/vdrpylib/vdr/channel.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** channel.py 25 Nov 2002 22:03:50 -0000 1.2
--- channel.py 25 Nov 2004 17:01:47 -0000 1.3
***************
*** 74,82 ****
"""
def __init__(self, line = None, index = None):
self.indexes = []
self.name = None
self.freq = None
self.pol = None
! self.diseqc = None
self.srate = None
self.vpid = None
--- 74,84 ----
"""
def __init__(self, line = None, index = None):
+ self.id = None
self.indexes = []
self.name = None
+ self.provider = None
self.freq = None
self.pol = None
! self.source = None
self.srate = None
self.vpid = None
***************
*** 86,89 ****
--- 88,94 ----
self.ca = None
self.sid = None
+ self.nid = None
+ self.tid = None
+ self.rid = None
self.events = []
if line is not None:
***************
*** 97,104 ****
"""
apids = string.join([string.join(map(str, self.apids), ','), string.join(map(str, self.dpids), ',')], ';')
! return string.join(map(str, [self.name, self.freq, self.pol, self.diseqc, self.srate, self.vpid, apids, self.tpid, self.ca, self.sid]), ':')
! def parse(self, string):
"""Parses a standard channel specification as can be found in
VDR's channels.conf file.
--- 102,109 ----
"""
apids = string.join([string.join(map(str, self.apids), ','), string.join(map(str, self.dpids), ',')], ';')
! return string.join(map(str, [self.name+";"+self.provider, self.freq, self.pol, self.source, self.srate, self.vpid, apids, self.tpid, self.ca, self.sid,self.nid,self.tid,self.rid]), ':')
! def parse(self, definition):
"""Parses a standard channel specification as can be found in
VDR's channels.conf file.
***************
*** 107,126 ****
specification string given in the first argument.
"""
! tokens = string.strip().split(':')
! self.name = tokens[0]
self.freq = int(tokens[1])
self.pol = tokens[2]
! self.diseqc = int(tokens[3])
self.srate = int(tokens[4])
! self.vpid = int(tokens[5])
apids = tokens[6]
self.tpid = int(tokens[7])
! self.ca = int(tokens[8])
! self.sid = int(tokens[9])
tokens = apids.split(';')
! self.apids = map(int, tokens[0].split(','))
if len(tokens) == 2:
! self.dpids = map(int, tokens[1].split(','))
def addevent(self, ev):
"""Add an EPG event to the list of events for this channel.
--- 112,143 ----
specification string given in the first argument.
"""
! tokens = definition.strip().split(':')
! name=tokens[0]
! nametokens=name.split(';')
! self.name = nametokens[0]
! if len(nametokens)>1:
! self.provider = nametokens[1]
self.freq = int(tokens[1])
self.pol = tokens[2]
! self.source = tokens[3]
self.srate = int(tokens[4])
! self.vpid = tokens[5]
apids = tokens[6]
self.tpid = int(tokens[7])
! self.ca = tokens[8]
! self.sid = tokens[9]
! self.nid = tokens[10]
! self.tid = tokens[11]
! self.rid = tokens[12]
tokens = apids.split(';')
! self.apids = map(str, tokens[0].split(','))
if len(tokens) == 2:
! self.dpids = map(str, tokens[1].split(','))
! #print "source=%s, nid=%s,tid=%s, sid=%s,rid=%s" % (self.source,self.nid,self.tid,self.sid,self.rid)
! self.id=self.source+"-"+self.nid+"-"+self.tid+"-"+self.sid
! if int(self.rid)>0:
! self.id+="-"+self.rid
+
def addevent(self, ev):
"""Add an EPG event to the list of events for this channel.
|