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:
|
||||
WINDOW.clearProperty(property)
|
||||
elif value is not None:
|
||||
# Takes unicode or string by default!
|
||||
WINDOW.setProperty(property, value)
|
||||
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):
|
||||
# Get or add addon setting
|
||||
addon = xbmcaddon.Addon(id='plugin.video.plexkodiconnect')
|
||||
|
||||
if value is not None:
|
||||
# Takes string or unicode by default!
|
||||
addon.setSetting(setting, value)
|
||||
else:
|
||||
return addon.getSetting(setting) #returns unicode object
|
||||
# Returns unicode by default!
|
||||
return addon.getSetting(setting)
|
||||
|
||||
def language(stringid):
|
||||
# Central string retrieval
|
||||
|
|
Loading…
Reference in a new issue