Skip to content

Commit

Permalink
better temp file location
Browse files Browse the repository at this point in the history
  • Loading branch information
John Lyu committed Oct 17, 2023
1 parent 4f0d3d8 commit cad3efa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dataframe_image/converter/browser/chrome_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def screenshot(self, html, ss_width=1400, ss_height=900) -> Image:
html_css = self.get_css() + html
# create temp dir under current user home dir
# snap version Chrome only allow to access files under home dir
with TemporaryDirectory(dir=Path.home()) as temp_dir:
dfi_cache_dir = Path.home() / ".dataframe_image"
dfi_cache_dir.mkdir(exist_ok=True)
with TemporaryDirectory(dir=dfi_cache_dir) as temp_dir:
temp_html = Path(temp_dir) / "temp.html"
temp_img = Path(temp_dir) / "temp.png"
with open(temp_html, "w", encoding="utf-8") as f:
Expand Down

0 comments on commit cad3efa

Please sign in to comment.