• File: __init__.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyc
  • Date Modified: 06/01/2017 4:14 PM
  • File size: 5.12 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

b=0Yc	@sSdZddlZddlZddlmZddlmZmZddddd	d
ddd
g	ZedgZ	e	Z
dZeZdZ
dZdZdedZdd dZdZdZdZdZddlmZejeZxHeD]@Zeeer2e eeZ!n	dZ!e"eee!qWdS(!s<
CloudLinux control panel API
API for Hosting control panel
iN(tNotSupported(tCACHE_CPNAMEtUNKNOWN_CP_NAMEtcpuserst	resellerst	db_accesstdblogin_cplogin_pairstcpinfotget_admin_emailtdocroottuserdomainsthomedirst	getCPNamecCsGt}tjjtrCtt}|jj}|jn|S(N(	RtostpathtisfileRtopentreadlinetstriptclose(tcontrolpanelnametcache_stream((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyRs
cCsdS(s
    Generates a list of cpusers registered in the control panel

    :return: list of cpusers registered in the control panel
    :rtype: tuple
    :raise: NotSupported
    N((((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyR(scCsdS(s
    Generates a list of resellers in the control panel

    :return: list of cpusers registered in the control panel
    :rtype: tuple
    :raise: NotSupported
    N((((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyR3scCsdS(s
    Getting root access to mysql database.
    For example {'login': 'root', 'db': 'mysql', 'host': 'localhost', 'pass': '9pJUv38sAqqW'}

    :return: root access to mysql database
    :rtype: dict
    :raises: NoDBAccessData, NotSupported
    N((((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyR>s	cCsdS(s
    Returs a list of pairs, the database user login - user login control panel
    For example:
        (('nata2_someuse', 'nata2'), ('testsome_dfrtbus', 'testsome'))
    :param list|tuple|None cplogin_lst: list of control panel users
    :param bool with_system_users: add system users to dbmapping
    :return: list of pairs, the database user login - user login control panel
    :rtype: tuple
    :raises: NotSupported, NoPackage
    N((tcplogin_lsttwith_system_users((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyRJstcplogintpackagetmailtresellertdnscCsdS(s
    keyls a list of data which is necessary to obtain the user, the values ​​can be:
       cplogin - name/login user control panel
       mail - Email users
       reseller - name reseller/owner users
       locale - localization of the user account
       package - User name of the package
       dns - domain of the user
    :param str|unicode|list|tuple|None cpuser: user login
    :return: returns a tuple of tuples of data in the same sequence as specified keys in keylst
    :rtype: tuple
    (((tcpusertkeyls((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyRXs
cCsdS(s<
    Gets admin email
    :return: string - admin email
    t((((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyRhscCsdS(sr
    Return document root for domain
    :param str|unicode domain:
    :return str: document root for domain
    R((tdomain((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyR	pscCsdgS(s
    Return domain and document root pairs for control panel user
    first domain is main domain
    :param str|unicode cpuser: user login
    :return list of tuples (domain_name, documen_root)
    (((R((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyR
yscCsgS(s
    Returns list of users' home dirs for particular detected panel
    In case of no panel it returns empty list
    :return list of home dirs
    ((((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyRs(tapicOs-ttddttfttjdS(Ntnot_supports,"%s" api not supported in "%s" control panel(tsetattrt	_api_funct	_api_nametCP_NAMERR"(targstkwargs((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyR$s(RRRRR(#t__doc__R
tsystcpapiexceptionsRtconstRRt
_API_IMPORTEDt_API_SUPPORTEDt__all__RR&RRRtNonetFalseRRRR	R
RtapilinkR!t
_apiplugintmodulest__name__t_thismoduleR%thasattrtgetattrR$R#(((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyt<module>s4