diff --git a/src/www/static/.keep b/src/edible_elephant/__init__.py similarity index 100% rename from src/www/static/.keep rename to src/edible_elephant/__init__.py diff --git a/src/cli.py b/src/edible_elephant/cli.py similarity index 97% rename from src/cli.py rename to src/edible_elephant/cli.py index 77681e5..010c714 100755 --- a/src/cli.py +++ b/src/edible_elephant/cli.py @@ -122,7 +122,7 @@ if __name__ == '__main__': args = parser.parse_args() dirname = os.path.dirname(os.path.realpath(__file__)) - dbpath = os.path.realpath(os.path.join(dirname, '..', 'db', 'data.sqlite')) + dbpath = os.path.realpath(os.path.join(dirname, '..', '..', 'db', 'data.sqlite')) db = sa.create_engine(f"sqlite:///{dbpath}") session = sa.orm.Session(db) diff --git a/src/db.py b/src/edible_elephant/db.py similarity index 100% rename from src/db.py rename to src/edible_elephant/db.py diff --git a/src/edible_elephant/www/__init__.py b/src/edible_elephant/www/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/www/serve.py b/src/edible_elephant/www/serve.py similarity index 91% rename from src/www/serve.py rename to src/edible_elephant/www/serve.py index 21aa29e..e0eccff 100755 --- a/src/www/serve.py +++ b/src/edible_elephant/www/serve.py @@ -36,7 +36,6 @@ DBSession = sqlalchemy.orm.scoped_session( def init_model(engine): DBSession.configure(bind=engine) - config.update_blueprint({ 'model': tg.util.Bunch( DBSession=DBSession, @@ -44,6 +43,13 @@ config.update_blueprint({ ) }) + +import os +import sys +sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) + +import edible_elephant.db + application = config.make_wsgi_app() import wsgiref.simple_server diff --git a/src/edible_elephant/www/static/.keep b/src/edible_elephant/www/static/.keep new file mode 100644 index 0000000..e69de29 diff --git a/src/www/templates/index.xhtml b/src/edible_elephant/www/templates/index.xhtml similarity index 100% rename from src/www/templates/index.xhtml rename to src/edible_elephant/www/templates/index.xhtml