Let init print message if database already exists.
This commit is contained in:
parent
da0e6a59f7
commit
1bc59311c9
1 changed files with 8 additions and 0 deletions
|
@ -326,6 +326,14 @@ def generate_thumbnail_argparse(args):
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def init_argparse(args):
|
def init_argparse(args):
|
||||||
|
global photodb
|
||||||
|
try:
|
||||||
|
load_photodb()
|
||||||
|
except etiquette.exceptions.NoClosestPhotoDB:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
pipeable.stderr(f'PhotoDB {photodb} already exists.')
|
||||||
|
return 0
|
||||||
photodb = etiquette.photodb.PhotoDB(create=True)
|
photodb = etiquette.photodb.PhotoDB(create=True)
|
||||||
photodb.commit()
|
photodb.commit()
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in a new issue