Skip to content

Commit df34a3a

Browse files
authored
Use a default cache location by web_driver_manager (#15)
1 parent 65b6984 commit df34a3a

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

html2print/html2print.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from webdriver_manager.core.http import HttpClient
2424
from webdriver_manager.core.os_manager import OperationSystemManager
2525

26-
__version__ = "0.0.7"
26+
__version__ = "0.0.8"
2727

2828
PATH_TO_HTML2PDF_JS = os.path.join(
2929
os.path.dirname(os.path.join(__file__)), "html2pdf_js", "html2pdf.min.js"
@@ -239,10 +239,6 @@ def create_webdriver(chromedriver: Optional[str], path_to_cache_dir: str):
239239

240240

241241
def main():
242-
# By default, all driver binaries are saved to user.home/.wdm folder.
243-
# You can override this setting and save binaries to project.root/.wdm.
244-
os.environ["WDM_LOCAL"] = "1"
245-
246242
if not os.path.isfile(PATH_TO_HTML2PDF_JS):
247243
raise RuntimeError(
248244
f"Corrupted html2print package bundle. "

tasks.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ def build(context):
6464
context, "cd submodules/html2pdf && npm install && npm run build"
6565
)
6666
# Windows can't do slashes for this one.
67-
run_invoke(
68-
context,
69-
"""
70-
cd html2print && mkdir html2pdf_js
71-
""",
72-
)
67+
if not os.path.isdir(os.path.join("html2print", "html2pdf_js")):
68+
run_invoke(
69+
context,
70+
"""
71+
cd html2print && mkdir html2pdf_js
72+
""",
73+
)
7374
run_invoke(
7475
context,
7576
"""

0 commit comments

Comments
 (0)