Prise pour les clubs.
darcs-hash:20041205011257-41617-bad8f1d31cfcd20347bf1684d980a7d78b4b470d.gz
This commit is contained in:
parent
13e162fcd6
commit
ebc52c99ac
3 changed files with 47 additions and 26 deletions
|
@ -1016,10 +1016,12 @@ def set_machine(machine) :
|
||||||
arg+= u'"Adresse mac :" 2 1 "%s" 2 15 17 0 ' % machine.mac()
|
arg+= u'"Adresse mac :" 2 1 "%s" 2 15 17 0 ' % machine.mac()
|
||||||
arg+= u'"IP :" 3 1 "%s" 3 6 15 0 ' % machine.ip()
|
arg+= u'"IP :" 3 1 "%s" 3 6 15 0 ' % machine.ip()
|
||||||
if isadm :
|
if isadm :
|
||||||
arg+= u'"PortsTCP ext->machine :" 4 1 "%s" 4 25 50 0 ' % machine.portTCPin()
|
if machine.proprietaire().__class__ == crans :
|
||||||
arg+= u'"PortsTCP machine->ext :" 5 1 "%s" 5 25 50 0 ' % machine.portTCPout()
|
arg+= u'"Prise :" 4 1 "%s" 4 9 5 0 ' % machine.prise()
|
||||||
arg+= u'"PortsUDP ext->machine :" 6 1 "%s" 6 25 50 0 ' % machine.portUDPin()
|
arg+= u'"PortsTCP ext->machine :" 5 1 "%s" 5 25 50 0 ' % machine.portTCPin()
|
||||||
arg+= u'"PortsUDP machine->ext :" 7 1 "%s" 7 25 50 0 ' % machine.portUDPout()
|
arg+= u'"PortsTCP machine->ext :" 6 1 "%s" 6 25 50 0 ' % machine.portTCPout()
|
||||||
|
arg+= u'"PortsUDP ext->machine :" 7 1 "%s" 7 25 50 0 ' % machine.portUDPin()
|
||||||
|
arg+= u'"PortsUDP machine->ext :" 8 1 "%s" 8 25 50 0 ' % machine.portUDPout()
|
||||||
if machine.puissance()!=None and isadm :
|
if machine.puissance()!=None and isadm :
|
||||||
# Borne wifi
|
# Borne wifi
|
||||||
p = u'Mettre le lieu de la borne comme première remarque.'
|
p = u'Mettre le lieu de la borne comme première remarque.'
|
||||||
|
@ -1063,16 +1065,17 @@ def set_machine(machine) :
|
||||||
|
|
||||||
if isadm :
|
if isadm :
|
||||||
try :
|
try :
|
||||||
machine.portTCPin(result[3])
|
machine.prise(result[3])
|
||||||
machine.portTCPout(result[4])
|
machine.portTCPin(result[4])
|
||||||
machine.portUDPin(result[5])
|
machine.portTCPout(result[5])
|
||||||
machine.portUDPout(result[6])
|
machine.portUDPin(result[6])
|
||||||
|
machine.portUDPout(result[7])
|
||||||
except ValueError, c : err += c.args[0] + '\n'
|
except ValueError, c : err += c.args[0] + '\n'
|
||||||
|
|
||||||
if isadm and machine.puissance()!=None :
|
if isadm and machine.puissance()!=None :
|
||||||
try : machine.canal(result[7])
|
try : machine.canal(result[8])
|
||||||
except ValueError, c : err += c.args[0] + '\n'
|
except ValueError, c : err += c.args[0] + '\n'
|
||||||
try : machine.puissance(result[8])
|
try : machine.puissance(result[9])
|
||||||
except ValueError, c : err += c.args[0] + '\n'
|
except ValueError, c : err += c.args[0] + '\n'
|
||||||
|
|
||||||
# Des erreurs ?
|
# Des erreurs ?
|
||||||
|
|
|
@ -1048,21 +1048,7 @@ class base_proprietaire(base_classes_crans) :
|
||||||
si négatif le supprime
|
si négatif le supprime
|
||||||
"""
|
"""
|
||||||
return self._an('paiement',action)
|
return self._an('paiement',action)
|
||||||
|
|
||||||
def prise(self) :
|
|
||||||
""" Retourne la prise associée ou au club
|
|
||||||
Si chbre est dans un bat sans correspondance chbre <-> prise
|
|
||||||
retourne ''
|
|
||||||
Si prise non trouvée retourne inconnue
|
|
||||||
"""
|
|
||||||
if self.chbre()[0].lower() in annuaires.chbre_prises.keys() :
|
|
||||||
try :
|
|
||||||
return annuaires.chbre_prises[self.chbre()[0].lower()][self.chbre()[1:]]
|
|
||||||
except :
|
|
||||||
return 'inconnue'
|
|
||||||
else :
|
|
||||||
return ''
|
|
||||||
|
|
||||||
def delete(self,comment='') :
|
def delete(self,comment='') :
|
||||||
"""Destruction du proprietaire"""
|
"""Destruction du proprietaire"""
|
||||||
|
|
||||||
|
@ -1849,6 +1835,35 @@ class machine(base_classes_crans) :
|
||||||
self._set('host',[new])
|
self._set('host',[new])
|
||||||
return new.split('.')[0]
|
return new.split('.')[0]
|
||||||
|
|
||||||
|
def prise(self,new=None) :
|
||||||
|
""" Retourne ou défini la prise associée à la machine
|
||||||
|
La définition n'est possible que si la machine est
|
||||||
|
une machine de l'assoce.
|
||||||
|
Si la prise est inconne retourne N/A
|
||||||
|
"""
|
||||||
|
if new == None :
|
||||||
|
if self.proprietaire().__class__ == crans :
|
||||||
|
return decode(self._data.get('prise',['N/A'])[0])
|
||||||
|
else :
|
||||||
|
chbre = self.proprietaire().chbre()
|
||||||
|
if chbre and chbre[0].lower() in annuaires.chbre_prises.keys() :
|
||||||
|
try :
|
||||||
|
return annuaires.chbre_prises[chbre[0].lower()][chbre[1:]]
|
||||||
|
except :
|
||||||
|
return 'N/A'
|
||||||
|
|
||||||
|
# Attribution de la prise
|
||||||
|
new=preattr(new)[1]
|
||||||
|
if new == 'N/A' :
|
||||||
|
self._set('prise',[])
|
||||||
|
self._data.pop('prise')
|
||||||
|
|
||||||
|
if not sre.match('^[a-cg-jmp][0-6][0-5][0-9]$',new.lower()) :
|
||||||
|
raise ValueError('Prise incorrecte')
|
||||||
|
|
||||||
|
self._set('prise',[new.upper()])
|
||||||
|
return new
|
||||||
|
|
||||||
def alias(self,new=None) :
|
def alias(self,new=None) :
|
||||||
"""
|
"""
|
||||||
Création ou visualisation des alias d'une machine.
|
Création ou visualisation des alias d'une machine.
|
||||||
|
|
|
@ -408,7 +408,10 @@ def machine_details(machine) :
|
||||||
except :
|
except :
|
||||||
a = machine.proprietaire()
|
a = machine.proprietaire()
|
||||||
f += "%s" % a.Nom()
|
f += "%s" % a.Nom()
|
||||||
if a.chbre() : f += " (%s)" % a.chbre()
|
if a.chbre()!='CRA' :
|
||||||
|
f += " (%s)" % a.chbre()
|
||||||
|
else :
|
||||||
|
f += coul(u'\t\tPrise : ','gras') + machine.prise()
|
||||||
f+= '\n'
|
f+= '\n'
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue