parent
17204dda91
commit
474da05929
1 changed files with 2 additions and 9 deletions
|
@ -31,15 +31,8 @@ class Module(bumblebee.engine.Module):
|
||||||
super(Module, self).__init__(engine, config,
|
super(Module, self).__init__(engine, config,
|
||||||
bumblebee.output.Widget(full_text=self.get_time))
|
bumblebee.output.Widget(full_text=self.get_time))
|
||||||
self._fmt = self.parameter("format", default_format(self.name))
|
self._fmt = self.parameter("format", default_format(self.name))
|
||||||
lcl = self.parameter("locale")
|
lcl = self.parameter("locale", ".".join(locale.getdefaultlocale()))
|
||||||
|
locale.setlocale(locale.LC_TIME, lcl.split("."))
|
||||||
# can't use the default in "parameter" because we split the
|
|
||||||
# string, while 'getdefaultlocale' already returns a tuple
|
|
||||||
if lcl is None:
|
|
||||||
self._lcl = locale.getdefaultlocale()
|
|
||||||
else:
|
|
||||||
self._lcl = lcl.split(".")
|
|
||||||
locale.setlocale(locale.LC_TIME, self._lcl)
|
|
||||||
|
|
||||||
def get_time(self, widget):
|
def get_time(self, widget):
|
||||||
return datetime.datetime.now().strftime(self._fmt)
|
return datetime.datetime.now().strftime(self._fmt)
|
||||||
|
|
Loading…
Reference in a new issue