Fix ex-and import

This commit is contained in:
moanos [he/him] 2023-01-11 19:16:59 +01:00
parent 76c637720e
commit 1b1cf765be

4
cli.py
View File

@ -10,7 +10,7 @@ from models import Instance
def load_local_blocklist(filename: str) -> [Instance]: def load_local_blocklist(filename: str) -> [Instance]:
with open(filename, "rb") as f: with open(filename, "r") as f:
data = toml.load(f) data = toml.load(f)
instances = [] instances = []
for instance_dict in data["instances"]: for instance_dict in data["instances"]:
@ -25,7 +25,7 @@ def export_blocklist_toml(blocklist: [Instance], filname: str):
toml_str = "" toml_str = ""
for instance in blocklist: for instance in blocklist:
toml_str += f''' toml_str += f'''
[instance] [[instances]]
name = "{instance.domain}" name = "{instance.domain}"
domain = "{instance.domain}" domain = "{instance.domain}"
severity = "{instance.severity}" severity = "{instance.severity}"