
    (phZ                        S r SSKrSSKrSSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SSKJr  SSKJ	r  / S	QrS
rSrSrSr\" 5       r\" 5       rS rS r " S S5      r\r\ " S S5      5       r " S S5      r\ " S S\\5      5       r\" / S5      r " S S\5      r  " S S\!5      r"\"" S\\ \4SS05      r#S  r$ " S! S\#5      r%\%" S"S#S$9r&S% \&l'        \&RQ                  \&5        \&RR                  \&4:X  d   e\&\ l*        \&\	l*         " S& S'\%5      r+ " S( S)\5      r, " S* S+\,5      r-S4S, jr.S5S- jr/S. r0SS/K1J2r2  SS0K1J3r3  SS1KJ4r4  SS2KJ5r5  SS3K1J6r6  \ RQ                  \6\65        g)6z Interface object implementation
    N)FunctionType)
MethodTypeUnion)ro)_use_c_impl)Invalid)InterfaceClassSpecificationadapter_hooks      __interface_tagged_values____interface_methods__c                     [         R                  " S5      R                  nUR                  [        0 5      nUR                  S/ 5      nUR                  U 5        [        $ )N   
invariants)sys	_getframef_locals
setdefaultTAGGED_DATAappend_decorator_non_return)callr   tagsr   s       K/var/www/html/venv/lib/python3.13/site-packages/zope/interface/interface.py	invariantr   2   sL    }}Q((H{B/Dr2Jd      c                     [         R                  " S5      R                  nUR                  [        0 5      nXU '   [
        $ )z;Attaches a tagged value to an interface at definition time.r   )r   r   r   r   r   r   )keyvaluer   tagged_valuess       r   taggedValuer$   :   s6    }}Q((H''R8M#  r   c                   X    \ rS rSrSr SS jrS rS rS rSS jr	S	 r
S
 r\	r\r\
rSrg)ElementB   zA
Default implementation of `zope.interface.interfaces.IElement`.
c                 j    U(       d  UR                  S5      S:  a  UnS nXl        X l        S U l        g )N r   )find__name____doc___Element__tagged_values)selfr+   r,   s      r   __init__Element.__init__L   s5     8==-2GH   $r   c                     U R                   $ )z Returns the name of the object. r+   r.   s    r   getNameElement.getNameY   s    }}r   c                     U R                   $ )z*Returns the documentation for the object. )r,   r3   s    r   getDocElement.getDoc]   s    ||r   c                 X    U R                   (       d  [        U5      eU R                   U   $ )Returns the value associated with 'tag'. )r-   KeyError)r.   tags     r   getTaggedValueElement.getTaggedValueh   s&    ##3-##C((r   Nc                 ^    U R                   (       a  U R                   R                  X5      $ U$ r:   )r-   get)r.   r=   defaults      r   queryTaggedValueElement.queryTaggedValuen   s3     !! ##''
 	/'.	/r   c                 \    U R                   (       a  U R                   R                  5       $ S$ )z"Returns a collection of all tags.  )r-   keysr3   s    r   getTaggedValueTagsElement.getTaggedValueTagst   s$    .2.B.Bt##((*JJr   c                 H    U R                   c  0 U l         X R                   U'   g)zAssociates 'value' with 'key'. N)r-   r.   r=   r"   s      r   setTaggedValueElement.setTaggedValuex   s$    '#%D $)S!r   )r,   r+   __tagged_values) N)r+   
__module____qualname____firstlineno__r,   r/   r4   r7   r>   rC   rH   rL   queryDirectTaggedValuegetDirectTaggedValuegetDirectTaggedValueTags__static_attributes__rF   r   r   r&   r&   B   sD     !#$)/K* .)1r   r&   c                   .    \ rS rSrSrS rS rS r\rSr	g)SpecificationBase   )_implied_dependents_bases_v_attrs__iro____sro____weakref__c                 4    [        U5      nXR                  ;   $ )z2Is the interface implemented by an object
        )
providedByr[   )r.   obspecs      r   rc   SpecificationBase.providedBy   s     "~}}$$r   c                 4    [        U5      nXR                  ;   $ )zTest whether the specification is implemented by a class or factory.

Raise TypeError if argument is neither a class nor a callable.
)implementedByr[   )r.   clsre   s      r   rh   SpecificationBase.implementedBy   s    
 S!}}$$r   c                     XR                   ;   $ )zCIs the interface the same as or extend the given interface
        r[   )r.   	interfaces     r   isOrExtendsSpecificationBase.isOrExtends   s     MM))r   rF   N)
r+   rQ   rR   rS   	__slots__rc   rh   rn   __call__rW   rF   r   r   rY   rY      s    
I%%*
 Hr   rY   c                   6    \ rS rSrSrS rS rS rS rS r	Sr
g)	NameAndModuleComparisonMixin   rF   c                     XL a  gUc  gU R                   U R                  4n UR                   UR                  4nX#:  X#:  -
  $ ! [         a	    [        s $ f = f)a#  
Compare *self* to *other* based on ``__name__`` and ``__module__``.

Return 0 if they are equal, return 1 if *self* is
greater than *other*, and return -1 if *self* is less than
*other*.

If *other* does not have ``__name__`` or ``__module__``, then
return ``NotImplemented``.

.. caution::
   This allows comparison to things well outside the type hierarchy,
   perhaps not symmetrically.

   For example, ``class Foo(object)`` and ``class Foo(Interface)``
   in the same file would compare equal, depending on the order of
   operands. Writing code like this by hand would be unusual, but it
   could happen with dynamic creation of types and interfaces.

None is treated as a pseudo interface that implies the loosest
contact possible, no contract. For that reason, all interfaces
sort before None.
r   )r+   rQ   AttributeErrorNotImplemented)r.   othern1n2s       r   _compare%NameAndModuleComparisonMixin._compare   sg    0 ==mmT__-	"..%"2"23B
 BG$$	  	"!!	"s   A AAc                 D    U R                  U5      nU[        L a  U$ US:  $ Nr   r|   rx   r.   ry   cs      r   __lt__#NameAndModuleComparisonMixin.__lt__   &    MM% H1ur   c                 D    U R                  U5      nU[        L a  U$ US:*  $ r   r   r   s      r   __le__#NameAndModuleComparisonMixin.__le__   &    MM% HAvr   c                 D    U R                  U5      nU[        L a  U$ US:  $ r   r   r   s      r   __gt__#NameAndModuleComparisonMixin.__gt__   r   r   c                 D    U R                  U5      nU[        L a  U$ US:  $ r   r   r   s      r   __ge__#NameAndModuleComparisonMixin.__ge__   r   r   N)r+   rQ   rR   rS   rp   r|   r   r   r   r   rW   rF   r   r   rs   rs      s#     I%%Nr   rs   c                   `    \ rS rSrSrSrSS jrS r\S 5       r	\
4S jrS	 rS
 rS rS rSrg)InterfaceBasei  z:Base class that wants to be replaced with a C base :)
    )r+   __ibmodule___v_cached_hashNc                     Xl         X l        g rP   r+   r   )r.   namemodules      r   r/   InterfaceBase.__init__  s    "r   c                     [         erP   )NotImplementedErrorr.   conforms     r   _call_conformInterfaceBase._call_conform  s    !!r   c                     U R                   $ rP   )r   r3   s    r   __module_property__!InterfaceBase.__module_property__  s        r   c                      UR                   nUb  U R                  U5      nUb  U$ U R                  U5      nUb  U$ U[        La  U$ [        SX5      e! [         a    Sn NTf = f)z)Adapt an object to the interface
        NzCould not adapt)__conform__rw   r   	__adapt___marker	TypeError)r.   obj	alternater   adapters        r   rq   InterfaceBase.__call__  s~    	ooG ((1G"..%NG#)355  	G	s   A A#"A#c                 l    U R                  U5      (       a  U$ [         H  nU" X5      nUc  M  Us  $    g)z(Adapt an object to the receiver
        N)rc   r   )r.   r   hookr   s       r   r   InterfaceBase.__adapt__0  s;     ??3J!D4oG" "
 r   c                      U R                   $ ! [         a4    [        U R                  U R                  45      U l          U R                   $ f = frP   )r   rw   hashr+   rQ   r3   s    r   __hash__InterfaceBase.__hash__=  sK    	I&&& 	I"&t'G"HD"""	Is    0AAc                 D    U R                  U5      nU[        L a  U$ US:H  $ r   r   r   s      r   __eq__InterfaceBase.__eq__E  r   r   c                 N    XL a  gU R                  U5      nU[        L a  U$ US:g  $ )NFr   r   r   s      r   __ne__InterfaceBase.__ne__K  s.    =MM% HAvr   )r   r+   r   NN)r+   rQ   rR   rS   r,   rp   r/   r   propertyr   r   rq   r   r   r   r   rW   rF   r   r   r   r     sJ    I#" ! ! '. 6*#r   r   r   c                       \ rS rSrSrSrSr\R                  r\R                  r	SS jr
\S 5       rS rS rS	 r\" S
 \5      r\rS rS rS rSS jrSS jrSS jrSrg)r   iX  a[  Specifications

An interface specification is used to track interface declarations
and component registrations.

This class is a base class for both interfaces themselves and for
interface specifications (declarations).

Specifications are mutable.  If you reassign their bases, their
relations with other specifications are adjusted accordingly.
rF   Nc                 x    S U l         SU l        0 U l        S U l        SU l        SU l        [        U5      U l        g )NrF   )r\   r]   r[   r^   r_   r`   tuple	__bases__)r.   basess     r   r/   Specification.__init__n  s:      ur   c                 h    U R                   c  [        R                  " 5       U l         U R                   $ rP   )r\   weakrefWeakKeyDictionaryr3   s    r   
dependentsSpecification.dependents  s+    #&88:Dr   c                 \    U R                   R                  US5      S-   U R                  U'   g )Nr   r   )r   rA   r\   )r.   	dependents     r   	subscribeSpecification.subscribe  s(    &*oo&9&9)Q&G!&K#r   c                      U R                   U   nUS-  nU(       d  U R                  U	 g US:  d   eX R                  U'   g ! [         a    [        U5      ef = f)Nr   r   )r\   r   r<   r   )r.   r   ns      r   unsubscribeSpecification.unsubscribe  sd    	&  +A 	
Q	*q5L5)*OOI&  	&9%%	&s   A Ac                     U R                    H  nUR                  U 5        M     Xl        U H  nUR                  U 5        M     U R	                  U 5        g rP   )r   r   r]   r   changed)r.   r   bs      r   
__setBasesSpecification.__setBases  sG    AMM$   AKK  	Tr   c                     U R                   $ rP   )r]   r3   s    r   <lambda>Specification.<lambda>  s    T[[r   c                    U R                  U R                   Vs0 s H  nXR                  _M     snS9nU R                  nUb8  U(       a1  US   ULa)  U Vs/ s H  nXCLd  M	  UPM     nnUR	                  U5        U$ s  snf s  snf )zCompute resolution order for this object using its ``__bases__``.

Ensures that ``Interface`` is always the last (lowest priority)
element.
)	base_mrosrv   )_do_calculate_ror   r`   _ROOTr   )r.   r   srorootxs        r   _calculate_sroSpecification._calculate_sro  s    D ##^^/
# yyL#/
#  zzBt(; A=   
 JJt
)/
s   A>B#Bc           	         SU l         U R                  nUR                  5         U R                  5       n[	        U5      U l        [	        U Vs/ s H  n[        U[        5      (       d  M  UPM     sn5      U l        U H  nSX$'   M	     [	        U R                  (       a  U R                  R                  5       OS5       H  nUR                  U5        M     SU l         gs  snf )z
We, or something we depend on, have changed.

By the time this is called, the things we depend on,
such as our bases, should themselves be stable.
NrF   )r^   r[   clearr   r   r`   
isinstancer
   r_   r\   rG   r   )r.   originally_changedimplied	ancestorsancestorr   s         r   r   Specification.changed  s     --'')	Y'y  y8!+Hn!E 'y   ! "H "G " '+'7'7D!!#R
I 01
 % s   C*Cc              #      #    0 nU R                    H)  nUR                  5        H  nX1;  d  M
  SX'   Uv   M     M+     g7f)DReturn an iterator for the interfaces in the specification.
        r   N)r   
interfaces)r.   seenbaserm   s       r   r   Specification.interfaces  s=      NND!__.	(&'DO#O / #s   (??c                 P    XR                   ;   =(       a    U(       + =(       d    X:g  $ )zDoes the specification extend the given interface?

Test whether an interface in the specification extends the
given interface
rl   )r.   rm   stricts      r   extendsSpecification.extends  s%     --' 3!2	
r   c                 .    [         R                  " X5      $ rP   )r   ref)r.   callbacks     r   r   Specification.weakref  s    {{4**r   c                     U R                   nUc  0 =o0l         UR                  U5      nUc-  U R                   H  nUR                  U5      nUc  M  XCU'     O   Uc  U$ U$ )z+Query for an attribute description
        )r^   rA   r_   direct)r.   r   rB   attrsattrifaces         r   rA   Specification.get  sk     =$&&EMyy<||D)#"&$K	 & ,w0D0r   )r   r_   r`   r]   r\   r[   r^   )rF   )TrP   )r+   rQ   rR   rS   r,   rp   r   rY   rn   rc   r/   r   r   r   r   _Specification__setBasesr   calculate_ror   r   r   r   r   r   rA   rW   rF   r   r   r   r   X  s    
 I E $//K"--J&$    
L
+
  *I $6p D$

+1r   r   c                   4    \ rS rSrSrS r\S 5       rS rSrg)_InterfaceMetaClassi0  rF   c                    [         R                  " S5      R                  S   n[        R                  S   n[        U[        5      (       a  [        R                  S   nXSS'   [        R                  XX#5      nXFl	        U$ )Nr   r+   rQ   r   )
r   r   	f_globalsr   __dict__r   strtype__new___InterfaceMetaClass__module)ri   r   r   r   rQ   moduledescrkinds          r   r  _InterfaceMetaClass.__new__|  sq    
 ]]1%//
;
 $,,\:k3'' (001FGK)l||Cu4"r   c                     U R                   $ rP   )r  ri   s    r   rQ   _InterfaceMetaClass.__module__  s    ||r   c                 N    SR                  U R                  U R                  5      $ )Nz<class '{}.{}'>)formatr  r+   r	  s    r   __repr___InterfaceMetaClass.__repr__  s#     ''LLLL
 	
r   N)	r+   rQ   rR   rS   rp   r  r   r  rW   rF   r   r   r   r   0  s(    T I$  
r   r   r
   rp   rF   c                     [         R                  " S5      R                  nUR                  [        0 5      nXU R
                  '   [        $ )a~  
Convert a method specification to an actual method of the interface.

This is a decorator that functions like `staticmethod` et al.

The primary use of this decorator is to allow interface definitions to
define the ``__adapt__`` method, but other interface methods can be
overridden this way too.

.. seealso::
    `zope.interface.interfaces.IInterfaceDeclaration.interfacemethod`
r   )r   r   r   r   INTERFACE_METHODSr+   r   )funcr   methodss      r   interfacemethodr    s=     }}Q((H!!"3R8G!DMM  r   c                       \ rS rSrSr     SS jr    SS jrS rS rS r	S	 r
SS
 jrS r SS jrS r\rS rS rSS jrSS jrSS jrS rS rS rS rS rS rS rS rSrg) r
   i  z
Prototype (scarecrow) Interfaces Implementation.

Note that it is not possible to change the ``__name__`` or ``__module__``
after an instance of this object has been constructed.
Nc                    [        U[        5      (       d   eU=(       d    0 nUR                  [        S 5      nU(       a}  UR	                  SU;   a  SUR                  S5      0O0 5        SU;   a  SUS'   [        U [        5      (       a  U 4nOU [        L a  [        4nOU [        4n[        U 5      " US-   UU5      n [        R                  U 5      $ )N__classcell__r   r   _CALL_CUSTOM_ADAPTz<WithCustomMethods>)r   r   popr  update
issubclass _InterfaceClassWithCustomMethodsr
   r  _InterfaceClassBaser  )ri   r   r   r   r,   rQ   needs_custom_class	cls_basess           r   r  InterfaceClass.__new__  s     %''''"YY'8$?%%"e+ !%))O"<=
 00;<"#78#?@@ F	&=?	 "BC	s),,"C #**3//r   c                    [        S U 5       5      (       d  [        S5      eUc  0 nUcN  UR                  S5      n[        U[        5      (       a  US	 O$ [
        R                  " S5      R                  S   n[        R                  XU5        UR                  S5      nUb  [        U[        5      (       d  Uc  UnUS	 Uc  Sn[        R                  XU5        UR                  [        S 5      nUb*  UR!                  5        H  u  pU R#                  X5        M     [$        R                  X5        U R'                  U5      U l        U SU 3U l        g ! [        [        4 a     Nf = f)	Nc              3   B   #    U  H  n[        U[        5      v   M     g 7frP   )r   r
   ).0r   s     r   	<genexpr>*InterfaceClass.__init__.<locals>.<genexpr>  s     F:dN33s   zExpected base interfacesrQ   r   r+   r,   rO   .)allr   rA   r   r  r   r   r   rw   r<   r   r/   	Attributer&   r  r   itemsrL   r   _InterfaceClass__compute_attrs_InterfaceClass__attrs__identifier__)
r.   r   r   r   r,   rQ   dtagged_datar!   vals
             r   r/   InterfaceClass.__init__  s[    FFFF677=E<0J*c**,' "%q!1!;!;J!GJ 	t:6
 IIi =a++?G)$?GW-iiT2"'--/##C- 0 	t+++E2!+AdV49 '1 s   #E E)(E)c           	         ^  U 4S jnUR                  5        VVs0 s H   u  p4US;  d  M  U[        Ld  M  X2" X45      _M"     snn$ s  snnf )Nc                    > [        U[        5      (       a   TUl        UR                  (       d  Xl        U$ [        U[        5      (       a  [        UTU S9nU$ [        SU -   5      e)N)r   zConcrete attribute, )r   r'  rm   r+   r   fromFunctionInvalidInterface)anameavalr.   s     r   update_value4InterfaceClass.__compute_attrs.<locals>.update_value!  sa    $	**!%}}$)M
 K	 D,//#D$U; K ''='EFFr   )
__locals__rR   __annotations__rW   rS   __classdictcell__)r(  r   )r.   r   r6  r4  r5  s   `    r   __compute_attrsInterfaceClass.__compute_attrs  s`    		  %{{}
,   -$ --% -E<,,,
 	
 
s   AAAc              #      #    U v   g7f)r   NrF   r3   s    r   r   InterfaceClass.interfacesB  s      
s   c                     U R                   $ rP   )r   r3   s    r   getBasesInterfaceClass.getBasesG  s    ~~r   c                 :    X:H  =(       d    UR                  U 5      $ )zSame interface or extends?)r   r.   ry   s     r   isEqualOrExtendedBy"InterfaceClass.isEqualOrExtendedByJ  s    }3d 33r   c                 $   U(       d  U R                   R                  5       $ U R                   R                  5       nU R                   H6  nUR	                  [
        R                  UR                  U5      5      5        M8     UR                  5       $ )z4Return the attribute names defined by the interface.)r*  rG   copyr   r  dictfromkeysnamesr.   r&  rr   s       r   rJ  InterfaceClass.namesN  sb    <<$$&&LLNNDHHT]]4::c?34 # vvxr   c                 2    [        U R                  SS95      $ )NT)r&  )iterrJ  r3   s    r   __iter__InterfaceClass.__iter__Z  s    DJJ4J())r   c                 "   U(       d  U R                   R                  5       $ 0 nU R                  SSS2    H,  nUR                  [	        UR                  U5      5      5        M.     UR                  U R                   5        UR                  5       $ )z=Return attribute names and descriptions defined by interface.Nrv   )r*  r(  r   r  rH  namesAndDescriptionsrK  s       r   rS  #InterfaceClass.namesAndDescriptions]  sp     <<%%''NN4R4(DHHT$33C89: ) 	
wwyr   c                 D    U R                  U5      nUb  U$ [        U5      e)z4Return the attribute description for the given name.)rA   r<   r.   r   rL  s      r   getDescriptionFor InterfaceClass.getDescriptionForl  s#    HHTN=Htnr   c                 (    U R                  U5      S L$ rP   rA   r.   r   s     r   __contains__InterfaceClass.__contains__v  s    xx~T))r   c                 8    U R                   R                  U5      $ rP   )r*  rA   r[  s     r   r   InterfaceClass.directy  s    ||%%r   c                 $    U R                  X5      $ rP   rZ  )r.   r   rB   s      r   queryDescriptionFor"InterfaceClass.queryDescriptionFor|  s    xx&&r   c                     U R                    H%  nUR                  SS5       H  n U" U5        M     M'     U(       a  [        U5      eg! [         a   nUb  UR                  U5         SnAMK  e SnAff = f)z&validate object to defined invariants.r   rF   N)r_   rT   r	   r   )r.   r   errorsr   r   errors         r   validateInvariants!InterfaceClass.validateInvariants  st     \\E"99,K	cN L " &/!   )e,,	s   A		
A3A.-A..A3c                 r    U R                    H&  nUR                  U[        5      nU[        Ld  M$  Us  $    U$ )z
Queries for the value associated with *tag*, returning it from the
nearest interface in the ``__iro__``.

If not found, returns *default*.
)r_   rT   r   )r.   r=   rB   r   r"   s        r   rC   InterfaceClass.queryTaggedValue  s8     \\E00g>EG# " r   c                 V    U R                  U[        S9nU[        L a  [        U5      eU$ )r;   )rB   )rC   r   r<   rK   s      r   r>   InterfaceClass.getTaggedValue  s.    %%c7%;G3-r   c                 ~    [        5       nU R                   H"  nUR                  UR                  5       5        M$     U$ )zReturns a list of all tags. )setr_   r  rV   )r.   rG   r   s      r   rH   !InterfaceClass.getTaggedValueTags  s1    uLLDKK5578 !r   c                      U R                   $ ! [         a3    [        U 5      nSU R                  R                   SU S3nX l         Us $ f = f)N<r)   >)_v_reprrw   r  	__class__r+   rV  s      r   r  InterfaceClass.__repr__  sR    	<< 	t9DDNN++,AdV15ALH		s    :A
Ac                 R    U R                   nU R                  nU(       a  U SU 3nU$ )Nr%  r   )r.   r   ms      r   __str__InterfaceClass.__str__  s-    }}S$=Dr   c                 |     U" U 5      $ ! [          a'    [        R                  " 5       S   R                  b  e  g f = f)N   )r   r   exc_infotb_nextr   s     r   r   InterfaceClass._call_conform  sH    	4=  	 ||~a ((4  5 	s   
 .;;c                     U R                   $ rP   r2   r3   s    r   
__reduce__InterfaceClass.__reduce__  s    }}r   c                     [         X4   $ )z,Allow type hinting syntax: Interface | None.r   rC  s     r   __or__InterfaceClass.__or__  s    T[!!r   c                     [         X4   $ )z,Allow type hinting syntax: None | Interface.r   rC  s     r   __ror__InterfaceClass.__ror__  s    U[!!r   )__attrsr+  rr  )NrF   NNN)rF   NNN)FrP   )r+   rQ   rR   rS   r,   r  r/   r)  r   r@  rD  rJ  rP  rS  rW  __getitem__r\  r   ra  rf  rC   r>   rH   r  rw  r   r  r  r  rW   rF   r   r   r
   r
     s     "0N 75r"
H
4
*  $K*&'" &""r   	Interfacezzope.interface)rQ   c                      [         4$ rP   )r  rF   r   r   r   r     s    I<r   c                       \ rS rSrSrSrg)r  i  zW
Marker class for interfaces with custom methods that override
InterfaceClass methods.
rF   N)r+   rQ   rR   rS   r,   rW   rF   r   r   r  r    s    r   r  c                   .    \ rS rSrSrSrS rS rS rSr	g)r'  i  zAttribute descriptions
    Nc                     g)z/Return extra data to put at the end of __str__.rO   rF   r3   s    r   _get_str_infoAttribute._get_str_info  s    r   c                     SnU R                   b3  U R                   R                  S-   U R                   R                  -   S-   nXR                  =(       d    S-   U R                  5       -   $ )NrO   r%  z	<unknown>)rm   rQ   r+   r  )r.   ofs     r   rw  Attribute.__str__  si    >>%))''(   ]]1k2T5G5G5IIIr   c                     SR                  [        U 5      R                  [        U 5      R                  [	        U 5      U 5      $ )Nz<{}.{} object at 0x{:x} {}>)r  r  rQ   r+   idr3   s    r   r  Attribute.__repr__  s9    ,33J!!JtH	
 	
r   rF   )
r+   rQ   rR   rS   r,   rm   r  rw  r  rW   rF   r   r   r'  r'    s     I
J
r   r'  c                   h    \ rS rSrSrS=rrS=r=rr	S r
S rS r\" \
\\5      rS rS	 rS
 r\rSrg)Methodi  zMethod interfaces

The idea here is that you have objects that describe methods.
This provides an opportunity for rich meta-data.
rF   Nc                 8    U R                   c  0 $ U R                   $ rP   	_optionalr3   s    r   _get_optionalMethod._get_optional  s    >>!I~~r   c                     Xl         g rP   r  )r.   opts     r   _set_optionalMethod._set_optional!  s    r   c                     S U l         g rP   r  r3   s    r   _del_optionalMethod._del_optional$  s	    r   c                 B    [        U R                  U R                  5      erP   )BrokenImplementationrm   r+   )r.   argskws      r   rq   Method.__call__)  s    "4>>4==AAr   c                 v    U R                   U R                  U R                  U R                  U R                  S.$ )N
positionalrequiredoptionalvarargskwargsr  r3   s    r   getSignatureInfoMethod.getSignatureInfo,  s/    "oo MM MM<<++	 	r   c           	         / nU R                    HY  nUR                  U5        X R                  R                  5       ;   d  M3  US==   S[	        U R                  U   5      -   -  ss'   M[     U R
                  (       a  UR                  SU R
                  -   5        U R                  (       a  UR                  SU R                  -   5        SSR                  U5      -  $ )Nrv   =*z**z(%s)z, )r  r   r  rG   reprr  r  join)r.   sigvs      r   getSignatureStringMethod.getSignatureString4  s    AJJqMMM&&((B3dmmA&6!777 ! <<JJsT\\)*;;JJtdkk)*		#&&r   r  )r+   rQ   rR   rS   r,   r  r  r  r  r  r  r  r  r   r  rq   r  r  r  rW   rF   r   r   r  r    sX     J#''I'&
 }mDHB' 'Mr   r  c           	         U=(       d    U R                   n[        X0R                  5      n[        U SS 5      =(       d    SnU R                  nUR
                  U-
  nUR                  US  n0 n	[        U5      n
U
(       d  [        U SS5      n
Xz-
  nUS:  a  X[* S  nSnU	R                  [        [        XS  U5      5      5        US U Ul        US U Ul        Xl        UnUR                  [        -  (       a  X   Ul        US-   nOS Ul        UR                  ["        -  (       a
  X   Ul        OS Ul        Xl        U R(                  R+                  5        H  u  pUR-                  X5        M     U$ )N__defaults__rF   __defaults_count__r   r   )r+   r  r,   getattr__code__co_argcountco_varnameslenr  rH  zipr  r  r  co_flags
CO_VARARGSr  CO_VARKEYWORDSr  rm   r   r(  rL   )r  rm   imlevelr   methoddefaultscodenarJ  r  defaults_countnrargnor!   r"   s                  r   r2  r2  D  sY    4==DD,,'Ft^T28bH==D			G	#BWX&E
C]N !';Q?		B	AvCD> JJtCc
H-./cr
FCRjFOOE }}z!	 }}~% mm))+
c) , Mr   c                 `    [        U [        5      (       a  U R                  nOU n[        X1SUS9$ )Nr   )r  r   )r   r   __func__r2  )methrm   r   r  s       r   
fromMethodr  x  s,    $
##}}>>r   c                      SSK Jn   SSKJn  U " [        U5        SSKJn  U " [        U5        SSKJn  U " [        U5        SSKJ	n  U " [        U5        SSKJn  U " [        U5        g )Nr   )classImplements)IElement)
IAttribute)IMethod)ISpecification)
IInterface)zope.interface.declarationsr  zope.interface.interfacesr  r&   r  r'  r  r  r  r   r  r
   )r  r  r  r  r  r  s         r   _wirer    sF    ;2GX&4Iz*1FG$8M>24NJ/r   )rh   )rc   )r  )r3  )_empty)Nr   Nr   )7r,   r   r   typesr   r   typingr   zope.interfacer   zope.interface._compatr   zope.interface.exceptionsr	   zope.interface.ror   __all__r  r  r   r  objectr   r   r   r$   r&   SpecificationBasePyrY   rs   r   r   r   r  r   r  r  r
   r  r   r   r`   r   r  r'  r  r2  r  r  r  rh   rc   r  r3  r  rF   r   r   <module>r     s         . - 0 
++  
(!!>2 >2B   + + +\L L^ M02E M M` B0U1% U1pf
$ f
R *M7+"	 !&b"( b"J	 ;3CD	/	  	  ) YL( (( ~ !
 !
H4'Y 4'n1h?0* 6 2 : 6 /   ff %r   