Commit 0b3f36bd authored by glondu's avatar glondu

Factorisation.

darcs-hash:20060506042207-68412-9a1b2dc973c00b7bdcc6ca8da05d29a7e329a82b.gz
parent 51d66c2c
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment