misc ws
darcs-hash:20090619212431-8fbb1-1bcd0b9ecd8a3bfd7cfd325f5213f91071e2c099.gz
This commit is contained in:
parent
1e6c5379c2
commit
02db41f8bd
4 changed files with 25 additions and 27 deletions
|
@ -16,5 +16,3 @@ cartes = conf
|
||||||
# On genre la conf
|
# On genre la conf
|
||||||
for carte in cartes :
|
for carte in cartes :
|
||||||
eval('carte.start()')
|
eval('carte.start()')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ class CarteOqp(Exception) :
|
||||||
|
|
||||||
class NotRunning(Exception) :
|
class NotRunning(Exception) :
|
||||||
""" La carte ne diffuse rien """
|
""" La carte ne diffuse rien """
|
||||||
|
|
||||||
class carte :
|
class carte :
|
||||||
""" Classe parent de toute classe de transpondeur """
|
""" Classe parent de toute classe de transpondeur """
|
||||||
# Niveux de verbosite :
|
# Niveux de verbosite :
|
||||||
|
@ -33,12 +33,12 @@ class carte :
|
||||||
# 2 : messages de debug
|
# 2 : messages de debug
|
||||||
# 3 : ne permet pas à mumudvb de daemonizer
|
# 3 : ne permet pas à mumudvb de daemonizer
|
||||||
verbose = 3
|
verbose = 3
|
||||||
|
|
||||||
CONF_FILE = "/etc/sat/carte%i.conf" # %i : numero de la carte
|
CONF_FILE = "/etc/sat/carte%i.conf" # %i : numero de la carte
|
||||||
|
|
||||||
timeout_accord=20 #en secondes
|
timeout_accord=20 #en secondes
|
||||||
timeout_no_diff=0 #en secondes
|
timeout_no_diff=0 #en secondes
|
||||||
|
|
||||||
entete_conf = """### Fichier genere, NE PAS EDITER
|
entete_conf = """### Fichier genere, NE PAS EDITER
|
||||||
autoconfiguration=1
|
autoconfiguration=1
|
||||||
autoconf_pid_update=1
|
autoconf_pid_update=1
|
||||||
|
|
|
@ -13,7 +13,7 @@ transpondeurs = { 'canard' : [ Hotbird_11034(0) ,
|
||||||
Hotbird_12597(2) ,
|
Hotbird_12597(2) ,
|
||||||
Hotbird_11604(3) ,
|
Hotbird_11604(3) ,
|
||||||
TNT_R1_586000(4) ],
|
TNT_R1_586000(4) ],
|
||||||
'lapin' : [ Hotbird_12539(0) ,
|
'lapin' : [ Hotbird_12539(0) ,
|
||||||
Hotbird_11727(1) , #Cette carte capte bizarrement, a vérifier
|
Hotbird_11727(1) , #Cette carte capte bizarrement, a vérifier
|
||||||
TNT_R2_474000(2) ,
|
TNT_R2_474000(2) ,
|
||||||
TNT_R3_522000(3) ],
|
TNT_R3_522000(3) ],
|
||||||
|
@ -28,7 +28,7 @@ transpondeurs = { 'canard' : [ Hotbird_11034(0) ,
|
||||||
}
|
}
|
||||||
|
|
||||||
conf = transpondeurs.get(host,[])
|
conf = transpondeurs.get(host,[])
|
||||||
|
|
||||||
if __name__ == '__main__' :
|
if __name__ == '__main__' :
|
||||||
import sys
|
import sys
|
||||||
if len(sys.argv) == 2 :
|
if len(sys.argv) == 2 :
|
||||||
|
|
|
@ -35,7 +35,7 @@ class CarteOqp(Exception) :
|
||||||
|
|
||||||
class NotRunning(Exception) :
|
class NotRunning(Exception) :
|
||||||
""" La carte ne diffuse rien """
|
""" La carte ne diffuse rien """
|
||||||
|
|
||||||
class carte :
|
class carte :
|
||||||
""" Classe parent de toute classe de transpondeur """
|
""" Classe parent de toute classe de transpondeur """
|
||||||
# Niveux de verbosite :
|
# Niveux de verbosite :
|
||||||
|
@ -44,12 +44,12 @@ class carte :
|
||||||
# 2 : messages de debug
|
# 2 : messages de debug
|
||||||
# 3 : ne permet pas à mumudvb de daemonizer
|
# 3 : ne permet pas à mumudvb de daemonizer
|
||||||
verbose = 3
|
verbose = 3
|
||||||
|
|
||||||
CONF_FILE = "/etc/sat/carte%i.conf" # %i : numero de la carte
|
CONF_FILE = "/etc/sat/carte%i.conf" # %i : numero de la carte
|
||||||
|
|
||||||
timeout_accord=20 #en secondes
|
timeout_accord=20 #en secondes
|
||||||
timeout_no_diff=60 #en secondes
|
timeout_no_diff=60 #en secondes
|
||||||
|
|
||||||
entete_conf = """### Fichier généré, NE PAS EDITER
|
entete_conf = """### Fichier généré, NE PAS EDITER
|
||||||
autoconfiguration=1
|
autoconfiguration=1
|
||||||
sap=1
|
sap=1
|
||||||
|
@ -94,15 +94,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])
|
||||||
|
@ -111,17 +111,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,
|
||||||
|
@ -129,7 +129,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 ,
|
||||||
|
@ -143,7 +143,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})
|
||||||
|
|
||||||
|
@ -151,16 +151,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'
|
||||||
|
@ -210,7 +210,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 = {}
|
||||||
|
@ -317,7 +317,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' : ('fra' , 'fra TNT02 France 2'),
|
'110' : ('fra' , 'fra TNT02 France 2'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue