comparison WebServiceToolWorkflow/DeleteTool2.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
comparison
equal deleted inserted replaced
-1:000000000000 0:d5cd409b8a18
1 import os,sys
2 import string
3
4 clientNo = string.atoi(sys.argv[1])
5
6 #outputfile=open(sys.argv[1],'w')
7 #outputfile.seek(0,0)
8
9 galaxyhome=os.environ.get('GALAXY_HOME')
10 f1=open(galaxyhome+'/tool_conf.xml','r')
11 f1.seek(0,0)
12 f2=open(galaxyhome+'/tool_conf_backup1.xml','w')
13 f2.seek(0,0)
14
15 line = f1.readline()
16 f2.write(line)
17
18 lineStripped=line.lstrip()
19 while not lineStripped == '<section name="Web Service Tools" id="WebServices">\n':
20 line = f1.readline()
21 lineStripped = line.lstrip()
22 f2.write(line)
23 else:
24 print line
25
26
27 i=1
28 while not i==clientNo:
29 line = f1.readline()
30 lineStripped = line.lstrip()
31 f2.write(line)
32 i=i+1
33 else:
34 line = f1.readline()
35
36 while not lineStripped == '<section name="Web Service Workflow Tools" id="WebServiceWorkflow">\n':
37 line = f1.readline()
38 lineStripped = line.lstrip()
39 f2.write(line)
40 else:
41 print line
42
43 i=1
44 while not i==clientNo:
45 line = f1.readline()
46 lineStripped = line.lstrip()
47 f2.write(line)
48 i=i+1
49 else:
50 line = f1.readline()
51
52 while not lineStripped == '</toolbox>\n':
53 line = f1.readline()
54 f2.write(line)
55 lineStripped = line.lstrip()
56 else:
57 print line
58
59 ##close f1 and f2
60 f1.close()
61 f2.close()
62
63 f1=open(galaxyhome+'/tool_conf.xml','w')
64 f1.seek(0,0)
65 f2=open(galaxyhome+'/tool_conf_backup1.xml','r')
66 f2.seek(0,0)
67
68 line = f2.readline()
69 f1.write(line)
70
71 lineStripped=line.lstrip()
72
73 ##write entire f2 into f1 (reverse roles)
74 while not lineStripped == '</toolbox>\n':
75 line = f2.readline()
76 f1.write(line)
77 lineStripped = line.lstrip()
78 else:
79 print line
80
81 f1.close()
82 f2.close()
83