minor fixes

This commit is contained in:
Rob Weber 2015-06-19 14:30:45 -05:00
parent 9add0b2981
commit 97a977c721

View File

@ -314,7 +314,6 @@ class XbmcBackup:
self.remote_vfs = XBMCFileSystem(xbmc.translatePath("special://temp/" + self.restore_point.split(".")[0] + "/")) self.remote_vfs = XBMCFileSystem(xbmc.translatePath("special://temp/" + self.restore_point.split(".")[0] + "/"))
self.xbmc_vfs.set_root(xbmc.translatePath("special://home/")) self.xbmc_vfs.set_root(xbmc.translatePath("special://home/"))
#for restores remote path must exist #for restores remote path must exist
if(not self.remote_vfs.exists(self.remote_vfs.root_path)): if(not self.remote_vfs.exists(self.remote_vfs.root_path)):
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30045),self.remote_vfs.root_path) xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30045),self.remote_vfs.root_path)
@ -535,12 +534,15 @@ class XbmcBackup:
result = False result = False
#copy the file and open it #copy the file and open it
self.xbmc_vfs.put(path + "xbmcbackup.val",xbmc.translatePath(utils.data_dir() + "xbmcbackup.val")) self.xbmc_vfs.put(path + "xbmcbackup.val",xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"))
vFile = xbmcvfs.File(xbmc.translatePath(utils.data_dir() + "xbmcbackup.val"),'r') vFile = xbmcvfs.File(xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"),'r')
jsonString = vFile.read() jsonString = vFile.read()
vFile.close() vFile.close()
#delete after checking
xbmcvfs.delete(xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"))
try: try:
json_dict = json.loads(jsonString) json_dict = json.loads(jsonString)
@ -569,6 +571,9 @@ class FileManager:
def walkTree(self,directory): def walkTree(self,directory):
if(directory[-1:] == '/'):
directory = directory[:-1]
if(self.vfs.exists(directory + "/")): if(self.vfs.exists(directory + "/")):
dirs,files = self.vfs.listdir(directory) dirs,files = self.vfs.listdir(directory)