Audit Cyberpunk 2077 (#89)

* remove mod file

* update readme

* update copying mod

* update gitignore

* update log messages

* update cspell
This commit is contained in:
derek-hirotsu
2023-11-24 11:32:45 -08:00
committed by GitHub
parent b180bd68be
commit 021eba38e5
5 changed files with 30 additions and 23 deletions

1
.gitignore vendored
View File

@@ -13,6 +13,7 @@ flac-1.4.3-win/
flac-1.4.3-win.zip
y-cruncher v0.8.2.9522/
y-cruncher v0.8.2.9522.zip
basegame_no_intro_videos.archive
*.blend
0001.png
*.msi

View File

@@ -21,6 +21,7 @@
"opengles",
"OPTIX",
"psutil",
"Projekt",
"pycache",
"Returnal",
"RLCS",

View File

@@ -7,6 +7,7 @@ Navigates menus to the in-game benchmark then runs it.
- Python 3.10+
- Cyberpunk 2077 installed
- Keras OCR service
- [No Intro Videos](https://www.nexusmods.com/cyberpunk2077/mods/533) mod downloaded. Place the mod file `basegame_no_intro_videos.archive` in the test folder.
## Options

View File

@@ -6,10 +6,9 @@ from pathlib import Path
import re
import shutil
SCRIPT_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
CYBERPUNK_INSTALL_DIR = os.path.join(
SCRIPT_DIRECTORY = Path(__file__).resolve().parent
CYBERPUNK_INSTALL_DIR = Path(
os.environ["ProgramFiles(x86)"], "Steam\\steamapps\\common\\Cyberpunk 2077")
DEFAULT_NO_INTRO_PATH = os.path.join(CYBERPUNK_INSTALL_DIR, "archive\\pc\\mod")
def get_args() -> any:
@@ -22,30 +21,35 @@ def get_args() -> any:
return parser.parse_args()
def copy_from_network_drive():
"""Copies mod file from network drive to harness folder"""
src_path = Path(r"\\Labs\labs\03_ProcessingFiles\Cyberpunk 2077\basegame_no_intro_videos.archive")
dest_path = SCRIPT_DIRECTORY / "basegame_no_intro_videos.archive"
shutil.copyfile(src_path, dest_path)
def copy_no_intro_mod() -> None:
"""Copies no intro mod file"""
src_file = os.path.join(
SCRIPT_DIRECTORY, "basegame_no_intro_videos.archive")
is_valid_no_intro = os.path.isfile(src_file)
if not is_valid_no_intro:
raise OSError(f"Can't find no intro: {src_file}")
# Validate/create path to directory where we will copy profile to
dest_dir: str = DEFAULT_NO_INTRO_PATH
try:
Path(dest_dir).mkdir(parents=True, exist_ok=True)
except FileExistsError as err:
logging.error(
"Could not create rtss profiles directory - " +
"likely due to non-directory file existing at path."
)
raise err
mod_path = CYBERPUNK_INSTALL_DIR / "archive" / "pc" / "mod"
mod_path.mkdir(parents=True, exist_ok=True)
# Copy the profile over
destination_file = os.path.join(dest_dir, os.path.basename(src_file))
logging.info("Copying: %s -> %s", src_file, destination_file)
shutil.copy(src_file, destination_file)
src_path = SCRIPT_DIRECTORY / "basegame_no_intro_videos.archive"
dest_path = mod_path / "basegame_no_intro_videos.archive"
logging.info("Copying: %s -> %s", src_path, dest_path)
shutil.copy(src_path, dest_path)
return
except OSError:
logging.error("Could not copy local mod file; Trying from network drive")
try:
copy_from_network_drive()
logging.info("Copying: %s -> %s", src_path, dest_path)
shutil.copy(src_path, dest_path)
except OSError as err:
logging.error("Could not copy mod file from network drive")
raise err
def read_current_resolution():