Skip to content

Commit c4c26ae

Browse files
author
Martin Ruefenacht
committed
Started on implementation of constants
1 parent 9b97886 commit c4c26ae

File tree

3 files changed

+424
-79
lines changed

3 files changed

+424
-79
lines changed

src/pympistandard/__init__.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@
1818
import os
1919

2020

21-
from .storage import KINDS, PROCEDURES, CALLBACKS, PREDEFINED_FUNCTIONS, clear_storage
21+
from .storage import (
22+
KINDS,
23+
PROCEDURES,
24+
CALLBACKS,
25+
PREDEFINED_FUNCTIONS,
26+
CONSTANTS,
27+
clear_storage,
28+
)
2229
from .parameter import Direction
2330
from .procedure import Procedure
2431
from .callback import Callback
32+
from .constant import Constant
2533
from .predefined_function import PredefinedFunction
2634
from .kind import Kind, PolyKind
2735
from . import _kinds
@@ -163,6 +171,13 @@ def _load_database_v1(path: Path) -> None:
163171
Find and register all procedures found in the 'apis.json' file with Procedure instances.
164172
"""
165173

174+
# TODO discover which files of our database are in path, apis.json, constants.json
175+
176+
with path.joinpath("constants.json").open() as constants_file:
177+
for name, desc in dataset.items():
178+
const = Constant(name, desc)
179+
CONSTANTS[const.name] = const
180+
166181
with path.open("r") as datafile:
167182
if path.suffix == ".json":
168183
dataset = json.load(datafile)

0 commit comments

Comments
 (0)