funcnodes-core 0.2.2__tar.gz → 0.2.3__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-0.2.2 → funcnodes_core-0.2.3}/PKG-INFO +1 -1
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/__init__.py +1 -1
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/lib/lib.py +4 -4
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/node.py +7 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/nodemaker.py +0 -7
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/pyproject.toml +1 -1
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/LICENSE +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/README.md +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/_logging.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/_setup.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/config.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/data.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/decorator/__init__.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/eventmanager.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/exceptions.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/graph.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/io.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/lib/__init__.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/lib/libfinder.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/lib/libparser.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/nodespace.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/triggerstack.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/utils/__init__.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/utils/data.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/utils/functions.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/utils/nodeutils.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/utils/plugins.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/utils/plugins_types.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/utils/saving.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/utils/serialization.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/utils/special_types.py +0 -0
- {funcnodes_core-0.2.2 → funcnodes_core-0.2.3}/funcnodes_core/utils/wrapper.py +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
from typing import List, Optional, TypedDict, Dict, Type, Tuple, Set
|
|
2
|
+
from typing import List, Optional, TypedDict, Dict, Type, Tuple, Set, Sequence
|
|
3
3
|
from funcnodes_core.node import Node, SerializedNodeClass
|
|
4
4
|
from funcnodes_core.utils.serialization import JSONEncoder, Encdata
|
|
5
5
|
from dataclasses import dataclass, field
|
|
@@ -180,7 +180,7 @@ def get_node_in_shelf(shelf: Shelf, nodeid: str) -> Tuple[int, Type[Node]]:
|
|
|
180
180
|
raise NodeClassNotFoundError(f"Node with id {nodeid} not found")
|
|
181
181
|
|
|
182
182
|
|
|
183
|
-
def update_nodes_in_shelf(shelf: Shelf, nodes:
|
|
183
|
+
def update_nodes_in_shelf(shelf: Shelf, nodes: Sequence[Type[Node]]):
|
|
184
184
|
"""
|
|
185
185
|
Adds nodes to a shelf
|
|
186
186
|
"""
|
|
@@ -347,7 +347,7 @@ class Library(EventEmitterMixin):
|
|
|
347
347
|
@emit_after()
|
|
348
348
|
def add_nodes(
|
|
349
349
|
self,
|
|
350
|
-
nodes:
|
|
350
|
+
nodes: Sequence[Type[Node]],
|
|
351
351
|
shelf: str | List[str],
|
|
352
352
|
):
|
|
353
353
|
if isinstance(shelf, str):
|
|
@@ -403,7 +403,7 @@ class Library(EventEmitterMixin):
|
|
|
403
403
|
i, _ = get_node_in_shelf(shelf, node.node_id)
|
|
404
404
|
shelf.nodes.pop(i)
|
|
405
405
|
|
|
406
|
-
def remove_nodeclasses(self, nodes:
|
|
406
|
+
def remove_nodeclasses(self, nodes: Sequence[Type[Node]]):
|
|
407
407
|
for node in nodes:
|
|
408
408
|
self.remove_nodeclass(node)
|
|
409
409
|
|
|
@@ -345,6 +345,7 @@ class Node(EventEmitterMixin, ABC, metaclass=NodeMeta):
|
|
|
345
345
|
self._inputs: List[NodeInput] = []
|
|
346
346
|
self._outputs: List[NodeOutput] = []
|
|
347
347
|
self._triggerstack: Optional[TriggerStack] = None
|
|
348
|
+
self._trigger_open = False
|
|
348
349
|
self._requests_trigger = False
|
|
349
350
|
self.asynceventmanager = AsyncEventManager(self)
|
|
350
351
|
if uuid is None and id is not None:
|
|
@@ -797,6 +798,8 @@ class Node(EventEmitterMixin, ABC, metaclass=NodeMeta):
|
|
|
797
798
|
"""Wraps the node's function to handle the triggering of events before and after its execution."""
|
|
798
799
|
# set the trigger event
|
|
799
800
|
await self.asynceventmanager.set_and_clear("triggered")
|
|
801
|
+
await asyncio.sleep(self._pretrigger_delay)
|
|
802
|
+
self._trigger_open = False
|
|
800
803
|
self.emit("triggerstart")
|
|
801
804
|
# run the function
|
|
802
805
|
|
|
@@ -852,6 +855,8 @@ class Node(EventEmitterMixin, ABC, metaclass=NodeMeta):
|
|
|
852
855
|
# if the node is ready to trigger, trigger it
|
|
853
856
|
if self.ready_to_trigger():
|
|
854
857
|
self.trigger()
|
|
858
|
+
elif self._trigger_open:
|
|
859
|
+
return
|
|
855
860
|
else:
|
|
856
861
|
# otherwise set the _requests_trigger attribute to True
|
|
857
862
|
self._requests_trigger = True
|
|
@@ -914,6 +919,8 @@ class Node(EventEmitterMixin, ABC, metaclass=NodeMeta):
|
|
|
914
919
|
raise InTriggerError("Node is already in trigger")
|
|
915
920
|
if triggerstack is None:
|
|
916
921
|
triggerstack = TriggerStack()
|
|
922
|
+
self._pretrigger_delay = 0.02 # 20ms
|
|
923
|
+
self._trigger_open = True
|
|
917
924
|
triggerlogger.debug(f"triggering {self}")
|
|
918
925
|
self._triggerstack = triggerstack
|
|
919
926
|
self._triggerstack.append(self())
|
|
@@ -91,13 +91,6 @@ def node_class_maker(
|
|
|
91
91
|
"""
|
|
92
92
|
A wrapper for the exposed function that sets the output values of the node.
|
|
93
93
|
"""
|
|
94
|
-
print(
|
|
95
|
-
"BBBtriggering",
|
|
96
|
-
self,
|
|
97
|
-
{ip.name: ip.value for ip in self.inputs.values()},
|
|
98
|
-
args,
|
|
99
|
-
kwargs,
|
|
100
|
-
)
|
|
101
94
|
outs = await asyncfunc(*args, **kwargs)
|
|
102
95
|
if len(outputs) > 1:
|
|
103
96
|
for op, out in zip(outputs, outs):
|
|
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
|