Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Fix #13: wsgi app init
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed May 3, 2018
1 parent 5f85234 commit c0eabb6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
10 changes: 1 addition & 9 deletions hummingbird/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
import os
from pywps.app.Service import Service

from hummingbird.processes import processes
from .wsgi import application

__version__ = "0.5_dev"


def application(environ, start_response):
app = Service(processes, [os.environ.get('PYWPS_CFG')])
return app(environ, start_response)
17 changes: 17 additions & 0 deletions hummingbird/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
from pywps.app.Service import Service

from .processes import processes


def create_app(cfgfiles=None):
config_files = [os.path.join(os.path.dirname(__file__), 'default.cfg')]
if cfgfiles:
config_files.extend(cfgfiles)
if 'PYWPS_CFG' in os.environ:
config_files.append(os.environ['PYWPS_CFG'])
service = Service(processes=processes, cfgfiles=config_files)
return service


application = create_app()

0 comments on commit c0eabb6

Please sign in to comment.