ó
    ×›‘hŒ  ã                   ó  • S SK r S SKJrJrJrJrJrJrJrJ	r	  S SK
Jr  S SKJrJrJr  S SKJrJrJr  \(       a  S SKJrJr  \" S5      r\" S\S	\4   S
9r " S S5      rS\S	\4   S\4S jr\SS j5       r\" \5       " S S5      5       rg)é    N)ÚTYPE_CHECKINGÚAnyÚCallableÚListÚOptionalÚTypeVarÚUnionÚoverload)Úimplementer)ÚMissingRenderMethodÚMissingTemplateLoaderÚUnexposedMethodError)ÚIRenderableÚIRequestÚITemplateLoader)ÚFlattenableÚTagÚTÚ_Tc.)Úboundc                   óÈ   • \ rS rSrSrS\S\S\4   S\4S jr\" 5       r	\
S\S	\S\S\4   4S
 j5       r\
S\S	\S\S\\S\4   \4   4S j5       r\	4S\S	\S\S\4S jjrSrg)ÚExposeé"   a  
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.
ÚfÚfuncObjs.Úreturnc                óš   • [         R                  " U/U5       H.  n[        US/ 5      nUR                  U 5        [	        USU5        M0     U$ )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        ÚXC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/web/_element.pyÚ__call__ÚExpose.__call__,   sL   € ô8 —O’O Q C¨Ö2ˆDÜ+2°4Ð9IÈ2Ó+NˆNØ×!Ñ! $Ô'Ü�DÐ*¨NÖ;ñ 3ð ˆó    ÚinstanceÚ
methodNamec                 ó   • g ©N© )r$   r*   r+   s      r&   ÚgetÚ
Expose.getP   s   € àr)   Údefaultc                 ó   • g r-   r.   )r$   r*   r+   r1   s       r&   r/   r0   T   s   € ð 	r)   c                 óx   • [        XS5      n[        US/ 5      nX;  a  X0R                  L a  [        X5      eU$ U$ )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$   r*   r+   r1   Úmethodr   s         r&   r/   r0   Z   sD   € ô ˜¨tÓ4ˆÜ  Ð)9¸2Ó>ˆØÓ%ØŸ/™/Ò)Ü*¨4Ó<Ð<ØˆNØˆr)   r.   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Úobjectr'   r4   r
   Ústrr   r/   r   r	   Ú__static_attributes__r.   r)   r&   r   r   "   sÜ   † ñð ˜#ð  ¨X°c¸6°kÑ-Bð  Àsô  ñD “€Jàð˜Fð °ð ¸ÀÀcÀÑ8Jó ó ðð ðØðØ,/ðØ:;ðà	ˆx˜˜S˜Ñ! 1Ð$Ñ	%óó ðð DNñØðØ,/ðØ:@ðà	÷ð r)   r   Úthunkr   c                 ó<   • [        5       nU R                  Ul        U$ r-   )r   r:   )r>   Úexposes     r&   ÚexposerrA   o   s   € Ü‹X€FØ—]‘]€F„NØ€Mr)   c                  ó   • g)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>
Nr.   r.   r)   r&   ÚrendererrC   u   s   � r)   c                   ó„   • \ rS rSr% SrSr\\   \S'   SS\\   4S jjr	S\
S\\\   S/S	4   4S
 jrS\\   SS	4S jrSrg)ÚElementé�   ab  
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}.
NÚloaderc                 ó   • Ub  Xl         g g r-   ©rG   )r$   rG   s     r&   Ú__init__ÚElement.__init__«   s   € ØÑØ �Kð r)   Únamer   r   r   c                 óN   • [         R                  XS5      nUc  [        X5      eU$ )z-
Look up and return the named render method.
N)rC   r/   r   )r$   rL   r5   s      r&   ÚlookupRenderMethodÚElement.lookupRenderMethod¯   s)   € ô —‘˜d¨$Ó/ˆØ‰>Ü% dÓ1Ð1Øˆr)   Úrequestc                 óV   • U R                   nUc  [        U 5      eUR                  5       $ )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}.)
)rG   r   Úload)r$   rP   rG   s      r&   ÚrenderÚElement.renderº   s)   € ð —‘ˆØ‰>Ü'¨Ó-Ð-Ø�{‰{‹}Ðr)   rI   r-   )r6   r7   r8   r9   r:   rG   r   r   Ú__annotations__rJ   r<   r   r   rN   rS   r=   r.   r)   r&   rE   rE   �   sj   ‡ ñð4 )-€FˆH�_Ñ%Ó,ñ!˜x¨Ñ8õ !ð	Øð	à	�8˜HÑ% uÐ-¨}Ð<Ñ	=ô	ð˜h xÑ0ð °]÷ r)   rE   )r   N)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   rA   rC   rE   r.   r)   r&   Ú<module>r[      s²   ðó
 ÷	÷ 	ó 	õ '÷ñ ÷
 DÑ Cæß5ñ ˆCƒL€Ùˆe˜8 C¨ KÑ0Ñ1€÷Jñ JðZ�8˜C ˜KÑ(ð ¨Vô ð 	óó 	ðñ. ˆ[Ó÷:ð :ó ñ:r)   