Ejemplo n.º 1
0
def dvipng_hack_alpha():
    try:
        p = Popen(["dvipng", "-version"], stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=(sys.platform != "win32"))
        stdout, stderr = p.communicate()
    except OSError:
        mpl.verbose.report("No dvipng was found", "helpful")
        return False
    lines = stdout.decode(sys.getdefaultencoding()).split("\n")
    for line in lines:
        if line.startswith("dvipng "):
            version = line.split()[-1]
            mpl.verbose.report("Found dvipng version %s" % version, "helpful")
            version = distutils.version.LooseVersion(version)
            return version < distutils.version.LooseVersion("1.6")
    mpl.verbose.report("Unexpected response from dvipng -version", "helpful")
    return False
Ejemplo n.º 2
0
def dvipng_hack_alpha():
    try:
        p = Popen([str('dvipng'), '-version'], stdin=PIPE, stdout=PIPE,
                  stderr=STDOUT, close_fds=(sys.platform != 'win32'))
        stdout, stderr = p.communicate()
    except OSError:
        _log.info('No dvipng was found')
        return False
    lines = stdout.decode(sys.getdefaultencoding()).split('\n')
    for line in lines:
        if line.startswith('dvipng '):
            version = line.split()[-1]
            _log.info('Found dvipng version %s', version)
            version = distutils.version.LooseVersion(version)
            return version < distutils.version.LooseVersion('1.6')
    _log.info('Unexpected response from dvipng -version')
    return False
Ejemplo n.º 3
0
def dvipng_hack_alpha():
    try:
        p = Popen(['dvipng', '-version'], stdin=PIPE, stdout=PIPE,
                  stderr=STDOUT, close_fds=(sys.platform != 'win32'))
        stdout, stderr = p.communicate()
    except OSError:
        mpl.verbose.report('No dvipng was found', 'helpful')
        return False
    lines = stdout.decode(sys.getdefaultencoding()).split('\n')
    for line in lines:
        if line.startswith('dvipng '):
            version = line.split()[-1]
            mpl.verbose.report('Found dvipng version %s' % version,
                               'helpful')
            version = distutils.version.LooseVersion(version)
            return version < distutils.version.LooseVersion('1.6')
    mpl.verbose.report('Unexpected response from dvipng -version', 'helpful')
    return False
Ejemplo n.º 4
0
def dvipng_hack_alpha():
    try:
        p = Popen(['dvipng', '-version'], stdin=PIPE, stdout=PIPE,
                  stderr=STDOUT, close_fds=(sys.platform != 'win32'))
        stdout, stderr = p.communicate()
    except OSError:
        mpl.verbose.report('No dvipng was found', 'helpful')
        return False
    lines = stdout.decode('ascii').split('\n')
    for line in lines:
        if line.startswith('dvipng '):
            version = line.split()[-1]
            mpl.verbose.report('Found dvipng version %s' % version,
                               'helpful')
            version = distutils.version.LooseVersion(version)
            return version < distutils.version.LooseVersion('1.6')
    mpl.verbose.report('Unexpected response from dvipng -version', 'helpful')
    return False
Ejemplo n.º 5
0
def dvipng_hack_alpha():
    try:
        p = Popen(['dvipng', '-version'], stdin=PIPE, stdout=PIPE,
                  stderr=STDOUT, close_fds=(sys.platform != 'win32'))
    except OSError:
        mpl.verbose.report('No dvipng was found', 'helpful')
        return False
    stdin, stdout = p.stdin, p.stdout
    for line in stdout:
        if line.startswith(b'dvipng '):
            version = line.split()[-1]
            mpl.verbose.report('Found dvipng version %s' % version,
                               'helpful')
            version = version.decode('ascii')
            version = distutils.version.LooseVersion(version)
            return version < distutils.version.LooseVersion('1.6')
    mpl.verbose.report('Unexpected response from dvipng -version', 'helpful')
    return False
def test_backend(backend):
    environ = os.environ.copy()
    environ["MPLBACKEND"] = backend
    proc = Popen([sys.executable, "-c", _test_script], env=environ)
    # Empirically, 1s is not enough on Travis.
    assert proc.wait(timeout=5) == 0
Ejemplo n.º 7
0
def test_backend(backend):
    environ = os.environ.copy()
    environ["MPLBACKEND"] = backend
    proc = Popen([sys.executable, "-c", _test_script], env=environ)
    # Empirically, 1s is not enough on Travis.
    assert proc.wait(timeout=10) == 0