Exemple #1
0
def find_convert_hdf5handler(obj, group):
    for clasz in resolve_entrypoints(ENTRYPOINT_HDF5HANDLER):
        handler = clasz()
        if handler.can_convert(obj, group):
            return handler
    raise ConvertError(
        "No handler found for object {!r} and group {!r}".format(obj, group))
Exemple #2
0
    def available_programs(self):
        """
        Returns a :class:`tuple` of all available programs, whether or not
        they are activated.
        The items are :class:`Program` classes.
        """
        # Late initialization
        if not self._available_programs:
            self._available_programs = {}

            for clasz in entrypoint.resolve_entrypoints(
                    ENTRYPOINT_AVAILABLE_PROGRAMS):
                identifier = clasz.getidentifier()
                self._available_programs[identifier] = clasz

        return tuple(self._available_programs.values())
Exemple #3
0
def find_convert_htmlhandler(obj):
    for clasz in resolve_entrypoints(ENTRYPOINT_HTMLHANDLER):
        handler = clasz()
        if handler.can_convert(obj):
            return handler
    raise ConvertError("No handler found for object {!r}".format(obj))
Exemple #4
0
def find_parse_hdf5handler(group):
    for clasz in resolve_entrypoints(ENTRYPOINT_HDF5HANDLER):
        handler = clasz()
        if handler.can_parse(group):
            return handler
    raise ParseError("No handler found for group: {!r}".format(group))