Use relative path for state file locations.

This commit is contained in:
Matthew Stratford 2020-10-28 22:04:11 +00:00
parent 4c11378ff2
commit eefa9f4a5d
No known key found for this signature in database
GPG key ID: 5F50E4308A3416E8

View file

@ -1,5 +1,6 @@
import json
import os
from helpers.os_environment import resolve_external_file_path
class StateManager:
@ -7,7 +8,7 @@ class StateManager:
__state = {}
def __init__(self, name, default_state=None):
self.filepath = "C:\Program Files\BAPSicle\state\\" + name + ".json"
self.filepath = resolve_external_file_path("/state/" + name + ".json")
if not os.path.isfile(self.filepath):
self.log("No file found for " + self.filepath)
try: