~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to dotgraph.py

  • Committer: Aaron Bentley
  • Date: 2005-09-01 13:58:51 UTC
  • Revision ID: abentley@panoramicfeedback.com-20050901135851-d79d3aac8803a1e2
Handle systems without dot (the horror!).  From Magnus Therning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    cmdline = ['dot', '-T%s' % file_type]
68
68
    if out_file is not None:
69
69
        cmdline.extend(('-o', out_file))
70
 
    dot_proc = Popen(cmdline, stdin=PIPE)
 
70
    try:
 
71
        dot_proc = Popen(cmdline, stdin=PIPE)
 
72
    except OSError, e:
 
73
        if e.errno == 2:
 
74
            print "You need 'dot' to create ancestry graphs"
 
75
        return
71
76
    for line in input:
72
77
        dot_proc.stdin.write(line)
73
78
    dot_proc.stdin.close()