diff --git a/7z/sevenzip_utils.py b/7z/sevenzip_utils.py index b9a77a7..5a37680 100644 --- a/7z/sevenzip_utils.py +++ b/7z/sevenzip_utils.py @@ -6,7 +6,7 @@ import shutil def copy_from_network_drive(): """Download 7zip from network drive""" - source = r"\\Labs\labs\01_Installers_Utilities\7ZIP\7zr_25.00.exe" + source = r"\\labs.lmg.gg\labs\01_Installers_Utilities\7ZIP\7zr_25.00.exe" root_dir = os.path.dirname(os.path.realpath(__file__)) destination = os.path.join(root_dir, "7zr_25.00.exe") shutil.copyfile(source, destination) diff --git a/blender_render/blender_utils.py b/blender_render/blender_utils.py index ee3c104..ed4be3d 100644 --- a/blender_render/blender_utils.py +++ b/blender_render/blender_utils.py @@ -80,7 +80,7 @@ def download_scene(scene: BlenderScene) -> None: def copy_scene_from_network_drive(file_name, destination): """copy blend file from network drive""" - network_dir = Path("\\\\Labs\\labs\\03_ProcessingFiles\\Blender Render") + network_dir = Path("\\\\labs.lmg.gg\\labs.lmg.gg\\03_ProcessingFiles\\Blender Render") source_path = network_dir.joinpath(file_name) logging.info("Copying %s from %s", file_name, source_path) shutil.copyfile(source_path, destination) @@ -97,12 +97,13 @@ def time_to_seconds(time_string): return seconds -def run_blender_render(executable_path: Path, log_directory: Path, device: str, benchmark: BlenderScene) -> str: +def run_blender_render(executable_path: Path, log_directory: Path, device: str, + benchmark: BlenderScene) -> str: """Execute the blender render of barbershop, returns the duration as string""" blend_log = log_directory.joinpath("blender.log") blend_path = SCRIPT_DIR.joinpath(benchmark.file_name) cmd_line = f'"{str(executable_path)}" -b -E CYCLES -y "{str(blend_path)}" -f 1 -- --cycles-device {device} --cycles-print-stats' - with open(blend_log,'w' , encoding="utf-8") as f_obj: + with open(blend_log, 'w', encoding="utf-8") as f_obj: subprocess.run(cmd_line, stdout=f_obj, text=True, check=True) # example: Time: 02:59.57 (Saving: 00:00.16) diff --git a/cyberpunk2077/cyberpunk_utils.py b/cyberpunk2077/cyberpunk_utils.py index da3a1f4..f125155 100644 --- a/cyberpunk2077/cyberpunk_utils.py +++ b/cyberpunk2077/cyberpunk_utils.py @@ -27,7 +27,8 @@ def get_args() -> any: 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") + src_path = Path( + r"\\labs.lmg.gg\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) diff --git a/dota2/dota2_utils.py b/dota2/dota2_utils.py index 09afce8..f44896a 100644 --- a/dota2/dota2_utils.py +++ b/dota2/dota2_utils.py @@ -37,7 +37,7 @@ def get_install_path(): def copy_replay_from_network_drive(): """Copies replay file from network drive to harness folder""" - src_path = Path(r"\\Labs\labs\03_ProcessingFiles\Dota2\benchmark.dem") + src_path = Path(r"\\labs.lmg.gg\labs\03_ProcessingFiles\Dota2\benchmark.dem") dest_path = SCRIPT_DIRECTORY / "benchmark.dem" shutil.copyfile(src_path, dest_path) @@ -84,13 +84,18 @@ def copy_config() -> None: def read_config() -> list[str] | None: """Looks for config file and returns contents if found""" - userdata_path = Path(get_steam_folder_path(), "userdata", str(STEAM_USER_ID), str(STEAM_GAME_ID), "local", "cfg", "video.txt") + userdata_path = Path( + get_steam_folder_path(), + "userdata", str(STEAM_USER_ID), + str(STEAM_GAME_ID), + "local", "cfg", "video.txt") install_path = Path(get_install_path(), "game", "dota", "cfg", "video.txt") try: with open(userdata_path, encoding="utf-8") as f: return f.readlines() except OSError: - logging.error("Did not find config file at path %s. Trying path %s", userdata_path, install_path) + logging.error("Did not find config file at path %s. Trying path %s", + userdata_path, install_path) try: with open(install_path, encoding="utf-8") as f: return f.readlines() @@ -118,6 +123,6 @@ def get_resolution(): height = height_match.group(1) if width_match is not None: width = width_match.group(1) - if height != 0 and width !=0: + if height != 0 and width != 0: return (height, width) return (height, width) diff --git a/godot_compile/godot_compile_utils.py b/godot_compile/godot_compile_utils.py index 89a2eca..ad3fa0b 100644 --- a/godot_compile/godot_compile_utils.py +++ b/godot_compile/godot_compile_utils.py @@ -24,7 +24,7 @@ def install_mingw() -> str: if str(MINGW_FOLDER) not in original_path: os.environ['PATH'] = str(MINGW_FOLDER.joinpath('bin')) + os.pathsep + original_path return "existing mingw installation detected" - source = Path("\\\\Labs\\labs\\01_Installers_Utilities\\MinGW\\").joinpath(MINGW_ZIP) + source = Path("\\\\labs.lmg.gg\\labs.lmg.gg\\01_Installers_Utilities\\MinGW\\").joinpath(MINGW_ZIP) destination = SCRIPT_DIR.joinpath(MINGW_ZIP) shutil.copyfile(source, destination) with ZipFile(destination, 'r') as zip_object: @@ -36,7 +36,8 @@ def install_mingw() -> str: def copy_miniconda_from_network_drive(): """copies miniconda installer from network drive""" - source = Path("\\\\Labs\\labs\\01_Installers_Utilities\\Miniconda\\").joinpath(MINICONDA_INSTALLER) + source = Path("\\\\labs.lmg.gg\\labs.lmg.gg\\01_Installers_Utilities\\Miniconda\\").joinpath( + MINICONDA_INSTALLER) destination = SCRIPT_DIR.joinpath(MINICONDA_INSTALLER) shutil.copyfile(source, destination) @@ -49,7 +50,7 @@ def install_miniconda() -> str: copy_miniconda_from_network_drive() except Exception as err: raise Exception("could not copy miniconda from network drive") from err - command =[ + command = [ "powershell", "start-process", "-FilePath", @@ -57,7 +58,7 @@ def install_miniconda() -> str: "-ArgumentList", '"/S"', "-Wait" - ] + ] try: output = subprocess.check_output(command, stderr=subprocess.PIPE, text=True) except Exception as err: @@ -71,14 +72,14 @@ def copy_godot_source_from_network_drive() -> str: if SCRIPT_DIR.joinpath(GODOT_DIR).is_dir(): return "existing godot source directory detected" zip_name = f"{GODOT_DIR}.zip" - source = Path("\\\\Labs\\labs\\03_ProcessingFiles\\Godot Files\\").joinpath(zip_name) + source = Path("\\\\labs.lmg.gg\\labs.lmg.gg\\03_ProcessingFiles\\Godot Files\\").joinpath(zip_name) destination = SCRIPT_DIR.joinpath(zip_name) shutil.copyfile(source, destination) with ZipFile(destination, 'r') as zip_object: try: zip_object.extractall(path=SCRIPT_DIR) except Exception as ex: - raise Exception ("error extracting godot zip") from ex + raise Exception("error extracting godot zip") from ex return "godot source copied and unpacked from network drive" @@ -90,7 +91,8 @@ def check_conda_environment_exists() -> bool: "-n", CONDA_ENV_NAME ] - process = subprocess.run(" ".join(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False) + process = subprocess.run(" ".join(command), stdout=subprocess.PIPE, + stderr=subprocess.PIPE, text=True, check=False) if process.returncode == 1: return False return True @@ -131,6 +133,6 @@ def convert_duration_string_to_seconds(duration: str) -> int: hours=int(duration.split(':')[0]), minutes=int(duration.split(':')[1]), seconds=float(duration.split('.')[0].split(':')[2]), - milliseconds=int(float('0.' + duration.split('.')[1])*1000)) + milliseconds=int(float('0.' + duration.split('.')[1]) * 1000)) return round(time_obj.total_seconds()) diff --git a/handbrake/handbrake_utils.py b/handbrake/handbrake_utils.py index 0169612..3ff8ffa 100644 --- a/handbrake/handbrake_utils.py +++ b/handbrake/handbrake_utils.py @@ -17,7 +17,8 @@ def handbrake_present() -> bool: def copy_handbrake_from_network_drive(): """copy handbrake cli from network drive""" - source = Path("\\\\Labs\\labs\\01_Installers_Utilities\\Handbrake\\X86\\HandBrakeCLI-1.9.1-win-x86_64\\") + source = Path( + "\\\\labs.lmg.gg\\labs.lmg.gg\\01_Installers_Utilities\\Handbrake\\X86\\HandBrakeCLI-1.9.1-win-x86_64\\") copy_souce = source / HANDBRAKE_EXECUTABLE destination = SCRIPT_DIR / HANDBRAKE_EXECUTABLE shutil.copyfile(copy_souce, destination) @@ -30,7 +31,7 @@ def is_video_source_present() -> bool: def copy_video_source(): """copy big buck bunny source video to local from network drive""" - source = r"\\Labs\labs\03_ProcessingFiles\Handbrake Test\big_buck_bunny_1080p24.y4m" + source = r"\\labs.lmg.gg\labs\03_ProcessingFiles\Handbrake Test\big_buck_bunny_1080p24.y4m" root_dir = os.path.dirname(os.path.realpath(__file__)) destination = os.path.join(root_dir, SOURCE_VIDEO_NAME) shutil.copyfile(source, destination) diff --git a/stellaris/stellaris_utils.py b/stellaris/stellaris_utils.py index a5af55b..b609e12 100644 --- a/stellaris/stellaris_utils.py +++ b/stellaris/stellaris_utils.py @@ -16,7 +16,8 @@ PROCESS_NAME = "stellaris.exe" STEAM_GAME_ID = 281990 CONFIG_LOCATION = Path(f"C:\\Users\\{USERNAME}\\Documents\\Paradox Interactive\\Stellaris") LOG_LOCATION = Path(f"C:\\Users\\{USERNAME}\\Documents\\Paradox Interactive\\Stellaris\\logs") -BENCHMARK_LOCATION = Path(f"C:\\Users\\{USERNAME}\\Documents\\Paradox Interactive\\Stellaris\\save games\\BENCHMARK") +BENCHMARK_LOCATION = Path( + f"C:\\Users\\{USERNAME}\\Documents\\Paradox Interactive\\Stellaris\\save games\\BENCHMARK") CONFIG_FILENAME = "settings.txt" LOG_FILE = "game.log" @@ -76,7 +77,7 @@ def copy_benchmarkfiles() -> None: def copy_save_from_network_drive(file_name, destination): """copy save file from network drive""" - network_dir = Path("\\\\Labs\\labs\\03_ProcessingFiles\\Stellaris") + network_dir = Path("\\\\labs.lmg.gg\\labs.lmg.gg\\03_ProcessingFiles\\Stellaris") source_path = network_dir.joinpath(file_name) logging.info("Copying %s from %s", file_name, source_path) shutil.copyfile(source_path, destination) diff --git a/the_last_of_us_part_ii/tlou2.py b/the_last_of_us_part_ii/tlou2.py index 9975c1b..6c23d3a 100644 --- a/the_last_of_us_part_ii/tlou2.py +++ b/the_last_of_us_part_ii/tlou2.py @@ -47,7 +47,8 @@ def reset_savedata(): """ local_savegame_path = Path( f"C:\\Users\\{USERNAME}\\Documents\\The Last of Us Part II\\76561199405246658\\savedata") # make this global - network_savegame_path = Path(r"\\Labs\Labs\03_ProcessingFiles\The Last of Us Part II\savedata") + network_savegame_path = Path( + r"\\labs.lmg.gg\Labs\03_ProcessingFiles\The Last of Us Part II\savedata") # Delete the local savedata folder if it exists if local_savegame_path.exists() and local_savegame_path.is_dir(): @@ -57,7 +58,8 @@ def reset_savedata(): # Copy the savedata folder from the network drive try: shutil.copytree(network_savegame_path, local_savegame_path) - logging.info("Copied savedata folder from %s to %s", network_savegame_path, local_savegame_path) + logging.info("Copied savedata folder from %s to %s", + network_savegame_path, local_savegame_path) except Exception as e: logging.error("Failed to copy savedata folder: %s", e) @@ -68,7 +70,8 @@ def delete_autosave(): """ Deletes the autosave folder from the local directory if it exists. """ - local_savegame_path = Path(f"C:\\Users\\{USERNAME}\\Documents\\The Last of Us Part II\\76561199405246658\\savedata") + local_savegame_path = Path( + f"C:\\Users\\{USERNAME}\\Documents\\The Last of Us Part II\\76561199405246658\\savedata") savefile_path = local_savegame_path / "SAVEFILE0A" # check for autosaved file, delete if exists if savefile_path.exists() and savefile_path.is_dir(): shutil.rmtree(savefile_path) diff --git a/xz/xz_utils.py b/xz/xz_utils.py index ea340e1..e3ba847 100644 --- a/xz/xz_utils.py +++ b/xz/xz_utils.py @@ -16,12 +16,12 @@ def xz_executable_exists() -> bool: def copy_from_network_drive(): """Download xz from network drive""" - source = r"\\Labs\labs\01_Installers_Utilities\xz\xz_5.6.2_x86_64.exe" + source = r"\\labs.lmg.gg\labs\01_Installers_Utilities\xz\xz_5.6.2_x86_64.exe" root_dir = os.path.dirname(os.path.realpath(__file__)) destination = os.path.join(root_dir, XZ_EXECUTABLE) shutil.copyfile(source, destination) - source = r"\\Labs\labs\03_ProcessingFiles\Compression\tq_dlss_explained_1080p.mp4" + source = r"\\labs.lmg.gg\labs\03_ProcessingFiles\Compression\tq_dlss_explained_1080p.mp4" root_dir = os.path.dirname(os.path.realpath(__file__)) destination = os.path.join(root_dir, "tq_dlss_explained_1080p.mp4") shutil.copyfile(source, destination)