Compare commits
No commits in common. "master" and "1.0.0" have entirely different histories.
|
|
@ -1,2 +0,0 @@
|
||||||
python -m pip install -r requirements.txt
|
|
||||||
python -m pip install -r build-requirements-nuitka.txt
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
nuitka==1.4.8
|
nuitka==1.2.4
|
||||||
ordered-set==4.1.0
|
ordered-set==4.1.0
|
||||||
zstandard==0.20.0
|
zstandard==0.19.0
|
||||||
|
|
|
||||||
1
build-requirements-pyi.txt
Normal file
1
build-requirements-pyi.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
pyinstaller==5.7.0
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
python -m nuitka --standalone --onefile --prefer-source-code --assume-yes-for-downloads --remove-output --lto=yes --windows-uac-admin --company-name=Cyrmax --product-name=Sku_Updater --file-version=32.15 --product-version=32.15 --file-description="A console program to update your installation of Sku for WoW Classic" --copyright="Made by Cyrmax in 2022. MIT license" sku-updater.py
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
from functools import total_ordering
|
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import re
|
import re
|
||||||
|
|
@ -13,37 +12,6 @@ import requests
|
||||||
SKU_URL = "https://duugu.github.io/Sku"
|
SKU_URL = "https://duugu.github.io/Sku"
|
||||||
|
|
||||||
|
|
||||||
@total_ordering
|
|
||||||
class Version:
|
|
||||||
major: int
|
|
||||||
minor: int
|
|
||||||
def __init__(self, number: float):
|
|
||||||
components = str(number).split(".")
|
|
||||||
self.major = int(components[0])
|
|
||||||
self.minor = int(components[1]) if len(components) > 1 else 0
|
|
||||||
|
|
||||||
def __eq__(self, other) -> bool:
|
|
||||||
return self.major == other.major and self.minor == other.minor
|
|
||||||
|
|
||||||
def __lt__(self, other) -> bool:
|
|
||||||
if self.major != other.major:
|
|
||||||
return self.major < other.major
|
|
||||||
else:
|
|
||||||
return self.minor < other.minor
|
|
||||||
|
|
||||||
def __gt__(self, other) -> bool:
|
|
||||||
if self.major != other.major:
|
|
||||||
return self.major > other.major
|
|
||||||
else:
|
|
||||||
return self.minor > other.minor
|
|
||||||
|
|
||||||
def __str__(self) -> str:
|
|
||||||
return f"{self.major}.{self.minor}"
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return str(self)
|
|
||||||
|
|
||||||
|
|
||||||
def confirmed_exit(code: int):
|
def confirmed_exit(code: int):
|
||||||
print("Press enter to exit program")
|
print("Press enter to exit program")
|
||||||
input()
|
input()
|
||||||
|
|
@ -63,7 +31,7 @@ def get_sku_version(sku_path: pathlib.Path) -> float:
|
||||||
changelog_path = sku_path / "CHANGELOG.md"
|
changelog_path = sku_path / "CHANGELOG.md"
|
||||||
with changelog_path.open("r") as f:
|
with changelog_path.open("r") as f:
|
||||||
txt = f.read()
|
txt = f.read()
|
||||||
version_match = re.search(r"^\# Sku \(((\d+\.\d+)|(\d+))\)", txt)
|
version_match = re.search(r"^\# Sku \((\d+\.\d+)\)", txt)
|
||||||
if not version_match:
|
if not version_match:
|
||||||
print("Unable to determine Sku version")
|
print("Unable to determine Sku version")
|
||||||
confirmed_exit(1)
|
confirmed_exit(1)
|
||||||
|
|
@ -72,12 +40,12 @@ def get_sku_version(sku_path: pathlib.Path) -> float:
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print("Unable to determine Sku version")
|
print("Unable to determine Sku version")
|
||||||
confirmed_exit(1)
|
confirmed_exit(1)
|
||||||
return Version(version)
|
return version
|
||||||
|
|
||||||
|
|
||||||
def fetch_sku_version() -> tuple[float, str]:
|
def fetch_sku_version() -> tuple[float, str]:
|
||||||
rre = re.compile(
|
rre = re.compile(
|
||||||
r"^https://github.com/Duugu/Sku/releases/download/r(\d+\.\d+)|(\d+)/Sku-r(\d+\.\d+)|(\d+)-.+\.zip$",
|
r"^https://github.com/Duugu/Sku/releases/download/r\d+\.\d+/Sku-r\d+\.\d+-.+\.zip$",
|
||||||
re.I,
|
re.I,
|
||||||
)
|
)
|
||||||
r = requests.get(SKU_URL)
|
r = requests.get(SKU_URL)
|
||||||
|
|
@ -88,14 +56,14 @@ def fetch_sku_version() -> tuple[float, str]:
|
||||||
confirmed_exit(1)
|
confirmed_exit(1)
|
||||||
href = links[0].get("href")
|
href = links[0].get("href")
|
||||||
version_match = re.search(
|
version_match = re.search(
|
||||||
r"^https://github.com/Duugu/Sku/releases/download/r(\d+\.\d+)|(\d+)/Sku-r((\d+\.\d+)|(\d+))-.+\.zip$",
|
r"^https://github.com/Duugu/Sku/releases/download/r\d+\.\d+/Sku-r(\d+\.\d+)-.+\.zip$",
|
||||||
href,
|
href,
|
||||||
)
|
)
|
||||||
if not version_match:
|
if not version_match:
|
||||||
print("Unable to fetch latest Sku version")
|
print("Unable to fetch latest Sku version")
|
||||||
confirmed_exit(1)
|
confirmed_exit(1)
|
||||||
version = float(version_match.group(1))
|
version = float(version_match.group(1))
|
||||||
return (Version(version), href)
|
return (version, href)
|
||||||
|
|
||||||
|
|
||||||
def update_sku(sku_info: tuple[float, str], sku_path: pathlib.Path):
|
def update_sku(sku_info: tuple[float, str], sku_path: pathlib.Path):
|
||||||
|
|
|
||||||
44
sku-updater.spec
Normal file
44
sku-updater.spec
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
block_cipher = None
|
||||||
|
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
['sku-updater.py'],
|
||||||
|
pathex=[],
|
||||||
|
binaries=[],
|
||||||
|
datas=[],
|
||||||
|
hiddenimports=[],
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
win_no_prefer_redirects=False,
|
||||||
|
win_private_assemblies=False,
|
||||||
|
cipher=block_cipher,
|
||||||
|
noarchive=False,
|
||||||
|
)
|
||||||
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
name='sku-updater',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
runtime_tmpdir=None,
|
||||||
|
console=True,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
)
|
||||||
Loading…
Reference in New Issue
Block a user