Mercurial > repos > ganjoo > webservice_toolsuite
comparison WebServiceToolWorkflow/clients/client_1.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 | |
2 import sys | |
3 import urllib | |
4 '''This script is the client for invoking RESTful Web services.''' | |
5 | |
6 outputFile = open(sys.argv[1],'w') | |
7 resUrl = sys.argv[2] | |
8 | |
9 if(resUrl.find('__tilda__')>-1): | |
10 ulist = resUrl.split('__tilda__') | |
11 resUrl = '~'.join(ulist) | |
12 | |
13 paramdict={} | |
14 length=(len(sys.argv)) | |
15 | |
16 i=3 | |
17 while( i>=3 and i<(length-1)): | |
18 key=sys.argv[i] | |
19 val=sys.argv[i+1] | |
20 while(val.find('**')>-1): | |
21 vlist = val.split('**') | |
22 val = ' '.join(vlist) | |
23 paramdict[key]=val | |
24 i=i+2 | |
25 | |
26 params = urllib.urlencode(paramdict) | |
27 data = urllib.urlopen(resUrl, params).read() | |
28 outputFile.write(data) |