本文整理汇总了Python中plugin_manager.PluginManager.get_plugin_info方法的典型用法代码示例。如果您正苦于以下问题:Python PluginManager.get_plugin_info方法的具体用法?Python PluginManager.get_plugin_info怎么用?Python PluginManager.get_plugin_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plugin_manager.PluginManager
的用法示例。
在下文中一共展示了PluginManager.get_plugin_info方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _do_modules
# 需要导入模块: from plugin_manager import PluginManager [as 别名]
# 或者: from plugin_manager.PluginManager import get_plugin_info [as 别名]
def _do_modules(self, request):
if request.method == 'POST':
try:
if 'file' in request.FILES:
file = request.FILES['file']
fname = file.name.encode('utf-8')
tmp_upload_path = '/tmp/{}'.format(fname)
fp = open(tmp_upload_path, 'wb')
for chunk in file.chunks():
fp.write(chunk)
fp.close()
zip = ZipFile(tmp_upload_path, 'r')
zip.extractall(path=PluginManager.PLUGIN_DIRECTORY)
Mediaplat.request({'module' : 'plugin_manager',
'action' : 'load_all_plugins',
'params' : None})
else:
action = request.POST.get('action')
plugin = request.POST.get('plugin')
if action not in ['activate', 'deactivate', 'remove']:
log.error('Invalid request : ' + action)
else:
Mediaplat.request({'module' : 'plugin_manager',
'action' : action,
'params' : (plugin)})
except (IOError, BadZipfile):
log.exception('module error')
self.args['cur_menu'] = 'setting'
self.args['submenu'] = 'modules'
self.args['submenu_list'] = submenu_list
self.args['modules'] = PluginManager.get_plugin_info()
return ('modules.html', self.args)