/usr/lib/python3/dist-packages/landscape/lib/__pycache__
Edit: /usr/lib/python3/dist-packages/landscape/lib/__pycache__/schema.cpython-310.pyc (7155B)
o
¶žâc9 ã @ sÜ d Z ddlmZmZmZ G dd„ deƒZG dd„ deƒZG dd„ deƒZ G d d
„ d
eƒZ
G dd„ deƒZG d
d„ deƒZG dd„ deƒZ
G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdS )z"A schema system. Yes. Another one!é )Ú iteritemsÚunicodeÚlongc @ s e Zd ZdZdS )ÚInvalidErrorz&Raised when invalid input is received.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r
r
ú6/usr/lib/python3/dist-packages/landscape/lib/schema.pyr s r c @ ó e Zd ZdZdd„ Zdd„ ZdS )ÚConstantz1Something that must be equal to a constant value.c C ó
|| _ d S ©N)Úvalue©Úselfr r
r
r Ú__init__ ó
zConstant.__init__c C sV t | jtƒrt |tƒrz| ¡ }W n ty Y nw || jkr)td|| jf ƒ‚|S )Nz%r != %r)Ú
isinstancer ÚstrÚbytesÚdecodeÚUnicodeDecodeErrorr r r
r
r Úcoerce s ÿ
zConstant.coerceN©r r r r r r r
r
r
r r
s r
c @ r )ÚAnyzsSomething which must apply to any of a number of different schemas.
@param schemas: Other schema objects.
c G r r )Úschemas)r r r
r
r r r zAny.__init__c C s@ | j D ]}z| |¡W S ty Y qw td|| j f ƒ‚)zˆ
The result of the first schema which doesn't raise
L{InvalidError} from its C{coerce} method will be returned.
z!%r did not match any schema in %s)r r r )r r Úschemar
r
r r # s
ÿÿz
Any.coerceNr r
r
r
r r ó r c @ ó e Zd ZdZdd„ ZdS )ÚBoolz!Something that must be a C{bool}.c C s t |tƒstd|f ƒ‚|S )Nz%r is not a bool)r Úboolr r r
r
r r 3 s
zBool.coerceN©r r r r r r
r
r
r r! 1 ó r! c @ r )ÚIntz,Something that must be an C{int} or C{long}.c C s t |ttfƒstd|f ƒ‚|S )Nz%r isn't an int or long)r Úintr r r r
r
r r ; s z
Int.coerceNr# r
r
r
r r% 9 r$ r% c @ r )ÚFloatz7Something that must be an C{int}, C{long}, or C{float}.c C s" t |tttfƒstd|f ƒ‚|S )Nz%r isn't a float)r r&