From b3e17d4899125d60756c5e116c3cc5fa98c3d893 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Mon, 31 Oct 2016 14:39:52 +0100 Subject: [PATCH] [modules/date] Combine to datetime module with date and time aliases Move module "date" to "datetime" (display both date and time), and create new aliases "time" and "date" (which only show date and time, respectively). --- bumblebee/modules/date.py | 2 +- bumblebee/modules/datetime.py | 1 + bumblebee/modules/time.py | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 120000 bumblebee/modules/datetime.py diff --git a/bumblebee/modules/date.py b/bumblebee/modules/date.py index 5a370f9..bde6404 120000 --- a/bumblebee/modules/date.py +++ b/bumblebee/modules/date.py @@ -1 +1 @@ -time.py \ No newline at end of file +datetime.py \ No newline at end of file diff --git a/bumblebee/modules/datetime.py b/bumblebee/modules/datetime.py new file mode 120000 index 0000000..5a370f9 --- /dev/null +++ b/bumblebee/modules/datetime.py @@ -0,0 +1 @@ +time.py \ No newline at end of file diff --git a/bumblebee/modules/time.py b/bumblebee/modules/time.py index 5254506..a436c29 100644 --- a/bumblebee/modules/time.py +++ b/bumblebee/modules/time.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import + import datetime import bumblebee.module @@ -6,8 +8,12 @@ class Module(bumblebee.module.Module): super(Module, self).__init__(args) module = self.__module__.split(".")[-1] + default = "%x %X" + if module == "date": + default = "%x" + if module == "time": + default = "%X" - default = "%x" if module == "date" else "%X" self._fmt = args[0] if args else default