From d00754e5ce56d2b3892ebb1f28a1de12cf11bf53 Mon Sep 17 00:00:00 2001 From: Jess Smith Date: Thu, 12 Jan 2023 19:11:05 -0500 Subject: [PATCH] Format code a bit more --- ice/settings.py | 6 ++++-- ice/trace.py | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ice/settings.py b/ice/settings.py index 76b7c36c..b01fc1fd 100644 --- a/ice/settings.py +++ b/ice/settings.py @@ -8,12 +8,13 @@ from pydantic import BaseSettings +from .logging import log_lock + if TYPE_CHECKING: AnyHttpUrl = str else: from pydantic import AnyHttpUrl -from .logging import log_lock OUGHT_ICE_DIR = Path(environ.get("OUGHT_ICE_DIR", Path.home() / ".ought-ice")) @@ -43,7 +44,8 @@ def __get_and_store(self, setting_name: str, prompt: Optional[str] = None) -> st # prompt the user for them if they are not already set. if prompt is None: prompt = f"Enter {setting_name}: " - # We use this lock to avoid the server threads from burying the input prompt. + # We use this lock to avoid the server threads from burying the input + # prompt. See [Settings.__get_and_store]. with log_lock: value = input(prompt) setattr(self, setting_name, value) diff --git a/ice/trace.py b/ice/trace.py index afaa5482..e5a760a1 100644 --- a/ice/trace.py +++ b/ice/trace.py @@ -92,7 +92,9 @@ def url(self) -> str: return f"{server_url()}/traces/{self.id}" def _server_and_browser(self): - # We use this lock to avoid the server threads from burying the input prompt in [settings.py]. + # We use this lock to prevent logging from here (which runs in a + # background thread) from burying the input prompt in + # [Settings.__get_and_store]. with log_lock: is_running = None if settings.OUGHT_ICE_AUTO_SERVER: