當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。