本文整理汇总了Python中yapsy.IPlugin.IPlugin方法的典型用法代码示例。如果您正苦于以下问题:Python IPlugin.IPlugin方法的具体用法?Python IPlugin.IPlugin怎么用?Python IPlugin.IPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yapsy.IPlugin
的用法示例。
在下文中一共展示了IPlugin.IPlugin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from yapsy import IPlugin [as 别名]
# 或者: from yapsy.IPlugin import IPlugin [as 别名]
def __init__(self, decorated_object=None,
# The following args will only be used if we need to
# create a default PluginManager
categories_filter=None,
directories_list=None,
plugin_info_ext="yapsy-plugin"):
if directories_list is None:
directories_list = [os.path.dirname(__file__)]
if categories_filter is None:
categories_filter = {"Default": IPlugin}
if decorated_object is None:
log.debug("Creating a default PluginManager instance to be decorated.")
from yapsy.PluginManager import PluginManager
decorated_object = PluginManager(categories_filter,
directories_list,
plugin_info_ext)
self._component = decorated_object
示例2: __init__
# 需要导入模块: from yapsy import IPlugin [as 别名]
# 或者: from yapsy.IPlugin import IPlugin [as 别名]
def __init__(self,
plugin_install_dir=None,
decorated_manager=None,
# The following args will only be used if we need to
# create a default PluginManager
categories_filter=None,
directories_list=None,
plugin_info_ext="yapsy-plugin"):
if categories_filter is None:
categories_filter = {"Default":IPlugin}
# Create the base decorator class
PluginManagerDecorator.__init__(self,
decorated_manager,
categories_filter,
directories_list,
plugin_info_ext)
# set the directory for new plugins
self.plugins_places=[]
self.setInstallDir(plugin_install_dir)
示例3: test_plugin
# 需要导入模块: from yapsy import IPlugin [as 别名]
# 或者: from yapsy.IPlugin import IPlugin [as 别名]
def test_plugin(self):
self.assertTrue(issubclass(Py2SwaggerPlugin, IPlugin))
plugin = Py2SwaggerPlugin()
self.assertEqual('', plugin.summary)
self.assertEqual('', plugin.description)
self.assertEqual(None, plugin.set_parser_arguments(None))
self.assertRaises(NotImplementedError, plugin.run, [])
示例4: pre_activate
# 需要导入模块: from yapsy import IPlugin [as 别名]
# 或者: from yapsy.IPlugin import IPlugin [as 别名]
def pre_activate(self, args, sample_rate=250, eeg_channels=8, aux_channels=3, imp_channels=0):
self.args = args
self.sample_rate = sample_rate
self.eeg_channels = eeg_channels
self.aux_channels = aux_channels
self.imp_channels = imp_channels
# by default we say that activation was okay -- inherited from IPlugin
self.is_activated = True
self.activate()
# tell outside world if init went good or bad
return self.is_activated
# inherited from IPlugin
示例5: __init__
# 需要导入模块: from yapsy import IPlugin [as 别名]
# 或者: from yapsy.IPlugin import IPlugin [as 别名]
def __init__(self,
decorated_manager=None,
categories_filter=None,
directories_list=None,
plugin_info_ext="yapsy-plugin"):
if categories_filter is None:
categories_filter = {"Default":IPlugin}
# Create the base decorator class
PluginManagerDecorator.__init__(self,decorated_manager,
categories_filter,
directories_list,
plugin_info_ext)
# prepare the mapping of the latest version of each plugin
self.rejectedPlugins = [ ]
示例6: __init__
# 需要导入模块: from yapsy import IPlugin [as 别名]
# 或者: from yapsy.IPlugin import IPlugin [as 别名]
def __init__(self,
categories_filter=None,
directories_list=None,
plugin_info_ext=None,
plugin_locator=None):
# as a good practice we don't use mutable objects as default
# values (these objects would become like static variables)
# for function/method arguments, but rather use None.
if categories_filter is None:
categories_filter = {"Default":IPlugin}
self.setCategoriesFilter(categories_filter)
plugin_locator = self._locatorDecide(plugin_info_ext, plugin_locator)
# plugin_locator could be either a dict defining strategies, or directly
# an IPluginLocator object
self.setPluginLocator(plugin_locator, directories_list)
示例7: __init__
# 需要导入模块: from yapsy import IPlugin [as 别名]
# 或者: from yapsy.IPlugin import IPlugin [as 别名]
def __init__(self,
decorated_manager=None,
categories_filter={"Default":IPlugin},
directories_list=None,
plugin_info_ext="yapsy-plugin"):
# Create the base decorator class
PluginManagerDecorator.__init__(self,decorated_manager,
categories_filter,
directories_list,
plugin_info_ext)
self.setPluginInfoClass(VersionedPluginInfo)
# prepare the storage for the early version of the plugins,
# for which only the latest version is the one that will be
# kept in the "core" plugin storage.
self._prepareAttic()