Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
# examples = os.path.join(parent_dir, "examples")
example_contrib = os.path.join(parent_dir, "examples/contrib")
example_common = os.path.join(parent_dir, "examples/common")
example_gui = os.path.join(parent_dir, "examples/gui")
# example_gui = os.path.join(parent_dir, "examples/gui")

sys.path.insert(0, os.path.abspath(os.pardir))
sys.path.append(example_common)
sys.path.append(example_contrib)
sys.path.append(example_gui)
# sys.path.append(example_gui)
# sys.path.extend([examples, example_common, example_contrib, example_gui])
# sys.path.insert(0, os.path.abspath("../"))

Expand Down
4 changes: 4 additions & 0 deletions doc/source/example/asyncio_server.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
==================================================
Asyncio Server Example
==================================================
.. literalinclude:: ../../../examples/common/asyncio_server.py
2 changes: 2 additions & 0 deletions doc/source/example/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Examples

async_asyncio_client
async_asyncio_serial_client
asyncio_server
asynchronous_asyncio_modbus_tls_client
callback_server
changing_framers
Expand All @@ -20,6 +21,7 @@ Examples
synchronous_client
synchronous_client_ext
synchronous_server
updating_server

asynchronous_asyncio_serial_client
bcd_payload
Expand Down
4 changes: 4 additions & 0 deletions doc/source/example/updating_server.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
==================================================
Updating Server Example
==================================================
.. literalinclude:: ../../../examples/common/updating_server.py
14 changes: 14 additions & 0 deletions doc/source/library/pymodbus.constants.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pymodbus\.constants package
===========================

.. automodule:: pymodbus.constants
:members:
:undoc-members:
:show-inheritance:
:noindex:

Submodules
----------



10 changes: 1 addition & 9 deletions doc/source/library/pymodbus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Subpackages
.. toctree::

pymodbus.client
pymodbus.constants
pymodbus.datastore
pymodbus.framer
pymodbus.internal
Expand All @@ -38,15 +39,6 @@ pymodbus\.bit\_write\_message module
:undoc-members:
:show-inheritance:

pymodbus\.constants module
--------------------------

.. automodule:: pymodbus.constants
:members:
:undoc-members:
:show-inheritance:
:noindex:

pymodbus\.device module
-----------------------

Expand Down
16 changes: 8 additions & 8 deletions examples/common/synchronous_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# --------------------------------------------------------------------------- #
from pymodbus.version import version

# from pymodbus.server.sync import StartTcpServer #NOSONAR
# from pymodbus.server.sync import StartTlsServer #NOSONAR
# from pymodbus.server.sync import StartUdpServer #NOSONAR
# from pymodbus.server.sync import StartSerialServer #NOSONAR
from pymodbus.server.sync import StartTcpServer # NOSONAR
# from pymodbus.server.sync import StartTlsServer # NOSONAR
# from pymodbus.server.sync import StartUdpServer # NOSONAR
# from pymodbus.server.sync import StartSerialServer # NOSONAR
from pymodbus.device import ModbusDeviceIdentification
from pymodbus.datastore import ModbusSequentialDataBlock

# from pymodbus.datastore import ModbusSparseDataBlock #NOSONAR
# from pymodbus.datastore import ModbusSparseDataBlock # NOSONAR
from pymodbus.datastore import ModbusSlaveContext, ModbusServerContext

# from pymodbus.transaction import ModbusRtuFramer, ModbusBinaryFramer #NOSONAR
Expand Down Expand Up @@ -100,14 +100,14 @@ def run_server():
ir=ModbusSequentialDataBlock(0, [17] * 100),
)

ModbusServerContext(slaves=store, single=True)
context = ModbusServerContext(slaves=store, single=True)

# ----------------------------------------------------------------------- #
# initialize the server information
# ----------------------------------------------------------------------- #
# If you don"t set this or any fields, they are defaulted to empty strings.
# ----------------------------------------------------------------------- #
ModbusDeviceIdentification(
identity = ModbusDeviceIdentification(
info_name={
"VendorName": "Pymodbus",
"ProductCode": "PM",
Expand All @@ -122,7 +122,7 @@ def run_server():
# run the server you want
# ----------------------------------------------------------------------- #
# Tcp:
# StartTcpServer(context, identity=identity, address=("", 5020))
StartTcpServer(context, identity=identity, address=("", 5020))
#
# TCP with different framer
# StartTcpServer(context, identity=identity,
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ check-str-concat-over-line-jumps=no
#max-line-length-suggestions=

[flake8]
exclude = .venv,.git,.tox,venv,build
exclude = .venv,.git,.tox,venv,build,tornado_twisted
max-complexity = 25
doctests = True
max-line-length = 120
Expand Down