OXIESEC PANEL
- Current Dir:
/
/
usr
/
local
/
lib
/
python3.6
/
dist-packages
/
jinja2
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/19/2021 04:38:27 PM
rwxrwxr-x
📄
__init__.py
2.15 KB
09/19/2021 04:38:25 PM
rw-r--r--
📁
__pycache__
-
09/19/2021 04:38:27 PM
rwxr-xr-x
📄
_identifier.py
1.73 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
async_utils.py
1.71 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
bccache.py
12.38 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
compiler.py
70.36 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
constants.py
1.4 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
debug.py
9.02 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
defaults.py
1.24 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
environment.py
60.13 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
exceptions.py
4.95 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
ext.py
31.37 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
filters.py
51.34 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
idtracking.py
10.46 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
lexer.py
29.22 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
loaders.py
21.83 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
meta.py
4.29 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
nativetypes.py
3.59 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
nodes.py
33.7 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
optimizer.py
1.61 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
parser.py
38.83 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
py.typed
0 bytes
09/19/2021 04:38:25 PM
rw-r--r--
📄
runtime.py
34.19 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
sandbox.py
14.26 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
tests.py
5.77 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
utils.py
26.33 KB
09/19/2021 04:38:25 PM
rw-r--r--
📄
visitor.py
3.49 KB
09/19/2021 04:38:25 PM
rw-r--r--
Editing: async_utils.py
Close
import inspect import typing as t from functools import wraps from .utils import _PassArg from .utils import pass_eval_context V = t.TypeVar("V") def async_variant(normal_func): # type: ignore def decorator(async_func): # type: ignore pass_arg = _PassArg.from_obj(normal_func) need_eval_context = pass_arg is None if pass_arg is _PassArg.environment: def is_async(args: t.Any) -> bool: return t.cast(bool, args[0].is_async) else: def is_async(args: t.Any) -> bool: return t.cast(bool, args[0].environment.is_async) @wraps(normal_func) def wrapper(*args, **kwargs): # type: ignore b = is_async(args) if need_eval_context: args = args[1:] if b: return async_func(*args, **kwargs) return normal_func(*args, **kwargs) if need_eval_context: wrapper = pass_eval_context(wrapper) wrapper.jinja_async_variant = True return wrapper return decorator async def auto_await(value: t.Union[t.Awaitable["V"], "V"]) -> "V": if inspect.isawaitable(value): return await t.cast("t.Awaitable[V]", value) return t.cast("V", value) async def auto_aiter( iterable: "t.Union[t.AsyncIterable[V], t.Iterable[V]]", ) -> "t.AsyncIterator[V]": if hasattr(iterable, "__aiter__"): async for item in t.cast("t.AsyncIterable[V]", iterable): yield item else: for item in t.cast("t.Iterable[V]", iterable): yield item async def auto_to_list( value: "t.Union[t.AsyncIterable[V], t.Iterable[V]]", ) -> t.List["V"]: return [x async for x in auto_aiter(value)]