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

def __build_param_file(self):

    param_dict = self.param_dict
    directory = self.local_working_directory
    command = self.tool.command
    if ((self.tool.profile < 16.04) and command and ('$param_file' in command)):
        (fd, param_filename) = tempfile.mkstemp(dir=directory)
        os.close(fd)
        f = open(param_filename, 'w')
        for (key, value) in param_dict.items():
            if (not isinstance(value, list)):
                value = [value]
            for elem in value:
                f.write(('%s=%s\n' % (key, elem)))
        f.close()
        self.__register_extra_file('param_file', param_filename)
        return param_filename
    else:
        return None
