pull/8/head
Nicolas Jouanin 2015-08-17 21:52:13 +02:00
rodzic 848aaf8438
commit 6b03106c1c
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -63,7 +63,7 @@ class PluginManager:
self.logger.debug(" Loading plugin %s" % ep)
plugin = ep.load(require=True)
self.logger.debug(" Initializing plugin %s" % ep)
obj = plugin(self)
obj = plugin(self.context)
return Plugin(ep.name, ep, obj)
except ImportError as ie:
self.logger.warn("Plugin %r import failed: %s" % (ep, ie))
@ -109,7 +109,8 @@ class PluginManager:
event_method = getattr(plugin.object, event_method_name, None)
if event_method:
tasks.append(self._schedule_coro(event_method(*args, **kwargs)))
yield from asyncio.wait(tasks, loop=self._loop)
if len(tasks) > 0:
yield from asyncio.wait(tasks, loop=self._loop)
@asyncio.coroutine
def map(self, coro, *args, **kwargs):