ó b=0Yc @sSdZddlZddlZddlmZddlmZmZddddd d d d d g ZedgZ e Z d„Z e ƒZ d„Z d„Zd„Zded„Zdd d„Zd„Zd„Zd„Zd„ZddlmZejeZxHeD]@Zeeeƒr2e eeƒZ!n d„Z!e"eee!ƒq WdS(!s< CloudLinux control panel API API for Hosting control panel iÿÿÿÿN(t NotSupported(t CACHE_CPNAMEtUNKNOWN_CP_NAMEtcpuserst resellerst db_accesstdblogin_cplogin_pairstcpinfotget_admin_emailtdocroott userdomainsthomedirst getCPNamecCsGt}tjjtƒrCttƒ}|jƒjƒ}|jƒn|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((t cplogin_lsttwith_system_users((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyRJs tcplogintpackagetmailtresellertdnscCsdS(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__.pyR ‚s(tapicOs-ttddttfƒttjƒ‚dS(Nt not_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 R tapilinkR!t _apiplugintmodulest__name__t _thismoduleR%thasattrtgetattrR$R#(((s;/usr/lib/python2.7/site-packages/clcommon/cpapi/__init__.pyts4