Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tehkillerbee committed Jan 26, 2024
1 parent 36f51f8 commit cb82f5f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tidalapi/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
import base64
import concurrent.futures
import datetime
import logging
import json
import logging
import random
import time
import uuid
from pathlib import Path
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
Expand Down Expand Up @@ -402,8 +402,8 @@ def login(self, username: str, password: str) -> bool:
return True

def login_oauth_file(self, oauth_file: Path) -> bool:
"""Logs in to the TIDAL api using an existing OAuth session file.
If no OAuth session json file exists, a new one will be created after successful login
"""Logs in to the TIDAL api using an existing OAuth session file. If no OAuth
session json file exists, a new one will be created after successful login.
:param oauth_file: The OAuth session json file
:return: Returns true if we think the login was successful.
Expand Down Expand Up @@ -458,10 +458,12 @@ def _save_oauth_session_to_file(self, oauth_file: Path):
# create a new session
if self.check_login():
# store current OAuth session
data = {"token_type": {"data": self.token_type},
"session_id": {"data": self.session_id},
"access_token": {"data": self.access_token},
"refresh_token": {"data": self.refresh_token}}
data = {
"token_type": {"data": self.token_type},
"session_id": {"data": self.session_id},
"access_token": {"data": self.access_token},
"refresh_token": {"data": self.refresh_token},
}
with oauth_file.open("w") as outfile:
json.dump(data, outfile)
self._oauth_saved = True
Expand Down

0 comments on commit cb82f5f

Please sign in to comment.