2017-01-31 16:07:49 +01:00
|
|
|
import sys
|
|
|
|
import urlparse
|
2017-01-31 15:08:00 +01:00
|
|
|
import xbmcgui
|
|
|
|
import resources.lib.utils as utils
|
|
|
|
from resources.lib.authorizers import DropboxAuthorizer,GoogleDriveAuthorizer
|
|
|
|
|
2017-01-31 16:07:49 +01:00
|
|
|
def get_params():
|
|
|
|
param = {}
|
|
|
|
try:
|
|
|
|
for i in sys.argv:
|
|
|
|
args = i
|
|
|
|
if(args.startswith('?')):
|
|
|
|
args = args[1:]
|
|
|
|
param.update(dict(urlparse.parse_qsl(args)))
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
return param
|
|
|
|
|
|
|
|
params = get_params()
|
|
|
|
|
2017-01-31 15:08:00 +01:00
|
|
|
#drobpox
|
2017-01-31 16:07:49 +01:00
|
|
|
if(params['type'] == 'dropbox'):
|
2017-01-31 15:08:00 +01:00
|
|
|
authorizer = DropboxAuthorizer()
|
|
|
|
|
|
|
|
if(authorizer.authorize()):
|
2017-01-31 16:07:49 +01:00
|
|
|
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30027) + ' ' + utils.getString(30106))
|
2017-01-31 15:08:00 +01:00
|
|
|
else:
|
2017-01-31 16:07:49 +01:00
|
|
|
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30107) + ' ' + utils.getString(30027))
|
2017-01-31 15:08:00 +01:00
|
|
|
|
|
|
|
#google drive
|
2017-01-31 16:07:49 +01:00
|
|
|
elif(params['type'] == 'google_drive'):
|
2017-01-31 15:08:00 +01:00
|
|
|
authorizer = GoogleDriveAuthorizer()
|
|
|
|
|
|
|
|
if(authorizer.authorize()):
|
2017-01-31 15:16:54 +01:00
|
|
|
xbmcgui.Dialog().ok("Backup",utils.getString(30098) + ' ' + utils.getString(30106))
|
2017-01-31 15:08:00 +01:00
|
|
|
else:
|
2017-01-31 15:16:54 +01:00
|
|
|
xbmcgui.Dialog().ok("Backup",utils.getString(30107) + ' ' + utils.getString(30098))
|