~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to dotgraph.py

  • Committer: Aaron Bentley
  • Date: 2008-03-20 15:36:35 UTC
  • Revision ID: aaron@aaronbentley.com-20080320153635-ywgk5968qpopub9y
cbranch creates parent directories as needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2004, 2005 Aaron Bentley
2
 
# <aaron.bentley@utoronto.ca>
 
2
# <aaron@aaronbentley.com>
3
3
#
4
4
#    This program is free software; you can redistribute it and/or modify
5
5
#    it under the terms of the GNU General Public License as published by
16
16
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
18
from subprocess import Popen, PIPE
19
 
from urllib import urlencode
20
 
from xml.sax.saxutils import escape
21
19
import os.path
22
20
import errno
23
21
import tempfile
24
22
import shutil
25
 
import time
26
23
 
27
24
RSVG_OUTPUT_TYPES = ('png', 'jpg')
28
 
DOT_OUTPUT_TYPES = ('svg', 'svgz', 'gif', 'jpg', 'ps', 'fig', 'mif', 'png', 
 
25
DOT_OUTPUT_TYPES = ('svg', 'svgz', 'gif', 'jpg', 'ps', 'fig', 'mif', 'png',
29
26
                    'cmapx')
30
27
 
31
28
class NoDot(Exception):
198
195
        shutil.rmtree(tempdir)
199
196
    return status
200
197
 
201
 
def invoke_dot(input, out_file=None, file_type='svg', antialias=None, 
 
198
def invoke_dot(input, out_file=None, file_type='svg', antialias=None,
202
199
               fontname="Helvetica", fontsize=11):
203
 
    cmdline = ['dot', '-T%s' % file_type, '-Nfontname=%s' % fontname, 
 
200
    cmdline = ['dot', '-T%s' % file_type, '-Nfontname=%s' % fontname,
204
201
               '-Efontname=%s' % fontname, '-Nfontsize=%d' % fontsize,
205
202
               '-Efontsize=%d' % fontsize]
206
203
    if out_file is not None: