diff --git a/gramps/cli/clidbman.py b/gramps/cli/clidbman.py index 8bdce7bdb..c9bb94d14 100644 --- a/gramps/cli/clidbman.py +++ b/gramps/cli/clidbman.py @@ -155,20 +155,23 @@ class CLIDbManager(object): dbid_path = os.path.join(dirpath, "database.txt") if os.path.isfile(dbid_path): dbid = open(dbid_path).read().strip() - 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] + "..."} - retval.update({ - _("Family Tree"): name, - _("Path"): dirpath, - _("Database backend"): dbid, - _("Last accessed"): time_val(dirpath)[1], - _("Locked?"): self.is_locked(dirpath), - }) + 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] + "..."} + else: + retval = {_("Locked?"): "True"} + retval.update({_("Family Tree"): name, + _("Path"): dirpath, + _("Database backend"): dbid, + _("Last accessed"): time_val(dirpath)[1], + _("Locked?"): self.is_locked(dirpath), + }) return retval def family_tree_summary(self):