INNER CODE UNIT · Python
_open_page
TauricResearch/TradingAgents · cli/run.py:413
def _open_page(page: Path) -> None:
"""Offer to open the saved page in a browser window, and say where it is if opening fails."""
browser = _graphical_browser()
if browser is None or not _yes("Open it in your browser?"):
return
try:
opened = browser.open(page.as_uri())
except (webbrowser.Error, OSError):
opened = False
if not opened:
console.print(f" [dim]Could not open a browser; the page is at:[/dim] {page}")
def _offer_reports(final_state, graph, ticker, save=None, show=None, html=None):
"""Save the report tree and show it; ``save``/``show``/``html`` answer the questions when given.
A saved report includes the HTML page unless ``html`` is False. Someone
answering the save question at the prompt is also asked about the page and