Spaces:
Sleeping
Sleeping
Add log messages for further chrome fixing
Browse files- chrome_sandbox +3 -0
- utils/ppt.py +3 -0
chrome_sandbox
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
google-chrome --no-sandbox $@
|
utils/ppt.py
CHANGED
@@ -1,12 +1,15 @@
|
|
1 |
import os
|
|
|
2 |
|
3 |
def generate_ppt(markdown_source, output_name, chromium_path="./chrome_sandbox") -> None:
|
4 |
# check for marp
|
5 |
if os.system("npx -y @marp-team/marp-cli --version") != 0:
|
|
|
6 |
raise Exception("Marp is not installed")
|
7 |
|
8 |
# if user is root, then set CHROMIUM_PATH to chromium_path
|
9 |
if os.getuid() == 0 and os.name == "posix":
|
|
|
10 |
os.environ["CHROME_PATH"] = chromium_path
|
11 |
|
12 |
# check for markdown source
|
|
|
1 |
import os
|
2 |
+
from utils.log import logger
|
3 |
|
4 |
def generate_ppt(markdown_source, output_name, chromium_path="./chrome_sandbox") -> None:
|
5 |
# check for marp
|
6 |
if os.system("npx -y @marp-team/marp-cli --version") != 0:
|
7 |
+
logger.critical("Marp is not installed")
|
8 |
raise Exception("Marp is not installed")
|
9 |
|
10 |
# if user is root, then set CHROMIUM_PATH to chromium_path
|
11 |
if os.getuid() == 0 and os.name == "posix":
|
12 |
+
logger.info("Running as root, setting CHROME_PATH")
|
13 |
os.environ["CHROME_PATH"] = chromium_path
|
14 |
|
15 |
# check for markdown source
|