'If deactivate is False, add datatype converters from self.converters or self.proprietary_converters
to the calling app\'s toolbox.  If deactivate is True, eliminates relevant converters from the calling
app\'s toolbox.'

def load_datatype_converters(self, toolbox, installed_repository_dict=None, deactivate=False, use_cached=False):

    if installed_repository_dict:
        converters = self.proprietary_converters
    else:
        converters = self.converters
    for elem in converters:
        tool_config = elem[0]
        source_datatype = elem[1]
        target_datatype = elem[2]
        if installed_repository_dict:
            converter_path = installed_repository_dict['converter_path']
        else:
            converter_path = self.converters_path
        try:
            config_path = os.path.join(converter_path, tool_config)
            converter = toolbox.load_tool(config_path, use_cached=use_cached)
            if installed_repository_dict:
                converter.tool_shed = installed_repository_dict['tool_shed']
                converter.repository_name = installed_repository_dict['repository_name']
                converter.repository_owner = installed_repository_dict['repository_owner']
                converter.installed_changeset_revision = installed_repository_dict['installed_changeset_revision']
                converter.old_id = converter.id
                tool_dicts = installed_repository_dict['tool_dicts']
                for tool_dict in tool_dicts:
                    if (tool_dict['id'] == converter.id):
                        converter.guid = tool_dict['guid']
                        converter.id = tool_dict['guid']
                        break
            if deactivate:
                toolbox.remove_tool_by_id(converter.id, remove_from_panel=False)
                if (source_datatype in self.datatype_converters):
                    if (target_datatype in self.datatype_converters[source_datatype]):
                        del self.datatype_converters[source_datatype][target_datatype]
                self.log.debug('Deactivated    converter:    %s', converter.id)
            else:
                toolbox.register_tool(converter)
                if (source_datatype not in self.datatype_converters):
                    self.datatype_converters[source_datatype] = odict()
                self.datatype_converters[source_datatype][target_datatype] = converter
                if ((not hasattr(toolbox.app, 'tool_cache')) or (converter.id in toolbox.app.tool_cache._new_tool_ids)):
                    self.log.debug('Loaded    converter:    %s', converter.id)
        except Exception:
            if deactivate:
                self.log.exception(('Error    deactivating    converter    from    (%s)' % converter_path))
            else:
                self.log.exception(('Error    loading    converter    (%s)' % converter_path))
