cudadog / pydot

Automatically exported from code.google.com/p/pydot
MIT License
0 stars 0 forks source link

Problem with detecting path to GraphViz #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a problem with finding of path to GraphViz system in pydot module 
version 1.0.2.
GraphVis catalog is  "C:\Program Files\Graphviz 2.21\bin" by default, but 
function find_graphvis() returned "None" value. It just because there 
was "C:\Program Files\ATT\Graphviz\bin" as a default path to binaries. 
Solving of problem is such

 # Method 3 (Windows only)
    #
    if os.sys.platform == 'win32':
        print 'win32'

        # Try and work out the equivalent of "C:\Program Files" on this
        # machine (might be on drive D:, or in a different language)
        #

        if os.environ.has_key('PROGRAMFILES'):

            # Note, we could also use the win32api to get this
            # information, but win32api may not be installed.

            #path = os.path.join(os.environ
['PROGRAMFILES'], 'ATT', 'GraphViz', 'bin')
            #print path

        #else:

            #Just in case, try the default...
            path = r"C:\Program Files\Graphviz 2.21\bin"
            print path

        progs = __find_executables(path)
        print progs

        if progs is not None :

            #print "Used default install location"
            return progs

Original issue reported on code.google.com by dmitrii....@gmail.com on 28 Jan 2009 at 1:03

GoogleCodeExporter commented 9 years ago
two small corrections:
to prevent an indentation error, added a 'pass' statement.
JIC, updated default path:

# Method 2 (Linux, Windows etc)
    if os.environ.has_key('PATH'):

        for path in os.environ['PATH'].split(os.pathsep):
            progs = __find_executables(path)
            if progs is not None :
                #print "Used path"
                return progs

    if os.sys.platform == 'win32':
        if os.environ.has_key('PROGRAMFILES'):
            pass
        else:
            path = r"C:\Program Files\Graphviz2.26.3\bin"

        progs = __find_executables(path)

        if progs is not None :
            return progs

Original comment by barkan...@gmail.com on 26 Jun 2010 at 6:51

GoogleCodeExporter commented 9 years ago

Original comment by ero.carr...@gmail.com on 30 Oct 2010 at 5:36

GoogleCodeExporter commented 9 years ago

Original comment by ero.carr...@gmail.com on 31 Oct 2010 at 12:21