From 31b46fb3b7ed748786c621ffbeec860accda914a Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Mon, 12 Mar 2018 10:18:56 +0000 Subject: [PATCH] framework/configuration: Refactor code into seperate method --- wa/framework/configuration/default.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wa/framework/configuration/default.py b/wa/framework/configuration/default.py index 87c6b89c..b115aa36 100644 --- a/wa/framework/configuration/default.py +++ b/wa/framework/configuration/default.py @@ -35,8 +35,12 @@ def generate_default_config(path): with open(path, 'w') as output: for param in MetaConfiguration.config_points + RunConfiguration.config_points: entry = {param.name: param.default} - comment = _format_yaml_comment(param) - output.writelines(comment) - yaml.dump(entry, output, default_flow_style=False) - output.write("\n") + write_param_yaml(entry, param, output) _format_augmentations(output) + + +def write_param_yaml(entry, param, output): + comment = _format_yaml_comment(param) + output.writelines(comment) + yaml.dump(entry, output, default_flow_style=False) + output.write("\n")