From 1bc59311c925c72ddbd12b8f0d00282d37486855 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 8 Mar 2022 17:03:50 -0800 Subject: [PATCH] Let init print message if database already exists. --- frontends/etiquette_cli.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontends/etiquette_cli.py b/frontends/etiquette_cli.py index 50382c8..7bc8c62 100644 --- a/frontends/etiquette_cli.py +++ b/frontends/etiquette_cli.py @@ -326,6 +326,14 @@ def generate_thumbnail_argparse(args): return 0 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.commit() return 0