def update_status(self, x): self.status.update(x) with open_atomic(str(self.status_file)) as f: json.dump(self.status, f)