本文整理匯總了Python中trello.label.Label.from_json方法的典型用法代碼示例。如果您正苦於以下問題:Python Label.from_json方法的具體用法?Python Label.from_json怎麽用?Python Label.from_json使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類trello.label.Label
的用法示例。
在下文中一共展示了Label.from_json方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_label
# 需要導入模塊: from trello.label import Label [as 別名]
# 或者: from trello.label.Label import from_json [as 別名]
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)
示例2: add_label
# 需要導入模塊: from trello.label import Label [as 別名]
# 或者: from trello.label.Label import from_json [as 別名]
def add_label(self, name, color):
"""Add a label to this board
:name: name of the label
:color: the color, either green, yellow, orange
red, purple, blue, sky, lime, pink, or black
:return: the label
:rtype: Label
"""
obj = self.client.fetch_json(
'/labels',
http_method='POST',
post_args={'name': name, 'idBoard': self.id, 'color': color},)
return Label.from_json(board=self, json_obj=obj)