-
Notifications
You must be signed in to change notification settings - Fork 949
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
Improve types for REPL #2007
Conversation
c2aaf64
to
714ffd3
Compare
@@ -88,12 +88,6 @@ def convert(self, value, param, ctx): | |||
if value in self.choices: | |||
return self.typ(value) | |||
|
|||
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.
@@ -342,7 +332,7 @@ def tcp(ctx, host, port, framer): | |||
"PARITY_NONE, PARITY_EVEN, PARITY_ODD PARITY_MARK, " | |||
'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"
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 ?
@@ -38,7 +38,7 @@ | |||
| | \___ / 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
mypy
errors and deletes some junk.