pep8 styling round 2

This commit is contained in:
Rob Weber 2019-11-26 10:43:38 -06:00
parent 3e9de429dd
commit 95649c2b3f
7 changed files with 49 additions and 50 deletions

View File

@ -4,6 +4,7 @@ import xbmcgui
import xbmcvfs
from . import utils as utils
class BackupSetManager:
jsonFile = xbmc.translatePath(utils.data_dir() + "custom_paths.json")
paths = None
@ -44,7 +45,7 @@ class BackupSetManager:
return keys
def getSet(self, index):
keys = self.getSets();
keys = self.getSets()
# return the set at this index
return {'name': keys[index], 'set': self.paths[keys[index]]}
@ -89,7 +90,7 @@ class AdvancedBackupEditor:
name = self.dialog.input(utils.getString(30110), defaultt='Backup Set')
if(name != None):
if(name is not None):
# give a choice to start in home or enter a root path
enterHome = self.dialog.yesno(utils.getString(30111), line1=utils.getString(30112) + " - " + utils.getString(30114), line2=utils.getString(30113) + " - " + utils.getString(30115), nolabel=utils.getString(30112), yeslabel=utils.getString(30113))
@ -223,5 +224,3 @@ class AdvancedBackupEditor:
dest = xbmc.translatePath(utils.data_dir() + "/custom_paths.json")
xbmcvfs.copy(source, dest)

View File

@ -10,6 +10,7 @@ try:
except ImportError:
pass
class DropboxAuthorizer:
APP_KEY = ""
APP_SECRET = ""

View File

@ -19,6 +19,7 @@ def folderSort(aKey):
return result
class XbmcBackup:
# constants for initiating a back or restore
Backup = 0
@ -51,7 +52,7 @@ class XbmcBackup:
def configureRemote(self):
if(utils.getSetting('remote_selection') == '1'):
self.remote_base_path = utils.getSetting('remote_path_2');
self.remote_base_path = utils.getSetting('remote_path_2')
self.remote_vfs = XBMCFileSystem(utils.getSetting('remote_path_2'))
utils.setSetting("remote_path", "")
elif(utils.getSetting('remote_selection') == '0'):
@ -280,12 +281,12 @@ class XbmcBackup:
restoreSets = [n['name'] for n in valFile['directories']]
# if passed in list, skip selection
if(selectedSets == None):
if(selectedSets is None):
selectedSets = xbmcgui.Dialog().multiselect(utils.getString(30131), restoreSets)
else:
selectedSets = [restoreSets.index(n) for n in selectedSets if n in restoreSets] # if set name not found just skip it
if(selectedSets != None):
if(selectedSets is not None):
# go through each of the directories in the backup and write them to the correct location
for index in selectedSets:
@ -357,7 +358,6 @@ class XbmcBackup:
utils.log(utils.getString(30047) + ": " + self.xbmc_vfs.root_path)
utils.log(utils.getString(30048) + ": " + self.remote_vfs.root_path)
# setup the progress bar
self.progressBar = BackupProgressBar(progressOverride)
self.progressBar.create(progressBarTitle, utils.getString(30049) + "......")
@ -531,6 +531,7 @@ class XbmcBackup:
jFile.close()
return json.loads(jsonString)
class FileManager:
not_dir = ['.zip', '.xsp', '.rar']
exclude_dir = []

View File

@ -48,7 +48,7 @@ class GuiSettingsManager:
for node in nodeList:
nodeValue = ''
if(node.firstChild != None):
if(node.firstChild is not None):
nodeValue = node.firstChild.nodeValue
# check for numbers and booleans
@ -70,4 +70,3 @@ class GuiSettingsManager:
self.doc = minidom.parse(fileLoc)
except ExpatError:
utils.log("Can't read " + fileLoc)

View File

@ -45,4 +45,3 @@ def getRegionalTimestamp(date_time, dateformat=['dateshort']):
result = result + ("%s " % date_time.strftime(xbmc.getRegion(aFormat)))
return result.strip()