annotate WebServiceToolWorkflow/getWADLMethods.py~ @ 0:d5cd409b8a18 default tip

Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author ganjoo
date Tue, 07 Jun 2011 18:00:50 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
1 import warnings
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
2 import platform
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
3
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
4 with warnings.catch_warnings():
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
5 warnings.simplefilter("ignore")
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
6 from jpype._jpackage import JPackage
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
7 from jpype import *
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
8 import os.path
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
9 import sys
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
10
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
11 javahome = os.environ.get('JAVA_HOME')
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
12 galaxyhome=os.environ.get('GALAXY_HOME')
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
13 classpath= galaxyhome + '/tools/restclientWADL/ParserForWADL/bin'
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
14 jarpath = galaxyhome + '/tools/restclientWADL/WADLParser/dist/lib/'
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
15 machine = platform.machine()
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
16 if machine == 'x86_64' :
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
17 startJVM("%s/jre/lib/amd64/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
18 elif machine == 'i686' :
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
19 startJVM("%s/jre/lib/i386/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
20 elif machine == 'sun4u' :
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
21 startJVM("%s/jre/lib/sparc/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath)
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
22 else :
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
23 System.exit("Could not identify machine, please specify path to libjvm.so")
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
24
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
25 pkg=JPackage('lsdis')
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
26 urlToPass=java.net.URL(sys.argv[1])
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
27 wadlUrl = sys.argv[1]
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
28
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
29 outputfile=open(sys.argv[2],'w')
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
30 outputfile.seek(0,0)
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
31
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
32
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
33 length=(len(sys.argv))
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
34
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
35 urls = []
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
36 methods = []
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
37
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
38 WADLParserDriver=pkg.WADLParserDriver
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
39 wPD=WADLParserDriver()
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
40 wPD.parse(urlToPass)
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
41 urls = wPD.getUrl()
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
42 methods = wPD.getCompleteMethodList()
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
43
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
44 i=0
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
45 for url in urls:
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
46 outputfile.write(wadlUrl+"\t")
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
47 outputfile.write(str(methods[i].getId())+"\t")
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
48 outputfile.write(str(url)+"\n")
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
49 i=i+1
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
50
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
51
d5cd409b8a18 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff changeset
52