B
    `>                 @   s  d dl mZmZ G dd deZeZG dd deZG dd deZG dd	 d	eZG d
d deZeZ	G dd deZ
G dd deZG dd dee
ZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG d d! d!eZG d"d# d#eZG d$d% d%eZG d&d' d'eZG d(d) d)eZG d*d+ d+eZG d,d- d-eZee_G d.d/ d/eZG d0d1 d1eZG d2d3 d3eZG d4d5 d5eZG d6d7 d7eZ G d8d9 d9eZ!G d:d; d;eZ"G d<d= d=eZ#G d>d? d?eZ$G d@dA dAe$Z%G dBdC dCe%Z&G dDdE dEeZ'G dFdG dGeZ(G dHdI dIeZ)e)Z*G dJdK dKeZ+G dLdM dMeZ,G dNdO dOeZ-G dPdQ dQeZ.G dRdS dSeZ/G dTdU dUeZ0e0Z1G dVdW dWeZ2G dXdY dYeZ3G dZd[ d[eZ4G d\d] d]eZ5G d^d_ d_eZ6G d`da dae6Z7dbZ8G dcdd ddeZ9G dedf dfeZ:G dgdh dheZ;G didj djeZ<G dkdl dleZ=G dmdn dneZ>G dodp dpeZ?G dqdr dreZ@G dsdt dteZAG dudv dveZBG dwdx dxeZCG dydz dzeZDG d{d| d|eZEG d}d~ d~eZFG dd deZGG dd deZHG dd deZIG dd deIZJG dd deIZKG dd deIZLG dd deZMG dd deZNG dd deZOG dd deZPdZQdZRdZSd ZTdS )    )	Attribute	Interfacec               @   s   e Zd ZdZedZdS )IContextFounda  An event type that is emitted after :app:`Pyramid` finds a
    :term:`context` object but before it calls any view code.  See the
    documentation attached to :class:`pyramid.events.ContextFound`
    for more information.

    .. note::

       For backwards compatibility with versions of
       :app:`Pyramid` before 1.0, this event interface can also be
       imported as :class:`pyramid.interfaces.IAfterTraversal`.
    zThe request objectN)__name__
__module____qualname____doc__r   request r
   r
   Z/home/kop/projects/devel/pgwui/test_venv/lib/python3.7/site-packages/pyramid/interfaces.pyr      s   r   c               @   s   e Zd ZdZedZdS )IBeforeTraversalz
    An event type that is emitted after :app:`Pyramid` attempted to find a
    route but before it calls any traversal or view code. See the documentation
    attached to :class:`pyramid.events.Routefound` for more information.
    zThe request objectN)r   r   r   r   r   r	   r
   r
   r
   r   r      s   r   c               @   s   e Zd ZdZedZdS )INewRequestzAn event type that is emitted whenever :app:`Pyramid`
    begins to process a new request.  See the documentation attached
    to :class:`pyramid.events.NewRequest` for more information.zThe request objectN)r   r   r   r   r   r	   r
   r
   r
   r   r   #   s   r   c               @   s    e Zd ZdZedZedZdS )INewResponsezAn event type that is emitted whenever any :app:`Pyramid`
    view returns a response. See the
    documentation attached to :class:`pyramid.events.NewResponse`
    for more information.zThe request objectzThe response objectN)r   r   r   r   r   r	   responser
   r
   r
   r   r   +   s   r   c               @   s   e Zd ZdZedZdS )IApplicationCreateda  Event issued when the
    :meth:`pyramid.config.Configurator.make_wsgi_app` method
    is called.  See the documentation attached to
    :class:`pyramid.events.ApplicationCreated` for more
    information.

    .. note::

       For backwards compatibility with :app:`Pyramid`
       versions before 1.0, this interface can also be imported as
       :class:`pyramid.interfaces.IWSGIApplicationCreatedEvent`.
    zCreated applicationN)r   r   r   r   r   Zappr
   r
   r
   r   r   5   s   r   c            	   @   s  e Zd ZdZedZdd ZedZedZedZ	edZ
d	d
 ZedZedZedZedZedZedZedZdd ZedZedZedZedZedZedZedZedZedZdd ZedZdCd"d#ZdDd&d'Z ed(Z!ed)Z"ed*Z#ed+Z$ed,Z%ed-Z&ed.Z'ed/Z(dEd0d1Z)d2d3 Z*ed4Z+ed5Z,ed6Z-ed7Z.dFd9d:Z/ed;Z0ed<Z1ed=Z2dGd?d@Z3edAZ4edBZ5d!S )H	IResponsea8  Represents a WSGI response using the WebOb response interface.
    Some attribute and method documentation of this interface references
    :rfc:`2616`.

    This interface is most famously implemented by
    :class:`pyramid.response.Response` and the HTTP exception classes in
    :mod:`pyramid.httpexceptions`.z, Alias for :class:`pyramid.request.Request` c             C   s   dS )zj:term:`WSGI` call interface, should call the start_response
        callback and should return an iterableNr
   )environstart_responser
   r
   r   __call__V   s    zIResponse.__call__z|Gets and sets and deletes the Accept-Ranges header. For more
        information on Accept-Ranges see RFC 2616, section 14.5z}Gets and sets and deletes the Age header. Converts using int.
        For more information on Age see RFC 2616, section 14.6.zGets and sets and deletes the Allow header. Converts using
        list. For more information on Allow see RFC 2616, Section 14.7.zReturns the app_iter of the response.

        If body was set, this will create an app_iter from that body
        (a single-item list)c             C   s   dS )znReturn a new app_iter built from the response app_iter that
        serves up only the given start:stop range.Nr
   )startstopr
   r
   r   app_iter_rangep   s    zIResponse.app_iter_rangezAn object containing authentication information related to the
        current request. The object's type and meaning is defined by the
        configured :term:`security policy`.z8A string to identify the authenticated user or ``None``.z_The body of the response, as a str. This will read in the entire
        app_iter if necessary.zA file-like object that can be used to write to the body. If you
        passed in a list app_iter, that app_iter will be modified by writes.z?Get/set/modify the Cache-Control header (RFC 2616 section 14.9)z Get/set the Cache-Control and Expires headers. This sets the
            response to expire in the number of seconds passed when set. z)Get/set the charset (in the Content-Type)c             C   s   dS )a  Like the normal __call__ interface, but checks conditional
        headers:

        - If-Modified-Since (304 Not Modified; only on GET, HEAD)

        - If-None-Match (304 Not Modified; only on GET, HEAD)

        - Range (406 Partial Content; only on GET, HEAD)Nr
   )r   r   r
   r
   r   conditional_response_app   s    z"IResponse.conditional_response_appzGets and sets and deletes the Content-Disposition header.
        For more information on Content-Disposition see RFC 2616 section
        19.5.1.zGets and sets and deletes the Content-Encoding header.  For more
        information about Content-Encoding see RFC 2616 section 14.11.zGets and sets and deletes the Content-Language header. Converts
        using list.  For more information about Content-Language see RFC 2616
        section 14.12.zGets and sets and deletes the Content-Length header. For more
        information on Content-Length see RFC 2616 section 14.17.
        Converts using int. zGets and sets and deletes the Content-Location header. For more
        information on Content-Location see RFC 2616 section 14.14.zyGets and sets and deletes the Content-MD5 header. For more
        information on Content-MD5 see RFC 2616 section 14.14.zGets and sets and deletes the Content-Range header. For more
        information on Content-Range see section 14.16. Converts using
        ContentRange object.zGet/set the Content-Type header (or None), without the charset
        or any parameters. If you include parameters (or ; at all) when
        setting the content_type, any existing parameters will be deleted;
        otherwise they will be preserved.zA dictionary of all the parameters in the content type.  This is
        not a view, set to change, modifications of the dict would not
        be applied otherwise.c               C   s   dS )z4 Makes a copy of the response and returns the copy. Nr
   r
   r
   r
   r   copy   s    zIResponse.copyzGets and sets and deletes the Date header. For more information on
        Date see RFC 2616 section 14.18. Converts using HTTP date./Nc             C   s   dS )zDelete a cookie from the client. Note that path and domain must
        match how the cookie was originally set.  This sets the cookie to the
        empty string, and max_age=0 so that it should expire immediately.Nr
   )namepathdomainr
   r
   r   delete_cookie   s    zIResponse.delete_cookiegzipFc             C   s   dS )zZEncode the content with the given encoding (only gzip and
        identity are supported).Nr
   )encodingZlazyr
   r
   r   encode_content   s    zIResponse.encode_contentzJGet/set the request environ associated with this response,
        if any.z Gets and sets and deletes the ETag header. For more information
        on ETag see RFC 2616 section 14.19. Converts using Entity tag.z Gets and sets and deletes the Expires header. For more
        information on Expires see RFC 2616 section 14.21. Converts using
        HTTP date.z The list of response headers. z) The headers in a dictionary-like object zA boolean indicating whether the request has an authenticated
        user, as determined by the security policy in use.

        The value is determined by the result of
        :attr:`pyramid.request.Request.authenticated_userid`.
        z Gets and sets and deletes the Last-Modified header. For more
        information on Last-Modified see RFC 2616 section 14.29. Converts
        using HTTP date.zt Gets and sets and deletes the Location header. For more
        information on Location see RFC 2616 section 14.30.c             C   s   dS )zGenerate an etag for the response object using an MD5 hash of the
        body (the body parameter, or self.body if not given).  Sets self.etag.
        If set_content_md5 is True sets self.content_md5 as wellNr
   )bodyZset_content_md5r
   r
   r   md5_etag
  s    zIResponse.md5_etagc             C   s   dS )zMerge the cookies that were set on this response with the given
        resp object (which can be any WSGI application).  If the resp is a
        webob.Response object, then the other object will be modified
        in-place.Nr
   )respr
   r
   r   merge_cookies  s    zIResponse.merge_cookieszq Gets and sets and deletes the Pragma header. For more information
        on Pragma see RFC 2616 section 14.32. z: Return the request associated with this response if any. z Gets and sets and deletes the Retry-After header. For more
        information on Retry-After see RFC 2616 section 14.37. Converts
        using HTTP date or delta seconds.zo Gets and sets and deletes the Server header. For more information
        on Server see RFC216 section 14.38.  c
       
      C   s   dS )z% Set (add) a cookie for the response Nr
   )
r   valueZmax_ager   r   securehttponlycommentexpires	overwriter
   r
   r   
set_cookie)  s    zIResponse.set_cookiez The status string. z The status as an integer zV Get/set the unicode value of the body (using the charset of
        the Content-Type)Tc             C   s   dS )zIUnset a cookie with the given name (remove it from the
        response).Nr
   )r   strictr
   r
   r   unset_cookie@  s    zIResponse.unset_cookiezwGets and sets and deletes the Vary header. For more information
        on Vary see section 14.44. Converts using list.z Gets and sets and deletes the WWW-Authenticate header. For more
        information on WWW-Authenticate see RFC 2616 section 14.47. Converts
        using 'parse_auth' and 'serialize_auth'. )r   N)r   F)NF)	r&   Nr   NFFNNF)T)6r   r   r   r   r   ZRequestClassr   Zaccept_rangesZageZallowZapp_iterr   identityauthenticated_useridr"   Z	body_fileZcache_controlZcache_expirescharsetr   content_dispositioncontent_encodingZcontent_languagecontent_lengthcontent_locationZcontent_md5Zcontent_rangecontent_typeZcontent_type_paramsr   dater   r!   r   etagr+   Z
headerlistheadersis_authenticatedZlast_modifiedlocationr#   r%   Zpragmar	   retry_afterserverr-   statusZ
status_intZunicode_bodyr/   varyZwww_authenticater
   r
   r
   r   r   I   s   



        

r   c               @   s   e Zd ZdZdS )
IExceptionz/ An interface representing a generic exception N)r   r   r   r   r
   r
   r
   r   rA   P  s   rA   c               @   s   e Zd ZdZdd ZdS )IExceptionResponsea  An interface representing a WSGI response which is also an exception
    object.  Register an exception view using this interface as a ``context``
    to apply the registered view for all exception types raised by
    :app:`Pyramid` internally (any exception that inherits from
    :class:`pyramid.response.Response`, including
    :class:`pyramid.httpexceptions.HTTPNotFound` and
    :class:`pyramid.httpexceptions.HTTPForbidden`).c             C   s   dS )z> Prepares the response for being called as a WSGI application Nr
   )r   r
   r
   r   prepare]  s    zIExceptionResponse.prepareN)r   r   r   r   rC   r
   r
   r
   r   rB   T  s   rB   c               @   s   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdddZdd Z	dd Z
dd ZdddZdd Zd ddZdd Zdd ZdS )!IDictc             C   s   dS )z7 Return ``True`` if key ``k`` exists in the dictionary.Nr
   )kr
   r
   r   __contains__d  s    zIDict.__contains__c             C   s   dS )z) Set a key/value pair into the dictionaryNr
   )rE   r'   r
   r
   r   __setitem__g  s    zIDict.__setitem__c             C   s   dS )znDelete an item from the dictionary which is passed to the
        renderer as the renderer globals dictionary.Nr
   )rE   r
   r
   r   __delitem__j  s    zIDict.__delitem__c             C   s   dS )zgReturn the value for key ``k`` from the dictionary or raise a
        KeyError if the key doesn't existNr
   )rE   r
   r
   r   __getitem__n  s    zIDict.__getitem__c               C   s   dS )z5 Return an iterator over the keys of this dictionary Nr
   r
   r
   r
   r   __iter__r  s    zIDict.__iter__Nc             C   s   dS )zlReturn the value for key ``k`` from the renderer dictionary, or
        the default if no such value exists.Nr
   )rE   defaultr
   r
   r   getu  s    z	IDict.getc               C   s   dS )z4 Return a list of [(k,v)] pairs from the dictionary Nr
   r
   r
   r
   r   itemsy  s    zIDict.itemsc               C   s   dS )z+ Return a list of keys from the dictionary Nr
   r
   r
   r
   r   keys|  s    z
IDict.keysc               C   s   dS )z- Return a list of values from the dictionary Nr
   r
   r
   r
   r   values  s    zIDict.valuesc             C   s   dS )zPop the key k from the dictionary and return its value.  If k
        doesn't exist, and default is provided, return the default.  If k
        doesn't exist and default is not provided, raise a KeyError.Nr
   )rE   rK   r
   r
   r   pop  s    z	IDict.popc               C   s   dS )zPop the item with key k from the dictionary and return it as a
        two-tuple (k, v).  If k doesn't exist, raise a KeyError.Nr
   r
   r
   r
   r   popitem  s    zIDict.popitemc             C   s   dS )aM  Return the existing value for key ``k`` in the dictionary.  If no
        value with ``k`` exists in the dictionary, set the ``default``
        value into the dictionary under the k name passed.  If a value already
        existed in the dictionary, return it.  If a value did not exist in
        the dictionary, return the defaultNr
   )rE   rK   r
   r
   r   
setdefault  s    zIDict.setdefaultc             C   s   dS )z> Update the renderer dictionary with another dictionary ``d``.Nr
   )dr
   r
   r   update  s    zIDict.updatec               C   s   dS )z& Clear all values from the dictionary Nr
   r
   r
   r
   r   clear  s    zIDict.clear)N)N)N)r   r   r   rF   rG   rH   rI   rJ   rL   rM   rN   rO   rP   rQ   rR   rT   rU   r
   r
   r
   r   rD   a  s   


rD   c               @   s   e Zd ZdZedZdS )IBeforeRenderaU  
    Subscribers to this event may introspect and modify the set of
    :term:`renderer globals` before they are passed to a :term:`renderer`.
    The event object itself provides a dictionary-like interface for adding
    and removing :term:`renderer globals`.  The keys and values of the
    dictionary are those globals.  For example::

      from repoze.events import subscriber
      from pyramid.interfaces import IBeforeRender

      @subscriber(IBeforeRender)
      def add_global(event):
          event['mykey'] = 'foo'

    .. seealso::

        See also :ref:`beforerender_event`.
    zuThe value returned by a view or passed to a ``render`` method for this rendering. This feature is new in Pyramid 1.2.N)r   r   r   r   r   Zrendering_valr
   r
   r
   r   rV     s   rV   c               @   s@   e Zd ZdZedZedZedZedZedZ	dd Z
d	S )
IRendererInfozAn object implementing this interface is passed to every
    :term:`renderer factory` constructor as its only argument (conventionally
    named ``info``)z1The value passed by the user as the renderer namezIThe "current package" when the renderer configuration statement was foundzThe renderer type namez@The "current" application registry when the renderer was createdzEThe deployment settings dictionary related to the current applicationc               C   s   dS )z= Return a shallow copy that does not share any mutable state.Nr
   r
   r
   r
   r   clone  s    zIRendererInfo.cloneN)r   r   r   r   r   r   packagetyperegistrysettingsrX   r
   r
   r
   r   rW     s   rW   c               @   s   e Zd Zdd ZdS )IRendererFactoryc             C   s   dS )zReturn an object that implements
        :class:`pyramid.interfaces.IRenderer`. ``info`` is an
        object that implements :class:`pyramid.interfaces.IRendererInfo`.
        Nr
   )infor
   r
   r   r     s    zIRendererFactory.__call__N)r   r   r   r   r
   r
   r
   r   r]     s   r]   c               @   s   e Zd Zdd ZdS )	IRendererc             C   s   dS )aN  Call the renderer with the result of the
        view (``value``) passed in and return a result (a string or
        unicode object useful as a response body).  Values computed by
        the system are passed by the system in the ``system``
        parameter, which is a dictionary.  Keys in the dictionary
        include: ``view`` (the view callable that returned the value),
        ``renderer_name`` (the template name or simple name of the
        renderer), ``context`` (the context object passed to the
        view), and ``request`` (the request object passed to the
        view).Nr
   )r'   systemr
   r
   r   r     s    
zIRenderer.__call__N)r   r   r   r   r
   r
   r
   r   r_     s   r_   c               @   s   e Zd Zdd ZdS )IViewMapperc             C   s   dS )a4  Provided with an arbitrary object (a function, class, or
        instance), returns a callable with the call signature ``(context,
        request)``.  The callable returned should itself return a Response
        object.  An IViewMapper is returned by
        :class:`pyramid.interfaces.IViewMapperFactory`.Nr
   )selfobjectr
   r
   r   r     s    zIViewMapper.__call__N)r   r   r   r   r
   r
   r
   r   ra     s   ra   c               @   s   e Zd Zdd ZdS )IViewMapperFactoryc             K   s   dS )a  
        Return an object which implements
        :class:`pyramid.interfaces.IViewMapper`.  ``kw`` will be a dictionary
        containing view-specific arguments, such as ``permission``,
        ``predicates``, ``attr``, ``renderer``, and other items.  An
        IViewMapperFactory is used by
        :meth:`pyramid.config.Configurator.add_view` to provide a plugpoint
        to extension developers who want to modify potential view callable
        invocation signatures and response values.
        Nr
   )rb   kwr
   r
   r   r     s    
zIViewMapperFactory.__call__N)r   r   r   r   r
   r
   r
   r   rd     s   rd   c               @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )ISecurityPolicyc             C   s   dS )zReturn the :term:`identity` of the current user.  The object can be
        of any shape, such as a simple ID string or an ORM object.
        Nr
   )r	   r
   r
   r   r0     s    zISecurityPolicy.identityc             C   s   dS )zReturn a :term:`userid` string identifying the trusted and
        verified user, or ``None`` if unauthenticated.

        If the result is ``None``, then
        :attr:`pyramid.request.Request.is_authenticated` will return ``False``.
        Nr
   )r	   r
   r
   r   r1     s    z$ISecurityPolicy.authenticated_useridc             C   s   dS )zReturn an instance of :class:`pyramid.security.Allowed` if a user
        of the given identity is allowed the ``permission`` in the current
        ``context``, else return an instance of
        :class:`pyramid.security.Denied`.
        Nr
   )r	   context
permissionr
   r
   r   permits  s    zISecurityPolicy.permitsc             K   s   dS )zReturn a set of headers suitable for 'remembering' the
        :term:`userid` named ``userid`` when set in a response.  An individual
        security policy and its consumers can decide on the composition and
        meaning of ``**kw``.
        Nr
   )r	   useridre   r
   r
   r   remember  s    zISecurityPolicy.rememberc             K   s   dS )zReturn a set of headers suitable for 'forgetting' the
        current user on subsequent requests.  An individual security policy and
        its consumers can decide on the composition and meaning of ``**kw``.
        Nr
   )r	   re   r
   r
   r   forget  s    zISecurityPolicy.forgetN)r   r   r   r0   r1   ri   rk   rl   r
   r
   r
   r   rf     s
   rf   c               @   s8   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d ZdS )IAuthenticationPolicyzAn object representing a Pyramid authentication policy.

    .. deprecated:: 2.0

        Authentication policies have been removed in favor of security
        policies.  See :ref:`upgrading_auth_20` for more information.

    c             C   s   dS )a  Return the authenticated :term:`userid` or ``None`` if
        no authenticated userid can be found. This method of the
        policy should ensure that a record exists in whatever
        persistent store is used related to the user (the user
        should not have been deleted); if a record associated with
        the current id does not exist in a persistent store, it
        should return ``None``.

        Nr
   )r	   r
   r
   r   r1   %  s    	z*IAuthenticationPolicy.authenticated_useridc             C   s   dS )aq  Return the *unauthenticated* userid.  This method
        performs the same duty as ``authenticated_userid`` but is
        permitted to return the userid based only on data present
        in the request; it needn't (and shouldn't) check any
        persistent store to ensure that the user record related to
        the request userid exists.

        This method is intended primarily a helper to assist the
        ``authenticated_userid`` method in pulling credentials out
        of the request data, abstracting away the specific headers,
        query strings, etc that are used to authenticate the request.

        Nr
   )r	   r
   r
   r   unauthenticated_userid0  s    z,IAuthenticationPolicy.unauthenticated_useridc             C   s   dS )a1  Return a sequence representing the effective principals
        typically including the :term:`userid` and any groups belonged
        to by the current user, always including 'system' groups such
        as ``pyramid.authorization.Everyone`` and
        ``pyramid.authorization.Authenticated``.

        Nr
   )r	   r
   r
   r   effective_principals?  s    z*IAuthenticationPolicy.effective_principalsc             K   s   dS )zReturn a set of headers suitable for 'remembering' the
        :term:`userid` named ``userid`` when set in a response.  An
        individual authentication policy and its consumers can
        decide on the composition and meaning of ``**kw``.

        Nr
   )r	   rj   re   r
   r
   r   rk   H  s    zIAuthenticationPolicy.rememberc             C   s   dS )zlReturn a set of headers suitable for 'forgetting' the
        current user on subsequent requests.

        Nr
   )r	   r
   r
   r   rl   P  s    zIAuthenticationPolicy.forgetN)	r   r   r   r   r1   rn   ro   rk   rl   r
   r
   r
   r   rm     s   	rm   c               @   s    e Zd ZdZdd Zdd ZdS )IAuthorizationPolicyzAn object representing a Pyramid authorization policy.

    .. deprecated:: 2.0

        Authentication policies have been removed in favor of security
        policies.  See :ref:`upgrading_auth_20` for more information.

    c             C   s   dS )zReturn an instance of :class:`pyramid.security.Allowed` if any
        of the ``principals`` is allowed the ``permission`` in the current
        ``context``, else return an instance of
        :class:`pyramid.security.Denied`.
        Nr
   )rg   Z
principalsrh   r
   r
   r   ri   a  s    zIAuthorizationPolicy.permitsc             C   s   dS )a  Return a set of principal identifiers allowed by the
        ``permission`` in ``context``.  This behavior is optional; if you
        choose to not implement it you should define this method as
        something which raises a ``NotImplementedError``.  This method
        will only be called when the
        ``pyramid.security.principals_allowed_by_permission`` API is
        used.Nr
   )rg   rh   r
   r
   r    principals_allowed_by_permissionh  s    z5IAuthorizationPolicy.principals_allowed_by_permissionN)r   r   r   r   ri   rq   r
   r
   r
   r   rp   W  s   rp   c               @   sB   e Zd ZdZdd Zdd ZdddZd	d
 Zdd Zdd Z	dS )
IMultiDictaq  
    An ordered dictionary that can have multiple values for each key. A
    multidict adds the methods ``getall``, ``getone``, ``mixed``, ``extend``,
    ``add``, and ``dict_of_lists`` to the normal dictionary interface.  A
    multidict data structure is used as ``request.POST``, ``request.GET``,
    and ``request.params`` within an :app:`Pyramid` application.
    c             C   s   dS )z< Add the key and value, not overwriting any previous value. Nr
   )keyr'   r
   r
   r   add{  s    zIMultiDict.addc               C   s   dS )zb
        Returns a dictionary where each key is associated with a list of
        values.
        Nr
   r
   r
   r
   r   dict_of_lists~  s    zIMultiDict.dict_of_listsNc             K   s   dS )zAdd a set of keys and values, not overwriting any previous
        values.  The ``other`` structure may be a list of two-tuples or a
        dictionary.  If ``**kwargs`` is passed, its value *will* overwrite
        existing values.Nr
   )otherkwargsr
   r
   r   extend  s    zIMultiDict.extendc             C   s   dS )zKReturn a list of all values matching the key (may be an empty
        list)Nr
   )rs   r
   r
   r   getall  s    zIMultiDict.getallc             C   s   dS )zYGet one value matching the key, raising a KeyError if multiple
        values were found.Nr
   )rs   r
   r
   r   getone  s    zIMultiDict.getonec               C   s   dS )a	  Returns a dictionary where the values are either single values,
        or a list of values when a key/value appears more than once in this
        dictionary. This is similar to the kind of dictionary often used to
        represent the variables in a web request.Nr
   r
   r
   r
   r   mixed  s    zIMultiDict.mixed)N)
r   r   r   r   rt   ru   rx   ry   rz   r{   r
   r
   r
   r   rr   r  s   
rr   c               @   s   e Zd ZdZdS )IRequestz8 Request type interface attached to all request objects N)r   r   r   r   r
   r
   r
   r   r|     s   r|   c               @   s   e Zd ZdZdS )ITweenszoMarker interface for utility registration representing the ordered
    set of a configuration's tween factoriesN)r   r   r   r   r
   r
   r
   r   r}     s   r}   c               @   s   e Zd ZdZdd ZdS )IRequestHandler c             C   s   dS )zMust return a tuple of IReqest, IResponse or raise an exception.
        The ``request`` argument will be an instance of an object that
        provides IRequest.Nr
   )rb   r	   r
   r
   r   r     s    zIRequestHandler.__call__N)r   r   r   r   r   r
   r
   r
   r   r~     s   r~   c               @   s    e Zd ZdZedZedZdS )IRequestExtensionszwMarker interface for storing request extensions (properties and
    methods) which will be added to the request object.z9A list of descriptors that will be added to each request.z.A list of methods to be added to each request.N)r   r   r   r   r   Zdescriptorsmethodsr
   r
   r
   r   r     s   r   c               @   s   e Zd ZdZdS )IRouteRequestzi*internal only* interface used as in a utility lookup to find
    route-specific interfaces.  Not an API.N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd ZdZdS )IAcceptOrderz[
    Marker interface for a list of accept headers with the most important
    first.

    N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s(   e Zd ZdZdd Zdd Zdd ZdS )	IStaticURLInfoz/ A policy for generating URLs to static assets c             K   s   dS )z$ Add a new static info registration Nr
   )configr   specextrar
   r
   r   rt     s    zIStaticURLInfo.addc             K   s   dS )z# Generate a URL for the given path Nr
   )r   r	   re   r
   r
   r   generate  s    zIStaticURLInfo.generatec             C   s   dS )z6 Add a new cache buster to a particular set of assets Nr
   )r   r   Zcache_busterr
   r
   r   add_cache_buster  s    zIStaticURLInfo.add_cache_busterN)r   r   r   r   rt   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd ZdZdd ZdS )IResponseFactoryz& A utility which generates a response c             C   s   dS )zReturn a response object implementing IResponse,
        e.g. :class:`pyramid.response.Response`). It should handle the
        case when ``request`` is ``None``.Nr
   )r	   r
   r
   r   r     s    zIResponseFactory.__call__N)r   r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s    e Zd ZdZdd Zdd ZdS )IRequestFactoryz% A utility which generates a request c             C   s   dS )z2 Return an instance of ``pyramid.request.Request``Nr
   )r   r
   r
   r   r     s    zIRequestFactory.__call__c             C   s   dS )zRReturn an empty request object (see
        :meth:`pyramid.request.Request.blank`)Nr
   )r   r
   r
   r   blank  s    zIRequestFactory.blankN)r   r   r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd ZdZdS )IViewClassifierz, *Internal only* marker interface for views.N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd ZdZdS )IExceptionViewClassifierz6 *Internal only* marker interface for exception views.N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd Zdd ZdS )IViewc             C   s   dS )z2 Must return an object that implements IResponse. Nr
   )rg   r	   r
   r
   r   r     s    zIView.__call__N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s    e Zd ZdZdd Zdd ZdS )ISecuredViewz) *Internal only* interface.  Not an API. c             C   s   dS )z+ Guaranteed-permissive version of __call__ Nr
   )rg   r	   r
   r
   r   __call_permissive__  s    z ISecuredView.__call_permissive__c             C   s   dS )zfReturn True if view execution will be permitted using the
        context and request, False otherwiseNr
   )rg   r	   r
   r
   r   __permitted__  s    zISecuredView.__permitted__N)r   r   r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd ZdZdddZdS )
IMultiViewz*internal only*.  A multiview is a secured view that is a
    collection of other views.  Each of the views is associated with
    zero or more predicates.  Not an API.Nc             C   s   dS )z Add a view to the multiview. Nr
   )view
predicatesorderacceptphashr
   r
   r   rt     s    zIMultiView.add)NN)r   r   r   r   rt   r
   r
   r
   r   r     s   r   c               @   s   e Zd Zdd ZdS )IRootFactoryc             C   s   dS )z+ Return a root object based on the request Nr
   )r	   r
   r
   r   r     s    zIRootFactory.__call__N)r   r   r   r   r
   r
   r
   r   r   
  s   r   c               @   s   e Zd Zdd ZdS )IDefaultRootFactoryc             C   s   dS )z5 Return the *default* root object for an application Nr
   )r	   r
   r
   r   r     s    zIDefaultRootFactory.__call__N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd Zdd ZdS )
ITraverserc             C   s   dS )a  Return a dictionary with (at least) the keys ``root``,
        ``context``, ``view_name``, ``subpath``, ``traversed``,
        ``virtual_root``, and ``virtual_root_path``.  These values are
        typically the result of an object graph traversal.  ``root`` is the
        physical root object, ``context`` will be a model object,
        ``view_name`` will be the view name used (a Unicode name),
        ``subpath`` will be a sequence of Unicode names that followed the
        view name but were not traversed, ``traversed`` will be a sequence of
        Unicode names that were traversed (including the virtual root path,
        if any) ``virtual_root`` will be a model object representing the
        virtual root (or the physical root if traversal was not performed),
        and ``virtual_root_path`` will be a sequence representing the virtual
        root path (a sequence of Unicode names) or ``None`` if traversal was
        not performed.

        Extra keys for special purpose functionality can be returned as
        necessary.

        All values returned in the dictionary will be made available
        as attributes of the ``request`` object by the :term:`router`.
        Nr
   )r	   r
   r
   r   r     s    zITraverser.__call__N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd Zdd ZdS )IViewPermissionc             C   s   dS )z@Return True if the permission allows, return False if it denies.Nr
   )rg   r	   r
   r
   r   r   1  s    zIViewPermission.__call__N)r   r   r   r   r
   r
   r
   r   r   0  s   r   c               @   s(   e Zd ZdZedZdd Zdd ZdS )IRouterz^
    WSGI application which routes requests to 'view' code based on
    a view registry.

    z:Component architecture registry local to this application.c             C   s   dS )a}  
        Create a new request context from a WSGI environ.

        The request context is used to push/pop the threadlocals required
        when processing the request. It also contains an initialized
        :class:`pyramid.interfaces.IRequest` instance using the registered
        :class:`pyramid.interfaces.IRequestFactory`. The context may be
        used as a context manager to control the threadlocal lifecycle:

        .. code-block:: python

            with router.request_context(environ) as request:
                ...

        Alternatively, the context may be used without the ``with`` statement
        by manually invoking its ``begin()`` and ``end()`` methods.

        .. code-block:: python

            ctx = router.request_context(environ)
            request = ctx.begin()
            try:
                ...
            finally:
                ctx.end()

        Nr
   )r   r
   r
   r   request_context@  s    zIRouter.request_contextc             C   s   dS )z
        Invoke the :app:`Pyramid` request pipeline.

        See :ref:`router_chapter` for information on the request pipeline.

        The output should be a :class:`pyramid.interfaces.IResponse` object
        or a raised exception.

        Nr
   )r	   r
   r
   r   invoke_request]  s    	zIRouter.invoke_requestN)r   r   r   r   r   r[   r   r   r
   r
   r
   r   r   5  s
   r   c               @   s   e Zd Zdd ZdS )IExecutionPolicyc             C   s   dS )a  
        This callable triggers the router to process a raw WSGI environ dict
        into a response and controls the :app:`Pyramid` request pipeline.

        The ``environ`` is the raw WSGI environ.

        The ``router`` is an :class:`pyramid.interfaces.IRouter` object which
        should be used to create a request object and send it into the
        processing pipeline.

        The return value should be a :class:`pyramid.interfaces.IResponse`
        object or an exception that will be handled by WSGI middleware.

        The default execution policy simply creates a request and sends it
        through the pipeline, attempting to render any exception that escapes:

        .. code-block:: python

            def simple_execution_policy(environ, router):
                with router.request_context(environ) as request:
                    try:
                        return router.invoke_request(request)
                    except Exception:
                        return request.invoke_exception_view(reraise=True)
        Nr
   )r   Zrouterr
   r
   r   r   j  s    zIExecutionPolicy.__call__N)r   r   r   r   r
   r
   r
   r   r   i  s   r   c               @   s   e Zd ZdZdS )	ISettingszRuntime settings utility for pyramid; represents the
    deployment settings for the application.  Implements a mapping
    interface.N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s    e Zd ZdZedZedZ dS )	ILocationz'Objects that have a structural locationz$The parent in the location hierarchyzThe name within the parentN)r   r   r   r   r   Z
__parent__r
   r
   r
   r   r     s   r   c               @   s   e Zd ZdZdS )IDebugLoggerz) Interface representing a PEP 282 logger N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd Zdd ZdS )IRoutePregeneratorc             C   s   dS )an  A pregenerator is a function associated by a developer with a
        :term:`route`. The pregenerator for a route is called by
        :meth:`pyramid.request.Request.route_url` in order to adjust the set
        of arguments passed to it by the user for special purposes, such as
        Pylons 'subdomain' support.  It will influence the URL returned by
        ``route_url``.

        A pregenerator should return a two-tuple of ``(elements, kw)``
        after examining the originals passed to this function, which
        are the arguments ``(request, elements, kw)``.  The simplest
        pregenerator is::

            def pregenerator(request, elements, kw):
                return elements, kw

        You can employ a pregenerator by passing a ``pregenerator``
        argument to the
        :meth:`pyramid.config.Configurator.add_route`
        function.

        Nr
   )r	   elementsre   r
   r
   r   r     s    zIRoutePregenerator.__call__N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   sH   e Zd ZdZedZedZedZedZedZ	dd Z
d	d
 ZdS )IRoutezWInterface representing the type of object returned from
    ``IRoutesMapper.get_route``zThe route namezThe route patternz`The :term:`root factory` used by the :app:`Pyramid` router when this route matches (or ``None``)zA sequence of :term:`route predicate` objects used to determine if a request matches this route or not after basic pattern matching has been completed.zoThis attribute should either be ``None`` or a callable object implementing the ``IRoutePregenerator`` interfacec             C   s   dS )a  
        If the ``path`` passed to this function can be matched by the
        ``pattern`` of this route, return a dictionary (the
        'matchdict'), which will contain keys representing the dynamic
        segment markers in the pattern mapped to values extracted from
        the provided ``path``.

        If the ``path`` passed to this function cannot be matched by
        the ``pattern`` of this route, return ``None``.
        Nr
   )r   r
   r
   r   match  s    
zIRoute.matchc             C   s   dS )z
        Generate a URL based on filling in the dynamic segment markers
        in the pattern using the ``kw`` dictionary provided.
        Nr
   )re   r
   r
   r   r     s    zIRoute.generateN)r   r   r   r   r   r   patternfactoryr   pregeneratorr   r   r
   r
   r
   r   r     s   r   c               @   sB   e Zd ZdZdd Zdd Zdd ZdddZdd Zdd Z	dS )IRoutesMapperz3 Interface representing a Routes ``Mapper`` object c               C   s   dS )zyReturn a sequence of Route objects registered in the mapper.
        Static routes will not be returned in this sequence.Nr
   r
   r
   r
   r   
get_routes  s    zIRoutesMapper.get_routesc               C   s   dS )z4 Returns ``True`` if any route has been registered. Nr
   r
   r
   r
   r   
has_routes  s    zIRoutesMapper.has_routesc             C   s   dS )zqReturns an ``IRoute`` object if a route with the name ``name``
        was registered, otherwise return ``None``.Nr
   )r   r
   r
   r   	get_route  s    zIRoutesMapper.get_routeNr
   Tc             C   s   dS )z Add a new route. Nr
   )r   r   r   r   r   Zstaticr
   r
   r   connect  s    zIRoutesMapper.connectc             C   s   dS )zUGenerate a URL using the route named ``name`` with the
        keywords implied by kwNr
   )r   re   r
   r
   r   r     s    zIRoutesMapper.generatec             C   s   dS )aE  Return a dictionary containing matching information for
        the request; the ``route`` key of this dictionary will either
        be a Route object or ``None`` if no route matched; the
        ``match`` key will be the matchdict or ``None`` if no route
        matched.  Static routes will not be considered for matching.Nr
   )r	   r
   r
   r   r     s    zIRoutesMapper.__call__)Nr
   NT)
r   r   r   r   r   r   r   r   r   r   r
   r
   r
   r   r     s      
r   c               @   s,   e Zd ZedZedZedZedZdS )IResourceURLz1The virtual url path of the resource as a string.z2The physical url path of the resource as a string.z>The virtual url path of the resource as a tuple.  (New in 1.5)z>The physical url path of the resource as a tuple. (New in 1.5)N)r   r   r   r   Zvirtual_pathZphysical_pathZvirtual_path_tupleZphysical_path_tupler
   r
   r
   r   r     s   r   c               @   s8   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d ZdS )IPEP302Loaderz2See http://www.python.org/dev/peps/pep-0302/#id30.c             C   s   dS )zRetrieve data for and arbitrary "files" from storage backend.

        Raise IOError for not found.

        Data is returned as bytes.
        Nr
   )r   r
   r
   r   get_data  s    zIPEP302Loader.get_datac             C   s   dS )z?Return True if the module specified by 'fullname' is a package.Nr
   )fullnamer
   r
   r   
is_package  s    zIPEP302Loader.is_packagec             C   s   dS )aV  Return the code object for the module identified by 'fullname'.

        Return 'None' if it's a built-in or extension module.

        If the loader doesn't have the code object but it does have the source
        code, return the compiled source code.

        Raise ImportError if the module can't be found by the importer at all.
        Nr
   )r   r
   r
   r   get_code  s    	zIPEP302Loader.get_codec             C   s   dS )a  Return the source code for the module identified by 'fullname'.

        Return a string, using newline characters for line endings, or None
        if the source is not available.

        Raise ImportError if the module can't be found by the importer at all.
        Nr
   )r   r
   r
   r   
get_source*  s    zIPEP302Loader.get_sourcec             C   s   dS )zReturn the value of '__file__' if the named module was loaded.

        If the module is not found, raise ImportError.
        Nr
   )r   r
   r
   r   get_filename3  s    zIPEP302Loader.get_filenameN)	r   r   r   r   r   r   r   r   r   r
   r
   r
   r   r     s   	r   c               @   s   e Zd ZdZdS )IPackageOverridesz% Utility for pkg_resources overrides N)r   r   r   r   r
   r
   r
   r   r   :  s   r   ZHTTP_X_VHM_ROOTc               @   s   e Zd ZdZdS )
ILocalizerz# Localizer for a specific language N)r   r   r   r   r
   r
   r
   r   r   C  s   r   c               @   s   e Zd Zdd ZdS )ILocaleNegotiatorc             C   s   dS )z Return a locale name Nr
   )r	   r
   r
   r   r   H  s    zILocaleNegotiator.__call__N)r   r   r   r   r
   r
   r
   r   r   G  s   r   c               @   s   e Zd ZdZdS )ITranslationDirectorieszSA list object representing all known translation directories
    for an applicationN)r   r   r   r   r
   r
   r
   r   r   L  s   r   c               @   s   e Zd ZdZdS )IDefaultPermissionzA string object representing the default permission to be used
    for all view configurations which do not explicitly declare their
    own.N)r   r   r   r   r
   r
   r
   r   r   Q  s   r   c               @   s@   e Zd ZdZedZedZedZedZedZ	edZ
dS )	IDefaultCSRFOptionszAn object representing the default CSRF settings to be used for
    all view configurations which do not explicitly declare their own.zkBoolean attribute. If ``True``, then CSRF checks will be enabled by default for the view unless overridden.z1The key to be matched in the body of the request.z-The header to be matched with the CSRF token.z,A set of safe methods that skip CSRF checks.z.A callback to disable CSRF checks per-request.ziBoolean.  If false, a request lacking both an ``Origin`` and ``Referer`` header will fail the CSRF check.N)r   r   r   r   r   Zrequire_csrftokenheaderZsafe_methodscallbackZallow_no_originr
   r
   r
   r   r   W  s   r   c               @   s   e Zd ZdZdd ZdS )ISessionFactoryzeAn interface representing a factory which accepts a request object and
    returns an ISession objectc             C   s   dS )z Return an ISession object Nr
   )r	   r
   r
   r   r   m  s    zISessionFactory.__call__N)r   r   r   r   r   r
   r
   r
   r   r   i  s   r   c               @   sN   e Zd ZdZedZedZdd Zdd Zdd
dZ	dddZ
dddZdS )ISessiona  An interface representing a session (a web session object,
    usually accessed via ``request.session``.

    Keys and values of a session must be JSON-serializable.

    .. warning::

        In :app:`Pyramid` 2.0 the session was changed to only be required to
        support types that can be serialized using JSON. It's recommended to
        switch any session implementations to support only JSON and to only
        store primitive types in sessions. See
        :ref:`upgrading_session_20` for more information about why this
        change was made.

    .. versionchanged:: 1.9

        Sessions are no longer required to implement ``get_csrf_token`` and
        ``new_csrf_token``. CSRF token support was moved to the pluggable
        :class:`pyramid.interfaces.ICSRFStoragePolicy` configuration hook.

    .. versionchanged:: 2.0

        Sessions now need to be JSON-serializable. This is more strict than
        the previous requirement of pickleable objects.

    z-Integer representing Epoch time when created.z4Boolean attribute.  If ``True``, the session is new.c               C   s   dS )ay  Invalidate the session.  The action caused by
        ``invalidate`` is implementation-dependent, but it should have
        the effect of completely dissociating any data stored in the
        session with the current request.  It might set response
        values (such as one which clears a cookie), or it might not.

        An invalidated session may be used after the call to ``invalidate``
        with the effect that a new session is created to store the data. This
        enables workflows requiring an entirely new session, such as in the
        case of changing privilege levels or preventing fixation attacks.
        Nr
   r
   r
   r
   r   
invalidate  s    zISession.invalidatec               C   s   dS )aq  Mark the session as changed. A user of a session should
        call this method after he or she mutates a mutable object that
        is *a value of the session* (it should not be required after
        mutating the session itself).  For example, if the user has
        stored a dictionary in the session under the key ``foo``, and
        he or she does ``session['foo'] = {}``, ``changed()`` needn't
        be called.  However, if subsequently he or she does
        ``session['foo']['a'] = 1``, ``changed()`` must be called for
        the sessioning machinery to notice the mutation of the
        internal dictionary.Nr
   r
   r
   r
   r   changed  s    
zISession.changedr&   Tc             C   s   dS )a:  Push a flash message onto the end of the flash queue represented
        by ``queue``.  An alternate flash message queue can used by passing
        an optional ``queue``, which must be a string.  If
        ``allow_duplicate`` is false, if the ``msg`` already exists in the
        queue, it will not be re-added.Nr
   )msgqueueZallow_duplicater
   r
   r   flash  s    zISession.flashc             C   s   dS )zPop a queue from the flash storage.  The queue is removed from
        flash storage after this message is called.  The queue is returned;
        it is a list of flash messages added by
        :meth:`pyramid.interfaces.ISession.flash`Nr
   )r   r
   r
   r   	pop_flash  s    zISession.pop_flashc             C   s   dS )zPeek at a queue in the flash storage.  The queue remains in
        flash storage after this message is called.  The queue is returned;
        it is a list of flash messages added by
        :meth:`pyramid.interfaces.ISession.flash`
        Nr
   )r   r
   r
   r   
peek_flash  s    zISession.peek_flashN)r&   T)r&   )r&   )r   r   r   r   r   creatednewr   r   r   r   r   r
   r
   r
   r   r   q  s   

r   c               @   s(   e Zd ZdZdd Zdd Zdd ZdS )	ICSRFStoragePolicyzRAn object that offers the ability to verify CSRF tokens and generate
    new ones.c             C   s   dS )zCreate and return a new, random cross-site request forgery
        protection token. The token will be an ascii-compatible unicode
        string.

        Nr
   )r	   r
   r
   r   new_csrf_token  s    z!ICSRFStoragePolicy.new_csrf_tokenc             C   s   dS )a  Return a cross-site request forgery protection token.  It
        will be an ascii-compatible unicode string.  If a token was previously
        set for this user via ``new_csrf_token``, that token will be returned.
        If no CSRF token was previously set, ``new_csrf_token`` will be
        called, which will create and set a token, and this token will be
        returned.

        Nr
   )r	   r
   r
   r   get_csrf_token  s    z!ICSRFStoragePolicy.get_csrf_tokenc             C   s   dS )aU  Determine if the supplied ``token`` is valid. Most implementations
        should simply compare the ``token`` to the current value of
        ``get_csrf_token`` but it is possible to verify the token using
        any mechanism necessary using this method.

        Returns ``True`` if the ``token`` is valid, otherwise ``False``.

        Nr
   )r	   r   r
   r
   r   check_csrf_token  s    z#ICSRFStoragePolicy.check_csrf_tokenN)r   r   r   r   r   r   r   r
   r
   r
   r   r     s   
r   c               @   sZ   e Zd ZdddZdddZdd Zddd	Zd
d Zdd Zdd Z	dd Z
dd ZdS )IIntrospectorNc             C   s   dS )zGet the IIntrospectable related to the category_name and the
        discriminator (or discriminator hash) ``discriminator``.  If it does
        not exist in the introspector, return the value of ``default``Nr
   )category_namediscriminatorrK   r
   r
   r   rL     s    zIIntrospector.getc             C   s   dS )a  Get a sequence of dictionaries in the form
        ``[{'introspectable':IIntrospectable, 'related':[sequence of related
        IIntrospectables]}, ...]`` where each introspectable is part of the
        category associated with ``category_name`` .

        If the category named ``category_name`` does not exist in the
        introspector the value passed as ``default`` will be returned.

        If ``sort_key`` is ``None``, the sequence will be returned in the
        order the introspectables were added to the introspector.  Otherwise,
        sort_key should be a function that accepts an IIntrospectable and
        returns a value from it (ala the ``key`` function of Python's
        ``sorted`` callable).Nr
   )r   rK   sort_keyr
   r
   r   get_category  s    zIIntrospector.get_categoryc               C   s   dS )zMReturn a sorted sequence of category names known by
        this introspectorNr
   r
   r
   r
   r   
categories  s    zIIntrospector.categoriesc             C   s   dS )a'  Get a sequence of tuples in the form ``[(category_name,
        [{'introspectable':IIntrospectable, 'related':[sequence of related
        IIntrospectables]}, ...])]`` representing all known
        introspectables.  If ``sort_key`` is ``None``, each introspectables
        sequence will be returned in the order the introspectables were added
        to the introspector.  Otherwise, sort_key should be a function that
        accepts an IIntrospectable and returns a value from it (ala the
        ``key`` function of Python's ``sorted`` callable).Nr
   )r   r
   r
   r   categorized  s    zIIntrospector.categorizedc             C   s   dS )a>  Remove the IIntrospectable related to ``category_name`` and
        ``discriminator`` from the introspector, and fix up any relations
        that the introspectable participates in. This method will not raise
        an error if an introspectable related to the category name and
        discriminator does not exist.Nr
   )r   r   r
   r
   r   remove  s    zIIntrospector.removec             C   s   dS )zReturn a sequence of IIntrospectables related to the
        IIntrospectable ``intr``. Return the empty sequence if no relations
        for exist.Nr
   )intrr
   r
   r   related  s    zIIntrospector.relatedc             C   s   dS )a  Add the IIntrospectable ``intr`` (use instead of
        :meth:`pyramid.interfaces.IIntrospector.add` when you have a custom
        IIntrospectable). Replaces any existing introspectable registered
        using the same category/discriminator.

        This method is not typically called directly, instead it's called
        indirectly by :meth:`pyramid.interfaces.IIntrospector.register`Nr
   )r   r
   r
   r   rt     s    zIIntrospector.addc              G   s   dS )a?  Given any number of ``(category_name, discriminator)`` pairs
        passed as positional arguments, relate the associated introspectables
        to each other. The introspectable related to each pair must have
        already been added via ``.add`` or ``.add_intr``; a :exc:`KeyError`
        will result if this is not true.  An error will not be raised if any
        pair has already been associated with another.

        This method is not typically called directly, instead it's called
        indirectly by :meth:`pyramid.interfaces.IIntrospector.register`
        Nr
   )pairsr
   r
   r   relate  s    
zIIntrospector.relatec              G   s   dS )a<  Given any number of ``(category_name, discriminator)`` pairs
        passed as positional arguments, unrelate the associated introspectables
        from each other. The introspectable related to each pair must have
        already been added via ``.add`` or ``.add_intr``; a :exc:`KeyError`
        will result if this is not true.  An error will not be raised if any
        pair is not already related to another.

        This method is not typically called directly, instead it's called
        indirectly by :meth:`pyramid.interfaces.IIntrospector.register`
        Nr
   )r   r
   r
   r   unrelate&  s    
zIIntrospector.unrelate)N)NN)N)r   r   r   rL   r   r   r   r   r   rt   r   r   r
   r
   r
   r   r     s   



	r   c               @   sh   e Zd ZdZedZedZedZedZedZ	edZ
edZd	d
 Zdd Zdd Zdd ZdS )IIntrospectablea  An introspectable object used for configuration introspection.  In
    addition to the methods below, objects which implement this interface
    must also implement all the methods of Python's
    ``collections.MutableMapping`` (the "dictionary interface"), and must be
    hashable.z)Text title describing this introspectablez-Text type name describing this introspectablezVinteger order in which registered with introspector (managed by introspector, usually)zintrospection category namezAintrospectable discriminator (within category) (must be hashable)z$an integer hash of the discriminatorzAn IActionInfo object representing the caller that invoked the creation of this introspectable (usually a sentinel until updated during self.register)c             C   s   dS )zIndicate an intent to relate this IIntrospectable with another
        IIntrospectable (the one associated with the ``category_name`` and
        ``discriminator``) during action execution.
        Nr
   )r   r   r
   r
   r   r   L  s    zIIntrospectable.relatec             C   s   dS )zIndicate an intent to break the relationship between this
        IIntrospectable with another IIntrospectable (the one associated with
        the ``category_name`` and ``discriminator``) during action execution.
        Nr
   )r   r   r
   r
   r   r   R  s    zIIntrospectable.unrelatec             C   s   dS )a  Register this IIntrospectable with an introspector.  This method
        is invoked during action execution.  Adds the introspectable and its
        relations to the introspector.  ``introspector`` should be an object
        implementing IIntrospector.  ``action_info`` should be a object
        implementing the interface :class:`pyramid.interfaces.IActionInfo`
        representing the call that registered this introspectable.
        Pseudocode for an implementation of this method:

        .. code-block:: python

            def register(self, introspector, action_info):
                self.action_info = action_info
                introspector.add(self)
                for methodname, category_name, discriminator in self._relations:
                    method = getattr(introspector, methodname)
                    method((i.category_name, i.discriminator),
                           (category_name, discriminator))
        Nr
   )Zintrospectoraction_infor
   r
   r   registerX  s    zIIntrospectable.registerc               C   s   dS )zIntrospectables must be hashable.  The typical implementation of
        an introsepectable's __hash__ is::

          return hash((self.category_name,) + (self.discriminator,))
        Nr
   r
   r
   r
   r   __hash__l  s    zIIntrospectable.__hash__N)r   r   r   r   r   title	type_namer   r   r   Zdiscriminator_hashr   r   r   r   r   r
   r
   r
   r   r   3  s   r   c               @   s(   e Zd ZdZedZedZdd ZdS )IActionInfozClass which provides code introspection capability associated with an
    action.  The ParserInfo class used by ZCML implements the same interface.
    z,Filename of action-invoking code as a stringzStarting line number in file (as an integer) of action-invoking code.This will be ``None`` if the value could not be determined.c               C   s   dS )zhReturn a representation of the action information (including
        source code from file, if possible)Nr
   r
   r
   r
   r   __str__  s    zIActionInfo.__str__N)r   r   r   r   r   fileliner   r
   r
   r
   r   r   u  s
   r   c               @   s@   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dS )IAssetDescriptorz%
    Describes an :term:`asset`.
    c               C   s   dS )zx
        Returns the absolute asset specification for this asset
        (e.g. ``mypackage:templates/foo.pt``).
        Nr
   r
   r
   r
   r   absspec  s    zIAssetDescriptor.absspecc               C   s   dS )zJ
        Returns an absolute path in the filesystem to the asset.
        Nr
   r
   r
   r
   r   abspath  s    zIAssetDescriptor.abspathc               C   s   dS )z
        Returns an input stream for reading asset contents.  Raises an
        exception if the asset is a directory or does not exist.
        Nr
   r
   r
   r
   r   stream  s    zIAssetDescriptor.streamc               C   s   dS )zT
        Returns True if the asset is a directory, otherwise returns False.
        Nr
   r
   r
   r
   r   isdir  s    zIAssetDescriptor.isdirc               C   s   dS )z
        Returns iterable of filenames of directory contents.  Raises an
        exception if asset is not a directory.
        Nr
   r
   r
   r
   r   listdir  s    zIAssetDescriptor.listdirc               C   s   dS )zH
        Returns True if asset exists, otherwise returns False.
        Nr
   r
   r
   r
   r   exists  s    zIAssetDescriptor.existsN)
r   r   r   r   r   r   r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd ZdZdS )IJSONAdapterzs
    Marker interface for objects that can convert an arbitrary object
    into a JSON-serializable primitive.
    N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd ZdZdS )IPredicateListz) Interface representing a predicate list N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s,   e Zd ZedZedZedZdd ZdS )IPredicateInfozKThe "current package" where the predicate configuration statement was foundzBThe "current" application registry where the predicate was invokedzEThe deployment settings dictionary related to the current applicationc             C   s   dS )a*  Resolve the :term:`dotted Python name` ``dotted`` to a
        global Python object.  If ``dotted`` is not a string, return
        it without attempting to do any name resolution.  If
        ``dotted`` is a relative dotted name (e.g. ``.foo.bar``,
        consider it relative to the ``package``.Nr
   )r'   r
   r
   r   maybe_dotted  s    zIPredicateInfo.maybe_dottedN)r   r   r   r   rY   r[   r\   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd Zdd ZdS )IPredicateFactoryc             C   s   dS )zQ
        Create a a :class:`.IPredicate` instance for a specific value.

        Nr
   )r'   r^   r
   r
   r   r     s    zIPredicateFactory.__call__N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd Zdd Zdd ZdS )
IPredicatec               C   s   dS )z
        A textual description of the predicate used in the introspector.

        For example, ``'content_type = application/json'`` for a
        ``ContentTypePredicate`` with a ``value == 'application/json'``.

        Nr
   r
   r
   r
   r   text  s    zIPredicate.textc               C   s   dS )z
        A unique string for the predicate containing both the name and value.

        Often implementations simply set ``phash = text``.

        Nr
   r
   r
   r
   r   r     s    zIPredicate.phashN)r   r   r   r   r   r
   r
   r
   r   r     s   	r   c               @   s   e Zd Zdd ZdS )IRoutePredicatec             C   s   dS )a|  
        The ``info`` object is a dictionary containing two keys:

        - "match" is a dictionary of parameters that becomes
          ``request.matchdict`` if the route is selected
          (all route predicates match).

        - "route" is the :class:`.IRoute` object being matched.

        Return ``True`` if the route should be selected or ``False`` otherwise.

        Nr
   )r^   r	   r
   r
   r   r     s    zIRoutePredicate.__call__N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd Zdd ZdS )ISubscriberPredicatec              G   s   dS )z
        The ``args`` is usually just a single ``event`` argument sent to
        ``registry.notify``.

        Return ``True`` if the subscriber should be executed for the given
        arguments or ``False`` otherwise.

        Nr
   )argsr
   r
   r   r     s    zISubscriberPredicate.__call__N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd Zdd ZdS )IViewPredicatec             C   s   dS )zy
        Return ``True`` if the view should be selected for the given
        arguments or ``False`` otherwise.

        Nr
   )rg   r	   r
   r
   r   r     s    zIViewPredicate.__call__N)r   r   r   r   r
   r
   r
   r   r     s   r   c               @   s   e Zd ZedZdd ZdS )IViewDeriverzuA list of supported options to be passed to :meth:`pyramid.config.Configurator.add_view`. This attribute is optional.c             C   s   dS )a  
        Derive a new view from the supplied view.

        View options, package information and registry are available on
        ``info``, an instance of :class:`pyramid.interfaces.IViewDeriverInfo`.

        The ``view`` is a callable accepting ``(context, request)``.

        Nr
   )r   r^   r
   r
   r   r     s    	zIViewDeriver.__call__N)r   r   r   r   optionsr   r
   r
   r
   r   r     s   r   c               @   sH   e Zd ZdZedZedZedZedZedZ	edZ
edZd	S )
IViewDeriverInfozgAn object implementing this interface is passed to every
    :term:`view deriver` during configuration.z=The "current" application registry where the view was createdzFThe "current package" where the view configuration statement was foundzEThe deployment settings dictionary related to the current applicationzYThe view options passed to the view, including any default values that were not overridenz)The list of predicates active on the viewz&The original view object being wrappedz,The view will only be invoked for exceptionsN)r   r   r   r   r   r[   rY   r\   r   r   Zoriginal_viewZexception_onlyr
   r
   r
   r   r     s   r   c               @   s   e Zd ZdZdS )IViewDeriversz" Interface for view derivers list N)r   r   r   r   r
   r
   r
   r   r   7  s   r   c               @   s   e Zd ZdZdd ZdS )ICacheBusterz
    A cache buster modifies the URL generation machinery for
    :meth:`~pyramid.request.Request.static_url`. See :ref:`cache_busting`.

    .. versionadded:: 1.6
    c             C   s   dS )a  
        Modifies a subpath and/or keyword arguments from which a static asset
        URL will be computed during URL generation.

        The ``subpath`` argument is a path of ``/``-delimited segments that
        represent the portion of the asset URL which is used to find the asset.
        The ``kw`` argument is a dict of keywords that are to be passed
        eventually to :meth:`~pyramid.request.Request.static_url` for URL
        generation.  The return value should be a two-tuple of
        ``(subpath, kw)`` where ``subpath`` is the relative URL from where the
        file is served and ``kw`` is the same input argument. The return value
        should be modified to include the cache bust token in the generated
        URL.

        The ``kw`` dictionary contains extra arguments passed to
        :meth:`~pyramid.request.Request.static_url` as well as some extra
        items that may be usful including:

          - ``pathspec`` is the path specification for the resource
            to be cache busted.

          - ``rawspec`` is the original location of the file, ignoring
            any calls to :meth:`pyramid.config.Configurator.override_asset`.

        The ``pathspec`` and ``rawspec`` values are only different in cases
        where an asset has been mounted into a virtual location using
        :meth:`pyramid.config.Configurator.override_asset`. For example, with
        a call to ``request.static_url('myapp:static/foo.png'), the
        ``pathspec`` is ``myapp:static/foo.png`` whereas the ``rawspec`` may
        be ``themepkg:bar.png``, assuming a call to
        ``config.override_asset('myapp:static/foo.png', 'themepkg:bar.png')``.
        Nr
   )r	   subpathre   r
   r
   r   r   C  s     zICacheBuster.__call__N)r   r   r   r   r   r
   r
   r
   r   r   ;  s   r   iiiN)UZzope.interfacer   r   r   ZIAfterTraversalr   r   r   r   ZIWSGIApplicationCreatedEventr   rA   rB   rD   rV   rW   r]   r_   ra   rd   rf   rm   rp   rr   r|   r}   r~   Zcombinedr   r   r   r   r   r   r   r   r   r   r   r   r   r   ZITraverserFactoryr   r   r   r   r   r   ZILoggerr   r   r   r   r   r   ZVH_ROOT_KEYr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ZPHASE0_CONFIGZPHASE1_CONFIGZPHASE2_CONFIGZPHASE3_CONFIGr
   r
   r
   r   <module>   s   

  	8	#<*	
		4($)Q QB'	/