Skip to content
Snippets Groups Projects
Commit 8ec1b7b1 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

return the just-added tool from addTool

augment addTool to return the tool it just added.
This allows one to write:
```python
myToolWithName = myalg.addTool(tool_conf2,"ToolWithName")
myToolWithName.String = "xyz"
```
instead of 
```python
myalg.addTool(tool_conf2,"ToolWithName")
myalg.ToolWithName.String = "xyz"
```
which requires one to duplicate the "ToolWithName" -- once as string, and
once as attribute, but only rarely does anybody use getattr for the 2nd
case to just avoid the duplication.

Of course, one could write 
```python
myalg.addTool(tool_conf2,"ToolWithName", String="xyz")
```
or even pass in a complete dictionary with **, but the configuration of
the tool isn't necessarily complete at the time of creation of its
configurable.

Fixes GAUDI-1162.
See merge request !87
parents ce142973 4f512ebd
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment