added list_photo_libraries

This commit is contained in:
Rhet Turnbull
2019-12-08 00:24:34 -08:00
parent 1d006a4b50
commit 62fedc7fbf
3 changed files with 12 additions and 1 deletions

View File

@@ -139,6 +139,10 @@ if __name__ == "__main__":
Returns path to last opened Photo Library as string.
#### ```list_photo_libraries()```
Returns list of Photos libraries found in the user's Pictures folder.
### PhotosDB
#### Open the default Photos library

View File

@@ -1,3 +1,4 @@
import glob
import json
import logging
import os.path
@@ -189,6 +190,12 @@ def get_last_library_path():
return None
def list_photo_libraries():
""" returns list of Photos libraries found in the user's Pictures folder """
lib_list = glob.glob(f"{str(Path.home())}/Pictures/*.photoslibrary")
return lib_list
class PhotosDB:
def __init__(self, dbfile=None):
""" create a new PhotosDB object """

View File

@@ -1,4 +1,4 @@
""" version info """
__version__ = "0.14.18"
__version__ = "0.14.19"