Skip to content

Conversation

@alexrudd2
Copy link
Collaborator

Closes #2006

Also reduces a further 15 mypy errors and deletes some junk.


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
Copy link
Collaborator Author

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),
Copy link
Collaborator Author

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"

Copy link
Collaborator

@janiversen janiversen left a 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}
Copy link
Collaborator

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

@janiversen janiversen merged commit b34eb46 into dev Feb 12, 2024
@janiversen janiversen deleted the repl-types branch February 12, 2024 07:03
@alexrudd2
Copy link
Collaborator Author

alexrudd2 commented Feb 12, 2024

Is your problem solved ?

Not sure. I submitted this PR from my home machine (not at work), and was only looking at pyright output. I created the issue for the benefit of anyone else who may be searching the issue tracker. (They might run into it on a released version even if we have fixed in dev)

Today I have installed pymodbus (from pip not git) on a work machine, which led to #2008

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REPL client params are broken

3 participants