Code and project cleanup

This commit is contained in:
2023-01-20 17:08:35 +01:00
parent 1b7397e608
commit 05e4ff96ca
7 changed files with 17 additions and 14 deletions

2
.gitignore vendored
View File

@@ -114,5 +114,5 @@ dmypy.json
# Pyre type checker
.pyre/
/test/
/make.conf
/test_local/

View File

@@ -1,5 +1,6 @@
recursive-include src/revpimodio *.py
include LICENSE.txt
include Makefile
include MANIFEST.in
include README.md
include requirements.txt
include setup.py

View File

@@ -1,2 +1,2 @@
setuptools>=65.6.3
setuptools>=58.0.4
wheel

View File

@@ -176,7 +176,8 @@ class IOList(object):
if type(oldio) == StructIO:
# Hier gibt es schon einen neuen IO
if oldio._bitshift:
if io._bitshift == oldio._bitshift and io._slc_address == oldio._slc_address:
if io._bitshift == oldio._bitshift \
and io._slc_address == oldio._slc_address:
raise MemoryError(
"bit {0} already assigned to '{1}'".format(
io._bitaddress, oldio._name
@@ -311,7 +312,8 @@ class IOBase(object):
# Bitadressen auf Bytes aufbrechen und umrechnen
self._bitaddress = -1 if valuelist[7] == "" else int(valuelist[7]) % 8
self._bitshift = None if self._bitaddress == -1 else 1 << self._bitaddress
self._bitshift = None if self._bitaddress == -1 \
else 1 << self._bitaddress
# Längenberechnung
self._bitlength = int(valuelist[2])

View File

@@ -69,7 +69,8 @@ class RevPiModIO(object):
:param simulator: Laedt das Modul als Simulator und vertauscht IOs
:param debug: Gibt alle Warnungen inkl. Zyklusprobleme aus
:param replace_io_file: Replace IO Konfiguration aus Datei laden
:param shared_procimg: Share process image with other processes (insecure for automation, little slower)
:param shared_procimg: Share process image with other processes, this
could be insecure for automation
:param direct_output: Deprecated, use shared_procimg
"""
# Parameterprüfung
@@ -290,7 +291,9 @@ class RevPiModIO(object):
elif device["type"] == DeviceType.LEFT_RIGHT:
# IOs
pt = int(device["productType"])
if pt == ProductType.DIO or pt == ProductType.DI or pt == ProductType.DO:
if pt == ProductType.DIO \
or pt == ProductType.DI \
or pt == ProductType.DO:
# DIO / DI / DO
dev_new = devicemodule.DioModule(
self, device, simulator=self._simulator
@@ -1454,7 +1457,6 @@ def run_plc(
:param debug: Print all warnings and detailed error messages
:param procimg: Use different process image
:param configrsc: Use different piCtory configuration
:return: None or the return value of the cycle function
"""
rpi = RevPiModIO(

View File

@@ -710,11 +710,13 @@ class RevPiNetIO(_RevPiModIO):
:param simulator: Laedt das Modul als Simulator und vertauscht IOs
:param debug: Gibt bei allen Fehlern komplette Meldungen aus
:param replace_io_file: Replace IO Konfiguration aus Datei laden
:param shared_procimg: Share process image with other processes (insecure for automation, little slower)
:param shared_procimg: Share process image with other processes, this
could be insecure for automation
:param direct_output: Deprecated, use shared_procimg
"""
check_ip = compile(
r"^(25[0-5]|(2[0-4]|[01]?\d|)\d)(\.(25[0-5]|(2[0-4]|[01]?\d|)\d)){3}$"
r"^(25[0-5]|(2[0-4]|[01]?\d|)\d)"
r"(\.(25[0-5]|(2[0-4]|[01]?\d|)\d)){3}$"
)
# Adresse verarbeiten
@@ -1054,9 +1056,6 @@ def run_net_plc(
:param cycletime: Cycle time in milliseconds
:param replace_io_file: Load replace IO configuration from file
:param debug: Print all warnings and detailed error messages
:param procimg: Use different process image
:param configrsc: Use different piCtory configuration
:return: None or the return value of the cycle function
"""
rpi = RevPiNetIO(

View File

@@ -1 +0,0 @@
[DEFAULT]