mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +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))
|
EyeTrackConfig(**json.load(settings_file))
|
||||||
shutil.copy(CONFIG_FILE_NAME, BACKUP_CONFIG_FILE_NAME)
|
shutil.copy(CONFIG_FILE_NAME, BACKUP_CONFIG_FILE_NAME)
|
||||||
# print("Backed up settings files.") # Comment out because it's too loud.
|
# print("Backed up settings files.") # Comment out because it's too loud.
|
||||||
|
except shutil.SameFileError:
|
||||||
|
pass
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
# No backup because the saved settings file is broken.
|
# No backup because the saved settings file is broken.
|
||||||
pass
|
pass
|
||||||
with open(CONFIG_FILE_NAME, "w") as settings_file:
|
with open(CONFIG_FILE_NAME, "w") as settings_file:
|
||||||
json.dump(obj=self.model_dump(warnings=False), fp=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):
|
def register_listener_callback(self, callback):
|
||||||
print(f"[DEBUG] Registering listener {callback}")
|
print(f"[DEBUG] Registering listener {callback}")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user