timers = add_title(u"Timers", timers)
return timers
-def exists(l):
- """Renvoie True si au moins un élément de l est vrai"""
- for i in l:
- if i:
- return True
- return False
-
def get_birthdays(*search):
"""Obtenir la liste des anniversaires à venir,
ou la liste des anniversaires correspondants à une recherche"""
search = [i.lower() for i in search]
tous = ("--all" in search)
for date, nom in liste:
- if tous or exists([term.lower() in nom.lower() for term in search]):
+ if tous or any([term.lower() in nom.lower() for term in search]):
thisyeardate = datetime.datetime(now.year, date.month, date.day)
delta = thisyeardate - now + datetime.timedelta(1)
age = now.year - date.year
for day in ["today", "tomorrow"]:
ssaints = saints[day]
for (sexe, saint) in ssaints:
- if exists([firstname.lower() in saint.lower().split() for firstname in firstnames]):
+ if any([firstname.lower() in saint.lower().split() for firstname in firstnames]):
towish[day].append(sexe + saint)
ttowish = []
if towish["today"]: