Exemple #1
0
    def content(self):
        """
        Read the entire body all at once, per :func:`treq.content()`.

        :returns: A `Deferred` that fires with a `bytes` object when the entire
            body has been received.
        """
        return content(self.original)
Exemple #2
0
    def content(self):
        """
        Read the entire body all at once, per :func:`treq.content()`.

        :returns: A `Deferred` that fires with a `bytes` object when the entire
            body has been received.
        """
        return content(self.original)
    def _fetch_json_body_result(self, resp):
        """
        Here will I arrive when fetching the json information has been
        successful and the body needs to be retrieved. treq.text_content does
        that for us, that has to do with the API of Agents.
        """
        if resp is False or resp is None: # deal with 304 oder 404
            return resp

        self._update_header_dict(resp)

        d = content(resp)
        return d
Exemple #4
0
    def _retrieve_headers(self, resp):
        """
        The body has received, putting us finally in control of what happens
        to a piece of 4chan content. Ideas for now involve storing the content
        in the self.subdir of thread_dir under the original filename, symlinked
        prinl self.thread_dir

        to thread_dir in the timestamp.ext and telling the BurstHandler that
        we're done with our one piece of content.
        """
        if resp.code == 404:
            """
            Here we will need to do something clever with the BurstHandler
            passed to this object in case we have had a bad day.
            """

        d = content(resp)
        return d
Exemple #5
0
 def content(self):
     return content(self.original)
Exemple #6
0
 def content(self):
     return content(self.original)