예제 #1
0
    def add_file_format_with_appended_name_requirement(self, file_formats, file_format, file_types,
                                                       clashing_file_formats):
        """
        This function adds a file format to the file format list. It checks if there are other selected file formats
        which clash with the current file format, e.g. both SaveNexusProcessed and SaveNXcanSAS produce .nxs files

        :param file_formats: A list of file formats
        :param file_format: The file format to be added
        :param file_types: The pure file types
        :param clashing_file_formats: The other file types which might be clashing with the current file type.
        :return:
        """
        if file_format in file_types:
            append_name = False
            for clashing_file_format in clashing_file_formats:
                if clashing_file_format in file_types:
                    append_name = True
            file_formats.append(file_format_with_append(file_format=file_format,
                                                        append_file_format_name=append_name))
예제 #2
0
    def add_file_format_with_appended_name_requirement(self, file_formats, file_format, file_types,
                                                       clashing_file_formats):
        """
        This function adds a file format to the file format list. It checks if there are other selected file formats
        which clash with the current file format, e.g. both SaveNexusProcessed and SaveNXcanSAS produce .nxs files

        :param file_formats: A list of file formats
        :param file_format: The file format to be added
        :param file_types: The pure file types
        :param clashing_file_formats: The other file types which might be clashing with the current file type.
        :return:
        """
        if file_format in file_types:
            append_name = False
            for clashing_file_format in clashing_file_formats:
                if clashing_file_format in file_types:
                    append_name = True
            file_formats.append(file_format_with_append(file_format=file_format,
                                                        append_file_format_name=append_name))