Пример #1
0
def find_mysql_binary(exe='mysql.exe'):
    r = find_mysql_in_registry()
    if r:
        for inst in r:
            mypath = inst['Location']
            myname = join(mypath, 'bin', exe)
            if isfile(myname):
                return myname
    else:
        return isinPATH(exe, cwd=True) or None
Пример #2
0
def find_mysqldump(exe='mysqldump.exe'):
    """Find mysqldump.exe, the MySQL client for database dumping.

    Looks for the MySQL binary mysqldump.exe in several different
    places, starting with the location(s) possibly found in the
    Windows Registry, plus the PATH and the current directory.
    Returns the full path to the file if it is actually present,
    or None otherwise.
    """
    r = find_mysql_in_registry()
    if r:
        for inst in r:
            mypath = inst['Location']
            myname = join(mypath, 'bin', exe)
            if isfile(myname):
                return myname
    else:
        return isinPATH(exe, cwd=True) or None