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
|
|
@ -13,8 +13,8 @@ class Listing:
|
|||
_cached: Dict = None
|
||||
data_dir: pathlib.Path = pathlib.Path("data/rs/")
|
||||
|
||||
def get_all_listings(self) -> List["Listing"]:
|
||||
listing_paths = sorted(list(self.data_dir.glob("*/listing.json")))
|
||||
@staticmethod
|
||||
def get_all_listings(listing_paths: list[str]) -> List["Listing"]:
|
||||
identifiers = []
|
||||
for listing_path in listing_paths:
|
||||
with open(listing_path) as f:
|
||||
|
|
@ -294,5 +294,6 @@ class Listing:
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
listing_paths = sorted(list(pathlib.Path("data/rs").glob("*/listing.json")))
|
||||
listings = Listing.get_all_listings()
|
||||
print(listings[0].list_floorplans())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue