Commits

Andrew McFague committed 4f0157d

Moving `manage.py` to the scripts dir and adding it to setuptools

Comments (0)

Files changed (3)

manage.py

-#!/usr/bin/env python
-
-from werkzeug import script, create_environ, run_wsgi_app
-
-from lodgeit import local
-from lodgeit.application import make_app
-from lodgeit.database import db
-
-dburi = 'sqlite:////tmp/lodgeit.db'
-
-SECRET_KEY = 'no secret key'
-
-
-def run_app(app, path='/'):
-    env = create_environ(path, SECRET_KEY)
-    return run_wsgi_app(app, env)
-
-action_runserver = script.make_runserver(
-    lambda: make_app(dburi, SECRET_KEY, debug=True),
-    use_reloader=True)
-
-action_shell = script.make_shell(
-    lambda: {
-        'app': make_app(dburi, SECRET_KEY, False, True),
-        'local': local,
-        'db': db,
-        'run_app': run_app
-    },
-    ('\nWelcome to the interactive shell environment of LodgeIt!\n'
-     '\n'
-     'You can use the following predefined objects: app, local, db.\n'
-     'To run the application (creates a request) use *run_app*.')
-)
-
-if __name__ == '__main__':
-    script.run()

scripts/lodgeit-manage

+#!/usr/bin/env python
+
+from werkzeug import script, create_environ, run_wsgi_app
+
+from lodgeit import local
+from lodgeit.application import make_app
+from lodgeit.database import db
+
+dburi = 'sqlite:////tmp/lodgeit.db'
+
+SECRET_KEY = 'no secret key'
+
+
+def run_app(app, path='/'):
+    env = create_environ(path, SECRET_KEY)
+    return run_wsgi_app(app, env)
+
+action_runserver = script.make_runserver(
+    lambda: make_app(dburi, SECRET_KEY, debug=True),
+    use_reloader=True)
+
+action_shell = script.make_shell(
+    lambda: {
+        'app': make_app(dburi, SECRET_KEY, False, True),
+        'local': local,
+        'db': db,
+        'run_app': run_app
+    },
+    ('\nWelcome to the interactive shell environment of LodgeIt!\n'
+     '\n'
+     'You can use the following predefined objects: app, local, db.\n'
+     'To run the application (creates a request) use *run_app*.')
+)
+
+if __name__ == '__main__':
+    script.run()
     license="",
     url="http://dev.webshox.org/lodgeit-main/overview",
     packages = find_packages(exclude=["testing"]),
-    scripts=['scripts/lodgeit.wsgi'],
+    scripts=[
+        'scripts/lodgeit.wsgi',
+        'scripts/lodgeit-manage',
+    ],
     install_requires=[
         'Babel',
         'Jinja2',