????

Your IP : 3.12.153.221


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/clflags/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/clflags/__pycache__/cli.cpython-311.opt-1.pyc

�

K�f����dZddlZddlZddlZddlmZddlmZmZddl	m
Z
d�Zd�Ze
dkr�ej��Ze�d	d
d���Ze�d
d���Ze�dd���Ze�dddd���e���Zejd
kr
ee��dSejdkr
ee��dSe���ed��dSdS)zl
Set of useful command line options to quickly get
information about available flags, their status and path
�N)�list_flags_info)�DEFAULT_FLAGS_STORAGE_PATH�DEFAULT_META_STORAGE_PATH)�PrettyTablec	��t��}g}|D]<}|�t|j|j|j|j������=|jr%ttj	|d�����dS|std��dStd�|dD��dtj��j
d	z
d
���}|�d�|D����t|��dS)
aM
    Lists information about all available flags on server.

    Supports both human-readable and json formats.

    E.g.
    +--------------------------------------------------------------------+
    | Name       | Description          | Path                 | Enabled |
    +------------+----------------------+----------------------+---------+
    | first-test | My first and super   | /var/cloudlinux/flag | False   |
    |            | cool flag that I can | s/enabled-           |         |
    |            | use everywhere       | flags.d/first-       |         |
    |            |                      | test.flag            |         |
    | super-test | My second and super  | /var/cloudlinux/flag | False   |
    |            | cool flag that I can | s/enabled-           |         |
    |            | use everywhere. Used | flags.d/super-       |         |
    |            | in AccelerateWP and  | test.flag            |         |
    |            | Immunify teams.      |                      |         |
    +------------+----------------------+----------------------+---------+
    )�name�description�path�enabled�)�indentNz!No flags available on this serverc�6�g|]}|�����S�)�
capitalize)�.0�is  ��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.8-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clflags/cli.py�
<listcomp>zlist_flags.<locals>.<listcomp>As ��0�0�0��Q�\�\�^�^�0�0�0�r�l�
�<)�align�max_table_width�	max_widthc�P�g|]#}t|�������$Sr)�list�values)r�values  rrzlist_flags.<locals>.<listcomp>Fs8��
�
�
��
������ � �
�
�
r)r�append�dictrr	r
r�json�print�dumpsr�os�get_terminal_size�columns�add_rows)�args�flags�results�flag�ts     r�
list_flagsr.s6��*
���E��G��������t����(����L�	
�
�
�	�	�	�	��y��
�d�j���+�+�+�,�,�,����	��5�6�6�6��F��0�0�W�Q�Z�0�0�0���0�2�2�:�R�?��	
�
�
��	
�
�
�
�
� �
�
�
�	�	�	�	�a�����rc���ttd�}tddgddd���}|�d�|���D����t|��d	S)
zY
    Useful information about system itself:
    - data paths for flags and metadata
    )zFlags default pathzFlags metadata path�Name�ValuerzGeneric system information�P)r�titlerc��g|]	\}}||f��
Srr)rrrs   rrzsystem_info.<locals>.<listcomp>\s0������D�%�
�u�
���rN)rrrr(�itemsr#)r)r+r-s   r�system_infor6Ms���9�8���G�
	�	����*��		�	�	�A�
�J�J���"�=�=�?�?�������
�!�H�H�H�H�Hr�__main__zActions with flagsz3Available manipulations that you can do with flags.�action)r3r	�dest�infoz+Prints useful information about the system.)�helprzQList all available flags on this server, their paths and current reported status.z--json�
store_trueFzReturn response in json format)r8�defaultr;�)�__doc__�argparser"r%�clflags.gatherr�clflags.configrr�prettytablerr.r6�__name__�ArgumentParser�parser�add_subparsers�
subparsers�
add_parser�info_subparser�list_subparser�add_argument�
parse_argsr)r8�
print_help�exitrrr�<module>rPs�����
��������	�	�	�	�������Q�P�P�P�P�P�P�P�#�#�#�#�#�#�2�2�2�j
�
�
�,�z���
$�X�
$�
&�
&�F��&�&�"�I�
�'���J� �*�*��B�+�D�D�N� �*�*��@�+�A�A�N�������<� �>�>�>������D��{�f�����D������	
���	�	��
�4��������������Q������3�r