Completed
Pull Request — master (#340)
by Arma
03:46
created

AddCardAction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %
Metric Value
dl 0
loc 13
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A CloseListAction.run() 0 8 2
1
from lib import action
2
3
4
class AddCardAction(action.BaseAction):
5
    def run(self, name, board_id, list_id, description=None, api_key=None, token=None):
6
        if api_key:
7
            self._set_creds(api_key=api_key, token=token)
8
9
        board = self._client().get_board(board_id)
10
        lst = board.get_list(list_id)
11
        card = lst.add_card(name=name, desc=description)
12
13
        if card:
14
            return card.id
15
        else:
16
            return False
17