Example #1
0
 def execute_callbacks(self, text=False):
     """
         Launch callback function on all registered plugins
         We can provide a text to be evaluated.
     """
     if not text:
         try:
             text = next(self.stt.text)
         except LookupError:
             pass
     for plugin in self.plugins:
         try:
             LOG.info('Calling plugin {} callback'.format(plugin))
             plugin.callback(text)
         except Exception:
             LOG.exception("Error on plugin {}".format(plugin))
             # We can't allow a bad plugin to break anything =(
             pass