-
Notifications
You must be signed in to change notification settings - Fork 961
pyln_client: (re-)adds method description to usage via docstring #7680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyln_client: (re-)adds method description to usage via docstring #7680
Conversation
9965a02 to
5cf477b
Compare
|
@cdecker Another option would be to reintroduce the |
|
We had to fix it quickly for the release, BUT the correct answer is to use the docstring! We already introspect, so accessing doc is easy (which always exists, but is None for no doc string). |
5cf477b to
4dbdb14
Compare
Thanks for the clarification. I have been away from the project for a while as you know ;) I rewrote the PR to use python docstring doc (if set) as the description. |
|
We may want to extend the JSON schema to have the description as a separate field (and not internally newline concatenated to the usage). What do you think? |
The old `long_description` was removed and deprecated a while ago
without adding a proper replacement for plugin developers.
The getmanifest JSON that was to be used for that only knows `name` and `usage`.
This PR adds an optional `description` parameter that will be filled
with the methods docstring `__doc__` (if set).
Example:
@p.method("example")
def some_method(...)
"""some description"""
...
Changelog-Add: optional description paramter to Plugin.Method
d7c9f08 to
8fd7bba
Compare
|
Trivial rebase! |
The extended usage information (long_description) has been removed a while ago without proper replacement. ( commit 2ff3e55 Date: Mon Jul 29 17:58:43 2024 -0700 )
This PR does the following:
descriptionparameter to a plugin method via docstring that will (if set) be appended with a newline following the generated usage argument list.print_usageThings to think about