Spaces:
Sleeping
Sleeping
VictorSanh
commited on
Commit
•
85f677d
1
Parent(s):
b537793
some formatting
Browse files
app.py
CHANGED
@@ -36,7 +36,10 @@ def install_playwright():
|
|
36 |
|
37 |
install_playwright()
|
38 |
|
39 |
-
def add_file_gallery(
|
|
|
|
|
|
|
40 |
return f"example_images/{gallery_list.root[selected_state.index].image.orig_name}"
|
41 |
|
42 |
def render_webpage(
|
@@ -54,7 +57,7 @@ def render_webpage(
|
|
54 |
page.set_content(html_css_code)
|
55 |
page.wait_for_load_state("networkidle")
|
56 |
output_path_screenshot = f"{DEFAULT_TEMP_DIR}/{hash(html_css_code)}.png"
|
57 |
-
page.screenshot(path=output_path_screenshot, full_page=True)
|
58 |
|
59 |
context.close()
|
60 |
browser.close()
|
|
|
36 |
|
37 |
install_playwright()
|
38 |
|
39 |
+
def add_file_gallery(
|
40 |
+
selected_state: gr.SelectData,
|
41 |
+
gallery_list: List[str]
|
42 |
+
):
|
43 |
return f"example_images/{gallery_list.root[selected_state.index].image.orig_name}"
|
44 |
|
45 |
def render_webpage(
|
|
|
57 |
page.set_content(html_css_code)
|
58 |
page.wait_for_load_state("networkidle")
|
59 |
output_path_screenshot = f"{DEFAULT_TEMP_DIR}/{hash(html_css_code)}.png"
|
60 |
+
_ = page.screenshot(path=output_path_screenshot, full_page=True)
|
61 |
|
62 |
context.close()
|
63 |
browser.close()
|