本文整理汇总了Python中pip.commands.download.DownloadCommand.name方法的典型用法代码示例。如果您正苦于以下问题:Python DownloadCommand.name方法的具体用法?Python DownloadCommand.name怎么用?Python DownloadCommand.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pip.commands.download.DownloadCommand
的用法示例。
在下文中一共展示了DownloadCommand.name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_summaries
# 需要导入模块: from pip.commands.download import DownloadCommand [as 别名]
# 或者: from pip.commands.download.DownloadCommand import name [as 别名]
def get_summaries(ordered=True):
"""Yields sorted (command name, command summary) tuples."""
if ordered:
cmditems = _sort_commands(commands_dict, commands_order)
else:
cmditems = commands_dict.items()
for name, command_class in cmditems:
yield (name, command_class.summary)
示例2: get_similar_commands
# 需要导入模块: from pip.commands.download import DownloadCommand [as 别名]
# 或者: from pip.commands.download.DownloadCommand import name [as 别名]
def get_similar_commands(name):
"""Command name auto-correct."""
from difflib import get_close_matches
name = name.lower()
close_commands = get_close_matches(name, commands_dict.keys())
if close_commands:
return close_commands[0]
else:
return False