From d0ddac1282f96d652fc6e3bfe8e4fa5d640c45a2 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 19 Jan 2006 04:30:40 +0000 Subject: [PATCH] * src/GrampsDb/_ReadGrdb.py (importData): Properly set batch transaction. * src/plugins/Check.py: Properly set batch transaction. * src/plugins/ImportGeneWeb.py: Properly set batch transaction. * src/plugins/ImportvCard.py: Properly set batch transaction. * src/plugins/TestCaseGenerator.py: Properly set batch transaction. svn: r5796 --- ChangeLog | 6 ++++++ src/GrampsDb/_ReadGrdb.py | 5 ++--- src/plugins/ChangeNames.py | 2 +- src/plugins/Check.py | 5 ++--- src/plugins/ImportGeneWeb.py | 5 ++--- src/plugins/ImportvCard.py | 5 ++--- src/plugins/TestcaseGenerator.py | 8 +++++--- 7 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c55bf51e..07df3d647 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,12 @@ rebuild; convert surnames secondary index to DUPSORTed BTREE. * src/GrampsDb/_GrampsBSDDB.py: upgrade from gramps20. * src/GrampsDb/_ReadXML.py (parse): Properly set batch transaction. + * src/GrampsDb/_ReadGrdb.py (importData): Properly set batch + transaction. + * src/plugins/Check.py: Properly set batch transaction. + * src/plugins/ImportGeneWeb.py: Properly set batch transaction. + * src/plugins/ImportvCard.py: Properly set batch transaction. + * src/plugins/TestCaseGenerator.py: Properly set batch transaction. 2006-01-17 Don Allingham * src/DbPrompter.py: removed diff --git a/src/GrampsDb/_ReadGrdb.py b/src/GrampsDb/_ReadGrdb.py index e54393c1a..04d95e025 100644 --- a/src/GrampsDb/_ReadGrdb.py +++ b/src/GrampsDb/_ReadGrdb.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2005 Donald N. Allingham +# Copyright (C) 2005-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -109,8 +109,7 @@ def importData(database, filename, callback=None,cl=0,use_trans=True): # Proceed with preparing for import if use_trans: - trans = database.transaction_begin() - trans.set_batch(True) + trans = database.transaction_begin("",batch=True) else: trans = None diff --git a/src/plugins/ChangeNames.py b/src/plugins/ChangeNames.py index 9867d10a3..9c8242ee2 100644 --- a/src/plugins/ChangeNames.py +++ b/src/plugins/ChangeNames.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2005 Donald N. Allingham +# Copyright (C) 2000-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/plugins/Check.py b/src/plugins/Check.py index 8841e2db1..7c808822b 100644 --- a/src/plugins/Check.py +++ b/src/plugins/Check.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2005 Donald N. Allingham +# Copyright (C) 2000-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -69,8 +69,7 @@ class Check(Tool.Tool): # checking of a read only database return - trans = db.transaction_begin() - trans.set_batch(True) + trans = db.transaction_begin("",batch=True) db.disable_signals() checker = CheckIntegrity(db,parent,trans) checker.fix_encoding() diff --git a/src/plugins/ImportGeneWeb.py b/src/plugins/ImportGeneWeb.py index 84ed39f29..8cd5091bd 100644 --- a/src/plugins/ImportGeneWeb.py +++ b/src/plugins/ImportGeneWeb.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2005 Martin Hawlisch, Donald N. Allingham +# Copyright (C) 2000-2006 Martin Hawlisch, Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -119,8 +119,7 @@ class GeneWebParser: return line def parse_geneweb_file(self): - self.trans = self.db.transaction_begin() - self.trans.set_batch(True) + self.trans = self.db.transaction_begin("",batch=True) self.db.disable_signals() t = time.time() self.lineno = 0 diff --git a/src/plugins/ImportvCard.py b/src/plugins/ImportvCard.py index 8db39bdad..3c36af217 100644 --- a/src/plugins/ImportvCard.py +++ b/src/plugins/ImportvCard.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2005 Martin Hawlisch, Donald N. Allingham +# Copyright (C) 2000-2006 Martin Hawlisch, Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -99,8 +99,7 @@ class VCardParser: return line def parse_vCard_file(self): - self.trans = self.db.transaction_begin() - self.trans.set_batch(True) + self.trans = self.db.transaction_begin("",batch=True) self.db.disable_signals() t = time.time() self.person = None diff --git a/src/plugins/TestcaseGenerator.py b/src/plugins/TestcaseGenerator.py index feeb2d5c0..700ba42bd 100644 --- a/src/plugins/TestcaseGenerator.py +++ b/src/plugins/TestcaseGenerator.py @@ -2,7 +2,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2005 Martin Hawlisch, Donald N. Allingham +# Copyright (C) 2000-2006 Martin Hawlisch, Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -247,10 +247,12 @@ class TestcaseGenerator(Tool.Tool): self.transaction_count = 0; - self.trans = self.db.transaction_begin() if not self.options.handler.options_dict['no_trans']: - self.trans.set_batch(True) + batch = True self.db.disable_signals() + else: + batch = False + self.trans = self.db.transaction_begin("",batch) if self.options.handler.options_dict['no_trans']: