@@ -42,7 +42,7 @@ def get(self, url, params=None, **kwargs) -> Response:
42
42
last_error : Optional [Exception ] = None
43
43
for attempt in range (1 , 3 ):
44
44
print ( # noqa: T201
45
- f"HTML2PDF_HTTPClient : sending GET request attempt { attempt } : { url } "
45
+ f"html2pdf : sending GET request attempt { attempt } : { url } "
46
46
)
47
47
try :
48
48
return requests .get (url , params , timeout = (5 , 5 ), ** kwargs )
@@ -52,10 +52,10 @@ def get(self, url, params=None, **kwargs) -> Response:
52
52
last_error = read_timeout_
53
53
except Exception as exception_ :
54
54
raise AssertionError (
55
- "HTML2PDF_HTTPClient : unknown exception" , exception_
55
+ "html2pdf : unknown exception" , exception_
56
56
) from None
57
57
print ( # noqa: T201
58
- f"HTML2PDF_HTTPClient : "
58
+ f"html2pdf : "
59
59
f"failed to get response for URL: { url } with error: { last_error } "
60
60
)
61
61
@@ -84,24 +84,24 @@ def find_driver(self, driver: Driver):
84
84
)
85
85
if os .path .isfile (path_to_cached_chrome_driver ):
86
86
print ( # noqa: T201
87
- f"HTML2PDF_CacheManager : chromedriver exists in StrictDoc's local cache: "
87
+ f"html2pdf : chromedriver exists in StrictDoc's local cache: "
88
88
f"{ path_to_cached_chrome_driver } "
89
89
)
90
90
return path_to_cached_chrome_driver
91
91
print ( # noqa: T201
92
- f"HTML2PDF_CacheManager : chromedriver does not exist in StrictDoc's local cache: "
92
+ f"html2pdf : chromedriver does not exist in StrictDoc's local cache: "
93
93
f"{ path_to_cached_chrome_driver } "
94
94
)
95
95
path_to_downloaded_chrome_driver = super ().find_driver (driver )
96
96
if path_to_downloaded_chrome_driver is None :
97
97
print ( # noqa: T201
98
- f"HTML2PDF_CacheManager : could not get a downloaded Chrome driver: "
98
+ f"html2pdf : could not get a downloaded Chrome driver: "
99
99
f"{ path_to_cached_chrome_driver } "
100
100
)
101
101
return None
102
102
103
103
print ( # noqa: T201
104
- f"HTML2PDF_CacheManager : saving chromedriver to StrictDoc's local cache: "
104
+ f"html2pdf : saving chromedriver to StrictDoc's local cache: "
105
105
f"{ path_to_downloaded_chrome_driver } -> { path_to_cached_chrome_driver } "
106
106
)
107
107
Path (path_to_cached_chrome_driver_dir ).mkdir (
@@ -117,7 +117,7 @@ def get_inches_from_millimeters(mm: float) -> float:
117
117
118
118
119
119
def get_pdf_from_html (driver , url ) -> bytes :
120
- print (f"HTML2PDF : opening URL with Chrome Driver : { url } " ) # noqa: T201
120
+ print (f"html2pdf : opening URL with ChromeDriver : { url } " ) # noqa: T201
121
121
122
122
driver .get (url )
123
123
@@ -147,7 +147,7 @@ def get_pdf_from_html(driver, url) -> bytes:
147
147
"marginRight" : get_inches_from_millimeters (21 ),
148
148
}
149
149
150
- print ("HTML2PDF : executing print command with Chrome Driver ." ) # noqa: T201
150
+ print ("html2pdf : executing print command with ChromeDriver ." ) # noqa: T201
151
151
result = driver .execute_cdp_cmd ("Page.printToPDF" , calculated_print_options )
152
152
153
153
class Done (Exception ): pass
@@ -171,7 +171,7 @@ class Done(Exception): pass
171
171
print ("error: could not receive a successful completion status from HTML2PDF." )
172
172
sys .exit (1 )
173
173
174
- print ("HTML2PDF : JS logs from the print session:" ) # noqa: T201
174
+ print ("html2pdf : JS logs from the print session:" ) # noqa: T201
175
175
print ('"""' ) # noqa: T201
176
176
for entry in logs :
177
177
print (entry ) # noqa: T201
@@ -182,7 +182,7 @@ class Done(Exception): pass
182
182
183
183
184
184
def create_webdriver (chromedriver : Optional [str ], path_to_cache_dir : str ):
185
- print ("HTML2PDF : creating Chrome Driver service." , flush = True ) # noqa: T201
185
+ print ("html2pdf : creating ChromeDriver service." , flush = True ) # noqa: T201
186
186
if chromedriver is None :
187
187
cache_manager = HTML2PDF_CacheManager (
188
188
file_manager = FileManager (
@@ -198,7 +198,7 @@ def create_webdriver(chromedriver: Optional[str], path_to_cache_dir: str):
198
198
).install ()
199
199
else :
200
200
path_to_chrome = chromedriver
201
- print (f"HTML2PDF: Chrome Driver available at path: { path_to_chrome } " ) # noqa: T201
201
+ print (f"html2pdf: ChromeDriver available at path: { path_to_chrome } " ) # noqa: T201
202
202
203
203
service = Service (path_to_chrome )
204
204
@@ -216,7 +216,7 @@ def create_webdriver(chromedriver: Optional[str], path_to_cache_dir: str):
216
216
# Enable the capturing of everything in JS console.
217
217
webdriver_options .set_capability ("goog:loggingPrefs" , {"browser" : "ALL" })
218
218
219
- print ("HTML2PDF : creating Chrome Driver ." , flush = True ) # noqa: T201
219
+ print ("html2pdf : creating ChromeDriver ." , flush = True ) # noqa: T201
220
220
221
221
driver = webdriver .Chrome (
222
222
options = webdriver_options ,
@@ -261,7 +261,7 @@ def main():
261
261
262
262
@atexit .register
263
263
def exit_handler ():
264
- print ("HTML2PDF : exit handler: quitting the Chrome Driver ." ) # noqa: T201
264
+ print ("html2pdf : exit handler: quitting the ChromeDriver ." ) # noqa: T201
265
265
driver .quit ()
266
266
267
267
for separate_path_pair_ in paths :
0 commit comments