mirror of
https://github.com/naruxde/revpimodio2.git
synced 2025-11-08 22:03:53 +01:00
Lock des replace_io bei Verwendung von replace_io_file entfernt
This commit is contained in:
@@ -1000,13 +1000,6 @@ class IntIOReplaceable(IntIO):
|
||||
>Python3 struct</a>
|
||||
|
||||
"""
|
||||
# Sperre prüfen
|
||||
if self._parentdevice._modio._lck_replace_io:
|
||||
raise RuntimeError(
|
||||
"can not use this function while using an external "
|
||||
"replace_io_file"
|
||||
)
|
||||
|
||||
# StructIO erzeugen
|
||||
io_new = StructIO(
|
||||
self,
|
||||
|
||||
@@ -37,7 +37,7 @@ class RevPiModIO(object):
|
||||
"_maxioerrors", "_myfh", "_myfh_lck", "_monitoring", "_procimg", \
|
||||
"_simulator", "_syncoutputs", "_th_mainloop", "_waitexit", \
|
||||
"core", "app", "device", "exitsignal", "io", "summary", "_debug", \
|
||||
"_lck_replace_io", "_replace_io_file", "_run_on_pi"
|
||||
"_replace_io_file", "_run_on_pi"
|
||||
|
||||
def __init__(
|
||||
self, autorefresh=False, monitoring=False, syncoutputs=True,
|
||||
@@ -85,7 +85,6 @@ class RevPiModIO(object):
|
||||
self._imgwriter = None
|
||||
self._ioerror = 0
|
||||
self._length = 0
|
||||
self._lck_replace_io = False
|
||||
self._looprunning = False
|
||||
self._lst_devselect = []
|
||||
self._lst_refresh = []
|
||||
@@ -308,8 +307,6 @@ class RevPiModIO(object):
|
||||
@param ireplaceio: Data to replace ios as <class 'ConfigParser'>
|
||||
|
||||
"""
|
||||
need_replace_lock = False
|
||||
|
||||
for io in creplaceio:
|
||||
if io == "DEFAULT":
|
||||
continue
|
||||
@@ -365,16 +362,12 @@ class RevPiModIO(object):
|
||||
# IO ersetzen
|
||||
try:
|
||||
self.io[parentio].replace_io(name=io, **dict_replace)
|
||||
need_replace_lock = True
|
||||
except Exception as e:
|
||||
raise RuntimeError(
|
||||
"replace_io_file: can not replace '{0}' with '{1}' "
|
||||
"| RevPiModIO message: {2}".format(parentio, io, e)
|
||||
)
|
||||
|
||||
# Sperre für weiter .replace_io Aufrufe setzen
|
||||
self._lck_replace_io = need_replace_lock
|
||||
|
||||
def _create_myfh(self):
|
||||
"""Erstellt FileObject mit Pfad zum procimg.
|
||||
return FileObject"""
|
||||
|
||||
@@ -582,8 +582,8 @@ class RevPiNetIO(_RevPiModIO):
|
||||
configrsc=None,
|
||||
simulator=simulator,
|
||||
debug=debug,
|
||||
replace_io_file=replace_io_file
|
||||
direct_output
|
||||
replace_io_file=replace_io_file,
|
||||
direct_output=direct_output,
|
||||
)
|
||||
|
||||
# Netzwerkfilehandler anlegen
|
||||
|
||||
Reference in New Issue
Block a user