Use util.asbool rather than manual true-value parsing
This commit is contained in:
parent
0d8d45e879
commit
f1410b7c1f
1 changed files with 2 additions and 3 deletions
|
@ -7,15 +7,14 @@ import json
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import bumblebee.store
|
import bumblebee.store
|
||||||
|
import bumblebee.util
|
||||||
_TrueValues = ["true", "t", "yes", "y", "1"]
|
|
||||||
|
|
||||||
def scrollable(func):
|
def scrollable(func):
|
||||||
def wrapper(module, widget):
|
def wrapper(module, widget):
|
||||||
text = func(module, widget)
|
text = func(module, widget)
|
||||||
if not text: return text
|
if not text: return text
|
||||||
width = widget.get("theme.width", module.parameter("width", 30))
|
width = widget.get("theme.width", module.parameter("width", 30))
|
||||||
if module.parameter("scrolling.makewide", "true").lower() in _TrueValues:
|
if bumblebee.util.asbool(module.parameter("scrolling.makewide", "true")):
|
||||||
widget.set("theme.minwidth", "A"*width)
|
widget.set("theme.minwidth", "A"*width)
|
||||||
if len(text) <= width:
|
if len(text) <= width:
|
||||||
return text
|
return text
|
||||||
|
|
Loading…
Reference in a new issue