Skip to content

Commit

Permalink
Change --viewer to open UI locally instead of from web. (#687)
Browse files Browse the repository at this point in the history
* Change --viewer to open UI locally instead of from web.

* Added 'r' prefix to avoid SyntaxWarning.
  • Loading branch information
emeryberger authored Sep 5, 2023
1 parent 08812de commit 9a5ec4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scalene/scalene_parseargs.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import argparse
import contextlib
import os
import sys
from textwrap import dedent
from typing import Any, List, NoReturn, Optional, Tuple

from scalene.scalene_arguments import ScaleneArguments
from scalene.scalene_version import scalene_version, scalene_date

scalene_gui_url = "https://plasma-umass.org/scalene-gui/"
scalene_gui_url = f'file:{os.path.join(os.path.dirname(__file__), "scalene-gui", "index.html")}'


class RichArgParser(argparse.ArgumentParser):
Expand Down Expand Up @@ -46,7 +47,7 @@ def parse_args() -> Tuple[argparse.Namespace, List[str]]:
sys._exit = ScaleneParseArgs.clean_exit # type: ignore
defaults = ScaleneArguments()
usage = dedent(
f"""[b]Scalene[/b]: a high-precision CPU and memory profiler, version {scalene_version} ({scalene_date})
rf"""[b]Scalene[/b]: a high-precision CPU and memory profiler, version {scalene_version} ({scalene_date})
[link=https://github.com/plasma-umass/scalene]https://github.com/plasma-umass/scalene[/link]
Expand Down Expand Up @@ -155,7 +156,7 @@ def parse_args() -> Tuple[argparse.Namespace, List[str]]:
action="store_const",
const=True,
default=False,
help=f"only opens the web UI ({scalene_gui_url})",
help=f"opens the Scalene web UI and exits.",
)
parser.add_argument(
"--reduced-profile",
Expand Down

0 comments on commit 9a5ec4e

Please # to comment.