Report error exceptions
svn: r1275
This commit is contained in:
@@ -46,6 +46,7 @@ import TextDoc
|
||||
import Report
|
||||
import Errors
|
||||
import FontScale
|
||||
from QuestionDialog import ErrorDialog
|
||||
from SubstKeywords import SubstKeywords
|
||||
from intl import gettext as _
|
||||
|
||||
@@ -255,6 +256,8 @@ class AncestorChartDialog(Report.DrawReportDialog):
|
||||
MyReport = AncestorChart(self.db, self.person, self.target_path,
|
||||
self.max_gen, self.doc, self.report_text)
|
||||
MyReport.write_report()
|
||||
except Errors.ReportError, msg:
|
||||
ErrorDialog(str(msg))
|
||||
except:
|
||||
import DisplayTrace
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
@@ -28,14 +28,6 @@
|
||||
import os
|
||||
import string
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# GNOME/GTK
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import gtk
|
||||
import gnome.ui
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# gramps modules
|
||||
@@ -44,6 +36,8 @@ import gnome.ui
|
||||
import Report
|
||||
import TextDoc
|
||||
import RelLib
|
||||
import Errors
|
||||
from QuestionDialog import ErrorDialog
|
||||
from intl import gettext as _
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@@ -60,11 +54,7 @@ class AncestorReport(Report.Report):
|
||||
self.max_generations = max
|
||||
self.pgbrk = pgbrk
|
||||
self.doc = doc
|
||||
|
||||
try:
|
||||
self.doc.open(output)
|
||||
except IOError,msg:
|
||||
gnome.ui.GnomeErrorDialog(_("Could not open %s") % output + "\n" + msg)
|
||||
self.doc.open(output)
|
||||
|
||||
def filter(self,person,index):
|
||||
if person == None or index >= (1 << 30):
|
||||
@@ -277,11 +267,12 @@ class AncestorReportDialog(Report.TextReportDialog):
|
||||
MyReport = AncestorReport(self.db, self.person, self.target_path,
|
||||
self.max_gen, self.doc, self.pg_brk)
|
||||
MyReport.write_report()
|
||||
except Errors.ReportError, msg:
|
||||
ErrorDialog(str(msg))
|
||||
except:
|
||||
import DisplayTrace
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
|
||||
@@ -48,6 +48,7 @@ import Errors
|
||||
|
||||
from SubstKeywords import SubstKeywords
|
||||
from intl import gettext as _
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -341,6 +342,8 @@ class DescendantReportDialog(Report.DrawReportDialog):
|
||||
MyReport = DescendantReport(self.db,self.report_text,
|
||||
self.person, self.target_path, self.doc)
|
||||
MyReport.write_report()
|
||||
except Errors.ReportError, msg:
|
||||
ErrorDialog(str(msg))
|
||||
except:
|
||||
import DisplayTrace
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
@@ -36,6 +36,9 @@ import string
|
||||
#------------------------------------------------------------------------
|
||||
import Report
|
||||
import TextDoc
|
||||
import Errors
|
||||
|
||||
from QuestionDialog import ErrorDialog
|
||||
from intl import gettext as _
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@@ -161,6 +164,8 @@ class DescendantReportDialog(Report.TextReportDialog):
|
||||
MyReport.setup()
|
||||
MyReport.report()
|
||||
MyReport.end()
|
||||
except Errors.ReportError, msg:
|
||||
ErrorDialog(str(msg))
|
||||
except:
|
||||
import DisplayTrace
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
@@ -24,7 +23,10 @@
|
||||
import RelLib
|
||||
import os
|
||||
import sort
|
||||
import Errors
|
||||
|
||||
from intl import gettext as _
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
from Report import *
|
||||
from TextDoc import *
|
||||
@@ -733,10 +735,15 @@ class DetAncestorReportDialog(TextReportDialog):
|
||||
"""Create the object that will produce the Detailed Ancestral
|
||||
Report. All user dialog has already been handled and the
|
||||
output file opened."""
|
||||
MyReport = DetAncestorReport(self.db, self.person, self.target_path,
|
||||
self.max_gen, self.pg_brk, self.doc)
|
||||
MyReport.write_report()
|
||||
|
||||
try:
|
||||
MyReport = DetAncestorReport(self.db, self.person, self.target_path,
|
||||
self.max_gen, self.pg_brk, self.doc)
|
||||
MyReport.write_report()
|
||||
except Errors.ReportError, msg:
|
||||
ErrorDialog(str(msg))
|
||||
except:
|
||||
import DisplayTrace
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -26,11 +26,13 @@ import os
|
||||
import sort
|
||||
from intl import gettext as _
|
||||
|
||||
import Errors
|
||||
from Report import *
|
||||
from TextDoc import *
|
||||
|
||||
import gtk
|
||||
import gnome.ui
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -761,10 +763,15 @@ class DetDescendantReportDialog(TextReportDialog):
|
||||
"""Create the object that will produce the Detailed Ancestral
|
||||
Report. All user dialog has already been handled and the
|
||||
output file opened."""
|
||||
MyReport = DetDescendantReport(self.db, self.person, self.target_path,
|
||||
self.max_gen, self.pg_brk, self.doc)
|
||||
MyReport.write_report()
|
||||
|
||||
try:
|
||||
MyReport = DetDescendantReport(self.db, self.person, self.target_path,
|
||||
self.max_gen, self.pg_brk, self.doc)
|
||||
MyReport.write_report()
|
||||
except Errors.ReportError, msg:
|
||||
ErrorDialog(str(msg))
|
||||
except:
|
||||
import DisplayTrace
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
def add_user_options(self):
|
||||
|
||||
|
||||
@@ -35,7 +35,9 @@ import os
|
||||
import RelLib
|
||||
import Report
|
||||
import TextDoc
|
||||
import Errors
|
||||
from intl import gettext as _
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -438,9 +440,15 @@ class FamilyGroupDialog(Report.TextReportDialog):
|
||||
"""Create the object that will produce the Ancestor Chart.
|
||||
All user dialog has already been handled and the output file
|
||||
opened."""
|
||||
MyReport = FamilyGroup(self.db, self.report_menu, self.target_path, self.doc)
|
||||
MyReport.setup()
|
||||
MyReport.write_report()
|
||||
try:
|
||||
MyReport = FamilyGroup(self.db, self.report_menu, self.target_path, self.doc)
|
||||
MyReport.setup()
|
||||
MyReport.write_report()
|
||||
except Errors.ReportError, msg:
|
||||
ErrorDialog(str(msg))
|
||||
except:
|
||||
import DisplayTrace
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
@@ -37,6 +37,8 @@ import TextDoc
|
||||
import StyleEditor
|
||||
import Report
|
||||
import GenericFilter
|
||||
import Errors
|
||||
from QuestionDialog import ErrorDialog
|
||||
from intl import gettext as _
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@@ -532,10 +534,17 @@ class IndivSummaryDialog(Report.TextReportDialog):
|
||||
opened."""
|
||||
|
||||
act = self.use_srcs.get_active()
|
||||
MyReport = IndivComplete(self.db, self.person, self.target_path,
|
||||
self.doc, self.filter, act)
|
||||
MyReport.setup()
|
||||
MyReport.write_report()
|
||||
try:
|
||||
MyReport = IndivComplete(self.db, self.person, self.target_path,
|
||||
self.doc, self.filter, act)
|
||||
MyReport.setup()
|
||||
MyReport.write_report()
|
||||
except Errors.ReportError, msg:
|
||||
ErrorDialog(str(msg))
|
||||
except:
|
||||
import DisplayTrace
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
|
||||
def get_report_generations(self):
|
||||
"""Return the default number of generations to start the
|
||||
|
||||
@@ -45,6 +45,8 @@ import const
|
||||
import TextDoc
|
||||
import StyleEditor
|
||||
import Report
|
||||
import Errors
|
||||
from QuestionDialog import ErrorDialog
|
||||
from intl import gettext as _
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@@ -373,9 +375,15 @@ class IndivSummaryDialog(Report.TextReportDialog):
|
||||
"""Create the object that will produce the Ancestor Chart.
|
||||
All user dialog has already been handled and the output file
|
||||
opened."""
|
||||
MyReport = IndivSummary(self.db, self.person, self.target_path, self.doc)
|
||||
MyReport.setup()
|
||||
MyReport.write_report()
|
||||
try:
|
||||
MyReport = IndivSummary(self.db, self.person, self.target_path, self.doc)
|
||||
MyReport.setup()
|
||||
MyReport.write_report()
|
||||
except Errors.ReportError, msg:
|
||||
ErrorDialog(str(msg))
|
||||
except:
|
||||
import DisplayTrace
|
||||
DisplayTrace.DisplayTrace()
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user