def get_card_name_and_id(card_query): cards = trello_update.get_cards() match = choose(unicode(card_query), [unicode(name) for name, id_ in cards]) if match is None: return None, None return [(name, id_) for (name, id_) in cards if name == match][0]
def print_card_completions(s): cards = trello_update.get_cards() m = suggestions(unicode(s), [n for n, _id in cards]) for x in m: print x