modified directories not backing up - thanks bertel333

This commit is contained in:
Rob Weber 2014-01-12 10:12:09 -06:00
parent d28596728b
commit 4dd6c90ab9
3 changed files with 16 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.xbmcbackup" <addon id="script.xbmcbackup"
name="XBMC Backup" version="0.4.3" provider-name="robweber"> name="XBMC Backup" version="0.4.4" provider-name="robweber">
<requires> <requires>
<import addon="xbmc.python" version="2.1.0"/> <import addon="xbmc.python" version="2.1.0"/>
</requires> </requires>

View File

@ -1,3 +1,7 @@
Version 0.4.4
modified the check for invalid file types
Version 0.4.3 Version 0.4.3
added error message if remote directory is blank added error message if remote directory is blank

View File

@ -387,6 +387,7 @@ class FileManager:
self.vfs = vfs self.vfs = vfs
def walkTree(self,directory): def walkTree(self,directory):
if(self.vfs.exists(directory)): if(self.vfs.exists(directory)):
dirs,files = self.vfs.listdir(directory) dirs,files = self.vfs.listdir(directory)
@ -395,12 +396,20 @@ class FileManager:
dirPath = xbmc.translatePath(directory + "/" + aDir) dirPath = xbmc.translatePath(directory + "/" + aDir)
file_ext = aDir.split('.')[-1] file_ext = aDir.split('.')[-1]
self.addFile("-" + dirPath) self.addFile("-" + dirPath)
#catch for "non directory" type files #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) self.walkTree(dirPath)
#copy all the files #copy all the files
for aFile in files: for aFile in files:
utils.log(aFile)
filePath = xbmc.translatePath(directory + "/" + aFile) filePath = xbmc.translatePath(directory + "/" + aFile)
self.addFile(filePath) self.addFile(filePath)