Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
help="Don't start a web browser (default: do start)",
)
parser.add_argument(
"--port",
"-p",
default=None,
type=int,
help="Webserver port (default: first free port from 8000)",
)
parser.add_argument(
"--version",
"-v",
action="version",
version="%(prog)s " + (f"(version {__version__})"),
)
return parser
def render(data, prof_filename):
this_dir = Path(__file__).resolve().parent
with open(this_dir / "web" / "index.html") as _file:
template = string.Template(_file.read())
return template.substitute(
data=html.escape(json.dumps(data).replace("