def convert_field(self, value, conversion): if conversion != 't': return super(TemplateFileFormatter, self).convert_field( value, conversion) fd, new_filename = mkstemp() try: self.original_files[new_filename] = value with open(value, 'r') as template: for line in template: os.write(fd, line.format(**self.task_spec)) finally: os.close(fd) return quote_for_shell(new_filename)
def set_arg(self, idx, value): self.__split_command[idx] = value self.command.set_edit_text(" ".join(quote_for_shell(arg) for arg in self.__split_command))
def set_split_command(self, value): self.command.set_edit_text(" ".join(quote_for_shell(arg) for arg in value))