diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99cf797..d6c9e81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: linux: name: Linux - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 @@ -52,7 +52,7 @@ jobs: macos: name: macOS - runs-on: macos-10.15 + runs-on: macos-11 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 diff --git a/.gitignore b/.gitignore index 6727855..618f91c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ .idea/ __pycache__/ -Interface/ -WTF/ -WTF-Backup/ +Interface +WTF +WTF-Backup /Wow.exe /CurseBreaker.reg /Build.sh diff --git a/CB/Core.py b/CB/Core.py index 43d1f31..3b74d91 100644 --- a/CB/Core.py +++ b/CB/Core.py @@ -115,6 +115,10 @@ def update_config(self): # 3.3.0 if 'Development' in addon.keys() and isinstance(addon['Development'], bool): addon['Development'] = 1 + # 4.3.0 + if addon['URL'].startswith('https://www.tukui.org/classic-tbc-addons.php?id='): + addon['URL'] = addon['URL'].replace('https://www.tukui.org/classic-tbc-addons.php?id=', + 'https://www.tukui.org/classic-wotlk-addons.php?id=') for add in [['2.1.0', 'WAUsername', ''], ['2.2.0', 'WAAccountName', ''], ['2.2.0', 'WAAPIKey', ''], @@ -185,7 +189,6 @@ def cleanup(self, directories): for directory in directories: shutil.rmtree(self.path / directory, ignore_errors=True) - # TODO WotLK Cleanup def parse_url(self, url): if url.startswith('https://addons.wago.io/addons/'): return WagoAddonsAddon(url, self.wagoCache, 'retail' if url in self.config['IgnoreClientVersion'].keys() @@ -204,8 +207,8 @@ def parse_url(self, url): raise RuntimeError('ElvUI and Tukui cannot be installed this way.') self.bulk_tukui_check() return TukuiAddon(url, self.tukuiCache) - elif url.startswith('https://www.tukui.org/classic-tbc-addons.php?id='): - if self.clientType != 'bc': + elif url.startswith('https://www.tukui.org/classic-wotlk-addons.php?id='): + if self.clientType != 'wotlk': raise RuntimeError('Unsupported client version.') elif url.endswith('=1') or url.endswith('=2'): raise RuntimeError('ElvUI and Tukui cannot be installed this way.') @@ -216,8 +219,6 @@ def parse_url(self, url): elif url.lower() == 'elvui': if self.clientType == 'retail': return TukuiAddon('ElvUI', self.tukuiCache, 'elvui') - elif self.clientType == 'wotlk': - raise RuntimeError('Unsupported client version.') else: self.bulk_tukui_check() return TukuiAddon('2', self.tukuiCache) @@ -225,18 +226,9 @@ def parse_url(self, url): return GitHubAddonRaw('tukui-org/ElvUI', 'development', ['ElvUI', 'ElvUI_OptionsUI'], self.config['GHAPIKey']) elif url.lower() == 'tukui': - if self.clientType == 'retail': - return TukuiAddon('Tukui', self.tukuiCache, 'tukui') - elif self.clientType == 'wotlk': - raise RuntimeError('Unsupported client version.') - else: - self.bulk_tukui_check() - return TukuiAddon('1', self.tukuiCache) + return TukuiAddon('Tukui', self.tukuiCache, 'tukui') elif url.lower() == 'tukui:dev': - if self.clientType != 'wotlk': - return GitHubAddonRaw('tukui-org/Tukui', 'Live', ['Tukui'], self.config['GHAPIKey']) - else: - raise RuntimeError('Unsupported client version.') + return GitHubAddonRaw('tukui-org/Tukui', 'Live', ['Tukui'], self.config['GHAPIKey']) elif url.lower() == 'shadow&light:dev': if self.clientType == 'retail': return GitHubAddonRaw('Shadow-and-Light/shadow-and-light', 'dev', ['ElvUI_SLE'], @@ -250,7 +242,6 @@ def parse_url(self, url): else: raise NotImplementedError('Provided URL is not supported.') - # TODO WotLK Cleanup def parse_url_source(self, url): if url.startswith('https://addons.wago.io/addons/'): return 'Wago', url @@ -258,7 +249,7 @@ def parse_url_source(self, url): return 'WoWI', url elif url.startswith('https://www.tukui.org/addons.php?id=') or \ url.startswith('https://www.tukui.org/classic-addons.php?id=') or \ - url.startswith('https://www.tukui.org/classic-tbc-addons.php?id='): + url.startswith('https://www.tukui.org/classic-wotlk-addons.php?id='): return 'Tukui', url elif url.lower() == 'elvui:dev': return 'GitHub', 'https://github.com/tukui-org/ElvUI' @@ -275,7 +266,6 @@ def parse_url_source(self, url): else: return '?', None - # TODO WotLK Cleanup def add_addon(self, url, ignore): if url.endswith(':'): raise NotImplementedError('Provided URL is not supported.') @@ -289,8 +279,8 @@ def add_addon(self, url, ignore): url = f'https://www.tukui.org/addons.php?id={url[3:]}' elif url.startswith('tuc:'): url = f'https://www.tukui.org/classic-addons.php?id={url[4:]}' - elif url.startswith('tubc:'): - url = f'https://www.tukui.org/classic-tbc-addons.php?id={url[5:]}' + elif url.startswith('tuwc:'): + url = f'https://www.tukui.org/classic-wotlk-addons.php?id={url[5:]}' elif url.startswith('gh:'): url = f'https://github.com/{url[3:]}' if url.endswith('/'): @@ -597,14 +587,13 @@ def bulk_check(self, addons): self.wagoCache[addon['slug']] = payload['addons'][addonid] break - # TODO WotLK Cleanup @retry(custom_error='Failed to parse Tukui API data') def bulk_tukui_check(self): if not self.tukuiCache: if self.clientType == 'classic': endpoint = 'classic-addons' - elif self.clientType == 'bc': - endpoint = 'classic-tbc-addons' + elif self.clientType == 'wotlk': + endpoint = 'classic-wotlk-addons' else: endpoint = 'addons' self.tukuiCache = requests.get(f'https://www.tukui.org/api.php?{endpoint}', @@ -667,7 +656,6 @@ def detect_addons(self): return names, slugs, namesinstalled - # TODO WotLK Cleanup def export_addons(self): addons = [] for addon in self.config['Addons']: @@ -679,8 +667,8 @@ def export_addons(self): url = f'tu:{addon["URL"].split("?id=")[-1]}' elif addon['URL'].startswith('https://www.tukui.org/classic-addons.php?id='): url = f'tuc:{addon["URL"].split("?id=")[-1]}' - elif addon['URL'].startswith('https://www.tukui.org/classic-tbc-addons.php?id='): - url = f'tubc:{addon["URL"].split("?id=")[-1]}' + elif addon['URL'].startswith('https://www.tukui.org/classic-wotlk-addons.php?id='): + url = f'tuwc:{addon["URL"].split("?id=")[-1]}' elif addon['URL'].startswith('https://github.com/'): url = f'gh:{addon["URL"].replace("https://github.com/", "")}' else: diff --git a/CB/GitHub.py b/CB/GitHub.py index 8745428..f6d24ca 100644 --- a/CB/GitHub.py +++ b/CB/GitHub.py @@ -72,8 +72,6 @@ def get_latest_package(self): targetfile = None if self.clientType == 'classic': targetflavor = 'classic' - elif self.clientType == 'bc': - targetflavor = 'bcc' elif self.clientType == 'wotlk': targetflavor = 'wrath' else: @@ -102,7 +100,6 @@ def get_latest_package(self): else: latest = None latestclassic = None - latestbc = None latestwrath = None for release in self.payloads[self.releaseDepth]['assets']: if release['name'] and '-nolib' not in release['name'] \ @@ -113,19 +110,14 @@ def get_latest_package(self): latest = release['url'] elif not latestclassic and release['name'].endswith('-classic.zip'): latestclassic = release['url'] - elif not latestbc and (release['name'].endswith('-bc.zip') or release['name'].endswith('-bcc.zip')): - latestbc = release['url'] elif not latestwrath and release['name'].endswith('-wrath.zip'): latestwrath = release['url'] if (self.clientType == 'retail' and latest) \ or (self.clientType == 'classic' and latest and not latestclassic) \ - or (self.clientType == 'bc' and latest and not latestbc) \ or (self.clientType == 'wotlk' and latest and not latestwrath): self.downloadUrl = latest elif self.clientType == 'classic' and latestclassic: self.downloadUrl = latestclassic - elif self.clientType == 'bc' and latestbc: - self.downloadUrl = latestbc elif self.clientType == 'wotlk' and latestwrath: self.downloadUrl = latestwrath else: diff --git a/CB/Wago.py b/CB/Wago.py index bdb3493..77d0a03 100644 --- a/CB/Wago.py +++ b/CB/Wago.py @@ -94,6 +94,7 @@ def parse_storage(self): class WagoUpdater: + # noinspection PyTypeChecker def __init__(self, config, clienttoc): self.username = config['WAUsername'] self.accountName = config['WAAccountName'] @@ -101,7 +102,6 @@ def __init__(self, config, clienttoc): self.clientTOC = clienttoc self.bbParser = bbcode.Parser() Markdown.output_formats['plain'] = markdown_unmark_element - # noinspection PyTypeChecker self.mdParser = Markdown(output_format='plain') self.mdParser.stripTopLevelTags = False self.headers = HEADERS diff --git a/CB/__init__.py b/CB/__init__.py index 4db2879..84b2c76 100644 --- a/CB/__init__.py +++ b/CB/__init__.py @@ -1,7 +1,7 @@ import requests from rich.terminal_theme import TerminalTheme -__version__ = '4.2.1' +__version__ = '4.3.0' __license__ = 'GPLv3' __copyright__ = '2019-2022, Paweł Jastrzębski ' __docformat__ = 'restructuredtext en' diff --git a/CurseBreaker.py b/CurseBreaker.py index fc63955..ca72afa 100644 --- a/CurseBreaker.py +++ b/CurseBreaker.py @@ -68,19 +68,15 @@ def start(self): pause(self.headless) sys.exit(1) # Detect client flavor - # TODO WotLK Cleanup if 'CURSEBREAKER_FLAVOR' in os.environ: flavor = os.environ.get('CURSEBREAKER_FLAVOR') else: flavor = os.path.basename(os.getcwd()) - if flavor in {'_retail_', '_ptr_', '_beta_'}: + if flavor in {'_retail_', '_ptr_'}: self.core.clientType = 'retail' - elif flavor in {'_classic_beta_'}: + elif flavor in {'_classic_', '_classic_ptr_'}: self.core.clientType = 'wotlk' set_terminal_title(f'CurseBreaker v{__version__} - Wrath of the Lich King') - elif flavor in {'_classic_', '_classic_ptr_'}: - self.core.clientType = 'bc' - set_terminal_title(f'CurseBreaker v{__version__} - Burning Crusade') elif flavor in {'_classic_era_', '_classic_era_ptr_'}: self.core.clientType = 'classic' set_terminal_title(f'CurseBreaker v{__version__} - Classic') @@ -427,7 +423,6 @@ def parse_link(self, text, link, dev=None, authors=None, uiversion=None): obj.no_wrap = True return obj - # TODO WotLK Cleanup def c_install(self, args): if args: optignore = False @@ -473,11 +468,11 @@ def c_install(self, args): 'interface.com/downloads/\[addon_name] [bold white]|[/bold white] wowi:\[addon_id]\n\tht' 'tps://www.tukui.org/addons.php?id=\[addon_id] [bold white]|[/bold white] tu:\[addon_id]' '\n\thttps://www.tukui.org/classic-addons.php?id=\[addon_id] [bold white]|[/bold white] ' - 'tuc:\[addon_id]\n\thttps://www.tukui.org/classic-tbc-addons.php?id=\[addon_id] [bold wh' - 'ite]|[/bold white] tubc:\[addon_id]\n\thttps://github.com/\[username]/\[repository_name' - '] [bold white]|[/bold white] gh:\[username]/\[repository_name]\n\tElvUI [bold white]|[/' - 'bold white] ElvUI:Dev\n\tTukui [bold white]|[/bold white] Tukui:Dev\n\tShadow&Light:Dev' - '', highlight=False) + 'tuc:\[addon_id]\n\thttps://www.tukui.org/classic-wotlk-addons.php?id=\[addon_id] [bold ' + 'white]|[/bold white] tuwc:\[addon_id]\n\thttps://github.com/\[username]/\[repository_na' + 'me] [bold white]|[/bold white] gh:\[username]/\[repository_name]\n\tElvUI [bold white]|' + '[/bold white] ElvUI:Dev\n\tTukui [bold white]|[/bold white] Tukui:Dev\n\tShadow&Light:D' + 'ev', highlight=False) def c_uninstall(self, args): if args: @@ -897,7 +892,6 @@ def c_export(self, _): pyperclip.copy(payload) self.console.print(f'{payload}\n\nThe command above was copied to the clipboard.', highlight=False) - # TODO WotLK Cleanup def c_help(self, _): self.console.print('[green]install [URL][/green]\n\tCommand accepts a space-separated list of links.\n\t[bold w' 'hite]Flags:[/bold white]\n\t' @@ -953,11 +947,11 @@ def c_help(self, _): 'te] wa:\[addon_name]\n\thttps://www.wowinterface.com/downloads/\[addon_name] [bold white]|[' '/bold white] wowi:\[addon_id]\n\thttps://www.tukui.org/addons.php?id=\[addon_id] [bold whit' 'e]|[/bold white] tu:\[addon_id]\n\thttps://www.tukui.org/classic-addons.php?id=\[addon_id] ' - '[bold white]|[/bold white] tuc:\[addon_id]\n\thttps://www.tukui.org/classic-tbc-addons.php?' - 'id=\[addon_id] [bold white]|[/bold white] tubc:\[addon_id]\n\thttps://github.com/\[username' - ']/\[repository_name] [bold white]|[/bold white] gh:\[username]/\[repository_name]\n\tElvUI ' - '[bold white]|[/bold white] ElvUI:Dev\n\tTukui [bold white]|[/bold white] Tukui:Dev\n\tShado' - 'w&Light:Dev', highlight=False) + '[bold white]|[/bold white] tuc:\[addon_id]\n\thttps://www.tukui.org/classic-wotlk-addons.ph' + 'p?id=\[addon_id] [bold white]|[/bold white] tuwc:\[addon_id]\n\thttps://github.com/\[userna' + 'me]/\[repository_name] [bold white]|[/bold white] gh:\[username]/\[repository_name]\n\tElvU' + 'I [bold white]|[/bold white] ElvUI:Dev\n\tTukui [bold white]|[/bold white] Tukui:Dev\n\tSha' + 'dow&Light:Dev', highlight=False) def c_exit(self, _): sys.exit(0) diff --git a/Pipfile.lock b/Pipfile.lock index c2ea948..95a2d46 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "a738a65f9916845da6959b49d8c1f96adefe4a0c634319c9ca49ec879a57d0a1" + "sha256": "90dd4d11e8990337dfcd45f4319b17e3773ca1a3e67b9ee8d50cba8223a8497a" }, "pipfile-spec": 6, "requires": { @@ -34,11 +34,11 @@ }, "charset-normalizer": { "hashes": [ - "sha256:5189b6f22b01957427f35b6a08d9a0bc45b46d3788ef5a92e978433c7a35f8a5", - "sha256:575e708016ff3a5e3681541cb9d79312c416835686d054a23accb873b254f413" + "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845", + "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f" ], "markers": "python_version >= '3.6'", - "version": "==2.1.0" + "version": "==2.1.1" }, "checksumdir": { "hashes": [ @@ -137,11 +137,11 @@ }, "markdown": { "hashes": [ - "sha256:cbb516f16218e643d8e0a95b309f77eb118cb138d39a4f27851e6a63581db874", - "sha256:f5da449a6e1c989a4cea2631aa8ee67caa5a2ef855d551c88f9e309f4634c621" + "sha256:08fb8465cffd03d10b9dd34a5c3fea908e20391a2a90b88d66362cb05beed186", + "sha256:3b809086bb6efad416156e00a0da66fe47618a5d6918dd688f53f40c8e4cfeff" ], "index": "pypi", - "version": "==3.3.7" + "version": "==3.4.1" }, "packaging": { "hashes": [ @@ -161,11 +161,11 @@ }, "pygments": { "hashes": [ - "sha256:5eb116118f9612ff1ee89ac96437bb6b49e8f04d8a13b514ba26f620208e26eb", - "sha256:dc9c10fb40944260f6ed4c688ece0cd2048414940f1cea51b8b226318411c519" + "sha256:56a8508ae95f98e2b9bdf93a6be5ae3f7d8af858b43e02c5a2ff083726be40c1", + "sha256:f643f331ab57ba3c9d89212ee4a2dabc6e94f117cf4eefde99a0574720d14c42" ], "markers": "python_version >= '3.6'", - "version": "==2.12.0" + "version": "==2.13.0" }, "pyparsing": { "hashes": [ @@ -216,11 +216,11 @@ }, "urllib3": { "hashes": [ - "sha256:8298d6d56d39be0e3bc13c1c97d133f9b45d797169a0e11cdd0e0489d786f7ec", - "sha256:879ba4d1e89654d9769ce13121e0f94310ea32e8d2f8cf587b77c08bbcdb30d6" + "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e", + "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4.0'", - "version": "==1.26.10" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_full_version < '4.0.0'", + "version": "==1.26.12" }, "wcwidth": { "hashes": [ diff --git a/README.md b/README.md index 959dc3f..e935bae 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Read the instructions on the top of the screen. Already installed addons will not be recognized by **CurseBreaker** and they need to be reinstalled.\ This process can be partially automated by using the `import` command. -_Retail_, _WotLK_, _Burning Crusade_ and _Classic_ clients are supported. The client version is detected automatically.\ +_Retail_, _WotLK Classic_ and _Classic_ clients are supported. The client version is detected automatically.\ By default **CurseBreaker** will create backups of the entire `WTF` directory. ## TIPS & TRICKS @@ -31,7 +31,7 @@ By default **CurseBreaker** will create backups of the entire `WTF` directory. ## SUPPORTED URL - Wago Addons: `https://addons.wago.io/addons/[addon_name]`, `wa:[addon_name]` - WoWInterface: `https://www.wowinterface.com/downloads/[addon_name]`, `wowi:[addon_id]` -- Tukui: `ElvUI`, `Tukui`, `https://www.tukui.org/addons.php?id=[addon_id]`, `https://www.tukui.org/classic-addons.php?id=[addon_id]`, `https://www.tukui.org/classic-tbc-addons.php?id=[addon_id]`, `tu:[addon_id]`, `tuc:[addon_id]` , `tubc:[addon_id]` +- Tukui: `ElvUI`, `Tukui`, `https://www.tukui.org/addons.php?id=[addon_id]`, `https://www.tukui.org/classic-addons.php?id=[addon_id]`, `https://www.tukui.org/classic-wotlk-addons.php?id=[addon_id]`, `tu:[addon_id]`, `tuc:[addon_id]` , `tuwc:[addon_id]` - GitHub: `ElvUI:Dev`, `Tukui:Dev`, `Shadow&Light:Dev` - GitHub Releases: `https://github.com/[username]/[repository_name]`, `gh:[username]/[repository_name]` - Wago: **CurseBreaker** can update auras and Plater profiles/scripts like WeakAuras Companion.