Ë
    ‹éŸfî  ã                   óX   — d Z ddlmZ ddlmZ ddlmZ g d¢Zd„ Zd„ fd„Zd	„ Zd
„ Z	d„ Z
y)zSchema convenience functions
é    )Úget_schema_validation_errors)Úget_validation_errors)Ú	getFields)ÚgetFieldNamesr   ÚgetFieldsInOrderÚgetFieldNamesInOrderÚgetValidationErrorsÚgetSchemaValidationErrorsc                 óF   — t        t        | «      j                  «       «      S )z6Return a list of all the Field names in a schema.
    )Úlistr   Úkeys)Úschemas    úk/var/dept/share/cheung/public_html/OutSchool/python/env/lib/python3.12/site-packages/zope/schema/_schema.pyr   r       s   € ô ”	˜&Ó!×&Ñ&Ó(Ó)Ð)ó    c                 ó    — | d   j                   S )Né   )Úorder)Úxs    r   ú<lambda>r   &   s   € °!°A±$·*±*€ r   c                 óJ   — t        t        | «      j                  «       |¬«      S )zBReturn a list of (name, value) tuples in native schema order.
    )Úkey)Úsortedr   Úitems)r   Ú
_field_keys     r   r   r   &   s   € ô ”)˜FÓ#×)Ñ)Ó+°Ô<Ð<r   c                 óJ   — t        | «      D cg c]  \  }}|‘Œ	 c}}S c c}}w )zFReturn a list of all the Field names in a schema in schema order.
    )r   )r   ÚnameÚfields      r   r   r   ,   s!   € ô %5°VÓ$<×=‘[T˜5ŠDÓ=Ð=ùÓ=s   c                 óŽ   — t        | |«      \  }}|s|sg S t        |j                  «       «      |D cg c]  }d|f‘Œ c}z   S c c}w )a%  
    Validate that *value* conforms to the schema interface *schema*.

    This includes checking for any schema validation errors (using
    `getSchemaValidationErrors`). If that succeeds, then we proceed to
    check for any declared invariants.

    Note that this does not include a check to see if the *value*
    actually provides the given *schema*.

    :return: A sequence of (name, `zope.interface.Invalid`) tuples,
       where *name* is None if the error was from an invariant.
       If the sequence is empty, there were no errors.
    N)r   r   r   )r   ÚvalueÚschema_error_dictÚinvariant_errorsÚes        r   r	   r	   2   s\   € ô +@ØØó+
Ñ'ÐÐ'ñ
 Ñ%5àˆ	ô 	Ð×$Ñ$Ó&Ó'Ø,Ö-qˆ$ŠÒ-ñ	.ðùâ-s   ²Ac                 óp   — t        | |«      j                  «       }t        |t        «      r|S t        |«      S )a¡  
    Validate that *value* conforms to the schema interface *schema*.

    All :class:`zope.schema.interfaces.IField` members of the *schema*
    are validated after being bound to *value*. (Note that we do not check for
    arbitrary :class:`zope.interface.Attribute` members being present.)

    :return: A sequence of (name, `ValidationError`) tuples. A non-empty
        sequence indicates validation failed.
    )r   r   Ú
isinstancer   )r   r   r   s      r   r
   r
   P   s1   € ô )¨°Ó7×=Ñ=Ó?€EÜ˜u¤dÔ+ˆ5Ð<´°e³Ð<r   N)Ú__doc__Úzope.schema._bootstrapfieldsr   r   r   Ú__all__r   r   r   r	   r
   © r   r   ú<module>r)      s;   ðñõ FÝ >Ý 2ò€ò*ñ )=ó =ò>òó<=r   