Пример #1
0
    def get_app(self):
        """
        Returns the relayr application of the API client.

        :rtype: A :py:class:`relayr.resources.App` object.
        """
        info = self.api.get_oauth2_app_info()
        app = App(info['id'], client=self)
        app.get_info()
        return app
Пример #2
0
    def get_public_apps(self):
        """
        Returns a generator for all apps on the relayr platform.

        A generator is returned since the called API method always
        returns the entire results list and not a paginated one.


        :rtype: A generator for :py:class:`relayr.resources.App` objects.

        .. code-block:: python

            c = Client(token='...')
            apps = c.get_public_apps()
            for app in apps:
                print('%s %s' % (app.id, app.name))
        """

        for app in self.api.get_public_apps():
            a = App(app['id'], client=self)
            a.get_info()
            yield a