Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Jul 20, 2022
1 parent dcb9381 commit 9dc5108
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CB/Core.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def cleanup(self, directories):
for directory in directories:
shutil.rmtree(self.path / directory, ignore_errors=True)

# TODO Cleanup after WOTLK Beta
# 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()
Expand Down Expand Up @@ -253,6 +253,7 @@ 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
Expand All @@ -277,6 +278,7 @@ 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.')
Expand Down Expand Up @@ -581,7 +583,7 @@ def bulk_check(self, addons):
# for addon in payload['addons']:
# self.wagoCache[addon] = payload['addons'][addon]

# TODO Cleanup after WOTLK Beta
# TODO WotLK Cleanup
@retry(custom_error='Failed to parse Tukui API data')
def bulk_tukui_check(self):
if not self.tukuiCache:
Expand Down Expand Up @@ -648,6 +650,7 @@ def detect_addons(self):

return names, slugs, namesinstalled

# TODO WotLK Cleanup
def export_addons(self):
addons = []
for addon in self.config['Addons']:
Expand Down
5 changes: 4 additions & 1 deletion CurseBreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ 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_'}:
if flavor in {'_retail_', '_ptr_', '_beta_'}:
self.core.clientType = 'retail'
elif flavor in {'_classic_beta_'}:
self.core.clientType = 'wotlk'
Expand Down Expand Up @@ -426,6 +427,7 @@ 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
Expand Down Expand Up @@ -895,6 +897,7 @@ 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'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_, _Burning Crusade_ and _Classic_ clients are supported. The client version is detected automatically.\
_Retail_, _WotLK_, _Burning Crusade_ and _Classic_ clients are supported. The client version is detected automatically.\
By default **CurseBreaker** will create backups of the entire `WTF` directory.

## TIPS & TRICKS
Expand Down Expand Up @@ -51,7 +51,7 @@ When GitHub is frequently used as a source for addons there is the possibility o
If that occurs user must get a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). And then add it to the application configuration by using `set gh_api` command.

## KNOWN ISSUES
- Using "double" WoWInterface projects ([example](https://www.wowinterface.com/downloads/info5086-BigWigsBossmods)) will always install a retail version of the addon. It can't be fixed as WoWInterface API doesn't support this type of project.
- Using WoWInterface projects that provide multiple addon releases ([example](https://www.wowinterface.com/downloads/info5086-BigWigsBossmods)) will always install a retail version of the addon. It can't be fixed as WoWInterface API doesn't support this type of project.
- Some WoWInterface addon categories (e.g. Compilations, Optional) are not handled by their API. Addons in these categories can't be installed.
- WoWInterface projects that need to install files outside the `Interface\AddOns` directory are not supported.

Expand Down

0 comments on commit 9dc5108

Please sign in to comment.