mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-14 20:35:48 +01:00
will copy zip file from remote to dest
This commit is contained in:
parent
933fdbdf09
commit
c28f9fd26b
@ -255,18 +255,25 @@ class XbmcBackup:
|
||||
|
||||
#catch for if the restore point is actually a zip file
|
||||
if(self.restore_point.split('.')[-1] == 'zip'):
|
||||
#copy just this file from the remote vfs
|
||||
zipFile = []
|
||||
zipFile.append(self.restore_point)
|
||||
self.progressBar.updateProgress(0, "Copying Zip Archive")
|
||||
utils.log("copying zip file: " + self.restore_point)
|
||||
|
||||
#set root to data dir home
|
||||
self.xbmc_vfs.set_root(xbmc.translatePath(utils.data_dir()))
|
||||
|
||||
self.progressBar.updateProgress(0, "Copying Zip Archive")
|
||||
if(not self.xbmc_vfs.exists(xbmc.translatePath(utils.data_dir() + self.restore_point))):
|
||||
#copy just this file from the remote vfs
|
||||
zipFile = []
|
||||
zipFile.append(self.remote_base_path + self.restore_point)
|
||||
|
||||
self.backupFiles(zipFile,self.remote_vfs, self.xbmc_vfs)
|
||||
else:
|
||||
utils.log("zip file exists already")
|
||||
|
||||
#set the new remote vfs
|
||||
self.remote_vfs = ZipFileSystem(xbmc.translatePath(utils.data_dir() + self.restore_point),'r')
|
||||
self.remote_vfs.set_root(self.restore_point.split(".")[0] + "/")
|
||||
|
||||
else:
|
||||
#for restores remote path must exist
|
||||
if(not self.remote_vfs.exists(self.remote_vfs.root_path)):
|
||||
|
@ -62,6 +62,7 @@ class XBMCFileSystem(Vfs):
|
||||
return xbmcvfs.mkdir(directory)
|
||||
|
||||
def put(self,source,dest):
|
||||
utils.log(source + ":" + dest)
|
||||
return xbmcvfs.copy(source,dest)
|
||||
|
||||
def rmdir(self,directory):
|
||||
@ -80,7 +81,6 @@ class ZipFileSystem(Vfs):
|
||||
self.root_path = ""
|
||||
self.zip = zipfile.ZipFile(rootString,mode=mode)
|
||||
|
||||
|
||||
def listdir(self,directory):
|
||||
return True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user