Skip to content

Commit

Permalink
Format code a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
smithjessk committed Jan 13, 2023
1 parent c3f3dbd commit d00754e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ice/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion ice/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d00754e

Please sign in to comment.