simplify a tiny bit

This commit is contained in:
Emi Vasilek 2023-11-05 10:42:09 +01:00
parent ae02e6de77
commit 2e12ab77a5

View file

@ -1,5 +1,4 @@
from typing import Dict, List, Any, Optional from typing import Dict, List, Any, Optional
from dataclasses import dataclass
import os import os
import yaml import yaml
@ -10,6 +9,7 @@ class Unit:
def __init__(self, name: str) -> None: def __init__(self, name: str) -> None:
self.name = name self.name = name
class Units: class Units:
def __init__(self) -> None: def __init__(self) -> None:
self.units: List[Unit] = [] self.units: List[Unit] = []
@ -251,15 +251,7 @@ def rendertemplate(
print(f"rendering {file}") print(f"rendering {file}")
outstr = template.render(args) outstr = template.render(args)
try: os.makedirs(f"out/{format}", exist_ok=True)
os.mkdir("out")
except FileExistsError:
pass
try:
os.mkdir(f"out/{format}")
except FileExistsError:
pass
with open(f"out/{format}/{file}", "w", encoding="utf-8") as f: with open(f"out/{format}/{file}", "w", encoding="utf-8") as f:
f.write(outstr) f.write(outstr)