Skip to content

Commit ca88b0c

Browse files
committed
Update to latest tool factory external.
1 parent b6d8294 commit ca88b0c

File tree

3 files changed

+344
-374
lines changed

3 files changed

+344
-374
lines changed
Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,39 @@
11
import os
22
import subprocess
3-
import sys
43

54

65
def find_packages(prefix="package_r_"):
76
"""
87
"""
9-
#locate env.sh | grep -i package_r_
10-
#/data/extended/galaxyJune14_2014/tool_dependency/readline/6.2/devteam/package_r_2_15_0/8ab0d08a3da1/env.sh
11-
#/data/home/rlazarus/galaxy/tool_dependency_dir/R_3_1_1/3.1.1/fubar/package_r_3_1_1/5f1b8d22140a/env.sh
12-
#/data/home/rlazarus/galaxy/tool_dependency_dir/R_3_1_1/3.1.1/fubar/package_r_3_1_1/d9964efbfbe3/env.sh
13-
#/data/home/rlazarus/galtest/tool_dependency_dir/R_3_1_1/3.1.1/fubar/package_r_3_1_1/63cdb9b2234c/env.sh
8+
# locate env.sh | grep -i package_r_
9+
# /data/extended/galaxyJune14_2014/tool_dependency/readline/6.2/devteam/package_r_2_15_0/8ab0d08a3da1/env.sh
10+
# /data/home/rlazarus/galaxy/tool_dependency_dir/R_3_1_1/3.1.1/fubar/package_r_3_1_1/5f1b8d22140a/env.sh
11+
# /data/home/rlazarus/galaxy/tool_dependency_dir/R_3_1_1/3.1.1/fubar/package_r_3_1_1/d9964efbfbe3/env.sh
12+
# /data/home/rlazarus/galtest/tool_dependency_dir/R_3_1_1/3.1.1/fubar/package_r_3_1_1/63cdb9b2234c/env.sh
1413
eprefix = prefix
1514
if prefix.find('/') != -1:
16-
eprefix = prefix.replace('/','\/') # for grep
15+
eprefix = prefix.replace('/', '\/') # for grep
1716
path = '.'
18-
# fails on nitesh's recent mac - locate not working
17+
# fails on nitesh's recent mac - locate not working
1918
# cl = ['locate env.sh | grep -i %s' % eprefix,]
20-
cl = ['find %s -iname "env.sh" | grep -i %s' % (path,eprefix),]
21-
p = subprocess.Popen(cl, stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True)
19+
cl = ['find %s -iname "env.sh" | grep -i %s' % (path, eprefix), ]
20+
p = subprocess.Popen(cl, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
2221
out, err = p.communicate()
2322
fpaths = out.split('\n')
2423
fpaths = [x for x in fpaths if len(x) > 1]
2524
fver = [x.split(os.path.sep)[-4:-1] for x in fpaths]
2625
# >>> foo.split(os.path.sep)[-4:-1]
2726
# ['fubar', 'package_r_3_1_1', '63cdb9b2234c']
2827
if len(fpaths) > 0:
29-
res = [['%s rev %s owner %s' % (x[1],x[2],x[0]),fpaths[i],False] for i,x in enumerate(fver)]
30-
res[0][2] = True # selected if more than one
31-
res.insert(0,['Use default (system) interpreter','system',False])
28+
res = [['%s rev %s owner %s' % (x[1], x[2], x[0]), fpaths[i], False] for i, x in enumerate(fver)]
29+
res[0][2] = True # selected if more than one
30+
res.insert(0, ['Use default (system) interpreter', 'system', False])
3231
else:
33-
res = [['Use default (system) interpreter','system',True],
34-
['**WARNING** NO package env.sh files found - is the "find" system command working? Are any interpreters installed?','system',False]]
32+
res = [['Use default (system) interpreter', 'system', True],
33+
['**WARNING** NO package env.sh files found - is the "find" system command working? Are any interpreters installed?', 'system', False]]
3534
# return a triplet - user_sees,value,selected - all unselected if False
3635
return res
3736

38-
def testapi():
39-
host_url = 'http://localhost:8080'
40-
new_path = [ os.path.join( os.getcwd(), "lib" ) ]
41-
new_path.extend( sys.path[1:] ) # remove scripts/ from the path
42-
sys.path = new_path
43-
from galaxy import config
44-
aconfig = config.Configuration( )
45-
M_A_K = aconfig.master_api_key
46-
tooldeps = aconfig.tool_dependency_dir
47-
gi = GalaxyInstance(url=host_url, key=M_A_K)
48-
4937

5038
if __name__ == "__main__":
5139
print(find_packages())
52-

0 commit comments

Comments
 (0)