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: //proc/self/root/usr/lib/python3.9/site-packages/ipapython/install/__pycache__/core.cpython-39.pyc
a

}�f�F�@s�dZddlZddlZddlZddlZddlZddlZddlmZddlm	Z	gd�Z
ed�ZeZ
dZdZd	Zd
ZdZdZd
Ze�Ze��Zejdd��ZGdd�de�ZGdd�de�ZGdd�dejd�Z efdd�Z!Gdd�de �Z"eeeeeeeeeeefdd�Z#efdd�Z$eeefdd �Z%Gd!d"�d"ej&d�Z'd#d$�Z(Gd%d&�d&ejej&�Z)Gd'd(�d(e'e)d�Z*d)d*�Z+Gd+d,�d,e'�Z,dS)-z
The framework core.
�N�)�util)�from_)�InvalidStateError�KnobValueError�Property�knob�Configurable�group�	Component�	CompositeZVALIDATE_PENDINGZVALIDATE_RUNNINGZEXECUTE_PENDINGZEXECUTE_RUNNINGZSTOPPEDZFAILEDZCLOSEDcCs0||urdSt||�rdSt||�r(dSdSdS)Nr���r)�
issubclass)�a�b�r�:/usr/lib/python3.9/site-packages/ipapython/install/core.py�
_class_key's

rc@seZdZdS)rN��__name__�
__module__�__qualname__rrrrr3srcseZdZ�fdd�Z�ZS)rcstt|��|�||_dS�N)�superr�__init__�name)�selfr�message��	__class__rrr8szKnobValueError.__init__)rrrr�
__classcell__rrrrr7src@sDeZdZdZdZdZedd��Zdd�Zdd�Z	dd	�Z
d
d�ZdS)�PropertyBaseNcCstd��dS)N�default)�AttributeError�rrrrr"DszPropertyBase.defaultcCsdSrr�r�outerrrrrHszPropertyBase.__init__cCs^|dur4z|j|jWSty(Yn0|��}qz|jWStyXt|j��Yn0dSr)�__dict__�__outer_name__�KeyError�
_get_fallbackr"r#�r�objZobj_typerrr�__get__Ks
zPropertyBase.__get__cCs2z||j|j<Wnty,t|j��Yn0dSr�r'r(r)r#)rr,�valuerrr�__set__XszPropertyBase.__set__cCs0z|j|j=Wnty*t|j��Yn0dSrr.)rr,rrr�
__delete__^szPropertyBase.__delete__)rrr�__outer_class__r(�_order�propertyr"rr-r0r1rrrrr!=s

r!)�	metaclasscCs$i}|tur||d<t�dtf|�S)Nr"r)�_missingr�InnerClassMetar!)r"�
class_dictrrrresrcspeZdZdZdZdZdZdZdZdZ	dd�Z
dd�Zed	d
��Z
edd��Zed
d��Ze�fdd��Z�ZS)�KnobBaseNFrrcCs
||_dSr�r&r%rrrrvszKnobBase.__init__cCsdSrr�rr/rrr�validateyszKnobBase.validatecCs
|j��Sr)r2r
��clsrrrr
|szKnobBase.groupcCstdd�|jD��S)Ncss"|]}|duo|�d�VqdS)N�-)�
startswith)�.0�nrrr�	<genexpr>�s�z-KnobBase.is_cli_positional.<locals>.<genexpr>)�all�	cli_namesr=rrr�is_cli_positional�s�zKnobBase.is_cli_positionalcst�fdd��}||_|S)Ncs
�|j�Srr:r$��funcrrr"�sz(KnobBase.default_getter.<locals>.default)r4r")r>rHr"rrGr�default_getter�szKnobBase.default_gettercs���fdd�}|�_�S)Ncs �|j|�t�|��|�dSr)r&rr<r;)rr>rHrrr<�sz$KnobBase.validator.<locals>.validate)r<)r>rHr<r)r>rHr�	validator�szKnobBase.validator)rrr�type�	sensitive�
deprecated�descriptionrE�cli_deprecated_names�cli_metavarrr<�classmethodr
rFrIrJr rrrrr9ms"


r9cCs.|durt}|turtf}nt|t�r,|f}|dus>t|t�rF|f}n|turVt|�}t|	t�rh|	f}	n|	turxt|	�}	i}|tur�||d<|tur�||d<|tur�||d<|tur�||d<|tur�||d<|tur�||d<|tur�||d<|tur�||d<|	tu�r|	|d	<|
tu�r |
|d
<t�d||�S)NrKr"r3rLrMrNr
rErOrPZKnob)	�NoneTyper6r9�
isinstance�builtin_type�str�tuplerr7)rKr"�basesr3rLrMrNr
rErOrPr8rrr�_knob�sH



rXcKst||fdtt�i|��S)z
    Define a new knob.
    r3)rX�next�_counter)rKr"�kwargsrrrr�s���rcKs:|tur|f}|tur t|j�}tt|f|t|d�|��S)z"
    Extend an existing knob.
    )rWr3r
)r6�staticmethodr
rX)�baser"rWr
r[rrr�extend_knob�s
���r^cs�eZdZdZe�fdd��Zedd��Ze�fdd��Zdd	�Z�fd
d�Z	�fdd
�Z
dd�Zej
�fdd��Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Z�fd"d#�Z�fd$d%�Z�fd&d'�Zd(d)�Z�ZS)*r	zh
    Base class of all configurables.

    FIXME: details of validate/execute, properties and knobs
    c#s�ttt|�d�rJ�t�}|jD]�}g}|j��D]F\}}||vrDq2|�|�t|t	�sZq2t
|t�sfq2|�|j
||f�q2t|dd�d�}|D]\}}}||fVq�q dS)zG
        Iterate over properties defined for the configurable.
        �
propertiescSs|dS�Nrr��rrrr�<lambda>�z)Configurable.properties.<locals>.<lambda>��keyN)�hasattrrr	�set�__mro__r'�items�addrSrKrr!�appendr3�sorted)r>�seen�	owner_cls�resultr�prop_clsr3rrrr_�s 



zConfigurable.propertiesccs4|��D]&\}}t||�}t|t�r||fVqdSr)r_�getattrrr9)r>rorrqrrr�knobss

zConfigurable.knobscsttt|�d�rJ�dS)Nr
)rgrr	r=rrrr
szConfigurable.groupc
KsP|j}|��D]d\}}|�d�r"qt||�}t|t�s8qt|t�sDqz|�|�}Wnt	ydYq0t
|||�q|��D]�\}}|�d�r�q|t||�s�q|t||d�}|dur�q|t||�}||�}z|�|�Wq|t
�y}zt|t|���WYd}~q|d}~00q||�rDt|�}	td�t|�jt|	�d�dd�|	D�����|��dS)z.
        Initialize the configurable.
        �_Nz/{0}() got {1} unexpected keyword arguments: {2}z, css|]}t|�VqdSr)�repr)rArrrrrCBrdz(Configurable.__init__.<locals>.<genexpr>)rr_r@rrrSrKrr!�popr)�setattrrsr<�
ValueErrorrrUrm�	TypeError�formatr�len�join�_reset)
rr[r>rorrqr/Zprop�eZextrarrrrsL






&��zConfigurable.__init__cs.ttt|�d�rJ�t|_t�|���|_dS)Nr})	rgrr	�_VALIDATE_PENDING�_Configurable__staterZrun_generator_with_yield_from�
_configure�_Configurable__genr$rrrr}FszConfigurable._resetcs&ttt|�d�rJ�td�|���dS)N�_get_componentsz{0} is not composite)rgrr	ryrzr$rrrr�LszConfigurable._get_componentscCsdSrrr$rrrr*QszConfigurable._get_fallbackc#s6ttt|�d�rJ�|�tt�|jtkr2dVq dS)zH
        Coroutine which defines the logic of the configurable.
        r�N)rgrr	�_Configurable__transition�_VALIDATE_RUNNING�_EXECUTE_PENDINGr��_EXECUTE_RUNNINGr$rrrr�Ts
zConfigurable._configurecCs|��|jtkr|��SdS)z'
        Run the configurable.
        N)r<r�r��executer$rrr�runas
zConfigurable.runcCs|��D]}qdS)z>
        Run the validation part of the configurable.
        N��
_validator)rZ_nothingrrrr<kszConfigurable.validatecCs|�tt|j�S)zO
        Coroutine which runs the validation part of the configurable.
        )�_Configurable__runnerrr��_handle_validate_exceptionr$rrrr�ss�zConfigurable._validatorcCs*d}|��D]}|dur||kr|}q|S)z=
        Run the execution part of the configurable.
        rN)�	_executor)rZreturn_valueZrvalrrrr�|s
zConfigurable.executecCs|�tt|j�S)zN
        Coroutine which runs the execution part of the configurable.
        )r�r�r��_handle_execute_exceptionr$rrrr��s�zConfigurable._executorcCs|jtttfvS)z?
        Return True if the configurable has finished.
        )r��_STOPPED�_FAILED�_CLOSEDr$rrr�done�szConfigurable.doneccs6|jtkr2zt|�VWqty.Yq2Yq0qdSr)r�r�rY�
StopIteration)r�genrrr�run_until_executing�s

z Configurable.run_until_executingc#s���||��fdd�}|}z
|�Wn�tyH��|t�Yq�Ynhtyh��|t�Yq�YnHty�t���z|��Wn ty���|t��Yn0Yn0�j	|kr�q�z
dVWn,ty�t�����fdd�}|}Yq0|}qdS)Ncs
t�j�Sr)rYr�rr$rr�	step_next�sz(Configurable.__runner.<locals>.step_nextcs�jj��Sr)r��throwr��exc_inforrr�
step_throw�sz)Configurable.__runner.<locals>.step_throw)
r�r�r��
GeneratorExitr��
BaseException�sysr�r�r�)rZ
pending_stateZ
running_stateZexc_handlerr��stepr�rr�rZ__runner�s6



zConfigurable.__runnercs"ttt|�d�rJ�tj|�dS)N�_handle_exception)rgrr	�sixZreraise�rr�rrrr��szConfigurable._handle_exceptioncs"ttt|�d�rJ�|�|�dS)Nr��rgrr	r�r�rrrr��s
�z'Configurable._handle_validate_exceptioncs"ttt|�d�rJ�|�|�dS)Nr�r�r�rrrr��s
�z&Configurable._handle_execute_exceptioncCs|j|krt|j��||_dSr)r�r)rZ
from_stateZto_staterrrZ__transition�s

zConfigurable.__transition)rrr�__doc__rQr_rsr
rr}r�r*�abc�abstractmethodr�r�r<r�r�r�r�r�r�r�r�r�r�r rrrrr	�s2
0
		(r	cs�fdd�}t|��_�S)Ncs�Srrrr=rrr
�szgroup.<locals>.group)r\r
)r>r
rr=rr
�s
r
c@seZdZdS)�
ComponentMetaNrrrrrr��sr�cs`eZdZdZdZdZe�fdd��Z�fdd�Ze	dd��Z
dd	�Zd
d�Z�fdd
�Z
�ZS)�
ComponentBaseNcs(tt|���}|dur|S|j��SdSr)rr�r
r2)r>rprrrr
�szComponentBase.groupcs ||_tt|�jfi|��dSr)�_ComponentBase__parentrr�r)r�parentr[rrrr�szComponentBase.__init__cCs|jSr�r�r$rrrr��szComponentBase.parentcCs||j|j<|Sr)r'r(r+rrrr-szComponentBase.__get__cCs|jSrr�r$rrrr*szComponentBase._get_fallbackcs@ztt|��|�Wn&ty:t��}|j�|�Yn0dSr)rr�r�r�r�r�r�r�rrrr�	s
zComponentBase._handle_exception)rrrr2r(r3rQr
rr4r�r-r*r�r rrrrr��s
r�cCs i}tt�|d<tdt|f|�S)Nr3r)rYrZr�r�)r>r8rrrrsrcs\eZdZdZe�fdd��Ze�fdd��Zdd�Z�fdd	�Zd
d�Z	�fdd
�Z
�ZS)rzi
    Configurable composed of any number of components.

    Provides knobs of all child components.
    c	
#shi}t��}tt|���D]"\}}|||<|�|g��|�q|��D]�\}}t||�}|�	�D]�\}}t
||�rtq`z||}Wn,ty�|||<|�|g��|�Yq`0t||�}t||�}t||��r|||<||�
|�|�|g�|||v�r2||�|�q`t||�s`td�|j||j|j���q`qFt|td�D] }||D]}||fV�qN�qBdS)Nz<{0}.knobs(): conflicting definitions of '{1}' in {2} and {3}re)�collections�OrderedDictrrr_�
setdefaultrl�
componentsrrrsrgr)r�removeryrzrrmr)	r>Z	name_dictZ
owner_dictror�comp_clsZlast_owner_clsZknob_clsZ
last_knob_clsrrrr_sB




�
zComposite.propertiesc#s�ttt|�d�rJ�t�}|jD]�}g}|j��D]F\}}||vrDq2|�|�t|t	�sZq2t
|t�sfq2|�|j
||f�q2t|dd�d�}|D]\}}}||fVq�q dS)Nr�cSs|dSr`rrarrrrc^rdz&Composite.components.<locals>.<lambda>re)rgrrrhrir'rjrkrSrKrr�rlr3rm)r>rnrorprr�r3rrrr�Is 



zComposite.componentscCsR|��D]\}}||krq&qt|��|jD]}t||�r,qHq,t|��t||�Sr)rsr#�_Composite__componentsrSrr)rrroZ	knob_nameZ	componentrrr�__getattr__cs

zComposite.__getattr__cs t|���|_tt|���dSr)�listr�r�rrr}r$rrrr}rszComposite._resetccs"|��D]\}}t||�VqdSr)r�rr)rZ
_owner_clsrrrrr�wszComposite._get_componentsc	#s�dd�|jD�}g}|D]6\}}zt|�Wnty>Yq0|�||f�q|sVqb|}dVq|jsldSttt|����Vdd�|jD�}g}|D]6\}}zt|�Wnty�Yq�0|�||f�q�|s�q�|}dVq�dS)NcSsg|]}||��f�qSrr��rA�crrr�
<listcomp>|rdz(Composite._configure.<locals>.<listcomp>cSs g|]}|��s||��f�qSr)r�r�r�rrrr��s�)r�rYr�rlrrrr�)rr<Znew_validate�childrJr�Znew_execute�executorrrrr�{s6zComposite._configure)rrrr�rQr_r�r�r}r�r�r rrrrrs)r)-r�r�r��	functools�	itertoolsr�r��rr�__all__rKrRrTrr�r�r�r�r�r��objectr6�countrZ�
cmp_to_keyr�	Exceptionrrxrr7r!rr9rXrr^�ABCMetar	r
r�r�rrrrrr�<module>sR
(+�
/x	'