source: TI03-DataExtractor/trunk/dxc/scripts/exampleCLClient2.py @ 1109

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/trunk/dxc/scripts/exampleCLClient2.py@1109
Revision 1109, 1.4 KB checked in by astephen, 13 years ago (diff)

Stable-ish version with fully-ish working dxc client.

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2import sys
3sys.path=sys.path+["..","scripts","../..",".", "../../pydxc"]
4
5#import readline
6from ZSI.client import Binding
7from pydxc.common import *
8from pydxc.clientConfig import SOAP_SERVER_URL
9# start session
10server = Binding(url=SOAP_SERVER_URL)
11(sessionID, secureToken)=server.startSession("jane", "jane1")[0]
12
13server.getOptions(sessionID, secureToken)
14
15print "dsg"
16print server.selectOptions(sessionID, [["secureToken",secureToken], ["datasetGroup_1","Test Data Group 1"]])
17
18print "ds"
19print server.selectOptions(sessionID, [["secureToken",secureToken], ["dataset_1.1","Test Dataset 1"]])
20
21print "v"
22print server.selectOptions(sessionID, [["secureToken",secureToken], ["variable_1.1.1","pqn"]])
23
24print "domain"
25print server.selectOptions(sessionID, [["secureToken",secureToken],["axis_1.1.1.3",(0,90)], ["axis_1.1.1.2",(90,0)], 
26                                        ["axis_1.1.1.1",[[1999,1,1,0,0,0],[1999,1,1,0,0,0]]]])
27print "format"
28print server.selectOptions(sessionID, [["secureToken",secureToken], ["outputFormat_1.1.1", "NetCDF"]])
29
30print "complete"
31print server.isComplete(sessionID, secureToken)
32
33
34print "cost"
35print server.getExtractionCosts(sessionID, secureToken)
36
37print "output"
38x=server.createOutput(sessionID, secureToken)
39
40print x
41x=deUnicodeObject(x[0][0][0][0][0])
42print "Output file is:", x.replace(OUTPUT_DIR_URL_PATH, OUTPUT_DIR_LOCAL_PATH)
43
Note: See TracBrowser for help on using the repository browser.