thasso / pyjip

JIP Pipeline System
http://pyjip.readthedocs.org
Other
19 stars 8 forks source link

Setup is not called when tools are added to a pipeline #25

Closed Poshi closed 10 years ago

thasso commented 10 years ago

The setup() method is not supposed to be called when a node is added. Otherwise setup() must be written in a way that it can easily be called multiple times without side effects.

If there is a general setup procedure of a tool, for example, adding options, this has to be done in init(). init() is called when the tool instance is created. Note that in the init function, you have no access to the option values yet. If you need to apply some logic on the option values that can not be covered by a template string, you have to implement init to create the dynamic options and setup to change the values based on the current configuration.