utils.Window to return unicode in all cases
This commit is contained in:
parent
e784dab578
commit
0afa304f52
1 changed files with 5 additions and 2 deletions
|
@ -207,18 +207,21 @@ def window(property, value=None, clear=False, windowid=10000):
|
||||||
if clear:
|
if clear:
|
||||||
WINDOW.clearProperty(property)
|
WINDOW.clearProperty(property)
|
||||||
elif value is not None:
|
elif value is not None:
|
||||||
|
# Takes unicode or string by default!
|
||||||
WINDOW.setProperty(property, value)
|
WINDOW.setProperty(property, value)
|
||||||
else: #getproperty returns string so convert to unicode
|
else: #getproperty returns string so convert to unicode
|
||||||
return WINDOW.getProperty(property)#.decode("utf-8")
|
return unicode(WINDOW.getProperty(property))
|
||||||
|
|
||||||
def settings(setting, value=None):
|
def settings(setting, value=None):
|
||||||
# Get or add addon setting
|
# Get or add addon setting
|
||||||
addon = xbmcaddon.Addon(id='plugin.video.plexkodiconnect')
|
addon = xbmcaddon.Addon(id='plugin.video.plexkodiconnect')
|
||||||
|
|
||||||
if value is not None:
|
if value is not None:
|
||||||
|
# Takes string or unicode by default!
|
||||||
addon.setSetting(setting, value)
|
addon.setSetting(setting, value)
|
||||||
else:
|
else:
|
||||||
return addon.getSetting(setting) #returns unicode object
|
# Returns unicode by default!
|
||||||
|
return addon.getSetting(setting)
|
||||||
|
|
||||||
def language(stringid):
|
def language(stringid):
|
||||||
# Central string retrieval
|
# Central string retrieval
|
||||||
|
|
Loading…
Reference in a new issue