Issue 4164, Graphviz version=2.26.3

svn: r15717
This commit is contained in:
Peter Landgren 2010-08-12 18:27:46 +00:00
parent 418d7dd39f
commit 534fac7b93

View File

@ -35,6 +35,7 @@ import threading
import time import time
from types import ClassType, InstanceType from types import ClassType, InstanceType
from gen.ggettext import gettext as _ from gen.ggettext import gettext as _
from subprocess import Popen, PIPE
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# #
@ -446,8 +447,13 @@ class GVPsDoc(GVDocBase):
# If I take a correct multip page PDF and convert it with pdf2ps I get multip pages, # If I take a correct multip page PDF and convert it with pdf2ps I get multip pages,
# but the output is clipped, some margins have disappeared. I used 1 inch margins always. # but the output is clipped, some margins have disappeared. I used 1 inch margins always.
# See bug tracker issue 2815 # See bug tracker issue 2815
# :cairo does not work with Graphviz 2.26.3 See issue 4164
os.system( 'dot -Tps:cairo -o"%s" "%s"' % (self._filename, tmp_dot) ) command = 'dot -Tps:cairo -o"%s" "%s"' % (self._filename, tmp_dot)
dotversion = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1]
if dotversion.find('2.26.3'):
command=command.replace(':cairo','')
os.system(command)
# Delete the temporary dot file # Delete the temporary dot file
os.remove(tmp_dot) os.remove(tmp_dot)
@ -775,7 +781,12 @@ class GVPdfGsDoc(GVDocBase):
# Generate PostScript using dot # Generate PostScript using dot
# Reason for using -Tps:cairo. Needed for Non Latin-1 letters # Reason for using -Tps:cairo. Needed for Non Latin-1 letters
# See bug tracker issue 2815 # See bug tracker issue 2815
# :cairo does not work with Graphviz 2.26.3 See issue 4164
command = 'dot -Tps:cairo -o"%s" "%s"' % ( tmp_ps, tmp_dot ) command = 'dot -Tps:cairo -o"%s" "%s"' % ( tmp_ps, tmp_dot )
dotversion = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1]
if dotversion.find('2.26.3'):
command=command.replace(':cairo','')
os.system(command) os.system(command)
# Add .5 to remove rounding errors. # Add .5 to remove rounding errors.