From 4dd6c90ab9cd2140cb6207f71a5f1d2612a4a272 Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Sun, 12 Jan 2014 10:12:09 -0600 Subject: [PATCH] modified directories not backing up - thanks bertel333 --- addon.xml | 2 +- changelog.txt | 4 ++++ resources/lib/backup.py | 13 +++++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/addon.xml b/addon.xml index d1f0afd..c3e7668 100644 --- a/addon.xml +++ b/addon.xml @@ -1,6 +1,6 @@  + name="XBMC Backup" version="0.4.4" provider-name="robweber"> diff --git a/changelog.txt b/changelog.txt index dfdea64..f334767 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +Version 0.4.4 + +modified the check for invalid file types + Version 0.4.3 added error message if remote directory is blank diff --git a/resources/lib/backup.py b/resources/lib/backup.py index a53e209..1e3d45e 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -387,6 +387,7 @@ class FileManager: self.vfs = vfs def walkTree(self,directory): + if(self.vfs.exists(directory)): dirs,files = self.vfs.listdir(directory) @@ -394,13 +395,21 @@ class FileManager: for aDir in dirs: dirPath = xbmc.translatePath(directory + "/" + aDir) file_ext = aDir.split('.')[-1] - self.addFile("-" + dirPath) + self.addFile("-" + dirPath) + #catch for "non directory" type files - if (not any(file_ext in s for s in self.not_dir)): + shouldWalk = True + + for s in file_ext: + if(s in self.not_dir): + shouldWalk = False + + if(shouldWalk): self.walkTree(dirPath) #copy all the files for aFile in files: + utils.log(aFile) filePath = xbmc.translatePath(directory + "/" + aFile) self.addFile(filePath)