2007-05-12 Don Allingham <don@gramps-project.org>
* src/DataViews/_PedigreeView.py: additional error checking * src/DataViews/_RelationView.py: check for empty person * src/GrampsDb/_ReadGedcom.py: additional error checking * src/GrampsDb/_DbUtils.py: additional error checking * src/ReportBase/_ReportDialog.py: additional error checking * src/Editors/_EditFamily.py: additional error checking * src/DisplayTabs/_EmbeddedList.py: additional error checking * src/plugins/FindDupes.py: additional error checking * src/plugins/Verify.py: additional error checking * src/ImgManip.py: additional error checking * src/BasicUtils.py: additional error checking svn: r8464
This commit is contained in:
parent
05efaa384c
commit
ae2874fb70
@ -1,3 +1,16 @@
|
||||
2007-05-12 Don Allingham <don@gramps-project.org>
|
||||
* src/DataViews/_PedigreeView.py: additional error checking
|
||||
* src/DataViews/_RelationView.py: check for empty person
|
||||
* src/GrampsDb/_ReadGedcom.py: additional error checking
|
||||
* src/GrampsDb/_DbUtils.py: additional error checking
|
||||
* src/ReportBase/_ReportDialog.py: additional error checking
|
||||
* src/Editors/_EditFamily.py: additional error checking
|
||||
* src/DisplayTabs/_EmbeddedList.py: additional error checking
|
||||
* src/plugins/FindDupes.py: additional error checking
|
||||
* src/plugins/Verify.py: additional error checking
|
||||
* src/ImgManip.py: additional error checking
|
||||
* src/BasicUtils.py: additional error checking
|
||||
|
||||
2007-05-11 Benny Malengier <bm@cage.ugent.be>
|
||||
* src/GrampsDb/_ReadXML.py: clean meld issues, add privacy read lds_ord even if not set yet
|
||||
|
||||
|
@ -76,7 +76,10 @@ class UpdateCallback:
|
||||
self.count += 1
|
||||
if not count:
|
||||
count = self.count
|
||||
newval = int(100*count/self.total)
|
||||
if self.total:
|
||||
newval = int(100*count/self.total)
|
||||
else:
|
||||
newval = 0
|
||||
newtime = time.time()
|
||||
time_has_come = self.interval and (newtime-self.oldtime>self.interval)
|
||||
value_changed = newval!=self.oldval
|
||||
|
@ -61,6 +61,7 @@ from Editors import EditPerson, EditFamily
|
||||
from DdTargets import DdTargets
|
||||
import cPickle as pickle
|
||||
|
||||
from QuestionDialog import RunDatabaseRepair
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -610,11 +611,14 @@ class PedigreeView(PageView.PersonNavView):
|
||||
all handling of visibility is now in rebuild_trees, see that for more
|
||||
information.
|
||||
"""
|
||||
active = self.dbstate.get_active_person()
|
||||
if active:
|
||||
self.rebuild_trees(active.handle)
|
||||
else:
|
||||
self.rebuild_trees(None)
|
||||
try:
|
||||
active = self.dbstate.get_active_person()
|
||||
if active:
|
||||
self.rebuild_trees(active.handle)
|
||||
else:
|
||||
self.rebuild_trees(None)
|
||||
except AttributeError, msg:
|
||||
RunDatabaseRepair(str(msg))
|
||||
|
||||
def change_db(self,db):
|
||||
"""
|
||||
|
@ -1029,6 +1029,9 @@ class RelationshipView(PageView.PersonNavView):
|
||||
family = RelLib.Family()
|
||||
person = self.dbstate.active
|
||||
|
||||
if not person:
|
||||
return
|
||||
|
||||
if person.gender == RelLib.Person.MALE:
|
||||
family.set_father_handle(person.handle)
|
||||
else:
|
||||
@ -1089,6 +1092,9 @@ class RelationshipView(PageView.PersonNavView):
|
||||
family = RelLib.Family()
|
||||
person = self.dbstate.active
|
||||
|
||||
if not person:
|
||||
return
|
||||
|
||||
ref = RelLib.ChildRef()
|
||||
ref.ref = person.handle
|
||||
family.add_child_ref(ref)
|
||||
|
@ -353,7 +353,13 @@ class EmbeddedList(ButtonTab):
|
||||
Rebuilds the data in the database by creating a new model,
|
||||
using the build_model function passed at creation time.
|
||||
"""
|
||||
self.model = self.build_model(self.get_data(), self.dbstate.db)
|
||||
try:
|
||||
self.model = self.build_model(self.get_data(), self.dbstate.db)
|
||||
except AttributeError, msg:
|
||||
from QuestionDialog import RunDatabaseRepair
|
||||
RunDatabaseRepair(str(msg))
|
||||
return
|
||||
|
||||
self.tree.set_model(self.model)
|
||||
self._set_label()
|
||||
self._selection_changed()
|
||||
|
@ -1,4 +1,4 @@
|
||||
#
|
||||
o#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2007 Donald N. Allingham
|
||||
@ -27,6 +27,7 @@
|
||||
#-------------------------------------------------------------------------
|
||||
from gettext import gettext as _
|
||||
import cPickle as pickle
|
||||
from bsddb import db
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -253,8 +254,11 @@ class ChildEmbedList(EmbeddedList):
|
||||
if ref.ref == handle:
|
||||
p = self.dbstate.db.get_person_from_handle(handle)
|
||||
n = NameDisplay.displayer.display(p)
|
||||
EditChildRef(n, self.dbstate, self.uistate, self.track,
|
||||
ref, self.child_ref_edited)
|
||||
try:
|
||||
EditChildRef(n, self.dbstate, self.uistate, self.track,
|
||||
ref, self.child_ref_edited)
|
||||
except Errors.WindowActiveError, msg:
|
||||
pass
|
||||
break
|
||||
|
||||
def edit_child_button_clicked(self, obj):
|
||||
@ -773,7 +777,12 @@ class EditFamily(EditPrimary):
|
||||
len(self.obj.get_child_ref_list()) == 0
|
||||
|
||||
def save(self,*obj):
|
||||
try:
|
||||
self.__do_save()
|
||||
except db.DBRunRecoveryError, msg:
|
||||
QuestionDialog.RunDatabaseRepair(msg[1])
|
||||
|
||||
def __do_save(self):
|
||||
self.ok_button.set_sensitive(False)
|
||||
if not self.added:
|
||||
original = self.db.get_family_from_handle(self.obj.handle)
|
||||
|
@ -116,6 +116,8 @@ def remove_parent_from_family(db, person_handle, family_handle, trans=None):
|
||||
elif family.get_mother_handle() == person_handle:
|
||||
msg = _("Remove mother from family")
|
||||
family.set_mother_handle(None)
|
||||
else:
|
||||
msg = _("Family unchanged")
|
||||
|
||||
child_list = family.get_child_ref_list()
|
||||
if (not family.get_father_handle() and not family.get_mother_handle() and
|
||||
@ -130,7 +132,7 @@ def remove_parent_from_family(db, person_handle, family_handle, trans=None):
|
||||
db.commit_person(person, trans)
|
||||
|
||||
if need_commit:
|
||||
db.transaction_commit(trans,msg)
|
||||
db.transaction_commit(trans, msg)
|
||||
|
||||
def remove_child_from_family(db, person_handle, family_handle, trans=None):
|
||||
"""
|
||||
|
@ -3165,8 +3165,14 @@ class GedcomParser(UpdateCallback):
|
||||
state.person.add_attribute(attr)
|
||||
else:
|
||||
name = RelLib.Name()
|
||||
name.set_surname(lname[-1].strip())
|
||||
name.set_first_name(' '.join(lname[0:l-1]))
|
||||
try:
|
||||
name.set_surname(lname[-1].strip())
|
||||
except IndexError:
|
||||
pass
|
||||
try:
|
||||
name.set_first_name(' '.join(lname[0:l-1]))
|
||||
except IndexError:
|
||||
pass
|
||||
state.person.add_alternate_name(name)
|
||||
|
||||
def func_name_sour(self, matches, state):
|
||||
|
@ -84,7 +84,7 @@ class ImgManip:
|
||||
|
||||
def fmt_scale_data(self, x, y, cnv):
|
||||
fd, dest = tempfile.mkstemp()
|
||||
scaled = self.img.scale_simple(x, y, gtk.gdk.INTERP_BILINEAR)
|
||||
scaled = self.img.scale_simple(int(x), int(y), gtk.gdk.INTERP_BILINEAR)
|
||||
scaled.save(dest,cnv)
|
||||
fh = open(dest,mode='rb')
|
||||
data = fh.read()
|
||||
|
@ -49,7 +49,7 @@ import Errors
|
||||
import Utils
|
||||
import const
|
||||
|
||||
from QuestionDialog import ErrorDialog, OptionDialog
|
||||
from QuestionDialog import ErrorDialog, OptionDialog, RunDatabaseRepair
|
||||
|
||||
from _Constants import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK, \
|
||||
CATEGORY_VIEW, CATEGORY_CODE, CATEGORY_WEB, standalone_categories
|
||||
@ -694,6 +694,8 @@ def report(dbstate,uistate,person,report_class,options_class,
|
||||
ErrorDialog(m1,m2)
|
||||
except Errors.DatabaseError,msg:
|
||||
ErrorDialog(_("Report could not be created"),str(msg))
|
||||
except AttributeError,msg:
|
||||
RunDatabaseRepair(str(msg))
|
||||
except:
|
||||
log.error("Failed to run report.", exc_info=True)
|
||||
break
|
||||
|
@ -161,7 +161,12 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow):
|
||||
def on_merge_ok_clicked(self,obj):
|
||||
threshold = self.menu.get_menu().get_active().get_data("v")
|
||||
self.use_soundex = int(self.soundex_obj.get_active())
|
||||
self.find_potentials(threshold)
|
||||
try:
|
||||
self.find_potentials(threshold)
|
||||
except AttributeError, msg:
|
||||
import QuestionDialog
|
||||
QuestionDialog.RunDatabaseRepair(str(msg))
|
||||
return
|
||||
|
||||
self.options.handler.options_dict['threshold'] = threshold
|
||||
self.options.handler.options_dict['soundex'] = self.use_soundex
|
||||
|
@ -323,14 +323,20 @@ class Verify(Tool.Tool, ManagedWindow, UpdateCallback):
|
||||
self.uistate.window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
|
||||
self.uistate.progress.show()
|
||||
self.window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
|
||||
vr.window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
|
||||
try:
|
||||
vr.window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
self.run_tool(cli=False)
|
||||
|
||||
self.uistate.progress.hide()
|
||||
self.uistate.window.window.set_cursor(None)
|
||||
self.window.window.set_cursor(None)
|
||||
vr.window.window.set_cursor(None)
|
||||
try:
|
||||
vr.window.window.set_cursor(None)
|
||||
except AttributeError:
|
||||
pass
|
||||
self.reset()
|
||||
|
||||
# Save options
|
||||
|
Loading…
Reference in New Issue
Block a user