From d0655fd16a86489fdf8398712e09748e69884140 Mon Sep 17 00:00:00 2001 From: "Schimon Jehudah, Adv." Date: Mon, 16 Dec 2024 16:04:01 +0200 Subject: [PATCH] Fix TOML data import. --- blasta/http/instance.py | 2 +- blasta/utilities/data.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/blasta/http/instance.py b/blasta/http/instance.py index 3267485..97cf56f 100644 --- a/blasta/http/instance.py +++ b/blasta/http/instance.py @@ -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() diff --git a/blasta/utilities/data.py b/blasta/utilities/data.py index d03ca61..773590c 100644 --- a/blasta/utilities/data.py +++ b/blasta/utilities/data.py @@ -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)