Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
598348c0
Commit
598348c0
authored
Aug 06, 2016
by
Jerome Hugues
Browse files
* Demonstrate usage of getSourcePorts and getDestinationPorts
parent
b597f33d
Changes
1
Hide whitespace changes
Inline
Side-by-side
resources/runtime/python/test/visitor.py
View file @
598348c0
...
...
@@ -31,6 +31,8 @@ args = sys.argv[1:]
import
ocarina
import
lmp
from
ocarina_common_tools
import
*
import
libocarina_python
def
visitor
(
component
,
level
):
"""
...
...
@@ -49,14 +51,15 @@ def visitor (component, level):
if
features
is
not
None
:
print
' '
*
level
,
' -> features:'
,
features
for
feature
in
features
:
print
' '
*
level
,
' -> '
,
feature
,
","
,
lmp
.
getInstanceName
(
feature
)[
0
]
print
' '
*
level
,
' -> feature:'
,
feature
,
', '
,
lmp
.
getInstanceName
(
feature
)[
0
]
print
' '
*
level
,
' source feature: '
,
lmp
.
getInstanceName
(
ocarina
.
getSourcePorts
(
feature
)[
0
])[
0
]
print
' '
*
level
,
' destination feature: '
,
lmp
.
getInstanceName
(
ocarina
.
getDestinationPorts
(
feature
)[
0
])[
0
]
properties
=
ocarina
.
AIN
.
Properties
(
component
)[
0
];
if
properties
is
not
None
:
print
' '
*
level
,
' -> properties:'
for
property
in
properties
:
print
' '
*
level
,
' '
,
ocarina
.
getPropertyValue
(
component
,
property
)[
0
]
print
'[looking for priority] '
*
level
,
' '
,
ocarina
.
getPropertyValueByName
(
component
,
u
'priority'
)[
0
]
subcomponents
=
ocarina
.
AIN
.
Subcomponents
(
component
)[
0
];
if
subcomponents
is
not
None
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment