0002542: Crash whilst generating web pages from command line

Throwing Report Error if center person is not in database. Added catching of Report Error to CommandLineReport
if using GUI it is not possible to cause this, as you have to select a person that is in the DB. However on the command line you can specify any PID and even no person with that pid exists an error was thrown.

svn: r13004
This commit is contained in:
Raphael Ackermann
2009-08-14 07:14:25 +00:00
parent 9b676e0f0f
commit 30d6eebd0b
17 changed files with 169 additions and 143 deletions

View File

@@ -37,11 +37,12 @@ from gettext import gettext as _
# GRAMPS modules
#
#------------------------------------------------------------------------
from gen.plug import PluginManager
from gen.plug.menu import PersonOption, BooleanOption, NumberOption, \
EnumeratedListOption
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_GRAPHVIZ
from BasicUtils import name_displayer
from Errors import ReportError
from gen.plug import PluginManager
from gen.plug.menu import (PersonOption, BooleanOption, NumberOption,
EnumeratedListOption)
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_GRAPHVIZ
import DateHandler
#------------------------------------------------------------------------
@@ -94,6 +95,8 @@ class HourGlassReport(Report):
self.max_ascend = menu.get_option_by_name('maxascend').get_value()
pid = menu.get_option_by_name('pid').get_value()
self.center_person = database.get_person_from_gramps_id(pid)
if (self.center_person == None) :
raise ReportError(_("Person %s is not in the Database") % pid )
self.colorize = menu.get_option_by_name('color').get_value()
if self.colorize == 'colored':
self.colors = colored