Tweaks based on workflow testing
This commit is contained in:
parent
c522b73ca4
commit
6bbd6776b8
2 changed files with 214 additions and 134 deletions
|
|
@ -12,11 +12,21 @@ def update_options(options, required_options, default_options):
|
|||
|
||||
return options
|
||||
|
||||
def save_options(options, path):
|
||||
def save_options(options, path, ignore=None):
|
||||
''' Saves any options dictionary to a JSON-file in the specified path'''
|
||||
|
||||
options_copy = options.copy()
|
||||
|
||||
if ignore:
|
||||
if not isinstance(ignore, list):
|
||||
ignore = [ignore]
|
||||
|
||||
for i in ignore:
|
||||
options_copy[i] = 'Removed'
|
||||
|
||||
|
||||
with open(path, 'w') as f:
|
||||
json.dump(options,f)
|
||||
json.dump(options_copy,f, skipkeys=True, indent=4)
|
||||
|
||||
|
||||
def load_options(path):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue