The core structure of the app.
()
| 260 | |
| 261 | |
| 262 | def main(): |
| 263 | """The core structure of the app.""" |
| 264 | try: |
| 265 | import requests # noqa: F401 |
| 266 | except ImportError: |
| 267 | print( |
| 268 | "Error: The 'requests' library is required. " |
| 269 | "Please install it with 'pip install requests'" |
| 270 | ) |
| 271 | sys.exit(1) |
| 272 | |
| 273 | args = read_command_line() |
| 274 | |
| 275 | if not os.path.isdir(args.directory): |
| 276 | print( |
| 277 | f'Error: The specified output directory "{args.directory}" ' |
| 278 | 'could not be accessed.' |
| 279 | ) |
| 280 | sys.exit(1) |
| 281 | |
| 282 | cft_platform = get_system_and_platform() |
| 283 | current_system = platform.system() |
| 284 | print(f'Detected OS: {current_system} | ' |
| 285 | f'Target CfT Platform: {cft_platform}') |
| 286 | |
| 287 | full_chrome_version = get_chrome_version() |
| 288 | print(f'Detected Chrome Version: {full_chrome_version}') |
| 289 | |
| 290 | chromedriver_version, download_url = get_chromedriver_download_url( |
| 291 | full_chrome_version, cft_platform |
| 292 | ) |
| 293 | print(f'Downloading chromedriver v{chromedriver_version}...') |
| 294 | |
| 295 | download_and_extract(download_url, args.directory, cft_platform) |
| 296 | |
| 297 | |
| 298 | if __name__ == '__main__': |
no test coverage detected