~mapperr/trl

cbed7f65b9e2d7df80a7a9a8a4779e5db1f415a1 — mapperr 2 years ago 201aa0f
Fix misbehaviour
3 files changed, 27 insertions(+), 25 deletions(-)

M trullo.py
M trullo/tclient.py
M trullo/usecases.py
M trullo.py => trullo.py +24 -23
@@ 85,10 85,25 @@ if __name__ == '__main__':

    selected_board_id, selected_board_name = usecases.get_selected_board()

    if args['g']:
        api_path = args['<api_path>']
        pp = pprint.PrettyPrinter(indent=4)
        pp.pprint(tclient.get(api_path))
    if args['c']:
        new_command = args['n']
        if new_command:
            target_list_shortcut = args['<list_shortcut>']
            usecases.create_card(target_list_shortcut)
        else:
            card_shortcut = args['<card_shortcut>']
            open_command = args['o']
            move_command = args['m']
            edit_command = args['e']
            if open_command:
                usecases.open_card_in_browser(card_shortcut)
            elif move_command:
                target_list_shortcut = args['<list_shortcut>']
                usecases.move_card(card_shortcut, target_list_shortcut)
            elif edit_command:
                usecases.update_card(card_shortcut)
            else:
                usecases.print_card(card_shortcut)

    elif args['o']:
        usecases.open_trello_in_browser()


@@ 115,22 130,8 @@ if __name__ == '__main__':
        list_shortcuts = args['<list_shortcuts>']
        usecases.print_lists(list_shortcuts)

    elif args['c']:
        new_command = args['n']
        if new_command:
            target_list_shortcut = args['<list_shortcut>']
            usecases.create_card(target_list_shortcut)
        else:
            card_shortcut = args['<card_shortcut>']
            open_command = args['o']
            move_command = args['m']
            edit_command = args['e']
            if open_command:
                usecases.open_card_in_browser(card_shortcut)
            elif move_command:
                target_list_shortcut = args['<list_shortcut>']
                usecases.move_card(card_shortcut, target_list_shortcut)
            elif edit_command:
                usecases.update_card(card_shortcut)
            else:
                usecases.print_card(card_shortcut)
    elif args['g']:
        api_path = args['<api_path>']
        pp = pprint.PrettyPrinter(indent=4)
        pp.pprint(tclient.get(api_path))


M trullo/tclient.py => trullo/tclient.py +1 -1
@@ 56,7 56,7 @@ class TClient:
                    lists = self._extract_lists(v)
            if not board_closed:
                boards.append(
                    TrlBoard(board_id, raw_board['shortLink'], lists, [],
                    TrlBoard(board_id, raw_board['shortLink'], lists, [], [],
                             raw_board))
        return boards


M trullo/usecases.py => trullo/usecases.py +2 -1
@@ 196,4 196,5 @@ class Usecases:
    def print_board_labels(self):
        board = self.tclient.get_board(self.selected_board_id)
        for label in board.labels:
            print('{:12} {}'.format(label.color, label.name))
            print('[{}]   {:10} {}'.format(
                label.id[-6:len(label.id)], label.color, label.name))