spelling
This commit is contained in:
parent
398bd1644f
commit
30dfe99e37
1 changed files with 20 additions and 20 deletions
|
@ -23,15 +23,15 @@ import xbmcvfs
|
|||
|
||||
|
||||
def logMsg(title, msg, level=1):
|
||||
|
||||
|
||||
# Get the logLevel set in UserClient
|
||||
try:
|
||||
logLevel = int(window('emby_logLevel'))
|
||||
except ValueError:
|
||||
logLevel = 0
|
||||
|
||||
|
||||
if logLevel >= level:
|
||||
|
||||
|
||||
if logLevel == 2: # inspect.stack() is expensive
|
||||
try:
|
||||
xbmc.log("%s -> %s : %s" % (title, inspect.stack()[1][3], msg))
|
||||
|
@ -46,13 +46,13 @@ def logMsg(title, msg, level=1):
|
|||
def window(property, value=None, clear=False, windowid=10000):
|
||||
# Get or set window property
|
||||
WINDOW = xbmcgui.Window(windowid)
|
||||
|
||||
|
||||
#setproperty accepts both string and unicode but utf-8 strings are adviced by kodi devs because some unicode can give issues
|
||||
'''if isinstance(property, unicode):
|
||||
property = property.encode("utf-8")
|
||||
if isinstance(value, unicode):
|
||||
value = value.encode("utf-8")'''
|
||||
|
||||
|
||||
if clear:
|
||||
WINDOW.clearProperty(property)
|
||||
elif value is not None:
|
||||
|
@ -73,7 +73,7 @@ def language(stringid):
|
|||
return string
|
||||
|
||||
def kodiSQL(media_type="video"):
|
||||
|
||||
|
||||
if media_type == "emby":
|
||||
dbPath = xbmc.translatePath("special://database/emby.db").decode('utf-8')
|
||||
elif media_type == "music":
|
||||
|
@ -82,7 +82,7 @@ def kodiSQL(media_type="video"):
|
|||
dbPath = xbmc.translatePath("special://database/Textures13.db").decode('utf-8')
|
||||
else:
|
||||
dbPath = getKodiVideoDBPath()
|
||||
|
||||
|
||||
connection = sqlite3.connect(dbPath)
|
||||
return connection
|
||||
|
||||
|
@ -143,7 +143,7 @@ def setScreensaver(value):
|
|||
'value': value
|
||||
}
|
||||
}
|
||||
logMsg("EMBY", "Toggling screensaver: %s %s" % (value, xbmc.executeJSONRPC(json.dumps(query))), 1)
|
||||
logMsg("EMBY", "Toggling screensaver: %s %s" % (value, xbmc.executeJSONRPC(json.dumps(query))), 1)
|
||||
|
||||
def reset():
|
||||
|
||||
|
@ -211,7 +211,7 @@ def reset():
|
|||
cursor.close()
|
||||
|
||||
# Offer to wipe cached thumbnails
|
||||
resp = dialog.yesno("Warning", "Removed all cached artwork?")
|
||||
resp = dialog.yesno("Warning", "Remove all cached artwork?")
|
||||
if resp:
|
||||
logMsg("EMBY", "Resetting all cached artwork.", 0)
|
||||
# Remove all existing textures first
|
||||
|
@ -225,7 +225,7 @@ def reset():
|
|||
xbmcvfs.delete(os.path.join(path+dir.decode('utf-8'),file.decode('utf-8')))
|
||||
else:
|
||||
xbmcvfs.delete(os.path.join(path.encode('utf-8')+dir,file))
|
||||
|
||||
|
||||
# remove all existing data from texture DB
|
||||
connection = kodiSQL('texture')
|
||||
cursor = connection.cursor()
|
||||
|
@ -237,8 +237,8 @@ def reset():
|
|||
cursor.execute("DELETE FROM " + tableName)
|
||||
connection.commit()
|
||||
cursor.close()
|
||||
|
||||
# reset the install run flag
|
||||
|
||||
# reset the install run flag
|
||||
settings('SyncInstallRunDone', value="false")
|
||||
|
||||
# Remove emby info
|
||||
|
@ -260,7 +260,7 @@ def profiling(sortby="cumulative"):
|
|||
# Will print results to Kodi log
|
||||
def decorator(func):
|
||||
def wrapper(*args, **kwargs):
|
||||
|
||||
|
||||
pr = cProfile.Profile()
|
||||
|
||||
pr.enable()
|
||||
|
@ -304,7 +304,7 @@ def normalize_nodes(text):
|
|||
# with dots at the end
|
||||
text = text.rstrip('.')
|
||||
text = unicodedata.normalize('NFKD', unicode(text, 'utf-8')).encode('ascii', 'ignore')
|
||||
|
||||
|
||||
return text
|
||||
|
||||
def normalize_string(text):
|
||||
|
@ -353,7 +353,7 @@ def sourcesXML():
|
|||
root = etree.Element('sources')
|
||||
else:
|
||||
root = xmlparse.getroot()
|
||||
|
||||
|
||||
|
||||
video = root.find('video')
|
||||
if video is None:
|
||||
|
@ -365,7 +365,7 @@ def sourcesXML():
|
|||
for source in root.findall('.//path'):
|
||||
if source.text == "smb://":
|
||||
count -= 1
|
||||
|
||||
|
||||
if count == 0:
|
||||
# sources already set
|
||||
break
|
||||
|
@ -417,7 +417,7 @@ def passwordsXML():
|
|||
break
|
||||
else:
|
||||
logMsg("EMBY", "Failed to find saved server: %s in passwords.xml" % credentials, 1)
|
||||
|
||||
|
||||
settings('networkCreds', value="")
|
||||
xbmcgui.Dialog().notification(
|
||||
heading="Emby for Kodi",
|
||||
|
@ -469,7 +469,7 @@ def passwordsXML():
|
|||
# Force Kodi to see the credentials without restarting
|
||||
xbmcvfs.exists(topath)
|
||||
|
||||
# Add credentials
|
||||
# Add credentials
|
||||
settings('networkCreds', value="%s" % server)
|
||||
logMsg("EMBY", "Added server: %s to passwords.xml" % server, 1)
|
||||
# Prettify and write to file
|
||||
|
@ -477,7 +477,7 @@ def passwordsXML():
|
|||
indent(root)
|
||||
except: pass
|
||||
etree.ElementTree(root).write(xmlpath)
|
||||
|
||||
|
||||
dialog.notification(
|
||||
heading="Emby for Kodi",
|
||||
message="%s added to passwords.xml" % server,
|
||||
|
@ -508,7 +508,7 @@ def playlistXSP(mediatype, tagname, viewid, viewtype="", delete=False):
|
|||
if delete:
|
||||
xbmcvfs.delete(xsppath)
|
||||
logMsg("EMBY", "Successfully removed playlist: %s." % tagname, 1)
|
||||
|
||||
|
||||
return
|
||||
|
||||
# Using write process since there's no guarantee the xml declaration works with etree
|
||||
|
|
Loading…
Reference in a new issue