Skip to content

Configuration values

alard edited this page Oct 15, 2012 · 2 revisions

If you do this, you retrieve the downloader name only when your project starts:

ExternalProcess("TinyBack",
                [ "./run.py", ...,
                  "--username=" + downloader ])

The downloader value gets added to the username when the pipeline is evaluated and that's it.

If you want to follow the changes the user makes in the configuration screen, it is better to keep the downloader as a separate object:

ExternalProcess("TinyBack",
                [ "./run.py", ...,
                  "--username", downloader ])

The downloader variable is a an instance of ConfigValue (or a string). When a task needs the value of that variable it uses the warrior's realize function to replace it with the current value. Since this happens each time the task is executed, you'll always have the most recent username. This only works if it is still a ConfigValue.

Alternatively, if you want to include the downloader name as part of a string, you could wrap the full string in a ConfigInterpolation object. For example:

ExternalProcess("TinyBack",
                [ "./run.py", ...,
                  ConfigInterpolation("--user=%s", downloader) ])

This ConfigInterpolation will be evaluated every time the task runs.

Clone this wiki locally