MCPcopy Create free account
hub / github.com/dadadel/pyment / parse_docs

Method parse_docs

pyment/docstring.py:1621–1646  ·  view source on GitHub ↗

Parses the docstring :param raw: the data to parse if not internally provided (Default value = None) :param before_lim: specify raw or unicode or format docstring type (ie. "r" for r'''... or "fu" for fu'''...)

(self, raw=None, before_lim='')

Source from the content-addressed store, hash-verified

1619 # TODO do something with this?
1620
1621 def parse_docs(self, raw=None, before_lim=''):
1622 """Parses the docstring
1623
1624 :param raw: the data to parse if not internally provided (Default value = None)
1625 :param before_lim: specify raw or unicode or format docstring type (ie. "r" for r'''... or "fu" for fu'''...)
1626
1627 """
1628 self.before_lim = before_lim
1629 if raw is not None:
1630 raw = raw.strip()
1631 if raw.startswith('"""') or raw.startswith("'''"):
1632 raw = raw[3:]
1633 if raw.endswith('"""') or raw.endswith("'''"):
1634 raw = raw[:-3]
1635 self.docs['in']['raw'] = raw
1636 self.dst.autodetect_style(raw)
1637 if self.docs['in']['raw'] is None:
1638 return
1639 self.dst.set_known_parameters(self.element['params'])
1640 self._extract_docs_doctest()
1641 self._extract_docs_params()
1642 self._extract_docs_return()
1643 self._extract_docs_raises()
1644 self._extract_docs_description()
1645 self._extract_docs_other()
1646 self.parsed_docs = True
1647
1648 def _set_desc(self):
1649 """Sets the global description if any"""

Calls 8

_extract_docs_doctestMethod · 0.95
_extract_docs_paramsMethod · 0.95
_extract_docs_returnMethod · 0.95
_extract_docs_raisesMethod · 0.95
_extract_docs_otherMethod · 0.95
autodetect_styleMethod · 0.80
set_known_parametersMethod · 0.80