From 10c66f00c07d081d3cd4d5c558c822e367e85f42 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 23 May 2022 20:40:49 -0400 Subject: [PATCH] Remove hardcoded /home/deck HOME_DIR --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 33ecb29..068259d 100644 --- a/main.py +++ b/main.py @@ -2,11 +2,14 @@ import json import os import asyncio import time +import pathlib + +HOME_DIR = str(pathlib.Path(os.getcwd()).parent.parent.resolve()) import logging logging.basicConfig( - filename = "/home/deck/.fantastic.log", + filename = "/tmp/fantastic.log", format = '%(asctime)s %(levelname)s %(message)s', filemode = 'w', force = True) @@ -21,7 +24,7 @@ TEMPERATURE_MINIMUM = 0.0 TEMPERATURE_MAXIMUM = 100.0 DATA_SAVE_FILE = "fantastic.json" -DATA_SAVE_FOLDER = "/home/deck/.config/fantastic/" +DATA_SAVE_FOLDER = HOME_DIR + "/.config/fantastic/" DATA_SAVE_PATH = DATA_SAVE_FOLDER + DATA_SAVE_FILE DEFAULT_DATA = {