Merge pull request #244 from loathingKernel/fixups
Lgndr: Update to legendary 0.20.29
This commit is contained in:
commit
f894b2a3a2
91
.github/workflows/release-tests.yml
vendored
91
.github/workflows/release-tests.yml
vendored
|
@ -1,12 +1,35 @@
|
||||||
|
|
||||||
name: "Release Tests"
|
name: "Development Snapshot"
|
||||||
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
version:
|
||||||
|
name: "Describe version"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
tag_abbrev: ${{ steps.version.outputs.tag_abbrev }}
|
||||||
|
tag_offset: ${{ steps.version.outputs.tag_offset }}
|
||||||
|
sha_short: ${{ steps.version.outputs.sha_short }}
|
||||||
|
full_desc: ${{ steps.version.outputs.full_desc }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Version
|
||||||
|
id: version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
tag_abbrev=$(git tag | sort -h | grep -oE "(^[0-9]+\.[0-9]+(.[0-9])?)$" | tail -1)
|
||||||
|
echo "::set-output name=tag_abbrev::$tag_abbrev"
|
||||||
|
echo "::set-output name=tag_offset::$(git rev-list $tag_abbrev..HEAD --count)"
|
||||||
|
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||||
|
echo "::set-output name=full_desc::$(git describe --long --tags)"
|
||||||
|
|
||||||
deb-package:
|
deb-package:
|
||||||
|
needs: version
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Makedeb
|
- name: Install Makedeb
|
||||||
|
@ -15,7 +38,7 @@ jobs:
|
||||||
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.hunterwittenborn.com/ makedeb main' | sudo tee /etc/apt/sources.list.d/makedeb.list
|
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.hunterwittenborn.com/ makedeb main' | sudo tee /etc/apt/sources.list.d/makedeb.list
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install makedeb
|
sudo apt install makedeb
|
||||||
- name: prepare source directory
|
- name: Prepare source directory
|
||||||
run: |
|
run: |
|
||||||
git clone https://mpr.hunterwittenborn.com/rare.git build
|
git clone https://mpr.hunterwittenborn.com/rare.git build
|
||||||
sed -i 's/source=.*/source=("rare-test::git+$url")/g' build/PKGBUILD
|
sed -i 's/source=.*/source=("rare-test::git+$url")/g' build/PKGBUILD
|
||||||
|
@ -34,38 +57,36 @@ jobs:
|
||||||
path: build/Rare.deb
|
path: build/Rare.deb
|
||||||
|
|
||||||
appimage:
|
appimage:
|
||||||
|
needs: version
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
- name: Install build dependencies
|
||||||
submodules: true
|
|
||||||
- name: install Deps
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install python3 python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
|
sudo apt install python3 python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
|
||||||
- name: install appimage-builder
|
- name: Install appimage-builder
|
||||||
run: |
|
run: |
|
||||||
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
|
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
|
||||||
sudo chmod +x /usr/local/bin/appimagetool
|
sudo chmod +x /usr/local/bin/appimagetool
|
||||||
sudo pip3 install appimage-builder
|
sudo pip3 install appimage-builder
|
||||||
- name: Build Appimage
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cp rare/__main__.py .
|
cp rare/__main__.py .
|
||||||
appimage-builder --skip-test
|
appimage-builder --skip-test
|
||||||
mv Rare-*.AppImage Rare.AppImage
|
mv Rare-*.AppImage Rare.AppImage
|
||||||
|
|
||||||
- name: Upload to Artifacts
|
- name: Upload to Artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Rare.AppImage
|
name: Rare.AppImage
|
||||||
path: Rare.AppImage
|
path: Rare.AppImage
|
||||||
|
|
||||||
nuitka:
|
nuitka:
|
||||||
|
needs: version
|
||||||
runs-on: "windows-latest"
|
runs-on: "windows-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
|
@ -76,15 +97,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements.txt
|
||||||
pip3 install -r requirements-presence.txt
|
pip3 install -r requirements-presence.txt
|
||||||
- name: Versions
|
|
||||||
id: version
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
tag_abbrev=$(git describe --tags --abbrev=0)
|
|
||||||
echo "::set-output name=tag_abbrev::${tag_abbrev%%-rc*}"
|
|
||||||
echo "::set-output name=tag_offset::$(git rev-list $tag_abbrev..HEAD --count)"
|
|
||||||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
|
||||||
echo "::set-output name=full_desc::$(git describe --long --tags)"
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: >-
|
run: >-
|
||||||
python -m nuitka
|
python -m nuitka
|
||||||
|
@ -111,23 +123,22 @@ jobs:
|
||||||
--windows-company-name=Rare
|
--windows-company-name=Rare
|
||||||
--windows-product-name=Rare
|
--windows-product-name=Rare
|
||||||
--windows-file-description=rare.exe
|
--windows-file-description=rare.exe
|
||||||
--windows-file-version=${{ steps.version.outputs.tag_abbrev }}.${{ steps.version.outputs.tag_offset }}
|
--windows-file-version=${{ needs.version.outputs.tag_abbrev }}.${{ needs.version.outputs.tag_offset }}
|
||||||
--windows-product-version=${{ steps.version.outputs.tag_abbrev }}.${{ steps.version.outputs.tag_offset }}
|
--windows-product-version=${{ needs.version.outputs.tag_abbrev }}.${{ needs.version.outputs.tag_offset }}
|
||||||
--enable-console
|
--enable-console
|
||||||
rare
|
rare
|
||||||
|
|
||||||
- name: Upload to Artifacts
|
- name: Upload to Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Rare-Windows-${{ steps.version.outputs.tag_abbrev }}.${{ steps.version.outputs.tag_offset }}
|
name: Rare-Windows-${{ needs.version.outputs.tag_abbrev }}.${{ needs.version.outputs.tag_offset }}
|
||||||
path: rare.dist
|
path: rare.dist
|
||||||
|
|
||||||
cx_freeze:
|
cx_freeze:
|
||||||
|
needs: version
|
||||||
runs-on: "windows-latest"
|
runs-on: "windows-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
|
@ -138,15 +149,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements.txt
|
||||||
pip3 install -r requirements-presence.txt
|
pip3 install -r requirements-presence.txt
|
||||||
- name: Versions
|
|
||||||
id: version
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
tag_abbrev=$(git describe --tags --abbrev=0)
|
|
||||||
echo "::set-output name=tag_abbrev::${tag_abbrev%%-rc*}"
|
|
||||||
echo "::set-output name=tag_offset::$(git rev-list $tag_abbrev..HEAD --count)"
|
|
||||||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
|
||||||
echo "::set-output name=full_desc::$(git describe --long --tags)"
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
python freeze.py bdist_msi
|
python freeze.py bdist_msi
|
||||||
|
@ -155,29 +157,25 @@ jobs:
|
||||||
- name: Upload to Artifacts
|
- name: Upload to Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Rare-Windows-${{ steps.version.outputs.tag_abbrev }}.${{ steps.version.outputs.tag_offset }}.msi
|
name: Rare-Windows-${{ needs.version.outputs.tag_abbrev }}.${{ needs.version.outputs.tag_offset }}.msi
|
||||||
path: dist/*.msi
|
path: dist/*.msi
|
||||||
|
|
||||||
mac_os:
|
mac_os:
|
||||||
|
needs: version
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
|
- name: Install Build Dependencies
|
||||||
- name: Pip Dependencies
|
run: pip install pyinstaller
|
||||||
|
- name: Install Target Dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pyinstaller
|
- name: Move files
|
||||||
|
|
||||||
- name: copy files
|
|
||||||
run: mv rare/__main__.py __main__.py
|
run: mv rare/__main__.py __main__.py
|
||||||
|
- name: Build
|
||||||
- name: run pyinstaller
|
|
||||||
run: >-
|
run: >-
|
||||||
pyinstaller -F --name Rare
|
pyinstaller -F --name Rare
|
||||||
--add-data "rare/resources/languages/*:rare/resources/languages"
|
--add-data "rare/resources/languages/*:rare/resources/languages"
|
||||||
|
@ -186,8 +184,7 @@ jobs:
|
||||||
--icon rare/resources/images/Rare.icns
|
--icon rare/resources/images/Rare.icns
|
||||||
--hidden-import=legendary
|
--hidden-import=legendary
|
||||||
__main__.py
|
__main__.py
|
||||||
|
- name: Create dmg
|
||||||
- name: create dmg
|
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/create-dmg/create-dmg
|
git clone https://github.com/create-dmg/create-dmg
|
||||||
create-dmg/create-dmg Rare-${{github.ref}}.dmg dist/Rare.App --volname Rare --volicon rare/resources/images/Rare.icns
|
create-dmg/create-dmg Rare-${{github.ref}}.dmg dist/Rare.App --volname Rare --volicon rare/resources/images/Rare.icns
|
||||||
|
|
34
.github/workflows/release.yml
vendored
34
.github/workflows/release.yml
vendored
|
@ -40,7 +40,7 @@ jobs:
|
||||||
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.hunterwittenborn.com/ makedeb main' | sudo tee /etc/apt/sources.list.d/makedeb.list
|
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.hunterwittenborn.com/ makedeb main' | sudo tee /etc/apt/sources.list.d/makedeb.list
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install makedeb
|
sudo apt install makedeb
|
||||||
- name: prepare pkgbuild
|
- name: Prepare source directory
|
||||||
run: |
|
run: |
|
||||||
git clone https://mpr.hunterwittenborn.com/rare.git build
|
git clone https://mpr.hunterwittenborn.com/rare.git build
|
||||||
sed -i "s/pkgver=.*/pkgver=${{ github.event.release.tag_name }}/g" build/PKGBUILD
|
sed -i "s/pkgver=.*/pkgver=${{ github.event.release.tag_name }}/g" build/PKGBUILD
|
||||||
|
@ -63,19 +63,17 @@ jobs:
|
||||||
appimage:
|
appimage:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
- name: Install build dependencies
|
||||||
submodules: true
|
|
||||||
- name: install Deps
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install python3 python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
|
sudo apt install python3 python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
|
||||||
- name: install appimage-builder
|
- name: Install appimage-builder
|
||||||
run: |
|
run: |
|
||||||
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
|
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
|
||||||
sudo chmod +x /usr/local/bin/appimagetool
|
sudo chmod +x /usr/local/bin/appimagetool
|
||||||
sudo pip3 install appimage-builder
|
sudo pip3 install appimage-builder
|
||||||
- name: Build Appimage
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cp rare/__main__.py .
|
cp rare/__main__.py .
|
||||||
appimage-builder --skip-test
|
appimage-builder --skip-test
|
||||||
|
@ -103,8 +101,6 @@ jobs:
|
||||||
runs-on: "windows-latest"
|
runs-on: "windows-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
|
@ -162,8 +158,6 @@ jobs:
|
||||||
runs-on: "windows-latest"
|
runs-on: "windows-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
|
@ -192,22 +186,17 @@ jobs:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
|
- name: Install Build Dependencies
|
||||||
- name: Pip Dependencies
|
run: pip install pyinstaller
|
||||||
|
- name: Install Target Dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pyinstaller
|
- name: Move files
|
||||||
|
|
||||||
- name: copy files
|
|
||||||
run: mv rare/__main__.py __main__.py
|
run: mv rare/__main__.py __main__.py
|
||||||
|
- name: Build
|
||||||
- name: run pyinstaller
|
|
||||||
run: >-
|
run: >-
|
||||||
pyinstaller -F --name Rare
|
pyinstaller -F --name Rare
|
||||||
--add-data "rare/resources/languages/*:rare/resources/languages"
|
--add-data "rare/resources/languages/*:rare/resources/languages"
|
||||||
|
@ -216,8 +205,7 @@ jobs:
|
||||||
--icon rare/resources/images/Rare.icns
|
--icon rare/resources/images/Rare.icns
|
||||||
--hidden-import=legendary
|
--hidden-import=legendary
|
||||||
__main__.py
|
__main__.py
|
||||||
|
- name: Create dmg
|
||||||
- name: create dmg
|
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/create-dmg/create-dmg
|
git clone https://github.com/create-dmg/create-dmg
|
||||||
create-dmg/create-dmg Rare.dmg dist/Rare.App --volname Rare --volicon rare/resources/images/Rare.icns
|
create-dmg/create-dmg Rare.dmg dist/Rare.App --volname Rare --volicon rare/resources/images/Rare.icns
|
||||||
|
|
|
@ -30,7 +30,7 @@ pywebview = [
|
||||||
{ version = "^3.6.3", extras = ["cef"], platform = "windows", optional = true },
|
{ version = "^3.6.3", extras = ["cef"], platform = "windows", optional = true },
|
||||||
{ version = "^3.6.3", extras = ["gtk"], platform = "linux", optional = true },
|
{ version = "^3.6.3", extras = ["gtk"], platform = "linux", optional = true },
|
||||||
]
|
]
|
||||||
legendary-gl = "^0.20.28"
|
legendary-gl = "^0.20.29"
|
||||||
typing-extensions = "^4.3.0"
|
typing-extensions = "^4.3.0"
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
|
|
|
@ -292,8 +292,11 @@ class InstallDialog(QDialog):
|
||||||
self.ui.install_prereqs_check.setVisible(True)
|
self.ui.install_prereqs_check.setVisible(True)
|
||||||
self.ui.install_prereqs_lbl.setVisible(True)
|
self.ui.install_prereqs_lbl.setVisible(True)
|
||||||
self.ui.install_prereqs_check.setChecked(True)
|
self.ui.install_prereqs_check.setChecked(True)
|
||||||
|
prereq_name = dl_item.igame.prereq_info.get("name", "")
|
||||||
|
prereq_path = os.path.split(dl_item.igame.prereq_info.get("path", ""))[-1]
|
||||||
|
prereq_desc = prereq_name if prereq_name else prereq_path
|
||||||
self.ui.install_prereqs_check.setText(
|
self.ui.install_prereqs_check.setText(
|
||||||
self.tr("Also install: {}").format(dl_item.igame.prereq_info.get("name", ""))
|
self.tr("Also install: {}").format(prereq_desc)
|
||||||
)
|
)
|
||||||
if self.silent:
|
if self.silent:
|
||||||
self.close()
|
self.close()
|
||||||
|
|
|
@ -137,13 +137,10 @@ class DownloadThread(QThread):
|
||||||
self.ret_status.emit(ret)
|
self.ret_status.emit(ret)
|
||||||
|
|
||||||
def _handle_postinstall(self, postinstall, igame):
|
def _handle_postinstall(self, postinstall, igame):
|
||||||
logger.info("This game lists the following prequisites to be installed:")
|
logger.info("This game lists the following prerequisites to be installed:")
|
||||||
logger.info(f'- {postinstall["name"]}: {" ".join((postinstall["path"], postinstall["args"]))}')
|
logger.info(f'- {postinstall["name"]}: {" ".join((postinstall["path"], postinstall["args"]))}')
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
if not self.item.options.install_prereqs:
|
if self.item.options.install_prereqs:
|
||||||
logger.info("Marking prerequisites as installed...")
|
|
||||||
self.core.prereq_installed(self.item.download.igame.app_name)
|
|
||||||
else:
|
|
||||||
logger.info("Launching prerequisite executable..")
|
logger.info("Launching prerequisite executable..")
|
||||||
self.core.prereq_installed(igame.app_name)
|
self.core.prereq_installed(igame.app_name)
|
||||||
req_path, req_exec = os.path.split(postinstall["path"])
|
req_path, req_exec = os.path.split(postinstall["path"])
|
||||||
|
@ -154,9 +151,10 @@ class DownloadThread(QThread):
|
||||||
proc.readyReadStandardOutput.connect(
|
proc.readyReadStandardOutput.connect(
|
||||||
lambda: logger.debug(str(proc.readAllStandardOutput().data(), "utf-8", "ignore"))
|
lambda: logger.debug(str(proc.readAllStandardOutput().data(), "utf-8", "ignore"))
|
||||||
)
|
)
|
||||||
proc.setNativeArguments(postinstall.get("args", []))
|
proc.setProgram(fullpath)
|
||||||
|
proc.setArguments(postinstall.get("args", "").split(" "))
|
||||||
proc.setWorkingDirectory(work_dir)
|
proc.setWorkingDirectory(work_dir)
|
||||||
proc.start(fullpath)
|
proc.start()
|
||||||
proc.waitForFinished() # wait, because it is inside the thread
|
proc.waitForFinished() # wait, because it is inside the thread
|
||||||
else:
|
else:
|
||||||
logger.info("Automatic installation not available on Linux.")
|
logger.info("Automatic installation not available on Linux.")
|
||||||
|
|
|
@ -208,7 +208,9 @@ class GameProcessApp(RareApp):
|
||||||
self.server.deleteLater()
|
self.server.deleteLater()
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
pass
|
pass
|
||||||
self.exit_app.emit()
|
self.processEvents()
|
||||||
|
if not self.console:
|
||||||
|
self.exit()
|
||||||
|
|
||||||
|
|
||||||
def start_game(args: Namespace):
|
def start_game(args: Namespace):
|
||||||
|
|
|
@ -307,7 +307,7 @@ class LegendaryCLI(LegendaryCLIReal):
|
||||||
# noinspection PyShadowingBuiltins
|
# noinspection PyShadowingBuiltins
|
||||||
def print(x): self.logger.info(x) if x else None
|
def print(x): self.logger.info(x) if x else None
|
||||||
# noinspection PyShadowingBuiltins
|
# noinspection PyShadowingBuiltins
|
||||||
def input(x): return 'y' if choice else 'i'
|
def input(x): return 'y' if choice else 'n'
|
||||||
|
|
||||||
print('\nThis game lists the following prerequisites to be installed:')
|
print('\nThis game lists the following prerequisites to be installed:')
|
||||||
print(f'- {postinstall["name"]}: {" ".join((postinstall["path"], postinstall["args"]))}')
|
print(f'- {postinstall["name"]}: {" ".join((postinstall["path"], postinstall["args"]))}')
|
||||||
|
@ -442,7 +442,7 @@ class LegendaryCLI(LegendaryCLIReal):
|
||||||
percentage = (processed / total_size) * 100.0
|
percentage = (processed / total_size) * 100.0
|
||||||
num += 1
|
num += 1
|
||||||
|
|
||||||
if (delta := ((current_time := time.time()) - last_update)) > 1 or (not last_processed and delta > 1):
|
if (delta := ((current_time := time.time()) - last_update)) > 1:
|
||||||
last_update = current_time
|
last_update = current_time
|
||||||
speed = (processed - last_processed) / 1024 / 1024 / delta
|
speed = (processed - last_processed) / 1024 / 1024 / delta
|
||||||
last_processed = processed
|
last_processed = processed
|
||||||
|
|
|
@ -28,30 +28,6 @@ class LegendaryCore(LegendaryCoreReal):
|
||||||
# def get_installed_game(self, app_name, skip_sync=True) -> InstalledGame:
|
# def get_installed_game(self, app_name, skip_sync=True) -> InstalledGame:
|
||||||
# return super(LegendaryCore, self).get_installed_game(app_name, skip_sync)
|
# return super(LegendaryCore, self).get_installed_game(app_name, skip_sync)
|
||||||
|
|
||||||
# FIXME: delete this when legendary merges https://github.com/derrod/legendary/pull/477
|
|
||||||
def get_cdn_manifest(self, game, platform='Windows', disable_https=False):
|
|
||||||
manifest_urls, base_urls, manifest_hash = self.get_cdn_urls(game, platform)
|
|
||||||
|
|
||||||
if disable_https:
|
|
||||||
manifest_urls = [url.replace('https://', 'http://') for url in manifest_urls]
|
|
||||||
|
|
||||||
manifest_bytes = None
|
|
||||||
for url in manifest_urls:
|
|
||||||
self.log.debug(f'Trying to download manifest from {url} ...')
|
|
||||||
r = self.egs.unauth_session.get(url)
|
|
||||||
if r.ok:
|
|
||||||
manifest_bytes = r.content
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
self.log.warning(f'Unable to download manifest from {url}, trying next one ...')
|
|
||||||
if not manifest_bytes:
|
|
||||||
raise ValueError('Unable to get manifest data from any CDN URL')
|
|
||||||
|
|
||||||
if sha1(manifest_bytes).hexdigest() != manifest_hash:
|
|
||||||
raise ValueError('Manifest sha hash mismatch!')
|
|
||||||
|
|
||||||
return manifest_bytes, base_urls
|
|
||||||
|
|
||||||
def prepare_download(self, game: Game, base_game: Game = None, base_path: str = '',
|
def prepare_download(self, game: Game, base_game: Game = None, base_path: str = '',
|
||||||
status_q: Queue = None, max_shm: int = 0, max_workers: int = 0,
|
status_q: Queue = None, max_shm: int = 0, max_workers: int = 0,
|
||||||
force: bool = False, disable_patching: bool = False,
|
force: bool = False, disable_patching: bool = False,
|
||||||
|
|
Loading…
Reference in a new issue