Skip to content
Prev Previous commit
Next Next commit
linting and formatting
  • Loading branch information
carl-adams-planet committed Oct 8, 2025
commit 0c61e912a878cc29e477477275d7ac050e197762
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def example_main():
# time, an app with persistent storage can skip user prompts when they
# are not needed.
# This helper will prompt the user only when it is necessary.
plsdk_auth.ensure_initialized(allow_open_browser=True, allow_tty_prompt=True)
plsdk_auth.ensure_initialized(allow_open_browser=True,
allow_tty_prompt=True)

# Create a Planet SDK object that uses the loaded auth session.
sess = planet.Session(plsdk_auth)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def example_main():
# time, an app with persistent storage can skip user prompts when they
# are not needed.
# This helper will prompt the user only when it is necessary.
plsdk_auth.ensure_initialized(allow_open_browser=True, allow_tty_prompt=True)
plsdk_auth.ensure_initialized(allow_open_browser=True,
allow_tty_prompt=True)

# Create a Planet SDK object that uses the loaded auth session.
sess = planet.Session(plsdk_auth)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def example_main():
plsdk_auth = planet.Auth.from_profile("planet-user",
save_state_to_storage=True)

plsdk_auth.ensure_initialized(allow_open_browser=True, allow_tty_prompt=True)
plsdk_auth.ensure_initialized(allow_open_browser=True,
allow_tty_prompt=True)

# Create a Planet SDK object that uses the loaded auth session.
sess = planet.Session(plsdk_auth)
Expand Down
8 changes: 6 additions & 2 deletions planet/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ def is_initialized(self) -> bool:

@abc.abstractmethod
def ensure_initialized(
self, allow_open_browser: typing.Optional[bool] = False, allow_tty_prompt: typing.Optional[bool] = False
self,
allow_open_browser: typing.Optional[bool] = False,
allow_tty_prompt: typing.Optional[bool] = False,
) -> None:
"""
Do everything necessary to ensure the auth context is ready for use,
Expand Down Expand Up @@ -551,7 +553,9 @@ def is_initialized(self) -> bool:
return self._plauth.request_authenticator_is_ready()

def ensure_initialized(
self, allow_open_browser: typing.Optional[bool] = False, allow_tty_prompt: typing.Optional[bool] = False
self,
allow_open_browser: typing.Optional[bool] = False,
allow_tty_prompt: typing.Optional[bool] = False,
) -> None:
return self._plauth.ensure_request_authenticator_is_ready(
allow_open_browser=allow_open_browser,
Expand Down