HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //usr/lib/python3.6/site-packages/ipalib/__pycache__/misc.cpython-36.opt-1.pyc
3

�d[e�
�@snddlZddlmZmZmZddlmZmZddlmZddl	m
Z
e
�ZGdd�de�ZGdd	�d	e�Z
dS)
�N)�
LocalOrRemote�_�ngettext)�Output�summary)�Flag)�Registryc	@s�eZdZed�Zed�ZdZeje	dded�dddgd	d
�fZe
deed�d
�e
deed�dgd�e
deed�dgd�e
fZdd�Zddd�ZdS)�envzShow environment variables.z%(count)d variables�
variables*�allzJretrieve and print all attributes from the server. Affects command output.�webui�	no_option�	no_outputT)�cli_name�doc�exclude�flags�default�resultz)Dictionary mapping variable name to value)�typer�totalz(Total number of variables env (>= count)Z
no_display)rrr�countz'Number of variables returned (<= total)cCspt�}xd|D]\}d|krTtj|jdd�d�}x8|jD]}|j|�r6|j|�q6Wq||jkr|j|�qW|S)N�*z.*�$)�set�re�compile�replacer	�match�add)�self�	variables�keysZqueryZpat�key�r$�/usr/lib/python3.6/misc.pyZ__find_keys=s


zenv.__find_keysNcsl|dkr�j}n
�j|�}tt�fdd�|D��t|�t�j�d�}t|�dkr`�j||d<nd|d<|S)Nc3s|]}|�j|fVqdS)N)r	)�.0r#)r r$r%�	<genexpr>Pszenv.execute.<locals>.<genexpr>)rrr�r)r	�_env__find_keys�dict�len�msg_summary)r r!�optionsr"�retr$)r r%�executeIs
zenv.execute)r
)N)�__name__�
__module__�__qualname__r�__doc__r,Z
takes_argsr�
takes_optionsrrr*�intr�
has_outputr)r/r$r$r$r%r	s8
r	c	@sleZdZed�Zeddd�Zeje	dded�ddd	gd
d�fZe
ded
�e
deed�d�e
fZdd�ZdS)�pluginszShow all loaded plugins.z%(count)d plugin loadedz%(count)d plugins loadedrrzJretrieve and print all attributes from the server. Affects command output.rr
rT)rrrrrrz(Dictionary mapping plugin names to basesrzNumber of plugins loaded)rrcKsdi}xN|jD]D}x>|j|�D].}t|�}dj|j|j�}|j|g�j|�qWqWt|t|�d�S)Nz{}.{})rr)	Zapir�formatr1r0�
setdefault�appendr*r+)r r-r�	namespaceZplugin�clsr#r$r$r%r/yszplugins.executeN)r0r1r2rr3rr,rr4rrr*r5rr6r/r$r$r$r%r7\s$


r7)rZipalibrrrZ
ipalib.outputrrrZipalib.plugabler�registerr	r7r$r$r$r%�<module>sI