[modules/datetime] Re-enable datetime module

Add datetime module + aliases date and time.

see #23
This commit is contained in:
Tobi-wan Kenobi 2016-12-09 07:11:23 +01:00
parent 2fa8d7b778
commit f40418475f
7 changed files with 51 additions and 4 deletions

View file

@ -31,10 +31,12 @@ class Theme(object):
return self._get(widget, "suffix", None)
def loads(self, data):
"""Initialize the theme from a JSON string"""
theme = json.loads(data)
self._init(theme)
def _load_icons(self, name):
"""Load icons for a theme"""
path = "{}/icons/".format(theme_path())
return self.load(name, path=path)
@ -52,7 +54,7 @@ class Theme(object):
raise bumblebee.error.ThemeLoadError("no such theme: {}".format(name))
def _get(self, widget, name, default=None):
"""Return the config value 'name' for 'widget'"""
module_theme = self._theme.get(widget.module(), {})
padding = None
@ -71,6 +73,7 @@ class Theme(object):
# http://blog.impressiver.com/post/31434674390/deep-merge-multiple-python-dicts
# nicely done :)
def _merge(self, target, *args):
"""Merge two arbitrarily nested data structures"""
if len(args) > 1:
for item in args:
self._merge(item)