diff --git a/gestion/gest_crans.py b/gestion/gest_crans.py index e825873a..4697cab4 100644 --- a/gestion/gest_crans.py +++ b/gestion/gest_crans.py @@ -2264,7 +2264,7 @@ Subject: Bugreport %s if debug: print u"Les services suivants seront redémarrés: " for s in serv: - print '\t%s' % s + print u'\t%s' % s if debug: print '-*- Fin -*-' diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 870f03db..76ba2397 100644 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -242,18 +242,21 @@ class Service: self.args = args self.start = map(int, start) - def __str__(self): + def __unicode__(self): starting = self.start starting.sort() - dates = ' et '.join(map(lambda t: t < time.time() and \ - "maintenant" or time.strftime(date_format, + dates = u' et '.join(map(lambda t: t < time.time() and \ + u"maintenant" or time.strftime(date_format, time.localtime(t)), self.start)) - dates = " à partir d%s %s" % (dates.startswith("maintenant") and "e" or "u", + dates = u" à partir d%s %s" % (dates.startswith(u"maintenant") and u"e" or u"u", dates) - return ("%s(%s)%s" % (self.nom, - ','.join(self.args), - dates)).replace(" et maintenant", "") + return (u"%s(%s)%s" % (self.nom, + u','.join(self.args), + dates)).replace(u" et maintenant", u"") + + def __str__(self): + return self.__unicode__().encode("ascii", "ignore") class CransLdap: """