Skip to content
Myr

Documented more changes

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent e73e097 · Browse files · 2 files+17 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+17 added−0 removed

  • other:+17 added−0 removed

2 files+17 added−0 removed

modified:jinja2/debug.py+8 added
63 unmodified lines
64 lines = traceback.format_exception(self.exc_type, self.exc_value,65 self.frames[0], limit=limit)66 return ''.join(lines).rstrip()6768 def render_as_html(self, full=False):69 """Return a unicode string with the traceback as rendered HTML."""70 from jinja2.debugrenderer import render_traceback71 return u'%s\n\n<!--\n%s\n-->' % (72 render_traceback(self, full=full),73 self.render_as_text().decode('utf-8', 'replace')74 )7576 @property77 def is_template_syntax_error(self):78 """`True` if this is a template syntax error."""79 return isinstance(self.exc_value, TemplateSyntaxError)
207 unmodified lines
modified:jinja2/environment.py+9 added
192 unmodified lines
193 #: shared environments have this set to `True`. A shared environment194 #: must not be modified195 shared = False196197 #: these are currently EXPERIMENTAL undocumented features.198 exception_handler = None199 exception_formatter = None200201 def __init__(self,
273 unmodified lines
475 """476 global _make_traceback477 if exc_info is None:478 exc_info = sys.exc_info()479480 # the debugging module is imported when it's used for the first time.481 # we're doing a lot of stuff there and for applications that do not482 # get any exceptions in template rendering there is no need to load483 # all of that.484 if _make_traceback is None:485 from jinja2.debug import make_traceback as _make_traceback486487 traceback = _make_traceback(exc_info, source_hint)488489 if rendered and self.exception_formatter is not None:490 return self.exception_formatter(traceback)491 if self.exception_handler is not None:492 self.exception_handler(traceback)493494 exc_type, exc_value, tb = traceback.standard_exc_info495 raise exc_type, exc_value, tb496497 def join_path(self, template, parent):
368 unmodified lines