当前位置: 首页>>代码示例>>Python>>正文


Python ft2font.__freetype_build_type__方法代码示例

本文整理汇总了Python中matplotlib.ft2font.__freetype_build_type__方法的典型用法代码示例。如果您正苦于以下问题:Python ft2font.__freetype_build_type__方法的具体用法?Python ft2font.__freetype_build_type__怎么用?Python ft2font.__freetype_build_type__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.ft2font的用法示例。


在下文中一共展示了ft2font.__freetype_build_type__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _init_tests

# 需要导入模块: from matplotlib import ft2font [as 别名]
# 或者: from matplotlib.ft2font import __freetype_build_type__ [as 别名]
def _init_tests():
    # CPython's faulthandler since v3.6 handles exceptions on Windows
    # https://bugs.python.org/issue23848 but until v3.6.4 it was printing
    # non-fatal exceptions https://bugs.python.org/issue30557
    import platform
    if not (sys.platform == 'win32' and
            (3, 6) < sys.version_info < (3, 6, 4) and
            platform.python_implementation() == 'CPython'):
        import faulthandler
        faulthandler.enable()

    # The version of FreeType to install locally for running the
    # tests.  This must match the value in `setupext.py`
    LOCAL_FREETYPE_VERSION = '2.6.1'

    from matplotlib import ft2font
    if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
        ft2font.__freetype_build_type__ != 'local'):
        _log.warning(
            "Matplotlib is not built with the correct FreeType version to run "
            "tests.  Set local_freetype=True in setup.cfg and rebuild. "
            "Expect many image comparison failures below. "
            "Expected freetype version {0}. "
            "Found freetype version {1}. "
            "Freetype build type is {2}local".format(
                LOCAL_FREETYPE_VERSION,
                ft2font.__freetype_version__,
                "" if ft2font.__freetype_build_type__ == 'local' else "not "))

    try:
        import pytest
    except ImportError:
        print("matplotlib.test requires pytest to run.")
        raise 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:36,代码来源:__init__.py

示例2: _init_tests

# 需要导入模块: from matplotlib import ft2font [as 别名]
# 或者: from matplotlib.ft2font import __freetype_build_type__ [as 别名]
def _init_tests():
    # CPython's faulthandler since v3.6 handles exceptions on Windows
    # https://bugs.python.org/issue23848 but until v3.6.4 it was printing
    # non-fatal exceptions https://bugs.python.org/issue30557
    import platform
    if not (sys.platform == 'win32' and
            (3, 6) < sys.version_info < (3, 6, 4) and
            platform.python_implementation() == 'CPython'):
        import faulthandler
        faulthandler.enable()

    # The version of FreeType to install locally for running the
    # tests.  This must match the value in `setupext.py`
    LOCAL_FREETYPE_VERSION = '2.6.1'

    from matplotlib import ft2font
    if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
        ft2font.__freetype_build_type__ != 'local'):
        warnings.warn(
            "Matplotlib is not built with the correct FreeType version to run "
            "tests.  Set local_freetype=True in setup.cfg and rebuild. "
            "Expect many image comparison failures below. "
            "Expected freetype version {0}. "
            "Found freetype version {1}. "
            "Freetype build type is {2}local".format(
                LOCAL_FREETYPE_VERSION,
                ft2font.__freetype_version__,
                "" if ft2font.__freetype_build_type__ == 'local' else "not "
            )
        )

    try:
        import pytest
    except ImportError:
        print("matplotlib.test requires pytest to run.")
        raise 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:38,代码来源:__init__.py

示例3: _init_tests

# 需要导入模块: from matplotlib import ft2font [as 别名]
# 或者: from matplotlib.ft2font import __freetype_build_type__ [as 别名]
def _init_tests():
    try:
        import faulthandler
    except ImportError:
        pass
    else:
        # CPython's faulthandler since v3.6 handles exceptions on Windows
        # https://bugs.python.org/issue23848 but until v3.6.4 it was
        # printing non-fatal exceptions https://bugs.python.org/issue30557
        import platform
        if not (sys.platform == 'win32' and
                (3, 6) < sys.version_info < (3, 6, 4) and
                platform.python_implementation() == 'CPython'):
            faulthandler.enable()

    # The version of FreeType to install locally for running the
    # tests.  This must match the value in `setupext.py`
    LOCAL_FREETYPE_VERSION = '2.6.1'

    from matplotlib import ft2font
    if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
        ft2font.__freetype_build_type__ != 'local'):
        warnings.warn(
            "Matplotlib is not built with the correct FreeType version to run "
            "tests.  Set local_freetype=True in setup.cfg and rebuild. "
            "Expect many image comparison failures below. "
            "Expected freetype version {0}. "
            "Found freetype version {1}. "
            "Freetype build type is {2}local".format(
                LOCAL_FREETYPE_VERSION,
                ft2font.__freetype_version__,
                "" if ft2font.__freetype_build_type__ == 'local' else "not "
            )
        )

    try:
        import pytest
        try:
            from unittest import mock
        except ImportError:
            import mock
    except ImportError:
        print("matplotlib.test requires pytest and mock to run.")
        raise 
开发者ID:alvarobartt,项目名称:twitter-stock-recommendation,代码行数:46,代码来源:__init__.py


注:本文中的matplotlib.ft2font.__freetype_build_type__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。