Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add __main__.py file

Roland Geider7369f61c7437
diff --git a/setup.py b/setup.py
index 783fb14fd..147d8d029 100644
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@ setup(
install_requires=install_requires,
entry_points={
'console_scripts': [
- 'wger = wger.main:main',
+ 'wger = wger.__main__:main',
],
},
)
diff --git a/wger/__main__.py b/wger/__main__.py
new file mode 100644
index 000000000..0732105e2
--- /dev/null
+++ b/wger/__main__.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+
+# This file is part of wger Workout Manager.
+#
+# wger Workout Manager is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# wger Workout Manager is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+
+import sys
+from invoke import run
+
+'''
+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.
+'''
+
+
+def main():
+ args = sys.argv[1:]
+ if len(args):
+ run('invoke ' + ' '.join(args), pty=True)
+ else:
+ run('invoke --list')
+
+
+if __name__ == '__main__':
+ main()