예제 #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 = {}
예제 #2
0
파일: __init__.py 프로젝트: ww102111/galaxy
    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
예제 #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
예제 #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
예제 #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)
예제 #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
예제 #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)
예제 #8
0
파일: util.py 프로젝트: willemdiehl/galaxy
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
예제 #9
0
파일: util.py 프로젝트: xingyongma/galaxy
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
예제 #10
0
파일: __init__.py 프로젝트: msauria/galaxy
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}]")
예제 #11
0
 def _file_source_plugins_dict(self):
     import galaxy.files.sources
     return plugin_config.plugins_dict(galaxy.files.sources, 'plugin_type')
예제 #12
0
 def __resolvers_dict( self ):
     import galaxy.tools.deps.container_resolvers
     return plugin_config.plugins_dict( galaxy.tools.deps.container_resolvers, 'resolver_type' )
예제 #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)
예제 #14
0
파일: __init__.py 프로젝트: glormph/galaxy
 def __plugins_dict(self):
     import galaxy.jobs.metrics.instrumenters
     return plugin_config.plugins_dict(galaxy.jobs.metrics.instrumenters, 'plugin_type')
예제 #15
0
 def __resolvers_dict(self):
     import galaxy.tool_util.deps.resolvers
     return plugin_config.plugins_dict(galaxy.tool_util.deps.resolvers,
                                       'resolver_type')
예제 #16
0
파일: __init__.py 프로젝트: msauria/galaxy
 def __plugins_dict(self):
     import galaxy.tools.error_reports.plugins
     return plugin_config.plugins_dict(galaxy.tools.error_reports.plugins,
                                       'plugin_type')
예제 #17
0
 def __plugins_dict(self):
     import galaxy.job_metrics.instrumenters
     return plugin_config.plugins_dict(galaxy.job_metrics.instrumenters,
                                       'plugin_type')
예제 #18
0
 def __plugins_dict(self):
     return plugin_config.plugins_dict(galaxy.workflow.schedulers,
                                       'plugin_type')
예제 #19
0
    def __resolvers_dict(self):
        import galaxy.tools.deps.resolvers

        return plugin_config.plugins_dict(galaxy.tools.deps.resolvers, "resolver_type")
예제 #20
0
 def __resolvers_dict(self):
     import galaxy.tool_util.locations
     return plugin_config.plugins_dict(galaxy.tool_util.locations, 'scheme')
예제 #21
0
파일: fetcher.py 프로젝트: ashvark/galaxy
 def __resolvers_dict( self ):
     import galaxy.tools.locations
     return plugin_config.plugins_dict(galaxy.tools.locations, 'scheme')
예제 #22
0
 def __plugins_dict(self):
     import galaxy.tools.error_reports.plugins
     return plugin_config.plugins_dict(galaxy.tools.error_reports.plugins, 'plugin_type')
예제 #23
0
 def __plugins_dict( self ):
     return plugin_config.plugins_dict( galaxy.workflow.schedulers, 'plugin_type' )