+
    üÐ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+   ø€ ÷  ñ  ™#ð  ©X°c¹6°kÕ-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 —O’O Q C¨Ö2ˆDÜ+2°4Ð9IÈ2Ó+NˆNØ×!Ñ! $Ô'Ü�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ˆÜ  Ð)9¸2Ó>ˆØÔ%ØŸ/™/Ó)Ü*¨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#   € ÷ ñ ”8˜C¤˜KÕ(ð ¬Vñ r$   c                 ó<   € \        4       pV P                  Vn        V# r5   )r   rD   )rI   Úexposes   & r!   ÚexposerrL   o   s   € Ü‹X€FØ—]‘]€F„NØ€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   ø€ ÷ 	ñ 	Ùð	á	‘8™HÕ% 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    ø€ ÷ ñ ™h¡xÕ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ñ ˆCƒL€Ùˆe˜8 C¨ KÕ0Ô1€÷Jñ JõZð 	ôó 	ðñ. ˆ[Ó÷:ð :ó ò:r$   