2007-05-14 Don Allingham <don@gramps-project.org>
* src/DataViews/_PedigreeView.py: catch errors * src/DataViews/_RelationView.py: catch errors * src/ReportBase/_ReportDialog.py: catch errors * src/ReportBase/_SimpleAccess.py: fix marriage place/date values * src/Editors/_EditFamily.py: catch errors * src/DisplayTabs/_EmbeddedList.py: catch errors * src/plugins/FindDupes.py: catch errors * src/plugins/Verify.py: catch errors * src/AddMedia.py: fix scale_simple types * src/AutoComp.py: pylint fixes * src/ImgManip.py: pylint fixes * src/LdsUtils.py: new temple types * src/DbLoader.py: error types svn: r8473
This commit is contained in:
@@ -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
|
||||
@@ -658,6 +658,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
|
||||
|
||||
@@ -30,6 +30,7 @@ import Utils
|
||||
|
||||
from BasicUtils import NameDisplay
|
||||
from ReportBase import ReportUtils
|
||||
from RelLib import EventType
|
||||
|
||||
class SimpleAccess:
|
||||
"""
|
||||
@@ -314,10 +315,13 @@ class SimpleAccess:
|
||||
if family:
|
||||
reflist = family.get_event_ref_list()
|
||||
if reflist:
|
||||
ref = reflist[0].ref
|
||||
event = self.dbase.get_event_from_handle(ref)
|
||||
place_handle = event.get_place_handle()
|
||||
return ReportUtils.place_name(self.dbase, place_handle)
|
||||
elist = [ self.dbase.get_event_from_handle(ref.ref)
|
||||
for ref in reflist ]
|
||||
events = [ evnt for evnt in elist
|
||||
if int(evnt.get_type()) == EventType.MARRIAGE ]
|
||||
if events:
|
||||
place_handle = events[0].get_place_handle()
|
||||
return ReportUtils.place_name(self.dbase, place_handle)
|
||||
return u''
|
||||
|
||||
def marriage_date(self, person):
|
||||
@@ -341,11 +345,14 @@ class SimpleAccess:
|
||||
if family:
|
||||
reflist = family.get_event_ref_list()
|
||||
if reflist:
|
||||
ref = reflist[0].ref
|
||||
event = self.dbase.get_event_from_handle(ref)
|
||||
date_obj = event.get_date_object()
|
||||
if date_obj:
|
||||
return DateHandler.displayer.display(date_obj)
|
||||
elist = [ self.dbase.get_event_from_handle(ref.ref)
|
||||
for ref in reflist ]
|
||||
events = [ evnt for evnt in elist
|
||||
if int(evnt.get_type()) == EventType.MARRIAGE ]
|
||||
if events:
|
||||
date_obj = events[0].get_date_object()
|
||||
if date_obj:
|
||||
return DateHandler.displayer.display(date_obj)
|
||||
return u''
|
||||
|
||||
def children(self, obj):
|
||||
|
||||
Reference in New Issue
Block a user