From f7e9a34a10c07002b6b380c116b238b5b8d6b002 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 18 Jul 2015 17:59:46 -0400 Subject: [PATCH] Gramps -L: cleanup, standardize --- gramps/cli/clidbman.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/gramps/cli/clidbman.py b/gramps/cli/clidbman.py index c9bb94d14..ce7cb7b5c 100644 --- a/gramps/cli/clidbman.py +++ b/gramps/cli/clidbman.py @@ -155,17 +155,16 @@ class CLIDbManager(object): dbid_path = os.path.join(dirpath, "database.txt") if os.path.isfile(dbid_path): dbid = open(dbid_path).read().strip() - lock_path = os.path.join(dirpath, "lock") - if not os.path.isfile(lock_path): - try: - database = self.dbstate.make_database(dbid) - database.load(dirpath, None) - retval = database.get_summary() - database.close() - except Exception as msg: - retval = {_("Unavailable"): str(msg)[:74] + "..."} + if not self.is_locked(dirpath): + try: + database = self.dbstate.make_database(dbid) + database.load(dirpath, None) + retval = database.get_summary() + database.close() + except Exception as msg: + retval = {_("Unavailable"): str(msg)[:74] + "..."} else: - retval = {_("Locked?"): "True"} + retval = {_("Unavailable"): "locked"} retval.update({_("Family Tree"): name, _("Path"): dirpath, _("Database backend"): dbid,