From 7379b4b646c8447d87cc28d9f1a47c840787a5fc Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Wed, 19 Jul 2006 04:05:17 +0000 Subject: [PATCH] * src/plugins/GraphViz.py: Make it work for Windows svn: r7039 --- ChangeLog | 3 +++ src/plugins/GraphViz.py | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ef0111eb..1a9759623 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2006-07-18 Brian Matherly + * src/plugins/GraphViz.py: Make it work for Windows + 2006-07-18 Don Allingham * src/RelLib/_DateBase.py: fix the date comparison for text only dates diff --git a/src/plugins/GraphViz.py b/src/plugins/GraphViz.py index cc83079d3..851d90b8d 100644 --- a/src/plugins/GraphViz.py +++ b/src/plugins/GraphViz.py @@ -122,7 +122,10 @@ class _options: ('', "Descendants - Ancestors", _("Descendants - Ancestors")), ) -_dot_found = os.system("dot -V 2>/dev/null") == 0 +if os.sys.platform == "win32": + _dot_found = os.system("dot -V 2>nul") == 0 +else: + _dot_found = os.system("dot -V 2>/dev/null") == 0 if os.system("which epstopdf >/dev/null 2>&1") == 0: _options.formats += (("pdf", "PDF", _("PDF"), "application/pdf"),) @@ -1146,9 +1149,9 @@ class GraphVizGraphics(Report): (self.junk_output,self.user_output,self.junk_output) os.system(command) else: - os.system('dot -T%s -o%s %s ; rm %s' % - (self.the_format,self.user_output, - self.junk_output,self.junk_output)) + os.system('dot -T%s -o"%s" "%s"' % + (self.the_format,self.user_output,self.junk_output) ) + os.remove(self.junk_output) if self.doc.print_req: _apptype = None