本文整理匯總了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