Added PhotosDB() behavior to open last library if no args passed but also added cautionary note to README

This commit is contained in:
Rhet Turnbull
2020-02-01 08:16:20 -08:00
parent 476e094365
commit 46d3c7dbda
2 changed files with 7 additions and 5 deletions

View File

@@ -165,11 +165,10 @@ class PhotosDB:
dbfile_,
)
elif dbfile is None:
raise TypeError(
f"photos database path must be specified as argument or named parameter dbfile",
dbfile_,
dbfile,
)
dbfile = get_last_library_path()
if dbfile is None:
# get_last_library_path must have failed to find library
raise FileNotFoundError("Could not get path to photo library database")
if os.path.isdir(dbfile):
# passed a directory, assume it's a photoslibrary