annotate WebServiceExtensionsV1.1/install.py~ @ 0:049760c677de default tip

Galaxy WSExtensions added successfully
author uga-galaxy-group
date Tue, 05 Jul 2011 19:34:18 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
1 # To change this template, choose Tools | Templates
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
2 # and open the template in the editor.
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
3
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
4 __author__ = "Chaitanya Guttula"
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
5
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
6
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
7 import os
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
8 import sys
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
9 from shutil import copytree, ignore_patterns
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
10
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
11 galaxyhome=os.environ.get('GALAXY_HOME')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
12 #print galaxyhome
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
13
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
14 #os.mkdir(galaxyhome+'/GAL')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
15 dirfilelist=os.listdir(galaxyhome+'/tools')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
16 exist = False
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
17 for dirfile in dirfilelist:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
18 if dirfile == 'WebServiceToolWorkflow_REST_SOAP':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
19 exist = True
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
20 break
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
21
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
22 if exist:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
23 print 'WebServiceToolWorkflow_REST_SOAP is already present in '+galaxyhome+'/tools/WebServiceToolWorkflow_REST_SOAP'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
24 else:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
25 copytree('WebServiceToolWorkflow_REST_SOAP',galaxyhome+'/tools/WebServiceToolWorkflow_REST_SOAP', ignore=ignore_patterns('*.pyc', 'tmp*'))
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
26 print 'Copied the folder \'WebServiceToolWorkflow_REST_SOAP\' to '+galaxyhome+'/tools'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
27
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
28 f1=open(galaxyhome+'/tool_conf.xml','r')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
29 f1.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
30 f2=open(galaxyhome+'/tool_conf_backup.xml','w')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
31 f2.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
32
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
33 #copy the first line <toolbox> into another file f2
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
34 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
35 #f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
36
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
37 lineStripped=line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
38 lineStripped=lineStripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
39
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
40 #Flags for verifying that the tool is not already installed
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
41 tool_present = False
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
42 webservice_present = False
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
43 workflow_present = False
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
44
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
45 # Check of the tools are already installed or not
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
46 # and sets the flags to true if they are already installed
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
47 while not lineStripped == '</toolbox>':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
48 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
49 lineStripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
50 lineStripped=lineStripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
51 if(lineStripped.find('<!--')>-1):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
52 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
53 while(not line.find('-->')>-1):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
54 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
55
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
56 if lineStripped == '<section name="Add Web service tool" id="RegisterWebService">':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
57 tool_present = True
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
58 elif lineStripped == '<section name="Web Service Tools" id="WebServices">':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
59 webservice_present = True
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
60 elif lineStripped == '<section name="Web Service Workflow Tools" id="WebServiceWorkflow">':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
61 workflow_present = True
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
62
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
63
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
64 f1.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
65 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
66 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
67
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
68 lineStripped=line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
69 lineStripped=lineStripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
70
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
71 # copy to the file f2 till <toolbox>
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
72 while not lineStripped == '<toolbox>':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
73 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
74 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
75 lineStripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
76 lineStripped = lineStripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
77
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
78 # Check if the tool is not installed and then add it to the file f2
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
79 if not tool_present:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
80 f2.write(' <section name="Add Web service tool" id="RegisterWebService">\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
81 f2.write(' <tool file="WebServiceToolWorkflow_REST_SOAP/WebServiceTool_input_url_REST_SOAP.xml"/>\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
82 f2.write(' <tool file="WebServiceToolWorkflow_REST_SOAP/WebServiceTool_input_method_REST_SOAP.xml"/>\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
83 f2.write(' <tool file="WebServiceToolWorkflow_REST_SOAP/refreshTool.xml"/>\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
84 f2.write(' </section>\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
85 print 'The "Add Web Service Tool" added successfully'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
86 else:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
87 print 'The "Add Web service tool" tool is already present'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
88
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
89
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
90 # Check if the section "Web Service Tools" is not installed and then add it to the file f2
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
91 if not webservice_present:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
92 f2.write(' <section name="Web Service Tools" id="WebServices">\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
93 f2.write('\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
94 f2.write(' </section>\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
95 print 'The "Web Service Tools" added successfully'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
96 else:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
97 print 'The section "Web Service Tools" is already present'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
98
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
99
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
100 # Check if the Section "Web Service Workflow Tools" is not installed and then add it to the file f2
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
101 if not workflow_present:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
102 f2.write(' <section name="Web Service Workflow Tools" id="WebServiceWorkflow">\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
103 f2.write('\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
104 f2.write(' </section>\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
105 print 'The section "Web Service Workflow Tools" is added successfully'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
106 else:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
107 print 'The section "Web Service Workflow Tools" is already present'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
108
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
109
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
110 #copy rest of tool_conf.xml file to f2
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
111 while not lineStripped == '</toolbox>':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
112 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
113 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
114 lineStripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
115 lineStripped=lineStripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
116 #else:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
117 # print line
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
118
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
119 ##close f1 and f2
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
120 f1.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
121 f2.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
122
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
123 ##interchange modes of f1 and f2
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
124 f1=open(galaxyhome+'/tool_conf.xml','w')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
125 f1.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
126 f2=open(galaxyhome+'/tool_conf_backup.xml','r')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
127 f2.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
128
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
129 line = f2.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
130 f1.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
131
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
132 lineStripped=line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
133 lineStripped = lineStripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
134
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
135 ##write entire f2 into f1 (reverse roles)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
136 while not lineStripped == '</toolbox>':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
137 line = f2.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
138 f1.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
139 lineStripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
140 lineStripped = lineStripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
141 #else:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
142 # print line
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
143
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
144 f1.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
145 f2.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
146
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
147
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
148 # Adding Code to __init__.py in lib/galaxy/tools folder in Galaxy for disabling Web service stand alone tools in Workflows
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
149 f1 = open(galaxyhome+'/lib/galaxy/tools/__init__.py','r')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
150 f1.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
151
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
152 exist = False
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
153 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
154 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
155 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
156 while line != '':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
157 # if(linsetripped.find('\'\'\'')>-1):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
158 # line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
159 # while(not line.find('\'\'\'')>-1):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
160 # line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
161 if(linestripped == 'if self.id.find("WebService")>-1:'):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
162 exist = True
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
163 break
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
164 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
165 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
166 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
167
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
168 if exist :
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
169 print 'Workflow code is already present in __init__.py'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
170 else:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
171 f2 = open(galaxyhome+'/lib/galaxy/tools/__init__backup.py','w')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
172 f2.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
173 f1.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
174 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
175 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
176 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
177 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
178 while not (linestripped.find('def check_workflow_compatible(')>-1):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
179 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
180 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
181 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
182 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
183 if line.find('(')>-1:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
184 while not line.find(')')>-1:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
185 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
186 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
187
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
188 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
189 while line.find('#')>-1:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
190 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
191 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
192
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
193 indent=0
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
194 while (line[indent] == ' '):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
195 indent = indent+1
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
196
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
197 space = ''
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
198 for i in range(0,indent):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
199 space +=' '
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
200
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
201 f2.write(space+'#############\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
202 f2.write(space+'#added by Chaitany Guttula, chaitu86@uga.edu - to disable webservice standalone tools in Workflows\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
203 f2.write(space+'if self.id.find("WebService")>-1:\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
204 f2.write(space+' return False\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
205 f2.write(space+'#############\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
206
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
207 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
208 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
209 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
210
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
211 while line != '':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
212 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
213 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
214
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
215 f1.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
216 f2.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
217
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
218 f1 = open(galaxyhome+'/lib/galaxy/tools/__init__backup.py','r')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
219 f2 = open(galaxyhome+'/lib/galaxy/tools/__init__.py','w')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
220
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
221 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
222 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
223
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
224 while line != '':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
225 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
226 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
227
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
228 f1.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
229 f2.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
230 print 'Workflow disabling Code added to __init__.py'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
231
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
232
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
233
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
234 # Adding Code to __init__.py in lib/galaxy/tools folder in Galaxy for invoking the refresh functionality
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
235 f1 = open(galaxyhome+'/lib/galaxy/tools/__init__.py','r')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
236 f1.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
237
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
238 exist = False
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
239 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
240 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
241 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
242 while line != '':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
243 # if(linsetripped.find('\'\'\'')>-1):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
244 # line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
245 # while(not line.find('\'\'\'')>-1):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
246 # line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
247 if(linestripped == 'if self.id == \'WebService_REFRESH_ID\':'):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
248 exist = True
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
249 break
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
250 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
251 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
252 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
253
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
254 if exist :
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
255 print 'Refresh code is already present in __init__.py'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
256 else:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
257 f2 = open(galaxyhome+'/lib/galaxy/tools/__init__backup.py','w')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
258 f2.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
259 f1.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
260 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
261 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
262 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
263 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
264 while not (linestripped.find('def execute(')>-1):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
265 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
266 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
267 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
268 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
269 if line.find('(')>-1:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
270 while not line.find(')')>-1:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
271 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
272 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
273
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
274 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
275 while line.find('#')>-1:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
276 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
277 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
278
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
279 indent=0
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
280 while (line[indent] == ' '):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
281 indent = indent+1
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
282
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
283 space = ''
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
284 for i in range(0,indent):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
285 space +=' '
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
286
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
287 f2.write(space+'#############\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
288 f2.write(space+'#add code to verify if user has administrative privileges\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
289 f2.write(space+'#added by sumedha ganjoo, sganjoo@uga.edu - to refresh toolbox\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
290 f2.write(space+'if self.id == \'WebService_REFRESH_ID\':\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
291 f2.write(space+' self.app.refreshToolBox()\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
292 f2.write(space+'#############\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
293
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
294 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
295 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
296 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
297
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
298 while line != '':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
299 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
300 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
301
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
302 f1.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
303 f2.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
304
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
305 f1 = open(galaxyhome+'/lib/galaxy/tools/__init__backup.py','r')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
306 f2 = open(galaxyhome+'/lib/galaxy/tools/__init__.py','w')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
307
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
308 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
309 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
310
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
311 while line != '':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
312 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
313 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
314
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
315 f1.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
316 f2.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
317 print 'Refresh Code added to __init__.py'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
318
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
319
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
320 # Adding Code to app.py in lib/galaxy folder in Galaxy for invoking the refresh functionality
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
321 f1 = open(galaxyhome+'/lib/galaxy/app.py','r')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
322
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
323 f1.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
324
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
325 exist = False
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
326 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
327 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
328 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
329 while line != '':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
330 if(linestripped == 'def refreshToolBox( self ):'):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
331 exist = True
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
332 break
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
333 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
334 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
335 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
336
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
337 if exist:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
338 print 'Refresh code is already present in app.py'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
339 else:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
340 f2 = open(galaxyhome+'/lib/galaxy/app_backup.py','w')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
341 f2.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
342 f1.seek(0,0)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
343 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
344 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
345 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
346 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
347 while not (line.find('class UniverseApplication')>-1):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
348 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
349 linestripped = line.lstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
350 linestripped = linestripped.rstrip()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
351 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
352 if line.find('(')>-1:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
353 while not line.find(')')>-1:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
354 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
355 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
356
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
357 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
358
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
359 while line.find('#')>-1:
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
360 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
361 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
362
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
363
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
364 indent=0
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
365 while (line[indent] == ' '):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
366 indent = indent+1
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
367
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
368 space = ''
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
369 for i in range(0,indent):
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
370 space +=' '
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
371
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
372 f2.write(space+'#############\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
373 f2.write(space+'#added by sumedha ganjoo, sganjoo@uga.edu\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
374 f2.write(space+'def refreshToolBox( self ):\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
375 f2.write(space+' self.toolbox = tools.ToolBox( self.config.tool_config, self.config.tool_path, self )\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
376 f2.write(space+'#############\n\n')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
377
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
378 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
379 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
380 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
381
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
382 while line != '':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
383 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
384 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
385
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
386 f1.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
387 f2.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
388
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
389 f1 = open(galaxyhome+'/lib/galaxy/app_backup.py','r')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
390 f2 = open(galaxyhome+'/lib/galaxy/app.py','w')
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
391
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
392 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
393 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
394
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
395 while line != '':
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
396 line = f1.readline()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
397 f2.write(line)
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
398
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
399 f1.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
400 f2.close()
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
401 print 'Refresh code is added to app.py'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
402
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
403
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
404
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
405 print '****Installation of tool is complete. Now reload galaxy to use the installed tool****'
049760c677de Galaxy WSExtensions added successfully
uga-galaxy-group
parents:
diff changeset
406