- Nouvelle methode derniereConnexion pour Adherent.

- On verifie que la nouvelle valeur n'est pas nulle dans la methode
   _set de BaseClasseCrans.

darcs-hash:20060520153737-68412-dd0a67b580cd1e23440667a6f8fae697905c7de3.gz
This commit is contained in:
glondu 2006-05-20 17:37:37 +02:00
parent 63f650cd86
commit 5499472a9c
2 changed files with 61 additions and 16 deletions

View file

@ -48,7 +48,7 @@ except:
base = None
from time import strftime, localtime
from time import strftime, localtime, time
from ldap_crans import is_actif, crans_ldap, ann_scol, AssociationCrans, hostname
from ldap_crans import MachineWifi, BorneWifi
from affich_tools import *
@ -114,7 +114,7 @@ def adhers_brief(adhers) :
adhers.sort(lambda x, y: cmp((x.nom(), x.prenom()), (y.nom(), y.prenom())))
for a in adhers:
## Etat administratif
## État administratif
ok = u'\x1b[1;32mo\x1b[1;0m'
ook = u'\x1b[1;32mO\x1b[1;0m'
nok = u'\x1b[1;31mn\x1b[1;0m'
@ -205,7 +205,7 @@ def clubs_brief(clubs) :
clubs.sort(lambda x, y: cmp(x.Nom(), y.Nom()))
for c in clubs :
## Etat administratif
## État administratif
ok = u'\x1b[1;32mo\x1b[1;0m'
ook = u'\x1b[1;32mO\x1b[1;0m'
nok = u'\x1b[1;31mn\x1b[1;0m'
@ -360,10 +360,17 @@ def adher_details(adher) :
except IOError, e:
# Pas de .forward, ou .forward privé... on laisse tomber
pass
f += coul(u'Dernière connexion : ', 'gras')
timestamp = adher.derniereConnexion()
if timestamp == 0:
f += coul(u'Jamais', 'rouge')
else:
f += coul(strftime('%d/%m/%Y %H:%M', localtime(timestamp)),
time()-timestamp > 32*24*3600 and 'rouge' or '')
f += u'\n'
# Etat administratif
f += coul(u'Etat administratif : ','gras')
# État administratif
f += coul(u'État administratif : ','gras')
jour=1
if ann_scol not in adher.carteEtudiant() :
f += coul(u"manque carte d'étudiant",'violet')
@ -406,12 +413,12 @@ def adher_details(adher) :
f += u'(%s)' % prise_etat(adher.chbre())
f += u'\n'
# Etudes
# Études
if adher.etudes(1).isdigit() :
f += coul(u'Etudes : ','gras')+ "%s %s%s\n" % \
f += coul(u'Études : ','gras')+ "%s %s%s\n" % \
( adher.etudes(0), adher.etudes(1), adher.etudes(2) )
elif adher.etudes(0) :
f += coul(u'Etudes : ','gras')+ "%s %s %s\n" % \
f += coul(u'Études : ','gras')+ "%s %s %s\n" % \
( adher.etudes(0), adher.etudes(1), adher.etudes(2) )
# Solde
@ -627,8 +634,8 @@ def club_details(club) :
# responsale
f += coul(u'Responsable : ','gras') + "%s\n" % club.responsable().Nom()
# Etat administratif
f += coul(u'Etat administratif : ','gras')
# État administratif
f += coul(u'État administratif : ','gras')
jour=1
if ann_scol not in club.paiement() :
if not jour : f += ' et '