advent-of-code-data 2.2.0__tar.gz → 2.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/PKG-INFO +1 -1
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/advent_of_code_data.egg-info/PKG-INFO +1 -1
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/cookies.py +12 -1
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/pyproject.toml +1 -1
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/LICENSE +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/README.md +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/advent_of_code_data.egg-info/SOURCES.txt +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/advent_of_code_data.egg-info/dependency_links.txt +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/advent_of_code_data.egg-info/entry_points.txt +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/advent_of_code_data.egg-info/requires.txt +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/advent_of_code_data.egg-info/top_level.txt +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/__init__.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/_ipykernel.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/cli.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/examples.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/exceptions.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/get.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/models.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/post.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/py.typed +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/runner.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/types.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/aocd/utils.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/setup.cfg +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_aocd.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_auth.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_cli.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_cookies.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_date_finding.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_date_introspection.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_example_parser.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_get_data.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_models.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_runner.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_submit.py +0 -0
- {advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/tests/test_utils.py +0 -0
|
@@ -4,6 +4,7 @@ import json
|
|
|
4
4
|
import logging
|
|
5
5
|
import os
|
|
6
6
|
import sys
|
|
7
|
+
from functools import cache
|
|
7
8
|
|
|
8
9
|
from .exceptions import DeadTokenError
|
|
9
10
|
from .models import AOCD_CONFIG_DIR
|
|
@@ -125,7 +126,7 @@ def scrape_session_tokens() -> None:
|
|
|
125
126
|
log.debug("%d tokens to check", len(tokens))
|
|
126
127
|
for name, token in tokens.items():
|
|
127
128
|
try:
|
|
128
|
-
owner =
|
|
129
|
+
owner = _check_token_liveness(token)
|
|
129
130
|
except DeadTokenError:
|
|
130
131
|
print(colored(f"{token} ({name}) is dead", color="red"))
|
|
131
132
|
else:
|
|
@@ -149,3 +150,13 @@ def scrape_session_tokens() -> None:
|
|
|
149
150
|
_ensure_intermediate_dirs(aocd_token_path)
|
|
150
151
|
aocd_token_path.write_text(token, encoding="utf-8")
|
|
151
152
|
log.info("wrote %s session to %s", auth_source, aocd_token_path)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
@cache
|
|
156
|
+
def _check_token_liveness(token):
|
|
157
|
+
# avoid duplicating the check in case that ~/.config/aocd/token
|
|
158
|
+
# and tokens.json have an overlap
|
|
159
|
+
try:
|
|
160
|
+
return get_owner(token)
|
|
161
|
+
except DeadTokenError:
|
|
162
|
+
return None
|
|
File without changes
|
|
File without changes
|
{advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/advent_of_code_data.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/advent_of_code_data.egg-info/requires.txt
RENAMED
|
File without changes
|
{advent_of_code_data-2.2.0 → advent_of_code_data-2.2.1}/advent_of_code_data.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|