mirror of
https://github.com/robweber/xbmcbackup.git
synced 2025-11-23 11:41:30 +01:00
pep8 comments
This commit is contained in:
30
default.py
30
default.py
@@ -10,7 +10,7 @@ def get_params():
|
||||
args = i
|
||||
if('=' in args):
|
||||
if(args.startswith('?')):
|
||||
args = args[1:] #legacy in case of url params
|
||||
args = args[1:] # legacy in case of url params
|
||||
splitString = args.split('=')
|
||||
param[splitString[0]] = splitString[1]
|
||||
except:
|
||||
@@ -18,7 +18,7 @@ def get_params():
|
||||
|
||||
return param
|
||||
|
||||
#the program mode
|
||||
# the program mode
|
||||
mode = -1
|
||||
params = get_params()
|
||||
|
||||
@@ -29,33 +29,33 @@ if("mode" in params):
|
||||
elif(params['mode'] == 'restore'):
|
||||
mode = 1
|
||||
|
||||
#if mode wasn't passed in as arg, get from user
|
||||
# if mode wasn't passed in as arg, get from user
|
||||
if(mode == -1):
|
||||
#by default, Backup,Restore,Open Settings
|
||||
# by default, Backup,Restore,Open Settings
|
||||
options = [utils.getString(30016),utils.getString(30017),utils.getString(30099)]
|
||||
|
||||
#find out if we're using the advanced editor
|
||||
# find out if we're using the advanced editor
|
||||
if(int(utils.getSetting('backup_selection_type')) == 1):
|
||||
options.append(utils.getString(30125))
|
||||
|
||||
#figure out if this is a backup or a restore from the user
|
||||
# figure out if this is a backup or a restore from the user
|
||||
mode = xbmcgui.Dialog().select(utils.getString(30010) + " - " + utils.getString(30023),options)
|
||||
|
||||
#check if program should be run
|
||||
# check if program should be run
|
||||
if(mode != -1):
|
||||
#run the profile backup
|
||||
# run the profile backup
|
||||
backup = XbmcBackup()
|
||||
|
||||
if(mode == 2):
|
||||
#open the settings dialog
|
||||
# open the settings dialog
|
||||
utils.openSettings()
|
||||
elif(mode == 3 and int(utils.getSetting('backup_selection_type')) == 1):
|
||||
#open the advanced editor
|
||||
# open the advanced editor
|
||||
xbmc.executebuiltin('RunScript(special://home/addons/script.xbmcbackup/launcher.py,action=advanced_editor)')
|
||||
elif(backup.remoteConfigured()):
|
||||
|
||||
if(mode == backup.Restore):
|
||||
#get list of valid restore points
|
||||
# get list of valid restore points
|
||||
restorePoints = backup.listBackups()
|
||||
pointNames = []
|
||||
folderNames = []
|
||||
@@ -67,16 +67,16 @@ if(mode != -1):
|
||||
selectedRestore = -1
|
||||
|
||||
if("archive" in params):
|
||||
#check that the user give archive exists
|
||||
# check that the user give archive exists
|
||||
if(params['archive'] in folderNames):
|
||||
#set the index
|
||||
# set the index
|
||||
selectedRestore = folderNames.index(params['archive'])
|
||||
utils.log(str(selectedRestore) + " : " + params['archive'])
|
||||
else:
|
||||
utils.showNotification(utils.getString(30045))
|
||||
utils.log(params['archive'] + ' is not a valid restore point')
|
||||
else:
|
||||
#allow user to select the backup to restore from
|
||||
# allow user to select the backup to restore from
|
||||
selectedRestore = xbmcgui.Dialog().select(utils.getString(30010) + " - " + utils.getString(30021),pointNames)
|
||||
|
||||
if(selectedRestore != -1):
|
||||
@@ -89,6 +89,6 @@ if(mode != -1):
|
||||
else:
|
||||
backup.backup()
|
||||
else:
|
||||
#can't go any further
|
||||
# can't go any further
|
||||
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30045))
|
||||
utils.openSettings()
|
||||
|
||||
Reference in New Issue
Block a user