+
    Dfj                         ^ RI t ^ RIHtHtHtHtHtHtHtH	t	 ^ RI
Ht ^ RIHtHtHt ^ RIHtHtHt ]'       d	   ^ RIHtHt ]! R4      t]! R]R	]3,          R
7      t ! R R4      tR R lt]R R l4       t]! ]4       ! R R4      4       tR# )    N)TYPE_CHECKINGAnyCallableListOptionalTypeVarUnionoverload)implementer)MissingRenderMethodMissingTemplateLoaderUnexposedMethodError)IRenderableIRequestITemplateLoader)FlattenableTagT_Tc.)boundc                      a  ] tR t^"t o RtV 3R lR lt]! 4       t]V 3R lR l4       t	]V 3R lR l4       t	]3V 3R lR	 llt	R
t
V tR# )Exposea  
Helper for exposing methods for various uses using a simple decorator-style
callable.

Instances of this class can be called with one or more functions as
positional arguments.  The names of these functions will be added to a list
on the class object of which they are methods.
c                @   < V ^8  d   QhRS[ RS[RS[3,          RS[ /# )   ffuncObjs.return)r   r   object)format__classdict__s   "6/usr/lib/python3/dist-packages/twisted/web/_element.py__annotate__Expose.__annotate__,   s+        #  Xc6k-B  s      c                   \         P                  ! V.V4       F.  p\        VR. 4      pVP                  V 4       \	        VRV4       K0  	  V# )a  
Add one or more functions to the set of exposed functions.

This is a way to declare something about a class definition, similar to
L{zope.interface.implementer}.  Use it like this::

    magic = Expose('perform extra magic')
    class Foo(Bar):
        def twiddle(self, x, y):
            ...
        def frob(self, a, b):
            ...
        magic(twiddle, frob)

Later you can query the object::

    aFoo = Foo()
    magic.get(aFoo, 'twiddle')(x=1, y=2)

The call to C{get} will fail if the name it is given has not been
exposed using C{magic}.

@param funcObjs: One or more function objects which will be exposed to
the client.

@return: The first of C{funcObjs}.
exposedThrough)	itertoolschaingetattrappendsetattr)selfr   r   fObjr&   s   ""*  r!   __call__Expose.__call__,   sL    8 OOQC2D+249I2+NN!!$'D*N; 3 r$   c                @   < V ^8  d   QhRS[ RS[RS[RS[3,          /# )r   instance
methodNamer   .)r   strr   r   )r   r    s   "r!   r"   r#   Q   s+      F  c8J r$   c                    R # N )r,   r1   r2   s   &&&r!   get
Expose.getP   s    r$   c                \   < V ^8  d   QhRS[ RS[RS[RS[S[RS[3,          S[3,          /# )r   r1   r2   defaultr   .)r   r3   r   r	   r   r   )r   r    s   "r!   r"   r#   U   s@      ,/:;	xS!1$	%r$   c                    R # r5   r6   )r,   r1   r2   r:   s   &&&&r!   r7   r8   T   s     	r$   c                2   < V ^8  d   QhRS[ RS[RS[ RS[ /# )r   r1   r2   r:   r   )r   r3   )r   r    s   "r!   r"   r#   Z   s-      ,/:@	r$   c                |    \        WR4      p\        VR. 4      pW9  d   W0P                  J d   \        W4      hV# V# )a  
Retrieve an exposed method with the given name from the given instance.

@raise UnexposedMethodError: Raised if C{default} is not specified and
there is no exposed method with the given name.

@return: A callable object for the named method assigned to the given
instance.
Nr&   )r)   
_nodefaultr   )r,   r1   r2   r:   methodr&   s   &&&&  r!   r7   r8   Z   sD     t4 )92>%//)*4<<Nr$   r6   N)__name__
__module____qualname____firstlineno____doc__r.   r   r>   r
   r7   __static_attributes____classdictcell__r    s   @r!   r   r   "   sZ        D J    DN  r$   r   c                J    V ^8  d   QhR\         R\        3,          R\        /# )r   thunk.r   )r   r   r   )r   s   "r!   r"   r"   o   s#      8CK( V r$   c                 <    \        4       pV P                  Vn        V# r5   )r   rD   )rI   exposes   & r!   exposerrL   o   s    XF]]FNMr$   c                    V ^8  d   QhRR/# )r   r   Nr6   )r   s   "r!   r"   r"   v   s      $ r$   c                     R# )a  
Decorate with L{renderer} to use methods as template render directives.

For example::

    class Foo(Element):
        @renderer
        def twiddle(self, request, tag):
            return tag('Hello, world.')

    <div xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1">
        <span t:render="twiddle" />
    </div>

Will result in this final output::

    <div>
        <span>Hello, world.</span>
    </div>
Nr6   r6   r$   r!   rendererrO   u   s    r$   c                   n   a  ] tR t^t o RtRtRV 3R lR lltV 3R lR ltV 3R lR ltV 3R	 lt	R
t
V tR# )Elementab  
Base for classes which can render part of a page.

An Element is a renderer that can be embedded in a stan document and can
hook its template (from the loader) up to render methods.

An Element might be used to encapsulate the rendering of a complex piece of
data which is to be displayed in multiple different contexts.  The Element
allows the rendering logic to be easily re-used in different ways.

Element returns render methods which are registered using
L{twisted.web._element.renderer}.  For example::

    class Menu(Element):
        @renderer
        def items(self, request, tag):
            ....

Render methods are invoked with two arguments: first, the
L{twisted.web.http.Request} being served and second, the tag object which
"invoked" the render method.

@ivar loader: The factory which will be used to load documents to
    return from C{render}.
Nc                0   < V ^8  d   QhRS[ S[,          /# r   loaderr   r   )r   r    s   "r!   r"   Element.__annotate__   s     ! !x8 !r$   c                    Ve	   Wn         R # R # r5   rT   )r,   rT   s   &&r!   __init__Element.__init__   s     K r$   c                N   < V ^8  d   QhRS[ RS[S[S[,          R.R3,          /# )r   namer   r   r   )r3   r   r   r   )r   r    s   "r!   r"   rV      s1     	 			8H%u-}<	=	r$   c                P    \         P                  WR4      pVf   \        W4      hV# )z-
Look up and return the named render method.
N)rO   r7   r   )r,   r\   r?   s   && r!   lookupRenderMethodElement.lookupRenderMethod   s)     d$/>%d11r$   c                4   < V ^8  d   QhRS[ S[,          RR/# )r   requestr   r   )r   r   )r   r    s   "r!   r"   rV      s       hx0 ] r$   c                X    V P                   pVf   \        V 4      hVP                  4       # )a  
Implement L{IRenderable} to allow one L{Element} to be embedded in
another's template or rendering output.

(This will simply load the template from the C{loader}; when used in a
template, the flattening engine will keep track of this object
separately as the object to lookup renderers on and call
L{Element.renderer} to look them up.  The resulting object from this
method is not directly associated with this L{Element}.)
)rT   r   load)r,   ra   rT   s   && r!   renderElement.render   s)     >'--{{}r$   c                6   < V ^8  d   Qh/ S[ S[,          ;R&   # rS   rU   )r   r    s   "r!   r"   rV      s     8 _%,9 r$   rX   r5   )r@   rA   rB   rC   rD   rT   rY   r^   rd   __annotate_func__rE   rF   rG   s   @r!   rQ   rQ      s7     4 )-F! !	 	 [  r$   rQ   )r'   typingr   r   r   r   r   r   r	   r
   zope.interfacer   twisted.web.errorr   r   r   twisted.web.iwebr   r   r   twisted.web.templater   r   r   r   r   r   rL   rO   rQ   r6   r$   r!   <module>rm      s   
 	 	 	 ' 
 D C5 CLe8CK01J JZ 	 	. [: : :r$   