Let closest_photodb have default path='.'.
This commit is contained in:
parent
042fe4dd2f
commit
2831eb43d0
2 changed files with 6 additions and 6 deletions
|
@ -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:
|
||||
|
|
|
@ -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.')
|
||||
|
|
Loading…
Reference in a new issue