From 9ab27bf83bbc999dcaa24c4e68035ada9c94fc41 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 22 May 2016 19:07:35 +0100 Subject: [PATCH] 9466: Include all place types in place report --- gramps/plugins/textreport/placereport.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/gramps/plugins/textreport/placereport.py b/gramps/plugins/textreport/placereport.py index 97d39d304..b1ff09b67 100644 --- a/gramps/plugins/textreport/placereport.py +++ b/gramps/plugins/textreport/placereport.py @@ -46,7 +46,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle, FONT_SANS_SERIF, FONT_SERIF, INDEX_TYPE_TOC, PARA_ALIGN_CENTER) 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.lib import PlaceType from gramps.gen.errors import ReportError @@ -171,17 +171,12 @@ class PlaceReport(Report): This procedure writes out the details of a single place """ place = self.database.get_place_from_handle(handle) - location = get_main_location(self.database, place) - place_details = [ - self._("Gramps ID: %s ") % place.get_gramps_id(), - self._("Street: %s ") % location.get(PlaceType.STREET, ''), - self._("Parish: %s ") % location.get(PlaceType.PARISH, ''), - 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_details = [self._("Gramps ID: %s ") % place.get_gramps_id()] + for level in get_location_list(self.database, place): + place_details.append("%(type)s: %(name)s " % + {'type': str(level[1]), 'name': level[0]}) + place_names = '' all_names = place.get_all_names() if len(all_names) > 1 or __debug__: