Skip to content

Commit

Permalink
Add functionality to retrieve a Label object
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrington22 committed Jan 12, 2016
1 parent b78b5fd commit 2519f24
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions trello/trelloclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from trello.member import Member
from trello.webhook import WebHook
from trello.exceptions import *
from trello.label import Label

try:
# PyOpenSSL works around some issues in python ssl modules
Expand Down Expand Up @@ -145,6 +146,17 @@ def get_card(self, card_id):
board = self.get_board(card_json['idBoard'])
return Card.from_json(List.from_json(board, list_json), card_json)

def get_label(self, label_id, board_id):
'''Get Label
Requires the parent board id the label is on
:rtype: Label
'''
board = self.get_board(board_id)
label_json = self.fetch_json('/labels/' + label_id)
return Label.from_json(board, label_json)

def fetch_json(
self,
uri_path,
Expand Down

0 comments on commit 2519f24

Please sign in to comment.