Skip to content

make __main__ use pyinvoke Program as entrypoint #1833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Developers
* Jonathan La Field - https://github.com/JLaField
* Kevin Moy - https://github.com/kmoy1
* Taylor Fuller - https://github.com/taylor-fuller
* eyJhb - https://github.com/eyJhb


Translators
Expand Down
19 changes: 5 additions & 14 deletions wger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,19 @@
import sys

# Third Party
from invoke import run
from wger.tasks import make_program


"""
This simple wrapper script is used as a console entry point in the packaged
version of the application. It simply redirects all arguments to the invoke
command, which does all the work.
version of the application. It takes all the tasks from tasks.py, and runs
invoke, which does all the work.
"""

invoke_cmd = 'invoke '


def main():
# Change the working directory so that invoke can find the tasks file
os.chdir(os.path.dirname(os.path.abspath(__file__)))

args = sys.argv[1:]
if len(args):
run(invoke_cmd + ' '.join(args), pty=True)
else:
run(invoke_cmd + '--list')
make_program().run()


if __name__ == '__main__':
if __name__ == "__main__":
main()
Loading
Loading