diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 3bdd912..e3ed280 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -1954,12 +1954,13 @@ class PhotoDB( # Will add -> PhotoDB when forward references are supported @classmethod - def closest_photodb(cls, path, *args, **kwargs): + def closest_photodb(cls, path='.', *args, **kwargs): ''' - Starting from the cwd and climbing upwards towards the filesystem root, - look for an existing Etiquette data directory and return the PhotoDB - object. If none exists, raise exceptions.NoClosestPhotoDB. + Starting from the given path and climbing upwards towards the filesystem + root, look for an existing Etiquette data directory and return the + PhotoDB object. If none exists, raise exceptions.NoClosestPhotoDB. ''' + path = pathclass.Path(path) starting = path while True: diff --git a/frontends/etiquette_repl.py b/frontends/etiquette_repl.py index 57d0433..436d807 100644 --- a/frontends/etiquette_repl.py +++ b/frontends/etiquette_repl.py @@ -4,7 +4,6 @@ import sys import traceback from voussoirkit import interactive -from voussoirkit import pathclass from voussoirkit import pipeable from voussoirkit import vlogging @@ -34,7 +33,7 @@ def erepl_argparse(args): global P try: - P = etiquette.photodb.PhotoDB.closest_photodb(pathclass.cwd()) + P = etiquette.photodb.PhotoDB.closest_photodb() except etiquette.exceptions.NoClosestPhotoDB as exc: pipeable.stderr(exc.error_message) pipeable.stderr('Try `etiquette_cli.py init` to create the database.')