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
|
||||
for carte in cartes :
|
||||
eval('carte.start()')
|
||||
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class CarteOqp(Exception) :
|
|||
|
||||
class NotRunning(Exception) :
|
||||
""" La carte ne diffuse rien """
|
||||
|
||||
|
||||
class carte :
|
||||
""" Classe parent de toute classe de transpondeur """
|
||||
# Niveux de verbosite :
|
||||
|
@ -33,12 +33,12 @@ class carte :
|
|||
# 2 : messages de debug
|
||||
# 3 : ne permet pas à mumudvb de daemonizer
|
||||
verbose = 3
|
||||
|
||||
|
||||
CONF_FILE = "/etc/sat/carte%i.conf" # %i : numero de la carte
|
||||
|
||||
|
||||
timeout_accord=20 #en secondes
|
||||
timeout_no_diff=0 #en secondes
|
||||
|
||||
|
||||
entete_conf = """### Fichier genere, NE PAS EDITER
|
||||
autoconfiguration=1
|
||||
autoconf_pid_update=1
|
||||
|
|
|
@ -13,7 +13,7 @@ transpondeurs = { 'canard' : [ Hotbird_11034(0) ,
|
|||
Hotbird_12597(2) ,
|
||||
Hotbird_11604(3) ,
|
||||
TNT_R1_586000(4) ],
|
||||
'lapin' : [ Hotbird_12539(0) ,
|
||||
'lapin' : [ Hotbird_12539(0) ,
|
||||
Hotbird_11727(1) , #Cette carte capte bizarrement, a vérifier
|
||||
TNT_R2_474000(2) ,
|
||||
TNT_R3_522000(3) ],
|
||||
|
@ -28,7 +28,7 @@ transpondeurs = { 'canard' : [ Hotbird_11034(0) ,
|
|||
}
|
||||
|
||||
conf = transpondeurs.get(host,[])
|
||||
|
||||
|
||||
if __name__ == '__main__' :
|
||||
import sys
|
||||
if len(sys.argv) == 2 :
|
||||
|
|
|
@ -35,7 +35,7 @@ class CarteOqp(Exception) :
|
|||
|
||||
class NotRunning(Exception) :
|
||||
""" La carte ne diffuse rien """
|
||||
|
||||
|
||||
class carte :
|
||||
""" Classe parent de toute classe de transpondeur """
|
||||
# Niveux de verbosite :
|
||||
|
@ -44,12 +44,12 @@ class carte :
|
|||
# 2 : messages de debug
|
||||
# 3 : ne permet pas à mumudvb de daemonizer
|
||||
verbose = 3
|
||||
|
||||
|
||||
CONF_FILE = "/etc/sat/carte%i.conf" # %i : numero de la carte
|
||||
|
||||
|
||||
timeout_accord=20 #en secondes
|
||||
timeout_no_diff=60 #en secondes
|
||||
|
||||
|
||||
entete_conf = """### Fichier généré, NE PAS EDITER
|
||||
autoconfiguration=1
|
||||
sap=1
|
||||
|
@ -94,15 +94,15 @@ sap_default_group=various
|
|||
#-----
|
||||
"""
|
||||
|
||||
|
||||
|
||||
def __cmp__(a,b) :
|
||||
for attr in ( 'card', 'freq', 'chaines' ) :
|
||||
if getattr(a,attr) != getattr(b,attr) :
|
||||
return -2
|
||||
return 0
|
||||
|
||||
|
||||
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 """
|
||||
try :
|
||||
self.freq = int(str(self.__class__).split('_')[-1])
|
||||
|
@ -111,17 +111,17 @@ sap_default_group=various
|
|||
self.freq = ''
|
||||
pass
|
||||
self.card = card
|
||||
|
||||
|
||||
def gen_conf(self) :
|
||||
""" 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"
|
||||
return
|
||||
|
||||
|
||||
fd = open(self.CONF_FILE % self.card,'w')
|
||||
# Entète du fichier
|
||||
try:
|
||||
fd.write( self.entete_conf_TNT %
|
||||
fd.write( self.entete_conf_TNT %
|
||||
{ 'qam' : self.qam, 'trans_mode' : self.trans_mode ,
|
||||
'bandwidth' : self.bandwidth, 'guardinterval' : self.guardinterval ,
|
||||
'coderate' : self.coderate,
|
||||
|
@ -129,7 +129,7 @@ sap_default_group=various
|
|||
'timeout_accord' : self.timeout_accord ,
|
||||
'timeout_no_diff' : self.timeout_no_diff } )
|
||||
except:
|
||||
fd.write( self.entete_conf %
|
||||
fd.write( self.entete_conf %
|
||||
{ 'pol' : self.pol, 'srate' : self.srate ,
|
||||
'freq' : self.freq , 'card' : self.card ,
|
||||
'timeout_accord' : self.timeout_accord ,
|
||||
|
@ -143,7 +143,7 @@ sap_default_group=various
|
|||
fd.write(self.chaine_template % vars())
|
||||
|
||||
#Si pas de chaines, on passe en autoconfiguration=2
|
||||
if not n :
|
||||
if not n :
|
||||
ip = '239.%s' % ( IP.split('.')[-1])
|
||||
fd.write(self.autoconf2_template % { "ip" : ip})
|
||||
|
||||
|
@ -151,16 +151,16 @@ sap_default_group=various
|
|||
|
||||
def start(self) :
|
||||
""" 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"
|
||||
return
|
||||
|
||||
|
||||
if self.verbose >0 :
|
||||
print "Generation de la conf de %s sur la carte %i" % (str(self.__class__).split('.')[-1], self.card)
|
||||
|
||||
|
||||
self.gen_conf()
|
||||
if self.verbose >0 : print "OK"
|
||||
|
||||
|
||||
|
||||
class Hotbird_10853(carte) :
|
||||
pol='h'
|
||||
|
@ -210,7 +210,7 @@ class Hotbird_11604(carte) :
|
|||
'1600' : ('x-ero' , 'x-ero hot arab tv'),
|
||||
'3200' : ('x-ero' , 'x-ero xxx Action TV')}
|
||||
|
||||
class Hotbird_11623(carte) :
|
||||
class Hotbird_11623(carte) :
|
||||
pol='v'
|
||||
srate=27500
|
||||
chaines = {}
|
||||
|
@ -317,7 +317,7 @@ class TNT_base(carte) :
|
|||
guardinterval="auto"
|
||||
coderate="auto"
|
||||
bandwidth="8MHz"
|
||||
|
||||
|
||||
class TNT_R1_586000(TNT_base) :
|
||||
chaines = {
|
||||
'110' : ('fra' , 'fra TNT02 France 2'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue