From dc1600000d772a75a853d45713b70d796e54823b Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Mon, 3 Feb 2014 17:03:51 +0100 Subject: [PATCH] [BirthDate] Un coup de PEP8 --- wiki/macro/BirthDate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wiki/macro/BirthDate.py b/wiki/macro/BirthDate.py index 97dfbaba..463d5177 100644 --- a/wiki/macro/BirthDate.py +++ b/wiki/macro/BirthDate.py @@ -14,10 +14,10 @@ def execute(macro, text): year, month, day = text.split(",") y, m, d = int(year), int(month), int(day) now = datetime.datetime(*time.localtime()[:6]) - if m==2 and d==29: - birthdate = datetime.datetime(now.year, 3, 01) - if now.month==2 and now.day==29: - now = datetime.datetime(now.year, 3, 01) + if (m, d) == (2, 29): + birthdate = datetime.datetime(now.year, 3, 1) + if (now.month, now.day) == (2, 29): + now = datetime.datetime(now.year, 3, 1) else: birthdate = datetime.datetime(now.year, m, d) age = now.year - y