/usr/lib/python2.6/site-packages/clcommon/cpapi
Edit: /usr/lib/python2.6/site-packages/clcommon/cpapi/pluginlib.pyo (3605B)
Ñò
\=0Yc @ s d Z d d k Z d d k l Z d d k Z d d k Z d d k l Z l Z l Z d d k l
Z
d Z e ƒ Z e i
e ƒ d Z d Z d Z e i d d
d d ƒ o e i d d
d d ƒ Z n e i i e i i e ƒ d
ƒ Z d „ Z e d „ Z d S( s
Library to work with plug-ins
iÿÿÿÿN( t ConfigParser( t CACHE_CPNAMEt UNKNOWN_CP_NAMEt UNKNOWN_CP_IMPORT( t PluginImportErrors /etc/sysconfig/cloudlinuxt
__cpname__t detectt sectiont cpapit optiont plugindirs
apilink.pyc
B s) e i i e i i e ƒ | ƒ } g } e i e i i | d ƒ ƒ D]) } | e i i e i i | ƒ ƒ d qD ~ } x¬ | D]¤ } | d j o q} n d } d | | f } y | d UWn e d | f ƒ ‚ n Xe
| e d ƒ } | o2 e
| e d ƒ } | o | ƒ o | | f Sq} q} Wd S( s³
Scan directory for the presence of plugins.
Plugin is considered a file with the extension "py", and with a non-empty variable "__cpname__" inside
(the name of the control panel). Also in the file must be a function "detect" which returns True in the case of
the presence of the control panel.
>>> 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)
s *.pyi t __init__s from %s import %s as apiNs Can not import %s plugin( NN(
t ost patht joint dirnamet __file__t globt splitextt basenamet NoneR t getattrt CONTROLPANELNAME_VARt DETECTFUNCNAME_VAR(
t plugin_packt
plugin_dirt _[1]t py_full_patht modulest mod_namet apit
import_stringt controlpanelnamet detect_func( ( s<