finished the different backup selection options

This commit is contained in:
Rob Weber 2012-04-19 18:00:20 -05:00
parent 3fa30e407a
commit ee880eaedf

View File

@ -38,6 +38,26 @@ class XbmcBackup:
xbmcvfs.mkdir(self.remote_path + "userdata/addon_data")
self.walkTree(self.local_path + "userdata/addon_data/")
if(self.Addon.getSetting('backup_database') == 'true'):
xbmcvfs.mkdir(self.remote_path + "userdata/Database")
self.walkTree(self.local_path + "userdata/Database")
if(self.Addon.getSetting("backup_playlists") == 'true'):
xbmcvfs.mkdir(self.remote_path + "userdata/playlists")
self.walkTree(self.local_path + "userdata/playlists")
if(self.Addon.getSetting("backup_thumbnails") == "true"):
xbmcvfs.mkdir(self.remote_path + "userdata/Thumbnails")
self.walkTree(self.local_path + "userdata/Thumbnails")
if(self.Addon.getSetting("backup_config") == "true"):
#this on is an oddity
configFiles = os.listdir(self.local_path + "userdata/")
for aFile in configFiles:
if(aFile.endswith(".xml")):
self.log("Copying: " + self.local_path + "userdata/" + aFile)
xbmcvfs.copy(self.local_path + "userdata/" + aFile,self.remote_path + "userdata/" + aFile)
def walkTree(self,directory):
for (path, dirs, files) in os.walk(directory):
#get the relative part of this path