
Ebc           @   s`  d  d l  m  Z  d  d l  m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m	 Z	 d d	 l m
 Z
 d d
 l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d e f d     YZ d e f d     YZ d S(   i(   t   datetime(   t	   timedeltai   (   t   string_types(   t   CallbackDict(   t   dump_age(   t   dump_csp_header(   t   dump_header(   t   dump_options_header(   t	   http_date(   t	   parse_age(   t   parse_csp_header(   t
   parse_date(   t   parse_options_header(   t   parse_set_header(   t   cached_property(   t   environ_property(   t   get_content_type(   t   header_property(   t   get_content_lengtht   CommonRequestDescriptorsMixinc           B   s   e  Z d  Z e d d d Z e d    Z e d d d Z e d d d Z e d	 d d
 Z	 e d d e d d Z e d d e d d Z d   Z e d    Z e d    Z e d    Z RS(   s   A mixin for :class:`BaseRequest` subclasses.  Request objects that
    mix this class in will automatically get descriptors for a couple of
    HTTP headers with automatic type conversion.

    .. versionadded:: 0.5
    t   CONTENT_TYPEt   docs   The Content-Type entity-header field indicates the media
        type of the entity-body sent to the recipient or, in the case of
        the HEAD method, the media type that would have been sent had
        the request been a GET.c         C   s   t  |  j  S(   s   The Content-Length entity-header field indicates the size of the
        entity-body in bytes or, in the case of the HEAD method, the size of
        the entity-body that would have been sent had the request been a
        GET.
        (   R   t   environ(   t   self(    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt   content_length'   s    t   HTTP_CONTENT_ENCODINGs  The Content-Encoding entity-header field is used as a
        modifier to the media-type. When present, its value indicates
        what additional content codings have been applied to the
        entity-body, and thus what decoding mechanisms must be applied
        in order to obtain the media-type referenced by the Content-Type
        header field.

        .. versionadded:: 0.9t   HTTP_CONTENT_MD5s  The Content-MD5 entity-header field, as defined in
        RFC 1864, is an MD5 digest of the entity-body for the purpose of
        providing an end-to-end message integrity check (MIC) of the
        entity-body. (Note: a MIC is good for detecting accidental
        modification of the entity-body in transit, but is not proof
        against malicious attacks.)

        .. versionadded:: 0.9t   HTTP_REFERERs   The Referer[sic] request-header field allows the client
        to specify, for the server's benefit, the address (URI) of the
        resource from which the Request-URI was obtained (the
        "referrer", although the header field is misspelled).t	   HTTP_DATEs   The Date general-header field represents the date and
        time at which the message was originated, having the same
        semantics as orig-date in RFC 822.t   HTTP_MAX_FORWARDSs   The Max-Forwards request-header field provides a
        mechanism with the TRACE and OPTIONS methods to limit the number
        of proxies or gateways that can forward the request to the next
        inbound server.c         C   s4   t  |  d  s0 t |  j j d d   |  _ n  d  S(   Nt   _parsed_content_typeR   t    (   t   hasattrR   R   t   getR   (   R   (    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt   _parse_content_type_   s    c         C   s   |  j    |  j d j   S(   s   Like :attr:`content_type`, but without parameters (eg, without
        charset, type etc.) and always lowercase.  For example if the content
        type is ``text/HTML; charset=utf-8`` the mimetype would be
        ``'text/html'``.
        i    (   R"   R   t   lower(   R   (    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt   mimetypee   s    
c         C   s   |  j    |  j d S(   s   The mimetype parameters as dict.  For example if the content
        type is ``text/html; charset=utf-8`` the params would be
        ``{'charset': 'utf-8'}``.
        i   (   R"   R   (   R   (    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt   mimetype_paramso   s    
c         C   s   t  |  j j d d   S(   sj  The Pragma general-header field is used to include
        implementation-specific directives that might apply to any recipient
        along the request/response chain.  All pragma directives specify
        optional behavior from the viewpoint of the protocol; however, some
        systems MAY require that behavior be consistent with the directives.
        t   HTTP_PRAGMAR   (   R   R   R!   (   R   (    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt   pragmax   s    N(   t   __name__t
   __module__t   __doc__R   t   content_typeR   R   t   content_encodingt   content_md5t   referrert   NoneR   t   datet   intt   max_forwardsR"   t   propertyR$   R%   R'   (    (    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyR      s8   								
	t   CommonResponseDescriptorsMixinc           B   s  e  Z d  Z e d    Z e j d    Z e d    Z e d d d Z e d d& e
 e d d Z e d	 d d
 Z e d d& e e d d Z e d d d Z e d d d Z e d d d Z e d d& e e d d Z e d d& e e d d Z e d d& e e d d Z e d d& e e d d Z e d d& e e d d Z e d    Z e j d    Z d& d  Z e d  d d! Z e d" d d# Z  e d$ d d% Z! [ RS('   s   A mixin for :class:`BaseResponse` subclasses.  Response objects that
    mix this class in will automatically get descriptors for a couple of
    HTTP headers with automatic type conversion.
    c         C   s3   |  j  j d  } | r/ | j d  d j   Sd S(   s0   The mimetype (content type without charset etc.)s   content-typet   ;i    N(   t   headersR!   t   splitt   strip(   R   t   ct(    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyR$      s    c         C   s   t  | |  j  |  j d <d  S(   Ns   Content-Type(   R   t   charsetR6   (   R   t   value(    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyR$      s    c            s;     f d   } t    j j d d   d } t | |  S(   s   The mimetype parameters as dict. For example if the
        content type is ``text/html; charset=utf-8`` the params would be
        ``{'charset': 'utf-8'}``.

        .. versionadded:: 0.5
        c            s   t    j |     j d <d  S(   Ns   Content-Type(   R   R$   R6   (   t   d(   R   (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt	   on_update   s    s   content-typeR   i   (   R   R6   R!   R   (   R   R=   R<   (    (   R   s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyR%      s    	t   LocationR   s   The Location response-header field is used to redirect
        the recipient to a location other than the Request-URI for
        completion of the request or identification of a new
        resource.t   Ages  The Age response-header field conveys the sender's
        estimate of the amount of time since the response (or its
        revalidation) was generated at the origin server.

        Age values are non-negative decimal integers, representing time
        in seconds.s   Content-Types   The Content-Type entity-header field indicates the media
        type of the entity-body sent to the recipient or, in the case of
        the HEAD method, the media type that would have been sent had
        the request been a GET.s   Content-Lengths  The Content-Length entity-header field indicates the size
        of the entity-body, in decimal number of OCTETs, sent to the
        recipient or, in the case of the HEAD method, the size of the
        entity-body that would have been sent had the request been a
        GET.s   Content-Locations   The Content-Location entity-header field MAY be used to
        supply the resource location for the entity enclosed in the
        message when that entity is accessible from a location separate
        from the requested resource's URI.s   Content-Encodingsb  The Content-Encoding entity-header field is used as a
        modifier to the media-type. When present, its value indicates
        what additional content codings have been applied to the
        entity-body, and thus what decoding mechanisms must be applied
        in order to obtain the media-type referenced by the Content-Type
        header field.s   Content-MD5sl  The Content-MD5 entity-header field, as defined in
        RFC 1864, is an MD5 digest of the entity-body for the purpose of
        providing an end-to-end message integrity check (MIC) of the
        entity-body. (Note: a MIC is good for detecting accidental
        modification of the entity-body in transit, but is not proof
        against malicious attacks.)s   Content-Security-Policys   The Content-Security-Policy header adds an additional layer of
        security to help detect and mitigate certain types of attacks.s#   Content-Security-Policy-Report-Onlys   The Content-Security-Policy-Report-Only header adds a csp policy
        that is not enforced but is reported thereby helping detect
        certain types of attacks.t   Dates   The Date general-header field represents the date and
        time at which the message was originated, having the same
        semantics as orig-date in RFC 822.t   Expiress   The Expires entity-header field gives the date/time after
        which the response is considered stale. A stale cache entry may
        not normally be returned by a cache.s   Last-Modifieds   The Last-Modified entity-header field indicates the date
        and time at which the origin server believes the variant was
        last modified.c         C   sU   |  j  j d  } | d k r" d S| j   rK t j   t d t |   St |  S(   s   The Retry-After response-header field can be used with a
        503 (Service Unavailable) response to indicate how long the
        service is expected to be unavailable to the requesting client.

        Time in seconds until expiration or date.
        s   retry-afterNt   seconds(	   R6   R!   R/   t   isdigitR    t   utcnowR   R1   R   (   R   R;   (    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt   retry_after  s    c         C   sg   | d  k r, d |  j k r( |  j d =n  d  St | t  rJ t |  } n t |  } | |  j d <d  S(   Ns   retry-afters   Retry-After(   R/   R6   t
   isinstanceR    R   t   str(   R   R;   (    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyRE     s    c            s1     f d   }   f d   } t  | | d | S(   Nc            s+      f d   } t    j j   |  S(   Nc            sC   |  r#    j  k r#  j    =n |  r? |  j    j    <n  d  S(   N(   R6   t	   to_header(   t
   header_set(   t   nameR   (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyR=   +  s    (   R   R6   R!   (   R   R=   (   RJ   (   R   s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt   fget*  s    c            sI   | s |  j    =n2 t | t  r2 | |  j    <n t |  |  j    <d  S(   N(   R6   RF   R   R   (   R   R;   (   RJ   (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt   fset3  s
    R   (   R3   (   RJ   R   RK   RL   (    (   RJ   s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt   _set_property)  s    	t   Varys   The Vary field value indicates the set of request-header
        fields that fully determines, while the response is fresh,
        whether a cache is permitted to use the response to reply to a
        subsequent request without revalidation.s   Content-Languages   The Content-Language entity-header field describes the
        natural language(s) of the intended audience for the enclosed
        entity. Note that this might not be equivalent to all the
        languages used within the entity-body.t   AllowsR  The Allow entity-header field lists the set of methods
        supported by the resource identified by the Request-URI. The
        purpose of this field is strictly to inform the recipient of
        valid methods associated with the resource. An Allow header
        field MUST be present in a 405 (Method Not Allowed)
        response.N("   R(   R)   R*   R3   R$   t   setterR%   R   t   locationR/   R	   R   t   ageR+   R1   RG   R   t   content_locationR,   R-   R
   R   t   content_security_policyt#   content_security_policy_report_onlyR   R   R0   t   expirest   last_modifiedRE   RM   t   varyt   content_languaget   allow(    (    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyR4      s   															N(   R    R   t   _compatR   t   datastructuresR   t   httpR   R   R   R   R   R	   R
   R   R   R   t   utilsR   R   R   R   t   wsgiR   t   objectR   R4   (    (    (    s|   /var/www/html/facial-emotion-detection-webapp-main/flask/lib/python2.7/site-packages/werkzeug/wrappers/common_descriptors.pyt   <module>   s(   l