diff --git a/.gitignore b/.gitignore index dab83450..49616bc9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ dist .project .pydevproject .idea/ +.tox/ diff --git a/trello/board.py b/trello/board.py index 75199991..386cda1e 100644 --- a/trello/board.py +++ b/trello/board.py @@ -97,39 +97,39 @@ def open(self): self.closed = False def get_list(self, list_id): - '''Get list + """Get list :rtype: List - ''' + """ obj = self.client.fetch_json('/lists/' + list_id) return List.from_json(board=self, json_obj=obj) def all_lists(self): """Returns all lists on this board - :rtype: List + :rtype: list of List """ return self.get_lists('all') def open_lists(self): """Returns all open lists on this board - :rtype: List + :rtype: list of List """ return self.get_lists('open') def closed_lists(self): """Returns all closed lists on this board - :rtype: List + :rtype: list of List """ return self.get_lists('closed') def get_lists(self, list_filter): - '''Get lists from filter + """Get lists from filter - :rtype: List - ''' + :rtype: list of List + """ # error checking json_obj = self.client.fetch_json( '/boards/' + self.id + '/lists', @@ -137,20 +137,20 @@ def get_lists(self, list_filter): return [List.from_json(board=self, json_obj=obj) for obj in json_obj] def get_labels(self, fields='all', limit=50): - '''Get label + """Get label - :rtype: Label - ''' + :rtype: list of Label + """ json_obj = self.client.fetch_json( '/boards/' + self.id + '/labels', query_params={'fields': fields, 'limit': limit}) return Label.from_json_list(self, json_obj) def get_checklists(self, cards='all'): - '''Get checklists + """Get checklists - :rtype: Checklist - ''' + :rtype: list of Checklist + """ checklists = [] json_obj = self.client.fetch_json( '/boards/' + self.id + '/checklists', @@ -192,7 +192,7 @@ def add_label(self, name, color): def all_cards(self): """Returns all cards on this board - :rtype: Card + :rtype: list of Card """ filters = { 'filter': 'all', @@ -203,7 +203,7 @@ def all_cards(self): def open_cards(self): """Returns all open cards on this board - :rtype: Card + :rtype: list of Card """ filters = { 'filter': 'open', @@ -214,7 +214,7 @@ def open_cards(self): def closed_cards(self): """Returns all closed cards on this board - :rtype: Card + :rtype: list of Card """ filters = { 'filter': 'closed', @@ -230,7 +230,7 @@ def get_cards(self, filters=None, card_filter=""): More info on card queries: https://trello.com/docs/api/board/index.html#get-1-boards-board-id-cards - :rtype: Card + :rtype: list of Card """ json_obj = self.client.fetch_json( '/boards/' + self.id + '/cards/' + card_filter, @@ -242,7 +242,7 @@ def get_cards(self, filters=None, card_filter=""): def all_members(self): """Returns all members on this board - :rtype: Member + :rtype: list of Member """ filters = { 'filter': 'all', @@ -253,7 +253,7 @@ def all_members(self): def normal_members(self): """Returns all normal members on this board - :rtype: Member + :rtype: list of Member """ filters = { 'filter': 'normal', @@ -264,7 +264,7 @@ def normal_members(self): def admin_members(self): """Returns all admin members on this board - :rtype: Member + :rtype: list of Member """ filters = { 'filter': 'admins', @@ -275,7 +275,7 @@ def admin_members(self): def owner_members(self): """Returns all owner members on this board - :rtype: Member + :rtype: list of Member """ filters = { 'filter': 'owners', @@ -286,7 +286,7 @@ def owner_members(self): def get_members(self, filters=None): """Get members with filter - :rtype: Member + :rtype: list of Member """ json_obj = self.client.fetch_json( '/boards/' + self.id + '/members', diff --git a/trello/organization.py b/trello/organization.py index b75b6798..29aeeb2e 100644 --- a/trello/organization.py +++ b/trello/organization.py @@ -46,10 +46,10 @@ def all_boards(self): return self.get_boards('all') def get_boards(self, list_filter): - '''Get boards using filter + """Get boards using filter - :rtype: Board - ''' + :rtype: list of Board + """ # error checking json_obj = self.client.fetch_json( '/organizations/' + self.id + '/boards', @@ -57,10 +57,10 @@ def get_boards(self, list_filter): return [Board.from_json(organization=self, json_obj=obj) for obj in json_obj] def get_board(self, field_name): - '''Get board + """Get board - :rtype: Board - ''' + :rtype: list of Board + """ # error checking json_obj = self.client.fetch_json( '/organizations/' + self.id + '/boards', diff --git a/trello/trelloclient.py b/trello/trelloclient.py index 4aa47ac2..4d18cf64 100644 --- a/trello/trelloclient.py +++ b/trello/trelloclient.py @@ -72,7 +72,7 @@ def list_boards(self, board_filter="all"): Returns all boards for your Trello user :return: a list of Python objects representing the Trello boards. - :rtype: Board + :rtype: list of Board Each board has the following noteworthy attributes: - id: the board's identifier @@ -90,7 +90,7 @@ def list_organizations(self): Returns all organizations for your Trello user :return: a list of Python objects representing the Trello organizations. - :rtype: Organization + :rtype: list of Organization Each organization has the following noteworthy attributes: - id: the organization's identifier @@ -104,28 +104,28 @@ def list_organizations(self): return [Organization.from_json(self, obj) for obj in json_obj] def get_organization(self, organization_id): - '''Get organization + """Get organization :rtype: Organization - ''' + """ obj = self.fetch_json('/organizations/' + organization_id) return Organization.from_json(self, obj) def get_board(self, board_id): - '''Get board + """Get board :rtype: Board - ''' + """ obj = self.fetch_json('/boards/' + board_id) return Board.from_json(self, json_obj=obj) def add_board(self, board_name, source_board=None, organization_id=None): - '''Create board + """Create board :param board_name: Name of the board to create :param source_board: Optional Board to copy :rtype: Board - ''' + """ post_args={'name': board_name} if source_board is not None: post_args['idBoardSource'] = source_board.id @@ -137,29 +137,29 @@ def add_board(self, board_name, source_board=None, organization_id=None): return Board.from_json(self, json_obj=obj) def get_member(self, member_id): - '''Get member + """Get member :rtype: Member - ''' + """ return Member(self, member_id).fetch() def get_card(self, card_id): - '''Get card + """Get card :rtype: Card - ''' + """ card_json = self.fetch_json('/cards/' + card_id) list_json = self.fetch_json('/lists/' + card_json['idList']) 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 + """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)