Improved docstring parser logic.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
e6f05dfe07
commit
15d06fa5c2
2 changed files with 2 additions and 5 deletions
|
@ -130,7 +130,7 @@ class RunnablePlugin(Plugin):
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
:param poll_interval: How often the :meth:`.loop` function should be
|
:param poll_interval: How often the :meth:`.loop` function should be
|
||||||
execute (default: 15 seconds). *NOTE*: For back-compatibility
|
executed (default: 15 seconds). *NOTE*: For back-compatibility
|
||||||
reasons, the `poll_seconds` argument is also supported, but it's
|
reasons, the `poll_seconds` argument is also supported, but it's
|
||||||
deprecated.
|
deprecated.
|
||||||
:param stop_timeout: How long we should wait for any running
|
:param stop_timeout: How long we should wait for any running
|
||||||
|
|
|
@ -133,7 +133,7 @@ class DocstringParser:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
lines = text.split("\n")
|
lines = text.split("\n")
|
||||||
return (lines[0] + tw.dedent("\n".join(lines[1:]) or "")).strip()
|
return (lines[0] + " " + tw.dedent("\n".join(lines[1:]) or "")).strip()
|
||||||
|
|
||||||
ctx = ParseContext(obj)
|
ctx = ParseContext(obj)
|
||||||
yield ctx
|
yield ctx
|
||||||
|
@ -179,9 +179,6 @@ class DocstringParser:
|
||||||
ctx.state = ParseState.PARAM
|
ctx.state = ParseState.PARAM
|
||||||
idx = len(ctx.parsed_params)
|
idx = len(ctx.parsed_params)
|
||||||
ctx.cur_param = m.group("name")
|
ctx.cur_param = m.group("name")
|
||||||
if ctx.cur_param not in ctx.param_names:
|
|
||||||
return
|
|
||||||
|
|
||||||
ctx.parsed_params[ctx.cur_param] = Parameter(
|
ctx.parsed_params[ctx.cur_param] = Parameter(
|
||||||
name=ctx.cur_param,
|
name=ctx.cur_param,
|
||||||
required=(
|
required=(
|
||||||
|
|
Loading…
Reference in a new issue