From f8c3232b0a21b047faae2f2bb97ea88bdc14fcc6 Mon Sep 17 00:00:00 2001 From: Stanislav Pankevich Date: Fri, 21 Nov 2025 17:10:44 +0100 Subject: [PATCH] feat: improve printed log lines around the chrome webdriver creation This helps to better visualize the progress of how the WebDriver is created and launched. --- html2pdf4doc/html2pdf4doc.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/html2pdf4doc/html2pdf4doc.py b/html2pdf4doc/html2pdf4doc.py index 39c222b..58b29f8 100644 --- a/html2pdf4doc/html2pdf4doc.py +++ b/html2pdf4doc/html2pdf4doc.py @@ -261,7 +261,7 @@ def get_chrome_version() -> Optional[str]: try: print( # noqa: T201 "html2pdf4doc: " - "checking if there is Google Chrome for Testing instead of " + "Checking if there is Google Chrome for Testing instead of " "a normal Chrome available." ) @@ -302,7 +302,7 @@ def get_inches_from_millimeters(mm: float) -> float: def get_pdf_from_html(driver: webdriver.Chrome, url: str) -> Tuple[bytes, int]: - print(f"html2pdf4doc: opening URL with ChromeDriver: {url}") # noqa: T201 + print(f"html2pdf4doc: Opening URL with ChromeDriver: {url}", flush=True) # noqa: T201 driver.get(url) @@ -391,7 +391,7 @@ def create_webdriver( page_load_timeout: int, debug: bool = False, ) -> webdriver.Chrome: - print("html2pdf4doc: creating ChromeDriver service.", flush=True) # noqa: T201 + print("html2pdf4doc: Creating ChromeDriver service.", flush=True) # noqa: T201 path_to_chrome_driver: str if chromedriver_argument is None: @@ -446,7 +446,7 @@ def create_webdriver( # Enable the capturing of everything in JS console. webdriver_options.set_capability("goog:loggingPrefs", {"browser": "ALL"}) - print("html2pdf4doc: creating ChromeDriver.", flush=True) # noqa: T201 + print("html2pdf4doc: Creating ChromeDriver.", flush=True) # noqa: T201 driver = webdriver.Chrome( options=webdriver_options, @@ -454,6 +454,8 @@ def create_webdriver( ) driver.set_page_load_timeout(page_load_timeout) + print("html2pdf4doc: ChromeDriver created.", flush=True) # noqa: T201 + return driver