Exemplo n.º 1
0
    def helper(self, args):
        default_params = {'url': self.url, 'page': self.markup}

        helper_url = util.listings_endpoint('/helpers')
        merged = dict(default_params, **args)
        compressed = zlib.compress(environment.json_from_object(merged), 9)
        params = {'payload': compressed}
        resp = environment.json_from_url(helper_url, params=params)

        if type(resp) is dict:
            self.proc.insert(0, resp)
        elif type(resp) is list:
            resp.reverse()
            for c in resp:
                self.proc.insert(0, c)

        return resp
Exemplo n.º 2
0
    def helper(self, args):
        default_params = {
            'url':  self.url,
            'page': self.markup
        }

        helper_url = util.listings_endpoint('/helpers')
        merged     = dict(default_params, **args)
        compressed = zlib.compress(environment.json_from_object(merged), 9)
        params     = { 'payload': compressed }
        resp       = environment.json_from_url(helper_url, params = params)

        if type(resp) is dict:
            self.proc.insert(0, resp)
        elif type(resp) is list:
            resp.reverse()
            for c in resp:
                self.proc.insert(0, c)

        return resp
Exemplo n.º 3
0
    def helper(self, args):
        import zlib
        default_params = {
            'url':  self.url,
            'page': self.page
        }

        helper_url = util.listings_endpoint('/helpers')
        merged     = dict(default_params, **args)
        compressed = zlib.compress(self.environment.to_json(merged), 9)
        params     = { 'payload': compressed }
        resp       = self.environment.json(helper_url, **params)

        if type(resp) is dict:
            self.proc.insert(0, resp)
        elif type(resp) is list:
            resp.reverse()
            for c in resp:
                self.proc.insert(0, c)

        return resp