Fixed _default_docstring regex.

This commit is contained in:
Fabio Manganiello 2023-09-30 14:35:31 +02:00
parent 532f5479b3
commit 1732bfa82c
Signed by: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 3 additions and 3 deletions

View file

@ -49,7 +49,7 @@ steps:
commands: commands:
- echo "Installing required build dependencies" - echo "Installing required build dependencies"
- apk add --update --no-cache make py3-sphinx py3-pip $(cat platypush/install/requirements/alpine.txt) - apk add --update --no-cache make py3-sphinx py3-pip py3-paho-mqtt $(cat platypush/install/requirements/alpine.txt)
- pip install -U hid sphinx-rtd-theme sphinx-book-theme - pip install -U hid sphinx-rtd-theme sphinx-book-theme
- pip install . - pip install .
- mkdir -p /docs/current - mkdir -p /docs/current

View file

@ -99,7 +99,7 @@ class DocstringParser:
_param_doc_re = re.compile(r"^:param\s+(?P<name>[\w_]+):\s+(?P<doc>.*)$") _param_doc_re = re.compile(r"^:param\s+(?P<name>[\w_]+):\s+(?P<doc>.*)$")
_type_doc_re = re.compile(r"^:type\s+[\w_]+:.*$") _type_doc_re = re.compile(r"^:type\s+[\w_]+:.*$")
_return_doc_re = re.compile(r"^:return:\s+(?P<doc>.*)$") _return_doc_re = re.compile(r"^:return:\s+(?P<doc>.*)$")
_default_docstring = re.compile(r"^Initialize self. See help") _default_docstring = re.compile(r"^\s*Initialize self\. See help.*$")
def __init__( def __init__(
self, self,
@ -186,7 +186,7 @@ class DocstringParser:
ctx.cur_param = m.group("name") ctx.cur_param = m.group("name")
# Skip vararg/var keyword parameters # Skip vararg/var keyword parameters
if ctx.cur_param == ctx.spec.varkw or ctx.spec.varargs: if ctx.cur_param in {ctx.spec.varkw, ctx.spec.varargs}:
return return
ctx.parsed_params[ctx.cur_param] = Parameter( ctx.parsed_params[ctx.cur_param] = Parameter(