Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated documentation to resolve warnings introduced with the longer …
…names

Updated requirements-docs.txt to include missing modules
  • Loading branch information
dices committed Sep 28, 2018
commit 38f1dc1c017375091ed64be837431efa37ca9d2d
9 changes: 7 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,18 @@ Version 1.5.1
* Added REPR statements for all syncchronous clients
* Added `isError` method to exceptions, Any response received can be tested for success before proceeding.

```
"""

res = client.read_holding_registers(...)
if not res.isError():

# proceed

else:
# handle error or raise
```

"""

* Add examples for MEI read device information request

Version 1.5.0
Expand Down
5 changes: 3 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.autodoc', 'm2r']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -104,7 +104,8 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']
html_static_path = []

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down
4 changes: 2 additions & 2 deletions doc/source/library/pymodbus.client.asynchronous.asyncio.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pymodbus\.client\.async\.asyncio package
========================================
pymodbus\.client\.asynchronous\.asyncio package
===============================================

.. automodule:: pymodbus.client.asynchronous.asyncio
:members:
Expand Down
16 changes: 8 additions & 8 deletions doc/source/library/pymodbus.client.asynchronous.factory.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pymodbus\.client\.async\.factory package
========================================
pymodbus\.client\.asynchronous\.factory package
===============================================

.. automodule:: pymodbus.client.asynchronous.factory
:members:
Expand All @@ -9,24 +9,24 @@ pymodbus\.client\.async\.factory package
Submodules
----------

pymodbus\.client\.async\.factory\.serial module
-----------------------------------------------
pymodbus\.client\.asynchronous\.factory\.serial module
------------------------------------------------------

.. automodule:: pymodbus.client.asynchronous.factory.serial
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.async\.factory\.tcp module
--------------------------------------------
pymodbus\.client\.asynchronous\.factory\.tcp module
---------------------------------------------------

.. automodule:: pymodbus.client.asynchronous.factory.tcp
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.async\.factory\.udp module
--------------------------------------------
pymodbus\.client\.asynchronous\.factory\.udp module
---------------------------------------------------

.. automodule:: pymodbus.client.asynchronous.factory.udp
:members:
Expand Down
18 changes: 9 additions & 9 deletions doc/source/library/pymodbus.client.asynchronous.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pymodbus\.client\.asynchronous package
===============================
======================================

.. automodule:: pymodbus.client.asynchronous
:members:
Expand All @@ -20,32 +20,32 @@ Subpackages
Submodules
----------

pymodbus\.client\.async\.serial module
--------------------------------------
pymodbus\.client\.asynchronous\.serial module
---------------------------------------------

.. automodule:: pymodbus.client.asynchronous.serial
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.async\.tcp module
-----------------------------------
pymodbus\.client\.asynchronous\.tcp module
------------------------------------------

.. automodule:: pymodbus.client.asynchronous.tcp
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.async\.thread module
--------------------------------------
pymodbus\.client\.asynchronous\.thread module
---------------------------------------------

.. automodule:: pymodbus.client.asynchronous.thread
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.async\.udp module
-----------------------------------
pymodbus\.client\.asynchronous\.udp module
------------------------------------------

.. automodule:: pymodbus.client.asynchronous.udp
:members:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pymodbus\.client\.async\.schedulers package
===========================================
pymodbus\.client\.asynchronous\.schedulers package
==================================================

.. automodule:: pymodbus.client.asynchronous.schedulers
:members:
Expand Down
4 changes: 2 additions & 2 deletions doc/source/library/pymodbus.client.asynchronous.tornado.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pymodbus\.client\.async\.tornado package
========================================
pymodbus\.client\.asynchronous\.tornado package
===============================================

.. automodule:: pymodbus.client.asynchronous.tornado
:members:
Expand Down
4 changes: 2 additions & 2 deletions doc/source/library/pymodbus.client.asynchronous.twisted.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pymodbus\.client\.async\.twisted package
========================================
pymodbus\.client\.asynchronous\.twisted package
===============================================

.. automodule:: pymodbus.client.asynchronous.twisted
:members:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/library/pymodbus.server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Submodules
----------

pymodbus\.server\.asynchronous module
------------------------------
-------------------------------------

.. automodule:: pymodbus.server.asynchronous
:members:
Expand Down
2 changes: 1 addition & 1 deletion pymodbus/framer/ascii_framer.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def processIncomingPacket(self, data, callback, unit, **kwargs):
:param data: The new packet data
:param callback: The function to send results to
:param unit: Process if unit id matches, ignore otherwise (could be a
list of unit ids (server) or single unit id(client/server))
list of unit ids (server) or single unit id(client/server))
:param single: True or False (If True, ignore unit address validation)

"""
Expand Down
2 changes: 1 addition & 1 deletion pymodbus/framer/binary_framer.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def processIncomingPacket(self, data, callback, unit, **kwargs):
:param data: The new packet data
:param callback: The function to send results to
:param unit: Process if unit id matches, ignore otherwise (could be a
list of unit ids (server) or single unit id(client/server)
list of unit ids (server) or single unit id(client/server)
:param single: True or False (If True, ignore unit address validation)

"""
Expand Down
3 changes: 2 additions & 1 deletion pymodbus/framer/rtu_framer.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ def processIncomingPacket(self, data, callback, unit, **kwargs):
:param data: The new packet data
:param callback: The function to send results to
:param unit: Process if unit id matches, ignore otherwise (could be a
list of unit ids (server) or single unit id(client/server)
list of unit ids (server) or single unit id(client/server)
:param single: True or False (If True, ignore unit address validation)

"""
if not isinstance(unit, (list, tuple)):
unit = [unit]
Expand Down
2 changes: 1 addition & 1 deletion pymodbus/framer/socket_framer.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def processIncomingPacket(self, data, callback, unit, **kwargs):
:param data: The new packet data
:param callback: The function to send results to
:param unit: Process if unit id matches, ignore otherwise (could be a
list of unit ids (server) or single unit id(client/server)
list of unit ids (server) or single unit id(client/server)
:param single: True or False (If True, ignore unit address validation)

"""
Expand Down
6 changes: 6 additions & 0 deletions pymodbus/repl/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,11 @@ def report_slave_id(self, **kwargs):
def read_exception_status(self, **kwargs):
"""
Read the contents of eight Exception Status outputs in a remote device.

:param unit: The slave unit this request is targeting

:return:

"""
request = ReadExceptionStatusRequest(**kwargs)
resp = self.execute(request)
Expand All @@ -311,8 +314,11 @@ def get_com_event_counter(self, **kwargs):
"""
Read status word and an event count from the remote device's communication
event counter

:param unit: The slave unit this request is targeting

:return:

"""
request = GetCommEventCounterRequest(**kwargs)
resp = self.execute(request)
Expand Down
18 changes: 15 additions & 3 deletions pymodbus/repl/completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,44 +49,56 @@ def command_names(self):
return self._commands.keys()

def completing_command(self, words, word_before_cursor):
"""Determine if we are currently completing the hn command.
"""
Determine if we are currently completing the hn command.

:type words: list
:param words: The input text broken into word tokens.
:type word_before_cursor: str
:param word_before_cursor: The current word before the cursor,
which might be one or more blank spaces.
:rtype: bool

:return: Specifies whether we are currently completing the hn command.

"""
if len(words) == 1 and word_before_cursor != '':
return True
else:
return False

def completing_arg(self, words, word_before_cursor):
"""Determine if we are currently completing an arg.
"""
Determine if we are currently completing an arg.

:type words: list
:param words: The input text broken into word tokens.
:type word_before_cursor: str
:param word_before_cursor: The current word before the cursor,
which might be one or more blank spaces.
:rtype: bool

:return: Specifies whether we are currently completing an arg.

"""
if len(words) > 1 and word_before_cursor != '':
return True
else:
return False

def arg_completions(self, words, word_before_cursor):
"""Generates arguments completions based on the input.
"""
Generates arguments completions based on the input.

:type words: list
:param words: The input text broken into word tokens.
:type word_before_cursor: str
:param word_before_cursor: The current word before the cursor,
which might be one or more blank spaces.
:rtype: list

:return: A list of completions.

"""
cmd = words[0].strip()
cmd = self._commands.get(cmd, None)
Expand Down
23 changes: 14 additions & 9 deletions pymodbus/server/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,18 @@ def _is_main_thread():

def StartTcpServer(context, identity=None, address=None,
console=False, defer_reactor_run=False, **kwargs):
""" Helper method to start the Modbus Async TCP server
"""
Helper method to start the Modbus Async TCP server

:param context: The server data context
:param identify: The server identity to use (default empty)
:param address: An optional (interface, port) to bind to.
:param console: A flag indicating if you want the debug console
:param ignore_missing_slaves: True to not send errors on a request
to a missing slave
to a missing slave
:param defer_reactor_run: True/False defer running reactor.run() as part
of starting server, to be explictly started by the user
of starting server, to be explictly started by the user

"""
from twisted.internet import reactor

Expand All @@ -258,15 +260,16 @@ def StartTcpServer(context, identity=None, address=None,

def StartUdpServer(context, identity=None, address=None,
defer_reactor_run=False, **kwargs):
""" Helper method to start the Modbus Async Udp server
"""
Helper method to start the Modbus Async Udp server

:param context: The server data context
:param identify: The server identity to use (default empty)
:param address: An optional (interface, port) to bind to.
:param ignore_missing_slaves: True to not send errors on a request
to a missing slave
to a missing slave
:param defer_reactor_run: True/False defer running reactor.run() as part
of starting server, to be explictly started by the user
of starting server, to be explictly started by the user
"""
from twisted.internet import reactor

Expand All @@ -284,7 +287,8 @@ def StartSerialServer(context, identity=None,
framer=ModbusAsciiFramer,
defer_reactor_run=False,
**kwargs):
""" Helper method to start the Modbus Async Serial server
"""
Helper method to start the Modbus Async Serial server

:param context: The server data context
:param identify: The server identity to use (default empty)
Expand All @@ -293,9 +297,10 @@ def StartSerialServer(context, identity=None,
:param baudrate: The baud rate to use for the serial device
:param console: A flag indicating if you want the debug console
:param ignore_missing_slaves: True to not send errors on a request to a
missing slave
missing slave
:param defer_reactor_run: True/False defer running reactor.run() as part
of starting server, to be explictly started by the user
of starting server, to be explictly started by the user

"""
from twisted.internet import reactor
from twisted.internet.serialport import SerialPort
Expand Down
3 changes: 3 additions & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ SQLAlchemy==1.1.15 # Required to parse some files
tornado==4.5.2 # Required to parse some files
twisted>= 12.2.0 # Required to parse some files
prompt_toolkit>=2.0.4
click>=6.7
m2r>=0.2.0