0
0
Fork 0
mirror of https://github.com/boltgolt/howdy.git synced 2024-09-19 09:51:19 +02:00

use PATH constant

This commit is contained in:
dmig 2018-12-09 13:15:31 +07:00
parent 01e706fce6
commit c8c481aed2
No known key found for this signature in database
GPG key ID: A4A245B3AD37C4FC

View file

@ -14,9 +14,12 @@ import os
import json
import configparser
# Get the absolute path to the current directory
PATH = os.path.abspath(__file__ + '/..')
# Read config from disk
config = configparser.ConfigParser()
config.read(os.path.dirname(os.path.abspath(__file__)) + "/config.ini")
config.read(PATH + "/config.ini")
def stop(status):
"""Stop the execution and close video stream"""
@ -41,7 +44,7 @@ dark_tries = 0
# Try to load the face model from the models folder
try:
models = json.load(open(os.path.dirname(os.path.abspath(__file__)) + "/models/" + user + ".dat"))
models = json.load(open(PATH + "/models/" + user + ".dat"))
# Put all models together into 1 array
for model in models: