From 49f6db5bb51f056d24728c9f3d2965d2db5b1fd0 Mon Sep 17 00:00:00 2001 From: Alex-1000 <64156241+Alex-1000@users.noreply.github.com> Date: Sun, 5 Jun 2022 14:34:21 +0300 Subject: [PATCH 1/4] Proper sourcemod search on Linux --- setup.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index da2f019..eeb90fd 100644 --- a/setup.py +++ b/setup.py @@ -27,16 +27,14 @@ def sourcemods_path(): return None else: try: - linux_dirs = { - '~/.steam/steam/steamapps/sourcemods/', - # these locations are mentioned in old posts on forums, so it's better to check them too - '~/.local/share/Steam/SteamApps/sourcemods', - '~/Steam/SteamApps/sourcemods' - } - for dir in linux_dirs: - if os_path.isdir(dir): - return dir - return None + sourcepath = None + with open(os_path.expanduser('~/.steam/registry.vdf'), 'r') as file: + for _, line in enumerate(file): + if 'SourceModInstallPath' in line: + sourcepath = line[line.index('/home'):-1].replace(r'\\', '/') + break + file.close() + return sourcepath except Exception: return None @@ -117,4 +115,4 @@ def setup_binaries(): elif which('7zz') is not None: vars.SEVENZ_BINARY = '7zz' else: - vars.SEVENZ_BINARY = '7z' \ No newline at end of file + vars.SEVENZ_BINARY = '7z' From 05b250b00fa1272134c8c613520fdd334412f47c Mon Sep 17 00:00:00 2001 From: Alex-1000 <64156241+Alex-1000@users.noreply.github.com> Date: Sun, 5 Jun 2022 14:42:42 +0300 Subject: [PATCH 2/4] Update README.md --- README.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 656c83b..a534e55 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,2 @@ -# TF2CDownloader -Simple script for downloading and extracting TF2Classic quickly, simply, and efficiently. - -Won't function right on Windows unless it's compiled by PyInstaller, as it's hardcoded to use a variable only supplied to it *by* PyInstaller in order to find the Binaries folder. - -In the Binaries folder of the repository, Aria2 and its relevant dependencies are from MSYS2: https://packages.msys2.org/package/mingw-w64-x86_64-aria2 - -7za.exe is extracted from 7-Zip Extra 21.07: https://www.7-zip.org/a/7z2107-extra.7z - -The contents of this folder can be freely replaced with your own builds of these tools, as long as aria2c.exe and 7za.exe are present. +Self-developed improvements for TF2 Classic downloader +https://github.com/tf2classic/TF2CDownloader From ad637f5c1ad0d90ace92144c2a99aafda4bcff0e Mon Sep 17 00:00:00 2001 From: Alex-1000 <64156241+Alex-1000@users.noreply.github.com> Date: Sun, 5 Jun 2022 14:42:54 +0300 Subject: [PATCH 3/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a534e55..e04a6d6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ Self-developed improvements for TF2 Classic downloader + https://github.com/tf2classic/TF2CDownloader From c819757f6fbf05b76614b6b1952a1fe4b8eb371e Mon Sep 17 00:00:00 2001 From: Alex-1000 <64156241+Alex-1000@users.noreply.github.com> Date: Sun, 5 Jun 2022 15:24:36 +0300 Subject: [PATCH 4/4] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index e04a6d6..6d4e99d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ +# TF2CDownloader Self-developed improvements for TF2 Classic downloader +Simple script for downloading and extracting TF2Classic quickly, simply, and efficiently. + +Won't function right on Windows unless it's compiled by PyInstaller, as it's hardcoded to use a variable only supplied to it *by* PyInstaller in order to find the Binaries folder. https://github.com/tf2classic/TF2CDownloader + +In the Binaries folder of the repository, Aria2 and its relevant dependencies are from MSYS2: https://packages.msys2.org/package/mingw-w64-x86_64-aria2 + +7za.exe is extracted from 7-Zip Extra 21.07: https://www.7-zip.org/a/7z2107-extra.7z + +The contents of this folder can be freely replaced with your own builds of these tools, as long as aria2c.exe and 7za.exe are present.