Skip to content

Commit c7a4eac

Browse files
authored
Solve pylint unhappy. (#1799)
1 parent 222c171 commit c7a4eac

File tree

12 files changed

+25
-24
lines changed

12 files changed

+25
-24
lines changed

examples/client_async.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def setup_async_client(description=None, cmdline=None):
5757
client = AsyncModbusTcpClient(
5858
args.host,
5959
port=args.port, # on which port
60-
# Common optional paramers:
60+
# Common optional parameters:
6161
framer=args.framer,
6262
timeout=args.timeout,
6363
retries=3,
@@ -73,7 +73,7 @@ def setup_async_client(description=None, cmdline=None):
7373
client = AsyncModbusUdpClient(
7474
args.host,
7575
port=args.port,
76-
# Common optional paramers:
76+
# Common optional parameters:
7777
framer=args.framer,
7878
timeout=args.timeout,
7979
# retries=3,
@@ -86,7 +86,7 @@ def setup_async_client(description=None, cmdline=None):
8686
elif args.comm == "serial":
8787
client = AsyncModbusSerialClient(
8888
args.port,
89-
# Common optional paramers:
89+
# Common optional parameters:
9090
# framer=ModbusRtuFramer,
9191
timeout=args.timeout,
9292
# retries=3,
@@ -104,7 +104,7 @@ def setup_async_client(description=None, cmdline=None):
104104
client = AsyncModbusTlsClient(
105105
args.host,
106106
port=args.port,
107-
# Common optional paramers:
107+
# Common optional parameters:
108108
framer=args.framer,
109109
timeout=args.timeout,
110110
# retries=3,

examples/client_sync.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def setup_sync_client(description=None, cmdline=None):
6161
client = ModbusTcpClient(
6262
args.host,
6363
port=args.port,
64-
# Common optional paramers:
64+
# Common optional parameters:
6565
framer=args.framer,
6666
timeout=args.timeout,
6767
# retries=3,
@@ -75,7 +75,7 @@ def setup_sync_client(description=None, cmdline=None):
7575
client = ModbusUdpClient(
7676
args.host,
7777
port=args.port,
78-
# Common optional paramers:
78+
# Common optional parameters:
7979
framer=args.framer,
8080
timeout=args.timeout,
8181
# retries=3,
@@ -88,7 +88,7 @@ def setup_sync_client(description=None, cmdline=None):
8888
elif args.comm == "serial":
8989
client = ModbusSerialClient(
9090
port=args.port, # serial port
91-
# Common optional paramers:
91+
# Common optional parameters:
9292
# framer=ModbusRtuFramer,
9393
timeout=args.timeout,
9494
# retries=3,
@@ -106,7 +106,7 @@ def setup_sync_client(description=None, cmdline=None):
106106
client = ModbusTlsClient(
107107
args.host,
108108
port=args.port,
109-
# Common optional paramers:
109+
# Common optional parameters:
110110
framer=args.framer,
111111
timeout=args.timeout,
112112
# retries=3,

examples/contrib/solar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def main():
2929
client = ModbusTcpClient(
3030
"modbusServer.lan",
3131
port=502,
32-
# Common optional paramers:
32+
# Common optional parameters:
3333
framer=ModbusSocketFramer,
3434
timeout=1,
3535
retry_on_empty=True,

pymodbus/client/mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def diag_restart_communication(
174174
) -> ModbusResponse:
175175
"""Diagnose restart communication (code 0x08 sub 0x01).
176176
177-
:param toggle: True if toogled.
177+
:param toggle: True if toggled.
178178
:param slave: (optional) Modbus slave ID
179179
:param kwargs: (optional) Experimental parameters.
180180
:raises ModbusException:

pymodbus/datastore/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ModbusBaseSlaveContext: # pylint: disable=too-few-public-methods
1919
_fx_mapper.update([(i, "h") for i in (3, 6, 16, 22, 23)])
2020
_fx_mapper.update([(i, "c") for i in (1, 5, 15)])
2121

22-
def decode(self, fx): # pylint: disable=invalid-name
22+
def decode(self, fx):
2323
"""Convert the function code to the datastore to.
2424
2525
:param fx: The function we are working with

pymodbus/repl/client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ result.raw Return raw result dict.
204204
205205
```
206206

207-
Every command has auto suggetion on the arguments supported , supply arg and value are to be supplied in `arg=val` format.
207+
Every command has auto suggestion on the arguments supported , supply arg and value are to be supplied in `arg=val` format.
208208
```
209209
210210
> client.read_holding_registers count=4 address=9 slave=1

pymodbus/server/simulator/http_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from pymodbus.factory import ServerDecoder
2222
from pymodbus.logging import Log
2323
from pymodbus.pdu import ExceptionResponse
24-
from pymodbus.server import (
24+
from pymodbus.server.async_io import (
2525
ModbusSerialServer,
2626
ModbusTcpServer,
2727
ModbusTlsServer,

pymodbus/server/simulator/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
"""HTTP server for modbus simulator.
33
4-
The modbus simulator contain 3 distint parts:
4+
The modbus simulator contain 3 distinct parts:
55
66
- Datastore simulator, to define registers and their behaviour including actions: (simulator)(../../datastore/simulator.py)
77
- Modbus server: (server)(./http_server.py)

pymodbus/utilities.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ def dict_property(store, index):
7777
getter = lambda self: store( # pylint: disable=unnecessary-lambda-assignment
7878
self
7979
)[index]
80-
setter = lambda self, value: store( # pylint: disable=unnecessary-dunder-call,unnecessary-lambda-assignment
81-
self
82-
).__setitem__(
83-
index, value
80+
setter = (
81+
lambda self, value: store( # pylint: disable=unnecessary-lambda-assignment
82+
self
83+
).__setitem__(index, value)
8484
)
8585
elif isinstance(store, str):
8686
getter = lambda self: self.__getattribute__( # pylint: disable=unnecessary-dunder-call,unnecessary-lambda-assignment
@@ -97,7 +97,7 @@ def dict_property(store, index):
9797
getter = lambda self: store[ # pylint: disable=unnecessary-lambda-assignment
9898
index
9999
]
100-
setter = lambda self, value: store.__setitem__( # pylint: disable=unnecessary-dunder-call,unnecessary-lambda-assignment
100+
setter = lambda self, value: store.__setitem__( # pylint: disable=unnecessary-lambda-assignment
101101
index, value
102102
)
103103

setup.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,19 @@ load-plugins=
8282
pylint.extensions.bad_builtin,
8383
pylint.extensions.check_elif,
8484
pylint.extensions.code_style,
85-
pylint.extensions.comparetozero,
8685
pylint.extensions.comparison_placement,
8786
pylint.extensions.confusing_elif,
8887
pylint.extensions.docparams,
8988
pylint.extensions.docstyle,
90-
pylint.extensions.emptystring,
9189
pylint.extensions.eq_without_hash,
9290
pylint.extensions.for_any_all,
9391
pylint.extensions.overlapping_exceptions,
9492
pylint.extensions.private_import,
9593
pylint.extensions.set_membership,
9694
pylint.extensions.typing,
95+
# NO longer supported:
96+
# pylint.extensions.comparetozero,
97+
# pylint.extensions.emptystring,
9798
# NOT WANTED:
9899
# pylint.extensions.mccabe, (replaced by ruff)
99100
# pylint.extensions.broad_try_clause,

0 commit comments

Comments
 (0)