'Build temporary file for file based parameter transfer if needed'

def __build_config_files(self):

    param_dict = self.param_dict
    config_filenames = []
    for (name, filename, content) in self.tool.config_files:
        (config_text, is_template) = self.__build_config_file_text(content)
        directory = self.local_working_directory
        if (filename is not None):
            config_filename = os.path.join(directory, filename)
        else:
            (fd, config_filename) = tempfile.mkstemp(dir=directory)
            os.close(fd)
        self.__write_workdir_file(config_filename, config_text, param_dict, is_template=is_template)
        self.__register_extra_file(name, config_filename)
        config_filenames.append(config_filename)
    return config_filenames
