[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.
This commit is contained in:
Tobias Witek 2016-10-31 11:11:53 +01:00
parent 23617fbdb7
commit 6278a4e564
2 changed files with 6 additions and 1 deletions

1
bumblebee/modules/date.py Symbolic link
View file

@ -0,0 +1 @@
time.py

View file

@ -3,7 +3,11 @@ import bumblebee.module
class Module(bumblebee.module.Module): class Module(bumblebee.module.Module):
def __init__(self, args): 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) super(Module, self).__init__(args)
def data(self): def data(self):