funcnodes-core 2.3.1__tar.gz → 2.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/CHANGELOG.md +6 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/PKG-INFO +1 -1
- funcnodes_core-2.3.2/cz.toml +6 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/pyproject.toml +1 -1
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/eventmanager.py +2 -2
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_eventmanager.py +49 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/uv.lock +1 -1
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/.coveragerc +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/.flake8 +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/.github/actions/install_package/action.yml +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/.github/workflows/py_test.yml +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/.github/workflows/version_publish_main.yml +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/.gitignore +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/.pre-commit-config.yaml +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/LICENSE +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/MANIFEST.in +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/README.md +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/THIRD_PARTY_NOTICES.md +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/conftest.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/pytest.ini +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/__init__.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/_logging.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/_setup.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/config.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/data.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/datapath.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/decorator/__init__.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/exceptions.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/graph.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/grouping_logic.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/io.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/lib/__init__.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/lib/lib.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/lib/libfinder.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/lib/libparser.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/node.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/nodemaker.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/nodespace.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/testing.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/triggerstack.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/__init__.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/cache.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/data.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/deprecations.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/files.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/functions.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/modules.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/nodetqdm.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/nodeutils.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/plugins.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/plugins_types.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/saving.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/serialization.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/special_types.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/src/funcnodes_core/utils/wrapper.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/__init__.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/conftest.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_cache_utils.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_config.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_data.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_datapaths.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_decorator.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_exceptions.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_functions.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_graph.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_grouping_logic.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_lib.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_libfinder.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_nodeclass.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_nodeclassmixin.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_nodeio.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_nodemaker.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_nodespace.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_nodeutils.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_public_api.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_setup.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_triggering.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_triggerstack.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/__init__.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_datautils.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_deprecations.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_files.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_logging.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_modules.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_nodetqdm.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_plugins.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_plugins_types.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_saving.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_serialization.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_special_types.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_testing.py +0 -0
- {funcnodes_core-2.3.1 → funcnodes_core-2.3.2}/tests/test_utils/test_wrapper.py +0 -0
|
@@ -337,11 +337,11 @@ class EventEmitterMixin:
|
|
|
337
337
|
msg["src"] = self
|
|
338
338
|
listened = False
|
|
339
339
|
if event_name in self._events:
|
|
340
|
-
for callback in self._events[event_name]:
|
|
340
|
+
for callback in self._events[event_name][:]:
|
|
341
341
|
callback(**msg)
|
|
342
342
|
listened = True
|
|
343
343
|
if "*" in self._events:
|
|
344
|
-
for callback in self._events["*"]:
|
|
344
|
+
for callback in self._events["*"][:]:
|
|
345
345
|
callback(event=event_name, **msg)
|
|
346
346
|
listened = True
|
|
347
347
|
|
|
@@ -597,3 +597,52 @@ def test_emit_after_decorator_async_function():
|
|
|
597
597
|
{"src": emitter, "result": "async_function_result"},
|
|
598
598
|
)
|
|
599
599
|
assert result == "async_function_result"
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
class EmitterTest(EventEmitterMixin):
|
|
603
|
+
pass
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
@pytest.mark.asyncio
|
|
607
|
+
async def test_event_manager_modification_during_emit():
|
|
608
|
+
"""
|
|
609
|
+
Test that modifying the event listener list (e.g., via once()) during
|
|
610
|
+
event emission does not cause listeners to be skipped.
|
|
611
|
+
"""
|
|
612
|
+
emitter = EmitterTest()
|
|
613
|
+
called = []
|
|
614
|
+
|
|
615
|
+
def cb1(**kwargs):
|
|
616
|
+
called.append(1)
|
|
617
|
+
|
|
618
|
+
def cb2(**kwargs):
|
|
619
|
+
called.append(2)
|
|
620
|
+
|
|
621
|
+
def cb3(**kwargs):
|
|
622
|
+
called.append(3)
|
|
623
|
+
|
|
624
|
+
# Scenario: cb1 is 'once', cb2 is normal.
|
|
625
|
+
# When event fires:
|
|
626
|
+
# 1. cb1 is called. It calls 'off' which removes itself from the list.
|
|
627
|
+
# 2. cb2 should still be called.
|
|
628
|
+
|
|
629
|
+
emitter.once("test", cb1)
|
|
630
|
+
emitter.on("test", cb2)
|
|
631
|
+
emitter.emit("test")
|
|
632
|
+
|
|
633
|
+
assert 1 in called
|
|
634
|
+
assert 2 in called
|
|
635
|
+
|
|
636
|
+
called.clear()
|
|
637
|
+
emitter.off("test")
|
|
638
|
+
|
|
639
|
+
# Scenario: cb1 is normal, cb2 is once, cb3 is normal.
|
|
640
|
+
emitter.on("test", cb1)
|
|
641
|
+
emitter.once("test", cb2)
|
|
642
|
+
emitter.on("test", cb3)
|
|
643
|
+
|
|
644
|
+
emitter.emit("test")
|
|
645
|
+
|
|
646
|
+
assert 1 in called
|
|
647
|
+
assert 2 in called
|
|
648
|
+
assert 3 in called
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|