From 7de3eec1b13b967e14ef8e9362e8cbc570e425e7 Mon Sep 17 00:00:00 2001 From: Long <931924+htlcnn@users.noreply.github.com> Date: Sat, 13 Feb 2021 06:06:15 +0700 Subject: [PATCH] make ifcpatch callable from command line (#1317) --- src/ifcpatch/__init__.py | 6 +++++- src/ifcpatch/__main__.py | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/ifcpatch/__main__.py diff --git a/src/ifcpatch/__init__.py b/src/ifcpatch/__init__.py index a3a74249aa..0632f90775 100644 --- a/src/ifcpatch/__init__.py +++ b/src/ifcpatch/__init__.py @@ -30,7 +30,7 @@ def execute(args, is_library=None): ifc_file.write(args["output"]) -if __name__ == "__main__": +def main(): parser = argparse.ArgumentParser(description="Patches IFC files to fix badly formatted data") parser.add_argument("-i", "--input", type=str, required=True, help="The IFC file to patch") parser.add_argument("-o", "--output", type=str, help="The output file to save the patched IFC") @@ -42,3 +42,7 @@ if __name__ == "__main__": execute(args) print("# All tasks are complete :-)") + + +if __name__ == "__main__": + main() diff --git a/src/ifcpatch/__main__.py b/src/ifcpatch/__main__.py new file mode 100644 index 0000000000..3b48deed79 --- /dev/null +++ b/src/ifcpatch/__main__.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python3 +import ifcpatch + +ifcpatch.main()