當前位置: 首頁>>代碼示例>>Python>>正文


Python PluginManager.getInstance方法代碼示例

本文整理匯總了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")
開發者ID:escaped,項目名稱:EasyClimatePlot,代碼行數:11,代碼來源:pluginselection.py

示例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)
開發者ID:nichollyn,項目名稱:libspark,代碼行數:20,代碼來源:pluginview.py

示例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
開發者ID:nichollyn,項目名稱:libspark,代碼行數:24,代碼來源:plugin1.py


注:本文中的pluginmanager.PluginManager.getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。