Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom committed Dec 4, 2023
1 parent dab5b2d commit ebf5652
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
14 changes: 4 additions & 10 deletions livekit-api/livekit/api/access_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ def __init__(
api_key: Optional[str] = None,
api_secret: Optional[str] = None,
) -> None:
if not api_key:
api_key = os.getenv("LIVEKIT_API_KEY")

if not api_secret:
api_secret = os.getenv("LIVEKIT_API_SECRET")
api_key = api_key or os.getenv("LIVEKIT_API_KEY")
api_secret = api_secret or os.getenv("LIVEKIT_API_SECRET")

if not api_key or not api_secret:
raise ValueError("api_key and api_secret must be set")
Expand Down Expand Up @@ -150,11 +147,8 @@ def __init__(
*,
leeway: datetime.timedelta = DEFAULT_LEEWAY,
) -> None:
if not api_key:
api_key = os.getenv("LIVEKIT_API_KEY")

if not api_secret:
api_secret = os.getenv("LIVEKIT_API_SECRET")
api_key = api_key or os.getenv("LIVEKIT_API_KEY")
api_secret = api_secret or os.getenv("LIVEKIT_API_SECRET")

if not api_key or not api_secret:
raise ValueError("api_key and api_secret must be set")
Expand Down
11 changes: 3 additions & 8 deletions livekit-api/livekit/api/livekit_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@ def __init__(
*,
timeout: float = 60, # 1 minutes by default
):
if not url:
url = os.getenv("LIVEKIT_URL")

if not api_key:
api_key = os.getenv("LIVEKIT_API_KEY")

if not api_secret:
api_secret = os.getenv("LIVEKIT_API_SECRET")
url = url or os.getenv("LIVEKIT_URL")
api_key = api_key or os.getenv("LIVEKIT_API_KEY")
api_secret = api_secret or os.getenv("LIVEKIT_API_SECRET")

if not url:
raise ValueError("url must be set")
Expand Down

0 comments on commit ebf5652

Please sign in to comment.