Skip to content

Commit df8715d

Browse files
committed
Made pylint happy
1 parent 97ef825 commit df8715d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

kos-loader/kos_loader/kos_loader.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Main kos_loader module"""
22

33
import asyncio
4+
import base64
45
import dataclasses
56
import datetime
67
import itertools
@@ -56,8 +57,6 @@ def get_output_file_path() -> pathlib.Path:
5657

5758
def decrypt_string(key: RSAPrivateKey, ciphertext_b64: str) -> str:
5859
"""Decrypt base64 encoded ciphertext with the given private key"""
59-
import base64
60-
6160
ciphertext = base64.b64decode(ciphertext_b64)
6261
plaintext = key.decrypt(
6362
ciphertext,
@@ -146,19 +145,19 @@ async def kos_session(user: Cookies) -> aiohttp.ClientSession:
146145
logger.info("Testing KOS session")
147146

148147
# Try to access user info endpoint to verify if the cookies are valid
149-
ATTEMPTS = 5
150-
for attempt in range(ATTEMPTS):
148+
max_attempts = 5
149+
for attempt in range(max_attempts):
151150
try:
152151
async with session.get(f"{KOS_API}/me") as resp:
153152
response = await resp.json()
154153
assert "person" in response
155154
assert "id" in response["person"] and isinstance(response["person"]["id"], int)
156155
assert "username" in response["person"] and isinstance(response["person"]["username"], str)
157-
logger.info("KOS session is valid", response)
156+
logger.info("KOS session is valid")
158157
break
159158
except (aiohttp.ClientResponseError, AssertionError) as ex:
160159
logger.exception("KOS session is not valid - could not access user info", exc_info=ex)
161-
if attempt < ATTEMPTS - 1:
160+
if attempt < max_attempts - 1:
162161
logger.info("Retrying in 2 seconds...")
163162
await asyncio.sleep(2)
164163
else:

0 commit comments

Comments
 (0)