AlkantarClanX12

Your IP : 3.145.164.47


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

�

�tg����dZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZd�Zd�Z
edkr�ej��Ze�d	d
d���Ze�d
d���Ze�dd���Ze�dddd���e���Zejd
kr
e
e��dSejdkr
ee��dSe���ejd��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]0}|�|j|j|j|jd����1|jr%tt
j|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.16-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clflags/cli.py�
<listcomp>zlist_flags.<locals>.<listcomp>Bs ��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>Gs8��
�
�
��
������ � �
�
�
r)r�appendrr	r
r�json�print�dumpsr�os�get_terminal_size�columns�add_rows)�args�flags�results�flag�ts     r�
list_flagsr-s/��*
���E��G���������I��+��I��|�	
�
�	�	�	�	��y��
�d�j���+�+�+�,�,�,����	��5�6�6�6��F��0�0�W�Q�Z�0�0�0���0�2�2�:�R�?��	
�
�
��	
�
�
�
�
� �
�
�
�	�	�	�	�a�����rc���ttd�}tddgddd���}|�t	|�������t
|��dS)	zY
    Useful information about system itself:
    - data paths for flags and metadata
    )zFlags default pathzFlags metadata path�Name�ValuerzGeneric system information�P)r�titlerN)rrrr'r�itemsr")r(r*r,s   r�system_infor4Nsp��9�8���G�
	�	����*��		�	�	�A�
�J�J�t�G�M�M�O�O�$�$�%�%�%�	�!�H�H�H�H�Hr�__main__zActions with flagsz3Available manipulations that you can do with flags.�action)r2r	�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)r6�defaultr9�)�__doc__�argparser!r$�sys�clflags.gatherr�clflags.configrr�prettytablerr-r4�__name__�ArgumentParser�parser�add_subparsers�
subparsers�
add_parser�info_subparser�list_subparser�add_argument�
parse_argsr(r6�
print_help�exitrrr�<module>rOs�����
��������	�	�	�	�
�
�
�
�������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���������������������3�r