fix boot folder remapping
This commit is contained in:
parent
1d9bf8e22e
commit
f4fee0e31f
@ -6,6 +6,7 @@ Copyright by aceinnolab
|
|||||||
import asyncio
|
import asyncio
|
||||||
import glob
|
import glob
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import os.path
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
|
|
||||||
@ -72,13 +73,16 @@ class Inkycal:
|
|||||||
f"No settings.json file could be found in the specified location: {settings_path}")
|
f"No settings.json file could be found in the specified location: {settings_path}")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logger.info("Looking for settings.json file in /boot folder...")
|
found = False
|
||||||
try:
|
for location in settings.SETTINGS_JSON_PATHS:
|
||||||
with open('/boot/settings.json', mode="r") as settings_file:
|
if os.path.exists(location):
|
||||||
|
logger.info(f"Found settings.json file in {location}")
|
||||||
|
with open(location, mode="r") as settings_file:
|
||||||
self.settings = json.load(settings_file)
|
self.settings = json.load(settings_file)
|
||||||
|
found = True
|
||||||
except FileNotFoundError:
|
break
|
||||||
raise SettingsFileNotFoundError
|
if not found:
|
||||||
|
raise SettingsFileNotFoundError(f"No settings.json file could be found in {settings.SETTINGS_JSON_PATHS} and no explicit path was specified.")
|
||||||
|
|
||||||
self.disable_calibration = self.settings.get('disable_calibration', False)
|
self.disable_calibration = self.settings.get('disable_calibration', False)
|
||||||
if self.disable_calibration:
|
if self.disable_calibration:
|
||||||
|
@ -18,3 +18,5 @@ class Settings:
|
|||||||
PARALLEL_DRIVER_PATH = os.path.join(basedir, "display", "drivers", "parallel_drivers")
|
PARALLEL_DRIVER_PATH = os.path.join(basedir, "display", "drivers", "parallel_drivers")
|
||||||
TEMPORARY_FOLDER = os.path.join(basedir, "tmp")
|
TEMPORARY_FOLDER = os.path.join(basedir, "tmp")
|
||||||
VCOM = "2.0"
|
VCOM = "2.0"
|
||||||
|
# /boot/settings.json is path on older releases, while the latter is more the more recent ones
|
||||||
|
SETTINGS_JSON_PATHS = ["/boot/settings.json", "/boot/firmware/settings.json"]
|
||||||
|
Loading…
Reference in New Issue
Block a user