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