parameterize dump_detail to use a custom data dir and also move data dir param as part of the click context
This commit is contained in:
parent
48d379567b
commit
e424361ed9
3 changed files with 32 additions and 21 deletions
|
|
@ -1,13 +1,14 @@
|
|||
import json
|
||||
import pathlib
|
||||
from rec.query import detail_query
|
||||
from tqdm import tqdm
|
||||
|
||||
from data_access import Listing
|
||||
|
||||
|
||||
def dump_detail():
|
||||
def dump_detail(listing_paths: list[str]):
|
||||
incremental = True
|
||||
listings = Listing.get_all_listings()
|
||||
listings = Listing.get_all_listings(listing_paths)
|
||||
filtered_listings = []
|
||||
for listing in listings:
|
||||
# We introduced last_seen later, so not all entries have it.
|
||||
|
|
@ -32,7 +33,8 @@ def dump_detail():
|
|||
|
||||
|
||||
def main():
|
||||
dump_detail()
|
||||
listing_paths = sorted(list(pathlib.Path("data/rs").glob("*/listing.json")))
|
||||
dump_detail(listing_paths)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue