2016-10-30 16:30:09 +00:00
|
|
|
import datetime
|
2016-10-30 16:56:04 +00:00
|
|
|
import bumblebee.module
|
|
|
|
|
|
|
|
class Module(bumblebee.module.Module):
|
2016-10-31 09:45:15 +00:00
|
|
|
def __init__(self, args):
|
2016-10-31 10:11:53 +00:00
|
|
|
module = self.__module__.split(".")[-1]
|
|
|
|
|
|
|
|
default = "%x" if module == "date" else "%X"
|
|
|
|
self._fmt = args[0] if args else default
|
|
|
|
|
2016-10-31 09:45:15 +00:00
|
|
|
super(Module, self).__init__(args)
|
2016-10-30 16:30:09 +00:00
|
|
|
|
|
|
|
def data(self):
|
2016-10-31 09:53:31 +00:00
|
|
|
return datetime.datetime.now().strftime(self._fmt)
|
2016-10-30 16:30:09 +00:00
|
|
|
|
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|