Allow creation of avi video.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Mikaël Capelle
2024-12-15 13:37:17 +01:00
parent bc06f86fdc
commit 8308940674
6 changed files with 207 additions and 136 deletions

View File

@@ -10,12 +10,17 @@ class SimpleFileHandler(FileHandler):
self.logger: Final = logger
self.folder: Final = folder
def create(self, filename: str, content: bytes, text: bool = False):
def make_path(self, filename: str) -> Path:
return self.folder.joinpath(filename)
def notify_created(self, path: Path): ...
def _create(self, path: Path, content: bytes, text: bool = False):
if text:
for line in content.decode("utf-8").splitlines():
self.logger.info(line)
else:
self.folder.mkdir(exist_ok=True)
with open(self.folder.joinpath(filename), "wb") as fp:
with open(path, "wb") as fp:
fp.write(content)
return self.folder.joinpath(filename)
return path