data module passes all ruff checks
Build Debian Packages / build (bookworm, debian12) (push) Successful in 7m42s
Build Debian Packages / build (bullseye, debian11) (push) Successful in 7m10s
Build Debian Packages / build (trixie, debian13) (push) Successful in 8m24s

This commit is contained in:
2026-03-19 13:24:24 +01:00
parent aba78a0b53
commit 3cd93f1c7e
+5 -8
View File
@@ -2,15 +2,11 @@
# provides data to experiment script and display # provides data to experiment script and display
import sys import sys
import types
import tables import tables
import collections import collections
import threading import threading
import traceback import traceback
import io import io
from . import ADC_Result
from . import Accumulation
from . import MeasurementResult
class DataPool(collections.abc.MutableMapping): class DataPool(collections.abc.MutableMapping):
""" """
@@ -103,8 +99,8 @@ class DataPool(collections.abc.MutableMapping):
self.__dictlock.release() self.__dictlock.release()
def __send_event(self, _event): def __send_event(self, _event):
for l in self.__registered_listeners: for listeners in self.__registered_listeners:
l(_event.copy()) listeners(_event.copy())
def __del__(self): def __del__(self):
self.__send_event(DataPool.Event(DataPool.Event.destroy)) self.__send_event(DataPool.Event(DataPool.Event.destroy))
@@ -124,13 +120,14 @@ class DataPool(collections.abc.MutableMapping):
self.__dictlock.release() self.__dictlock.release()
try: try:
for key in dict_keys: for key in dict_keys:
if key[:2]=="__": continue if key.startswith("__"):
continue
dump_dir=dump_group dump_dir=dump_group
# walk along the given path and create groups if necessary # walk along the given path and create groups if necessary
namelist = key.split("/") namelist = key.split("/")
for part in namelist[:-1]: for part in namelist[:-1]:
dir_part="dir_"+str(part).translate(DataPool.translation_table) dir_part="dir_"+str(part).translate(DataPool.translation_table)
if not dir_part in dump_dir: if dir_part not in dump_dir:
dump_dir=dump_file.create_group(dump_dir,name=dir_part,title=part) dump_dir=dump_file.create_group(dump_dir,name=dir_part,title=part)
else: else:
if dump_dir._v_children[dir_part]._v_title==part: if dump_dir._v_children[dir_part]._v_title==part: