当前位置: 首页>>代码示例>>Python>>正文


Python PluginsHolder.isActive方法代码示例

本文整理汇总了Python中MaKaC.plugins.PluginsHolder.isActive方法的典型用法代码示例。如果您正苦于以下问题:Python PluginsHolder.isActive方法的具体用法?Python PluginsHolder.isActive怎么用?Python PluginsHolder.isActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MaKaC.plugins.PluginsHolder的用法示例。


在下文中一共展示了PluginsHolder.isActive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: eventDetailFooter

# 需要导入模块: from MaKaC.plugins import PluginsHolder [as 别名]
# 或者: from MaKaC.plugins.PluginsHolder import isActive [as 别名]
    def eventDetailFooter(cls, obj, vars):
        """
        Add the footer extension for the statistics tracking.
        """
        stats = PluginsHolder().getPluginType('statistics')
        register = StatisticsRegister()

        if not stats.isActive() or not register.hasActivePlugins():
            return False

        key = 'extraFooterContent'
        extension = {}
        tracking = {}

        tracking['trackingActive'] = True
        tracking['trackingHooks'] = register.getAllPluginJSHooks(obj)

        # Build the extension object to be passed to the footer.
        extension['path'] = register.getJSInjectionPath()
        extension['args'] = tracking

        if key not in vars:
            vars[key] = [extension]
        else:
            vars[key].append(extension)
开发者ID:aninhalacerda,项目名称:indico,代码行数:27,代码来源:chrome.py

示例2: _getAnswer

# 需要导入模块: from MaKaC.plugins import PluginsHolder [as 别名]
# 或者: from MaKaC.plugins.PluginsHolder import isActive [as 别名]
    def _getAnswer(self):        
        #entries = json.loads(self._data)['data']
        try:
            from indico.util.ICTP_available_sponsors import ocirne_dictionary as available_sponsors
        except:
            available_sponsors = {}

        # init sponsor vocabulary
        plugin = PluginsHolder().getPluginType('ictp_addons').getPlugin("sponsor_management")
        #sponsors_array = plugin.getOptions()["sponsors"].getValue()
        sponsors_array = []

        if plugin.isActive():
            for k in available_sponsors.keys():
                d = available_sponsors[k]
                logo = ''
                if d.has_key('logo'):
                    logo = d['logo']
                elem = {
                    'name': k, 
                    'title': d['title'], 
                    'country': d['country'], 
                    'logo': logo,
                    'optionname': 'ictp_addons.sponsor_management.sponsors', 
                    'structure': d['url'],
                    }
                sponsors_array.append(elem)
            
            
        

        #return json.dumps({'success': True, 'table': sponsors_array})


        #print "addLink sponsors_array=",sponsors_array

        self._targetOption.setValue(sponsors_array)
        self._targetOption._notifyModification()
        #plugin.getOption("sponsors").setValue(sponsors_array)
        #print "addLink targetOption+",self._targetOption.getValue()
        
        return {'success': True, 'table': sponsors_array}
开发者ID:Ictp,项目名称:ictp_addons,代码行数:44,代码来源:handlers.py


注:本文中的MaKaC.plugins.PluginsHolder.isActive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。