Skip to content

Commit 6f4a2ae

Browse files
pyln-client: remove unused doc variable from plugin.
Changelog-Changed: Removed the redundant code to improve clarity and maintainability. The `doc` variable was being initialised and processed but not used anywhere. Signed-off-by: Nishant Bansal <[email protected]>
1 parent b6c1ffa commit 6f4a2ae

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

contrib/pyln-client/pyln/client/plugin.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ def get_usage(self):
8484
args.append("[%s]" % arg)
8585

8686
if self.description is not None:
87-
args.append("\n%s" % self.description)
87+
doc = inspect.getdoc(self.func)
88+
doc = re.sub('\n+', ' | ', doc)
89+
args.append(" | %s" % doc)
8890

8991
return " ".join(args)
9092

@@ -938,16 +940,6 @@ def _getmanifest(self, **kwargs) -> JSONType:
938940
'after': method.after})
939941
continue
940942

941-
doc = inspect.getdoc(method.func)
942-
if not doc:
943-
self.log(
944-
'RPC method \'{}\' does not have a docstring.'.format(
945-
method.name
946-
)
947-
)
948-
doc = "Undocumented RPC method from a plugin."
949-
doc = re.sub('\n+', ' ', doc)
950-
951943
# For compatibility with lightningd prior to 24.08, we must
952944
# provide a description. Ignored by 24.08 onwards,
953945
description = method.description

0 commit comments

Comments
 (0)