Commits

bb b...@gmx.de  committed 7f1c6a9 Draft

updated to use new PluginManager interface

  • Participants
  • Parent commits c2d98c4

Comments (0)

Files changed (1)

File araldo/server.py

     """ Launches WSGI server that will listen forever
     """
     logger = logging.getLogger("araldo")
-    logger.debug("Starting server on port %d", port)
+    logger.info("Starting server on port %d", port)
     server = pywsgi.WSGIServer(
         ("", port),
         WebSocketApp(queue),
     signal.signal(signal.SIGTERM, sig_handler)
     signal.signal(signal.SIGQUIT, sig_handler)
 
-def setup_plugins(logger):
-    PluginManager.instantiate_plugins()
-    
-    plugin_instances = PluginManager.plugin_instances()["araldo.endpoints.inbound"]
+def setup_plugins(logger, config):
+    plugin_manager = PluginManager.create(config)
+    plugin_instances = plugin_manager.plugin_instances()["araldo.endpoints.inbound"]
     logger.debug("Starting %d inbound handlers", len(plugin_instances)) 
-    [x.start() for x in plugin_instances]
+    [x.start() for x in plugin_instances.values()]
 
 
 def main():
     config = Config.create("araldo.yaml")
 
     setup_signals()
-    setup_plugins(logger)
+    setup_plugins(logger, config)
 
-    queue = PluginManager.gevent_queue()
+    queue = PluginManager.get().gevent_queue()
     setup_sending(config, queue)
     start_server(
         config.settings()["global"]["port"],