docs: enforce 100 character line width in docstrings

Reformatted docstrings across device.py, helper.py, and io.py to honor
the 100 character line width limit, improving readability and
consistency with project formatting standards.
This commit is contained in:
Nicolai Buchwitz
2026-02-05 08:57:00 +01:00
committed by Sven Sager
parent e8af56ff70
commit c338069833
3 changed files with 36 additions and 15 deletions

View File

@@ -1053,10 +1053,14 @@ class Connect(Core):
""" """
Sets the automatic watchdog toggle. Sets the automatic watchdog toggle.
If this value is set to True, the necessary bit to toggle the watchdog is switched between True and False every 10 seconds in the background. If this value is set to True, the necessary bit to toggle the
This bit is automatically written to the process image with autorefresh=True. watchdog is switched between True and False every 10 seconds in
the background.
This bit is automatically written to the process image with
autorefresh=True.
IMPORTANT: If autorefresh=False, .writeprocimg() must be called cyclically to write the value to the process image!!! IMPORTANT: If autorefresh=False, .writeprocimg() must be called
cyclically to write the value to the process image!!!
:param value: True to activate, False to terminate :param value: True to activate, False to terminate
""" """
@@ -2046,9 +2050,11 @@ class Gateway(Device):
""" """
Class for the RevPi Gateway-Devices. Class for the RevPi Gateway-Devices.
Provides additional functions for the RevPi Gateway devices besides the functions from RevPiDevice. Provides additional functions for the RevPi Gateway devices besides
Gateways are ready. IOs on this device provide the replace_io function, the functions from RevPiDevice.
which allows defining custom IOs that map to a RevPiStructIO object. Gateways are ready. IOs on this device provide the replace_io
function, which allows defining custom IOs that map to a
RevPiStructIO object.
This IO type can process and return values via multiple bytes. This IO type can process and return values via multiple bytes.
:ref: :func:`revpimodio2.io.IntIOReplaceable.replace_io()` :ref: :func:`revpimodio2.io.IntIOReplaceable.replace_io()`
@@ -2096,7 +2102,10 @@ class Virtual(Gateway):
""" """
Writes piCtory default input values for a virtual device. Writes piCtory default input values for a virtual device.
If default values for inputs of a virtual device are specified in piCtory, these are only set at system startup or a piControl reset. If the process image is subsequently overwritten with NULL, these values will be lost. If default values for inputs of a virtual device are specified
in piCtory, these are only set at system startup or a piControl
reset. If the process image is subsequently overwritten with NULL,
these values will be lost.
This function can only be applied to virtual devices! This function can only be applied to virtual devices!
:return: True if operations on the virtual device were successful :return: True if operations on the virtual device were successful

View File

@@ -18,12 +18,20 @@ from .io import IOBase
class EventCallback(Thread): class EventCallback(Thread):
"""Thread for internal calling of event functions. """Thread for internal calling of event functions.
The event function that this thread calls will receive the thread itself as a parameter. This must be considered when defining the function, e.g., "def event(th):". For extensive functions, this can be evaluated to prevent duplicate starts. The event function that this thread calls will receive the thread itself
as a parameter. This must be considered when defining the function, e.g.,
"def event(th):". For extensive functions, this can be evaluated to
prevent duplicate starts.
The name of the IO object can be retrieved via EventCallback.ioname, The name of the IO object can be retrieved via EventCallback.ioname,
which triggered the event. EventCallback.iovalue returns the value of the IO object at the time of triggering. which triggered the event. EventCallback.iovalue returns the value of
The thread provides the EventCallback.exit event as an abort condition for the called function. the IO object at the time of triggering.
By calling the EventCallback.stop() function, the exit event is set and can be used to abort loops. The thread provides the EventCallback.exit event as an abort condition
A wait function can also be implemented with the .exit() event: "th.exit.wait(0.5)" - waits 500ms or aborts immediately if .stop() is called on the thread. for the called function.
By calling the EventCallback.stop() function, the exit event is set
and can be used to abort loops.
A wait function can also be implemented with the .exit() event:
"th.exit.wait(0.5)" - waits 500ms or aborts immediately if .stop()
is called on the thread.
while not th.exit.is_set(): while not th.exit.is_set():
# IO-Arbeiten # IO-Arbeiten
@@ -363,7 +371,9 @@ class ProcimgWriter(Thread):
""" """
Class for synchronization thread. Class for synchronization thread.
This class is started as a thread if the process image should be synchronized cyclically. This function is mainly used for event handling. This class is started as a thread if the process image should be
synchronized cyclically. This function is mainly used for event
handling.
""" """
__slots__ = ( __slots__ = (

View File

@@ -1465,8 +1465,10 @@ class StructIO(IOBase):
Handles byte and word order conversion based on configuration. Handles byte and word order conversion based on configuration.
:param value: If None, returns current value unpacked using struct format; otherwise packs and sets the value :param value: If None, returns current value unpacked using struct
:return: Current IO value unpacked according to struct format when called without arguments format; otherwise packs and sets the value
:return: Current IO value unpacked according to struct format when
called without arguments
""" """
if value is None: if value is None:
# Inline get_structdefaultvalue() # Inline get_structdefaultvalue()