Permalink
Browse files

More refactoring and moving stuff around

  • Loading branch information...
1 parent a3c9494 commit 665fa2a32b5ff2b1c1887a48ed69329110a555f7 @mitsuhiko mitsuhiko committed Jul 4, 2010
Showing with 15 additions and 14 deletions.
  1. +3 −3 flask/app.py
  2. +0 −11 flask/ctx.py
  3. +12 −0 flask/templating.py
View
@@ -24,11 +24,12 @@
_tojson_filter
from flask.wrappers import Request, Response
from flask.config import ConfigAttribute, Config
-from flask.ctx import _default_template_ctx_processor, _RequestContext
+from flask.ctx import _RequestContext
from flask.globals import _request_ctx_stack, request
from flask.session import Session, _NullSession
from flask.module import _ModuleSetupState
-from flask.templating import _DispatchingJinjaLoader
+from flask.templating import _DispatchingJinjaLoader, \
+ _default_template_ctx_processor
# a lock used for logger initialization
_logger_lock = Lock()
@@ -831,4 +832,3 @@ def test_request_context(self, *args, **kwargs):
def __call__(self, environ, start_response):
"""Shortcut for :attr:`wsgi_app`."""
return self.wsgi_app(environ, start_response)
-
View
@@ -63,14 +63,3 @@ def __exit__(self, exc_type, exc_value, tb):
if not self.request.environ.get('flask._preserve_context') and \
(tb is None or not self.app.debug):
self.pop()
-
-def _default_template_ctx_processor():
- """Default template context processor. Injects `request`,
- `session` and `g`.
- """
- reqctx = _request_ctx_stack.top
- return dict(
- request=reqctx.request,
- session=reqctx.session,
- g=reqctx.g
- )
View
@@ -13,6 +13,18 @@
from flask.globals import _request_ctx_stack
+def _default_template_ctx_processor():
+ """Default template context processor. Injects `request`,
+ `session` and `g`.
+ """
+ reqctx = _request_ctx_stack.top
+ return dict(
+ request=reqctx.request,
+ session=reqctx.session,
+ g=reqctx.g
+ )
+
+
class _DispatchingJinjaLoader(BaseLoader):
"""A loader that looks for templates in the application and all
the module folders.

0 comments on commit 665fa2a

Please sign in to comment.