create google file system

This commit is contained in:
Rob Weber 2014-10-09 14:40:05 -05:00
parent 9c73b5b0b8
commit e316e82013

View File

@ -4,7 +4,7 @@ import xbmcvfs
import utils as utils import utils as utils
import time import time
import json import json
from vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem from vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem,GoogleDriveFilesystem
def folderSort(aKey): def folderSort(aKey):
result = aKey[0] result = aKey[0]
@ -54,6 +54,9 @@ class XbmcBackup:
elif(utils.getSetting('remote_selection') == '2'): elif(utils.getSetting('remote_selection') == '2'):
self.remote_base_path = "/" self.remote_base_path = "/"
self.remote_vfs = DropboxFileSystem("/") self.remote_vfs = DropboxFileSystem("/")
elif(utils.getSetting('remote_selection') == '3'):
self.remote_base_path = '/'
self.remote_vfs = GoogleDriveFilesystem('/')
def remoteConfigured(self): def remoteConfigured(self):
result = True result = True
@ -423,8 +426,8 @@ class XbmcBackup:
dest.mkdir(dest.root_path + aFile[len(source.root_path) + 1:]) dest.mkdir(dest.root_path + aFile[len(source.root_path) + 1:])
else: else:
self._updateProgress() self._updateProgress()
if(isinstance(source,DropboxFileSystem)): if(isinstance(source,DropboxFileSystem) or isinstance(source,GoogleDriveFilesystem)):
#if copying from dropbox we need the file handle, use get_file #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):]) source.get_file(aFile,dest.root_path + aFile[len(source.root_path):])
else: else:
#copy using normal method #copy using normal method