/
opt
/
alt
/
python27
/
lib
/
python2.7
/
site-packages
/
jinja2
/
/opt/alt/python27/lib/python2.7/site-packages/jinja2
mkdir
upload
Name
Size
Mode
Actions
testsuite/
-
0755
rm
bccache.py
12334
0644
edit
dl
rm
bccache.pyc
14557
0644
edit
dl
rm
bccache.pyo
14605
0644
edit
dl
rm
compiler.py
61785
0644
edit
dl
rm
compiler.pyc
56040
0644
edit
dl
rm
compiler.pyo
56552
0644
edit
dl
rm
constants.py
1626
0644
edit
dl
rm
constants.pyc
1707
0644
edit
dl
rm
constants.pyo
1707
0644
edit
dl
rm
debug.py
10980
0644
edit
dl
rm
debug.pyc
11091
0644
edit
dl
rm
debug.pyo
11019
0644
edit
dl
rm
defaults.py
1068
0644
edit
dl
rm
defaults.pyc
1670
0644
edit
dl
rm
defaults.pyo
1678
0644
edit
dl
rm
environment.py
47244
0644
edit
dl
rm
environment.pyc
47013
0644
edit
dl
rm
environment.pyo
46819
0644
edit
dl
rm
exceptions.py
4428
0644
edit
dl
rm
exceptions.pyc
6521
0644
edit
dl
rm
exceptions.pyo
6551
0644
edit
dl
rm
ext.py
25078
0644
edit
dl
rm
ext.pyc
24801
0644
edit
dl
rm
ext.pyo
24734
0644
edit
dl
rm
filters.py
29836
0644
edit
dl
rm
filters.pyc
34780
0644
edit
dl
rm
filters.pyo
34966
0644
edit
dl
rm
lexer.py
28393
0644
edit
dl
rm
lexer.pyc
23165
0644
edit
dl
rm
lexer.pyo
23226
0644
edit
dl
rm
loaders.py
17036
0644
edit
dl
rm
loaders.pyc
19499
0644
edit
dl
rm
loaders.pyo
19583
0644
edit
dl
rm
meta.py
4190
0644
edit
dl
rm
meta.pyc
4122
0644
edit
dl
rm
meta.pyo
4122
0644
edit
dl
rm
nodes.py
28875
0644
edit
dl
rm
nodes.pyc
43653
0644
edit
dl
rm
nodes.pyo
43839
0644
edit
dl
rm
optimizer.py
2302
0644
edit
dl
rm
optimizer.pyc
2929
0644
edit
dl
rm
optimizer.pyo
2939
0644
edit
dl
rm
parser.py
35186
0644
edit
dl
rm
parser.pyc
31913
0644
edit
dl
rm
parser.pyo
32334
0644
edit
dl
rm
runtime.py
19558
0644
edit
dl
rm
runtime.pyc
23785
0644
edit
dl
rm
runtime.pyo
23984
0644
edit
dl
rm
sandbox.py
13445
0644
edit
dl
rm
sandbox.pyc
12271
0644
edit
dl
rm
sandbox.pyo
12271
0644
edit
dl
rm
tests.py
3444
0644
edit
dl
rm
tests.pyc
5257
0644
edit
dl
rm
tests.pyo
5259
0644
edit
dl
rm
utils.py
16165
0644
edit
dl
rm
utils.pyc
20165
0644
edit
dl
rm
utils.pyo
20307
0644
edit
dl
rm
visitor.py
3316
0644
edit
dl
rm
visitor.pyc
3916
0644
edit
dl
rm
visitor.pyo
3938
0644
edit
dl
rm
_compat.py
4042
0644
edit
dl
rm
_compat.pyc
6421
0644
edit
dl
rm
_compat.pyo
6431
0644
edit
dl
rm
_stringdefs.py
404291
0644
edit
dl
rm
_stringdefs.pyc
208605
0644
edit
dl
rm
_stringdefs.pyo
208605
0644
edit
dl
rm
__init__.py
2270
0644
edit
dl
rm
__init__.pyc
2445
0644
edit
dl
rm
__init__.pyo
2445
0644
edit
dl
rm
Edit:
/opt/alt/python27/lib/python2.7/site-packages/jinja2/exceptions.py
(4428B)
# -*- coding: utf-8 -*- """ jinja2.exceptions ~~~~~~~~~~~~~~~~~ Jinja exceptions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2._compat import imap, text_type, PY2, implements_to_string class TemplateError(Exception): """Baseclass for all template errors.""" if PY2: def __init__(self, message=None): if message is not None: message = text_type(message).encode('utf-8') Exception.__init__(self, message) @property def message(self): if self.args: message = self.args[0] if message is not None: return message.decode('utf-8', 'replace') def __unicode__(self): return self.message or u'' else: def __init__(self, message=None): Exception.__init__(self, message) @property def message(self): if self.args: message = self.args[0] if message is not None: return message @implements_to_string class TemplateNotFound(IOError, LookupError, TemplateError): """Raised if a template does not exist.""" # looks weird, but removes the warning descriptor that just # bogusly warns us about message being deprecated message = None def __init__(self, name, message=None): IOError.__init__(self) if message is None: message = name self.message = message self.name = name self.templates = [name] def __str__(self): return self.message class TemplatesNotFound(TemplateNotFound): """Like :class:`TemplateNotFound` but raised if multiple templates are selected. This is a subclass of :class:`TemplateNotFound` exception, so just catching the base exception will catch both. .. versionadded:: 2.2 """ def __init__(self, names=(), message=None): if message is None: message = u'none of the templates given were found: ' + \ u', '.join(imap(text_type, names)) TemplateNotFound.__init__(self, names and names[-1] or None, message) self.templates = list(names) @implements_to_string class TemplateSyntaxError(TemplateError): """Raised to tell the user that there is a problem with the template.""" def __init__(self, message, lineno, name=None, filename=None): TemplateError.__init__(self, message) self.lineno = lineno self.name = name self.filename = filename self.source = None # this is set to True if the debug.translate_syntax_error # function translated the syntax error into a new traceback self.translated = False def __str__(self): # for translated errors we only return the message if self.translated: return self.message # otherwise attach some stuff location = 'line %d' % self.lineno name = self.filename or self.name if name: location = 'File "%s", %s' % (name, location) lines = [self.message, ' ' + location] # if the source is set, add the line to the output if self.source is not None: try: line = self.source.splitlines()[self.lineno - 1] except IndexError: line = None if line: lines.append(' ' + line.strip()) return u'\n'.join(lines) class TemplateAssertionError(TemplateSyntaxError): """Like a template syntax error, but covers cases where something in the template caused an error at compile time that wasn't necessarily caused by a syntax error. However it's a direct subclass of :exc:`TemplateSyntaxError` and has the same attributes. """ class TemplateRuntimeError(TemplateError): """A generic runtime error in the template engine. Under some situations Jinja may raise this exception. """ class UndefinedError(TemplateRuntimeError): """Raised if a template tries to operate on :class:`Undefined`.""" class SecurityError(TemplateRuntimeError): """Raised if a template tries to do something insecure if the sandbox is enabled. """ class FilterArgumentError(TemplateRuntimeError): """This error is raised if a filter was called with inappropriate arguments """
Save
cmd:
run