Mercurial > repos > ganjoo > webservice_toolsuite
view WebServiceToolWorkflow/DeleteTool1.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 |
line wrap: on
line source
import os galaxyhome=os.environ.get('GALAXY_HOME') f1=open(galaxyhome+'/tool_conf.xml','r') f1.seek(0,0) f3=open(galaxyhome+'/tools/WebServiceToolWorkflow/DeleteTool2.xml','w') f3.seek(0,0) f3.write('<tool id="DeleteTool3" name="Step 2">\n') f3.write(' <description> :Choose Web Service Tool to be deleted </description>\n') f3.write(' <command interpreter="python">\n DeleteTool2.py \n'+' $output \n $tool \n </command>\n') f3.write(' <inputs>\n <param name ="tool" type ="select" label =" Select the Web service tool you want to delete, by its order number (position in the Web Service Tools section on the left) " help="see tip below">\n') ##first copy everything upto WebServiceTool1.xml into another file f2 line = f1.readline() lineStripped=line.lstrip() while not lineStripped == '<section name="Web Service Tools" id="WebServices">\n': line = f1.readline() lineStripped = line.lstrip() else: print line i=0 while not lineStripped == '</section>\n': i=i+1 line = f1.readline() lineStripped = line.lstrip() else: print line j=0 while not j==i-1: j=j+1 f3.write(' <option value = "client_'+ str(j) + '.xml"> Web Service Tools: Tool '+ str(j) + '</option>\n') else: print i f3.write(' </param>\n </inputs>\n') f3.write(' <outputs>\n <data format="tabular" name="output" />\n </outputs>\n') f3.write(' <help>\n </help>\n</tool>')