fix types and format
This commit is contained in:
parent
91d3237516
commit
b873eaf203
8 changed files with 117 additions and 172 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import asyncio
|
||||
import json
|
||||
import pathlib
|
||||
from rec.query import detail_query
|
||||
from tqdm.asyncio import tqdm
|
||||
|
||||
|
|
@ -13,8 +12,7 @@ semaphore = asyncio.Semaphore(10)
|
|||
async def dump_detail(listing_paths: list[str]):
|
||||
listings = Listing.get_all_listings(listing_paths)
|
||||
filtered_listings = await tqdm.gather(
|
||||
*[_dump_detail_for_listing(listing) for listing in listings]
|
||||
)
|
||||
*[_dump_detail_for_listing(listing) for listing in listings])
|
||||
return filtered_listings
|
||||
|
||||
|
||||
|
|
@ -27,12 +25,3 @@ async def _dump_detail_for_listing(listing: Listing):
|
|||
d = await detail_query(listing.identifier)
|
||||
with open(listing.path_detail_json(), "w") as f:
|
||||
json.dump(d, f)
|
||||
|
||||
|
||||
def main():
|
||||
listing_paths = sorted(list(pathlib.Path("data/rs").glob("*/listing.json")))
|
||||
dump_detail(listing_paths)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue