Fix TOML data import.

This commit is contained in:
Schimon Jehudah, Adv. 2024-12-16 16:04:01 +02:00
parent 51cc1eb81f
commit d0655fd16a
2 changed files with 4 additions and 1 deletions

View file

@ -1367,7 +1367,7 @@ class HttpInstance:
# TODO Add match/case for filetype.
entries = UtilitiesData.open_file_toml(content)
entries = UtilitiesData.load_data_toml(content)
# entries_node = entries[node]
#breakpoint()

View file

@ -127,6 +127,9 @@ class UtilitiesData:
result = entries
return result
def load_data_toml(data: dict) -> dict:
return tomllib.loads(data)
def open_file_toml(filename: str) -> dict:
with open(filename, mode="rb") as fn:
data = tomllib.load(fn)