On Sat, Mar 2, 2013 at 4:18 PM, Kempenaar, M <m.kempen...@umcg.nl> wrote:
> Dear list,
>
> I have a few tools that use Python which subsequently tries to load files
> from a subfolder in the tool dir (i.e.
> galaxy-dist/tools/myTool/templates/template.sh).
>
> However at runtime it seems the Python file(s) are copied to Galaxy's
> working directory making all other files located in 'myTool' unavailable.
> Importing a Python file does work so these get copied / moved to the working
> directory as well but any other file is unavailable.
>
> What is the solution of using a different file (for simplicities sake, let's
> consider any kind of file) that is located in the above mentioned path
> -without- using any hardcoded paths in my code?
>
> Thanks!
>
> Best regards,
>
> Marcel

Hi Marcel,

I doubt any Python scripts are being moved or copied - simply
that imports work relative to the location of the Python script.
In much the same way, you should be able to get the relative
path to your template files by using the location of the script
(and not the current working directory). Try the special Python
value __file__ and/or sys.argv[0] for this.

Peter
___________________________________________________________
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:

  http://lists.bx.psu.edu/

Reply via email to