From 3096d749d7cc826cbe814f85bef08bdb419a28c7 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Sat, 13 Jul 2019 18:33:51 +0200 Subject: Print a gregorian date for days different from today. --- debdate | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/debdate b/debdate index ed9542f..f92d371 100755 --- a/debdate +++ b/debdate @@ -35,9 +35,9 @@ RELEASES = [ (datetime.date(1996, 12, 12), 'rex'), (datetime.date(1996, 6, 17), 'buzz'), ] -MSG = "Today is day {dody} of year {yodr} of the {release}" -FUTURE_MSG = "Today could be day {dody} of year {yodr} of the {release}" -ERR_MSG = "Today is {isodate} of the Debianless Age" +MSG = "{today} is day {dody} of year {yodr} of the {release}" +FUTURE_MSG = "{today} could be day {dody} of year {yodr} of the {release}" +ERR_MSG = "{isodate} is in the Debianless Age" class DebDate: @@ -80,6 +80,10 @@ class DebDate: data['certain'] = math.exp((today - day).days / 365.25 ) else: data['certain'] = 1 + if day == today: + data['today'] = 'Today' + else: + data['today'] = day.isoformat() for r in self.releases: epoch = r[0] data['release'] = r[1] -- cgit v1.2.3