This commit is contained in:
crudo 2017-12-23 17:11:24 +01:00
parent cdc55411b5
commit 8668b43880
3 changed files with 21 additions and 5 deletions

21
src/phi.py Normal file
View File

@ -0,0 +1,21 @@
from pprint import pformat as pp
from phi.config import get_config
from phi.logging import setup_logging, get_logger
from phi.app import setup_app, run_app
log = get_logger(__name__)
if __name__ == '__main__':
config_file, config = get_config()
# Beware that everything happened until now
# could not possibly get logged.
setup_logging(config.get('logging', {}))
log.info("Found configuration at '{}':\n{}"
.format(config_file, pp(config)))
app = setup_app(config)
run_app(app)

View File

@ -16,10 +16,6 @@ def setup_app(config):
return app return app
def shutdown_app(app):
app['ldap_client'].close()
def run_app(app): def run_app(app):
web.run_app(app, web.run_app(app,
host=app['config']['core']['listen'].get('host', '127.0.0.1'), host=app['config']['core']['listen'].get('host', '127.0.0.1'),

View File

@ -5,7 +5,6 @@ from phi.config import get_config
from phi.logging import setup_logging, get_logger from phi.logging import setup_logging, get_logger
from phi.app import setup_app, run_app from phi.app import setup_app, run_app
log = get_logger(__name__) log = get_logger(__name__)