}CevdZddlmZddlmZddlmZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z ddlmZddlmZmZd d lmZmZmZd d lmZedd ZeedZdZdZdZeddr>> detectplugin('plugins') ('from .plugins import cpanel as api', 'cPanel') :param plugin_pack: package name or the name of the plug-ins directory ('cache' - cache plugins users; 'plugins' - officially supported plug-ins) :rtype: tuple :return: a pair of values: (line to import the package, the name of the control panel) z*.pycg|]D}tjtj|dES)r)r'r(splitextbasename).0 py_full_paths r5 z detectplugin..wsM  )),7788;r7__init__z{}.{}.{}zfrom .z import z as apizCan not import z pluginnamez8cpapi: Plugin {} does not satisfy cpapi requirements: {}Nr&)r'r(joindirname__file__globr:r;r ImportErrorr PanelPluginget_cp_descriptionAttributeError TypeErrorKeyErrorsyslog LOG_WARNINGstr) plugin_pack ignore_errors plugin_dirplugin_path_patternmodulesmod_nameabsolute_module_name import_stringr9 panel_class panel_dataexcs r5 detectpluginraes bgooh77EEJ',,z6:: I&9::G  z ! ! )001C[RZ[[7B{{HHHM  ^ 455CC ^ ^ ^ ^''FZFZFZ(\]]]  ^ //++K$7799J *V"44 4 4 4 84    M"KRRc#hh((          :s+2C C$C$(1DE=3AE88E=cltj}|dkrdStj|dS)zJ Get current user's username based on os.getuid() :rtype: str rroot)r'getuidpwdgetpwuid)uids r5getuserrhs2 )++C axxv <  Q r7ct|dddl}||t jdtj|dddS)zAcreate (or rewrite) an empty __init__.py and it's .pyc/.pyo partswrNz{} -O -m py_compile "{}"Tz /bin/bash)shell executable) openclose py_compilecompile subprocessrunr:sysrl) init_pathros r5_reinit_moduleruspC   y!!!N-44S^YOOW[hsttttttr7c`d}d}tjtjt|}t j||r5tj|rt j||ntj |tj |dtj|d}t| t|\}}n>#t$r1}d\}}td|Yd}~nd}~wwxYw|Kt j|tj |t|t|d\}}| t t"}}td |z|rt%t&d }|||t%t,d } | |d z| dSdS) Ncachepluginsiz __init__.pyr&z WARNING: {}T)rWzHWARNING: can not detect control panel; the control panel is set to "%s" rj )r'r(rIrJrKshutilrmtreer/copytreemkdirchmodrurarprintr:r r rmr writern API_LINK_PATH) plugins_dir CACHE_DIR PLUGINS_PATH cache_dirrtr]cpnamer` cpname_cacheapi_link_streams r5 rebuild_cachersIL RW__X66 BBI M)rw}}[11 Y//// HY Y 66I9) ,Y 7 7 vv ))) * v m""3''(((((((()~ i    y!!! ,\ N N N v ~!2Ov  X[aabbb  L#.. 6""" }c22md2333   s+C>> D9'D44D9)N)F)6__doc__ __future__rrrr'rqrsrerLrzrS importlibr configparserrclcommon.clcustomscriptrr constr r r cpapiexceptionsr clsysconfigreadCONTROLPANELNAME_VARDETECTFUNCNAME_VARr; PLUGINS_DIR has_optiongetr(existsrrIrJrKrr,r-r.r0r1r2r*r+r6r?rarhrurr7r5rs~&%%%%%&&&&&&  ######%%%%%%JJJJJJJJCCCCCCCCCC......le<<< #% '+>>G//'+/FFK 7>>+ & &G EFFF RW__X66 EE      m\K#Y,,,6....b   uuu*+ + + + + + r7