9466: Include all place types in place report

This commit is contained in:
Nick Hall 2016-05-22 19:07:35 +01:00 committed by prculley
parent 3ea4b0d109
commit 9ab27bf83b

View File

@ -46,7 +46,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
FONT_SANS_SERIF, FONT_SERIF, FONT_SANS_SERIF, FONT_SERIF,
INDEX_TYPE_TOC, PARA_ALIGN_CENTER) INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
from gramps.gen.sort import Sort from gramps.gen.sort import Sort
from gramps.gen.utils.location import get_main_location from gramps.gen.utils.location import get_location_list
from gramps.gen.display.place import displayer as place_displayer from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.lib import PlaceType from gramps.gen.lib import PlaceType
from gramps.gen.errors import ReportError from gramps.gen.errors import ReportError
@ -171,17 +171,12 @@ class PlaceReport(Report):
This procedure writes out the details of a single place This procedure writes out the details of a single place
""" """
place = self.database.get_place_from_handle(handle) place = self.database.get_place_from_handle(handle)
location = get_main_location(self.database, place)
place_details = [ place_details = [self._("Gramps ID: %s ") % place.get_gramps_id()]
self._("Gramps ID: %s ") % place.get_gramps_id(), for level in get_location_list(self.database, place):
self._("Street: %s ") % location.get(PlaceType.STREET, ''), place_details.append("%(type)s: %(name)s " %
self._("Parish: %s ") % location.get(PlaceType.PARISH, ''), {'type': str(level[1]), 'name': level[0]})
self._("Locality: %s ") % location.get(PlaceType.LOCALITY, ''),
self._("City: %s ") % location.get(PlaceType.CITY, ''),
self._("County: %s ") % location.get(PlaceType.COUNTY, ''),
self._("State: %s") % location.get(PlaceType.STATE, ''),
self._("Country: %s ") % location.get(PlaceType.COUNTRY, '')]
place_names = '' place_names = ''
all_names = place.get_all_names() all_names = place.get_all_names()
if len(all_names) > 1 or __debug__: if len(all_names) > 1 or __debug__: