Skip to content

Commit 46752cc

Browse files
camtarnAndy Walker
authored andcommitted
Add newlines to docstrings to stop docs breaking
Without newlines, the docstring (including :params:, :return: etc) all collapses onto a single line.
1 parent 55d15e5 commit 46752cc

File tree

8 files changed

+61
-0
lines changed

8 files changed

+61
-0
lines changed

pymodbus/client/asynchronous/async_io/__init__.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class BaseModbusAsyncClientProtocol(AsyncModbusClientMixin):
2828
async def execute(self, request=None):
2929
"""
3030
Executes requests asynchronously
31+
3132
:param request:
3233
:return:
3334
"""
@@ -40,6 +41,7 @@ def connection_made(self, transport):
4041
Called when a connection is made.
4142
4243
The transport argument is the transport representing the connection.
44+
4345
:param transport:
4446
:return:
4547
"""
@@ -54,6 +56,7 @@ def connection_lost(self, reason):
5456
Called when the connection is lost or closed.
5557
5658
The argument is either an exception object or None
59+
5760
:param reason:
5861
:return:
5962
"""
@@ -67,6 +70,7 @@ def data_received(self, data):
6770
"""
6871
Called when some data is received.
6972
data is a non-empty bytes object containing the incoming data.
73+
7074
:param data:
7175
:return:
7276
"""
@@ -75,13 +79,15 @@ def data_received(self, data):
7579
def create_future(self):
7680
"""
7781
Helper function to create asyncio Future object
82+
7883
:return:
7984
"""
8085
return asyncio.Future()
8186

8287
def resolve_future(self, f, result):
8388
"""
8489
Resolves the completed future and sets the result
90+
8591
:param f:
8692
:param result:
8793
:return:
@@ -92,6 +98,7 @@ def resolve_future(self, f, result):
9298
def raise_future(self, f, exc):
9399
"""
94100
Sets exception of a future if not done
101+
95102
:param f:
96103
:param exc:
97104
:return:
@@ -198,6 +205,7 @@ def data_received(self, data):
198205
"""
199206
Called when some data is received.
200207
data is a non-empty bytes object containing the incoming data.
208+
201209
:param data:
202210
:return:
203211
"""
@@ -237,6 +245,7 @@ class ReconnectingAsyncioModbusTcpClient(object):
237245
def __init__(self, protocol_class=None, loop=None, **kwargs):
238246
"""
239247
Initialize ReconnectingAsyncioModbusTcpClient
248+
240249
:param protocol_class: Protocol used to talk to modbus device.
241250
:param loop: Event loop to use
242251
"""
@@ -263,6 +272,7 @@ def reset_delay(self):
263272
def start(self, host, port=502):
264273
"""
265274
Initiates connection to start client
275+
266276
:param host:
267277
:param port:
268278
:return:
@@ -278,6 +288,7 @@ def start(self, host, port=502):
278288
def stop(self):
279289
"""
280290
Stops client
291+
281292
:return:
282293
"""
283294
# prevent reconnect:
@@ -354,6 +365,7 @@ class AsyncioModbusTcpClient(object):
354365
def __init__(self, host=None, port=502, protocol_class=None, loop=None, **kwargs):
355366
"""
356367
Initializes Asyncio Modbus Tcp Client
368+
357369
:param host: Host IP address
358370
:param port: Port to connect
359371
:param protocol_class: Protocol used to talk to modbus device.
@@ -444,6 +456,7 @@ class ReconnectingAsyncioModbusTlsClient(ReconnectingAsyncioModbusTcpClient):
444456
def __init__(self, protocol_class=None, loop=None, framer=None, **kwargs):
445457
"""
446458
Initialize ReconnectingAsyncioModbusTcpClient
459+
447460
:param protocol_class: Protocol used to talk to modbus device.
448461
:param loop: Event loop to use
449462
"""
@@ -454,6 +467,7 @@ def __init__(self, protocol_class=None, loop=None, framer=None, **kwargs):
454467
def start(self, host, port=802, sslctx=None, server_hostname=None):
455468
"""
456469
Initiates connection to start client
470+
457471
:param host:
458472
:param port:
459473
:param sslctx:
@@ -511,6 +525,7 @@ class ReconnectingAsyncioModbusUdpClient(object):
511525
def __init__(self, protocol_class=None, loop=None, **kwargs):
512526
"""
513527
Initializes ReconnectingAsyncioModbusUdpClient
528+
514529
:param protocol_class: Protocol used to talk to modbus device.
515530
:param loop: Asyncio Event loop
516531
"""
@@ -538,6 +553,7 @@ def reset_delay(self):
538553
def start(self, host, port=502):
539554
"""
540555
Start reconnecting asynchronous udp client
556+
541557
:param host: Host IP to connect
542558
:param port: Host port to connect
543559
:return:
@@ -561,6 +577,7 @@ def start(self, host, port=502):
561577
def stop(self):
562578
"""
563579
Stops connection and prevents reconnect
580+
564581
:return:
565582
"""
566583
# prevent reconnect:
@@ -643,6 +660,7 @@ class AsyncioModbusUdpClient(object):
643660
def __init__(self, host=None, port=502, protocol_class=None, loop=None, **kwargs):
644661
"""
645662
Initializes Asyncio Modbus UDP Client
663+
646664
:param host: Host IP address
647665
:param port: Port to connect
648666
:param protocol_class: Protocol used to talk to modbus device.
@@ -664,6 +682,7 @@ def __init__(self, host=None, port=502, protocol_class=None, loop=None, **kwargs
664682
def stop(self):
665683
"""
666684
Stops connection
685+
667686
:return:
668687
"""
669688
# prevent reconnect:
@@ -745,6 +764,7 @@ def __init__(self, port, protocol_class=None, framer=None, loop=None,
745764
baudrate=9600, bytesize=8, parity='N', stopbits=1, **serial_kwargs):
746765
"""
747766
Initializes Asyncio Modbus Serial Client
767+
748768
:param port: Port to connect
749769
:param protocol_class: Protocol used to talk to modbus device.
750770
:param framer: Framer to use
@@ -768,6 +788,7 @@ def __init__(self, port, protocol_class=None, framer=None, loop=None,
768788
def stop(self):
769789
"""
770790
Stops connection
791+
771792
:return:
772793
"""
773794
if self._connected:
@@ -788,6 +809,7 @@ def _connected(self):
788809
def connect(self):
789810
"""
790811
Connect Async client
812+
791813
:return:
792814
"""
793815
_logger.debug('Connecting.')
@@ -838,6 +860,7 @@ def protocol_lost_connection(self, protocol):
838860
def init_tcp_client(proto_cls, loop, host, port, **kwargs):
839861
"""
840862
Helper function to initialize tcp client
863+
841864
:param proto_cls:
842865
:param loop:
843866
:param host:
@@ -856,6 +879,7 @@ def init_tls_client(proto_cls, loop, host, port, sslctx=None,
856879
server_hostname=None, framer=None, **kwargs):
857880
"""
858881
Helper function to initialize tcp client
882+
859883
:param proto_cls:
860884
:param loop:
861885
:param host:
@@ -877,6 +901,7 @@ def init_tls_client(proto_cls, loop, host, port, sslctx=None,
877901
def init_udp_client(proto_cls, loop, host, port, **kwargs):
878902
"""
879903
Helper function to initialize UDP client
904+
880905
:param proto_cls:
881906
:param loop:
882907
:param host:

pymodbus/client/asynchronous/factory/serial.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
def reactor_factory(port, framer, **kwargs):
1616
"""
1717
Factory to create twisted serial asynchronous client
18+
1819
:param port: Serial port
1920
:param framer: Modbus Framer
2021
:param kwargs:
@@ -59,6 +60,7 @@ def __init__(self, framer, *args, **kwargs):
5960
def io_loop_factory(port=None, framer=None, **kwargs):
6061
"""
6162
Factory to create Tornado based asynchronous serial clients
63+
6264
:param port: Serial port
6365
:param framer: Modbus Framer
6466
:param kwargs:
@@ -82,6 +84,7 @@ def io_loop_factory(port=None, framer=None, **kwargs):
8284
def async_io_factory(port=None, framer=None, **kwargs):
8385
"""
8486
Factory to create asyncio based asynchronous serial clients
87+
8588
:param port: Serial port
8689
:param framer: Modbus Framer
8790
:param kwargs: Serial port options
@@ -114,6 +117,7 @@ def async_io_factory(port=None, framer=None, **kwargs):
114117
def get_factory(scheduler):
115118
"""
116119
Gets protocol factory based on the backend scheduler being used
120+
117121
:param scheduler: REACTOR/IO_LOOP/ASYNC_IO
118122
:return:
119123
"""

pymodbus/client/asynchronous/factory/tcp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def reactor_factory(host="127.0.0.1", port=Defaults.Port, framer=None,
1717
source_address=None, timeout=None, **kwargs):
1818
"""
1919
Factory to create twisted tcp asynchronous client
20+
2021
:param host: Host IP address
2122
:param port: Port
2223
:param framer: Modbus Framer
@@ -52,6 +53,7 @@ def io_loop_factory(host="127.0.0.1", port=Defaults.Port, framer=None,
5253
source_address=None, timeout=None, **kwargs):
5354
"""
5455
Factory to create Tornado based asynchronous tcp clients
56+
5557
:param host: Host IP address
5658
:param port: Port
5759
:param framer: Modbus Framer
@@ -80,6 +82,7 @@ def io_loop_factory(host="127.0.0.1", port=Defaults.Port, framer=None,
8082
def async_io_factory(host="127.0.0.1", port=Defaults.Port, **kwargs):
8183
"""
8284
Factory to create asyncio based asynchronous tcp clients
85+
8386
:param host: Host IP address
8487
:param port: Port
8588
:param framer: Modbus Framer
@@ -107,6 +110,7 @@ def async_io_factory(host="127.0.0.1", port=Defaults.Port, **kwargs):
107110
def get_factory(scheduler):
108111
"""
109112
Gets protocol factory based on the backend scheduler being used
113+
110114
:param scheduler: REACTOR/IO_LOOP/ASYNC_IO
111115
:return
112116
"""

pymodbus/client/asynchronous/factory/tls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def async_io_factory(host="127.0.0.1", port=Defaults.TLSPort, sslctx=None,
1616
server_hostname=None, framer=None, **kwargs):
1717
"""
1818
Factory to create asyncio based asynchronous tls clients
19+
1920
:param host: Host IP address
2021
:param port: Port
2122
:param sslctx: The SSLContext to use for TLS (default None and auto create)
@@ -47,6 +48,7 @@ def async_io_factory(host="127.0.0.1", port=Defaults.TLSPort, sslctx=None,
4748
def get_factory(scheduler):
4849
"""
4950
Gets protocol factory based on the backend scheduler being used
51+
5052
:param scheduler: ASYNC_IO
5153
:return
5254
"""

pymodbus/client/asynchronous/factory/udp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def reactor_factory(host="127.0.0.1", port=Defaults.Port, framer=None,
1414
source_address=None, timeout=None, **kwargs):
1515
"""
1616
Factory to create twisted udp asynchronous client
17+
1718
:param host: Host IP address
1819
:param port: Port
1920
:param framer: Modbus Framer
@@ -29,6 +30,7 @@ def io_loop_factory(host="127.0.0.1", port=Defaults.Port, framer=None,
2930
source_address=None, timeout=None, **kwargs):
3031
"""
3132
Factory to create Tornado based asynchronous udp clients
33+
3234
:param host: Host IP address
3335
:param port: Port
3436
:param framer: Modbus Framer
@@ -55,6 +57,7 @@ def io_loop_factory(host="127.0.0.1", port=Defaults.Port, framer=None,
5557
def async_io_factory(host="127.0.0.1", port=Defaults.Port, **kwargs):
5658
"""
5759
Factory to create asyncio based asynchronous udp clients
60+
5861
:param host: Host IP address
5962
:param port: Port
6063
:param framer: Modbus Framer
@@ -79,6 +82,7 @@ def async_io_factory(host="127.0.0.1", port=Defaults.Port, **kwargs):
7982
def get_factory(scheduler):
8083
"""
8184
Gets protocol factory based on the backend scheduler being used
85+
8286
:param scheduler: REACTOR/IO_LOOP/ASYNC_IO
8387
:return
8488
"""

0 commit comments

Comments
 (0)