From 15d06fa5c20bc6a5a6b4df136aeb3d76379435cf Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 30 Sep 2023 12:35:31 +0200 Subject: [PATCH] Improved docstring parser logic. --- platypush/plugins/__init__.py | 2 +- platypush/utils/reflection/_parser.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/platypush/plugins/__init__.py b/platypush/plugins/__init__.py index 3615f921b..39cb9f32b 100644 --- a/platypush/plugins/__init__.py +++ b/platypush/plugins/__init__.py @@ -130,7 +130,7 @@ class RunnablePlugin(Plugin): ): """ :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 deprecated. :param stop_timeout: How long we should wait for any running diff --git a/platypush/utils/reflection/_parser.py b/platypush/utils/reflection/_parser.py index 57f07b8ac..fa89def7a 100644 --- a/platypush/utils/reflection/_parser.py +++ b/platypush/utils/reflection/_parser.py @@ -133,7 +133,7 @@ class DocstringParser: return None 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) yield ctx @@ -179,9 +179,6 @@ class DocstringParser: ctx.state = ParseState.PARAM idx = len(ctx.parsed_params) ctx.cur_param = m.group("name") - if ctx.cur_param not in ctx.param_names: - return - ctx.parsed_params[ctx.cur_param] = Parameter( name=ctx.cur_param, required=(