From 927e39a870c063589603b99f95dea02e544a1af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Mon, 1 Sep 2014 23:53:01 +0200 Subject: [PATCH] [stats_cableurs2] Fial --- utils/stats_cableurs2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/stats_cableurs2.py b/utils/stats_cableurs2.py index f9b85ff7..4dbc6705 100755 --- a/utils/stats_cableurs2.py +++ b/utils/stats_cableurs2.py @@ -58,7 +58,7 @@ def actions_cableurs(): champ=parse_historique(histo[j])[0] champ_action=parse_historique(histo[j])[1] date=parse_historique(histo[j])[2] - if ((champ_action == u'inscription' or champ_action == u'debutAdhesion+%s' % (crans_utils.toGeneralizedTimeFormat(config.debut_periode_transitoire),) ) or len(champ) > 5 and (champ[5] == u'debutAdhesion+%s' % (crans_utils.toGeneralizedTimeFormat(config.debut_periode_transitoire), ) or champ[5] == u'inscription')) and date > datetime.date(config.ann_scol, 8, 16) : + if ((champ_action == u'inscription' or u"debutAdhesion+" in champ_action) or len(champ) > 5 and (u"debutAdhesion+" in champ[5] or champ[5] == u'inscription')) and date > datetime.date(config.ann_scol, 8, 16) : historique.append(champ) return historique @@ -76,7 +76,7 @@ def score_cableurs(): histo_action = historique[l][4] if histo_uid == uid and histo_action == u'inscription': inscriptions = inscriptions+1 - if histo_uid == uid and (histo_action == u'debutAdhesion+%s' % (crans_utils.toGeneralizedTimeFormat(config.debut_periode_transitoire),) or (len(historique[l])>5 and (historique[l][5] == u'debutAdhesion+%s' % (crans_utils.toGeneralizedTimeFormat(config.debut_periode_transitoire),)))): + if histo_uid == uid and (u"debutAdhesion+" in histo_action or (len(historique[l])>5 and (u'debutAdhesion+' in historique[l][5]))): reinscriptions = reinscriptions+1 score = 2*inscriptions + reinscriptions scores.append(["%s %s" % (prenom, nom), score, inscriptions, reinscriptions])