Hello Hans, Tools are not tightly integrated with the Galaxy framework by design. Galaxy provides an interface to tools, but every tool can also be run from the command lines as a stand-alone component. Because of this, distributed tools do not depend on specific Galaxy entities like a Galaxy user, and the distributed Galaxy framework does not enable this. You could decide to add your own logic to enable this for your local instance, however. On Dec 8, 2009, at 5:12 AM, Hotz, Hans-Rudolf wrote:
Hi
By accident, my colleague found out, that we can use the $userEmail variable in the 'command' tag of the "tool config file", eg:
<command interpreter="perl">script.pl $input $userEmail $output </ command>
Access to the 'user' information ('Anonymous' or the user's e-mail address if logged in) is very handy, as it gives the potential to execute the script differently depending on the value of $userEmail .
Now, we would like to use the 'user' information in order to create different options in the interface for the tool, eg:
<inputs> <param name="input" type="select" label="available files" display="radio" dynamic_options="ds_Options()"/> </inputs> <outputs> <data format="fasta" name="output"/> </outputs> <code file="more_code.py" />
where "ds_Options()" is defined in the extra python code "more_code.py"
I can pass a value to "ds_Options()" which we get as an example from a first page of the interface, eg:
<inputs> <page> <param name="dir" type="select" display="radio"> <option value="foo">FOO</option> <option value="bar">BAR</option> </param> </page> <page> <param name="input" type="select" label="available files" display="radio" dynamic_options="ds_Options(dir)"/> </page> </inputs> <outputs> <data format="fasta" name="output"/> </outputs> <code file="more_code.py" />
...but how do I pass just the 'user' information to the function?
As I can use '$userEmail' in the 'command' tag, I tried (with my limited understanding of galaxy and python) the obvious:
dynamic_options="ds_Options(userEmail)"
but I get
NameError: name 'userEmail' is not defined
Is there any way to pass the 'user' information?
Alternatively, is there a direct way to get access to the 'user' information within the function?
Thank you very much for your help
Hans
_______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu