def patch(self): output = patcher.patch_file(self.file_info) failed = True if output: failed = False self.file_info.move_to_target(output, move=True) self.finished.emit(failed, self.file_info.get_new_filename())
file_info.ramdisk = ramdisks[choice] if loki: file_info.loki = True file_info.bootimg = 'boot.lok' else: file_info.bootimg = 'boot.img' file_info.patch = autopatcher.auto_patch file_info.extract = autopatcher.files_to_auto_patch print("") print("Replacing ramdisk with " + file_info.ramdisk) try: partition_configs, choice = common.ask_partconfig(file_info) except Exception as e: print(str(e)) sys.exit(1) file_info.set_partconfig(partition_configs[choice]) new_file = patcher.patch_file(file_info) if not new_file: sys.exit(1) file_info.move_to_target(new_file) print("Path: " + file_info.get_new_filename()) sys.exit(0)