~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to dotgraph.py

  • Committer: Aaron Bentley
  • Date: 2005-08-30 16:33:39 UTC
  • Revision ID: abentley@panoramicfeedback.com-20050830163339-0ced18607bbaf642
Got initial graphing functionality working

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
import os.path
6
6
 
7
7
class Node(object):
8
 
    def __init__(self, name, color=None):
 
8
    def __init__(self, name, color=None, label=None):
9
9
        self.name = name
10
10
        self.color = color
 
11
        self.label = label
11
12
 
12
13
    def define(self):
13
14
        if self.color is not None:
17
18
    def __str__(self):
18
19
        return self.name
19
20
 
20
 
def dot_output(my_file, relations):
 
21
def dot_output(relations):
21
22
    defined = set()
22
23
    yield "digraph G\n"
23
24
    yield "{\n"
37
38
    yield "}\n"
38
39
 
39
40
def invoke_dot(input, out_file=None):
40
 
    cmdline = ['dot', '-Tgif']
 
41
    cmdline = ['dot', '-Tsvg']
41
42
    if out_file is not None:
42
43
        cmdline.extend(('-o', out_file))
43
44
    dot_proc = Popen(cmdline, stdin=PIPE)