crans -> AssociationCrans
adherent -> Adherent club -> Club darcs-hash:20060325215156-68412-615c1bfb3b23e16cd10b82cc3dc467e716c258ea.gz
This commit is contained in:
parent
0a53921e05
commit
f16056b8b4
12 changed files with 62 additions and 64 deletions
|
@ -28,7 +28,8 @@ import re
|
|||
|
||||
import affich_tools, config
|
||||
from lock import make_lock, remove_lock
|
||||
from ldap_crans import adherent, crans_ldap, crans, club, blacklist_items, isadm, isdeconnecteur, ann_scol, droits_possibles, smtpserv, script_utilisateur
|
||||
from ldap_crans import crans_ldap, blacklist_items, isadm, isdeconnecteur, ann_scol, droits_possibles, smtpserv, script_utilisateur
|
||||
from ldap_crans import Adherent, AssociationCrans, Club
|
||||
from ldap_crans import Machine, MachineFixe, MachineWifi, MachineCrans, BorneWifi
|
||||
|
||||
def dialog(arg) :
|
||||
|
@ -1155,7 +1156,7 @@ def set_machine(machine) :
|
|||
* Remarque
|
||||
Si borne wifi demande aussi canal et puissance
|
||||
"""
|
||||
if machine.proprietaire().__class__ == crans :
|
||||
if machine.proprietaire().__class__ == AssociationCrans:
|
||||
if not isadm :
|
||||
arg = u'--title "Erreur" '
|
||||
arg+= u'--msgbox "Vous n\'avez pas les droits de modification de cette machine.\n\n" 0 0'
|
||||
|
@ -1184,7 +1185,7 @@ def set_machine(machine) :
|
|||
p = u'Mettre le lieu de la borne comme première remarque.'
|
||||
arg+= u'"Canaux :" 2 35 "%s" 2 43 14 0 ' % machine.canal(None,False)
|
||||
arg+= u'"Puissance :" 3 35 "%s" 3 47 4 0 ' % machine.puissance()
|
||||
if isadm and machine.proprietaire().__class__ == crans :
|
||||
if isadm and machine.proprietaire().__class__ == AssociationCrans:
|
||||
arg+= u'"Prise :" 8 1 "%s" 8 9 5 0 ' % machine.prise()
|
||||
|
||||
else :
|
||||
|
@ -1237,7 +1238,7 @@ def set_machine(machine) :
|
|||
try : machine.puissance(result[8])
|
||||
except ValueError, c : err += c.args[0] + '\n'
|
||||
|
||||
if isadm and machine.proprietaire().__class__ == crans :
|
||||
if isadm and machine.proprietaire().__class__ == AssociationCrans:
|
||||
try : machine.prise(result[-1])
|
||||
except ValueError,c : err += c.args[0] + '\n'
|
||||
|
||||
|
@ -1641,7 +1642,7 @@ def select(clas,quoi,mde='') :
|
|||
else :
|
||||
raise TypeError('Argument fonction invalide')
|
||||
|
||||
if not valid or ( len(valid)==1 and quoi[-1] == 'a' and valid[0].__class__ == crans ) :
|
||||
if not valid or (len(valid) == 1 and quoi[-1] == 'a' and valid[0].__class__ == AssociationCrans):
|
||||
arg = u'--title "Recherche" '
|
||||
arg+= u'--msgbox "Aucun résultat.\n\n\n" 0 0'
|
||||
dialog(arg)
|
||||
|
@ -1716,12 +1717,12 @@ def menu_principal() :
|
|||
arg+= u'--help-button --item-help --cancel-label "Quitter" '
|
||||
arg+= u'--default-item "%s" ' % choix
|
||||
arg+= u'--menu "Que souhaitez vous faire ?" 0 55 13 '
|
||||
if proprio.__class__ == adherent :
|
||||
if proprio.__class__ == Adherent :
|
||||
arg+= u'"mAc"'
|
||||
elif proprio.__class__ == club :
|
||||
elif proprio.__class__ == Club :
|
||||
arg+= u'"mCc"'
|
||||
if proprio :
|
||||
if proprio.__class__ != crans :
|
||||
if proprio.__class__ != AssociationCrans:
|
||||
arg+= u' "Modifier l\'inscription de %s" "" ' % proprio.Nom()
|
||||
arg+= u'"aMc" "Ajouter une machine à %s" "" ' % proprio.Nom()
|
||||
if becane :
|
||||
|
@ -1763,7 +1764,7 @@ def menu_principal() :
|
|||
|
||||
if choix=='aA' :
|
||||
# Inscription nouvel adhérent
|
||||
proprio = adherent()
|
||||
proprio = Adherent()
|
||||
if new_adher(proprio) :
|
||||
del proprio
|
||||
proprio = None
|
||||
|
@ -1795,7 +1796,7 @@ def menu_principal() :
|
|||
|
||||
elif choix=='aC' :
|
||||
# Ajout d'un club
|
||||
proprio = club()
|
||||
proprio = Club()
|
||||
if new_club(proprio) :
|
||||
del proprio ; proprio = None
|
||||
else : choix = 'aMc' # ajout d'une machine
|
||||
|
@ -1831,13 +1832,13 @@ def menu_principal() :
|
|||
|
||||
elif choix=='aKM' :
|
||||
# Ajout machine au crans
|
||||
becane = MachineCrans(crans(db.conn))
|
||||
becane = MachineCrans(AssociationCrans(db.conn))
|
||||
if set_machine(becane) :
|
||||
becane.restore()
|
||||
|
||||
elif choix=='aKB' :
|
||||
# Ajout borne wifi
|
||||
becane = BorneWifi(crans(db.conn))
|
||||
becane = BorneWifi(AssociationCrans(db.conn))
|
||||
if set_machine(becane) :
|
||||
becane.restore()
|
||||
|
||||
|
@ -1845,7 +1846,7 @@ def menu_principal() :
|
|||
|
||||
if choix=='aMc' :
|
||||
# Ajout d'une machine à l'adhérent/au club courant
|
||||
if proprio.__class__ == club or proprio.etudes(0) != "ENS" or \
|
||||
if proprio.__class__ == Club or proprio.etudes(0) != "ENS" or \
|
||||
proprio.etudes(1) != "Pers":
|
||||
|
||||
# On ne peut avoir de machine fixe si on n'a pas payé
|
||||
|
@ -1857,7 +1858,7 @@ def menu_principal() :
|
|||
# (expérimental)
|
||||
|
||||
# On récupère la liste des machines fixes
|
||||
if (proprio.__class__ == club or (caution_ok and \
|
||||
if (proprio.__class__ == Club or (caution_ok and \
|
||||
(not proprio.machines_fixes() or proprio.droits()))):
|
||||
arg = u'--title "Nouvelle machine" '
|
||||
arg+= u'--menu "Type de machine ?" 0 0 0 '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue