+

:4736 Function create_function() is deprecated [8192]

Last commit for mycoserver/context.py: 7004713412b51ec58cf01149ba736fadf769acaf

Initial commit

Benjamin Renard [2014-01-12 00:33:07]
Initial commit
  1. # -*- coding: utf-8 -*-
  2.  
  3.  
  4. """Context loaded and saved in WSGI requests"""
  5.  
  6.  
  7. from webob.dec import wsgify
  8.  
  9.  
  10. def make_add_context_to_request(app, app_ctx):
  11. """Return a WSGI middleware that adds context to requests."""
  12. @wsgify
  13. def add_context_to_request(req):
  14. req.ctx = app_ctx
  15. req.ctx.req = req
  16. return req.get_response(app)
  17. return add_context_to_request
  18.  
  19.  
  20. class Context(object):
  21. _ = lambda self, message: message
  22. conf = None
  23. templates = None
  24. db = None