From 1e71b7f0fa2ecffead312f793650c74dfdd81761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Fri, 20 Nov 2020 09:28:10 +0100 Subject: [PATCH] Changed source of stable ElvUI/Tukui --- CB/Core.py | 8 ++++---- CB/GitLab.py | 8 +------- CB/Tukui.py | 12 ++++++++---- CB/__init__.py | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/CB/Core.py b/CB/Core.py index a012795..c27c1f4 100644 --- a/CB/Core.py +++ b/CB/Core.py @@ -197,9 +197,9 @@ def parse_url(self, url): return GitHubAddon(url, self.clientType) elif url.lower() == 'elvui': if self.clientType == 'wow_retail': - return GitLabAddon('ElvUI', '60', 'elvui/elvui', 'master') + return TukuiAddon('ElvUI', False, 'elvui') else: - return GitLabAddon('ElvUI', '492', 'elvui/elvui-classic', 'master') + return TukuiAddon('2', True) elif url.lower() == 'elvui:dev': if self.clientType == 'wow_retail': return GitLabAddon('ElvUI', '60', 'elvui/elvui', 'development') @@ -207,9 +207,9 @@ def parse_url(self, url): return GitLabAddon('ElvUI', '492', 'elvui/elvui-classic', 'development') elif url.lower() == 'tukui': if self.clientType == 'wow_retail': - return GitLabAddon('Tukui', '77', 'Tukz/Tukui', 'master') + return TukuiAddon('Tukui', False, 'tukui') else: - return GitLabAddon('Tukui', '77', 'Tukz/Tukui', 'Classic') + return TukuiAddon('1', True) elif url.lower() == 'shadow&light:dev': if self.clientType == 'wow_retail': return GitLabAddon('ElvUI Shadow & Light', '45', 'shadow-and-light/shadow-and-light', 'dev') diff --git a/CB/GitLab.py b/CB/GitLab.py index d240548..0159c2e 100644 --- a/CB/GitLab.py +++ b/CB/GitLab.py @@ -27,17 +27,11 @@ def __init__(self, name, projectid, path, branch): self.author = [] if name == 'ElvUI': - self.author = ['Elv', 'Blazeflack'] + self.author = ['Elv'] if projectid == '60': self.changelogUrl = 'https://www.tukui.org/download.php?ui=elvui&changelog' elif projectid == '492': self.changelogUrl = 'https://www.tukui.org/classic-addons.php?id=2&changelog' - elif name == 'Tukui': - self.author = ['Tukz'] - if branch == 'master': - self.changelogUrl = 'https://www.tukui.org/download.php?ui=tukui&changelog' - elif branch == 'Classic': - self.changelogUrl = 'https://www.tukui.org/classic-addons.php?id=1&changelog' elif name == 'ElvUI Shadow & Light': self.author = ['Repooc', 'DarthPredator'] self.changelogUrl = 'https://git.tukui.org/shadow-and-light/shadow-and-light/-/commits/dev' diff --git a/CB/Tukui.py b/CB/Tukui.py index b18af95..0e1231e 100644 --- a/CB/Tukui.py +++ b/CB/Tukui.py @@ -8,10 +8,14 @@ class TukuiAddon: @retry() - def __init__(self, url, isclassic): - project = re.findall(r'\d+', url)[0] - self.payload = requests.get(f'https://www.tukui.org/api.php?{"classic-" if isclassic else ""}addon={project}', - headers=HEADERS, timeout=5) + def __init__(self, url, isclassic, special=None): + if special: + self.payload = requests.get(f'https://www.tukui.org/client-api.php?ui={special}', + headers=HEADERS, timeout=5) + else: + project = re.findall(r'\d+', url)[0] + self.payload = requests.get(f'https://www.tukui.org/api.php?' + f'{"classic-" if isclassic else ""}addon={project}', headers=HEADERS, timeout=5) if self.payload.text == '': raise RuntimeError(url) else: diff --git a/CB/__init__.py b/CB/__init__.py index b6bcac5..6ca5ceb 100644 --- a/CB/__init__.py +++ b/CB/__init__.py @@ -2,7 +2,7 @@ import random from rich.terminal_theme import TerminalTheme -__version__ = '3.15.0' +__version__ = '3.15.1' __license__ = 'GPLv3' __copyright__ = '2019-2020, Paweł Jastrzębski ' __docformat__ = 'restructuredtext en'