aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-05-27 12:12:16 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-05-27 12:12:16 +0200
commitc8345be8af86ae12d12e3d9a70e74e75a176e857 (patch)
treed2f04bc163d4f53a8664cf21cc7581e33e060071
parentf047edbc55a9d8cce7931c0cddc255bb676bd83d (diff)
Debianless Age
-rwxr-xr-xdebdate9
1 files changed, 7 insertions, 2 deletions
diff --git a/debdate b/debdate
index 39af2ea..e602f63 100755
--- a/debdate
+++ b/debdate
@@ -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()