vectorvein 0.2.62__py3-none-any.whl → 0.2.64__py3-none-any.whl
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.
- vectorvein/workflow/graph/node.py +10 -6
- vectorvein/workflow/utils/json_to_code.py +2 -1
- {vectorvein-0.2.62.dist-info → vectorvein-0.2.64.dist-info}/METADATA +1 -1
- {vectorvein-0.2.62.dist-info → vectorvein-0.2.64.dist-info}/RECORD +6 -6
- {vectorvein-0.2.62.dist-info → vectorvein-0.2.64.dist-info}/WHEEL +0 -0
- {vectorvein-0.2.62.dist-info → vectorvein-0.2.64.dist-info}/entry_points.txt +0 -0
@@ -1,10 +1,14 @@
|
|
1
1
|
import uuid
|
2
|
-
from typing import Dict, Any, Optional, List, Union
|
2
|
+
from typing import Dict, Any, Optional, List, Union, TYPE_CHECKING
|
3
3
|
|
4
|
-
from .port import
|
4
|
+
from .port import InputPort, OutputPort
|
5
5
|
|
6
6
|
|
7
|
-
|
7
|
+
if TYPE_CHECKING:
|
8
|
+
from .port import PortType, Port
|
9
|
+
|
10
|
+
|
11
|
+
class PortsDict(Dict[str, "Port"]):
|
8
12
|
"""自定义字典类,用于管理节点的端口,并强制执行端口添加权限。"""
|
9
13
|
|
10
14
|
def __init__(self, owner_node: "Node", *args, **kwargs):
|
@@ -12,7 +16,7 @@ class PortsDict(Dict[str, Port]):
|
|
12
16
|
self._owner_node = owner_node
|
13
17
|
self._initializing = True
|
14
18
|
|
15
|
-
def __setitem__(self, key: str, value: Port) -> None:
|
19
|
+
def __setitem__(self, key: str, value: "Port") -> None:
|
16
20
|
if self._initializing or key in self:
|
17
21
|
super().__setitem__(key, value)
|
18
22
|
return
|
@@ -40,7 +44,7 @@ class Node:
|
|
40
44
|
category: str,
|
41
45
|
task_name: str,
|
42
46
|
description: str = "",
|
43
|
-
ports: Optional[Dict[str,
|
47
|
+
ports: Optional[Dict[str, "Port"]] = None,
|
44
48
|
node_id: Optional[str] = None,
|
45
49
|
position: Optional[Dict[str, float]] = None,
|
46
50
|
seleted_workflow_title: str = "",
|
@@ -74,7 +78,7 @@ class Node:
|
|
74
78
|
def add_port(
|
75
79
|
self,
|
76
80
|
name: str,
|
77
|
-
port_type: Union[PortType, str],
|
81
|
+
port_type: Union["PortType", str],
|
78
82
|
show: bool = False,
|
79
83
|
value: Any = None,
|
80
84
|
options: Optional[List[Any]] = None,
|
@@ -150,7 +150,8 @@ def generate_python_code(
|
|
150
150
|
|
151
151
|
# 添加节点到工作流
|
152
152
|
node_list = [f" {info['var_name']}," for info in node_instances.values()]
|
153
|
-
|
153
|
+
node_list_str = "\n".join(node_list)
|
154
|
+
code.append(f"workflow.add_nodes([\n{node_list_str}\n])")
|
154
155
|
|
155
156
|
code.append("")
|
156
157
|
for node_info in node_instances.values():
|
@@ -1,6 +1,6 @@
|
|
1
|
-
vectorvein-0.2.
|
2
|
-
vectorvein-0.2.
|
3
|
-
vectorvein-0.2.
|
1
|
+
vectorvein-0.2.64.dist-info/METADATA,sha256=Rd5tC_nxsZ9vTIatBOc10n_0OFxSwoK4gf8H_Jq39Pk,4570
|
2
|
+
vectorvein-0.2.64.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
3
|
+
vectorvein-0.2.64.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
4
4
|
vectorvein/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
vectorvein/api/__init__.py,sha256=lfY-XA46fgD2iIZTU0VYP8i07AwA03Egj4Qua0vUKrQ,738
|
6
6
|
vectorvein/api/client.py,sha256=xF-leKDQzVyyy9FnIRaz0k4eElYW1XbbzeRLcpnyk90,33047
|
@@ -42,7 +42,7 @@ vectorvein/utilities/media_processing.py,sha256=7KtbLFzOYIn1e9QTN9G6C76NH8CBlV9k
|
|
42
42
|
vectorvein/utilities/rate_limiter.py,sha256=dwolIUVw2wP83Odqpx0AAaE77de1GzxkYDGH4tM_u_4,10300
|
43
43
|
vectorvein/utilities/retry.py,sha256=6KFS9R2HdhqM3_9jkjD4F36ZSpEx2YNFGOVlpOsUetM,2208
|
44
44
|
vectorvein/workflow/graph/edge.py,sha256=1ckyyjCue_PLm7P1ItUfKOy6AKkemOpZ9m1WJ8UXIHQ,1072
|
45
|
-
vectorvein/workflow/graph/node.py,sha256=
|
45
|
+
vectorvein/workflow/graph/node.py,sha256=WtO4MkeMQr59zNl9N2ZoYiCZcVKxebSp1rKMPONmfqk,5628
|
46
46
|
vectorvein/workflow/graph/port.py,sha256=HcinzQqNP7ysTvBmi3c4iaWne8nV6m-BpFFX0jTrMIE,7122
|
47
47
|
vectorvein/workflow/graph/workflow.py,sha256=f5KAQUXTKii7UFYmSZeZZQ7JCKKPmJlUg0iFAfBEJQE,6366
|
48
48
|
vectorvein/workflow/nodes/__init__.py,sha256=dWrWtL3q0Vsn-MLgJ7gNgLCrwZ5BrqjrN2QFPNeBMuc,3240
|
@@ -62,6 +62,6 @@ vectorvein/workflow/nodes/vector_db.py,sha256=p9AT_E8ASbcYHZqHYTCIGvqkIqzxaFM4Ux
|
|
62
62
|
vectorvein/workflow/nodes/video_generation.py,sha256=qmdg-t_idpxq1veukd-jv_ChICMOoInKxprV9Z4Vi2w,4118
|
63
63
|
vectorvein/workflow/nodes/web_crawlers.py,sha256=FB0bTimkk___p3Z5UwQx2YarJyQCc45jjnbXbgGA_qw,5640
|
64
64
|
vectorvein/workflow/utils/check.py,sha256=Oj_S5WQf4_Fr_ro3ipjZt9unKFSFcuwZrrSmrS9kVLE,10193
|
65
|
-
vectorvein/workflow/utils/json_to_code.py,sha256=
|
65
|
+
vectorvein/workflow/utils/json_to_code.py,sha256=zCobrmWN33WP6t7i5Yx-lAJMM_PbhJ4H1ckceGB6FqI,6292
|
66
66
|
vectorvein/workflow/utils/layout.py,sha256=j0bRD3uaXu40xCS6U6BGahBI8FrHa5MiF55GbTrZ1LM,4565
|
67
|
-
vectorvein-0.2.
|
67
|
+
vectorvein-0.2.64.dist-info/RECORD,,
|
File without changes
|
File without changes
|