本文整理汇总了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)
示例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}