[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).
This commit is contained in:
parent
b0608c7054
commit
b3e17d4899
3 changed files with 9 additions and 2 deletions
|
@ -1 +1 @@
|
||||||
time.py
|
datetime.py
|
1
bumblebee/modules/datetime.py
Symbolic link
1
bumblebee/modules/datetime.py
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
time.py
|
|
@ -1,3 +1,5 @@
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import bumblebee.module
|
import bumblebee.module
|
||||||
|
|
||||||
|
@ -6,8 +8,12 @@ class Module(bumblebee.module.Module):
|
||||||
super(Module, self).__init__(args)
|
super(Module, self).__init__(args)
|
||||||
|
|
||||||
module = self.__module__.split(".")[-1]
|
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
|
self._fmt = args[0] if args else default
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue