Python werkzeug.exceptions.HTTPException 模块,get_headers() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用werkzeug.exceptions.HTTPException.get_headers()

项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:zanph    作者:zanph    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:zanph    作者:zanph    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:zanph    作者:zanph    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.length is not None:
            headers.append(
                ('Content-Range', '%s */%d' % (self.units, self.length)))
        return headers
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.length is not None:
            headers.append(
                ('Content-Range', '%s */%d' % (self.units, self.length)))
        return headers
项目:harbour-sailfinder    作者:DylanVanAssche    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:harbour-sailfinder    作者:DylanVanAssche    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:harbour-sailfinder    作者:DylanVanAssche    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:harbour-sailfinder    作者:DylanVanAssche    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:harbour-sailfinder    作者:DylanVanAssche    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:Texty    作者:sarthfrey    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:Texty    作者:sarthfrey    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:Texty    作者:sarthfrey    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:arithmancer    作者:google    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:arithmancer    作者:google    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:arithmancer    作者:google    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:tesismometro    作者:joapaspe    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:tesismometro    作者:joapaspe    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:tesismometro    作者:joapaspe    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:RPoint    作者:george17-meet    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:RPoint    作者:george17-meet    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:RPoint    作者:george17-meet    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:RPoint    作者:george17-meet    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.length is not None:
            headers.append(
                ('Content-Range', '%s */%d' % (self.units, self.length)))
        return headers
项目:isni-reconcile    作者:cmh2166    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:isni-reconcile    作者:cmh2166    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:isni-reconcile    作者:cmh2166    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:oa_qian    作者:sunqb    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:oa_qian    作者:sunqb    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:oa_qian    作者:sunqb    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:RealtimePythonChat    作者:quangtqag    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:RealtimePythonChat    作者:quangtqag    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:RealtimePythonChat    作者:quangtqag    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:Indushell    作者:SecarmaLabs    | 项目源码 | 文件源码
def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]
项目:Indushell    作者:SecarmaLabs    | 项目源码 | 文件源码
def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)
项目:Indushell    作者:SecarmaLabs    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers
项目:Indushell    作者:SecarmaLabs    | 项目源码 | 文件源码
def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.length is not None:
            headers.append(
                ('Content-Range', '%s */%d' % (self.units, self.length)))
        return headers