Move configuration defaults dict to module level
So that it is importable by tests
This commit is contained in:
parent
f7d5cbbd04
commit
cfc6b0d012
@ -65,8 +65,7 @@ def cardAnswer(card):
|
||||
return card.answer()
|
||||
|
||||
|
||||
def setting(key):
|
||||
defaults = {
|
||||
DEFAULT_CONFIG = {
|
||||
'apiKey': None,
|
||||
'apiLogPath': None,
|
||||
'apiPollInterval': 25,
|
||||
@ -80,7 +79,8 @@ def setting(key):
|
||||
'webTimeout': 10000,
|
||||
}
|
||||
|
||||
def setting(key):
|
||||
try:
|
||||
return aqt.mw.addonManager.getConfig(__name__).get(key, defaults[key])
|
||||
return aqt.mw.addonManager.getConfig(__name__).get(key, DEFAULT_CONFIG[key])
|
||||
except:
|
||||
raise Exception('setting {} not found'.format(key))
|
||||
|
Loading…
Reference in New Issue
Block a user