本文整理汇总了Python中pluginmanager.PluginManager.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Python PluginManager.getInstance方法的具体用法?Python PluginManager.getInstance怎么用?Python PluginManager.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pluginmanager.PluginManager
的用法示例。
在下文中一共展示了PluginManager.getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pluginmanager import PluginManager [as 别名]
# 或者: from pluginmanager.PluginManager import getInstance [as 别名]
def __init__ (self, view, viewcontrol, type):
Control.__init__ (self, view)
self.vc = viewcontrol
self.pm = PluginManager.getInstance()
if type in [WizardPlugin.T_INPUT, WizardPlugin.T_OUTPUT]:
self.type = type # TODO Parameter
else:
raise Exception("Invalid PluginType")
示例2: updatePluginDependencies
# 需要导入模块: from pluginmanager import PluginManager [as 别名]
# 或者: from pluginmanager.PluginManager import getInstance [as 别名]
def updatePluginDependencies(self):
for spec in PluginManager.getInstance().loadQueue():
disableIndirectly = False
if spec.name() in self.whitelist:
continue
for depSpec in spec.dependencySpecs():
if not depSpec.isEnabled() or depSpec.isDisabledIndirectly():
disableIndirectly = True
break
childItem = self.specToItem[spec]
childItem.setDisabled(disableIndirectly)
if disableIndirectly == spec.isDisabledIndirectly():
continue
spec.setDisabledIndirectly(disableIndirectly)
if childItem.parent() and not childItem.parent().isExpanded():
childItem.parent().setExpanded(True)
示例3: initialize
# 需要导入模块: from pluginmanager import PluginManager [as 别名]
# 或者: from pluginmanager.PluginManager import getInstance [as 别名]
def initialize(self, arguments):
self.initializeCalled = False
obj = QObject(self)
obj.setObjectName("MyPlugin1")
self.addAutoReleaseObject(obj)
found2 = False
found3 = False
for otherPluginObj in PluginManager.getInstance().allObjects():
if otherPluginObj.objectName() == "MyPlugin2":
found2 = True
elif otherPluginObj.objectName() == "MyPlugin3":
found3 = True
if found2 and found3:
return True, "No error"
errorString = "object(s) missing from plugin(s):"
if not found2:
errorString += "plugin2"
if not found3:
errorString += "plugin3"
return False, errorString