![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /lib/python3/dist-packages/landscape/lib/__pycache__/ |
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"