Changeset b4b19c7 for fedd/fedd_client.py
- Timestamp:
- Apr 21, 2010 5:31:03 AM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- f7a54c6
- Parents:
- f54e8e4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd_client.py
rf54e8e4 rb4b19c7 134 134 self.add_option("--data", dest="data", default=[], 135 135 action="append", type="choice", 136 choices=("id", "federant", "vtopo", "vis", "log", "status"), 136 choices=("id", "experimentdescription", "federant", "vtopo", 137 "vis", "log", "status"), 137 138 help="data to extract") 138 139 … … 360 361 # called. 361 362 self.params = { 362 'vis': ('vis', self.print_ xml('vis')),363 'vtopo': ('vtopo', self.print_ xml('vtopo')),363 'vis': ('vis', self.print_vis_or_vtopo('vis')), 364 'vtopo': ('vtopo', self.print_vis_or_vtopo('vtopo')), 364 365 'federant': ('federant', self.print_xml), 366 'experimentdescription': \ 367 ('experimentdescription', self.print_xml), 365 368 'id': ('experimentID', self.print_id), 366 369 'status': ('experimentStatus', self.print_string), … … 379 382 print >>out, "%s: %s" % (k, id[k]) 380 383 381 class print_xml: 384 def print_xml(self, d, out=sys.stdout): 385 """ 386 Very simple ugly xml formatter of the kinds of dicts that come back 387 from services. 388 """ 389 if isinstance(d, dict): 390 for k, v in d.items(): 391 print >>out, "<%s>" % k 392 self.print_xml(v, out) 393 print >>out, "</%s>" % k 394 elif isinstance(d, list): 395 for x in d: 396 self.print_xml(x, out) 397 else: 398 print >>out, d 399 400 401 class print_vis_or_vtopo: 382 402 """ 383 403 Print the retrieved data is a simple xml representation of the dict.
Note: See TracChangeset
for help on using the changeset viewer.