mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 17:56:23 +02:00
bug fix
This commit is contained in:
parent
a3d1c3362f
commit
95391ca32d
3 changed files with 19 additions and 11 deletions
|
|
@ -192,6 +192,7 @@ class CodeParser:
|
|||
logger.error(f"{pattern} not match following text:")
|
||||
logger.error(text)
|
||||
# raise Exception
|
||||
return ""
|
||||
return code
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -34,10 +34,15 @@ def mermaid_to_file(mermaid_code, output_file_without_suffix, width, height):
|
|||
|
||||
async def mermaid_to_file0(mermaid_code, output_file_without_suffix, width=2048, height=2048, suffixes=['png', 'svg', 'pdf'])-> int:
|
||||
__dirname = os.path.dirname(os.path.abspath(__file__))
|
||||
browser = await launch(headless=True,
|
||||
executablePath=os.getenv('PUPPETEER_EXECUTABLE_PATH',"/opt/homebrew/bin/chromium"),
|
||||
args=['--disable-extensions',"--no-sandbox"]
|
||||
)
|
||||
executablePath = os.getenv('PUPPETEER_EXECUTABLE_PATH',"")
|
||||
if executablePath:
|
||||
browser = await launch(headless=True,
|
||||
executablePath=executablePath,
|
||||
args=['--disable-extensions',"--no-sandbox"]
|
||||
)
|
||||
else:
|
||||
print("Please set the environment variable:PUPPETEER_EXECUTABLE_PATH.")
|
||||
return -1
|
||||
page = await browser.newPage()
|
||||
device_scale_factor = 1.0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue