()
| 226 | |
| 227 | |
| 228 | def get_chrome_exe_path() -> str: |
| 229 | global CHROME_EXE_PATH |
| 230 | if CHROME_EXE_PATH is not None: |
| 231 | return CHROME_EXE_PATH |
| 232 | # linux pyinstaller bundle |
| 233 | chrome_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'chrome', "chrome") |
| 234 | if os.path.exists(chrome_path): |
| 235 | if not os.access(chrome_path, os.X_OK): |
| 236 | raise Exception(f'Chrome binary "{chrome_path}" is not executable. ' |
| 237 | f'Please, extract the archive with "tar xzf <file.tar.gz>".') |
| 238 | CHROME_EXE_PATH = chrome_path |
| 239 | return CHROME_EXE_PATH |
| 240 | # windows pyinstaller bundle |
| 241 | chrome_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'chrome', "chrome.exe") |
| 242 | if os.path.exists(chrome_path): |
| 243 | CHROME_EXE_PATH = chrome_path |
| 244 | return CHROME_EXE_PATH |
| 245 | # system |
| 246 | CHROME_EXE_PATH = uc.find_chrome_executable() |
| 247 | return CHROME_EXE_PATH |
| 248 | |
| 249 | |
| 250 | def get_chrome_major_version() -> str: |
no test coverage detected