當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。