From 6278a4e5649fc06e5c342e407e676cf3dfe4aa02 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Mon, 31 Oct 2016 11:11:53 +0100 Subject: [PATCH] [modules] Add module "date" as alias of "time" The "time" module now has an alias (symlink) called "date". This is used to differentiate a widget showing the time from a widget showing the date. --- bumblebee/modules/date.py | 1 + bumblebee/modules/time.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 120000 bumblebee/modules/date.py diff --git a/bumblebee/modules/date.py b/bumblebee/modules/date.py new file mode 120000 index 0000000..5a370f9 --- /dev/null +++ b/bumblebee/modules/date.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 1ae6e44..9076a94 100644 --- a/bumblebee/modules/time.py +++ b/bumblebee/modules/time.py @@ -3,7 +3,11 @@ import bumblebee.module class Module(bumblebee.module.Module): def __init__(self, args): - self._fmt = args[0] if args else "%x %X" + module = self.__module__.split(".")[-1] + + default = "%x" if module == "date" else "%X" + self._fmt = args[0] if args else default + super(Module, self).__init__(args) def data(self):