Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev3.7 async keyword changes #346

Merged
merged 9 commits into from
Oct 23, 2018
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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ matrix:
python: "3.5"
- os: linux
python: "3.6"
# - os: linux
# python: "3.7"
- os: osx
osx_image: xcode8.3
language: generic
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ Version 1.5.1

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 @@ -45,7 +45,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', 'recommonmark']
extensions = ['sphinx.ext.autodoc', 'm2r', 'recommonmark']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -112,7 +112,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
8 changes: 0 additions & 8 deletions doc/source/library/pymodbus.client.async.asyncio.rst

This file was deleted.

36 changes: 0 additions & 36 deletions doc/source/library/pymodbus.client.async.factory.rst

This file was deleted.

55 changes: 0 additions & 55 deletions doc/source/library/pymodbus.client.async.rst

This file was deleted.

8 changes: 0 additions & 8 deletions doc/source/library/pymodbus.client.async.schedulers.rst

This file was deleted.

8 changes: 0 additions & 8 deletions doc/source/library/pymodbus.client.async.tornado.rst

This file was deleted.

8 changes: 0 additions & 8 deletions doc/source/library/pymodbus.client.async.twisted.rst

This file was deleted.

8 changes: 8 additions & 0 deletions doc/source/library/pymodbus.client.asynchronous.asyncio.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pymodbus\.client\.asynchronous\.asyncio package
===============================================

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

36 changes: 36 additions & 0 deletions doc/source/library/pymodbus.client.asynchronous.factory.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
pymodbus\.client\.asynchronous\.factory package
===============================================

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

Submodules
----------

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

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

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

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

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

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


55 changes: 55 additions & 0 deletions doc/source/library/pymodbus.client.asynchronous.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
pymodbus\.client\.asynchronous package
======================================

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

Subpackages
-----------

.. toctree::

pymodbus.client.asynchronous.asyncio
pymodbus.client.asynchronous.factory
pymodbus.client.asynchronous.schedulers
pymodbus.client.asynchronous.tornado
pymodbus.client.asynchronous.twisted

Submodules
----------

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

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

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

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

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

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

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

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


Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pymodbus\.client\.asynchronous\.schedulers package
==================================================

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

8 changes: 8 additions & 0 deletions doc/source/library/pymodbus.client.asynchronous.tornado.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pymodbus\.client\.asynchronous\.tornado package
===============================================

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

8 changes: 8 additions & 0 deletions doc/source/library/pymodbus.client.asynchronous.twisted.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pymodbus\.client\.asynchronous\.twisted package
===============================================

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

2 changes: 1 addition & 1 deletion doc/source/library/pymodbus.client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Subpackages

.. toctree::

pymodbus.client.async
pymodbus.client.asynchronous

Submodules
----------
Expand Down
6 changes: 3 additions & 3 deletions doc/source/library/pymodbus.server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ pymodbus\.server package
Submodules
----------

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

.. automodule:: pymodbus.server.async
.. automodule:: pymodbus.server.asynchronous
:members:
:undoc-members:
:show-inheritance:
Expand Down
10 changes: 5 additions & 5 deletions examples/common/async_asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
import asyncio
import logging
# ----------------------------------------------------------------------- #
# Import the required async client
# Import the required asynchronous client
# ----------------------------------------------------------------------- #
from pymodbus.client.async.tcp import AsyncModbusTCPClient as ModbusClient
# from pymodbus.client.async.udp import (
from pymodbus.client.asynchronous.tcp import AsyncModbusTCPClient as ModbusClient
# from pymodbus.client.asynchronous.udp import (
# AsyncModbusUDPClient as ModbusClient)
from pymodbus.client.async import schedulers
from pymodbus.client.asynchronous import schedulers

else:
import sys
Expand Down Expand Up @@ -68,7 +68,7 @@ async def start_async_test(client):
# are not known to these tests. Furthermore, some use the same memory
# blocks for the two sets, so a change to one is a change to the other.
# Keep both of these cases in mind when testing as the following will
# _only_ pass with the supplied async modbus server (script supplied).
# _only_ pass with the supplied asynchronous modbus server (script supplied).
# ----------------------------------------------------------------------- #
log.debug("Write to a Coil and read back")
rq = await client.write_coil(0, True, unit=UNIT)
Expand Down
6 changes: 3 additions & 3 deletions examples/common/async_asyncio_serial_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
if IS_PYTHON3 and PYTHON_VERSION >= (3, 4):
import logging
import asyncio
from pymodbus.client.async.serial import (
from pymodbus.client.asynchronous.serial import (
AsyncModbusSerialClient as ModbusClient)
from pymodbus.client.async import schedulers
from pymodbus.client.asynchronous import schedulers
else:
import sys
sys.stderr("This example needs to be run only on python 3.4 and above")
Expand Down Expand Up @@ -63,7 +63,7 @@ async def start_async_test(client):
# Furthermore, some use the same memory blocks for the two sets,
# so a change to one is a change to the other.
# Keep both of these cases in mind when testing as the following will
# _only_ pass with the supplied async modbus server (script supplied).
# _only_ pass with the supplied asynchronous modbus server (script supplied).
# ----------------------------------------------------------------------- #
log.debug("Write to a Coil and read back")
rq = await client.write_coil(0, True, unit=UNIT)
Expand Down
6 changes: 3 additions & 3 deletions examples/common/async_tornado_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

import functools
from tornado.ioloop import IOLoop
from pymodbus.client.async import schedulers
from pymodbus.client.asynchronous import schedulers

# ---------------------------------------------------------------------------#
# choose the requested modbus protocol
# ---------------------------------------------------------------------------#

# from pymodbus.client.async.udp import AsyncModbusUDPClient as ModbusClient
from pymodbus.client.async.tcp import AsyncModbusTCPClient as ModbusClient
# from pymodbus.client.asynchronous.udp import AsyncModbusUDPClient as ModbusClient
from pymodbus.client.asynchronous.tcp import AsyncModbusTCPClient as ModbusClient

# ---------------------------------------------------------------------------#
# configure the client logging
Expand Down
Loading