0001835: cli crashes for all reports. NoneType has no attribute get_gramps_id

svn: r10126
This commit is contained in:
Brian Matherly 2008-02-27 03:03:20 +00:00
parent 7bd31dd4f1
commit fe6c305a14
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-02-26 Brian Matherly <brian@gramps-project.org>
* src/ReportBase/_CommandLineReport.py:
0001835: cli crashes for all reports. NoneType has no attribute
get_gramps_id
2008-02-26 Benny Malengier <benny.malengier@gramps-project.org> 2008-02-26 Benny Malengier <benny.malengier@gramps-project.org>
* src/ScratchPad.py: bug when dragging sourceref #1833 * src/ScratchPad.py: bug when dragging sourceref #1833
* src/GrampsDisplay.py: remove whitespace * src/GrampsDisplay.py: remove whitespace

View File

@ -28,12 +28,17 @@
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gettext import gettext as _ from gettext import gettext as _
import sys
import logging import logging
log = logging.getLogger(".") log = logging.getLogger(".")
#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------
import PluginUtils import PluginUtils
from BasicUtils import name_displayer
import Utils import Utils
import BaseDoc import BaseDoc
from ReportBase import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK, \ from ReportBase import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK, \
@ -68,6 +73,9 @@ def _initialize_options(options, dbase):
if not person: if not person:
person = dbase.get_default_person() person = dbase.get_default_person()
option.set_value(person.get_gramps_id()) option.set_value(person.get_gramps_id())
if not person:
print "Please specify a person"
sys.exit(0)
elif isinstance(option, PluginUtils.FamilyOption): elif isinstance(option, PluginUtils.FamilyOption):
fid = option.get_value() fid = option.get_value()