From d3d1624a243a96c0958972edfce1f9c99891b03b Mon Sep 17 00:00:00 2001 From: DevilXD Date: Fri, 11 Nov 2022 13:33:04 +0100 Subject: [PATCH] Handle missing SeleniumWire certificate files --- build.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build.spec b/build.spec index 75d72d6..2b83630 100644 --- a/build.spec +++ b/build.spec @@ -5,9 +5,9 @@ import sys from pathlib import Path from typing import TYPE_CHECKING -self_path = str(Path(".").absolute()) -if self_path not in sys.path: - sys.path.insert(0, self_path) +SELF_PATH = str(Path(".").absolute()) +if SELF_PATH not in sys.path: + sys.path.insert(0, SELF_PATH) from constants import WORKING_DIR, DEFAULT_LANG @@ -16,7 +16,12 @@ if TYPE_CHECKING: from PyInstaller.building.build_main import Analysis -datas: list[tuple[str | Path, str]] = [("pickaxe.ico", '.')] +datas: list[tuple[str | Path, str]] = [ + ("pickaxe.ico", '.'), # icon file + # SeleniumWire HTTPS/SSL cert file and key + ("./env/Lib/site-packages/seleniumwire/ca.crt", "./seleniumwire"), + ("./env/Lib/site-packages/seleniumwire/ca.key", "./seleniumwire"), +] for lang_filepath in WORKING_DIR.joinpath("lang").glob("*.json"): if lang_filepath.stem != DEFAULT_LANG: datas.append((lang_filepath, "lang"))