final commit before first prod test
This commit is contained in:
1 parent
a6e2397046
commit
dbe5cd6146
4 files changed
+12
-4
No files matched your search
+4
-2
@@ -13,6 +13,7 @@ from typing import Dict, Any, Optional
|
||||
from datetime import datetime, timedelta
|
||||
from async_lru import alru_cache
|
||||
from . import throttler
|
||||
from . import get_sq_env
|
||||
|
||||
Throttler = throttler.GlobalThrottler
|
||||
|
||||
@@ -22,11 +23,12 @@ dotenv.load_dotenv()
|
||||
class AsyncBricksetAPI:
|
||||
"""Asynchronous client for the Brickset API"""
|
||||
|
||||
def __init__(self, debug: bool = False, logger=None):
|
||||
def __init__(self, debug: bool = None, logger=None):
|
||||
self.username = os.getenv("BRICKSET_USERNAME")
|
||||
self.password = os.getenv("BRICKSET_PASS")
|
||||
self.api_key = os.getenv("BRICKSET_API_KEY")
|
||||
self.debug = debug
|
||||
# Use DEBUG_MODE from env if debug not explicitly set
|
||||
self.debug = debug if debug is not None else get_sq_env.DEBUG_MODE
|
||||
self.headers = {"UserAgent": "studspider/0.1"}
|
||||
self.throttler = Throttler(rate_limit=500, period=60)
|
||||
self.user_hash = None
|
||||
|
||||
Reference in new issue
Block a user