Example #1
0
    def get_list(self, list_id):
        """Get list

        :rtype: List
        """
        obj = self.client.fetch_json('/lists/' + list_id)
        return List.from_json(board=self, json_obj=obj)
Example #2
0
    def get_list(self, list_id):
        """Get list

        :rtype: List
        """
        obj = self.client.fetch_json('/lists/' + list_id)
        return List.from_json(board=self, json_obj=obj)
Example #3
0
    def get_list(self, list_id):
        """Get list

        :rtype: List
        """
        list_json = self.fetch_json('/lists/' + list_id)
        board = self.get_board(list_json['idBoard'])
        return List.from_json(board, list_json)
    def get_list(self, list_id):
        """Get list

        :rtype: List
        """
        list_json = self.fetch_json('/lists/' + list_id)
        board = self.get_board(list_json['idBoard'])
        return List.from_json(board, list_json)
Example #5
0
    def get_card(self, card_id):
        '''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_card(self, card_id):
        """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)
Example #7
0
    def get_card(self, card_id):
        """Get card

        :rtype: Card
        """
        card_json = self.fetch_json('/cards/' + card_id, query_params={'customFieldItems': 'true'})
        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)
Example #8
0
    def get_lists(self, list_filter):
        """Get lists from filter

        :rtype: list of List
        """
        # error checking
        json_obj = self.client.fetch_json(
            '/boards/' + self.id + '/lists',
            query_params={'cards': 'none', 'filter': list_filter})
        return [List.from_json(board=self, json_obj=obj) for obj in json_obj]
Example #9
0
    def get_lists(self, list_filter):
        """Get lists from filter

        :rtype: list of List
        """
        # error checking
        json_obj = self.client.fetch_json(
            '/boards/' + self.id + '/lists',
            query_params={'cards': 'none', 'filter': list_filter})
        return [List.from_json(board=self, json_obj=obj) for obj in json_obj]
Example #10
0
    def add_list(self, name):
        """Add a list to this board

        :name: name for the list
        :return: the list
        :rtype: List
        """
        obj = self.client.fetch_json(
            '/lists',
            http_method='POST',
            post_args={'name': name, 'idBoard': self.id}, )
        return List.from_json(board=self, json_obj=obj)
Example #11
0
    def add_list(self, name):
        """Add a list to this board

        :name: name for the list
        :return: the list
        :rtype: List
        """
        obj = self.client.fetch_json(
            '/lists',
            http_method='POST',
            post_args={'name': name, 'idBoard': self.id}, )
        return List.from_json(board=self, json_obj=obj)
Example #12
0
	def add_list(self, name, pos=None):
		"""Add a list to this board

		:name: name for the list
		:pos: position of the list: "bottom", "top" or a positive number
		:return: the list
		:rtype: List
		"""
		arguments = {'name': name, 'idBoard': self.id}
		if pos:
			arguments["pos"] = pos
		obj = self.client.fetch_json(
				'/lists',
				http_method='POST',
				post_args=arguments, )
		return List.from_json(board=self, json_obj=obj)
Example #13
0
    def add_list(self, name, pos=None):
        """Add a list to this board

        :name: name for the list
        :pos: position of the list: "bottom", "top" or a positive number
        :return: the list
        :rtype: List
        """
        arguments = {'name': name, 'idBoard': self.id}
        if pos:
            arguments["pos"] = pos
        obj = self.client.fetch_json(
            '/lists',
            http_method='POST',
            post_args=arguments, )
        return List.from_json(board=self, json_obj=obj)
Example #14
0
from trello.board import Board
from trello.trellolist import List
from trello.label import Label

from . import enums as e

trello_client = TrelloClient(
    api_key='8c38f7619e8c0dbd0af427a6f145538f',
    api_secret='01d89258fa41a284468d9983eaec2a1f',
    token='46a437ceea33ce9c130d9ad4aea6bda1b7262225be966a858753d26f50bf4a8a',
    token_secret=
    '1af4d3041e6caa4165cfe1bace2115749db8d060d7e9dd67218a9e9667d0f8c3')

board = Board(client=trello_client, board_id=e.Board.INSTAGRAM.value)

list_complaints = List(board=board, list_id=e.List.COMPLAINTS.value)
list_on_progress = List(board=board, list_id=e.List.ON_PROGRESS.value)
list_done = List(board=board, list_id=e.List.DONE.value)

labels = {
    'transaksi': Label(trello_client, e.Label.TRANSAKSI.value, 'Transaksi'),
    'produk': Label(trello_client, e.Label.PRODUCT.value, 'Product'),
    'pengiriman': Label(trello_client, e.Label.PENGIRIMAN.value, 'Pengiriman'),
    'servis': Label(trello_client, e.Label.SERVICE.value, 'Service'),
    'pertanyaan': Label(trello_client, e.Label.PERTANYAAN.value, 'Pertanyaan'),
    'misuh': Label(trello_client, e.Label.MISUH.value, 'Misuh'),
    'lainnya': Label(trello_client, e.Label.LAINNYA.value, 'Lainnya')
}

from julid import settings as s
mongo_db = s.mongo_db