diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2019-07-13 18:33:51 +0200 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2019-07-13 18:33:51 +0200 |
commit | 3096d749d7cc826cbe814f85bef08bdb419a28c7 (patch) | |
tree | c7984b857aad929a55f5b10efa9a6cf2c0bff3dc | |
parent | 3e3eff9ee639a60052a3fb4ae2e6955d2f85ae92 (diff) |
Print a gregorian date for days different from today.
-rwxr-xr-x | debdate | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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] |