[Tutorial][Trello] Doing everything.

One thing I was taught was helpful was a do_everything method. I can feed in a board to act as a template for it to construct all the things I want.

It will take all the lists and make them boards, add labels to boards, add lists to boards, add cards to the lists on the new boards, and add labels to those cards.

The great thing is that I just call these functions. As long as I maintain the inputs and outputs I can update or change them however I want and it won’t (hopefully) break things.

def do_everything(master_board):
    new_boards = convert_lists_to_boards(master_board, client)
    new_lists = create_lists_on_new_boards(new_boards)
    add_labels_to_boards(master_board, new_boards)
    new_cards = create_cards_on_new_lists(master_board, new_boards, new_lists)
    list_of_labeled_cards = add_labels_to_cards(new_boards)
    return(list_of_labeled_cards)

I call this for every test.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s