Improve transport service documentation - #329
Open
sgunes-wirepas wants to merge 11 commits into
Open
Conversation
Environment variable name is passed to "metavar" in argparse, so it is now printed in the help text. Formatter class is switched to RawDescriptionHelpFormatter to make it possible to write more detailed group level descriptions in the future. The default value or choices for an argument is printed by the new wrapper instead of the formatter.
It has never been used earlier; no need to wire it up now
This allows running the docker container with wm-gw --help to get the help text. Earlier, it was failing because a connection to the system bus was required during import. It might be possible to use lazy import with python 3.15 in the future.
| # extension requires a running system bus. This allows running "--help" | ||
| # without connecting to a dbus daemon. | ||
| import dbusCExtension | ||
| self._dbus_c_extension = dbusCExtension |
Contributor
Author
There was a problem hiding this comment.
Not sure about this one; it's not nice to do an import here but this is the easiest way to get help text to print without a dbus connection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve argparse parameters so that --help can be used as documentation and source of truth. After this, the table in docker/docker-compose/README.md can be removed and, a new one added in transport service readme based on the help text.
Briefly:
docker run wirepas/gateway_transport_service wm-gw --helpshould now workExample output