From 2519f2460fc63a6e263cef86c5be8d3034eed219 Mon Sep 17 00:00:00 2001 From: jharrington22 Date: Tue, 12 Jan 2016 18:00:49 +1100 Subject: [PATCH] Add functionality to retrieve a Label object --- trello/trelloclient.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/trello/trelloclient.py b/trello/trelloclient.py index 43dd7142..217e4732 100644 --- a/trello/trelloclient.py +++ b/trello/trelloclient.py @@ -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 @@ -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,