- Timestamp:
- Jul 14, 2009 6:49:41 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 8780cbec
- Parents:
- 7a1918e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd_client.py
r7a1918e r67c0e15 169 169 default=True, action='store_false', 170 170 help='Label nodes and edges') 171 self.add_option('-j','--pixels', dest="pixels", default=None, 172 type="int", 173 help="Size of output in pixels (diagrams are square") 171 174 172 175 class fedd_ns_image_opts(fedd_split_opts): … … 189 192 default=True, action='store_false', 190 193 help='Label nodes and edges') 194 self.add_option('-j','--pixels', dest="pixels", default=None, 195 type="int", 196 help="Size of output in pixels (diagrams are square") 191 197 192 198 def exit_with_fault(dict, out=sys.stderr): … … 517 523 fedd_rpc.__init__(self, op) 518 524 519 def gen_image(self, d, file, fmt, neato, labels ):525 def gen_image(self, d, file, fmt, neato, labels, pix=None): 520 526 521 527 # Open up a temporary file for dot to turn into a visualization … … 549 555 else: size = 18 550 556 557 if pix: 558 dpi = pix / size 559 else: 560 dpi = None 561 562 551 563 print >>dotfile, "graph G {" 552 print >>dotfile, '\tgraph [size="%i,%i", ratio=fill];' % (size, size) 564 if dpi: 565 print >>dotfile, '\tgraph [size="%i,%i", dpi="%i", ratio=fill];' \ 566 % (size, size, dpi) 567 else: 568 print >>dotfile, '\tgraph [size="%i,%i", ratio=fill];' \ 569 % (size, size) 570 553 571 if labels: 554 572 print >>dotfile, '\tnode [fontname=arial,fontsize=9,label="\N"];' … … 686 704 if resp_dict.has_key('vtopo'): 687 705 self.gen_image(resp_dict['vtopo'], file, fmt, opts.neato, 688 opts.labels )706 opts.labels, opts.pixels) 689 707 else: 690 708 sys.exit("Bad response. %s" % e.message) … … 844 862 sys.exit("Bad response: could not split") 845 863 topo = self.generate_topo_dict(resp_dict['output']) 846 self.gen_image(topo, file, fmt, opts.neato, opts.labels) 864 self.gen_image(topo, file, fmt, opts.neato, opts.labels, 865 opts.pixels) 847 866 else: 848 867 sys.exit("Bad response. %s" % e.message)
Note: See TracChangeset
for help on using the changeset viewer.