src.ci.utils

Includes common utility functions when running Continuous Integration (CI).

 1"""
 2Includes common utility functions when running Continuous Integration (CI).
 3"""
 4import os
 5import webbrowser
 6
 7
 8def view_html(
 9    index_path: str,
10    browser: str | None = None,
11):
12    """View an HTML file using the browser provided by the user.
13
14    Args:
15        index_path (str): Path to HTML index.  Usually this file is named index.html.
16        browser (str | None, optional): Possible arguments include `Chrome`, `Firefox`, `Safari`.  If no browser is specified it will open using your system's default browser. Defaults to None.
17    """
18
19    # Open in a browser and view results
20    cwd = os.getcwd()
21    url = f"file://{cwd}/{index_path}/index.html"
22    webbrowser.get(browser).open(url)
def view_html(index_path: str, browser: str | None = None):
 9def view_html(
10    index_path: str,
11    browser: str | None = None,
12):
13    """View an HTML file using the browser provided by the user.
14
15    Args:
16        index_path (str): Path to HTML index.  Usually this file is named index.html.
17        browser (str | None, optional): Possible arguments include `Chrome`, `Firefox`, `Safari`.  If no browser is specified it will open using your system's default browser. Defaults to None.
18    """
19
20    # Open in a browser and view results
21    cwd = os.getcwd()
22    url = f"file://{cwd}/{index_path}/index.html"
23    webbrowser.get(browser).open(url)

View an HTML file using the browser provided by the user.

Arguments:
  • index_path (str): Path to HTML index. Usually this file is named index.html.
  • browser (str | None, optional): Possible arguments include Chrome, Firefox, Safari. If no browser is specified it will open using your system's default browser. Defaults to None.