我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用pip.commands.show.ShowCommand.name()。
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)
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
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)
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
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)