formatting

This commit is contained in:
AJ Slater 2024-02-20 18:36:34 -08:00
parent de1e0949c0
commit 55423a9f10
2 changed files with 3 additions and 6 deletions

View File

@ -145,12 +145,9 @@ class ComicFilenameParser:
if not self._unparsed_path: if not self._unparsed_path:
return return
# TODO fix REMAINING GROUP_RE to use token delim
tokens = self._unparsed_path.split(_TOKEN_DELIMETER)
# ASSIGN GROUPS
remaining_key_index = 0 remaining_key_index = 0
unused_tokens = [] unused_tokens = []
tokens = self._unparsed_path.split(_TOKEN_DELIMETER)
while tokens and remaining_key_index < len(_REMAINING_GROUP_KEYS): while tokens and remaining_key_index < len(_REMAINING_GROUP_KEYS):
key = _REMAINING_GROUP_KEYS[remaining_key_index] key = _REMAINING_GROUP_KEYS[remaining_key_index]
token = tokens.pop(0) token = tokens.pop(0)

View File

@ -111,15 +111,15 @@ ORIGINAL_FORMAT_SCAN_INFO_SEPARATE_RE = re_compile(
# REGULAR TOKENS # REGULAR TOKENS
VOLUME_RE = re_compile(r"((?:v(?:ol(?:ume)?)?\.?)\s*(?P<volume>\d+))") VOLUME_RE = re_compile(r"((?:v(?:ol(?:ume)?)?\.?)\s*(?P<volume>\d+))")
# ISSUE
_ISSUE_NUMBER_RE_EXP = r"(?P<issue>[\w½]+\.?\d*\w*)" _ISSUE_NUMBER_RE_EXP = r"(?P<issue>[\w½]+\.?\d*\w*)"
ISSUE_NUMBER_RE = re_compile(r"(\(?#" + _ISSUE_NUMBER_RE_EXP + r"\)?)") ISSUE_NUMBER_RE = re_compile(r"(\(?#" + _ISSUE_NUMBER_RE_EXP + r"\)?)")
_ISSUE_RE_EXP = r"(?P<issue>[\d½]+\.?\d*\w*)" _ISSUE_RE_EXP = r"(?P<issue>[\d½]+\.?\d*\w*)"
ISSUE_END_RE = re_compile(r"([\/\s]\(?" + _ISSUE_RE_EXP + r"\)?(\/|$))") ISSUE_END_RE = re_compile(r"([\/\s]\(?" + _ISSUE_RE_EXP + r"\)?(\/|$))")
ISSUE_BEGIN_RE = re_compile(r"((^|\/)\(?" + _ISSUE_RE_EXP + r"\)?[\/|\s])") ISSUE_BEGIN_RE = re_compile(r"((^|\/)\(?" + _ISSUE_RE_EXP + r"\)?[\/|\s])")
ISSUE_ANYWHERE_RE = re_compile(r"\b(\(?" + _ISSUE_RE_EXP + r"\)?)\b") ISSUE_ANYWHERE_RE = re_compile(r"\b(\(?" + _ISSUE_RE_EXP + r"\)?)\b")
# LONG STRINGS # LONG STRINGS
REMAINING_GROUP_RE = re_compile(r"^[^\()].*[^\)]") REMAINING_GROUP_RE = re_compile(r"^[^\()].*[^\)]")
NON_NUMBER_DOT_RE = re_compile(r"(\D)\.(\D)") NON_NUMBER_DOT_RE = re_compile(r"(\D)\.(\D)")