Theme.exclude now can take a list

This commit is contained in:
Ivan Chinenov 2019-12-11 14:23:57 +03:00
parent c070d9b333
commit 4b0ac88e62
2 changed files with 8 additions and 1 deletions

View file

@ -226,7 +226,7 @@ class Theme(object):
if not self._widget:
self._widget = widget
if self._widget.get("theme.exclude", "") == name:
if name in bumblebee.util.aslist(self._widget.get("theme.exclude", "")):
return None
if self._widget != widget:

View file

@ -19,6 +19,13 @@ def asbool(val):
val = str(val).strip().lower()
return val in ("t", "true", "y", "yes", "on", "1")
def aslist(val):
if val is None:
return []
if isinstance(val, list):
return val
return str(val).replace(' ', '').strip(',')
def execute(cmd, wait=True):
logging.info("executing command '{}'".format(cmd))
args = shlex.split(cmd)