added some encoding options to minimize international text from crashing addon

This commit is contained in:
robweber 2012-08-01 14:50:07 -05:00
parent 1e41f75df4
commit 2c2b87b861

View File

@ -72,7 +72,7 @@ class FileManager:
def addFile(self,filename): def addFile(self,filename):
#write the full remote path name of this file #write the full remote path name of this file
if(self.verbose_log): if(self.verbose_log):
xbmc.log("Add File: " + filename) xbmc.log("Add File: " + filename.encode("utf-8"))
self.fileArray.append(filename) self.fileArray.append(filename)
def getFileList(self): def getFileList(self):
@ -93,10 +93,9 @@ class XbmcBackup:
fileManager = None fileManager = None
def __init__(self): def __init__(self):
self.local_path = xbmc.translatePath("special://home") self.local_path = xbmc.translatePath("special://home").encode("utf-8");
if(self.Addon.getSetting('remote_selection') == '1' and vfs.exists(self.Addon.getSetting('remote_path_2'))): if(self.Addon.getSetting('remote_selection') == '1' and vfs.exists(self.Addon.getSetting('remote_path_2'))):
xbmc.log(str(self.Addon.getSetting('remote_path_2')))
self.remote_path = self.Addon.getSetting('remote_path_2') self.remote_path = self.Addon.getSetting('remote_path_2')
self.Addon.setSetting("remote_path","") self.Addon.setSetting("remote_path","")
elif(self.Addon.getSetting('remote_selection') == '0' and vfs.exists(self.Addon.getSetting("remote_path"))): elif(self.Addon.getSetting('remote_selection') == '0' and vfs.exists(self.Addon.getSetting("remote_path"))):
@ -107,6 +106,8 @@ class XbmcBackup:
else: else:
self.remote_path = "" self.remote_path = ""
self.remote_path = self.remote_path.encode("utf-8");
self.log("Starting") self.log("Starting")
self.log('Local Dir: ' + self.local_path) self.log('Local Dir: ' + self.local_path)
self.log('Remote Dir: ' + self.remote_path) self.log('Remote Dir: ' + self.remote_path)