2007-06-22 Alex Roitman <shura@phy.ucsf.edu>

* src/GrampsDb/_GrampsGEDDB.py (close): Save after batch 
	transactions: #862.
	* src/GrampsDb/_GrampsXMLDB.py (close): Save after batch
	transactions: #862.



svn: r8630
This commit is contained in:
Alex Roitman 2007-06-23 01:33:12 +00:00
parent dbdf2a2889
commit 1060e56243
3 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2007-06-22 Alex Roitman <shura@phy.ucsf.edu>
* src/GrampsDb/_GrampsGEDDB.py (close): Save after batch
transactions: #862.
* src/GrampsDb/_GrampsXMLDB.py (close): Save after batch
transactions: #862.
2007-06-22 Brian Matherly <brian@gramps-project.org>
* src/ReportBase/_ReportDialog.py: Still let REAL exceptions pass through.

View File

@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2000-2007 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
@ -60,6 +60,7 @@ class GrampsGEDDB(GrampsInMemDB):
self.bookmarks = GrampsDbBookmarks(self.metadata.get('bookmarks',[]))
self.db_is_open = True
self.readonly = True
self.abort_possible = True
return 1
def load_from(self, other_database, filename, callback):
@ -89,7 +90,8 @@ class GrampsGEDDB(GrampsInMemDB):
log.warning("Failed to load Gedcom writer", exc_info=True)
raise GrampsDbException("Failed to load Gedcom writer")
if not self.readonly and len(self.undodb) > 0:
if (not self.readonly) and ((len(self.undodb)>0) or
not self.abort_possible):
writer = GedcomWriter(self,self.get_default_person())
writer.export_data(self.full_name)
self.db_is_open = False

View File

@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2000-2007 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,6 +69,7 @@ class GrampsXMLDB(GrampsInMemDB):
self.bookmarks.set(self.metadata.get('bookmarks',[]))
self.db_is_open = True
self.abort_possible = True
return 1
def load_from(self, other_database, filename, callback):
@ -96,7 +97,8 @@ class GrampsXMLDB(GrampsInMemDB):
log.warning("Failed to load XML writer", exc_info=True)
raise GrampsDbException("Failed to load XML writer")
if not self.readonly and len(self.undodb) > 0:
if (not self.readonly) and ((len(self.undodb)>0) or
not self.abort_possible):
quick_write(self,self.full_name)
self.db_is_open = False
GrampsInMemDB.close(self)