-
Notifications
You must be signed in to change notification settings - Fork 1k
Improve types for REPL #2007
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
Improve types for REPL #2007
Conversation
c2aaf64 to
714ffd3
Compare
|
|
||
| if ctx is not None and ctx.token_normalize_func is not None: | ||
| value = ctx.token_normalize_func(value) | ||
| for choice in self.casted_choices: # pylint: disable=no-member |
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 searched for casted_choices in git history as well as Click project, and could not find it anywhere.
| 'PARITY_SPACE. Default to "N"', | ||
| default="N", | ||
| type=CaseInsenstiveChoice(["N", "E", "O", "M", "S"]), | ||
| type=click.Choice(["N", "E", "O", "M", "S"], case_sensitive=False), |
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.
this will automatically normalize to the values in the list (upper case) so we can kill CaseInsensitiveChoice class entirely
alex@antorak:~/git/pymodbus$ pymodbus.console serial --port /dev/blah --parity e
> client.get_parity
"E"
janiversen
left a comment
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.
LGTM, thanks.
Is your problem solved ?
| | | \___ / Y ( <_> ) /_/ | | | \ ___/| |_> > |__ | ||
| |____| / ____\____|__ /\____/\____ | /\ |____|_ /\___ > __/|____/ | ||
| \/ \/ \/ \/ \/ \/|__| | ||
| v1.3.0 - {pymodbus_version} |
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.
We should really change this to refer to the version in pymodbus/init
Not sure. I submitted this PR from my home machine (not at work), and was only looking at Today I have installed |
Closes #2006
Also reduces a further 15
mypyerrors and deletes some junk.