mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-09-26 23:09:28 +08:00
Fix: shutil.SameFileError, removed "[INFO] Config Saved Successfully" print spam
This commit is contained in:
parent
9e4b345928
commit
ce4942a54e
@ -313,12 +313,14 @@ class EyeTrackConfig(BaseModel):
|
||||
EyeTrackConfig(**json.load(settings_file))
|
||||
shutil.copy(CONFIG_FILE_NAME, BACKUP_CONFIG_FILE_NAME)
|
||||
# print("Backed up settings files.") # Comment out because it's too loud.
|
||||
except shutil.SameFileError:
|
||||
pass
|
||||
except json.JSONDecodeError:
|
||||
# No backup because the saved settings file is broken.
|
||||
pass
|
||||
with open(CONFIG_FILE_NAME, "w") as settings_file:
|
||||
json.dump(obj=self.model_dump(warnings=False), fp=settings_file)
|
||||
print(f"\033[92m[INFO] Config Saved Successfully\033[0m")
|
||||
#print(f"\033[92m[INFO] Config Saved Successfully\033[0m")
|
||||
|
||||
def register_listener_callback(self, callback):
|
||||
print(f"[DEBUG] Registering listener {callback}")
|
||||
|
Loading…
Reference in New Issue
Block a user