????
Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/clwizard/__pycache__/ |
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/clwizard/__pycache__/parser.cpython-311.pyc |
� xޘf� � �: � d dl mZ d dlZd dlZd dlmZ d� Zd� ZdS )� )�absolute_importN)�get_supported_modulesc �< � t j | � � }n.# t t f$ r}t j d� � |�d }~ww xY wt � � }|� � � D �]3\ }}||vr9t j d|�dt |� � � � � ��� � �dt |� � � � � v r�t |d � � � � � � || � � � � � s?t j d|�dt |d � � � � � ��� � ���|r9t j d|�dt |� � � � � ��� � ���5|S )NzInvalid JSON data passed�'z9' module is not supported at the moment, available keys: �optionsz ' module has incorrect options: z%' module has incorrect instructions: ) �json�loads� TypeError� ValueError�argparse�ArgumentTypeErrorr �items�list�keys�set�issubset�supported_options)�json_string�data� json_error�supported_modules�name�instructionss �F/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwizard/parser.py�validate_json_modulesr s� � �U��z�+�&�&�����z�"� U� U� U��(�)C�D�D�*�T�����U���� .�/�/�� #�j�j�l�l� � ���l��(�(�(��,�,�(,���d�3D�3I�3I�3K�3K�.L�.L�.L�N�� � � ��\�.�.�0�0�1�1�1�1��|�I�.�3�3�5�5�6�6�?�?�%�d�+�=�=�?�?�� � � �0�0��t�t�T�,�y�"9�">�">�"@�"@�A�A�A�C�� � � � � ��,�,��4�4��l�/�/�1�1�2�2�2�4�� � � � �Ks � �A�=�Ac � � t j dd�� � }|� ddt j �� � |� d�� � }|� d d �� � }|� dd d�� � |� ddd�� � |� d�� � }|� ddt �� � |� ddd�� � |� dd�� � }|� dddd�� � |� dd�� � }|� dd �� � }|� d!t t � � � � �"� � |� | � � }|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)r! z --no-asynczInstall in the foreground)r! r z--forcez4Force the installer to ignore existing installationsT)�requiredz--json-dataz!JSON with modules to be installed)r! �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 r r � parse_args) �argv�parserr"