Skip to content

Commit 4ee084d

Browse files
authored
Merge branch 'dev' into no-float-messages
2 parents 12c28f5 + b475772 commit 4ee084d

32 files changed

+335
-444
lines changed

API_changes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Version 3.2.0
1010
- `ReturnSlaveNoReponseCountResponse` has been corrected to
1111
`ReturnSlaveNoResponseCountResponse`
1212
- Option `--modbus-config` for REPL server renamed to `--modbus-config-path`
13+
- client.protocol.<something> --> client.<something>
14+
- client.factory.<something> --> client.<something>
1315

1416
-------------
1517
Version 3.1.0

examples/client_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async def run_async_client(client, modbus_calls=None):
119119
"""Run sync client."""
120120
_logger.info("### Client starting")
121121
await client.connect()
122-
assert client.protocol
122+
assert client.connected
123123
if modbus_calls:
124124
await modbus_calls(client)
125125
await client.close()

examples/client_payload.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ async def run_payload_calls(client):
105105
# Make sure word/byte order is consistent between BinaryPayloadBuilder and BinaryPayloadDecoder
106106
assert (
107107
decoder._byteorder == builder._byteorder # pylint: disable=protected-access
108-
) # nosec
108+
)
109109
assert (
110110
decoder._wordorder == builder._wordorder # pylint: disable=protected-access
111-
) # nosec
111+
)
112112

113113
decoded = OrderedDict(
114114
[

examples/v2.5.3/changing_framers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
# ----------------------------------------------------------------------- #
4444
rq = client.write_coil(1, True)
4545
rr = client.read_coils(1, 1)
46-
assert not rq.isError() # nosec test that we are not an error
47-
assert rr.bits[0] # nosec test the expected value
46+
assert not rq.isError() # test that we are not an error
47+
assert rr.bits[0] # test the expected value
4848

4949
# ----------------------------------------------------------------------- #
5050
# close the client

examples/v2.5.3/concurrent_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def _client_worker_process(factory, input_queue, output_queue, is_shutdown):
111111
txt = f"error in worker thread: {threading.current_thread()}"
112112
log.exception(txt)
113113
output_queue.put(WorkResponse(True, workitem.work_id, exc))
114-
except Exception: # nosec pylint: disable=broad-except
114+
except Exception: # pylint: disable=broad-except
115115
pass
116116
txt = f"request worker shutting down: {threading.current_thread()}"
117117
log.info(txt)

examples/v2.5.3/dbstore_update_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def updating_writer(parm1):
5757

5858
# import pdb; pdb.set_trace()
5959

60-
rand_value = random.randint(0, 9999) # nosec
61-
rand_addr = random.randint(0, 65000) # nosec
60+
rand_value = random.randint(0, 9999)
61+
rand_addr = random.randint(0, 65000)
6262
txt = f"Writing to datastore: {rand_addr}, {rand_value}"
6363
log.debug(txt)
6464
# import pdb; pdb.set_trace()

examples/v2.5.3/modbus_saver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* handle_save_end(self)
2828
"""
2929
import json
30-
import xml.etree.ElementTree as xml # nosec
30+
import xml.etree.ElementTree as xml
3131

3232

3333
class ModbusDatastoreSaver:

examples/v2.5.3/modbus_simulator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
with read/write data as well as user configurable base data
66
"""
77
import logging
8-
import pickle # nosec
8+
import pickle
99
from optparse import OptionParser # pylint: disable=deprecated-module
1010

1111
from pymodbus.datastore import ModbusServerContext, ModbusSlaveContext
@@ -82,7 +82,7 @@ def __init__(self, config):
8282

8383
def parse(self):
8484
"""Parse the config file and creates a server context"""
85-
handle = pickle.load(self.file) # nosec
85+
handle = pickle.load(self.file)
8686
try: # test for existence, or bomb
8787
dsd = handle["di"]
8888
csd = handle["ci"]

examples/v2.5.3/tornado_twisted/async_tornado_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def dassert(future, callback):
3939

4040
def _assertor(value):
4141
# by pass assertion, an error here stops the write callbacks
42-
assert value # nosec
42+
assert value
4343

4444
def on_done(f_trans):
4545
if exc := f_trans.exception():

examples/v2.5.3/tornado_twisted/async_tornado_client_serial.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# import needed libraries
1111
# ---------------------------------------------------------------------------#
1212
import logging
13+
from tempfile import gettempdir
1314

1415
from tornado.ioloop import IOLoop
1516

@@ -45,7 +46,7 @@ def dassert(future, callback):
4546

4647
def _assertor(value):
4748
# by pass assertion, an error here stops the write callbacks
48-
assert value # nosec
49+
assert value
4950

5051
def on_done(f_trans):
5152
if exc := f_trans.exception():
@@ -170,7 +171,7 @@ def callback(protocol, future):
170171
) = AsyncModbusSerialClient( # pylint: disable=unpacking-non-sequence
171172
schedulers.IO_LOOP,
172173
method="rtu",
173-
port="/tmp/ptyp0", # nosec
174+
port=gettempdir() + "/ptyp0",
174175
baudrate=9600,
175176
timeout=2,
176177
)

0 commit comments

Comments
 (0)