From 4f42e0afad4d687b7947fb1bdf8af80bed54e782 Mon Sep 17 00:00:00 2001 From: AJ Slater Date: Wed, 21 Feb 2024 21:16:03 -0800 Subject: [PATCH] minor code cleanup --- comicfn2dict/parse.py | 5 +++-- comicfn2dict/unparse.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/comicfn2dict/parse.py b/comicfn2dict/parse.py index d0fa781..9e621a3 100644 --- a/comicfn2dict/parse.py +++ b/comicfn2dict/parse.py @@ -337,6 +337,7 @@ class ComicFilenameParser: self._path_indexes: dict[str, int] = {} -def comicfn2dict(path: str | Path): +def comicfn2dict(path: str | Path, verbose: int = 0): """Simple API.""" - return ComicFilenameParser(path).parse() + parser = ComicFilenameParser(path, verbose=verbose) + return parser.parse() diff --git a/comicfn2dict/unparse.py b/comicfn2dict/unparse.py index a0c4b91..351a115 100644 --- a/comicfn2dict/unparse.py +++ b/comicfn2dict/unparse.py @@ -112,6 +112,7 @@ class ComicFilenameSerializer: self._debug: bool = bool(verbose) -def dict2comicfn(md: Mapping, ext: bool = True) -> str: +def dict2comicfn(md: Mapping, ext: bool = True, verbose: int = 0) -> str: """Simple API.""" - return ComicFilenameSerializer(md, ext=ext).serialize() + serializer = ComicFilenameSerializer(md, ext=ext, verbose=verbose) + return serializer.serialize()