<commit_before>from .trello import TrelloCommand
import operations
import card_options

class TrelloNavigateCommand(TrelloCommand):
    def work(self, edit):
        self.show(BoardOperation, self.conn.me, self.show_lists)

    def show_lists(self, index):
        self.show(ListOperation, index, self.show_cards)

    def show_cards(self, index):
        self.show(CardOperation, index, self.show_card_options)

    def show(self, Operation, indexOrObject, callback):
        try:
            operation = Operation(self.last_operation.find(indexOrObject))
        except (AttributeError, TypeError):
            operation = Operation(indexOrObject)

        self.last_operation = operation
        self.show_quick_panel(operation.element_names(), callback)

    def show_card_options(self, index):
        card = self.last_operation.find(index)
        card_options = CardOptions(card)

        self.show_quick_panel(card_options.names(), card_options.execute)
<commit_msg>Simpler show method (removes try), fix imports<commit_after>from .trello import TrelloCommand
from .operations import *
from .card_options import CardOptions

class TrelloNavigateCommand(TrelloCommand):
    def work(self, edit):
        self.show(BoardOperation(self.conn.me), self.show_lists)

    def show_lists(self, index):
        self.show(ListOperation(self.last_trello_element(index)), self.show_cards)

    def show_cards(self, index):
        self.show(CardOperation(self.last_trello_element(index)), self.show_card_options)

    def last_trello_element(self, index):
        return self.last_operation.find(index)

    def show(self, operation, callback):
        self.last_operation = operation
        self.show_quick_panel(operation.element_names(), callback)

    def show_card_options(self, index):
        card = self.last_operation.find(index)
        card_options = CardOptions(card)

        self.show_quick_panel(card_options.names(), card_options.execute)

{'fraction_non_alphanumeric': 0.09477459016393443, 'fraction_numerical': 0.0, 'mean_word_length': 3.9318181818181817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2297265', 'n_tokens_mistral': 580, 'n_tokens_neox': 558, 'n_words': 110}