Negligible cleanups to django.template.context
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6975 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
55ae4e00a7
commit
abffdf5940
|
@ -9,7 +9,6 @@ class ContextPopException(Exception):
|
||||||
|
|
||||||
class Context(object):
|
class Context(object):
|
||||||
"A stack container for variable context"
|
"A stack container for variable context"
|
||||||
|
|
||||||
def __init__(self, dict_=None, autoescape=True):
|
def __init__(self, dict_=None, autoescape=True):
|
||||||
dict_ = dict_ or {}
|
dict_ = dict_ or {}
|
||||||
self.dicts = [dict_]
|
self.dicts = [dict_]
|
||||||
|
@ -78,11 +77,11 @@ def get_standard_processors():
|
||||||
try:
|
try:
|
||||||
mod = __import__(module, {}, {}, [attr])
|
mod = __import__(module, {}, {}, [attr])
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
raise ImproperlyConfigured, 'Error importing request processor module %s: "%s"' % (module, e)
|
raise ImproperlyConfigured('Error importing request processor module %s: "%s"' % (module, e))
|
||||||
try:
|
try:
|
||||||
func = getattr(mod, attr)
|
func = getattr(mod, attr)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise ImproperlyConfigured, 'Module "%s" does not define a "%s" callable request processor' % (module, attr)
|
raise ImproperlyConfigured('Module "%s" does not define a "%s" callable request processor' % (module, attr))
|
||||||
processors.append(func)
|
processors.append(func)
|
||||||
_standard_context_processors = tuple(processors)
|
_standard_context_processors = tuple(processors)
|
||||||
return _standard_context_processors
|
return _standard_context_processors
|
||||||
|
@ -102,4 +101,3 @@ class RequestContext(Context):
|
||||||
processors = tuple(processors)
|
processors = tuple(processors)
|
||||||
for processor in get_standard_processors() + processors:
|
for processor in get_standard_processors() + processors:
|
||||||
self.update(processor(request))
|
self.update(processor(request))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue