From 49f6b176e8b12c1c2ff0bb99193dcb4a4f625695 Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Thu, 26 Mar 2015 10:38:51 -0500 Subject: [PATCH 1/4] exit if we can't delete the old archive --- resources/language/English/strings.xml | 2 ++ resources/lib/backup.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index c5c8e27..1e72c8e 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -87,4 +87,6 @@ Delete Authorization Info This will delete any OAuth token files Do you want to do this? + Old Zip Archive could not be deleted + This needs to happen before a backup can run diff --git a/resources/lib/backup.py b/resources/lib/backup.py index 2093df2..792335f 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -118,7 +118,10 @@ class XbmcBackup: if(utils.getSetting("compress_backups") == 'true'): #delete old temp file if(self.xbmc_vfs.exists(xbmc.translatePath('special://temp/xbmc_backup_temp.zip'))): - self.xbmc_vfs.rmfile(xbmc.translatePath('special://temp/xbmc_backup_temp.zip')) + if(not self.xbmc_vfs.rmfile(xbmc.translatePath('special://temp/xbmc_backup_temp.zip'))): + #we had some kind of error deleting the old file + xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30096),utils.getString(30097)) + return #save the remote file system and use the zip vfs self.saved_remote_vfs = self.remote_vfs From eaf5f1224522c104e608b0a8ff439b32d44dad4f Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Thu, 26 Mar 2015 10:44:36 -0500 Subject: [PATCH 2/4] version bump --- addon.xml | 2 +- changelog.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addon.xml b/addon.xml index f765c8e..7726742 100644 --- a/addon.xml +++ b/addon.xml @@ -1,6 +1,6 @@  + name="Backup" version="1.0.4" provider-name="robweber"> diff --git a/changelog.txt b/changelog.txt index e460b78..da16137 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +Version 1.0.4 + +exit if we can't delete the old archive, non recoverable + Version 1.0.3 added "delete auth" dialog to delete oauth files in settings From 02e3a73623f0f1d6193d2951135ab941db577d9f Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Fri, 24 Apr 2015 09:23:56 -0500 Subject: [PATCH 3/4] make compression setting compatible with python 2.6 and above --- resources/lib/vfs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lib/vfs.py b/resources/lib/vfs.py index ce2a65d..415f2a9 100644 --- a/resources/lib/vfs.py +++ b/resources/lib/vfs.py @@ -84,7 +84,7 @@ class ZipFileSystem(Vfs): def __init__(self,rootString,mode): self.root_path = "" - self.zip = zipfile.ZipFile(rootString,mode=mode,allowZip64=True) + self.zip = zipfile.ZipFile(rootString,mode=mode,compression=zipfile.ZIP_DEFLATED,allowZip64=True) def listdir(self,directory): return [[],[]] @@ -97,7 +97,7 @@ class ZipFileSystem(Vfs): aFile = xbmcvfs.File(xbmc.translatePath(source),'r') - self.zip.writestr(utils.encode(dest),aFile.read(),compress_type=zipfile.ZIP_DEFLATED) + self.zip.writestr(utils.encode(dest),aFile.read()) return True From 776c3872ae6d6613eb1d8cbf94bc9d0c1c68813a Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Fri, 24 Apr 2015 09:24:03 -0500 Subject: [PATCH 4/4] version bump --- addon.xml | 2 +- changelog.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addon.xml b/addon.xml index 7726742..f1791a8 100644 --- a/addon.xml +++ b/addon.xml @@ -1,6 +1,6 @@  + name="Backup" version="1.0.5" provider-name="robweber"> diff --git a/changelog.txt b/changelog.txt index da16137..a6e8e2e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +Version 1.0.5 + +make compression setting compatible with python 2.6 and above + Version 1.0.4 exit if we can't delete the old archive, non recoverable