(args: argparse.Namespace)
| 200 | |
| 201 | |
| 202 | def main(args: argparse.Namespace): |
| 203 | conf_file = ConfFile(args.input) |
| 204 | if args.format.lower() == "dot": |
| 205 | with open(args.output, "w") as f: |
| 206 | generate_dot_file(conf_file.sections, f, args.omit_levels) |
| 207 | else: |
| 208 | ensure_graphviz_available() |
| 209 | with io.StringIO() as f: |
| 210 | generate_dot_file(conf_file.sections, f, args.omit_levels) |
| 211 | f.seek(0) |
| 212 | dot_file = f.read() |
| 213 | subprocess.run(["dot", "-T", args.format, "-o", args.output], input=dot_file, universal_newlines=True) |
| 214 | |
| 215 | |
| 216 | if __name__ == "__main__": |
no test coverage detected