-
Notifications
You must be signed in to change notification settings - Fork 216
Make pause after sending SDO request configurable #429
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,9 @@ class SdoClient(SdoBase): | |
| #: Seconds to wait before sending a request, for rate limiting | ||
| PAUSE_BEFORE_SEND = 0.0 | ||
|
|
||
| #: Seconds to wait after sending a request | ||
| PAUSE_AFTER_SEND = 0.1 | ||
|
|
||
| def __init__(self, rx_cobid, tx_cobid, od): | ||
| """ | ||
| :param int rx_cobid: | ||
|
|
@@ -56,7 +59,8 @@ def send_request(self, request): | |
| if not retries_left: | ||
| raise | ||
| logger.info(str(e)) | ||
| time.sleep(0.1) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are in fact changing the default behavior here. What are the consequences? I'd hate breaking people's usage of the library because they are not aware of this change. There must be a reason why this delay was added. Although I completely agree it should be configurable.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was actually unintentional. I meant it to initalize Edit:. Fixed. |
||
| if self.PAUSE_AFTER_SEND: | ||
| time.sleep(self.PAUSE_AFTER_SEND) | ||
| else: | ||
| break | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc nit:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please not. It's inconsistent with the other docs and just one more useless character in the source. Let's not get into such nit-picks :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are docstrings both with and without dots; I'm not sure if there is already consistency ;) Nits are nits; it is ok to ignore them :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me clarify: you are right that the docstrings are consistent, but the rendered docs are not consistent, since the docs for attributes and methods include correct punctuation. Up to you to if this needs cleaning up ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it doesn't need any action on our part. If the Sphinx automatically appends a period, that's fine and expected. Doxygen does likewise IIRC. Some Python style checkers (I'm using flake8) already point out inconsistencies in docstrings. Such as "missing period", "not a single sentence" or "not in imperative mood". There are no analogous conventions for attribute descriptions AFAIK, but it does make sense to not document them with an imperative sentence. Thus also no full-stop required. It's just a descriptive phrase.