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
|
# Will add -> PhotoDB when forward references are supported
|
||||||
@classmethod
|
@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,
|
Starting from the given path and climbing upwards towards the filesystem
|
||||||
look for an existing Etiquette data directory and return the PhotoDB
|
root, look for an existing Etiquette data directory and return the
|
||||||
object. If none exists, raise exceptions.NoClosestPhotoDB.
|
PhotoDB object. If none exists, raise exceptions.NoClosestPhotoDB.
|
||||||
'''
|
'''
|
||||||
|
path = pathclass.Path(path)
|
||||||
starting = path
|
starting = path
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
|
@ -4,7 +4,6 @@ import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from voussoirkit import interactive
|
from voussoirkit import interactive
|
||||||
from voussoirkit import pathclass
|
|
||||||
from voussoirkit import pipeable
|
from voussoirkit import pipeable
|
||||||
from voussoirkit import vlogging
|
from voussoirkit import vlogging
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@ def erepl_argparse(args):
|
||||||
global P
|
global P
|
||||||
|
|
||||||
try:
|
try:
|
||||||
P = etiquette.photodb.PhotoDB.closest_photodb(pathclass.cwd())
|
P = etiquette.photodb.PhotoDB.closest_photodb()
|
||||||
except etiquette.exceptions.NoClosestPhotoDB as exc:
|
except etiquette.exceptions.NoClosestPhotoDB as exc:
|
||||||
pipeable.stderr(exc.error_message)
|
pipeable.stderr(exc.error_message)
|
||||||
pipeable.stderr('Try `etiquette_cli.py init` to create the database.')
|
pipeable.stderr('Try `etiquette_cli.py init` to create the database.')
|
||||||
|
|
Loading…
Reference in a new issue