Skip to content

Commit

Permalink
improve github workflow, cosmetic update in client
Browse files Browse the repository at this point in the history
  • Loading branch information
sourceperl committed Dec 21, 2021
1 parent 090617f commit 7f88132
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: Tests

on:
push:
Expand All @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ The module is currently test on Python 3.4, 3.5, 3.6, 3.7, 3.8, 3.9 and 3.10.

Status:

.. image:: https://github.com/sourceperl/pyModbusTCP/actions/workflows/tests.yml/badge.svg?branch=master
:target: https://github.com/sourceperl/pyModbusTCP/actions/workflows/tests.yml

.. image:: https://readthedocs.org/projects/pymodbustcp/badge/?version=latest
:target: http://pymodbustcp.readthedocs.io/en/latest/?badge=latest

Expand Down
8 changes: 5 additions & 3 deletions pyModbusTCP/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def host(self, hostname=None):
except socket.error:
pass
# DNS name ?
if re.match('^[a-z][a-z0-9\.\-]+$', hostname):
if re.match(r'^[a-z][a-z0-9.\-]+$', hostname):
self.__hostname = hostname
return self.__hostname
else:
Expand Down Expand Up @@ -1028,7 +1028,8 @@ def _pretty_dump(self, label, data):
s += i + ' '
print(s)

def _add_crc(self, frame):
@staticmethod
def _add_crc(frame):
"""Add CRC to modbus frame (for RTU mode)
:param frame: modbus RTU frame
Expand All @@ -1039,7 +1040,8 @@ def _add_crc(self, frame):
crc = struct.pack('<H', crc16(frame))
return frame + crc

def _crc_is_ok(self, frame):
@staticmethod
def _crc_is_ok(frame):
"""Check the CRC of modbus RTU frame
:param frame: modbus RTU frame with CRC
Expand Down

0 comments on commit 7f88132

Please sign in to comment.