misc ws fix

darcs-hash:20090619215517-75e45-8541bf0877cd14af9a8caed1f6ff9e2e3037ba09.gz
This commit is contained in:
huber 2009-06-19 23:55:17 +02:00
parent d238066d67
commit 3e402c3ba2

View file

@ -91,15 +91,15 @@ sap_default_group=various
#----- #-----
""" """
def __cmp__(a,b) : def __cmp__(a,b) :
for attr in ( 'card', 'freq', 'chaines' ) : for attr in ( 'card', 'freq', 'chaines' ) :
if getattr(a,attr) != getattr(b,attr) : if getattr(a,attr) != getattr(b,attr) :
return -2 return -2
return 0 return 0
def __init__(self,card) : def __init__(self,card) :
""" Initalisation card est le numéro (entier) de la carte """ Initalisation card est le numéro (entier) de la carte
correspondante """ correspondante """
try : try :
self.freq = int(str(self.__class__).split('_')[-1]) self.freq = int(str(self.__class__).split('_')[-1])
@ -108,17 +108,17 @@ sap_default_group=various
self.freq = '' self.freq = ''
pass pass
self.card = card self.card = card
def gen_conf(self) : def gen_conf(self) :
""" Génère le fichier de conf """ """ Génère le fichier de conf """
if not self.freq : if not self.freq :
if self.verbose > 1 : print "Instance ne permettant pas la génération de la conf" if self.verbose > 1 : print "Instance ne permettant pas la génération de la conf"
return return
fd = open(self.CONF_FILE % self.card,'w') fd = open(self.CONF_FILE % self.card,'w')
# Entète du fichier # Entète du fichier
try: try:
fd.write( self.entete_conf_TNT % fd.write( self.entete_conf_TNT %
{ 'qam' : self.qam, 'trans_mode' : self.trans_mode , { 'qam' : self.qam, 'trans_mode' : self.trans_mode ,
'bandwidth' : self.bandwidth, 'guardinterval' : self.guardinterval , 'bandwidth' : self.bandwidth, 'guardinterval' : self.guardinterval ,
'coderate' : self.coderate, 'coderate' : self.coderate,
@ -126,7 +126,7 @@ sap_default_group=various
'timeout_accord' : self.timeout_accord , 'timeout_accord' : self.timeout_accord ,
'timeout_no_diff' : self.timeout_no_diff } ) 'timeout_no_diff' : self.timeout_no_diff } )
except: except:
fd.write( self.entete_conf % fd.write( self.entete_conf %
{ 'pol' : self.pol, 'srate' : self.srate , { 'pol' : self.pol, 'srate' : self.srate ,
'freq' : self.freq , 'card' : self.card , 'freq' : self.freq , 'card' : self.card ,
'timeout_accord' : self.timeout_accord , 'timeout_accord' : self.timeout_accord ,
@ -140,7 +140,7 @@ sap_default_group=various
fd.write(self.chaine_template % vars()) fd.write(self.chaine_template % vars())
#Si pas de chaines, on passe en autoconfiguration=2 #Si pas de chaines, on passe en autoconfiguration=2
if not n : if not n :
ip = '239.%s' % ( IP.split('.')[-1]) ip = '239.%s' % ( IP.split('.')[-1])
fd.write(self.autoconf2_template % { "ip" : ip}) fd.write(self.autoconf2_template % { "ip" : ip})
@ -148,16 +148,16 @@ sap_default_group=various
def start(self) : def start(self) :
""" Lance la diffusion """ """ Lance la diffusion """
if not self.freq : if not self.freq :
if self.verbose > 1 : print "Instance ne permettant pas le lancement d'un flux" if self.verbose > 1 : print "Instance ne permettant pas le lancement d'un flux"
return return
if self.verbose >0 : if self.verbose >0 :
print "Generation de la conf de %s sur la carte %i" % (str(self.__class__).split('.')[-1], self.card) print "Generation de la conf de %s sur la carte %i" % (str(self.__class__).split('.')[-1], self.card)
self.gen_conf() self.gen_conf()
if self.verbose >0 : print " OK" if self.verbose >0 : print " OK"
class Hotbird_10853(carte) : class Hotbird_10853(carte) :
pol='h' pol='h'
@ -213,7 +213,7 @@ class Hotbird_11604(carte) :
'1600' : ('x-ero' , 'x-ero hot arab tv'), '1600' : ('x-ero' , 'x-ero hot arab tv'),
'3200' : ('x-ero' , 'x-ero xxx Action TV')} '3200' : ('x-ero' , 'x-ero xxx Action TV')}
class Hotbird_11623(carte) : class Hotbird_11623(carte) :
pol='v' pol='v'
srate=27500 srate=27500
chaines = {} chaines = {}
@ -224,7 +224,7 @@ class Hotbird_11642(carte) :
chaines = { chaines = {
'5003' : ('eng' , 'eng Bloomberg Europe'), '5003' : ('eng' , 'eng Bloomberg Europe'),
'5004' : ('eng' , 'eng Bloomberg Europe"'), '5004' : ('eng' , 'eng Bloomberg Europe"'),
'5005' : ('eng' , 'eng Bloomberg U.K.'), '5005' : ('eng' , 'eng Bloomberg U.K.'),
'256' : ('gre' , 'gre ERT World')} '256' : ('gre' , 'gre ERT World')}
class Hotbird_11727(carte) : class Hotbird_11727(carte) :
@ -243,7 +243,7 @@ class Hotbird_11766(carte) :
'1107' : ('ita' , 'ita eng Senato italiano'), '1107' : ('ita' , 'ita eng Senato italiano'),
'1107' : ('eng' , 'eng ita Senato italiano'), '1107' : ('eng' , 'eng ita Senato italiano'),
'261' : ('ita' , 'ita Rai Edu2')} '261' : ('ita' , 'ita Rai Edu2')}
class Hotbird_11539(carte) : class Hotbird_11539(carte) :
@ -291,7 +291,7 @@ class TNT_base(carte) :
guardinterval="auto" guardinterval="auto"
coderate="auto" coderate="auto"
bandwidth="8MHz" bandwidth="8MHz"
class TNT_R1_586000(TNT_base) : class TNT_R1_586000(TNT_base) :
chaines = { chaines = {
'110' : ('TNT' , 'TNT02 France 2'), '110' : ('TNT' , 'TNT02 France 2'),