本文整理匯總了Python中pip.commands.completion.CompletionCommand.name方法的典型用法代碼示例。如果您正苦於以下問題:Python CompletionCommand.name方法的具體用法?Python CompletionCommand.name怎麽用?Python CompletionCommand.name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pip.commands.completion.CompletionCommand
的用法示例。
在下文中一共展示了CompletionCommand.name方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_summaries
# 需要導入模塊: from pip.commands.completion import CompletionCommand [as 別名]
# 或者: from pip.commands.completion.CompletionCommand 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.completion import CompletionCommand [as 別名]
# 或者: from pip.commands.completion.CompletionCommand 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
示例3: get_summaries
# 需要導入模塊: from pip.commands.completion import CompletionCommand [as 別名]
# 或者: from pip.commands.completion.CompletionCommand import name [as 別名]
def get_summaries(ignore_hidden=True, ordered=True):
"""Yields sorted (command name, command summary) tuples."""
if ordered:
cmditems = _sort_commands(commands, commands_order)
else:
cmditems = commands.items()
for name, command_class in cmditems:
if ignore_hidden and command_class.hidden:
continue
yield (name, command_class.summary)
示例4: get_similar_commands
# 需要導入模塊: from pip.commands.completion import CompletionCommand [as 別名]
# 或者: from pip.commands.completion.CompletionCommand import name [as 別名]
def get_similar_commands(name):
"""Command name auto-correct."""
from difflib import get_close_matches
close_commands = get_close_matches(name, commands.keys())
if close_commands:
guess = close_commands[0]
else:
guess = False
return guess
示例5: get_summaries
# 需要導入模塊: from pip.commands.completion import CompletionCommand [as 別名]
# 或者: from pip.commands.completion.CompletionCommand import name [as 別名]
def get_summaries(ignore_hidden=True, 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:
if ignore_hidden and command_class.hidden:
continue
yield (name, command_class.summary)