Skip to content

Commit bee714b

Browse files
authored
run codespell on pymodbus/pymodbus (#847)
* Install codespell, and correct spell errors. * Codespell pymodbus.
1 parent f92156b commit bee714b

File tree

20 files changed

+58
-58
lines changed

20 files changed

+58
-58
lines changed

pymodbus/bit_read_message.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class ReadCoilsResponse(ReadBitsResponseBase):
168168
function_code = 1
169169

170170
def __init__(self, values=None, **kwargs):
171-
""" Intializes a new instance
171+
""" Initializes a new instance
172172
173173
:param values: The request values to respond with
174174
"""
@@ -185,7 +185,7 @@ class ReadDiscreteInputsRequest(ReadBitsRequestBase):
185185
function_code = 2
186186

187187
def __init__(self, address=None, count=None, **kwargs):
188-
""" Intializes a new instance
188+
""" Initializes a new instance
189189
190190
:param address: The address to start reading from
191191
:param count: The number of bits to read
@@ -225,7 +225,7 @@ class ReadDiscreteInputsResponse(ReadBitsResponseBase):
225225
function_code = 2
226226

227227
def __init__(self, values=None, **kwargs):
228-
""" Intializes a new instance
228+
""" Initializes a new instance
229229
230230
:param values: The request values to respond with
231231
"""

pymodbus/client/asynchronous/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
event_loop, client = Client(schedulers.ASYNC_IO, port=5020)
2222
2323
# Here event_loop is a thread which would control the backend and future is
24-
# a Future/deffered object which would be used to
24+
# a Future/deferred object which would be used to
2525
# add call backs to run asynchronously.
2626
2727
# The Actual client could be accessed with future.result() with Tornado

pymodbus/client/asynchronous/deprecated/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
event_loop, client = Client(schedulers.ASYNC_IO, port=5020)
2929
3030
# Here event_loop is a thread which would control the backend and future is
31-
# a Future/deffered object which would be used to
31+
# a Future/deferred object which would be used to
3232
# add call backs to run asynchronously.
3333
3434
# The Actual client could be accessed with future.result() with Tornado

pymodbus/client/asynchronous/tornado/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def connect(self):
6565
raise gen.Return(self)
6666

6767
def on_receive(self, *args):
68-
""" On data recieve call back
68+
""" On data receive call back
6969
:param args: data received
7070
:return:
7171
"""
@@ -337,7 +337,7 @@ def _on_timeout():
337337
transaction.set_exception(TimeOutException())
338338

339339
def _on_write_done():
340-
""" Set up reader part after sucessful write to the serial. """
340+
""" Set up reader part after successful write to the serial. """
341341
_logger.debug("frame sent, waiting for a reply")
342342
self.last_frame_end = round(time.time(), 6)
343343
self.state = ModbusTransactionState.WAITING_FOR_REPLY

pymodbus/client/asynchronous/udp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""UDP comminication."""
1+
"""UDP communication."""
22
from __future__ import unicode_literals
33
from __future__ import absolute_import
44

pymodbus/client/sync.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
class BaseModbusClient(ModbusClientMixin):
32-
""" Inteface for a modbus synchronous client. Defined here are all the
32+
""" Interface for a modbus synchronous client. Defined here are all the
3333
methods for performing the related request methods. Derived classes
3434
simply need to implement the transport methods and set the correct
3535
framer.
@@ -259,7 +259,7 @@ def _recv(self, size):
259259
# socket.recv(size) waits until it gets some data from the host but
260260
# not necessarily the entire response that can be fragmented in
261261
# many packets.
262-
# To avoid the splitted responses to be recognized as invalid
262+
# To avoid split responses to be recognized as invalid
263263
# messages and to be discarded, loops socket.recv until full data
264264
# is received or timeout is expired.
265265
# If timeout expires returns the read data, also if its length is
@@ -408,7 +408,7 @@ def _recv(self, size):
408408
# socket.recv(size) waits until it gets some data from the host but
409409
# not necessarily the entire response that can be fragmented in
410410
# many packets.
411-
# To avoid the splitted responses to be recognized as invalid
411+
# To avoid split responses to be recognized as invalid
412412
# messages and to be discarded, loops socket.recv until full data
413413
# is received or timeout is expired.
414414
# If timeout expires returns the read data, also if its length is
@@ -709,12 +709,12 @@ def _wait_for_data(self):
709709
condition = partial(lambda dummy1, dummy2: True, dummy2=None)
710710
start = time.time()
711711
while condition(start):
712-
avaialble = self._in_waiting()
713-
if (more_data and not avaialble) or (more_data and avaialble == size):
712+
available = self._in_waiting()
713+
if (more_data and not available) or (more_data and available == size):
714714
break
715-
if avaialble and avaialble != size:
715+
if available and available != size:
716716
more_data = True
717-
size = avaialble
717+
size = available
718718
time.sleep(0.01)
719719
return size
720720

pymodbus/constants.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Defaults(Singleton): # pylint: disable=too-few-public-methods
6262
6363
The modbus slave addrss. Currently this is set to 0x00 which
6464
means this request should be broadcast to all the slave devices
65-
(really means that all the devices should respons).
65+
(really means that all the devices should respond).
6666
6767
.. attribute:: Baudrate
6868
@@ -99,7 +99,7 @@ class Defaults(Singleton): # pylint: disable=too-few-public-methods
9999
100100
In case a request is made to a missing slave, this defines if an error
101101
should be returned or simply ignored. This is useful for the case of a
102-
serial server emulater where a request to a non-existant slave on a bus
102+
serial server emulater where a request to a non-existent slave on a bus
103103
will never respond. The client in this case will simply timeout.
104104
105105
.. attribute:: broadcast_enable
@@ -170,7 +170,7 @@ class ModbusStatus(Singleton): # pylint: disable=too-few-public-methods
170170

171171

172172
class Endian(Singleton): # pylint: disable=too-few-public-methods
173-
""" An enumeration representing the various byte endianess.
173+
""" An enumeration representing the various byte endianness.
174174
175175
.. attribute:: Auto
176176
@@ -247,7 +247,7 @@ class MoreData(Singleton): # pylint: disable=too-few-public-methods
247247
248248
.. attribute:: Nothing
249249
250-
This indiates that no more objects are going to be returned.
250+
This indicates that no more objects are going to be returned.
251251
252252
.. attribute:: KeepReading
253253

pymodbus/datastore/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def __init__(self, slaves=None, single=True):
122122
self._slaves = {Defaults.UnitId: self._slaves}
123123

124124
def __iter__(self):
125-
""" Iterater over the current collection of slave
125+
""" Iterator over the current collection of slave
126126
contexts.
127127
128128
:returns: An iterator over the slave contexts

pymodbus/datastore/store.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
There are two ways that the server datastore can be implemented.
1515
The first is a complete range from 'address' start to 'count'
16-
number of indecies. This can be thought of as a straight array::
16+
number of indices. This can be thought of as a straight array::
1717
1818
data = range(1, 1 + count)
1919
[1,2,3,...,count]
@@ -39,7 +39,7 @@
3939
4040
Using this, layout, the first device will implement n, n+1, and n+2,
4141
however, the second device may set the latter two values to 0 or
42-
will simply not implmented the registers thus causing a single read
42+
will simply not implemented the registers thus causing a single read
4343
or a range read to fail.
4444
4545
I have both methods implemented, and leave it up to the user to change
@@ -120,7 +120,7 @@ def __str__(self):
120120
return f"DataStore({len(self.values)}, {self.default_value})"
121121

122122
def __iter__(self):
123-
""" Iterater over the data block data
123+
""" Iterator over the data block data
124124
125125
:returns: An iterator of the data block data
126126
"""

pymodbus/device.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ModbusAccessControl(Singleton):
3131
]
3232

3333
def __iter__(self):
34-
""" Iterater over the network access tablek
34+
""" Iterator over the network access tablek
3535
3636
:returns: An iterator of the network access table
3737
"""
@@ -144,7 +144,7 @@ def __init__(self):
144144
self.reset()
145145

146146
def __iter__(self):
147-
""" Iterater over the statistics
147+
""" Iterator over the statistics
148148
149149
:returns: An iterator of the modbus plus statistics
150150
"""
@@ -219,7 +219,7 @@ def __init__(self, info=None):
219219
self.__data[key] = info[key]
220220

221221
def __iter__(self):
222-
""" Iterater over the device information
222+
""" Iterator over the device information
223223
224224
:returns: An iterator of the device information
225225
"""
@@ -394,7 +394,7 @@ class ModbusCountersHandler:
394394
overrun is caused by data characters arriving at the port faster
395395
than they can.
396396
397-
.. note:: I threw the event counter in here for convinience
397+
.. note:: I threw the event counter in here for convenience
398398
"""
399399
__data = dict([(i, 0x0000) for i in range(9)]) # pylint: disable=consider-using-dict-comprehension
400400
__names = [
@@ -410,7 +410,7 @@ class ModbusCountersHandler:
410410
]
411411

412412
def __iter__(self):
413-
""" Iterater over the device counters
413+
""" Iterator over the device counters
414414
415415
:returns: An iterator of the device counters
416416
"""
@@ -488,7 +488,7 @@ def __str__(self):
488488
return "ModbusControl"
489489

490490
def __iter__(self):
491-
""" Iterater over the device counters
491+
""" Iterator over the device counters
492492
493493
:returns: An iterator of the device counters
494494
"""

0 commit comments

Comments
 (0)