def gitignores(*args):
to_send = []
gitignore_list = list()
for arg in set(args):
if arg in gitignore_list:
to_send.append(arg)
elif __name__ == '__main__':
possibles = []
for gitignore in gitignore_list:
if Levenshtein.distance(gitignore, arg) == 1:
possibles.append(gitignore)
print('WARNING: {} is not in gitignore list.'.format(arg), file=sys.stderr, end='')
if possibles:
if len(possibles) == 1:
possible_string = possibles[0]
else:
possible_string = ', '.join(possibles[:-1]) + ' or ' + possibles[-1]
print(' Did you mean {}?'.format(possible_string), file=sys.stderr)
else:
print('', file=sys.stderr)
if not to_send:
return '\n'
text = _get_text_from_url('{}/{}'.format(API_URL, ','.join(to_send)))
return '\n'.join(text.split('\n')[2:])
评论列表
文章目录