add file_json
This commit is contained in:
parent
43b4437333
commit
7d1e1589b6
|
@ -1,4 +1,5 @@
|
||||||
import io
|
import io
|
||||||
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
import jwt
|
import jwt
|
||||||
import ereuse_utils
|
import ereuse_utils
|
||||||
|
@ -166,6 +167,11 @@ def file(name: str) -> dict:
|
||||||
return json_encode(yaml2json(name))
|
return json_encode(yaml2json(name))
|
||||||
|
|
||||||
|
|
||||||
|
def file_json(name):
|
||||||
|
with Path(__file__).parent.joinpath('files').joinpath(name).open() as f:
|
||||||
|
return json.loads(f.read())
|
||||||
|
|
||||||
|
|
||||||
def file_workbench(name: str) -> dict:
|
def file_workbench(name: str) -> dict:
|
||||||
"""Opens and parses a YAML file from the ``files`` subdir."""
|
"""Opens and parses a YAML file from the ``files`` subdir."""
|
||||||
with Path(__file__).parent.joinpath('workbench_files').joinpath(name + '.json').open() as f:
|
with Path(__file__).parent.joinpath('workbench_files').joinpath(name + '.json').open() as f:
|
||||||
|
|
Reference in New Issue