wtf is going on with these imports man
This commit is contained in:
1 parent
e9d2bef2ae
commit
77db374418
3 files changed
+21
-16
No files matched your search
+2
-1
@@ -9,7 +9,8 @@ import aiohttp
|
|||||||
import json
|
import json
|
||||||
import dotenv
|
import dotenv
|
||||||
from typing import Dict, Any
|
from typing import Dict, Any
|
||||||
from asyncio_throttle.throttler import Throttler
|
from . import throttler
|
||||||
|
Throttler = throttler.GlobalThrottler
|
||||||
|
|
||||||
dotenv.load_dotenv()
|
dotenv.load_dotenv()
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -6,9 +6,9 @@ import uuid
|
|||||||
import re
|
import re
|
||||||
from time import time
|
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:
|
def get_set_number(text: str) -> int:
|
||||||
|
|||||||
+17
-13
@@ -1,14 +1,16 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import get_sq_env
|
from . import get_sq_env
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
import asquare
|
from . import asquare
|
||||||
import db
|
from . import db
|
||||||
import abricksetapi
|
from . import abricksetapi
|
||||||
from throttler import GlobalThrottler
|
from . import throttler
|
||||||
|
Throttler = throttler.GlobalThrottler
|
||||||
|
|
||||||
|
|
||||||
LEGO_CAT_ID = get_sq_env.LEGO_CAT_ID
|
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"]):
|
if not re.match(r".*\d{5}.*", item["name"]):
|
||||||
missing = []
|
missing = []
|
||||||
print(f"{item} is missing its set number!")
|
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 = {
|
item_sanitized = {
|
||||||
"sq_object": item["id"],
|
"sq_object": item["id"],
|
||||||
"set_name": item["name"],
|
"set_name": item["name"],
|
||||||
@@ -27,11 +29,13 @@ async def do_review() -> bool:
|
|||||||
"time_added": time
|
"time_added": time
|
||||||
}
|
}
|
||||||
missing.append(item_sanitized)
|
missing.append(item_sanitized)
|
||||||
for item in missing:
|
|
||||||
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
|
|
||||||
|
|
||||||
|
for item in missing:
|
||||||
|
print(item)
|
||||||
|
# sq_item = await db.fetch(item["id"])
|
||||||
|
if item["id"] != sq_item["sq_object"]:
|
||||||
|
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
|
||||||
Reference in new issue
Block a user