source: fedd/fedd_multiinfo.py @ 5d854e1

axis_examplecompt_changesinfo-ops
Last change on this file since 5d854e1 was 5d854e1, checked in by Ted Faber <faber@…>, 14 years ago

allow FEDD_URL in the environment to set the contact URL. Man am I sick of typing --url.

  • Property mode set to 100755
File size: 1.2 KB
Line 
1#!/usr/local/bin/python
2
3import sys
4import os
5import pwd
6import tempfile
7import subprocess
8import re
9import xml.parsers.expat
10import time
11
12from federation.remote_service import service_caller
13from federation.client_lib import client_opts, exit_with_fault, RPCException,\
14        wrangle_standard_options, do_rpc, info_format
15
16class exp_data_opts(client_opts):
17    def __init__(self):
18        client_opts.__init__(self)
19        self.add_option("--data", dest="data", default=[],
20                action="append", type="choice",
21                choices=("id", "experimentdescription", "federant", "vtopo", 
22                    "vis", "log", "status"),
23                help="data to extract")
24       
25parser = exp_data_opts()
26(opts, args) = parser.parse_args()
27cert, fid, url = wrangle_standard_options(opts)
28
29try:
30    resp_dict = do_rpc({ },
31            url, opts.transport, cert, opts.trusted, 
32            serialize_only=opts.serialize_only,
33            tracefile=opts.tracefile,
34            caller=service_caller('MultiInfo'), 
35            responseBody='MultiInfoResponseBody')
36except RPCException, e:
37    exit_with_fault(e)
38except RuntimeError, e:
39    sys.exit("Error processing RPC: %s" % e)
40
41formatter = info_format()
42for i in resp_dict.get('info', []):
43    for d in opts.data:
44        formatter(i, d)
45    print "---"
Note: See TracBrowser for help on using the repository browser.