From 4b0ac88e62e22faf5fea41b20e670341a47dc735 Mon Sep 17 00:00:00 2001 From: Ivan Chinenov Date: Wed, 11 Dec 2019 14:23:57 +0300 Subject: [PATCH] Theme.exclude now can take a list --- bumblebee/theme.py | 2 +- bumblebee/util.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bumblebee/theme.py b/bumblebee/theme.py index d7e8471..3d5b114 100644 --- a/bumblebee/theme.py +++ b/bumblebee/theme.py @@ -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: diff --git a/bumblebee/util.py b/bumblebee/util.py index fdd3af5..6aeb803 100644 --- a/bumblebee/util.py +++ b/bumblebee/util.py @@ -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)