diff --git a/src/abricksetapi.py b/src/abricksetapi.py index 7d6fda5..6e1c03b 100644 --- a/src/abricksetapi.py +++ b/src/abricksetapi.py @@ -9,7 +9,8 @@ import aiohttp import json import dotenv from typing import Dict, Any -from asyncio_throttle.throttler import Throttler +from . import throttler +Throttler = throttler.GlobalThrottler dotenv.load_dotenv() diff --git a/src/asquare.py b/src/asquare.py index 1f12e2d..578a7b2 100644 --- a/src/asquare.py +++ b/src/asquare.py @@ -6,9 +6,9 @@ import uuid import re from time import time -import db +from . import db -import get_sq_env +from . import get_sq_env def get_set_number(text: str) -> int: diff --git a/src/glue.py b/src/glue.py index f52eb01..09003bd 100644 --- a/src/glue.py +++ b/src/glue.py @@ -1,14 +1,16 @@ import asyncio import json import re -import get_sq_env +from . import get_sq_env import aiosqlite from time import time -import asquare -import db -import abricksetapi -from throttler import GlobalThrottler +from . import asquare +from . import db +from . import abricksetapi +from . import throttler +Throttler = throttler.GlobalThrottler + LEGO_CAT_ID = get_sq_env.LEGO_CAT_ID @@ -19,7 +21,7 @@ async def do_review() -> bool: if not re.match(r".*\d{5}.*", item["name"]): missing = [] print(f"{item} is missing its set number!") - print(f"[@DEBUG] Upserting {item['id']} into REVIEW table") + #print(f"[@DEBUG] Upserting {item['id']} into REVIEW table") item_sanitized = { "sq_object": item["id"], "set_name": item["name"], @@ -27,11 +29,13 @@ async def do_review() -> bool: "time_added": time } missing.append(item_sanitized) + for item in missing: - sq_item = await db.fetch(item["id"]) # + print(item) + # sq_item = await db.fetch(item["id"]) if item["id"] != sq_item["sq_object"]: - await db.upsert("REVIEW", item_sanitized, "sq_object") - print(f"[@DEBUG] Upserted {item['id']} into REVIEW table") - print(f"[@DEBUG] {item['id']} already in REVIEW table") - return True - + print(f"[@DEBUG] {item['id']} is missing)") + #await db.upsert("MISSING", item_sanitized, "sq_object") + # #print(f"[@DEBUG] Upserted {item['id']} into REVIEW table") + #print(f"[@DEBUG] {item['id']} already in REVIEW table") + return True \ No newline at end of file