Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
workflow
representation
Compare Revisions
4513c7e79561e6e687badce4f98fb9dd8a26ac04...fed57846a1acb8c3f901081a74cf20a7ce1f828b
Commits (2)
[node] manage case handler is already instanciate
· 7099e42e
payno
authored
Aug 03, 2020
7099e42e
[node] remove raise error if set_properties does not exists
· fed57846
payno
authored
Aug 03, 2020
fed57846
Hide whitespace changes
Inline
Side-by-side
scheme/node.py
View file @
fed57846
...
...
@@ -166,6 +166,7 @@ class Node(object):
self
.
_handlers
.
clear
()
self
.
_input_type_to_name
.
clear
()
self
.
_output_type_to_name
.
clear
()
assert
self
.
_process_pt
is
not
None
if
callable
(
self
.
_process_pt
):
self
.
__process_instance
=
self
.
_process_pt
...
...
@@ -245,13 +246,17 @@ class Node(object):
''
.
format
(
str
(
process_pt
),
input_data
,
input_name
))
if
hasattr
(
node
.
__process_instance
,
'set_properties'
):
node
.
__process_instance
.
set_properties
(
properties
)
else
:
raise
ValueError
(
'no function set properties found'
)
if
input_name
in
node
.
handlers
:
out
=
getattr
(
node
.
__process_instance
,
node
.
handlers
[
input_name
])(
input_data
)
if
type
(
node
.
handlers
[
input_name
])
is
str
:
out
=
getattr
(
node
.
__process_instance
,
node
.
handlers
[
input_name
])(
input_data
)
else
:
out
=
node
.
handlers
[
input_name
](
input_data
)
elif
None
in
node
.
handlers
:
out
=
getattr
(
node
.
__process_instance
,
node
.
handlers
[
None
])(
input_data
)
if
type
(
node
.
handlers
[
None
])
is
str
:
out
=
getattr
(
node
.
__process_instance
,
node
.
handlers
[
None
])(
input_data
)
else
:
out
=
node
.
__process_instance
(
input_data
)
else
:
err
=
'"{0}" channel is not managed by {1}'
.
format
(
input_name
,
node
.
_process_pt
)
raise
KeyError
(
err
)
...
...