Rewrite dictionary creation as a dictionary literal

This commit is contained in:
labrys 2016-05-31 03:44:33 -04:00 committed by Labrys
commit 8235134fad
3 changed files with 18 additions and 20 deletions

View file

@ -48,11 +48,9 @@ class autoProcessComics(object):
if len(ext) == 4: # we assume this was a standard extension. if len(ext) == 4: # we assume this was a standard extension.
inputName = clean_name inputName = clean_name
params = {} params = {
params['nzb_folder'] = dirName 'nzb_folder': remoteDir(dirName) if remote_path else dirName,
}
if remote_path:
params['nzb_folder'] = remoteDir(dirName)
if inputName is not None: if inputName is not None:
params['nzb_name'] = inputName params['nzb_name'] = inputName

View file

@ -51,11 +51,12 @@ class autoProcessGames(object):
if status == 0: if status == 0:
downloadStatus = 'Downloaded' downloadStatus = 'Downloaded'
params = {} params = {
params['api_key'] = apikey 'api_key': apikey,
params['mode'] = 'UPDATEREQUESTEDSTATUS' 'mode': 'UPDATEREQUESTEDSTATUS',
params['db_id'] = gamezID 'db_id': gamezID,
params['status'] = downloadStatus 'status': downloadStatus
}
logger.debug("Opening URL: %s" % (url), section) logger.debug("Opening URL: %s" % (url), section)

View file

@ -16,9 +16,10 @@ class autoProcessMusic(object):
def get_status(self, url, apikey, dirName): def get_status(self, url, apikey, dirName):
logger.debug("Attempting to get current status for release:%s" % (os.path.basename(dirName))) logger.debug("Attempting to get current status for release:%s" % (os.path.basename(dirName)))
params = {} params = {
params['apikey'] = apikey 'apikey': apikey,
params['cmd'] = "getHistory" 'cmd': "getHistory"
}
logger.debug("Opening URL: %s with PARAMS: %s" % (url, params)) logger.debug("Opening URL: %s with PARAMS: %s" % (url, params))
@ -95,13 +96,11 @@ class autoProcessMusic(object):
if status == 0: if status == 0:
params = {} params = {
params['apikey'] = apikey 'apikey': apikey,
params['cmd'] = "forceProcess" 'cmd': "forceProcess",
'dir': remoteDir(os.path.dirname(dirName)) if remote_path else os.path.dirname(dirName)
params['dir'] = os.path.dirname(dirName) }
if remote_path:
params['dir'] = remoteDir(os.path.dirname(dirName))
release_status = self.get_status(url, apikey, dirName) release_status = self.get_status(url, apikey, dirName)
if not release_status: if not release_status: