mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
Use dict literal or comprehension for dict creation
This commit is contained in:
parent
c99b497bd8
commit
6d0d2d3f7e
4 changed files with 35 additions and 24 deletions
|
@ -20,8 +20,16 @@ def auto_fork(section, input_category):
|
|||
apikey = cfg.get('apikey')
|
||||
ssl = int(cfg.get('ssl', 0))
|
||||
web_root = cfg.get('web_root', '')
|
||||
replace = {'sickrage': 'SickRage', 'sickchill': 'SickChill', 'sickgear': 'SickGear', 'medusa': 'Medusa', 'sickbeard-api': 'SickBeard-api', 'stheno': 'Stheno'}
|
||||
f1 = replace[cfg.get('fork', 'auto')] if cfg.get('fork', 'auto') in replace else cfg.get('fork', 'auto')
|
||||
replace = {
|
||||
'medusa': 'Medusa',
|
||||
'sickbeard-api': 'SickBeard-api',
|
||||
'sickgear': 'SickGear',
|
||||
'sickchill': 'SickChill',
|
||||
'sickrage': 'SickRage',
|
||||
'stheno': 'Stheno',
|
||||
}
|
||||
_val = cfg.get('fork', 'auto')
|
||||
f1 = replace.get(_val, _val)
|
||||
try:
|
||||
fork = f1, core.FORKS[f1]
|
||||
except KeyError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue