mirror of
https://github.com/marceloprates/prettymaps.git
synced 2025-08-16 03:24:22 +02:00
Fixed presets directory path-related error with preset() function
This commit is contained in:
@@ -772,11 +772,7 @@ def presets():
|
|||||||
|
|
||||||
|
|
||||||
def preset(name):
|
def preset(name):
|
||||||
base_path = os.path.abspath(os.path.join(
|
with open(os.path.join(presets_directory(), f"{name}.json"), "r") as f:
|
||||||
os.path.dirname(prettymaps.__file__),
|
|
||||||
os.path.pardir
|
|
||||||
))
|
|
||||||
with open(os.path.join(base_path, "presets", f"{name}.json"), "r") as f:
|
|
||||||
# Load params from JSON file
|
# Load params from JSON file
|
||||||
params = json.load(f)
|
params = json.load(f)
|
||||||
return Preset(params)
|
return Preset(params)
|
||||||
|
Reference in New Issue
Block a user