コード例 #1
0
ファイル: response.py プロジェクト: toby2o12/pythontest
    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)
コード例 #2
0
ファイル: response.py プロジェクト: jameshilliard/treq
    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)
コード例 #3
0
    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
コード例 #4
0
ファイル: content.py プロジェクト: luceatnobis/chan_archiver
    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
コード例 #5
0
ファイル: response.py プロジェクト: shyba/treq
 def content(self):
     return content(self.original)
コード例 #6
0
ファイル: response.py プロジェクト: andrew-plunk/treq
 def content(self):
     return content(self.original)