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


Python compat.basestring方法代码示例

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


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

示例1: finalize_options

# 需要导入模块: from setuptools import compat [as 别名]
# 或者: from setuptools.compat import basestring [as 别名]
def finalize_options(self):
        if self.match is None:
            raise DistutilsOptionError(
                "Must specify one or more (comma-separated) match patterns "
                "(e.g. '.zip' or '.egg')"
            )
        if self.keep is None:
            raise DistutilsOptionError("Must specify number of files to keep")           
        try:
            self.keep = int(self.keep)
        except ValueError:
            raise DistutilsOptionError("--keep must be an integer")
        if isinstance(self.match, basestring):
            self.match = [
                convert_path(p.strip()) for p in self.match.split(',')
            ]
        self.set_undefined_options('bdist',('dist_dir', 'dist_dir')) 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:19,代码来源:rotate.py

示例2: finalize_options

# 需要导入模块: from setuptools import compat [as 别名]
# 或者: from setuptools.compat import basestring [as 别名]
def finalize_options(self):
        if self.match is None:
            raise DistutilsOptionError(
                "Must specify one or more (comma-separated) match patterns "
                "(e.g. '.zip' or '.egg')"
            )
        if self.keep is None:
            raise DistutilsOptionError("Must specify number of files to keep")
        try:
            self.keep = int(self.keep)
        except ValueError:
            raise DistutilsOptionError("--keep must be an integer")
        if isinstance(self.match, basestring):
            self.match = [
                convert_path(p.strip()) for p in self.match.split(',')
            ]
        self.set_undefined_options('bdist', ('dist_dir', 'dist_dir')) 
开发者ID:DirceuSilvaLabs,项目名称:noc-orchestrator,代码行数:19,代码来源:rotate.py

示例3: check_test_suite

# 需要导入模块: from setuptools import compat [as 别名]
# 或者: from setuptools.compat import basestring [as 别名]
def check_test_suite(dist, attr, value):
    if not isinstance(value,basestring):
        raise DistutilsSetupError("test_suite must be a string") 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:5,代码来源:dist.py

示例4: iter_symbols

# 需要导入模块: from setuptools import compat [as 别名]
# 或者: from setuptools.compat import basestring [as 别名]
def iter_symbols(code):
    """Yield names and strings used by `code` and its nested code objects"""
    for name in code.co_names: yield name
    for const in code.co_consts:
        if isinstance(const,basestring):
            yield const
        elif isinstance(const,CodeType):
            for name in iter_symbols(const):
                yield name 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:11,代码来源:bdist_egg.py

示例5: write_entries

# 需要导入模块: from setuptools import compat [as 别名]
# 或者: from setuptools.compat import basestring [as 别名]
def write_entries(cmd, basename, filename):
    ep = cmd.distribution.entry_points

    if isinstance(ep,basestring) or ep is None:
        data = ep
    elif ep is not None:
        data = []
        for section, contents in ep.items():
            if not isinstance(contents,basestring):
                contents = EntryPoint.parse_group(section, contents)
                contents = '\n'.join(map(str,contents.values()))
            data.append('[%s]\n%s\n\n' % (section,contents))
        data = ''.join(data)

    cmd.write_or_delete_file('entry points', filename, data, True) 
开发者ID:sugarguo,项目名称:Flask_Blog,代码行数:17,代码来源:egg_info.py

示例6: iter_symbols

# 需要导入模块: from setuptools import compat [as 别名]
# 或者: from setuptools.compat import basestring [as 别名]
def iter_symbols(code):
    """Yield names and strings used by `code` and its nested code objects"""
    for name in code.co_names:
        yield name
    for const in code.co_consts:
        if isinstance(const, basestring):
            yield const
        elif isinstance(const, CodeType):
            for name in iter_symbols(const):
                yield name 
开发者ID:DirceuSilvaLabs,项目名称:noc-orchestrator,代码行数:12,代码来源:bdist_egg.py

示例7: write_entries

# 需要导入模块: from setuptools import compat [as 别名]
# 或者: from setuptools.compat import basestring [as 别名]
def write_entries(cmd, basename, filename):
    ep = cmd.distribution.entry_points

    if isinstance(ep, basestring) or ep is None:
        data = ep
    elif ep is not None:
        data = []
        for section, contents in sorted(ep.items()):
            if not isinstance(contents, basestring):
                contents = EntryPoint.parse_group(section, contents)
                contents = '\n'.join(sorted(map(str, contents.values())))
            data.append('[%s]\n%s\n\n' % (section, contents))
        data = ''.join(data)

    cmd.write_or_delete_file('entry points', filename, data, True) 
开发者ID:DirceuSilvaLabs,项目名称:noc-orchestrator,代码行数:17,代码来源:egg_info.py


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