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


Python errors.DistutilsArgError方法代码示例

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


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

示例1: parse_distutils_args

# 需要导入模块: from distutils import errors [as 别名]
# 或者: from distutils.errors import DistutilsArgError [as 别名]
def parse_distutils_args(args):
    # type: (List[str]) -> Dict[str, str]
    """Parse provided arguments, returning an object that has the
    matched arguments.

    Any unknown arguments are ignored.
    """
    result = {}
    for arg in args:
        try:
            _, match = _distutils_getopt.getopt(args=[arg])
        except DistutilsArgError:
            # We don't care about any other options, which here may be
            # considered unrecognized since our option list is not
            # exhaustive.
            pass
        else:
            result.update(match.__dict__)
    return result 
开发者ID:pantsbuild,项目名称:pex,代码行数:21,代码来源:distutils_args.py

示例2: finalize_options

# 需要导入模块: from distutils import errors [as 别名]
# 或者: from distutils.errors import DistutilsArgError [as 别名]
def finalize_options(self):
        orig.install.finalize_options(self)
        if self.root:
            self.single_version_externally_managed = True
        elif self.single_version_externally_managed:
            if not self.root and not self.record:
                raise DistutilsArgError(
                    "You must specify --record or --root when building system"
                    " packages"
                ) 
开发者ID:jpush,项目名称:jbox,代码行数:12,代码来源:install.py

示例3: getopt

# 需要导入模块: from distutils import errors [as 别名]
# 或者: from distutils.errors import DistutilsArgError [as 别名]
def getopt (self, args=None, object=None):
        """Parse command-line options in args. Store as attributes on object.

        If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
        'object' is None or not supplied, creates a new OptionDummy
        object, stores option values there, and returns a tuple (args,
        object).  If 'object' is supplied, it is modified in place and
        'getopt()' just returns 'args'; in both cases, the returned
        'args' is a modified copy of the passed-in 'args' list, which
        is left untouched.
        """
        if args is None:
            args = sys.argv[1:]
        if object is None:
            object = OptionDummy()
            created_object = 1
        else:
            created_object = 0

        self._grok_option_table()

        short_opts = string.join(self.short_opts)
        try:
            opts, args = getopt.getopt(args, short_opts, self.long_opts)
        except getopt.error, msg:
            raise DistutilsArgError, msg 
开发者ID:glmcdona,项目名称:meddle,代码行数:28,代码来源:fancy_getopt.py


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