コード例 #1
0
ファイル: response.py プロジェクト: lowks/horsemeat
    def body(self, val):

        """
        If the body isn't wrapped in a list, I'll wrap it in a list.
        """

        self._body = clepy.listmofize(val)
コード例 #2
0
ファイル: response.py プロジェクト: 216software/horsemeat
    def body_python3(self, val):

        """
        If the body isn't wrapped in a list, I'll wrap it in a list.

        (Only if it's not a file wrapper)
        """

        from gunicorn.http.wsgi import FileWrapper

        if isinstance(val, FileWrapper):
            self._body = val

        # Remember that in python 3, unicode stuff is just a string.
        elif isinstance(val, str):
            self._body = clepy.listmofize(bytes(val, "utf-8"))

        else:
            self._body = clepy.listmofize(val)
コード例 #3
0
ファイル: response.py プロジェクト: bormesh/budgetbot
    def body(self, val):

        """
        If the body isn't wrapped in a list, I'll wrap it in a list.

        (Only if it's not a file wrapper)
        """

        from gunicorn.http.wsgi import FileWrapper

        if not isinstance(val, FileWrapper):
            self._body = clepy.listmofize(val)
        else:
            self._body = val
コード例 #4
0
ファイル: response.py プロジェクト: 216software/horsemeat
    def body_python2(self, val):

        """
        This is the body setter for python 2.

        If the body isn't wrapped in a list, I'll wrap it in a list, but
        only if the data is not a file wrapper!
        """

        from gunicorn.http.wsgi import FileWrapper

        if not isinstance(val, FileWrapper):
            self._body = clepy.listmofize(val)
        else:
            self._body = val