From f3186853ecccb730e18024e63e77bed1a4525a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Thu, 15 Oct 2015 14:32:01 +0200 Subject: [PATCH] Les timestamps dans l'historique contiennent des secondes --- gestion/ldap_crans.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index c306a9f6..76a74bab 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -407,7 +407,7 @@ class Service: starting = self.start starting.sort() dates = u' et '.join(map(lambda t: t < time.time() and \ - u"maintenant" or time.strftime(date_format, + u"maintenant" or time.strftime(date_format_new, time.localtime(t)), self.start)) dates = u" à partir d%s %s" % (dates.startswith(u"maintenant") and u"e" or u"u", @@ -1353,7 +1353,7 @@ class BaseClasseCrans(CransLdap): modif = ', '.join(liste_historique) timestamp = time.localtime() - hist = "%s, %s" % ( time.strftime(date_format, timestamp), script_utilisateur ) + hist = "%s, %s" % ( time.strftime(date_format_new, timestamp), script_utilisateur ) if self.modifs.has_key('derniereConnexion'): # On nettoie l'historique pour ne garder que la dernière modification @@ -1365,7 +1365,7 @@ class BaseClasseCrans(CransLdap): # On loggue try: fd = file('%s/%s_%s_%s' % ("%s/logs" % config.cimetiere, str(self.__class__).split('.')[-1], - time.strftime('%Y-%m-%d-%H:%M', timestamp), self.nom()), 'wb') + time.strftime('%Y-%m-%d-%H:%M:%S', timestamp), self.nom()), 'wb') fd.write("%s\n" % self._data) fd.close() except: @@ -1456,12 +1456,12 @@ class BaseClasseCrans(CransLdap): # Sauvegarde t = str(self.__class__).split('.')[-1] fd = open('%s/%s/%s_%s' % (config.cimetiere, t, - time.strftime('%Y-%m-%d-%H:%M'), + time.strftime('%Y-%m-%d-%H:%M:%S'), self.nom()), 'wb') self.conn = None # Fermeture des connexions à la base sinon cPickle ne marchera pas cPickle.dump(self, fd, 2) fd.close() - index = u"%s, %s : %s %s # %s\n" % (time.strftime(date_format), + index = u"%s, %s : %s %s # %s\n" % (time.strftime(date_format_new), script_utilisateur, t, self.Nom(), decode(comment))