當前位置: 首頁>>代碼示例>>Python>>正文


Python IPlugin.IPlugin方法代碼示例

本文整理匯總了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 
開發者ID:xtiankisutsa,項目名稱:MARA_Framework,代碼行數:19,代碼來源:PluginManagerDecorator.py

示例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) 
開發者ID:xtiankisutsa,項目名稱:MARA_Framework,代碼行數:21,代碼來源:AutoInstallPluginManager.py

示例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, []) 
開發者ID:Arello-Mobile,項目名稱:py2swagger,代碼行數:12,代碼來源:test_plugins.py

示例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 
開發者ID:openbci-archive,項目名稱:OpenBCI_Python,代碼行數:15,代碼來源:plugin_interface.py

示例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 =  [ ] 
開發者ID:xtiankisutsa,項目名稱:MARA_Framework,代碼行數:16,代碼來源:FilteredPluginManager.py

示例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) 
開發者ID:xtiankisutsa,項目名稱:MARA_Framework,代碼行數:17,代碼來源:PluginManager.py

示例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() 
開發者ID:xtiankisutsa,項目名稱:MARA_Framework,代碼行數:17,代碼來源:VersionedPluginManager.py


注:本文中的yapsy.IPlugin.IPlugin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。