Add ability to change settings via environment variables

This commit is contained in:
nvbn
2015-04-22 20:18:53 +02:00
parent b4b599df80
commit 69a9516477
8 changed files with 233 additions and 61 deletions
+1 -4
View File
@@ -37,10 +37,7 @@ def wrap_settings(params):
def decorator(fn):
@wraps(fn)
def wrapper(command, settings):
for key, val in params.items():
if not hasattr(settings, key):
setattr(settings, key, val)
return fn(command, settings)
return fn(command, settings.update(**params))
return wrapper
return decorator