当前位置: 首页>>代码示例>>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;未经允许,请勿转载。