Skip to content

Commit

Permalink
add whatsitdoing test and change to groundhog to support getting an app
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonc committed Mar 28, 2011
1 parent d911b5a commit 90df27b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions demo/whatsitdoing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from groundhog import Groundhog
from repoze.profile.profiler import AccumulatingProfileMiddleware
from paste.httpserver import serve

# application

app = Groundhog(__name__, 'seekrit')

@app.route('/')
def root():
return 'hello'

if __name__ == '__main__':
wsgiapp = app.get_wsgiapp()
wrapped = AccumulatingProfileMiddleware(wsgiapp)
serve(wrapped)

4 changes: 4 additions & 0 deletions groundhog.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ def decorator(func):
return func
return decorator

def get_wsgiapp(self):
self.config.end()
return self.config.make_wsgi_app()

def run(self, host=None, port=8080, debug=False):
self.config.end()
app = self.config.make_wsgi_app()
Expand Down

0 comments on commit 90df27b

Please sign in to comment.