Factorisation.
darcs-hash:20060506042207-68412-9a1b2dc973c00b7bdcc6ca8da05d29a7e329a82b.gz
This commit is contained in:
parent
51d66c2c78
commit
0b3f36bda8
1 changed files with 6 additions and 5 deletions
|
@ -12,10 +12,12 @@ Utilis
|
|||
|
||||
import sys, os, commands
|
||||
sys.path.append('/usr/scripts/gestion')
|
||||
from ldap_crans import crans_ldap
|
||||
from ldap_crans import crans_ldap, Club, Adherent, AssociationCrans
|
||||
from gen_confs import gen_config
|
||||
from pyPgSQL import PgSQL
|
||||
|
||||
db = crans_ldap()
|
||||
|
||||
# Génération des la tables d'exemptions
|
||||
#######################################
|
||||
|
||||
|
@ -29,7 +31,7 @@ class exemptions(gen_config) :
|
|||
|
||||
def _gen (self) :
|
||||
|
||||
machines = crans_ldap().search('exempt=*')['machine']
|
||||
machines = db.search('exempt=*')['machine']
|
||||
|
||||
pgsql = PgSQL.connect(host='/var/run/postgresql', database='filtrage', user='crans')
|
||||
curseur = pgsql.cursor()
|
||||
|
@ -63,12 +65,11 @@ class machines(gen_config) :
|
|||
# recherche de toutes les machines dans ldap
|
||||
import sys
|
||||
sys.path.append('/usr/scripts/gestion')
|
||||
from ldap_crans import crans_ldap, Club, Adherent, AssociationCrans
|
||||
machines = crans_ldap().search('ip=*')['machine']
|
||||
machines = db.search('ip=*')['machine']
|
||||
|
||||
# liste des machines (on prend que les paimement ok)
|
||||
machines = self.machines
|
||||
# machines = crans_ldap().search('ip=*')['machine']
|
||||
# machines = db.search('ip=*')['machine']
|
||||
|
||||
# connexion à la base postgresql
|
||||
from pyPgSQL import PgSQL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue