Skip to content

Commit

Permalink
Fix a bug when accessing the outputs of a node
Browse files Browse the repository at this point in the history
git-svn-id: svn://scm.gforge.inria.fr/svnroot/openalea/trunk@3652 04ea39c6-a500-0410-8508-e77fe2a861cf
  • Loading branch information
pradal committed Sep 26, 2012
1 parent 4910b96 commit 2d49ad9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/openalea/core/alea.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def run_and_display(component, inputs, gui=False, pm=None):

try:
node.eval()
print node.outputs
print _outputs(node)
except Exception, error:
print "Error while executing component : ", error
print "Try with -g flag"
Expand All @@ -143,10 +143,10 @@ def run(component, inputs, pm=None, vtx_id=-1):

if vtx_id < 0:
node.eval()
return node.outputs
return _outputs(node)
else:
node.eval_as_expression(vtx_id)
return node.node(vtx_id).outputs
return _outputs(node.node(vtx_id))

def query(component, pm=None):
""" show help of component """
Expand Down Expand Up @@ -290,6 +290,10 @@ def f(*args, **kwds):

return f


def _outputs(node):
return [node.output(i) for i in range(node.get_nb_output())]

def main():
""" Parse options """

Expand Down

0 comments on commit 2d49ad9

Please sign in to comment.