diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2017-05-27 12:12:16 +0200 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2017-05-27 12:12:16 +0200 |
commit | c8345be8af86ae12d12e3d9a70e74e75a176e857 (patch) | |
tree | d2f04bc163d4f53a8664cf21cc7581e33e060071 | |
parent | f047edbc55a9d8cce7931c0cddc255bb676bd83d (diff) |
Debianless Age
-rwxr-xr-x | debdate | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -34,6 +34,7 @@ RELEASES = [ (datetime.date(1996, 6, 17), 'buzz'), ] MSG = "Today is day {dody} of year {yodr} of the {release}" +ERR_MSG = "Today is {isodate} of the Debianless Age" class DebDate: @@ -160,8 +161,12 @@ class Command: else: date = datetime.date.today() debdate = DebDate() - data = debdate.get_release(date) - print(MSG.format(**data)) + try: + data = debdate.get_release(date) + except OutsideTimeError: + print(ERR_MSG.format(isodate=date.strftime("%Y-%m-%d"))) + else: + print(MSG.format(**data)) def main(self): self.setup_parser() |