MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / _insert_message

Method _insert_message

scripts/griffe_extensions.py:25–29  ·  view source on GitHub ↗
(self, obj: Function | Class, message: str)

Source from the content-addressed store, hash-verified

23 """Griffe extension for `@markdown.util.deprecated` decorator support."""
24
25 def _insert_message(self, obj: Function | Class, message: str) -> None:
26 if not obj.docstring:
27 obj.docstring = Docstring("", parent=obj)
28 sections = obj.docstring.parsed
29 sections.insert(0, DocstringSectionAdmonition(kind="warning", text=message, title="Deprecated"))
30
31 def on_class_instance(self, node: ast.AST | ObjectNode, cls: Class, agent: Visitor | Inspector, **kwargs: Any) -> None: # noqa: ARG002
32 """Add section to docstrings of deprecated classes."""

Callers 2

on_class_instanceMethod · 0.95
on_function_instanceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected