def interrupt(self): if hasattr(self.process_handle, "pid"): logging.info("killing conversion task %d", self.process_handle.pid) utils.kill_process(self.process_handle.pid) if not self.temp_output_path.endswith(".tmp"): # temp file if os.path.exists(self.temp_output_path) and self.progress < 1.0: clean_up(self.temp_output_path, file_and_directory=True)
def kill_process(self, pid): try: kill_process(pid) except (KeyboardInterrupt, SystemExit): raise except: logging.warn("Error trying to kill the movie data process:\n%s", traceback.format_exc()) else: logging.info("Movie data process killed")
def shutdown_timeout_cb(self): logging.warning("killing download daemon") kill_process(self.read_pid()) self.shutdown_response()