moved cloud creation code to an authorizer class

added authorize as part of settings
This commit is contained in:
Rob Weber
2017-01-31 08:08:00 -06:00
parent 2e7552896a
commit 49f6ae5270
7 changed files with 192 additions and 91 deletions

23
authorize_cloud.py Normal file
View File

@@ -0,0 +1,23 @@
import xbmc
import xbmcgui
import xbmcvfs
import resources.lib.utils as utils
from resources.lib.authorizers import DropboxAuthorizer,GoogleDriveAuthorizer
#drobpox
if(utils.getSetting('remote_selection') == '2'):
authorizer = DropboxAuthorizer()
if(authorizer.authorize()):
xbmcgui.Dialog().ok("Backup","Dropbox is authorized")
else:
xbmcgui.Dialog().ok("Backup","Error Authorizing Dropbox")
#google drive
elif(utils.getSetting('remote_selection') == '3'):
authorizer = GoogleDriveAuthorizer()
if(authorizer.authorize()):
xbmcgui.Dialog().ok("Backup","Google Drive is authorized")
else:
xbmcgui.Dialog().ok("Backup","Error Authorizing Google Drive")