HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //usr/lib/python3.9/site-packages/ipalib/__pycache__/output.cpython-39.pyc
a

}�f?�@s�dZddlZddlmZmZddlmZddlmZddl	m
Z
ejrJeZ
Gdd�de�ZGd	d
�d
e�ZdZGdd
�d
e�ZGdd�de�ZGdd�de�Zeded�d�Zede
ed�fed��Zedded�dgd�ZeefZeed�efZeed�edeed��edeed��fZeedeed��efZeedeed��eddgd�fZeedeed ��efZ e Z!eedeed ��ede
dgd�fZ"eed�ede
dgd�fZ#dS)!z&
Simple description of return values.
�N)�ReadOnly�lock)�client_has_capability)�_)�apireprc@s@eZdZdZdZdZdZgZddgfdd�Zdd�Z	dd�Z
dS)	�Outputa
    Simple description of a member in the return value ``dict``.

    This class controls both the type of object being returned by
    a command as well as how the output will be displayed.

    For example, this class defines two return results: an entry
    and a value.

    >>> from ipalib import crud, output
    >>> class user(crud.Update):
    ...
    ...     has_output = (
    ...         output.Entry('result'),
    ...         output.value,
    ...     )

    The order of the values in has_output controls the order of output.
    If you have values that you don't want to be printed then add
    ``'no_display'`` to flags.

    The difference between ``'no_display'`` and ``'no_output'`` is
    that ``'no_output'`` will prevent a Param value from being returned
    at all. ``'no_display'`` will cause the API to return a value, it
    simply won't be displayed to the user. This is so some things may
    be returned that while not interesting to us, but may be to others.

    >>> from ipalib import crud, output
    >>> myvalue = output.Output('myvalue', unicode,
    ...     'Do not print this value', flags=['no_display'],
    ... )
    >>> class user(crud.Update):
    ...
    ...     has_output = (
    ...         output.Entry('result'),
    ...         myvalue,
    ...     )
    NcCsD||_|dur$t|t�s|f}||_|dur2||_||_t|�dS�N)�name�
isinstance�tuple�type�doc�flagsr)�selfr	rr
r�r�1/usr/lib/python3.9/site-packages/ipalib/output.py�__init__Ns
zOutput.__init__cCsd|jjd�|���fS)Nz%s(%s)z, )�	__class__�__name__�join�_Output__repr_iter)rrrr�__repr__Ys�zOutput.__repr__ccsZt|j�VdD]D}|j�|�}|s&qt|t�r>tt|��}nt|�}d||fVqdS)N)rr
rz%s=%s)�reprr	�__dict__�getr
rr�list)r�key�valuerrrZ__repr_iter_s
zOutput.__repr_iter)r�
__module__�__qualname__�__doc__r�validater
rrrrrrrrr!s'rc@seZdZeZed�ZdS)�Entryz'A dictionary representing an LDAP entryN)rrr�dictrrr
rrrrr"lsr"zP%s.validate_output() => %s.validate():
  output[%r][%d]: need a %r; got a %r: %rc@s$eZdZeefZed�Zdd�ZdS)�
ListOfEntrieszA list of LDAP entriesc
CsVt||j�sJ�t|�D]8\}}t|t�stt|j|jj|j|tt|�|f��qdSr)	r
r�	enumerater#�	TypeError�emsgr	rr)r�cmd�entries�version�i�entryrrrr!xs
�zListOfEntries.validateN)	rrrrrrrr
r!rrrrr$tsr$c@seZdZdd�ZdS)�
PrimaryKeycCs�t|d�rDt|d�r.|jr.|jjr.|jjj}ntf}|td�f}ntf}t||�s|td|j	|j
j|j	|dt|�|f��dS)N�primary_key_types�obj�H%s.validate_output() => %s.validate():
  output[%r]: need %r; got %r: %rr)r�hasattrr/�primary_key�
allowed_types�unicoderr
r&r	rr)rr(rr*�typesrrrr!�s

���zPrimaryKey.validateN�rrrr!rrrrr-�sr-c@seZdZdd�ZdS)�ListOfPrimaryKeysc
Cs�t|d�rttf}ntf}t||�sLtd|j|jj|j|dt	|�|f��t|d�r�t
|d�rz|jrz|jjrz|jjj
}ntf}t|�D]<\}}t||�s�tt|j|jj||j|dt	|�|f��q�dS)Nr.r0rr/)rrrr4r
r&r	rrrr1r/r2r3r%r')rr(�valuesr*r5r+rrrrr!�s*


���

�zListOfPrimaryKeys.validateNr6rrrrr7�sr7�resultz*All commands should at least have a result)r
�summaryz-User-friendly description of action performedrz:The primary_key value of the entry, e.g. 'jdoe' for a userZ
no_display)r�countzNumber of entries returnedZ	truncatedz%True if not all results were returnedzList of deletions that failedz'True means the operation was successful)$r ZsixZipalib.plugablerrZipalib.capabilitiesrZipalib.textrZipalib.utilrZPY3�strr4rr"r'r$r-r7r9rr:rZstandardZstandard_entry�int�boolZstandard_list_of_entriesr#Zstandard_deleteZstandard_multi_deleteZstandard_booleanZstandard_valueZsimple_valueZsimple_entryrrrr�<module>shK���������