Mercurial > repos > ganjoo > webservice_toolsuite
annotate WebServiceToolWorkflow/WebServiceTool2.py~ @ 0:e7482c82796e 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 17:34:26 -0400 |
parents | |
children |
rev | line source |
---|---|
0
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
1 import warnings |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
2 import platform |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
3 import os,sys |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
4 from generateClient import * |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
5 from generateClient1 import * |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
6 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
7 ##input : wadl/wsdl/sawadl-url, method name |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
8 ##generate a client as tool for Galaxy: |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
9 #1. Add client xml address to Galaxy tool-conf.xml file - call edit_tool_conf.py |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
10 #2. Generate client xml file - call generate client.py |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
11 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
12 url = sys.argv[2] |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
13 urllist = url.split('.') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
14 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
15 #f=open(sys.argv[5],'w') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
16 #f.write('url: ' + url + '\t') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
17 #f.write('reached here 1') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
18 #f.close() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
19 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
20 clientGenerator = ClientGenerator(sys.argv[2],sys.argv[3],sys.argv[4],sys.argv[5]) |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
21 clientGenerator1 = ClientGenerator1(sys.argv[2],sys.argv[3],sys.argv[4],sys.argv[5]) |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
22 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
23 if urllist[len(urllist)-1]=='wadl' or urllist[len(urllist)-1]=='WADL': |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
24 javahome = os.environ.get('JAVA_HOME') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
25 galaxyhome=os.environ.get('GALAXY_HOME') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
26 classpath= galaxyhome + '/tools/WebServiceToolWorkflow/ParserForWADL/bin' |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
27 jarpath = galaxyhome + '/tools/WebServiceToolWorkflow/ParserForWADL/lib/' |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
28 machine = platform.machine() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
29 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
30 if machine == 'x86_64' : |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
31 print 'a' |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
32 startJVM("%s/jre/lib/amd64/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath) |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
33 elif machine == 'i686' : |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
34 print 'b' |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
35 startJVM("%s/jre/lib/i386/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath) |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
36 elif machine == 'sun4u' : |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
37 startJVM("%s/jre/lib/sparc/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath) |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
38 else : |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
39 print 'c' |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
40 System.exit("Could not identify machine, please specify path to libjvm.so") |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
41 clientGenerator1.wadlClient() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
42 clientGenerator.wadlClient() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
43 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
44 elif urllist[len(urllist)-1]=='wsdl' or urllist[len(urllist)-1]=='WSDL': |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
45 clientGenerator.wsdlClient() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
46 clientGenerator1.wsdlClient() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
47 elif urllist[len(urllist)-1]=='sawadl' or urllist[len(urllist)-1]=='SAWADL': |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
48 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
49 javahome = os.environ.get('JAVA_HOME') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
50 galaxyhome=os.environ.get('GALAXY_HOME') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
51 classpath= galaxyhome + '/tools/WebServiceToolWorkflow/lib/SAWADLParser/bin' |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
52 jarpath = galaxyhome + '/tools/WebServiceToolWorkflow/lib/' |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
53 machine = platform.machine() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
54 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
55 if machine == 'x86_64' : |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
56 print 'a' |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
57 startJVM("%s/jre/lib/amd64/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath) |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
58 elif machine == 'i686' : |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
59 print 'b' |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
60 startJVM("%s/jre/lib/i386/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath) |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
61 elif machine == 'sun4u' : |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
62 startJVM("%s/jre/lib/sparc/server/libjvm.so" % javahome,"-ea", "-Djava.class.path=%s" % classpath,"-Djava.ext.dirs=%s" % jarpath) |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
63 else : |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
64 print 'c' |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
65 System.exit("Could not identify machine, please specify path to libjvm.so") |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
66 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
67 #f=open(sys.argv[5],'w') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
68 #f.write('reached here 2 \t') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
69 #f.close() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
70 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
71 clientGenerator.sawadlClient() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
72 clientGenerator1.sawadlClient() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
73 #f=open(sys.argv[5],'w') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
74 #f.write('reached here 3') |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
75 #f.close() |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
76 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
77 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
78 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
79 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
80 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
81 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
82 |