From 6ffdacc185c22eff61fad23b1f36ab02c27ba9db Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Mon, 3 Sep 2012 08:46:20 +0000 Subject: [PATCH] Fix graphviz 2.28.0 and multiple pages. svn: r20316 --- src/gen/plug/docgen/graphdoc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gen/plug/docgen/graphdoc.py b/src/gen/plug/docgen/graphdoc.py index 16d1a6f00..b13bcf6cd 100644 --- a/src/gen/plug/docgen/graphdoc.py +++ b/src/gen/plug/docgen/graphdoc.py @@ -638,16 +638,16 @@ class GVPsDoc(GVDocBase): # multip pages, but the output is clipped, some margins have # disappeared. I used 1 inch margins always. # See bug tracker issue 2815 - # :cairo does not work with Graphviz 2.26.3 See issue 4164 + # :cairo does not work with Graphviz 2.26.3 and later See issue 4164 # Covert filename to str using file system encoding. fname = self._filename.encode(sys.getfilesystemencoding()) command = 'dot -Tps:cairo -o"%s" "%s"' % (fname, tmp_dot) dotversion = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1] - # Problem with dot 2.26.3 and multiple pages, which gives "cairo: out of + # Problem with dot 2.26.3 and later and multiple pages, which gives "cairo: out of # memory" If the :cairo is skipped for these cases it gives acceptable # result. - if dotversion.find('2.26.3') != -1 and (self.vpages * self.hpages) > 1: + if (dotversion.find('2.26.3') or dotversion.find('2.28.0')) != -1 and (self.vpages * self.hpages) > 1: command = command.replace(':cairo','') os.system(command) # Delete the temporary dot file @@ -912,14 +912,14 @@ class GVPdfGsDoc(GVDocBase): # Generate PostScript using dot # Reason for using -Tps:cairo. Needed for Non Latin-1 letters # See bug tracker issue 2815 - # :cairo does not work with Graphviz 2.26.3 See issue 4164 + # :cairo does not work with Graphviz 2.26.3 and later See issue 4164 command = 'dot -Tps:cairo -o"%s" "%s"' % ( tmp_ps, tmp_dot ) dotversion = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1] - # Problem with dot 2.26.3 and multiple pages, which gives "cairo: out + # Problem with dot 2.26.3 and later and multiple pages, which gives "cairo: out # of memory". If the :cairo is skipped for these cases it gives # acceptable result. - if dotversion.find('2.26.3') != -1 and (self.vpages * self.hpages) > 1: + if (dotversion.find('2.26.3') or dotversion.find('2.28.0')) != -1 and (self.vpages * self.hpages) > 1: command = command.replace(':cairo','') os.system(command)