From e316e8201392eb75f5cf72b3dfc57baa5370f32b Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Thu, 9 Oct 2014 14:40:05 -0500 Subject: [PATCH] create google file system --- resources/lib/backup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/lib/backup.py b/resources/lib/backup.py index 58de387..efce29c 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -4,7 +4,7 @@ import xbmcvfs import utils as utils import time import json -from vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem +from vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem,GoogleDriveFilesystem def folderSort(aKey): result = aKey[0] @@ -54,6 +54,9 @@ class XbmcBackup: elif(utils.getSetting('remote_selection') == '2'): self.remote_base_path = "/" self.remote_vfs = DropboxFileSystem("/") + elif(utils.getSetting('remote_selection') == '3'): + self.remote_base_path = '/' + self.remote_vfs = GoogleDriveFilesystem('/') def remoteConfigured(self): result = True @@ -423,8 +426,8 @@ class XbmcBackup: dest.mkdir(dest.root_path + aFile[len(source.root_path) + 1:]) else: self._updateProgress() - if(isinstance(source,DropboxFileSystem)): - #if copying from dropbox we need the file handle, use get_file + if(isinstance(source,DropboxFileSystem) or isinstance(source,GoogleDriveFilesystem)): + #if copying from cloud storage we need the file handle, use get_file source.get_file(aFile,dest.root_path + aFile[len(source.root_path):]) else: #copy using normal method