Skip to content

Commit bbcf6f3

Browse files
author
Petr Vesely
committed
[UR] Refactor python to use format strings
1 parent 8767908 commit bbcf6f3

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

scripts/add_experimental_feature.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,25 @@ def main():
3232

3333
exp_feat_name = args.name
3434

35-
out_yml_name = "exp-%s.yml" % exp_feat_name
36-
out_rst_name = "EXP-%s.rst" % exp_feat_name.upper()
35+
out_yml_name = f"exp-{exp_feat_name}.yml"
36+
out_rst_name = f"EXP-{exp_feat_name.upper()}.rst"
3737

38-
yaml_template_path = "./scripts/templates/%s" % "exp_feat.yml.mako"
39-
rst_template_path = "./scripts/templates/%s" % "exp_feat.rst.mako"
40-
out_yml_path = "./scripts/core/%s" % out_yml_name
41-
out_rst_path = "./scripts/core/%s" % out_rst_name
38+
yaml_template_path = "./scripts/templates/exp_feat.yml.mako"
39+
rst_template_path = "./scripts/templates/exp_feat.rst.mako"
40+
out_yml_path = f"./scripts/core/{out_yml_name}"
41+
out_rst_path = f"./scripts/core/{out_rst_name}"
4242

4343
makoWrite(yaml_template_path, out_yml_path, name=exp_feat_name)
4444
makoWrite(rst_template_path, out_rst_path, name=exp_feat_name)
4545

4646

47-
print("Successfully generated the template files needed for %s." % exp_feat_name)
48-
print("""
47+
print(f"""\
48+
Successfully generated the template files needed for {exp_feat_name}.
49+
4950
You can now implement your feature in the following files:
50-
* %s
51-
* %s
52-
""" % (out_yml_name, out_rst_name))
51+
* {out_yml_name}
52+
* {out_rst_name}
53+
""")
5354

5455

5556
if __name__ == "__main__":

0 commit comments

Comments
 (0)