ѠgHZdZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZmZddlmZmZmZddlmZe dd Zeed Zd Zd ZdZeddr>> 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 r2 z detectplugin..tsM  )),7788;r4__init__.zfrom .z import z as apiNzCan not import z pluginnamezcpapi: Plugin z& does not satisfy cpapi requirements: r#)r$r%joindirname__file__globr7r ImportErrorr PanelPluginget_cp_descriptionAttributeError TypeErrorKeyErrorsyslog LOG_WARNING) plugin_pack ignore_errors plugin_dirplugin_path_patternmodulesmod_nameabsolute_module_name import_stringr6e panel_class panel_dataexcs r2 detectpluginr^bs bgooh77EEJ',,z6:: I&9::G  z ! ! "4OO{OOXOOGGGhGGG  \ 455CC \ \ \ #$S6J$S$S$STTZ[ [ \ //++K$7799J *V"44 4 4 4 84    M"WWWRUWW          :s6%B55 C?CCC#1DE.%EEcltj}|dkrdStj|dS)zJ Get current user's username based on os.getuid() :rtype: str rroot)r$getuidpwdgetpwuid)uids r2getuserres2 )++C axxv <  Q r4ct|dd5 dddn #1swxYwYtj|tjt jd|dddd dS) zAcreate (or rewrite) an empty __init__.py and it's .pyc/.pyo partswutf-8encodingNz -O -m py_compile ""Tz /bin/bashF)shell executablecheck)open py_compilecompile subprocessrunsysrm) init_paths r2_reinit_modulervs iw / / /                  y!!!N >::i::: s !%%c\d}d}tjtjt|}t j||r5tj|rt j||ntj |tj |dtj|d}t| t|\}}n.#t$r!}d\}}td|Yd}~nd}~wwxYw|Kt j|tj |t|t|d\}}|!tt }}td |d |rt#t$d d 5}||dddn #1swxYwYt#t(d d 5}||dzddddS#1swxYwYdSdS)Ncachepluginsiz __init__.pyr#z WARNING: T)rSzDWARNING: can not detect control panel; the control panel is set to "rkrgrhri )r$r%rFrGrHshutilrmtreer,copytreemkdirchmodrvr^r printr r rorwrite API_LINK_PATH) plugins_dir CACHE_DIR PLUGINS_PATH cache_dirrurYcpnamer]fs r2 rebuild_cachersIL RW__X66 BBI M)rw}}[11 Y//// HY Y 66I9! ,Y 7 7 vv !!! * v #        !~ i    y!!! ,\ N N N v ~!2Ov  ^U[^^^___ * ,g 6 6 6 ! GGFOOO                -w 7 7 7 *1 GGMD( ) ) ) * * * * * * * * * * * * * * * * * * * *s<+C>> D)D$$D)5GGG9HH#&H#)N)F)3__doc__r$rprrrtrbrIr{rP importlibr configparserrclcommon.clcustomscriptrrconstrr r cpapiexceptionsr clsysconfigreadCONTROLPANELNAME_VARDETECTFUNCNAME_VARr7 PLUGINS_DIR has_optiongetr%existsrrFrGrHrr)r*r+r-r.r/r'r(r3r;r^rervrr4r2rsQ  ######%%%%%%JJJJJJJJCCCCCCCCCC......le<<< #% '+>>G//'+/FFK 7>>+ & &G EFFF RW__X66 EE      m\K#Y,,,6,,,,^      *)*)*)*)*)*)*r4