Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
sphinx /
util /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
stemmer
[ DIR ]
drwxr-xr-x
__init__.py
19.24
KB
-rw-r--r--
build_phase.py
417
B
-rw-r--r--
cfamily.py
13.96
KB
-rw-r--r--
compat.py
1.2
KB
-rw-r--r--
console.py
3.48
KB
-rw-r--r--
docfields.py
16.11
KB
-rw-r--r--
docstrings.py
3.65
KB
-rw-r--r--
docutils.py
18.53
KB
-rw-r--r--
fileutil.py
3.72
KB
-rw-r--r--
i18n.py
9.71
KB
-rw-r--r--
images.py
2.92
KB
-rw-r--r--
inspect.py
31.36
KB
-rw-r--r--
inventory.py
6.28
KB
-rw-r--r--
jsdump.py
5.69
KB
-rw-r--r--
logging.py
17.92
KB
-rw-r--r--
matching.py
3.22
KB
-rw-r--r--
math.py
1.85
KB
-rw-r--r--
nodes.py
22.31
KB
-rw-r--r--
osutil.py
6.79
KB
-rw-r--r--
parallel.py
5.28
KB
-rw-r--r--
png.py
1.56
KB
-rw-r--r--
pycompat.py
2.04
KB
-rw-r--r--
requests.py
4.06
KB
-rw-r--r--
rst.py
3.35
KB
-rw-r--r--
smartypants.py
15.61
KB
-rw-r--r--
tags.py
2.72
KB
-rw-r--r--
template.py
4.65
KB
-rw-r--r--
texescape.py
5.46
KB
-rw-r--r--
typing.py
18.44
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : tags.py
""" sphinx.util.tags ~~~~~~~~~~~~~~~~ :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from typing import Iterator, List from jinja2 import nodes from jinja2.environment import Environment from jinja2.nodes import Node from jinja2.parser import Parser env = Environment() class BooleanParser(Parser): """ Only allow condition exprs and/or/not operations. """ def parse_compare(self) -> Node: node: Node token = self.stream.current if token.type == 'name': if token.value in ('true', 'false', 'True', 'False'): node = nodes.Const(token.value in ('true', 'True'), lineno=token.lineno) elif token.value in ('none', 'None'): node = nodes.Const(None, lineno=token.lineno) else: node = nodes.Name(token.value, 'load', lineno=token.lineno) next(self.stream) elif token.type == 'lparen': next(self.stream) node = self.parse_expression() self.stream.expect('rparen') else: self.fail("unexpected token '%s'" % (token,), token.lineno) return node class Tags: def __init__(self, tags: List[str] = None) -> None: self.tags = dict.fromkeys(tags or [], True) def has(self, tag: str) -> bool: return tag in self.tags __contains__ = has def __iter__(self) -> Iterator[str]: return iter(self.tags) def add(self, tag: str) -> None: self.tags[tag] = True def remove(self, tag: str) -> None: self.tags.pop(tag, None) def eval_condition(self, condition: str) -> bool: # exceptions are handled by the caller parser = BooleanParser(env, condition, state='variable') expr = parser.parse_expression() if not parser.stream.eos: raise ValueError('chunk after expression') def eval_node(node: Node) -> bool: if isinstance(node, nodes.CondExpr): if eval_node(node.test): return eval_node(node.expr1) else: return eval_node(node.expr2) elif isinstance(node, nodes.And): return eval_node(node.left) and eval_node(node.right) elif isinstance(node, nodes.Or): return eval_node(node.left) or eval_node(node.right) elif isinstance(node, nodes.Not): return not eval_node(node.node) elif isinstance(node, nodes.Name): return self.tags.get(node.name, False) else: raise ValueError('invalid node, check parsing') return eval_node(expr)
Close