diff options
author | 2020-01-25 23:28:12 +0100 | |
---|---|---|
committer | 2020-01-25 23:41:54 +0100 | |
commit | 4435eb6300d1901a48b72b2cb380e63220c578fa (patch) | |
tree | 29cde1c38724dbefd3f15e12d88ae2471b6b02ca | |
parent | Bump version to 0.7.0 (diff) | |
download | metagen-4435eb6300d1901a48b72b2cb380e63220c578fa.tar.gz metagen-4435eb6300d1901a48b72b2cb380e63220c578fa.tar.bz2 metagen-4435eb6300d1901a48b72b2cb380e63220c578fa.zip |
Support "python -m metagen"
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
-rwxr-xr-x | metagen/__main__.py (renamed from metagen/main.py) | 5 | ||||
-rwxr-xr-x | metagen/test_cli | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/metagen/main.py b/metagen/__main__.py index 987f7a0..0452771 100755 --- a/metagen/main.py +++ b/metagen/__main__.py @@ -109,7 +109,7 @@ def _check_maintainer_type_list(text): _check_maintainer_type_list.__name__ = 'maintainer type' -if __name__ == '__main__': +def main(): parser = ArgumentParser(prog='metagen') parser.add_argument('--version', action='version', version='%(prog)s ' + __version__) @@ -191,3 +191,6 @@ if __name__ == '__main__': open("%s" % out_file, "w").writelines(txt) print(blue("%s written") % out_file) + +if __name__ == '__main__': + main() diff --git a/metagen/test_cli b/metagen/test_cli index 959388d..fb394ca 100755 --- a/metagen/test_cli +++ b/metagen/test_cli @@ -1,6 +1,6 @@ #!/bin/bash metagen() { - PYTHONPATH=. ./metagen/main.py "$@" + PYTHONPATH=. python3 -m metagen "$@" } handle_error() { |