ó
Xé?_c        
   @   sÿ  d  Z  d d l Z d d l Z d d l m Z d d l Z d d l m Z m Z d d l	 m
 Z d d l	 m Z e e d „ Z d „  Z d e d	 „ Z d d
 d d e d „ Z d& e d „ Z d e d „ Z e e _ e e d d e d „ Z d e f d „  ƒ  YZ d „  Z d d j g  e e ƒ D]7 Z e j d ƒ s#d e e e  e e ƒ ƒ j! f ^ q#ƒ e _  e j" e d „ Z# e d „ Z$ e d „ Z% d e e d „ Z& e e d e d  „ Z' e d! „ Z( d e d" „ Z) d# e j* f d$ „  ƒ  YZ+ d e d% „ Z, d S('   s%   Functions for builtin CherryPy tools.iÿÿÿÿN(   t   md5(   t
   basestringt
   unicodestr(   t   httputil(   t   is_iteratorc   
      C   sÌ  t  j j } t | d ƒ r d St j | j ƒ \ } } } | j j d ƒ } | rr | rt  j	 d | d ƒ qn– |  s” | rt  j	 d d ƒ qnt | d k r¼ | rt  j	 d d ƒ qnL | j
 ƒ  } d t | ƒ j ƒ  } | rû t  j	 d	 | d ƒ n  | | j d <| | _ | r.t  j	 d
 | d ƒ n  | d k rÈ| d k rÈt  j j } | j j d ƒ pgg  } g  | D] }	 t |	 ƒ ^ qq} | r¬t  j	 d t | ƒ d ƒ n  | rí| d g k pÊ| | k rít  j d d | | f ƒ ‚ n  | j j d ƒ pg  } g  | D] }	 t |	 ƒ ^ q} | rGt  j	 d t | ƒ d ƒ n  | d g k sb| | k rÈ| r‚t  j	 d | j d ƒ n  | j d k r¦t  j g  d ƒ ‚ qÅt  j d d | | f ƒ ‚ qÈn  d S(   s  Validate the current ETag against If-Match, If-None-Match headers.

    If autotags is True, an ETag response-header value will be provided
    from an MD5 hash of the response body (unless some other code has
    already provided an ETag header). If False (the default), the ETag
    will not be automatic.

    WARNING: the autotags feature is not designed for URL's which allow
    methods other than GET. For example, if a POST to the same URL returns
    no content, the automatic ETag will be incorrect, breaking a fundamental
    use for entity tags in a possibly destructive fashion. Likewise, if you
    raise 304 Not Modified, the response body will be empty, the ETag hash
    will be incorrect, and your application will break.
    See :rfc:`2616` Section 14.24.
    t   ETagNs   ETag already set: %ss   TOOLS.ETAGSs   Autotags offiÈ   s   Status not 200s   "%s"s   Setting ETag: %ss
   Status: %si+  s   If-Matchs   If-Match conditions: %st   *iœ  s)   If-Match failed: ETag %r did not match %rs   If-None-Matchs   If-None-Match conditions: %ss   request.method: %st   GETt   HEADi0  s(   If-None-Match failed: ETag %r matched %r(   s   GETs   HEAD(   t   cherrypyt   servingt   responset   hasattrt	   _httputilt   valid_statust   statust   headerst   gett   logt   collapse_bodyR    t	   hexdigestR   t   requestt   elementst   strt   reprt	   HTTPErrort   methodt   HTTPRedirect(
   t   autotagst   debugR   R   t   reasont   msgt   etagR   t
   conditionst   x(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   validate_etags   sZ    	
"
	c          C   s0  t  j j }  |  j j d ƒ } | r,t j |  j ƒ \ } } } t  j j } | j j d ƒ } | r¨ | | k r¨ | d k r‡ | d k s“ | d k r¨ t  j	 d ƒ ‚ q¨ n  | j j d ƒ } | r,| | k r,| d k rä | d k sð | d k r)| j
 d k rt  j g  d ƒ ‚ q&t  j	 d ƒ ‚ q)q,n  d
 S(   s¯   Validate the current Last-Modified against If-Modified-Since headers.

    If no code has set the Last-Modified response header, then no validation
    will be performed.
    s   Last-Modifieds   If-Unmodified-SinceiÈ   i+  iœ  s   If-Modified-Sincei0  R   R   N(   s   GETs   HEAD(   R	   R
   R   R   R   R   R   R   R   R   R   R   (   R   t   lastmodR   R   R   R   t   since(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   validate_since]   s    $$c         C   s  t  |  t t f ƒ s! |  g }  n  g  |  D] } | r( | j ƒ  ^ q( }  |  s[ d d g }  n( d |  k rƒ d |  k rƒ |  j d ƒ n  d j |  ƒ t j j d <t j	 j
 |  k ré | r× t j d t j	 j
 |  f d ƒ n  t j d ƒ ‚ n) | rt j d t j	 j
 |  f d ƒ n  d	 S(
   s’  Raise 405 if request.method not in methods (default ['GET', 'HEAD']).

    The given methods are case-insensitive, and may be in any order.
    If only one method is allowed, you may supply a single string;
    if more than one, supply a list of strings.

    Regardless of whether the current method is allowed or not, this
    also emits an 'Allow' response header, containing the given methods.
    R   R   s   , t   Allows#   request.method %r not in methods %rs   TOOLS.ALLOWi•  s   request.method %r in methods %rN(   t
   isinstancet   tuplet   listt   uppert   appendt   joinR	   R   R   R   R   R   R   (   t   methodsR   t   m(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   allowz   s     
%		s   X-Forwarded-Hosts   X-Forwarded-Fors   X-Forwarded-Protoc   
      C   sá  t  j j } | rz | j j | d ƒ } | rJ t  j d | | f d ƒ n  | d k rq d | j ƒ  k rq d } qz | } n  | sœ | j | j j	 d ƒ  } n  | rÿ | j j | d ƒ } | rÚ t  j d | | f d ƒ n  | d k	 rÿ | j
 d ƒ d	 }  qÿ n  |  s3| j j } | d
 k r&d }  q3d | }  n  |  j	 d ƒ d k rY| d |  }  n  |  | _ | rÝ| j j | ƒ }	 | rt  j d | |	 f d ƒ n  |	 rÝ| d k rË|	 j
 d ƒ d	 j ƒ  }	 n  |	 | j _ qÝn  d S(   s¡  Change the base URL (scheme://host[:port][/path]).

    For running a CP server behind Apache, lighttpd, or other HTTP server.

    For Apache and lighttpd, you should leave the 'local' argument at the
    default value of 'X-Forwarded-Host'. For Squid, you probably want to set
    tools.proxy.local = 'Origin'.

    If you want the new request.base to include path info (not just the host),
    you must explicitly set base to the full base path, and ALSO set 'local'
    to '', so that the X-Forwarded-Host request header (which never includes
    path info) does not override it. Regardless, the value for 'base' MUST
    NOT end in a slash.

    cherrypy.request.remote.ip (the IP address of the client) will be
    rewritten if the header specified by the 'remote' arg is valid.
    By default, 'remote' is set to 'X-Forwarded-For'. If you do not
    want to rewrite remote.ip, set the 'remote' arg to an empty string.
    s   Testing scheme %r:%rs   TOOLS.PROXYt   ont   sslt   httpss   ://s   Testing local %r:%rt   ,i    iP   s	   127.0.0.1s   127.0.0.1:%siÿÿÿÿs   Testing remote %r:%rs   X-Forwarded-ForN(   R	   R
   R   R   R   t   NoneR   t   lowert   baset   findt   splitt   localt   portt   stript   remotet   ip(
   R7   R:   R=   t   schemeR   R   t   st   lbaseR;   t   xff(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   proxy˜   s@    				t   Rangec         C   sZ   t  j j } xG |  D]? } | | j k r | rE t  j d | d ƒ n  | j | =q q Wd S(   s  Delete request headers whose field names are included in 'headers'.

    This is a useful tool for working behind certain HTTP servers;
    for example, Apache duplicates the work that CP does for 'Range'
    headers, and will doubly-truncate the response.
    s   Ignoring request header %rs   TOOLS.IGNORE_HEADERSN(   R	   R
   R   R   R   (   R   R   R   t   name(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   ignore_headersÛ   s    
c         C   sW   | r# t  j d t |  ƒ d ƒ n  x- |  p/ g  D] \ } } | t  j j j | <q0 Wd S(   s   Set headers on the response.s   Setting response headers: %ss   TOOLS.RESPONSE_HEADERSN(   R	   R   R   R
   R   R   (   R   R   RE   t   value(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   response_headersë   s
    
i“  s   Forbidden Referer header.c         C   s¯   yb t  j j j d } t t j |  | ƒ ƒ } | rQ t  j d | |  f d ƒ n  | | k ra d SWn4 t k
 r˜ | r‹ t  j d d ƒ n  | r™ d Sn Xt  j	 | | ƒ ‚ d S(   sú  Raise HTTPError if Referer header does/does not match the given pattern.

    pattern
        A regular expression pattern to test against the Referer.

    accept
        If True, the Referer must match the pattern; if False,
        the Referer must NOT match the pattern.

    accept_missing
        If True, permit requests with no Referer header.

    error
        The HTTP error code to return to the client on failure.

    message
        A string to include in the response body on failure.

    t   Referers   Referer %r matches %rs   TOOLS.REFERERNs   No Referer header(
   R	   R
   R   R   t   boolt   ret   matchR   t   KeyErrorR   (   t   patternt   acceptt   accept_missingt   errort   messageR   t   refRL   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   refererõ   s    
t   SessionAuthc           B   s   e  Z d  Z d Z e Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d d d d	 „ Z d d
 „ Z d d „ Z d „  Z i  d „ Z d „  Z RS(   s"   Assert that the user is logged in.t   usernamec         C   s   d  S(   N(    (   t   selfRV   t   password(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   check_username_and_password"  s    c         C   s   d S(   s2   Provide a temporary user name for anonymous users.N(    (   RW   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt	   anonymous%  s    c         C   s   d  S(   N(    (   RW   RV   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   on_login)  s    c         C   s   d  S(   N(    (   RW   RV   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt	   on_logout,  s    c         C   s   d  S(   N(    (   RW   RV   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   on_check/  s    s   ..t    c         K   s   t  d ƒ t ƒ  j d ƒ S(   Nss  <html><body>
Message: %(error_msg)s
<form method="post" action="do_login">
    Login: <input type="text" name="username" value="%(username)s" size="10" />
    <br />
    Password: <input type="password" name="password" size="10" />
    <br />
    <input type="hidden" name="from_page" value="%(from_page)s" />
    <br />
    <input type="submit" />
</form>
</body></html>s   utf-8(   R   t   varst   encode(   RW   t	   from_pageRV   t	   error_msgt   kwargs(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   login_screen2  s    c         K   s§   t  j j } |  j | | ƒ } | rb |  j | | | ƒ } | | _ d | j k r^ | j d =n  t S| t  j j _	 | t  j
 |  j <|  j | ƒ t  j | p d ƒ ‚ d S(   s=   Login. May raise redirect, or return True if request handled.s   Content-Lengtht   /N(   R	   R
   R   RY   Rd   t   bodyR   t   TrueR   t   logint   sessiont   session_keyR[   R   (   RW   RV   RX   Ra   Rc   R   Rb   Rf   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   do_loginA  s    	c         K   s`   t  j } | j |  j ƒ } d | |  j <| rM d t  j j _ |  j | ƒ n  t  j	 | ƒ ‚ d S(   s>   Logout. May raise redirect, or return True if request handled.N(
   R	   Ri   R   Rj   R5   R
   R   Rh   R\   R   (   RW   Ra   Rc   t   sessRV   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt	   do_logoutR  s    	c         C   sí   t  j } t  j j } t  j j } | j |  j ƒ } | s` |  j ƒ  | |  j <} |  j d ƒ n  | sÀ t  j	 d | j
 ƒ } |  j d t ƒ  ƒ |  j | ƒ | _ d | j k r¼ | j d =n  t S|  j d t ƒ  ƒ | | _ |  j | ƒ d S(   sL   Assert username. Raise redirect, or return True if request handled.
        s&   No session[username], trying anonymoust   qss;   No username, routing to login_screen with from_page %(url)rs   Content-Lengths%   Setting request.login to %(username)rN(   R	   Ri   R
   R   R   R   Rj   RZ   t   _debug_messaget   urlt   query_stringt   localsRd   Rf   R   Rg   Rh   R]   (   RW   Rl   R   R   RV   Rp   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   do_check\  s&    	
	c         C   s%   |  j  s d  St j | | d ƒ d  S(   Ns   TOOLS.SESSAUTH(   R   R	   R   (   RW   t   templatet   context(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyRo   v  s    	c         C   s>  t  j j } t  j j } | j } | j d ƒ rV |  j d t ƒ  ƒ |  j ƒ  | _	 t
 S| j d ƒ rÃ | j d k r  d | j d <|  j d ƒ t  j d ƒ ‚ n  |  j d t ƒ  ƒ |  j | j   S| j d	 ƒ r#| j d k r d | j d <t  j d ƒ ‚ n  |  j d
 t ƒ  ƒ |  j | j   S|  j d ƒ |  j ƒ  Sd  S(   NRd   s    routing %(path)r to login_screenRk   t   POSTR'   s   do_login requires POSTi•  s   routing %(path)r to do_loginRm   s   routing %(path)r to do_logouts!   No special path, running do_check(   R	   R
   R   R   t	   path_infot   endswithRo   Rr   Rd   Rf   Rg   R   R   R   Rk   t   paramsRm   Rs   (   RW   R   R   t   path(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   run{  s,    	(   t   __name__t
   __module__t   __doc__Rj   t   FalseR   RY   RZ   R[   R\   R]   Rd   Rk   Rm   Rs   Ro   R{   (    (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyRU     s   					
	c          K   s@   t  ƒ  } x* |  j ƒ  D] \ } } t | | | ƒ q W| j ƒ  S(   N(   RU   t   itemst   setattrR{   (   Rc   t   sat   kt   v(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   session_auth–  s    	s|   Session authentication hook.

Any attribute of the SessionAuth class may be overridden via a keyword arg
to this function:

s   
t   __s   %s: %sc         C   s    t  j d d d |  d t ƒd S(   s;   Write the last error's traceback to the cherrypy error log.R^   t   HTTPt   severityt	   tracebackN(   R	   R   Rg   (   Rˆ   R   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   log_traceback¤  s    c         C   sS   g  t  j j j D] \ } } d | | f ^ q } t  j d d j | ƒ d ƒ d S(   s0   Write request headers to the cherrypy error log.s     %s: %ss   
Request Headers:
s   
R‡   N(   R	   R
   R   t   header_listR   R-   (   R   Rƒ   R„   t   h(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   log_request_headers©  s    2c         C   só   t  j j } g  } d d l  m } | j } x3 | j j ƒ  D]" } | | k r; | j | ƒ q; q; Wx` | D]X } | j d | ƒ | j j | g  ƒ } | j	 ƒ  x | D] } | j d | ƒ q¥ Wqh Wt  j
 d t  j ƒ  d d j | ƒ d ƒ d	 S(
   s.   Write request.hooks to the cherrypy error log.iÿÿÿÿ(   t
   _cprequests       %s:s
           %rs   
Request Hooks for s   :
s   
R‡   N(   R	   R
   R   RŽ   t
   hookpointst   hookst   keysR,   R   t   sortR   Rp   R-   (   R   R   R   RŽ   t   pointsRƒ   R„   RŒ   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt	   log_hooks¯  s    	
R^   c         C   s`   | r5 t  j d i d t 6d t 6| |  f d ƒ n  | rM t  j |  ƒ ‚ n t  j |  ƒ ‚ d S(   s8   Raise InternalRedirect or HTTPRedirect to the given url.s   Redirecting %sto: %ss	   internal R^   s   TOOLS.REDIRECTN(   R	   R   Rg   R   t   InternalRedirectR   (   Rp   t   internalR   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   redirectÅ  s    	
c         C   s  t  j j } | j } | rA t  j d | j |  | | f d ƒ n  | j t k r¢ |  r| j d ƒ sŸ t  j | d | j	 ƒ } t  j
 | d | p“ d ƒ‚ qŸ qnm | j t k r| r| j d ƒ r| d k rt  j | d  | j	 ƒ } t  j
 | d | p d ƒ‚ qqn  d S(   s9   Redirect if path_info has (missing|extra) trailing slash.s3   is_index: %r, missing: %r, extra: %r, path_info: %rs   TOOLS.TRAILING_SLASHRe   R   i-  iÿÿÿÿN(   R	   R
   R   Rw   R   t   is_indexRg   Rx   Rp   Rq   R   R   (   t   missingt   extraR   R   R   t   pit   new_url(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   trailing_slashÑ  s     		
$c            s4   ‡  ‡ f d †  ‰ t  j j } ˆ | j ƒ | _ d S(   sÎ   Wrap response.body in a generator that recursively iterates over body.

    This allows cherrypy.response.body to consist of 'nested generators';
    that is, a set of generators that yield generators.
    c         3   s|   d } xR |  D]J } t  | ƒ s1 | d 7} | Vq x# ˆ | ƒ D] } | d 7} | Vq> Wq Wˆ  rx t j d | d ƒ n  d  S(   Ni    i   s   Flattened %d chunkss   TOOLS.FLATTEN(   R   R	   R   (   t   inputt	   numchunksR"   t   y(   R   t	   flattener(    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyR¡   í  s    

N(   R	   R
   R   Rf   (   R   R   (    (   R   R¡   s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   flattenç  s    c   	      C   s·  |  s
 d St  |  t ƒ r% |  g }  n  t j j } | j j d ƒ } | sj | rb t j d d ƒ n  |  d Sxì | D]ä } | j d k rq | j	 d k r¶ | r® t j d d ƒ n  |  d S| j	 j
 d ƒ r| j	 d	  } xz |  D]9 } | j | ƒ rÜ | rt j d
 | j	 d ƒ n  | SqÜ WqU| j	 |  k rU| rKt j d
 | j	 d ƒ n  | j	 Sqq qq W| j j d ƒ } | d k r€d } n
 d | } | d d j |  ƒ 7} t j d | ƒ ‚ d S(   sp  Return the client's preferred media-type (from the given Content-Types).

    If 'media' is None (the default), no test will be performed.

    If 'media' is provided, it should be the Content-Type value (as a string)
    or values (as a list or tuple of strings) which the current resource
    can emit. The client's acceptable media ranges (as declared in the
    Accept request header) will be matched in order to these Content-Type
    values; the first such string is returned. That is, the return value
    will always be one of the strings provided in the 'media' arg (or None
    if 'media' is None).

    If no match is found, then HTTPError 406 (Not Acceptable) is raised.
    Note that most web browsers send */* as a (low-quality) acceptable
    media range, which should match any Content-Type. In addition, "...if
    no Accept header field is present, then it is assumed that the client
    accepts all media types."

    Matching types are checked in order of client preference first,
    and then in the order of the given 'media' values.

    Note that this function does not honor accept-params (other than "q").
    Nt   Accepts   No Accept header elementss   TOOLS.ACCEPTi    s   */*s   Match due to */*s   /*iÿÿÿÿs   Match due to %ss*   Your client did not send an Accept header.s(   Your client sent this Accept header: %s.s4    But this resource only emits these media types: %s.s   , i–  (   R(   R   R	   R
   R   R   R   R   t   qvalueRG   Rx   t
   startswithR   R5   R-   R   (	   t   mediaR   R   t   rangest   elementt   mtypeR/   t   ahR   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyRO   ý  sH    

	
t   MonitoredHeaderMapc           B   sJ   e  Z d  „  Z d „  Z d „  Z d d „ Z e i  d ƒ rH d „  Z n  RS(   c         C   s   t  ƒ  |  _ d  S(   N(   t   sett   accessed_headers(   RW   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   __init__J  s    c         C   s#   |  j  j | ƒ t j j |  | ƒ S(   N(   R­   t   addR   t	   HeaderMapt   __getitem__(   RW   t   key(    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyR±   M  s    c         C   s#   |  j  j | ƒ t j j |  | ƒ S(   N(   R­   R¯   R   R°   t   __contains__(   RW   R²   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyR³   Q  s    c         C   s)   |  j  j | ƒ t j j |  | d | ƒS(   Nt   default(   R­   R¯   R   R°   R   (   RW   R²   R´   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyR   U  s    t   has_keyc         C   s#   |  j  j | ƒ t j j |  | ƒ S(   N(   R­   R¯   R   R°   Rµ   (   RW   R²   (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyRµ   [  s    N(	   R|   R}   R®   R±   R³   R5   R   R   Rµ   (    (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyR«   H  s   			c            s„   t  j j ‰ ˆ j } t ƒ  ˆ _ ˆ j j | ƒ ˆ d k rU t d d d g ƒ ‰ n  ‡  ‡ ‡ f d †  } ˆ j j	 d | d ƒ d S(   sK   Auto-populate the Vary response header based on request.header access.
    s   Content-Dispositions   Content-Lengths   Content-Typec             s®   t  j j j }  t g  |  j d ƒ D] } | j ^ q" ƒ } ˆ  r] t  j d ˆ j j d ƒ n  | j	 ˆ j j ƒ } | j
 ˆ ƒ } t | ƒ } | j ƒ  d j | ƒ |  d <d  S(   Nt   Varys   Accessed headers: %ss   TOOLS.AUTOVARYs   , (   R	   R
   R   R   R¬   R   RG   R   R­   t   uniont
   differenceR*   R’   R-   (   t   resp_ht   eR„   (   R   t   ignoreR   (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   set_response_headerk  s    +

t   before_finalizei_   N(
   R	   R
   R   R   R«   t   updateR5   R¬   R   t   attach(   R»   R   t   req_hR¼   (    (   R   R»   R   s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   autovary`  s    	(   RD   (-   R~   t   loggingRK   t   hashlibR    R	   t   cherrypy._cpcompatR   R   t   cherrypy.libR   R   R   R   R#   R&   R5   R0   RC   RF   RH   Rg   t   failsafeRT   t   objectRU   R…   R-   t   dirRƒ   R¥   t   typet   getattrR|   t   ERRORRŠ   R   R”   R—   R   R¢   RO   R°   R«   RÁ   (    (    (    s{   /local/mnt/workspace/CRMBuilds/Saipan.LA.2.0-00145-STD.PROD-1_20200821_083004/b/common/sectools/ext/cherrypy/lib/cptools.pyt   <module>   s<   N		B		%{	
NK