How to use the groupy.pagers.MessageList function in groupy

To help you get started, we’ve selected a few groupy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rhgrant10 / Groupy / tests / test_pagers.py View on Github external
def setUp(self):
        self.m_manager = mock.Mock()
        self.m_endpoint = mock.Mock()
        pages = [
            [mock.Mock(id='foo'), mock.Mock(id='bar')],
            [mock.Mock(id='baz'), mock.Mock(id='qux')],
        ]
        self.m_endpoint.side_effect = pages
        self.messages = pagers.MessageList(self.m_manager, self.m_endpoint)
github rhgrant10 / Groupy / groupy / api / messages.py View on Github external
def list(self, before_id=None, since_id=None, **kwargs):
        """Return a page of direct messages.

        The messages come in reversed order (newest first). Note you can only
        provide _one_ of ``before_id``, ``since_id``.

        :param str before_id: message ID for paging backwards
        :param str since_id: message ID for most recent messages since
        :return: direct messages
        :rtype: :class:`~groupy.pagers.MessageList`
        """
        return pagers.MessageList(self, self._raw_list, before_id=before_id,
                                  since_id=since_id, **kwargs)
github rhgrant10 / Groupy / groupy / managers.py View on Github external
def list(self, **params):
        return pagers.MessageList(self, **params)