Skip to content

Commit

Permalink
Python 3.12 update
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Mar 12, 2024
1 parent 24fc38b commit e1fbe84
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 159 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
- name: Install dependencies
env:
PYINSTALLER_COMPILE_BOOTLOADER: 1
Expand All @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
Expand All @@ -57,7 +57,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel
Expand Down
26 changes: 12 additions & 14 deletions CB/Core.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def update_addon(self, url, update, force):
if old['URL'].startswith(('https://www.townlong-yak.com/addons/',
'https://www.curseforge.com/wow/addons/',
'https://www.tukui.org/')):
return old['Name'], [], oldversion, oldversion, None, modified, blocked, 'Unsupported', old['URL'],\
return old['Name'], [], oldversion, oldversion, None, modified, blocked, 'Unsupported', old['URL'], \
None, dev
source, sourceurl = self.parse_url_source(old['URL'])
new = self.parse_url(old['URL'])
Expand All @@ -328,7 +328,7 @@ def update_addon(self, url, update, force):
if force:
modified = False
blocked = False
return new.name, new.author, new.currentVersion, oldversion, new.uiVersion, modified, blocked, source,\
return new.name, new.author, new.currentVersion, oldversion, new.uiVersion, modified, blocked, source, \
sourceurl, new.changelogUrl, dev
return url, [], False, False, None, False, False, '?', None, None, None

Expand Down Expand Up @@ -447,7 +447,6 @@ def backup_wtf(self, console):
progress.update(task, advance=1, refresh=True)
zipf.close()

# noinspection PyTypeChecker
def find_orphans(self):
orphanedaddon = []
orphaneconfig = []
Expand Down Expand Up @@ -496,23 +495,23 @@ def search(self, query):
def create_reg(self):
with open('CurseBreaker.reg', 'w') as outfile:
outfile.write('Windows Registry Editor Version 5.00\n\n'
'[HKEY_CURRENT_USER\Software\Classes\\wago-app]\n'
'[HKEY_CURRENT_USER\\Software\\Classes\\wago-app]\n'
'"URL Protocol"="\\"\\""\n'
'@="\\"URL:CurseBreaker Protocol\\""\n'
'[HKEY_CURRENT_USER\Software\Classes\\wago-app\DefaultIcon]\n'
'[HKEY_CURRENT_USER\\Software\\Classes\\wago-app\\DefaultIcon]\n'
'@="\\"CurseBreaker.exe,1\\""\n'
'[HKEY_CURRENT_USER\Software\Classes\\wago-app\shell]\n'
'[HKEY_CURRENT_USER\Software\Classes\\wago-app\shell\open]\n'
'[HKEY_CURRENT_USER\Software\Classes\\wago-app\shell\open\command]\n'
'[HKEY_CURRENT_USER\\Software\\Classes\\wago-app\\shell]\n'
'[HKEY_CURRENT_USER\\Software\\Classes\\wago-app\\shell\\open]\n'
'[HKEY_CURRENT_USER\\Software\\Classes\\wago-app\\shell\\open\\command]\n'
'@="\\"' + os.path.abspath(sys.executable).replace('\\', '\\\\') + '\\" \\"%1\\""\n'
'[HKEY_CURRENT_USER\Software\Classes\weakauras-companion]\n'
'[HKEY_CURRENT_USER\\Software\\Classes\\weakauras-companion]\n'
'"URL Protocol"="\\"\\""\n'
'@="\\"URL:CurseBreaker Protocol\\""\n'
'[HKEY_CURRENT_USER\Software\Classes\weakauras-companion\DefaultIcon]\n'
'[HKEY_CURRENT_USER\\Software\\Classes\\weakauras-companion\\DefaultIcon]\n'
'@="\\"CurseBreaker.exe,1\\""\n'
'[HKEY_CURRENT_USER\Software\Classes\weakauras-companion\shell]\n'
'[HKEY_CURRENT_USER\Software\Classes\weakauras-companion\shell\open]\n'
'[HKEY_CURRENT_USER\Software\Classes\weakauras-companion\shell\open\command]\n'
'[HKEY_CURRENT_USER\\Software\\Classes\\weakauras-companion\\shell]\n'
'[HKEY_CURRENT_USER\\Software\\Classes\\weakauras-companion\\shell\\open]\n'
'[HKEY_CURRENT_USER\\Software\\Classes\\weakauras-companion\\shell\\open\\command]\n'
'@="\\"' + os.path.abspath(sys.executable).replace('\\', '\\\\') + '\\" \\"%1\\""')

def parse_wagoapp_payload(self, url):
Expand Down Expand Up @@ -581,7 +580,6 @@ def detect_accounts(self):
else:
return []

# noinspection PyTypeChecker
def detect_addons(self):
if self.config['WAAAPIKey'] == '':
raise RuntimeError('This feature only matches addons that are in the database of the Wago Addons. Other sou'
Expand Down
10 changes: 5 additions & 5 deletions CB/Wago.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def markdown_unmark_element(element, stream=None):

class BaseParser:
def __init__(self):
self.urlParser = re.compile('/([a-zA-Z0-9_-]+)/(\d+)')
self.urlParser = re.compile('/([a-zA-Z0-9_-]+)/(\\d+)')
self.list = {}
self.ignored = {}
self.data = {'slugs': [], 'stash': []}
Expand Down Expand Up @@ -147,8 +147,8 @@ def check_stash(self, wa, plater):
stash = f' ["{entry["slug"]}"] = {{\n name = [=[{entry["name"]}]=],\n author' \
f' = [=[{entry["username"]}]=],\n encoded = [=[{raw}]=],\n wagoVersion = [=' \
f'[{entry["version"]}]=],\n wagoSemver = [=[{entry["versionString"]}]=],\n ' \
f'source = [=[Wago]=],\n logo = [=[Interface\AddOns\CurseBreakerCompanion\LogoWA.tga' \
f']=],\n versionNote = [=[]=],\n }}' \
f'source = [=[Wago]=],\n logo = [=[Interface\\AddOns\\CurseBreakerCompanion\\LogoWA.' \
f'tga]=],\n versionNote = [=[]=],\n }}' \
f',\n'
if entry['type'] == 'WEAKAURA':
wa.data['stash'].append(stash)
Expand All @@ -173,8 +173,8 @@ def update_entry(self, entry, addon):
slug = f' ["{entry["slug"]}"] = {{\n name = [=[{entry["name"]}]=],\n author = [=[' \
f'{entry["username"]}]=],\n encoded = [=[{raw}]=],\n wagoVersion = [=[' \
f'{entry["version"]}]=],\n wagoSemver = [=[{entry["versionString"]}]=],\n source = [' \
f'=[Wago]=],\n logo = [=[Interface\AddOns\CurseBreakerCompanion\LogoWA.tga]=],\n ver' \
f'sionNote = [=[{self.parse_changelog(entry)}]=],\n' \
f'=[Wago]=],\n logo = [=[Interface\\AddOns\\CurseBreakerCompanion\\LogoWA.tga]=],\n ' \
f'versionNote = [=[{self.parse_changelog(entry)}]=],\n' \
f' }},\n'
addon.data['slugs'].append(slug)

Expand Down
4 changes: 2 additions & 2 deletions CB/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import requests
from rich.terminal_theme import TerminalTheme

__version__ = '4.5.2'
__version__ = '4.5.3'
__license__ = 'GPLv3'
__copyright__ = '2019-2023, Paweł Jastrzębski <pawelj@iosphe.re>'
__copyright__ = '2019-2024, Paweł Jastrzębski <pawelj@iosphe.re>'
__docformat__ = 'restructuredtext en'


Expand Down
25 changes: 13 additions & 12 deletions CurseBreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,10 @@ def c_install(self, args):
self.console.print('[green]Usage:[/green]\n\tThis command accepts a space-separated list of links as an arg'
'ument.[bold white]\n\tFlags:[/bold white]\n\t\t[bold white]-i[/bold white] - Disable th'
'e client version check.\n[bold green]Supported URL:[/bold green]\n\thttps://addons.wago'
'.io/addons/\[addon_name] [bold white]|[/bold white] wa:\[addon_name]\n\thttps://www.wow'
'interface.com/downloads/\[addon_name] [bold white]|[/bold white] wowi:\[addon_id]\n\tht'
'tps://github.com/\[username]/\[repository_name] [bold white]|[/bold white] gh:\[usernam'
'e]/\[repository_name]\n\tElvUI [bold white]|[/bold white] Tukui\n\t' +
'.io/addons/\\[addon_name] [bold white]|[/bold white] wa:\\[addon_name]\n\thttps://www.w'
'owinterface.com/downloads/\\[addon_name] [bold white]|[/bold white] wowi:\\[addon_id]\n'
'\thttps://github.com/\\[username]/\\[repository_name] [bold white]|[/bold white] gh:\\['
'username]/\\[repository_name]\n\tElvUI [bold white]|[/bold white] Tukui\n\t' +
self.parse_custom_addons(), highlight=False)

def c_uninstall(self, args):
Expand Down Expand Up @@ -601,7 +601,8 @@ def c_update(self, args, addline=False, update=True, force=False, reverseprovide
self.console.print(f'Additionally [green]{compacted}[/green] addons are up-to-date.')
overlap = self.core.check_if_overlap()
if overlap:
self.console.print(f'\n[bold red]Detected addon directory overlap. This will cause issues. Affected addons:[/bold red]\n{overlap}')
self.console.print(f'\n[bold red]Detected addon directory overlap. This will cause issues. Affected add'
f'ons:[/bold red]\n{overlap}')
else:
self.console.print('Apparently there are no addons installed by CurseBreaker (or you provided incorrect add'
'on name).\nCommand [green]import[/green] might be used to detect already installed addo'
Expand All @@ -614,8 +615,8 @@ def c_force_update(self, args):
self.c_update(args, False, True, True)
else:
# noinspection PyTypeChecker
answer = confirm(HTML('<ansibrightred>Execute a forced update of all addons and overwrite ALL local '
'changes?</ansibrightred>'))
answer = confirm(HTML('<ansibrightred>Execute a forced update of all addons and overwrite ALL local changes'
'?</ansibrightred>'))
if answer:
self.c_update(False, False, True, True)

Expand Down Expand Up @@ -970,11 +971,11 @@ def c_help(self, _):
's.\n'
'[green]uri_integration[/green]\n\tEnables integration with Wago Addons and Wago page.\n\t"D'
'ownload with Wago App" and "Send to WeakAura Companion App" buttons.\n\n[bold green]Support'
'ed URL:[/bold green]\n\thttps://addons.wago.io/addons/\[addon_name] [bold white]|[/bold whi'
'te] wa:\[addon_name]\n\thttps://www.wowinterface.com/downloads/\[addon_name] [bold white]|['
'/bold white] wowi:\[addon_id]\n\thttps://github.com/\[username]/\[repository_name] [bold wh'
'ite]|[/bold white] gh:\[username]/\[repository_name]\n\tElvUI [bold white]|[/bold white] Tu'
'kui\n\t' + self.parse_custom_addons(), highlight=False)
'ed URL:[/bold green]\n\thttps://addons.wago.io/addons/\\[addon_name] [bold white]|[/bold wh'
'ite] wa:\\[addon_name]\n\thttps://www.wowinterface.com/downloads/\\[addon_name] [bold white'
']|[/bold white] wowi:\\[addon_id]\n\thttps://github.com/\\[username]/\\[repository_name] [b'
'old white]|[/bold white] gh:\\[username]/\\[repository_name]\n\tElvUI [bold white]|[/bold w'
'hite] Tukui\n\t' + self.parse_custom_addons(), highlight=False)

def c_exit(self, _):
sys.exit(0)
Expand Down
2 changes: 1 addition & 1 deletion CurseBreaker.spec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if platform.system() == 'Windows':
vi.StringStruct('InternalName', 'CurseBreaker.exe'),
vi.StringStruct('FileDescription', 'CurseBreaker'),
vi.StringStruct('CompanyName', ' '),
vi.StringStruct('LegalCopyright', 'Copyright (C) 2019-2023 Paweł Jastrzębski'),
vi.StringStruct('LegalCopyright', 'Copyright (C) 2019-2024 Paweł Jastrzębski'),
vi.StringStruct('ProductName', 'CurseBreaker')])
]),
vi.VarFileInfo([vi.VarStruct('Translation', [0, 1200])])
Expand Down
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "pypi"
[packages]
python-dateutil = "*"
prompt-toolkit = "*"
checksumdir = "*"
checksumdir = {ref = "replace-pkg-resources", git = "git+https://github.com/idahogray/checksumdir"}
packaging = "*"
pyperclip = "*"
requests = "*"
Expand All @@ -17,4 +17,4 @@ rich = "*"
[dev-packages]

[requires]
python_version = "3.11"
python_version = "3.12"
Loading

0 comments on commit e1fbe84

Please sign in to comment.