snapshot of https://github.com/ActivityWatch/aw-core.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Build / Test on ubuntu-latest, py-3.8 (push) Successful in 4m21s
Lint / lint (push) Successful in 25s
Build / Test on macOS-latest, py-3.8 (push) Has been cancelled
Build / Test on windows-latest, py-3.8 (push) Has been cancelled
CodeQL / Analyze (python) (push) Failing after 1s
Some checks failed
Build / Test on ubuntu-latest, py-3.8 (push) Successful in 4m21s
Lint / lint (push) Successful in 25s
Build / Test on macOS-latest, py-3.8 (push) Has been cancelled
Build / Test on windows-latest, py-3.8 (push) Has been cancelled
CodeQL / Analyze (python) (push) Failing after 1s
This commit is contained in:
20
aw_core/schema.py
Normal file
20
aw_core/schema.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import os
|
||||
import json
|
||||
|
||||
|
||||
def _this_dir() -> str:
|
||||
return os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def _schema_dir() -> str:
|
||||
return os.path.join(os.path.dirname(_this_dir()), "aw_core", "schemas")
|
||||
|
||||
|
||||
def get_json_schema(name: str) -> dict:
|
||||
with open(os.path.join(_schema_dir(), name + ".json")) as f:
|
||||
data = json.load(f)
|
||||
return data
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(get_json_schema("event"))
|
||||
Reference in New Issue
Block a user