Added selected and quit to repl
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
""" version info """
|
""" version info """
|
||||||
|
|
||||||
__version__ = "0.42.74"
|
__version__ = "0.42.75"
|
||||||
|
|||||||
@@ -4093,16 +4093,30 @@ def repl(ctx, cli_obj, db):
|
|||||||
get_photo = photosdb.get_photo
|
get_photo = photosdb.get_photo
|
||||||
show = _show_photo
|
show = _show_photo
|
||||||
get_selected = _get_selected(photosdb)
|
get_selected = _get_selected(photosdb)
|
||||||
|
selected = get_selected()
|
||||||
|
|
||||||
def inspect(obj):
|
def inspect(obj):
|
||||||
"""inspect object"""
|
"""inspect object"""
|
||||||
return _inspect(obj, methods=True)
|
return _inspect(obj, methods=True)
|
||||||
|
|
||||||
|
class ReprQuit:
|
||||||
|
def __repr__(self):
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
def __call__(self):
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
quit = ReprQuit()
|
||||||
|
q = ReprQuit()
|
||||||
|
|
||||||
print(f"Found {len(photos)} photos in {tictoc:0.2f} seconds")
|
print(f"Found {len(photos)} photos in {tictoc:0.2f} seconds")
|
||||||
print("The following variables are defined:")
|
print("The following variables are defined:")
|
||||||
print(f"- photosdb: PhotosDB() instance for {photosdb.library_path}")
|
print(f"- photosdb: PhotosDB() instance for {photosdb.library_path}")
|
||||||
print(
|
print(
|
||||||
f"- photos: list of PhotoInfo objects for all photos in photosdb, including those in the trash"
|
f"- photos: list of PhotoInfo objects for all photos in photosdb, including those in the trash (len={len(photos)})"
|
||||||
|
)
|
||||||
|
print(
|
||||||
|
f"- selected: list of PhotoInfo objects for any photos selected in Photos (len={len(selected)})"
|
||||||
)
|
)
|
||||||
print(f"\nThe following functions may be helpful:")
|
print(f"\nThe following functions may be helpful:")
|
||||||
print(f"- get_photo(uuid): return a PhotoInfo object for photo with uuid")
|
print(f"- get_photo(uuid): return a PhotoInfo object for photo with uuid")
|
||||||
@@ -4116,5 +4130,5 @@ def repl(ctx, cli_obj, db):
|
|||||||
print(
|
print(
|
||||||
f"- inspect(object): print information about an object; for example inspect(photosdb)"
|
f"- inspect(object): print information about an object; for example inspect(photosdb)"
|
||||||
)
|
)
|
||||||
print(f"- quit(): exit this interactive shell\n")
|
print(f"- q, quit, or quit(): exit this interactive shell\n")
|
||||||
code.interact(banner="", local=locals())
|
code.interact(banner="", local=locals())
|
||||||
|
|||||||
Reference in New Issue
Block a user