本文整理匯總了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()