From 6b2e09a86374d7d7b884f4ff04e78fd3d10391e6 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sat, 16 Sep 2017 02:49:41 +0200 Subject: generate_config: Replace print statement with fc Fix py3 compatibility by using 'print' function instead. While at it, fix constant names reported by `pylint` as invalid. Change-Id: I73e3a370560c038a8814db9758b13026dc4c0b42 Signed-off-by: Alexandru Avadanii --- utils/generate_config.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'utils') diff --git a/utils/generate_config.py b/utils/generate_config.py index 523a7a8..b65bf7f 100755 --- a/utils/generate_config.py +++ b/utils/generate_config.py @@ -4,20 +4,20 @@ import argparse import yaml from jinja2 import Environment, FileSystemLoader -parser = argparse.ArgumentParser() -parser.add_argument("--yaml", "-y", type=str, required=True) -parser.add_argument("--jinja2", "-j", type=str, required=True) -args = parser.parse_args() +PARSER = argparse.ArgumentParser() +PARSER.add_argument("--yaml", "-y", type=str, required=True) +PARSER.add_argument("--jinja2", "-j", type=str, required=True) +ARGS = PARSER.parse_args() ENV = Environment(loader=FileSystemLoader('./')) -with open(args.yaml) as _: - dict = yaml.safe_load(_) +with open(ARGS.yaml) as _: + DICT = yaml.safe_load(_) # Print dictionary generated from yaml (uncomment for debug) -#print dict +#print DICT # Render template and print generated conf to console -template = ENV.get_template(args.jinja2) -print template.render(conf=dict) +TEMPLATE = ENV.get_template(ARGS.jinja2) +print(TEMPLATE.render(conf=DICT)) -- cgit 1.2.3-korg