????

Your IP : 216.73.217.84


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

�

����x)��p�ddlZddlZddlZddlmZejd��ZdhZdhZhd�Z	d�Z
d�Zd	�ZdS)
�N)�get_supported_modulesz\A\d+(\.\d+){0,2}\Z�versions�default_version>�enable_selector�use_beta_for_da�enable_for_new_users�enable_for_existing_usersc	�B�|tvr2t|t��stjd|�d|�d����dS|t
vr�t|t��stjd|�d|�d����|D]N}t|t��rt�	|��stjd|�d|�d|������OdS|tvrLt|t��rt�	|��stjd|�d|�d|�����dSdS)N�'z' module option 'z' must be a booleanz' must be a listz' contains invalid version: z' has invalid version: )�
_BOOL_OPTIONS�
isinstance�bool�argparse�ArgumentTypeError�_VERSION_LIST_OPTIONS�list�str�_VERSION_RE�match�_VERSION_STRING_OPTIONS)�module_name�key�value�vers    �py/clwizard/parser.py�_validate_option_valuers���
�m����%��&�&�	��,�J�K�J�J�#�J�J�J���
�	�	�

�%�	%�	%��%��&�&�	��,�G�K�G�G�#�G�G�G���
��	�	�C��c�3�'�'�
�{�/@�/@��/E�/E�
��0�9��9�9�c�9�9�14�9�9����
�	�	�

�'�	'�	'��%��%�%�	�[�->�->�u�-E�-E�	��,�2�K�2�2�#�2�2�(-�2�2���
�
(�	'�	�	�c
��	tj|��}n.#ttf$r}t	jd��|�d}~wwxYwt
��}|���D�]e\}}||vr9t	jd|�dt|�	���������dt|�	����vr�t|d�	�����||�����s?t	jd|�dt|d�	���������|d���D]\}}t|||�����*|r9t	jd|�dt|�	�����������g|S)NzInvalid JSON data passedrz9' module is not supported at the moment, available keys: �optionsz ' module has incorrect options: z%' module has incorrect instructions: )�json�loads�	TypeError�
ValueErrorrrr�itemsr�keys�set�issubset�supported_optionsr)�json_string�data�
json_error�supported_modules�name�instructionsrrs        r�validate_json_modulesr/.s��U��z�+�&�&�����z�"�U�U�U��(�)C�D�D�*�T�����U����.�/�/��"�j�j�l�l�����l��(�(�(��,�D�D�D�D�#'�(9�(>�(>�(@�(@�#A�#A�D�D���
���\�.�.�0�0�1�1�1�1��|�I�.�3�3�5�5�6�6�?�?�%�d�+�=�=�?�?���
��0�d��d�d�d�<�PY�CZ�C_�C_�Ca�Ca�>b�>b�d�d����+�9�5�;�;�=�=�
9�
9�
��U�&�t�S�%�8�8�8�8�
9�
�	��,�Z�D�Z�Z�t�L�DU�DU�DW�DW�?X�?X�Z�Z���
�	��Ks��A�=�Ac��tjdd���}|�ddtj���|�d���}|�d	d
���}|�dd
d���|�ddd���|�d���}|�ddt���|�ddd���|�dd���}|�dddd���|�dd���}|�dd ���}|�d!tt�����"��|�
|��}|S)#z2
    Arg parser for cloudlinux-wizard utility
    zcloudlinux-wizardz)Utility for installing cloudlinux modules)�prog�descriptionz--json�
store_true)�action�help�	subparser)�dest�installzLInstall a module. The installation is performed in the background by default)r5z
--no-asynczInstall in the foreground)r5r4z--forcez4Force the installer to ignore existing installationsT)�requiredz--json-dataz!JSON with modules to be installed)r5�typez--resumez@Restart the installation process with previously given arguments�statusz(Return JSON with statuses of all modulesz	--initialz-izGet the current modules' status�finishz6Finalize the installation from UI and close the wizard�cancelz+Remove a module from the installation queue�module)�choices)r�ArgumentParser�add_argument�SUPPRESS�add_subparsers�
add_parser�add_mutually_exclusive_groupr/rr�
parse_args)	�argv�parserr6�install_parser�installer_group�
status_parser�
finish_parser�
cancel_parser�optss	         r�parse_cloudlinux_wizard_optsrOLs����
$�
 �?����F�
�����H�<M��N�N�N��%�%�;�%�7�7�I��)�)��
[�*���N�����6�|� ��������
C�� ����%�A�A�4�A�P�P�O�� � ��
0�
"�!����
� � ��
O��!�����(�(��A�)���M�����T�,�5V������(�(��O�)���M��(�(��D�)���M����x��6K�6M�6M�1N�1N��O�O�O����T�"�"�D��Kr)
rr �re�clwizard.modulesr�compilerrrrrr/rO�rr�<module>rTs�����������	�	�	�	�2�2�2�2�2�2��b�j�/�0�0��#���,�-��<�<�<�
����2���<6�6�6�6�6r