Question: absolute path of Galaxy folder in template mako file in visualisation plugin
1
gravatar for sureshhewabi
2.3 years ago by
sureshhewabi • 20
sureshhewabi • 20 wrote:

Hi,

My question is how can I get the absolute path of the galaxy root folder from mako template file of the visualisation plugin? For example, /Users/myname/Downloads/galaxy is my root folder. I want this value in javaScript.

my template file has:

 <%
   root = h.url_for( "/" )
   app_root = root + "plugins/visualizations/protviewer/static/"
%>

I tried to access it in javascript like this:

var config = { root : '${root}' }
alert(config.root)

It gave me '/' but I expected /Users/myname/Downloads/galaxy. Any idea how to get this?

ADD COMMENT • link • modified 2.3 years ago by carlfeberhard ♦ 390 • written 2.3 years ago by sureshhewabi • 20
3
gravatar for carlfeberhard
2.3 years ago by
carlfeberhard ♦ 390
United States
carlfeberhard ♦ 390 wrote:

Your code is getting the URL root. It sounds like you're looking for the file system directory for galaxy. This should work as far as I know:

## within the mako file...
<% 
    import os
    galaxy_dir = os.getcwd()
%>
var galaxyDir = "${galaxy_dir}";
ADD COMMENT • link written 2.3 years ago by carlfeberhard ♦ 390
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 167 users visited in the last hour