本文整理汇总了Python中Plugins.buildPluginExecList方法的典型用法代码示例。如果您正苦于以下问题:Python Plugins.buildPluginExecList方法的具体用法?Python Plugins.buildPluginExecList怎么用?Python Plugins.buildPluginExecList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugins
的用法示例。
在下文中一共展示了Plugins.buildPluginExecList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: openList
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import buildPluginExecList [as 别名]
def openList(self):
res = []
splitext = os.path.splitext
for filename, ordered, enabled in Plugins.buildPluginExecList():
if os.path.basename(filename) == '__init__.plug-in.py':
continue
name = splitext(splitext(os.path.basename(filename))[0])[0]
if not enabled:
name = splitext(name)[0]
status = _('Disabled')
imgIdx = EditorHelper.imgSystemObjDisabled
else:
fn = filename.lower()
if Preferences.failedPlugins.has_key(fn):
kind, msg = Preferences.failedPlugins[fn]
if kind == 'Skipped':
status = _('Skipped plug-in: %s')% msg
imgIdx = EditorHelper.imgSystemObjPending
else:
status = _('Broken plug-in: %s')% msg
imgIdx = EditorHelper.imgSystemObjBroken
elif fn in Preferences.installedPlugins:
if ordered:
status = _('Installed, ordered')
imgIdx = EditorHelper.imgSystemObjOrdered
else:
status = _('Installed')
imgIdx = EditorHelper.imgSystemObj
else:
status = _('Pending restart')
imgIdx = EditorHelper.imgSystemObjPending
res.append(PluginFileExplNode(name, enabled, status, filename, imgIdx))
return res
示例2: exec
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import buildPluginExecList [as 别名]
if Preferences.csXmlSupport: from Models import XMLSupport
if Plugins.transportInstalled('ZopeLib.ZopeExplorer'):
import ZopeLib.ZopeEditorModels
if Utils.IsComEnabled():
PaletteStore.newControllers['MakePy-Dialog'] = Controllers.MakePyController
PaletteStore.paletteLists['New'].append('MakePy-Dialog')
#-Plug-ins initialisation-------------------------------------------------------
if Preferences.pluginPaths:
print 'executing plug-ins...'
fails = Preferences.failedPlugins
succeeded = Preferences.installedPlugins
for pluginFilename, ordered, enabled in Plugins.buildPluginExecList():
if not enabled:
continue
pluginBasename = os.path.basename(pluginFilename)
print 'executing %s'% os.path.splitext(pluginBasename)[0]
filename = pluginFilename.lower()
try:
exec(open(pluginFilename,'r'))
succeeded.append(filename)
except Plugins.SkipPluginSilently, msg:
fails[filename] = ('Skipped', msg)
except Plugins.SkipPlugin, msg:
fails[filename] = ('Skipped', msg)