本文整理汇总了Python中plugin_manager.PluginManager.get_driver方法的典型用法代码示例。如果您正苦于以下问题:Python PluginManager.get_driver方法的具体用法?Python PluginManager.get_driver怎么用?Python PluginManager.get_driver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plugin_manager.PluginManager
的用法示例。
在下文中一共展示了PluginManager.get_driver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: startup
# 需要导入模块: from plugin_manager import PluginManager [as 别名]
# 或者: from plugin_manager.PluginManager import get_driver [as 别名]
def startup(config_path=DEFAULT_SETTINGS_FILE):
#init logging
setup_logging()
#load the config file and start the listener, daemon
logging.debug("init starting up")
config = ConfigParser.ConfigParser()
logging.debug('reading setting from: %s' % config_path)
config.read(config_path)
#Load the plugin manager to get a handle to the plugins.
_plugin_manager = PluginManager(config)
locator = _plugin_manager.get_resource_locator()
datastore = _plugin_manager.get_datastore()
driver = _plugin_manager.get_driver()
_registrar = Registrar(datastore, driver)
#should the listener be started?
start_server = config.getboolean('DEFAULT', 'start_server')
if start_server:
server.set_registrar(registrar)
Thread.start(server.start())
#start looking for backends and updating the driver
#THIS CALL WILL NOT RETURN
daemon.start(_registrar, locator, config)
示例2: startup
# 需要导入模块: from plugin_manager import PluginManager [as 别名]
# 或者: from plugin_manager.PluginManager import get_driver [as 别名]
def startup(config_path=DEFAULT_SETTINGS_FILE):
''' Load the config file and start the listener, daemon '''
logging.debug('Init starting up')
config = ConfigParser.ConfigParser()
logging.debug('Reading setting from: %s' % config_path)
config.read(config_path)
''' Load the plugin manager to get a handle to the plugins. '''
plugin_manager = PluginManager(config)
_locator = plugin_manager.get_resource_locator()
_datastore = plugin_manager.get_datastore()
_driver = plugin_manager.get_driver()
_registrar = Registrar(_datastore, _driver)
''' Should the listener be started? '''
start_server = config.getboolean('DEFAULT', 'start_server')
if start_server:
server.set_registrar(registrar)
thread.start(server.start())
''' Start looking for backends and updating the driver '''
''' THIS CALL WILL NOT RETURN '''
daemon.start(_registrar, _locator, config)