Fix TOML data import.
This commit is contained in:
parent
51cc1eb81f
commit
d0655fd16a
2 changed files with 4 additions and 1 deletions
|
@ -1367,7 +1367,7 @@ class HttpInstance:
|
||||||
|
|
||||||
# TODO Add match/case for filetype.
|
# TODO Add match/case for filetype.
|
||||||
|
|
||||||
entries = UtilitiesData.open_file_toml(content)
|
entries = UtilitiesData.load_data_toml(content)
|
||||||
# entries_node = entries[node]
|
# entries_node = entries[node]
|
||||||
|
|
||||||
#breakpoint()
|
#breakpoint()
|
||||||
|
|
|
@ -127,6 +127,9 @@ class UtilitiesData:
|
||||||
result = entries
|
result = entries
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def load_data_toml(data: dict) -> dict:
|
||||||
|
return tomllib.loads(data)
|
||||||
|
|
||||||
def open_file_toml(filename: str) -> dict:
|
def open_file_toml(filename: str) -> dict:
|
||||||
with open(filename, mode="rb") as fn:
|
with open(filename, mode="rb") as fn:
|
||||||
data = tomllib.load(fn)
|
data = tomllib.load(fn)
|
||||||
|
|
Loading…
Reference in a new issue