How to use the groupy.pagers 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 / api / test_chats.py View on Github external
def test_results_is_a_ChatList(self):
        self.assertTrue(isinstance(self.results, pagers.ChatList))
github rhgrant10 / Groupy / tests / test_pagers.py View on Github external
def test_since_mode(self):
        mode = pagers.MessageList.detect_mode(since_id='x')
        self.assertEqual(mode, 'since_id')
github rhgrant10 / Groupy / groupy / api / messages.py View on Github external
def list(self, before_id=None, since_id=None, after_id=None, limit=20):
        """Return a page of group messages.

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

        :param str before_id: message ID for paging backwards
        :param str after_id: message ID for paging forwards
        :param str since_id: message ID for most recent messages since
        :param int limit: maximum number of messages per page
        :return: group messages
        :rtype: :class:`~groupy.pagers.MessageList`
        """
        return pagers.MessageList(self, self._raw_list, before_id=before_id,
                                  after_id=after_id, since_id=since_id,
                                  limit=limit)
github rhgrant10 / Groupy / groupy / managers.py View on Github external
def list(self, **params):
        return pagers.MessageList(self, **params)
github rhgrant10 / Groupy / groupy / api / messages.py View on Github external
def list(self, before=None, since=None, after=None, limit=100):
        before = self._convert_to_rfc3339(before)
        since = self._convert_to_rfc3339(since)
        after = self._convert_to_rfc3339(after)
        return pagers.GalleryList(self, self._raw_list, before=before,
                                  since=since, after=after, limit=limit)
github rhgrant10 / Groupy / groupy / api / chats.py View on Github external
def list(self, page=1, per_page=10):
        """List a page of chats.

        :param int page: which page
        :param int per_page: how many chats per page
        :return: chats with other users
        :rtype: :class:`~groupy.pagers.ChatList`
        """
        return pagers.ChatList(self, self._raw_list, per_page=per_page,
                               page=page)