implement dynamic db name from config
This commit is contained in:
parent
4b55227642
commit
0626b34337
5 changed files with 60 additions and 27 deletions
|
|
@ -20,6 +20,7 @@ import os
|
|||
from .input.implementations import codes as known_codes
|
||||
from typing import Any
|
||||
|
||||
|
||||
def replace_string(string: str, name: str, val: str) -> str:
|
||||
if '{' + name + '}' in string:
|
||||
n = string.replace('{' + name + '}', val)
|
||||
|
|
@ -27,6 +28,7 @@ def replace_string(string: str, name: str, val: str) -> str:
|
|||
else:
|
||||
return string
|
||||
|
||||
|
||||
def replace_in_meas(measurements: dict[str, dict[str, Any]], vars: dict[str, str]) -> dict[str, dict[str, Any]]:
|
||||
# replace global variables
|
||||
for name, value in vars.items():
|
||||
|
|
@ -39,6 +41,7 @@ def replace_in_meas(measurements: dict[str, dict[str, Any]], vars: dict[str, str
|
|||
measurements[m][key][i] = replace_string(measurements[m][key][i], name, value)
|
||||
return measurements
|
||||
|
||||
|
||||
def fill_cons(measurements: dict[str, dict[str, Any]], constants: dict[str, str]) -> dict[str, dict[str, Any]]:
|
||||
for m in measurements.keys():
|
||||
for name, val in constants.items():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue