mirror of
https://github.com/wlinator/luminara.git
synced 2024-10-02 22:23:13 +00:00
14 lines
353 B
Python
14 lines
353 B
Python
import json
|
|
|
|
|
|
class JsonCache:
|
|
_cache = {}
|
|
|
|
@staticmethod
|
|
def read_json(path):
|
|
"""Read and cache the JSON data if not already cached."""
|
|
if path not in JsonCache._cache:
|
|
with open(f"config/JSON/{path}.json") as file:
|
|
JsonCache._cache[path] = json.load(file)
|
|
|
|
return JsonCache._cache[path]
|