Edit File: whmapi_lib.cpython-311.pyc
� �e� � �� � d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm Z ddl mZ d Z G d � de� � Z G d� d e � � Z G d� de � � Z G d� d� � ZdS )z, Everything that is related to whmapi calls � )�print_function)�absolute_import)�divisionN)�FormattedException)�run_command)� urlencode)� WhmApiRequest�WhmApiErrorc � � e Zd ZdZd� ZdS )r zW An error that is raised in case of an error in communication with whmapi. c �6 � t j | ||d�� � d S )N)�message�context)r �__init__)�selfr r s ��/builddir/build/BUILDROOT/alt-python27-cllib-3.3.5-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/lib/whmapi_lib.pyr zWhmApiError.__init__ s3 � ��#�D���+ � + � � � � � � N)�__name__� __module__�__qualname__�__doc__r � r r r r s- � � � � � �� � � � � � r r c � � e Zd ZdZdS )�WhmLicenseErrorz)A license-related error raised by whmapi.N�r r r r r r r r r % s � � � � � �3�3��Dr r c � � e Zd ZdZdS )�WhmNoPhpBinariesErrorz; An error when there are no installed php binaries Nr r r r r r * s � � � � � �� � �Dr r c �t � e Zd ZdZdZdZd� Zd� Zed� � � Z e d� � � Ze d� � � Zd � Z d � ZdS )r a Wrapper over cpanel's whm command-line api tool that allows us to easily build complex requests (filter, sorting, etc) See details in the official cpanel docs (link below) https://documentation.cpanel.net/display/DD/Guide+to+WHM+API+1 z/usr/sbin/whmapi1� c �B � || _ i | _ i | _ ddg| _ d S )Nz--output�json)�_command�_filters�_args�_extra_args)r �commands r r zWhmApiRequest.__init__= s* � ��� ��� ��� �'��1����r c �N � t |d�� � \ }}}|dk rt d|�� � � t j |� � }d|v r#d|d v r|d d �d|d d<