Use `config/` for images + config.json

This commit is contained in:
slashtechno 2022-12-17 18:19:10 -06:00
parent 65bba32284
commit 0c6a53b457
Signed by: slashtechno
GPG Key ID: 8EC1D9D9286C2B17
2 changed files with 7 additions and 5 deletions

5
.gitignore vendored
View File

@ -1,2 +1,3 @@
person.jpg
config.json
# person.jpg
# config.json
config/

View File

@ -44,12 +44,12 @@ config = {
"run_scale": "0.25",
"view_scale": "0.75",
"faces": {
"example1": {"image": "example1.jpg", "last_seen": ""},
"example2": {"image": "example2.jpg", "last_seen": ""},
"example1": {"image": "config/example1.jpg", "last_seen": ""},
"example2": {"image": "config/example2.jpg", "last_seen": ""},
},
"display": True
}
config_path = pathlib.Path("config.json")
config_path = pathlib.Path("config/config.json")
if config_path.exists():
with open(config_path, "r") as config_file:
config = json.load(config_file)
@ -57,6 +57,7 @@ else:
with open(config_path, "w") as config_file:
json.dump(config, config_file, indent=4)
print("Config file created, please edit it and restart the program")
print("For relative paths, use the format config/example.jpg")
exit()