Python Image 模块,VERSION 实例源码

我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用Image.VERSION

项目:sdining    作者:Lurance    | 项目源码 | 文件源码
def pillow_required():
    def pil_version(version):
        try:
            return int(re.compile('[^\d]').sub('', version))
        except:
            return 116

    try:
        from PIL import Image, ImageDraw, ImageFont
    except ImportError:
        try:
            import Image
            import ImageDraw  # NOQA
            import ImageFont  # NOQA
        except ImportError:
            return True

    return pil_version(Image.VERSION) < 116
项目:cetusshop    作者:icetusorg    | 项目源码 | 文件源码
def pillow_required():
    def pil_version(version):
        try:
            return int(re.compile('[^\d]').sub('', version))
        except:
            return 116

    try:
        from PIL import Image, ImageDraw, ImageFont
    except ImportError:
        try:
            import Image
            import ImageDraw  # NOQA
            import ImageFont  # NOQA
        except ImportError:
            return True

    return pil_version(Image.VERSION) < 116
项目:nml-andythenorth    作者:andythenorth    | 项目源码 | 文件源码
def get_lib_versions():
    versions = {}
    #PIL
    try:
        from PIL import Image
        versions["PIL"] = Image.VERSION
    except ImportError:
        try:
            import Image
            versions["PIL"] = Image.VERSION
        except ImportError:
            versions["PIL"] = "Not found!"

    #PLY
    try:
        from ply import lex
        versions["PLY"] = lex.__version__
    except ImportError:
        versions["PLY"] = "Not found!"

    return versions
项目:sdining    作者:Lurance    | 项目源码 | 文件源码
def get_version(svn=False):
    "Return the version as a human-format string."
    return '.'.join([str(i) for i in VERSION])
项目:cetusshop    作者:icetusorg    | 项目源码 | 文件源码
def get_version(svn=False):
    "Returns the version as a human-format string."
    return '.'.join([str(i) for i in VERSION])
项目:CNCGToolKit    作者:cineuse    | 项目源码 | 文件源码
def versions():
    import sys
    return (
        VERSION, core.littlecms_version, sys.version.split()[0], Image.VERSION
        )

# --------------------------------------------------------------------
项目:InstagramPosting    作者:LeviParadis    | 项目源码 | 文件源码
def versions():
    import sys
    return (
        VERSION, core.littlecms_version, sys.version.split()[0], Image.VERSION
        )

# --------------------------------------------------------------------