I don’t like ‘hacks’!! I solved this by pulling the relevant bits of the module into my script so that it runs with no dependencies. It’s basically just making an HTTP GET request with an authentication header, so not too hard to achieve.  Should be safe to put in the toolshed.

Thanks, this is a big improvement in our UI (and I vote for not deprecating this feature, maybe even making it more robust).

Steve

Department of Computing, Macquarie University
http://web.science.mq.edu.au/~cassidy

On 7 Dec 2017, at 8:50 pm, Hans-Rudolf Hotz <hrh@fmi.ch> wrote:


Sure

However, tools relying on "dynamic_options" and extra "code" scripts are usually 'hacks' for accessing external data/services in a local galaxy installation. And such tools are not intended for the toolshed anyway....IMHO.


Hans-Rudolf


On 12/07/2017 09:37 AM, Steve Cassidy wrote:
I could do that but it would mean that no-one could install the tool
from the toolshed without also installing this package.

Maybe I just need to hack this together.

Steve



Department of Computing, Macquarie University
http://web.science.mq.edu.au/~cassidy

On 7 Dec 2017, at 6:59 pm, Hans-Rudolf Hotz <hrh@fmi.ch
<mailto:hrh@fmi.ch>> wrote:

Hi Steve

what happened, when you add this module to the environment the galaxy
server is running in? (e.g. by listing the path in the 'run.sh' file)

Regards, Hans-Rudolf


On 12/07/2017 03:05 AM, Steve Cassidy wrote:
Hi all,
 this would help in a tool I’m trying to write too but the problem I
have implementing this approach is that my script will need an external
python module - is there any way that I can list dependencies for the
script?  As it happens these are the same dependancies that the tool
itself will need once executed.

Thanks,

Steve


Department of Computing, Macquarie University
http://web.science.mq.edu.au/~cassidy

On 24 Nov 2017, at 6:52 pm, Hans-Rudolf Hotz <hrh@fmi.ch
<mailto:hrh@fmi.ch>> wrote:

Hi Evan

Yes, this is possible with "dynamic_options"

e.g.:

<tool ...

<inputs>

<param name="year" type="select" label="from which year"
  display="radio" refresh_on_change="true" >
           <option value="/2017" selected="true">2017</option>
   <option value="/2016">2016</option>
           <option value="/2015">2015</option>
</param>

<param name="file" type="select" label="select a run"
 display="radio"
 dynamic_options="ds_readFiles(year)"/>


</inputs>
<outputs>
...
</outputs>
<help>
...
</help>
<code file="more_code.py" />

</tool>

The python function "ds_readFiles" is defined in a extra code file
"more_code.py", which is stored in the same directory as the tool
definition file. The function returns all files with a matching file
name (i.e.year), and could look like:


rDir = "/data/"

def ds_readFiles(year):

 l = os.listdir(rDir)
 p = re.compile('^%s_[0­9]{4}_M[0­9]{5}_[0­9]'%year)
 l.sort()
 path = rDir
 filesoptions = [(s) for s in l if os.path.exists(path + s)]
 files = [(s,s,False) for s in filesoptions if p.match(s)]
 return files



a similar case is also described here:

http://dev.list.galaxyproject.org/Dynamic-Tool-Parameter-Lists-td4175828.html


Hope this helps, Hans-Rudolf


On 11/23/2017 06:02 PM, Evan Clark wrote:
Is it possible to execute a script within a tool xml confit to retrieve
some data and append to the ui depending on the requested data. I.e
if I
wanted to get a list of files and provide them as select options before
hitting the execute button.


---
Sent from VMware Boxer


___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
http://galaxyproject.org/search/

___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
http://galaxyproject.org/search/