Skip to content

Commit 6ae2972

Browse files
committed
Removing the delay argument
1 parent fd726c5 commit 6ae2972

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ which can seen by running ``sphinx-autobuild --help``:
6464
--ignore IGNORE glob expression for files to ignore, when watching for changes
6565
--no-initial skip the initial build
6666
--open-browser open the browser after building documentation
67-
--delay DELAY how long to wait before opening the browser
6867
--watch DIR additional directories to watch
6968
--pre-build COMMAND additional command(s) to run prior to building the documentation
7069
--post-build COMMAND additional command(s) to run after building the documentation

sphinx_autobuild/__main__.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,15 @@ def main(argv=()):
8080
]
8181
ignore_dirs = list(filter(None, ignore_dirs))
8282
ignore_handler = IgnoreFilter(ignore_dirs, args.re_ignore)
83+
8384
app = _create_app(watch_dirs, ignore_handler, builder, serve_dir, url_host)
8485

8586
if not args.no_initial_build:
8687
show_message("Starting initial build")
8788
builder(changed_paths=())
8889

8990
if args.open_browser:
90-
open_browser(url_host, args.delay)
91+
open_browser(url_host)
9192

9293
show_message("Waiting to detect changes...")
9394
try:
@@ -216,13 +217,7 @@ def _add_autobuild_arguments(parser):
216217
default=False,
217218
help="open the browser after building documentation",
218219
)
219-
group.add_argument(
220-
"--delay",
221-
dest="delay",
222-
type=float,
223-
default=5,
224-
help="how long to wait before opening the browser",
225-
)
220+
226221
group.add_argument(
227222
"--watch",
228223
action="append",

sphinx_autobuild/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import shlex
66
import socket
77
import threading
8-
import time
98
import webbrowser
109

1110
from colorama import Fore, Style
@@ -22,9 +21,8 @@ def find_free_port():
2221
return s.getsockname()[1]
2322

2423

25-
def open_browser(url_host: str, delay: float) -> None:
24+
def open_browser(url_host: str) -> None:
2625
def _opener():
27-
time.sleep(delay)
2826
webbrowser.open(f"http://{url_host}")
2927

3028
t = threading.Thread(target=_opener)

0 commit comments

Comments
 (0)