[bugfix] if no district is passed, fetch data for all
This commit is contained in:
parent
56c203189f
commit
102c20ac42
1 changed files with 8 additions and 5 deletions
|
|
@ -28,11 +28,14 @@ async def dump_listings(
|
||||||
parameters: QueryParameters,
|
parameters: QueryParameters,
|
||||||
data_dir: pathlib.Path = pathlib.Path("data/rs/"),
|
data_dir: pathlib.Path = pathlib.Path("data/rs/"),
|
||||||
) -> list[Listing]:
|
) -> list[Listing]:
|
||||||
districts = {
|
if parameters.district_names:
|
||||||
district: locid
|
districts = {
|
||||||
for district, locid in get_districts().items()
|
district: locid
|
||||||
if district in parameters.district_names
|
for district, locid in get_districts().items()
|
||||||
}
|
if district in parameters.district_names
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
districts = get_districts()
|
||||||
print("Valid districts to scrape:", districts.keys())
|
print("Valid districts to scrape:", districts.keys())
|
||||||
listings = []
|
listings = []
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue