diff --git a/bumblebee/config.py b/bumblebee/config.py index 57958ac..49005ad 100644 --- a/bumblebee/config.py +++ b/bumblebee/config.py @@ -78,6 +78,10 @@ class Config(object): return self._store.get(name, default) def increase(self, name, limit, default): + if not name in self._store: + self._store[name] = default + return default + self._store[name] += 1 if self._store[name] >= limit: self._store[name] = default diff --git a/bumblebee/theme.py b/bumblebee/theme.py index 2f7d5c7..42e6c01 100644 --- a/bumblebee/theme.py +++ b/bumblebee/theme.py @@ -120,9 +120,8 @@ class Theme: value = instance_state_theme.get(name, value) if type(value) is list: - key = "{}{}".format(repr(widget), value) - idx = self._config.parameter(key, 0) - self._config.increase(key, len(value), 0) + key = "{}{}".format(widget.instance(), value) + idx = self._config.increase(key, len(value), 0) value = value[idx] return value if value else default