def install_plugins(): """ Installs plugins associated with dispatch :return: """ for ep in pkg_resources.iter_entry_points("dispatch.plugins"): try: logger.debug(f"Attempting to load plugin: {ep.name}") plugin = ep.load() register(plugin) logger.debug(f"Successfully loaded plugin: {ep.name}") except KeyError as e: logger.warning(f"Failed to load plugin: {ep.name} Reason: {e}") except SQLAlchemyError as e: logger.error( "Something went wrong with creating plugin rows, is the database setup correctly?", e, ) except Exception as ex: logger.error( f"Failed to load plugin {ep.name}:{traceback.format_exc()}", ex) else: if not plugin.enabled: continue
def install_plugins(): """ Installs plugins associated with dispatch :return: """ for ep in pkg_resources.iter_entry_points("dispatch.plugins"): logger.info(f"Attempting to load plugin: {ep.name}") try: plugin = ep.load() register(plugin) logger.info(f"Successfully loaded plugin: {ep.name}") except SQLAlchemyError: logger.error( "Something went wrong with creating plugin rows, is the database setup correctly?" ) logger.error( f"Failed to load plugin {ep.name}:{traceback.format_exc()}") except KeyError as e: logger.info( f"Failed to load plugin {ep.name} due to missing configuration items. {e}" ) except Exception: logger.error( f"Failed to load plugin {ep.name}:{traceback.format_exc()}")
def install_plugins(): """ Installs plugins associated with dispatch :return: """ from dispatch.plugins.base import register for ep in pkg_resources.iter_entry_points("dispatch.plugins"): logger.debug(f"Loading plugin {ep.name}") try: plugin = ep.load() except KeyError as e: logger.warning(f"Failed to load plugin {ep.name}. Reason: {e}") except Exception: logger.error(f"Failed to load plugin {ep.name}:{traceback.format_exc()}") else: register(plugin)
def task_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.task import TestTaskPlugin register(TestTaskPlugin) return TestTaskPlugin
def storage_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.storage import TestStoragePlugin register(TestStoragePlugin) return TestStoragePlugin
def participant_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.participant import TestParticipantPlugin register(TestParticipantPlugin) return TestParticipantPlugin
def oncall_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.oncall import TestOncallPlugin register(TestOncallPlugin) return TestOncallPlugin
def document_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.document import TestDocumentPlugin register(TestDocumentPlugin) return TestDocumentPlugin
def document_resolver_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.document_resolver import TestDocumentResolverPlugin register(TestDocumentResolverPlugin) return TestDocumentResolverPlugin
def conversation_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.conversation import TestConversationPlugin register(TestConversationPlugin) return TestConversationPlugin
def contact_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.contact import TestContactPlugin register(TestContactPlugin) return TestContactPlugin
def conference_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.conference import TestConferencePlugin register(TestConferencePlugin) return TestConferencePlugin
def participant_group_plugin(): from dispatch.plugins.base import register from .plugins.participant_group import TestParticipantGroupPlugin register(TestParticipantGroupPlugin) return TestParticipantGroupPlugin
def term_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.term import TestTermPlugin register(TestTermPlugin) return TestTermPlugin
def definition_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.definition import TestDefinitionPlugin register(TestDefinitionPlugin) return TestDefinitionPlugin
def ticket_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.ticket import TestTicketPlugin register(TestTicketPlugin) return TestTicketPlugin
def workflow_plugin(): from dispatch.plugins.base import register from dispatch.plugins.dispatch_test.workflow import TestWorkflowPlugin register(TestWorkflowPlugin) return TestWorkflowPlugin