Ejemplo n.º 1
0
 def __init__(self):
     """
     """
     module_prefix = self.__module__
     self.cli_shells = plugins_dict(f"{module_prefix}.shell", "__name__")
     self.cli_job_interfaces = plugins_dict(f"{module_prefix}.job",
                                            "__name__")
     self.active_cli_shells = {}
Ejemplo n.º 2
0
    def __init__(self, app):
        self.__app = app
        import galaxy.auth.providers
        self.__plugins_dict = plugin_config.plugins_dict(galaxy.auth.providers, 'plugin_type' )
        auth_config_file = app.config.auth_config_file
        # parse XML
        ct = xml.etree.ElementTree.parse(auth_config_file)
        conf_root = ct.getroot()

        authenticators = []
        # process authenticators
        for auth_elem in conf_root.getchildren():
            type_elem = auth_elem.find('type')
            plugin = self.__plugins_dict.get(type_elem.text)()

            # check filterelem
            filter_elem = auth_elem.find('filter')
            if filter_elem is not None:
                filter_template = str(filter_elem.text)
            else:
                filter_template = None

            # extract options
            options_elem = auth_elem.find('options')
            options = {}
            if options_elem is not None:
                for opt in options_elem:
                    options[opt.tag] = opt.text
            authenticator = Authenticator(
                plugin=plugin,
                filter_template=filter_template,
                options=options,
            )
            authenticators.append(authenticator)
        self.authenticators = authenticators
Ejemplo n.º 3
0
def get_authenticators(auth_config_file):
    __plugins_dict = plugin_config.plugins_dict(galaxy.auth.providers, 'plugin_type')
    # parse XML
    ct = xml.etree.ElementTree.parse(auth_config_file)
    conf_root = ct.getroot()

    authenticators = []
    # process authenticators
    for auth_elem in conf_root:
        type_elem = auth_elem.find('type')
        plugin = __plugins_dict.get(type_elem.text)()

        # check filterelem
        filter_elem = auth_elem.find('filter')
        if filter_elem is not None:
            filter_template = str(filter_elem.text)
        else:
            filter_template = None

        # extract options
        options_elem = auth_elem.find('options')
        options = {}
        if options_elem is not None:
            for opt in options_elem:
                options[opt.tag] = opt.text
        authenticator = Authenticator(
            plugin=plugin,
            filter_template=filter_template,
            options=options,
        )
        authenticators.append(authenticator)
    return authenticators
Ejemplo n.º 4
0
def get_authenticators(auth_config_file):
    __plugins_dict = plugin_config.plugins_dict(galaxy.auth.providers,
                                                'plugin_type')
    # parse XML
    ct = xml.etree.ElementTree.parse(auth_config_file)
    conf_root = ct.getroot()

    authenticators = []
    # process authenticators
    for auth_elem in conf_root:
        type_elem = auth_elem.find('type')
        plugin = __plugins_dict.get(type_elem.text)()

        # check filterelem
        filter_elem = auth_elem.find('filter')
        if filter_elem is not None:
            filter_template = str(filter_elem.text)
        else:
            filter_template = None

        # extract options
        options_elem = auth_elem.find('options')
        options = {}
        if options_elem is not None:
            for opt in options_elem:
                options[opt.tag] = opt.text
        authenticator = Authenticator(
            plugin=plugin,
            filter_template=filter_template,
            options=options,
        )
        authenticators.append(authenticator)
    return authenticators
Ejemplo n.º 5
0
 def __init__(self, app):
     self.__app = app
     import galaxy.auth.providers
     self.__plugins_dict = plugin_config.plugins_dict(
         galaxy.auth.providers, 'plugin_type')
     auth_config_file = app.config.auth_config_file
     self.__init_authenticators(auth_config_file)
Ejemplo n.º 6
0
    def __init__(self, app):
        self.__app = app
        import galaxy.auth.providers
        self.__plugins_dict = plugin_config.plugins_dict(galaxy.auth.providers, 'plugin_type' )
        auth_config_file = app.config.auth_config_file
        # parse XML
        ct = xml.etree.ElementTree.parse(auth_config_file)
        conf_root = ct.getroot()

        authenticators = []
        # process authenticators
        for auth_elem in conf_root.getchildren():
            type_elem = auth_elem.find('type')
            plugin = self.__plugins_dict.get(type_elem.text)()

            # check filterelem
            filter_elem = auth_elem.find('filter')
            if filter_elem is not None:
                filter_template = str(filter_elem.text)
            else:
                filter_template = None

            # extract options
            options_elem = auth_elem.find('options')
            options = {}
            if options_elem is not None:
                for opt in options_elem:
                    options[opt.tag] = opt.text
            authenticator = Authenticator(
                plugin=plugin,
                filter_template=filter_template,
                options=options,
            )
            authenticators.append(authenticator)
        self.authenticators = authenticators
Ejemplo n.º 7
0
def generate_report_json(trans,
                         invocation,
                         runtime_report_config_json=None,
                         plugin_type=None):
    import galaxy.workflow.reports.generators
    plugin_classes = plugin_config.plugins_dict(
        galaxy.workflow.reports.generators, 'plugin_type')
    plugin_type = plugin_type or DEFAULT_REPORT_GENERATOR_TYPE
    plugin = plugin_classes[plugin_type]()
    return plugin.generate_report_json(
        trans,
        invocation,
        runtime_report_config_json=runtime_report_config_json)
Ejemplo n.º 8
0
def get_authenticators(auth_config_file, auth_config_file_set):
    __plugins_dict = plugin_config.plugins_dict(galaxy.auth.providers,
                                                'plugin_type')
    # parse XML
    try:
        ct = parse_xml(auth_config_file)
        conf_root = ct.getroot()
    except (OSError, IOError) as exc:
        if exc.errno == errno.ENOENT and not auth_config_file_set:
            conf_root = parse_xml_string(AUTH_CONF_XML)
        else:
            raise

    authenticators = []
    # process authenticators
    for auth_elem in conf_root:
        type_elem_text = auth_elem.find('type').text
        plugin_class = __plugins_dict.get(type_elem_text)
        if not plugin_class:
            raise Exception(
                "Authenticator type '%s' not recognized, should be one of %s" %
                (type_elem_text, ', '.join(__plugins_dict)))
        plugin = plugin_class()

        # check filterelem
        filter_elem = auth_elem.find('filter')
        if filter_elem is not None:
            filter_template = str(filter_elem.text)
        else:
            filter_template = None

        # extract options
        options_elem = auth_elem.find('options')
        options = {}
        if options_elem is not None:
            for opt in options_elem:
                options[opt.tag] = opt.text
        authenticator = Authenticator(
            plugin=plugin,
            filter_template=filter_template,
            options=options,
        )
        authenticators.append(authenticator)
    return authenticators
Ejemplo n.º 9
0
def get_authenticators(auth_config_file, auth_config_file_set):
    __plugins_dict = plugin_config.plugins_dict(galaxy.auth.providers,
                                                'plugin_type')
    # parse XML
    try:
        ct = xml.etree.ElementTree.parse(auth_config_file)
        conf_root = ct.getroot()
    except (OSError, IOError) as exc:
        if exc.errno == errno.ENOENT and not auth_config_file_set:
            conf_root = xml.etree.ElementTree.fromstring(AUTH_CONF_XML)
        else:
            raise

    authenticators = []
    # process authenticators
    for auth_elem in conf_root:
        type_elem = auth_elem.find('type')
        plugin = __plugins_dict.get(type_elem.text)()

        # check filterelem
        filter_elem = auth_elem.find('filter')
        if filter_elem is not None:
            filter_template = str(filter_elem.text)
        else:
            filter_template = None

        # extract options
        options_elem = auth_elem.find('options')
        options = {}
        if options_elem is not None:
            for opt in options_elem:
                options[opt.tag] = opt.text
        authenticator = Authenticator(
            plugin=plugin,
            filter_template=filter_template,
            options=options,
        )
        authenticators.append(authenticator)
    return authenticators
Ejemplo n.º 10
0
def generate_report(trans,
                    invocation,
                    runtime_report_config_json=None,
                    plugin_type=None,
                    target_format="json"):
    import galaxy.workflow.reports.generators
    plugin_classes = plugin_config.plugins_dict(
        galaxy.workflow.reports.generators, 'plugin_type')
    plugin_type = plugin_type or DEFAULT_REPORT_GENERATOR_TYPE
    plugin = plugin_classes[plugin_type]()
    if target_format == "json":
        return plugin.generate_report_json(
            trans,
            invocation,
            runtime_report_config_json=runtime_report_config_json)
    elif target_format == "pdf":
        return plugin.generate_report_pdf(
            trans,
            invocation,
            runtime_report_config_json=runtime_report_config_json)
    else:
        raise RequestParameterInvalidException(
            f"Unknown report format [{target_format}]")
Ejemplo n.º 11
0
 def _file_source_plugins_dict(self):
     import galaxy.files.sources
     return plugin_config.plugins_dict(galaxy.files.sources, 'plugin_type')
Ejemplo n.º 12
0
 def __resolvers_dict( self ):
     import galaxy.tools.deps.container_resolvers
     return plugin_config.plugins_dict( galaxy.tools.deps.container_resolvers, 'resolver_type' )
Ejemplo n.º 13
0
 def __init__(self, app):
     self.__app = app
     import galaxy.auth.providers
     self.__plugins_dict = plugin_config.plugins_dict( galaxy.auth.providers, 'plugin_type' )
     auth_config_file = app.config.auth_config_file
     self.__init_authenticators(auth_config_file)
Ejemplo n.º 14
0
 def __plugins_dict(self):
     import galaxy.jobs.metrics.instrumenters
     return plugin_config.plugins_dict(galaxy.jobs.metrics.instrumenters, 'plugin_type')
Ejemplo n.º 15
0
 def __resolvers_dict(self):
     import galaxy.tool_util.deps.resolvers
     return plugin_config.plugins_dict(galaxy.tool_util.deps.resolvers,
                                       'resolver_type')
Ejemplo n.º 16
0
 def __plugins_dict(self):
     import galaxy.tools.error_reports.plugins
     return plugin_config.plugins_dict(galaxy.tools.error_reports.plugins,
                                       'plugin_type')
Ejemplo n.º 17
0
 def __plugins_dict(self):
     import galaxy.job_metrics.instrumenters
     return plugin_config.plugins_dict(galaxy.job_metrics.instrumenters,
                                       'plugin_type')
Ejemplo n.º 18
0
 def __plugins_dict(self):
     return plugin_config.plugins_dict(galaxy.workflow.schedulers,
                                       'plugin_type')
Ejemplo n.º 19
0
    def __resolvers_dict(self):
        import galaxy.tools.deps.resolvers

        return plugin_config.plugins_dict(galaxy.tools.deps.resolvers, "resolver_type")
Ejemplo n.º 20
0
 def __resolvers_dict(self):
     import galaxy.tool_util.locations
     return plugin_config.plugins_dict(galaxy.tool_util.locations, 'scheme')
Ejemplo n.º 21
0
 def __resolvers_dict( self ):
     import galaxy.tools.locations
     return plugin_config.plugins_dict(galaxy.tools.locations, 'scheme')
Ejemplo n.º 22
0
 def __plugins_dict(self):
     import galaxy.tools.error_reports.plugins
     return plugin_config.plugins_dict(galaxy.tools.error_reports.plugins, 'plugin_type')
Ejemplo n.º 23
0
 def __plugins_dict( self ):
     return plugin_config.plugins_dict( galaxy.workflow.schedulers, 'plugin_type' )