list comprehension
This commit is contained in:
parent
263ceae6a1
commit
9f31448134
1 changed files with 6 additions and 1 deletions
|
@ -98,7 +98,12 @@ def populate(dest_dir, rougailconfig):
|
||||||
root_config = config.unrestraint
|
root_config = config.unrestraint
|
||||||
else:
|
else:
|
||||||
root_config = config.unrestraint.value.mandatory()
|
root_config = config.unrestraint.value.mandatory()
|
||||||
values = ['ROUGAIL_' + variable.path().upper() + '="' + "" if get_value(variable) is None else get_value(variable) + '"' for variable in get_variables(root_config)]
|
values = []
|
||||||
|
for variable in get_variables(root_config):
|
||||||
|
var = get_value(variable)
|
||||||
|
if var is None:
|
||||||
|
var = ""
|
||||||
|
values.append('ROUGAIL_' + variable.path().upper() + '="' + var + '"')
|
||||||
if not environment_file.is_file():
|
if not environment_file.is_file():
|
||||||
with environment_file.open('w') as envfh:
|
with environment_file.open('w') as envfh:
|
||||||
envfh.write('\n'.join(values) + '\n')
|
envfh.write('\n'.join(values) + '\n')
|
||||||
|
|
Loading…
Reference in a new issue