Merge pull request #478 from JohnDowson/List-exclude

theme.exclude now takes a comma separated list
This commit is contained in:
tobi-wan-kenobi 2019-12-12 07:21:15 +01:00 committed by GitHub
commit 3d6448cca6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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(' ', '').split(',')
def execute(cmd, wait=True):
logging.info("executing command '{}'".format(cmd))
args = shlex.split(cmd)