Add support for further .toc client version suffixes.

This commit is contained in:
Casper V. Kristensen 2021-09-02 21:50:35 +02:00
parent 9ac1fc5cff
commit 5476352b53
Signed by: caspervk
GPG key ID: 289CA03790535054

View file

@ -124,9 +124,9 @@ def find_addon_dirs(path: Path) -> Dict[str, Path]:
def toc_stem(toc: str): def toc_stem(toc: str):
""" """
Removes AddOn .toc client version suffixes, such as '-Classic.toc' or '-BCC.toc'. Removes AddOn .toc client version suffixes, such as '-Classic.toc' or '-BCC.toc'.
See https://github.com/Stanzilla/WoWUIBugs/issues/68#issuecomment-830351390 for more information. See https://github.com/Stanzilla/WoWUIBugs/issues/68#issuecomment-889431675 for more information.
""" """
return re.sub(r"(.*)-(BCC|Classic|Mainline)(\.toc)", r"\1\3", toc) return re.sub(r"(.*)[_-](Classic|Vanilla|BCC|TBC|Mainline)(\.toc)", r"\1\3", toc)
def get_valid_dir_filename(s: str) -> str: def get_valid_dir_filename(s: str) -> str: