From 7d98a8cea64f191921fb5732e7b798df09133349 Mon Sep 17 00:00:00 2001 From: AJ Slater Date: Fri, 23 Feb 2024 17:39:02 -0800 Subject: [PATCH] move function --- comicfn2dict/parse.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/comicfn2dict/parse.py b/comicfn2dict/parse.py index 856db94..c31ba6d 100644 --- a/comicfn2dict/parse.py +++ b/comicfn2dict/parse.py @@ -47,7 +47,7 @@ class ComicFilenameParser: return -1 if value not in self._path_indexes: # TODO This is fragile. - # Better to get it at match time. + # Can I get it at match time? if key == "ext": index = self.path.rfind(value) else: @@ -67,15 +67,6 @@ class ComicFilenameParser: self.metadata["ext"] = ext self._unparsed_path = data - def _grouping_operators_strip(self, value: str) -> str: - """Strip spaces and parens.""" - value = value.strip() - value = value.strip("()").strip() - value = value.strip("-").strip() - value = value.strip(",").strip() - value = value.strip("'").strip() - return value.strip('"').strip() - def _clean_dividers(self): """Replace non space dividers and clean extra spaces out of string.""" data = self._unparsed_path @@ -174,6 +165,15 @@ class ComicFilenameParser: break return title_ok or not other_tokens_exist + def _grouping_operators_strip(self, value: str) -> str: + """Strip spaces and parens.""" + value = value.strip() + value = value.strip("()").strip() + value = value.strip("-").strip() + value = value.strip(",").strip() + value = value.strip("'").strip() + return value.strip('"').strip() + def _assign_remaining_groups(self): """Assign series and title.""" if not self._unparsed_path: