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


Python exceptions.CommandError方法代码示例

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


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

示例1: check_required_packages

# 需要导入模块: from pip import exceptions [as 别名]
# 或者: from pip.exceptions import CommandError [as 别名]
def check_required_packages(self):
        import_or_raise(
            'wheel.bdist_wheel',
            CommandError,
            "'pip wheel' requires the 'wheel' package. To fix this, run: "
            "pip install wheel"
        )
        pkg_resources = import_or_raise(
            'pkg_resources',
            CommandError,
            "'pip wheel' requires setuptools >= 0.8 for dist-info support."
            " To fix this, run: pip install --upgrade setuptools"
        )
        if not hasattr(pkg_resources, 'DistInfoDistribution'):
            raise CommandError(
                "'pip wheel' requires setuptools >= 0.8 for dist-info "
                "support. To fix this, run: pip install --upgrade "
                "setuptools"
            ) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:21,代码来源:wheel.py

示例2: run

# 需要导入模块: from pip import exceptions [as 别名]
# 或者: from pip.exceptions import CommandError [as 别名]
def run(self, options, args):
        from pip.commands import commands_dict, get_similar_commands

        try:
            # 'pip help' with no args is handled by pip.__init__.parseopt()
            cmd_name = args[0]  # the command we need help for
        except IndexError:
            return SUCCESS

        if cmd_name not in commands_dict:
            guess = get_similar_commands(cmd_name)

            msg = ['unknown command "%s"' % cmd_name]
            if guess:
                msg.append('maybe you meant "%s"' % guess)

            raise CommandError(' - '.join(msg))

        command = commands_dict[cmd_name]()
        command.parser.print_help()

        return SUCCESS 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:24,代码来源:help.py

示例3: run

# 需要导入模块: from pip import exceptions [as 别名]
# 或者: from pip.exceptions import CommandError [as 别名]
def run(self, options, args):
        from pip.commands import commands, get_similar_commands

        try:
            # 'pip help' with no args is handled by pip.__init__.parseopt()
            cmd_name = args[0]  # the command we need help for
        except IndexError:
            return SUCCESS

        if cmd_name not in commands:
            guess = get_similar_commands(cmd_name)

            msg = ['unknown command "%s"' % cmd_name]
            if guess:
                msg.append('maybe you meant "%s"' % guess)

            raise CommandError(' - '.join(msg))

        command = commands[cmd_name]()
        command.parser.print_help()

        return SUCCESS 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:24,代码来源:help.py

示例4: run

# 需要导入模块: from pip import exceptions [as 别名]
# 或者: from pip.exceptions import CommandError [as 别名]
def run(self, options, args):
        if not args:
            raise CommandError('Missing required argument (search query).')
        query = args
        index_url = options.index

        pypi_hits = self.search(query, index_url)
        hits = transform_hits(pypi_hits)

        terminal_width = None
        if sys.stdout.isatty():
            terminal_width = get_terminal_size()[0]

        print_results(hits, terminal_width=terminal_width)
        if pypi_hits:
            return SUCCESS
        return NO_MATCHES_FOUND 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:19,代码来源:search.py


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