stats_cableurs2: clean up paths & imports

On utilise /usr/scripts/python.sh en shabang qui rajoute /usr/scripts
au PYTHONPATH dès le début. Plus besoin de rajouter plusieurs sous-dossiers à
coups de sys.path.append: on référence tous les imports par rapport à ce
dossier.
This commit is contained in:
Daniel STAN 2014-01-14 20:46:02 +01:00
parent 572f4f79c8
commit 6e525ac424

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/bin/bash /usr/scripts/python.sh
# -*- coding: utf-8 -*-
#
# stats.py
@ -21,17 +21,12 @@
# Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
import sys, re, datetime, string
sys.path.append('/usr/scripts/lc_ldap')
import lc_ldap
import shortcuts
sys.path.append("/usr/scripts/gestion/")
from config import ann_scol
sys.path.append('/usr/scripts/lib')
import argparse
from lc_ldap import shortcuts
from gestion.config import ann_scol
### Appels à LDAP et tri initial sur l'année en cours
db = shortcuts.lc_ldap_readonly()
adherents=db.search(u'(&(paiement=%s)(aid=*))' % (ann_scol), sizelimit=2000)