Hack for Windows users to compensate for Graphviz "feature".

Recent versions of Graphviz no longer set the PATH variable on Windows.
Hence Scyther can fail to find dot.exe even though Graphviz was appropriately
installed.

This patch is a hack to try and locate dot.exe in the more common locations.
We currently have a hardcoded search through:

  C:\Program Files\Graphviz*
  C:\Program Files (x86)\Graphviz*

This is clearly fragile. Obviously, nobody should be solving Graphviz' problem
in such an ugly way. Change drives or languages and it stops working.

Until Graphviz provides at least an alternative environment variable (GVPATH?)
this hack will help the bulk of our users to get things up and running smoothly.
This commit is contained in:
Cas Cremers
2013-12-09 14:24:57 +00:00
parent 7e3f0ed73b
commit c9b1d08f4f
3 changed files with 136 additions and 18 deletions

View File

@@ -230,24 +230,9 @@ def CheckRequirements():
""" Check for any required programs """
""" We need 'dot', in the graphviz package """
failed = False
try:
(sts,sout,serr) = Misc.safeCommandOutput("dot -V")
output = (sout + serr).lower()
if output.find("graphviz") == -1:
failed = True
except OSError, ImportError:
failed = True
if failed:
Misc.panic("""
Could not find the required 'dot' program, which is part of the graphviz suite.
Please install it from http://www.graphviz.org/
from Scyther import FindDot
Ubuntu users: install the 'graphviz' package.
Restarting your system may be needed for Scyther to locate any newly installed
programs.
""")
FindDot.findDot() # If Graphviz is not found, this function will call panic to complain.
#---------------------------------------------------------------------------