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


Python version.parse方法代码示例

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


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

示例1: parse_configuration

# 需要导入模块: from setuptools.extern.packaging import version [as 别名]
# 或者: from setuptools.extern.packaging.version import parse [as 别名]
def parse_configuration(
        distribution, command_options, ignore_option_errors=False):
    """Performs additional parsing of configuration options
    for a distribution.

    Returns a list of used option handlers.

    :param Distribution distribution:
    :param dict command_options:
    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.
    :rtype: list
    """
    options = ConfigOptionsHandler(
        distribution, command_options, ignore_option_errors)
    options.parse()

    meta = ConfigMetadataHandler(
        distribution.metadata, command_options, ignore_option_errors,
        distribution.package_dir)
    meta.parse()

    return meta, options 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:27,代码来源:config.py

示例2: _parse_dict

# 需要导入模块: from setuptools.extern.packaging import version [as 别名]
# 或者: from setuptools.extern.packaging.version import parse [as 别名]
def _parse_dict(cls, value):
        """Represents value as a dict.

        :param value:
        :rtype: dict
        """
        separator = '='
        result = {}
        for line in cls._parse_list(value):
            key, sep, val = line.partition(separator)
            if sep != separator:
                raise DistutilsOptionError(
                    'Unable to parse option value to dict: %s' % value)
            result[key.strip()] = val.strip()

        return result 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:18,代码来源:config.py

示例3: _get_parser_compound

# 需要导入模块: from setuptools.extern.packaging import version [as 别名]
# 或者: from setuptools.extern.packaging.version import parse [as 别名]
def _get_parser_compound(cls, *parse_methods):
        """Returns parser function to represents value as a list.

        Parses a value applying given methods one after another.

        :param parse_methods:
        :rtype: callable
        """
        def parse(value):
            parsed = value

            for method in parse_methods:
                parsed = method(parsed)

            return parsed

        return parse 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:19,代码来源:config.py

示例4: parse

# 需要导入模块: from setuptools.extern.packaging import version [as 别名]
# 或者: from setuptools.extern.packaging.version import parse [as 别名]
def parse(self):
        """Parses configuration file items from one
        or more related sections.

        """
        for section_name, section_options in self.sections.items():

            method_postfix = ''
            if section_name:  # [section.option] variant
                method_postfix = '_%s' % section_name

            section_parser_method = getattr(
                self,
                # Dots in section names are tranlsated into dunderscores.
                ('parse_section%s' % method_postfix).replace('.', '__'),
                None)

            if section_parser_method is None:
                raise DistutilsOptionError(
                    'Unsupported distribution option section: [%s.%s]' % (
                        self.section_prefix, section_name))

            section_parser_method(section_options) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:25,代码来源:config.py

示例5: parse

# 需要导入模块: from setuptools.extern.packaging import version [as 别名]
# 或者: from setuptools.extern.packaging.version import parse [as 别名]
def parse(self):
        """Parses configuration file items from one
        or more related sections.

        """
        for section_name, section_options in self.sections.items():

            method_postfix = ''
            if section_name:  # [section.option] variant
                method_postfix = '_%s' % section_name

            section_parser_method = getattr(
                self,
                # Dots in section names are translated into dunderscores.
                ('parse_section%s' % method_postfix).replace('.', '__'),
                None)

            if section_parser_method is None:
                raise DistutilsOptionError(
                    'Unsupported distribution option section: [%s.%s]' % (
                        self.section_prefix, section_name))

            section_parser_method(section_options) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:25,代码来源:config.py

示例6: parse_configuration

# 需要导入模块: from setuptools.extern.packaging import version [as 别名]
# 或者: from setuptools.extern.packaging.version import parse [as 别名]
def parse_configuration(
        distribution, command_options, ignore_option_errors=False):
    """Performs additional parsing of configuration options
    for a distribution.

    Returns a list of used option handlers.

    :param Distribution distribution:
    :param dict command_options:
    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.
    :rtype: list
    """
    options = ConfigOptionsHandler(
        distribution, command_options, ignore_option_errors)
    options.parse()

    meta = ConfigMetadataHandler(
        distribution.metadata, command_options, ignore_option_errors, distribution.package_dir)
    meta.parse()

    return meta, options 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:26,代码来源:config.py


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