Skip to content

Commit

Permalink
Fixed issues with Tukui GitLab support (close #17)
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Sep 25, 2019
1 parent 1b9c010 commit 778d078
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CB/Core.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ def parse_url(self, url):
raise RuntimeError('Incorrect client version.')
return TukuiAddon(url, False)
elif url.startswith('https://www.tukui.org/classic-addons.php?id='):
if self.clientType == 'wow_retail' or url.endswith('1') or url.endswith('2'):
if self.clientType == 'wow_retail':
raise RuntimeError('Incorrect client version.')
elif url.endswith('1') or url.endswith('2'):
raise RuntimeError('ElvUI and Tukui cannot be installed this way.')
return TukuiAddon(url, True)
elif url.lower() == 'elvui':
if self.clientType == 'wow_retail':
Expand Down
3 changes: 3 additions & 0 deletions CB/GitLab.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ def get_addon(self):
file_info = self.archive.getinfo(file)
if file_info.is_dir() and file_info.filename.count('/') == 2 and '.gitlab' not in file_info.filename:
self.directories.append(file_info.filename.split('/')[1])
if len(self.directories) == 0 or self.directories == ['']:
raise RuntimeError

def install(self, path):
self.get_addon()
self.archive.extractall(path)
for directory in self.directories:
shutil.rmtree(path / directory, ignore_errors=True)
# FIXME - Python bug #32689
shutil.move(str(path / f'{self.shorthPath}-{self.branch}' / directory), str(path))
shutil.rmtree(path / f'{self.shorthPath}-{self.branch}')
2 changes: 1 addition & 1 deletion CB/WeakAura.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def install_companion(self, client_type, force):
if not os.path.isdir(Path('Interface\AddOns\WeakAurasCompanion')) or force:
Path('Interface\AddOns\WeakAurasCompanion').mkdir(exist_ok=True)
with open(Path('Interface\AddOns\WeakAurasCompanion\WeakAurasCompanion.toc'), 'w', newline='\n') as out:
out.write(f'## Interface: {"11302" if client_type == "wow_classic" else "80200"}\n## Title: WeakAu'
out.write(f'## Interface: {"11302" if client_type == "wow_classic" else "80205"}\n## Title: WeakAu'
f'ras Companion\n## Author: The WeakAuras Team\n## Version: 1.0.0\n## Notes: Keep your WeakAu'
f'ras updated!\n## X-Category: Interface Enhancements\n## DefaultState: Enabled\n## LoadOnDem'
f'and: 0\n## Dependencies: WeakAuras\n\ndata.lua\ninit.lua')
Expand Down
2 changes: 1 addition & 1 deletion CB/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import string
import random

__version__ = '2.6.0'
__version__ = '2.6.1'
__license__ = 'GPLv3'
__copyright__ = '2019, Paweł Jastrzębski <[email protected]>'
__docformat__ = 'restructuredtext en'
Expand Down

0 comments on commit 778d078

Please sign in to comment.