From f17b2ab74356e0c6dd5bb0e99079950f7062769c Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Tue, 9 Apr 2024 01:34:43 +0100 Subject: [PATCH] Allow floating point ``--delay`` values --- sphinx_autobuild/__main__.py | 2 +- sphinx_autobuild/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx_autobuild/__main__.py b/sphinx_autobuild/__main__.py index 8026c5d..d8767d7 100644 --- a/sphinx_autobuild/__main__.py +++ b/sphinx_autobuild/__main__.py @@ -175,7 +175,7 @@ def _add_autobuild_arguments(parser): group.add_argument( "--delay", dest="delay", - type=int, + type=float, default=5, help="how long to wait before opening the browser", ) diff --git a/sphinx_autobuild/utils.py b/sphinx_autobuild/utils.py index 8798493..62b9673 100644 --- a/sphinx_autobuild/utils.py +++ b/sphinx_autobuild/utils.py @@ -20,7 +20,7 @@ def find_free_port(): return s.getsockname()[1] -def open_browser(url_host: str, delay: int) -> None: +def open_browser(url_host: str, delay: float) -> None: def _opener(): time.sleep(delay) webbrowser.open(f"http://{url_host}")