
    fNt                     P   d Z dZddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddl	mZ dd	l	mZ dd
l	mZ ddl	mZ ddl	mZ ddl	mZ ddl	mZ ddl	mZ ddl	mZ ddl	mZ ddl	mZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddlm!Z! ddlm"Z" ddlm#Z# dd lm$Z$ dd!lm%Z% dd"lm&Z& dd#lm'Z' dd$lm(Z( dd%lm)Z) dd&lm*Z* dd'lm+Z+ dd(lm,Z, dd)lm-Z- dd*lm.Z. dd+lm/Z/ dd,l0m1Z1 g d-Z2 G d. d/e-      Z3 G d0 d1e-      Z4 G d2 d3e-      Z5 G d4 d5e-      Z6 G d6 d7e7      Z8 G d8 d9e      Z9 G d: d;e9      Z: G d< d=e9      Z; G d> d?e9      Z< G d@ dAe9      Z= G dB dCe<      Z> G dD dEe=      Z? G dF dGe9      Z@ G dH dIe9      ZA G dJ dKe?e:e9      ZB G dL dMe?e:e9      ZC G dN dOeC      ZD G dP dQeD      ZE G dR dSeB      ZF G dT dUeE      ZG G dV dWeC      ZH G dX dYeC      ZI G dZ d[eI      ZJ G d\ d]eI      ZK G d^ d_e>e9      ZL G d` daeL      ZM G db dceM      ZN G dd deeN      ZO G df dgeO      ZP G dh dieP      ZQ G dj dkeN      ZR G dl dmeL      ZS G dn doe>e9      ZT G dp dqe>e9      ZU G dr dse>e9      ZV G dt due>e9      ZWdv ZXdw ZY G dx dyeJ      ZZ G dz d{eJ      Z[ G d| d}eJ      Z\ G d~ deJ      Z] G d de9      Z^ G d de?e:e;      Z_ G d de_      Z` G d de`      Za G d de_      Zb G d deb      Zc G d deb      Zd G d de`      Ze G d dea      Zf G d dec      Zg G d dec      Zh G d de9      Zi G d de?e:e;      Zj G d dej      Zk G d dek      Zl G d de      Zm G d dem      Zn G d den      Zo G d de      Zp G d de      Zq G d de      Zr G d dep      Zs G d dep      Zt G d de      Zu G d deues      Zv G d dev      Zw G d dewe      Zx G d de      Zy G d de      Zz G d de      Z{ G d de{      Z|y)z!Schema interfaces and exceptions
reStructuredText    )	Attribute)	Interface)IEnumerableMapping)
IInterface)Bool)Complex)Decimal)Field)Int)Integral)Number)Object)Rational)Real)Text)TextLine)ConstraintNotSatisfied)IBeforeObjectAssignedEvent)IContextAwareDefaultFactory)
IFromBytes)IFromUnicode)InvalidValue)IValidatable)LenOutOfBounds)NotAContainer)NotAnInterface)NotAnIterator)OrderableOutOfBounds)OutOfBounds)RequiredMissing)SchemaNotCorrectlyImplemented)SchemaNotFullyImplemented)SchemaNotProvided)StopValidation)TooBig)TooLong)TooShort)TooSmall)ValidationError)WrongContainedType)	WrongType)_)_r   InvalidDottedName	InvalidId
InvalidURIr   r   r   r   r   	NotUniquer   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   Unboundr*   r+   r,   IASCII
IASCIILineIAbstractBagIAbstractSetIBaseVocabularyr   IBoolIBytes
IBytesLineIChoiceICollectionIComplex
IContainerr   IContextSourceBinderIDate	IDatetimeIDecimalIDictIDottedNameIFieldIFieldEventIFieldUpdatedEventIFloatr   r   
IFrozenSetIIdIInt	IIntegralIInterfaceField	IIterableIIterableSourceIIterableVocabularyILenIListIMappingIMinMax
IMinMaxLenIMutableMappingIMutableSequenceINativeStringINativeStringLineINumberIObject
IOrderable	IPasswordIPythonIdentifier	IRationalIReal	ISequenceISetISourceISourceQueriablesISourceTextITermIText	ITextLineITime
ITimedeltaITitledTokenizedTermITokenizedTermITreeVocabularyITupleIURIIUnorderedCollectionIVocabularyIVocabularyFactoryIVocabularyRegistryIVocabularyTokenizedc                       e Zd Z ed      Zy)r1   z/One or more entries of sequence are not unique.N__name__
__module____qualname__r-   __doc__     n/var/dept/share/cheung/public_html/OutSchool/python/env/lib/python3.12/site-packages/zope/schema/interfaces.pyr1   r1      s    EFGr|   r1   c                       e Zd Z ed      Zy)r0   zThe specified URI is not valid.Nrv   r{   r|   r}   r0   r0      s    56Gr|   r0   c                       e Zd Z ed      Zy)r/   zThe specified id is not valid.Nrv   r{   r|   r}   r/   r/      s    45Gr|   r/   c                       e Zd Z ed      Zy)r.   z'The specified dotted name is not valid.Nrv   r{   r|   r}   r.   r.      s    =>Gr|   r.   c                       e Zd Z ed      Zy)r2   zThe field is not bound.Nrv   r{   r|   r}   r2   r2      s    -.Gr|   r2   c                   |   e Zd ZdZd Z e ed       ed      dd      Z e ed       ed	      dd      Z	 e
 ed
       ed      d      Z e
 ed       ed      dd      Z e ed       ed            Z e ed       ed            Z e ed       ed      dd      Zd Zd Zd ZddZd Zy) rE   a  Basic Schema Field Interface.

    Fields are used for Interface specifications.  They at least provide
    a title, description and a default value.  You can also
    specify if they are required and/or readonly.

    The Field Interface is also used for validation and specifying
    constraints.

    We want to make it possible for a IField to not only work
    on its value but also on the object this value is bound to.
    This enables a Field implementation to perform validation
    against an object which also marks a certain place.

    Note that many fields need information about the object
    containing a field. For example, when validating a value to be
    set as an object attribute, it may be necessary for the field to
    introspect the object's state. This means that the field needs to
    have access to the object when performing validation::

         bound = field.bind(object)
         bound.validate(value)

    c                      y)a  Return a copy of this field which is bound to context.

        The copy of the Field will have the 'context' attribute set
        to 'object'.  This way a Field can implement more complex
        checks involving the object's location/environment.

        Many fields don't need to be bound. Only fields that condition
        validation or properties on an object containing the field
        need to be bound.
        Nr{   objects    r}   bindzIField.bind       r|   TitlezA short summary or label F)titledescriptiondefaultrequiredDescriptionzA description of the fieldRequired2Tells whether a field requires its value to exist.Tr   r   r   z	Read Onlyz-If true, the field's value cannot be changed.r   r   r   r   Default ValueRThe field default value may be None or a legal
                        field valuer   r   zMissing ValuezjIf input for this Field is missing, and that's ok,
                          then this is the value to usezField Ordera"  
        The order attribute can be used to determine the order in
        which fields in a schema were defined. If one field is created
        after another (in the same thread), its order will be
        greater.

        (Fields in separate threads could have the same order.)
        )r   r   r   readonlyc                      y)a9  Check a customized constraint on the value.

        You can implement this method with your Field to
        require a certain constraint.  This relaxes the need
        to inherit/subclass a Field you to add a simple constraint.
        Returns true if the given value is within the Field's constraint.
        Nr{   values    r}   
constraintzIField.constraint  r   r|   c                      y)zValidate that the given value is a valid field value.

        Returns nothing but raises an error if the value is invalid.
        It checks everything specific to a Field and also checks
        with the additional constraint.
        Nr{   r   s    r}   validatezIField.validate  r   r|   c                      y)z0Get the value of the field for the given object.Nr{   r   s    r}   getz
IField.get&  r   r|   Nc                      y)zuQuery the value of the field for the given object.

        Return the default if the value hasn't been set.
        Nr{   )r   r   s     r}   queryzIField.query)  r   r|   c                      y)zrSet the value of the field for the object

        Raises a type error if the field is a read-only field.
        Nr{   )r   r   s     r}   setz
IField.set/  r   r|   )N)rw   rx   ry   rz   r   r   r-   r   r   r   r   r   r   r   r   missing_valuer   orderr   r   r   r   r   r{   r|   r}   rE   rE      s   2
 j01	
E 23	
K 
mKLH
 nEF	H   ' (
G   ; <
M    
E?r|   rE   c                       e Zd ZdZy)rN   zFields with a value that can be iterated over.

    The value needs to support iteration; the implementation mechanism
    is not constrained.  (Either `__iter__()` or `__getitem__()` may be
    used.)
    Nrw   rx   ry   rz   r{   r|   r}   rN   rN   6      r|   rN   c                       e Zd ZdZy)r>   zFields whose value allows an ``x in value`` check.

    The value needs to support the `in` operator, but is not
    constrained in how it does so (whether it defines `__contains__()`
    or `__getitem__()` is immaterial).
    Nr   r{   r|   r}   r>   r>   ?  r   r|   r>   c                       e Zd ZdZy)r\   zField requiring its value to be orderable.

    The set of value needs support a complete ordering; the
    implementation mechanism is not constrained.  Either `__cmp__()` or
    'rich comparison' methods may be used.
    Nr   r{   r|   r}   r\   r\   H  r   r|   r\   c                       e Zd ZdZy)rQ   znA Field requiring its value to have a length.

    The value needs to have a conventional __len__ method.
    Nr   r{   r|   r}   rQ   rQ   Q      r|   rQ   c                   T    e Zd ZdZ e ed      dd      Z e ed      dd      Zy)rT   zField requiring its value to be between min and max.

    This implies that the value needs to support the IOrderable interface.
    Start of the rangeFNr   r   r   -End of the range (including the value itself))rw   rx   ry   rz   r   r-   minmaxr{   r|   r}   rT   rT   X  s=    
 $%
C ?@
Cr|   rT   c                   t    e Zd ZdZ e ed       ed      ddd      Z e ed       ed      ddd	      Zy	)
rU   z<Field requiring the length of its value to be within a rangezMinimum lengthz
        Value after whitespace processing cannot have less than
        `min_length` characters (if a string type) or elements (if
        another sequence type). If `min_length` is ``None``, there is
        no minimum.
        Fr   )r   r   r   r   r   zMaximum lengthz
        Value after whitespace processing cannot have greater
        or equal than `max_length` characters (if a string type) or
        elements (if another sequence type). If `max_length` is
        ``None``, there is no maximum.N)rw   rx   ry   rz   r   r-   
min_length
max_lengthr{   r|   r}   rU   rU   k  s]    F !   
J  ! * +
 	Jr|   rU   c                       e Zd ZdZy)rM   zUFields with a value that is an interface (implementing
    zope.interface.Interface).Nr   r{   r|   r}   rM   rM     s    "r|   rM   c                   l    e Zd ZdZ e ed       ed            Z e ed       ed      dd      Zy	)
r8   zBoolean Field.r   r   r   r   r   Fr   N)rw   rx   ry   rz   r   r-   r   r   r{   r|   r}   r8   r8     sF      ' (
G
 
mKL	Hr|   r8   c                       e Zd ZdZy)r9   zxField containing a byte string (like the python str).

    The value might be constrained to be with length limits.
    Nr   r{   r|   r}   r9   r9     r   r|   r9   c                       e Zd ZdZy)rg   z"Field containing a unicode string.Nr   r{   r|   r}   rg   rg     s    ,r|   rg   c                       e Zd ZdZy)rX   z
    A field that always contains the native `str` type.

    .. versionchanged:: 4.9.0
       This is now a distinct type instead of an alias for either `IText`
       or `IBytes`, depending on the platform.
    Nr   r{   r|   r}   rX   rX         r|   rX   c                       e Zd ZdZy)r3   zField containing a 7-bit ASCII string. No characters > DEL
    (chr(127)) are allowed

    The value might be constrained to be with length limits.
    Nr   r{   r|   r}   r3   r3         r|   r3   c                       e Zd ZdZy)r:   z0Field containing a byte string without newlines.Nr   r{   r|   r}   r:   r:     s    :r|   r:   c                       e Zd ZdZy)r4   z7Field containing a 7-bit ASCII string without newlines.Nr   r{   r|   r}   r4   r4         Ar|   r4   c                       e Zd ZdZy)re   z Field for source text of object.Nr   r{   r|   r}   re   re     s    *r|   re   c                       e Zd ZdZy)rh   z3Field containing a unicode string without newlines.Nr   r{   r|   r}   rh   rh     s    =r|   rh   c                       e Zd ZdZy)rY   z
    A field that always contains the native `str` type, without any newlines.

    .. versionchanged:: 4.9.0
       This is now a distinct type instead of an alias for either `ITextLine`
       or `IBytesLine`, depending on the platform.
    Nr   r{   r|   r}   rY   rY     r   r|   rY   c                       e Zd ZdZy)r]   z<Field containing a unicode password string without newlines.Nr   r{   r|   r}   r]   r]     s    Fr|   r]   c                       e Zd ZdZ e ed      dd      Z e ed      dd      Z e ed       ed      	      Zy)
rZ   z
    Field containing a generic number: :class:`numbers.Number`.

    .. seealso:: :class:`zope.schema.Number`
    .. versionadded:: 4.6.0
    r   FNr   r   r   r   r   )	rw   rx   ry   rz   r   r-   r   r   r   r{   r|   r}   rZ   rZ     s^     $%
C ?@
C   ' (
Gr|   rZ   c                       e Zd ZdZ e ed      dd      Z e ed      dd      Z e ed       ed      	      Zy)
r=   z
    Field containing a complex number: :class:`numbers.Complex`.

    .. seealso:: :class:`zope.schema.Real`
    .. versionadded:: 4.6.0
    r   FNr   r   r   r   r   )	rw   rx   ry   rz   r	   r-   r   r   r   r{   r|   r}   r=   r=     s^     $%
C ?@
C   ' (
Gr|   r=   c                       e Zd ZdZ e ed      dd      Z e ed      dd      Z e ed       ed      	      Zy)
r`   z
    Field containing a real number: :class:`numbers.IReal`.

    .. seealso:: :class:`zope.schema.Real`
    .. versionadded:: 4.6.0
    r   FNr   r   r   r   r   )	rw   rx   ry   rz   r   r-   r   r   r   r{   r|   r}   r`   r`     s^     $%
C ?@
C   ' (
Gr|   r`   c                       e Zd ZdZ e ed      dd      Z e ed      dd      Z e ed       ed      	      Zy)
r_   z
    Field containing a rational number: :class:`numbers.IRational`.

    .. seealso:: :class:`zope.schema.Rational`
    .. versionadded:: 4.6.0
    r   FNr   r   r   r   r   )	rw   rx   ry   rz   r   r-   r   r   r   r{   r|   r}   r_   r_   ,  s^     $%
C ?@
C   ' (
Gr|   r_   c                       e Zd ZdZ e ed      dd      Z e ed      dd      Z e ed       ed      	      Zy)
rL   z
    Field containing an integral number: class:`numbers.Integral`.

    .. seealso:: :class:`zope.schema.Integral`
    .. versionadded:: 4.6.0
    r   FNr   r   r   r   r   )	rw   rx   ry   rz   r   r-   r   r   r   r{   r|   r}   rL   rL   G  s^     $%
C ?@
C   ' (
Gr|   rL   c                       e Zd ZdZ e ed      dd      Z e ed      dd      Z e ed       ed      	      Zy)
rK   zl
    Field containing exactly the native class :class:`int`.

    .. seealso:: :class:`zope.schema.Int`
    r   FNr   r   r   r   r   )	rw   rx   ry   rz   r   r-   r   r   r   r{   r|   r}   rK   rK   e  s^     $%
C ?@
C   ' (
Gr|   rK   c                       e Zd ZdZy)rH   z
    Field containing exactly the native class :class:`float`.

    :class:`IReal` is a more general interface, allowing all of
    floats, ints, and fractions.

    .. seealso:: :class:`zope.schema.Float`
    Nr   r{   r|   r}   rH   rH     s    r|   rH   c                       e Zd ZdZ e ed      dd      Z e ed      dd      Z e ed       ed      	      Zy)
rB   z+Field containing a :class:`decimal.Decimal`r   FNr   r   r   r   r   )	rw   rx   ry   rz   r
   r-   r   r   r   r{   r|   r}   rB   rB     sZ    5
$%
C ?@
C   ' (
Gr|   rB   c                       e Zd ZdZy)rA   zField containing a datetime.Nr   r{   r|   r}   rA   rA     s    &r|   rA   c                       e Zd ZdZy)r@   zField containing a date.Nr   r{   r|   r}   r@   r@         "r|   r@   c                       e Zd ZdZy)rj   zField containing a timedelta.Nr   r{   r|   r}   rj   rj         'r|   rj   c                       e Zd ZdZy)ri   zField containing a time.Nr   r{   r|   r}   ri   ri     r   r|   ri   c                 0    t         j                  |       syyNFT)rE   
providedByr   s    r}   	_is_fieldr     s    U#r|   c                 ,    | D ]  }t        |      r y yr   )r   )valuesr   s     r}   _fieldsr     s!      r|   c                       e Zd ZdZy)ro   z'A field containing an absolute URI
    Nr   r{   r|   r}   ro   ro         r|   ro   c                       e Zd ZdZy)rJ   zA field containing a unique identifier

    A unique identifier is either an absolute URI or a dotted name.
    If it's a dotted name, it should have a module/package name as a prefix.
    Nr   r{   r|   r}   rJ   rJ     r   r|   rJ   c                   V    e Zd ZdZ e ed      ddd      Z e ed      dd	      Zy)
rD   z[Dotted name field.

    Values of DottedName fields must be Python-style dotted names.
    zMinimum number of dotsTr   )r   r   r   r   z9Maximum number of dots (should not be less than min_dots)FNr   )rw   rx   ry   rz   r   r-   min_dotsmax_dotsr{   r|   r}   rD   rD     s@    
 ()	
H KL
Hr|   rD   c                       e Zd ZdZy)r^   z\
    A single Python identifier, such as a  variable name.

    .. versionadded:: 4.9.0
    Nr   r{   r|   r}   r^   r^     r   r|   r^   c                   p    e Zd ZdZ e ed       ed      dd      Z e ed       ed      dd      Zy)	r;   zField whose value is contained in a predefined set

    Only one, values or vocabulary, may be specified for a given choice.
    z%Vocabulary or source providing valuesz`The ISource, IContextSourceBinder or IBaseVocabulary object that provides values for this field.FNr   zVocabulary namez4Vocabulary name to lookup in the vocabulary registry)	rw   rx   ry   rz   r   r-   
vocabularyr   vocabularyNamer{   r|   r}   r;   r;     sU     78 D E
J !"LM	
Nr|   r;   c                   l    e Zd ZdZ ee ed       ed            Z e ed       ed      d      Z	y	)
r<   z|Abstract interface containing a collection value.

    The Value must be iterable and may have a min_length/max_length.
    z
Value TypezHField value items must conform to the given type, expressed via a Field.r   zUnique Membersz?Specifies whether the members of the collection must be unique.Fr   N)
rw   rx   ry   rz   r   rE   r-   
value_typer   uniquer{   r|   r}   r<   r<     sO    
 o / 01J  ! ( )	Fr|   r<   c                       e Zd ZdZy)ra   z7Abstract interface specifying that the value is orderedNr   r{   r|   r}   ra   ra     r   r|   ra   c                       e Zd ZdZy)rW   zo
    Abstract interface specifying that the value is ordered and
    mutable.

    .. versionadded:: 4.6.0
    Nr   r{   r|   r}   rW   rW     r   r|   rW   c                       e Zd ZdZy)rp   z>Abstract interface specifying that the value cannot be orderedNr   r{   r|   r}   rp   rp   #  s    Hr|   rp   c                   "    e Zd ZdZ ed      Zy)r6   z)An unordered collection of unique values.z1This ICollection interface attribute must be Truer   Nrw   rx   ry   rz   r   r   r{   r|   r}   r6   r6   '  s    3GIFr|   r6   c                   "    e Zd ZdZ ed      Zy)r5   zXAn unordered collection of values, with no limitations on whether
    members are uniquez2This ICollection interface attribute must be Falser   Nr   r{   r|   r}   r5   r5   .  s     HJFr|   r5   c                       e Zd ZdZy)rn   zTField containing a value that implements the API of a conventional
    Python tuple.Nr   r{   r|   r}   rn   rn   9  s    r|   rn   c                       e Zd ZdZy)rR   zSField containing a value that implements the API of a conventional
    Python list.Nr   r{   r|   r}   rR   rR   >  s    r|   rR   c                       e Zd ZdZy)rb   zJField containing a value that implements the API of a Python2.4+ set.
    Nr   r{   r|   r}   rb   rb   C  r   r|   rb   c                       e Zd ZdZy)rI   z]Field containing a value that implements the API of a conventional
    Python 2.4+ frozenset.Nr   r{   r|   r}   rI   rI   H  s    r|   rI   c                   ^    e Zd ZdZ ee ed            Z e ed       ed      d      Z	y)	r[   zz
    Field containing an Object value.

    .. versionchanged:: 4.6.0
       Add the *validate_invariants* attribute.
    z<The Interface that defines the Fields comprising the Object.r   zValidate InvariantszrA boolean that says whether ``schema.validateInvariants`` is called from ``self.validate()``. The default is true.Tr   N)
rw   rx   ry   rz   r   r   r-   schemar   validate_invariantsr{   r|   r}   r[   r[   O  sM        !F %& B C r|   r[   c                   P    e Zd ZdZ ee ed            Z ee ed            Zy)rS   z
    Field containing an instance of :class:`collections.Mapping`.

    The *key_type* and *value_type* fields allow specification
    of restrictions for keys and values contained in the dict.

    zAField keys must conform to the given type, expressed via a Field.r   zCField values must conform to the given type, expressed via a Field.N)	rw   rx   ry   rz   r   rE   r-   key_typer   r{   r|   r}   rS   rS   f  s?      % &H  % &Jr|   rS   c                       e Zd ZdZy)rV   zN
    Field containing an instance of :class:`collections.MutableMapping`.
    Nr   r{   r|   r}   rV   rV   {  s    r|   rV   c                       e Zd ZdZy)rC   z*Field containing a conventional dict.
    Nr   r{   r|   r}   rC   rC     r   r|   rC   c                   "    e Zd ZdZ edd      Zy)rf   z3Object representing a single value in a vocabulary.r   z7The value used to represent vocabulary term in a field.N)rw   rx   ry   rz   r   r   r{   r|   r}   rf   rf     s    =JLEr|   rf   c                   "    e Zd ZdZ edd      Zy)rl   zBObject representing a single value in a tokenized vocabulary.
    tokenzToken which can be used to represent the value on a stream.

        The value of this attribute must be a non-empty 7-bit ``str``.
        Control characters, including newline, are not allowed.
        N)rw   rx   ry   rz   r   r   r{   r|   r}   rl   rl     s    
 	Er|   rl   c                   .    e Zd ZdZ e ed            Zy)rk   z'A tokenized term that includes a title.r   )r   N)rw   rx   ry   rz   r   r-   r   r{   r|   r}   rk   rk     s    11W:&Er|   rk   c                       e Zd ZdZd Zy)rc   a  A set of values from which to choose

    Sources represent sets of values. They are used to specify the
    source for choice fields.

    Sources can be large (even infinite), in which case, they need to
    be queried to find out what their values are.
    c                      y)z=Return whether the value is available in this source
        Nr{   r   s    r}   __contains__zISource.__contains__  r   r|   N)rw   rx   ry   rz   r   r{   r|   r}   rc   rc     s    r|   rc   c                       e Zd ZdZd Zy)rd   z1A collection of objects for querying sources
    c                       y)a  Return an iterable of objects that can be queried

        The returned obects should be two-tuples with:

        - A unicode id

          The id must uniquely identify the queriable object within
          the set of queriable objects. Furthermore, in subsequent
          calls, the same id should be used for a given queriable
          object.

        - A queriable object

          This is an object for which there is a view provided for
          searching for items.

        Nr{   r{   r|   r}   getQueriableszISourceQueriables.getQueriables  r   r|   N)rw   rx   ry   rz   r  r{   r|   r}   rd   rd     s    r|   rd   c                       e Zd Zd Zy)r?   c                      y)zAReturn a context-bound instance that implements ISource.
        Nr{   contexts    r}   __call__zIContextSourceBinder.__call__  r   r|   N)rw   rx   ry   r  r{   r|   r}   r?   r?     s    r|   r?   c                       e Zd ZdZd Zy)r7   a(  Representation of a vocabulary.

    At this most basic level, a vocabulary only need to support a test
    for containment.  This can be implemented either by __contains__()
    or by sequence __getitem__() (the later only being useful for
    vocabularies which are intrinsically ordered).
    c                      y)zReturn the ITerm object for the term 'value'.

        If 'value' is not a valid term, this method raises LookupError.
        Nr{   r   s    r}   getTermzIBaseVocabulary.getTerm  r   r|   N)rw   rx   ry   rz   r	  r{   r|   r}   r7   r7     s    r|   r7   c                       e Zd ZdZd Zd Zy)rO   z}Source which supports iteration over allowed values.

    The objects iteration provides must be values from the source.
    c                       y)z=Return an iterator which provides the values from the source.Nr{   r{   r|   r}   __iter__zIIterableSource.__iter__  r   r|   c                       y)z1Return the number of valid values, or sys.maxint.Nr{   r{   r|   r}   __len__zIIterableSource.__len__  r   r|   Nrw   rx   ry   rz   r  r  r{   r|   r}   rO   rO     s    
L@r|   rO   c                       e Zd ZdZd Zd Zy)rP   zVocabulary which supports iteration over allowed values.

    The objects iteration provides must conform to the ITerm
    interface.
    c                       y)z@Return an iterator which provides the terms from the vocabulary.Nr{   r{   r|   r}   r  zIIterableVocabulary.__iter__  r   r|   c                       y)z0Return the number of valid terms, or sys.maxint.Nr{   r{   r|   r}   r  zIIterableVocabulary.__len__  r   r|   Nr  r{   r|   r}   rP   rP     s    O?r|   rP   c                       e Zd ZdZy)rq   zVocabulary which is iterable.Nr   r{   r|   r}   rq   rq     r   r|   rq   c                       e Zd ZdZd Zy)rt   zVocabulary that provides support for tokenized representation.

    Terms returned from getTerm() and provided by iteration must
    conform to ITokenizedTerm.
    c                      y)zReturn an ITokenizedTerm for the passed-in token.

        If `token` is not represented in the vocabulary, `LookupError`
        is raised.
        Nr{   )r   s    r}   getTermByTokenz#IVocabularyTokenized.getTermByToken  r   r|   N)rw   rx   ry   rz   r  r{   r|   r}   rt   rt     s    r|   rt   c                       e Zd ZdZy)rm   zA tokenized vocabulary with a tree-like structure.

       The tree is implemented as dictionary, with keys being ITokenizedTerm
       terms and the values being similar dictionaries. Leaf values are empty
       dictionaries.
    Nr   r{   r|   r}   rm   rm     r   r|   rm   c                       e Zd ZdZd Zy)rs   aZ  
    Registry that provides `IBaseVocabulary` objects for specific
    fields.

    The fields of this package use the vocabulary registry that is
    returned from :func:`~.getVocabularyRegistry`. This is a hook
    function; by default it returns an instance of
    :class:`~.VocabularyRegistry`, but the function
    :func:`~.setVocabularyRegistry` can be used to change this.

    In particular, the package `zope.vocabularyregistry
    <https://pypi.org/project/zope.vocabularyregistry/>`_ can be used
    to install a vocabulary registry that uses the :mod:`zope.component`
    architecture.
    c                      y)z
        Return the vocabulary named *name* for the content object
        *context*.

        When the vocabulary cannot be found, `LookupError` is raised.
        Nr{   )r  names     r}   r   zIVocabularyRegistry.get(  r   r|   N)rw   rx   ry   rz   r   r{   r|   r}   rs   rs     s     r|   rs   c                       e Zd ZdZd Zy)rr   a  
    An object that can create `IBaseVocabulary`.

    Objects that implement this interface can be registered with the
    default :class:`~.VocabularyRegistry` provided by this package.

    Alternatively, `zope.vocabularyregistry
    <https://pypi.org/project/zope.vocabularyregistry/>`_ can be used
    to install a `IVocabularyRegistry` that looks for named utilities
    using :func:`zope.component.getUtility` which provide this
    interface.
    c                      y)zKThe *context* provides a location that vocabulary can make use of.
        Nr{   r  s    r}   r  zIVocabularyFactory.__call__?  r   r|   N)rw   rx   ry   rz   r  r{   r|   r}   rr   rr   1  s    r|   rr   c                   0    e Zd Z eed      Z ed      Zy)rF   zThe field that has been changedr   zThe object containing the fieldN)rw   rx   ry   r   rE   fieldr   r   r{   r|   r}   rF   rF   D  s    57E 89Fr|   rF   c                   0    e Zd ZdZ ed      Z ed      Zy)rG   zo
    A field has been modified

    Subscribers will get the old and the new value together with the field
    z*The value of the field before modificationz)The value of the field after modificationN)rw   rx   ry   rz   r   	old_value	new_valuer{   r|   r}   rG   rG   M  s     FGIEFIr|   rG   N)}rz   __docformat__zope.interfacer   r   zope.interface.common.mappingr   zope.interface.interfacesr   zope.schema._bootstrapfieldsr   r	   r
   r   r   r   r   r   r   r   r   r    zope.schema._bootstrapinterfacesr   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   zope.schema._messageidr-   __all__r1   r0   r/   r.   	Exceptionr2   rE   rN   r>   r\   rQ   rT   rU   rM   r8   r9   rg   rX   r3   r:   r4   re   rh   rY   r]   rZ   r=   r`   r_   rL   rK   rH   rB   rA   r@   rj   ri   r   r   ro   rJ   rD   r^   r;   r<   ra   rW   rp   r6   r5   rn   rR   rb   rI   r[   rS   rV   rC   rf   rl   rk   rc   rd   r?   r7   rO   rP   rq   rt   rm   rs   rr   rF   rG   r{   r|   r}   <module>r+     s6  " $ $ < 0 - 0 0 . , 1 / / 1 - - 1 D G H 7 9 9 9 ; : ; : A 8 < J F > ; 3 4 5 5 < ? 6 $dNG G7 76 6? ?/i /w\ wt   6 
j 
& 6"f "
F ZF -J	6 -
E ] ; ;B B+% +> >	 G	 G
gv 
4
w 
4
H 
4
 
6
	 
<
9 
4U 
w 
4' '#GV #(& (#GV # 

 
# 
() 
f 
2*i &B By I; II' IJ' JY 
 
< 
 f .z9j *h O 
LI LU '> 'i 	 09 g  
@g 
@?) ?(% (; *,> ) 4 &:) :	G 	Gr|   