diff --git a/sort_regressionfiles_yaml.py b/sort_regressionfiles_yaml.py index d923318..e9bf549 100755 --- a/sort_regressionfiles_yaml.py +++ b/sort_regressionfiles_yaml.py @@ -1,14 +1,6 @@ #!/usr/bin/env python -# import yaml - - -# class IndentDumper(yaml.SafeDumper): -# def increase_indent(self, flow=False, indentless=False): -# return super(IndentDumper, self).increase_indent(flow, False) - - if __name__ == "__main__": import sys import subprocess as sp @@ -20,17 +12,14 @@ yaml.indent(mapping=2, sequence=4, offset=2) with open("regressionfiles.yaml", encoding="utf-8") as handle: - # contents = yaml.load(handle, Loader=yaml.SafeLoader) contents = yaml.load(handle) contents_sorted = {"regressions": sorted(contents["regressions"], key=lambda x: x["loc_entry"])} with open("regressionfiles_nocomments.yaml", "w", encoding="utf-8") as handle: - # yaml.dump(contents, handle, Dumper=IndentDumper, allow_unicode=True) yaml.dump(contents, handle) with open("regressionfiles_sorted.yaml", "w", encoding="utf-8") as handle: - # yaml.dump(contents_sorted, handle, Dumper=IndentDumper, allow_unicode=True) yaml.dump(contents_sorted, handle) result = sp.run(