From a1750394d7d5a457ef983b21e7f786b930c25880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Fri, 24 Oct 2014 09:17:05 +0200 Subject: [PATCH] 8122: DB lock not checked when opening database from the recent opened trees list --- gramps/cli/grampscli.py | 7 +++++++ po/gramps.pot | 18 ++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/gramps/cli/grampscli.py b/gramps/cli/grampscli.py index 89e2e73ac..d19e95762 100644 --- a/gramps/cli/grampscli.py +++ b/gramps/cli/grampscli.py @@ -249,6 +249,13 @@ class CLIManager(object): _("Family Tree does not exist, as it has been deleted.")) return + if os.path.isfile(os.path.join(filename, "lock")): + self._errordialog( + _("The database is locked."), + _("Use the --force-unlock option if you are sure " + "that the database is not in use.")) + return + if self.db_loader.read_file(filename): # Attempt to figure out the database title path = os.path.join(filename, "name.txt") diff --git a/po/gramps.pot b/po/gramps.pot index f4b72496c..55e4efad8 100644 --- a/po/gramps.pot +++ b/po/gramps.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-22 08:23+0200\n" +"POT-Creation-Date: 2014-10-24 09:11+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1130,18 +1130,28 @@ msgstr "" msgid "Family Tree does not exist, as it has been deleted." msgstr "" +#: ../gramps/cli/grampscli.py:254 +msgid "The database is locked." +msgstr "" + +#: ../gramps/cli/grampscli.py:255 +msgid "" +"Use the --force-unlock option if you are sure that the database is not in " +"use." +msgstr "" + #. already errors encountered. Show first one on terminal and exit -#: ../gramps/cli/grampscli.py:324 +#: ../gramps/cli/grampscli.py:331 #, python-format msgid "Error encountered: %s" msgstr "" -#: ../gramps/cli/grampscli.py:326 ../gramps/cli/grampscli.py:334 +#: ../gramps/cli/grampscli.py:333 ../gramps/cli/grampscli.py:341 #, python-format msgid " Details: %s" msgstr "" -#: ../gramps/cli/grampscli.py:331 +#: ../gramps/cli/grampscli.py:338 #, python-format msgid "Error encountered in argument parsing: %s" msgstr ""