Set up ability to run commands from the terminal

This commit is contained in:
Andrew Miner
2025-10-06 20:57:46 -06:00
parent a8b6e6b15e
commit 4637137152
18 changed files with 231 additions and 49 deletions
@@ -0,0 +1,24 @@
from tungston.generator.markdown.report import Report
import shutil
import os
# Class ############################################################################################
class ReportWriter:
def __init__(self, reports:list[Report]):
self._reports = reports
def write(self, reportDirPath:str):
if os.path.exists(reportDirPath):
shutil.rmtree(reportDirPath)
os.makedirs(reportDirPath, exist_ok=True)
for report in self._reports:
report.build()
path = os.path.join(reportDirPath, report.name)
with open(path, "w") as file:
file.write(str(report))