simplify a tiny bit
This commit is contained in:
parent
ae02e6de77
commit
2e12ab77a5
1 changed files with 2 additions and 10 deletions
12
recipes.py
12
recipes.py
|
@ -1,5 +1,4 @@
|
|||
from typing import Dict, List, Any, Optional
|
||||
from dataclasses import dataclass
|
||||
import os
|
||||
|
||||
import yaml
|
||||
|
@ -10,6 +9,7 @@ class Unit:
|
|||
def __init__(self, name: str) -> None:
|
||||
self.name = name
|
||||
|
||||
|
||||
class Units:
|
||||
def __init__(self) -> None:
|
||||
self.units: List[Unit] = []
|
||||
|
@ -251,15 +251,7 @@ def rendertemplate(
|
|||
print(f"rendering {file}")
|
||||
outstr = template.render(args)
|
||||
|
||||
try:
|
||||
os.mkdir("out")
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
try:
|
||||
os.mkdir(f"out/{format}")
|
||||
except FileExistsError:
|
||||
pass
|
||||
os.makedirs(f"out/{format}", exist_ok=True)
|
||||
|
||||
with open(f"out/{format}/{file}", "w", encoding="utf-8") as f:
|
||||
f.write(outstr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue