ACIL FM
Dark
Refresh
Current DIR:
/usr/lib/python3.9/site-packages/jinja2
/
usr
lib
python3.9
site-packages
jinja2
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
__pycache__
-
chmod
Open
Rename
Delete
asyncfilters.py
4.15 MB
chmod
View
DL
Edit
Rename
Delete
asyncsupport.py
7.04 MB
chmod
View
DL
Edit
Rename
Delete
bccache.py
11.85 MB
chmod
View
DL
Edit
Rename
Delete
compiler.py
64.73 MB
chmod
View
DL
Edit
Rename
Delete
constants.py
1.42 MB
chmod
View
DL
Edit
Rename
Delete
debug.py
8.37 MB
chmod
View
DL
Edit
Rename
Delete
defaults.py
1.1 MB
chmod
View
DL
Edit
Rename
Delete
environment.py
49.44 MB
chmod
View
DL
Edit
Rename
Delete
exceptions.py
5.3 MB
chmod
View
DL
Edit
Rename
Delete
ext.py
25.82 MB
chmod
View
DL
Edit
Rename
Delete
filters.py
41.41 MB
chmod
View
DL
Edit
Rename
Delete
idtracking.py
9 MB
chmod
View
DL
Edit
Rename
Delete
lexer.py
29.62 MB
chmod
View
DL
Edit
Rename
Delete
loaders.py
17.25 MB
chmod
View
DL
Edit
Rename
Delete
meta.py
4.03 MB
chmod
View
DL
Edit
Rename
Delete
nativetypes.py
2.75 MB
chmod
View
DL
Edit
Rename
Delete
nodes.py
30.37 MB
chmod
View
DL
Edit
Rename
Delete
optimizer.py
1.42 MB
chmod
View
DL
Edit
Rename
Delete
parser.py
34.82 MB
chmod
View
DL
Edit
Rename
Delete
runtime.py
29.9 MB
chmod
View
DL
Edit
Rename
Delete
sandbox.py
17.12 MB
chmod
View
DL
Edit
Rename
Delete
tests.py
4.69 MB
chmod
View
DL
Edit
Rename
Delete
utils.py
21.91 MB
chmod
View
DL
Edit
Rename
Delete
visitor.py
3.16 MB
chmod
View
DL
Edit
Rename
Delete
_compat.py
3.12 MB
chmod
View
DL
Edit
Rename
Delete
_identifier.py
1.73 MB
chmod
View
DL
Edit
Rename
Delete
__init__.py
1.51 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /usr/lib/python3.9/site-packages/jinja2/nativetypes.py
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): """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. """ head = list(islice(nodes, 2)) if not head: return None if len(head) == 1: raw = head[0] if not isinstance(raw, str): return raw else: raw = u"".join([text_type(v) for v in chain(head, nodes)]) try: return literal_eval(raw) except (ValueError, SyntaxError, MemoryError): return raw class NativeCodeGenerator(CodeGenerator): """A code generator which renders Python types by not adding ``to_string()`` around output nodes. """ @staticmethod def _default_finalize(value): return value def _output_const_repr(self, group): return repr(u"".join([text_type(v) for v in 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))) except Exception: return self.environment.handle_exception() NativeEnvironment.template_class = NativeTemplate
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply