change some "place_displayer" strings to the shorter "_pd"

This commit is contained in:
Paul Franklin 2016-07-02 20:50:31 -07:00
parent 8bfa3d13a3
commit 62d8487f14
12 changed files with 32 additions and 33 deletions

View File

@ -41,7 +41,7 @@ import os
from ...const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from ...datehandler import get_date
from ...display.place import displayer as place_displayer
from ...display.place import displayer as _pd
from ...utils.file import media_path_full
from ..docgen import IndexMark, INDEX_TYPE_ALP
@ -120,7 +120,7 @@ def roman(num):
def place_name(db, place_handle):
if place_handle:
place = db.get_place_from_handle(place_handle)
name = place_displayer.display(db, place)
name = _pd.display(db, place)
else:
name = ""
return str(name)

View File

@ -58,7 +58,7 @@ from gramps.gen.plug.report import utils
from gramps.gen.plug.report import MenuReportOptions
from gramps.gen.plug.report import stdoptions
from gramps.gen.datehandler import parser
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.display.place import displayer as _pd
from gramps.gen.proxy import CacheProxyDb
#------------------------------------------------------------------------
@ -437,7 +437,7 @@ class Extract:
"return place for given event"
place_handle = event.get_place_handle()
if place_handle:
place = place_displayer.display_event(self.db, event)
place = _pd.display_event(self.db, event)
if place:
return [place]
return [_T_("Place missing")]
@ -450,7 +450,7 @@ class Extract:
event = self.db.get_event_from_handle(event_handle)
place_handle = event.get_place_handle()
if place_handle:
place = place_displayer.display_event(self.db, event)
place = _pd.display_event(self.db, event)
if place:
places.append(place)
else:

View File

@ -54,7 +54,7 @@ from gramps.gen.updatecallback import UpdateCallback
from gramps.gen.utils.file import media_path_full
from gramps.gen.utils.place import conv_lat_lon
from gramps.gen.utils.location import get_main_location
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.display.place import displayer as _pd
#-------------------------------------------------------------------------
#
@ -1386,7 +1386,7 @@ class GedcomWriter(UpdateCallback):
+1 <<NOTE_STRUCTURE>> {0:M}
"""
if place is None: return
place_name = place_displayer.display(self.dbase, place, dateobj)
place_name = _pd.display(self.dbase, place, dateobj)
self._writeln(level, "PLAC", place_name.replace('\r', ' '), limit=120)
longitude = place.get_longitude()
latitude = place.get_latitude()

View File

@ -59,7 +59,7 @@ from gramps.gen.utils.file import media_path_full, find_file
from gramps.gen.utils.thumbnails import get_thumbnail_path
from gramps.gen.relationship import get_relationship_calculator
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.display.place import displayer as _pd
from gramps.gen.proxy import CacheProxyDb
#------------------------------------------------------------------------
@ -633,7 +633,7 @@ class RelGraphReport(Report):
empty string
"""
if event and self.event_choice in [2, 3, 5, 6, 7]:
return place_displayer.display_event(self._db, event)
return _pd.display_event(self._db, event)
return ''
#------------------------------------------------------------------------

View File

@ -133,7 +133,7 @@ from gramps.gui.dialog import WarningDialog
from gramps.gen.lib.const import IDENTICAL, DIFFERENT
from gramps.gen.lib import (StyledText, StyledTextTag, StyledTextTagType)
from gramps.plugins.lib.libplaceimport import PlaceImport
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.display.place import displayer as _pd
#-------------------------------------------------------------------------
#
@ -2964,7 +2964,7 @@ class GedcomParser(UpdateCallback):
sub_state.place.get_placeref_list())
if place is None:
place = sub_state.place
place_title = place_displayer.display(self.dbase, place)
place_title = _pd.display(self.dbase, place)
location = sub_state.pf.load_place(self.place_import, place, place_title)
self.dbase.add_place(place, self.trans)
# if 'location was created, then store it, now that we have a handle.
@ -2974,7 +2974,7 @@ class GedcomParser(UpdateCallback):
event.set_place_handle(place.get_handle())
else:
place.merge(sub_state.place)
place_title = place_displayer.display(self.dbase, place)
place_title = _pd.display(self.dbase, place)
location = sub_state.pf.load_place(self.place_import, place, place_title)
self.dbase.commit_place(place, self.trans)
if location:
@ -4502,7 +4502,7 @@ class GedcomParser(UpdateCallback):
state.msg += sub_state.msg
if sub_state.place:
place_title = place_displayer.display(self.dbase, sub_state.place)
place_title = _pd.display(self.dbase, sub_state.place)
sub_state.place_fields.load_place(self.place_import,
sub_state.place,
place_title)
@ -5077,7 +5077,7 @@ class GedcomParser(UpdateCallback):
state.msg += sub_state.msg
if sub_state.place:
place_title = place_displayer.display(self.dbase, sub_state.place)
place_title = _pd.display(self.dbase, sub_state.place)
sub_state.place_fields.load_place(self.place_import,
sub_state.place,
place_title)
@ -5570,7 +5570,7 @@ class GedcomParser(UpdateCallback):
else:
place.merge(state.place)
self.dbase.commit_place(place, self.trans)
place_title = place_displayer.display(self.dbase, place)
place_title = _pd.display(self.dbase, place)
state.pf.load_place(self.place_import, place, place_title)
# Create the Place Details (it is committed with the event)

View File

@ -41,7 +41,7 @@ Mary Smith was born on 3/28/1923.
from gramps.gen.lib import EventType, PlaceType, Location
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
from gramps.gen.utils.location import get_main_location
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.display.place import displayer as _pd
from gramps.gen.const import GRAMPS_LOCALE as glocale
@ -347,7 +347,7 @@ class PlaceFormat(GenericFormat):
return None
def _default_format(self, place):
return place_displayer.display(self.database, place)
return _pd.display(self.database, place)
def parse_format(self, database, place):
""" Parse the place """

View File

@ -58,7 +58,7 @@ from gramps.gen.plug.report import utils
from gramps.gen.plug.report import MenuReportOptions
from gramps.gen.plug.report import stdoptions
from gramps.plugins.lib.libnarrate import Narrator
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.display.place import displayer as _pd
from gramps.gen.proxy import CacheProxyDb
#------------------------------------------------------------------------
@ -431,7 +431,7 @@ class DetAncestorReport(Report):
else:
date = event.get_date_object().get_year()
place = place_displayer.display_event(self._db, event)
place = _pd.display_event(self._db, event)
self.doc.start_paragraph('DAR-MoreDetails')
if date and place:

View File

@ -58,7 +58,7 @@ from gramps.gen.plug.report import utils
from gramps.gen.plug.report import MenuReportOptions
from gramps.gen.plug.report import stdoptions
from gramps.plugins.lib.libnarrate import Narrator
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.display.place import displayer as _pd
from gramps.gen.proxy import CacheProxyDb
#------------------------------------------------------------------------
@ -440,7 +440,7 @@ class DetDescendantReport(Report):
else:
date = event.get_date_object().get_year()
place = place_displayer.display_event(self._db, event)
place = _pd.display_event(self._db, event)
self.doc.start_paragraph('DDR-MoreDetails')
event_name = self._get_type(event.get_type())

View File

@ -48,7 +48,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
TableStyle, TableCellStyle,
FONT_SANS_SERIF, FONT_SERIF,
INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.display.place import displayer as _pd
from gramps.gen.proxy import CacheProxyDb
#------------------------------------------------------------------------
@ -120,7 +120,7 @@ class FamilyGroup(Report):
descr = ""
if event:
date = self._get_date(event.get_date_object())
place = place_displayer.display_event(self.db, event)
place = _pd.display_event(self.db, event)
if place is None:
place = ''
descr = event.get_description()
@ -435,7 +435,7 @@ class FamilyGroup(Report):
date = self._get_date(event.get_date_object())
place_handle = event.get_place_handle()
if place_handle:
place = place_displayer.display_event(self.db, event)
place = _pd.display_event(self.db, event)
if place is None:
place = ''

View File

@ -47,7 +47,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
TableStyle, TableCellStyle,
FONT_SANS_SERIF, INDEX_TYPE_TOC,
PARA_ALIGN_CENTER, PARA_ALIGN_RIGHT)
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.display.place import displayer as _pd
from gramps.gen.plug.menu import (BooleanOption, FilterOption, PersonOption,
BooleanListOption)
from gramps.gen.plug.report import Report
@ -172,7 +172,7 @@ class IndivCompleteReport(Report):
place_handle = event.get_place_handle()
if place_handle:
place = self._db.get_place_from_handle(place_handle)
place_name = place_displayer.display_event(self._db, event)
place_name = _pd.display_event(self._db, event)
place_endnote = self._cite_endnote(place)
# make sure it's translated, so it can be used below, in "combine"
ignore = _('%(str1)s in %(str2)s. ') % {'str1':'', 'str2':''}
@ -471,7 +471,7 @@ class IndivCompleteReport(Report):
place_handle = lds_ord.get_place_handle()
if place_handle:
place = self._db.get_place_from_handle(place_handle)
place_name = place_displayer.display_event(self._db, lds_ord)
place_name = _pd.display_event(self._db, lds_ord)
place_endnote = self._cite_endnote(place)
endnotes = self._cite_endnote(lds_ord, prior=place_endnote)
self.doc.start_row()
@ -666,8 +666,7 @@ class IndivCompleteReport(Report):
place_handle = lds_ord.get_place_handle()
if place_handle:
place = self._db.get_place_from_handle(place_handle)
place_name = place_displayer.display_event(self._db,
lds_ord)
place_name = _pd.display_event(self._db, lds_ord)
place_endnote = self._cite_endnote(place)
endnotes = self._cite_endnote(lds_ord, prior=place_endnote)
self.doc.start_row()

View File

@ -47,7 +47,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
INDEX_TYPE_TOC, PARA_ALIGN_CENTER)
from gramps.gen.sort import Sort
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 _pd
from gramps.gen.errors import ReportError
from gramps.gen.proxy import LivingProxyDb, CacheProxyDb
@ -193,7 +193,7 @@ class PlaceReport(Report):
place_names += ' (%s)' % place_name.get_language()
place_details += [self._("places|All Names: %s") % place_names,]
self.doc.start_paragraph("PLC-PlaceTitle")
place_title = place_displayer.display(self._db, place)
place_title = _pd.display(self._db, place)
self.doc.write_text(("%(nbr)s. %(place)s") % {'nbr' : place_nbr,
'place' : place_title})
self.doc.end_paragraph()

View File

@ -50,7 +50,7 @@ from gramps.gen.lib import NoteType, UrlType
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.errors import ReportError
from gramps.gen.utils.db import get_participant_from_event
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.display.place import displayer as _pd
from gramps.gen.proxy import LivingProxyDb, CacheProxyDb
#------------------------------------------------------------------------
@ -437,7 +437,7 @@ class TagReport(Report):
for place_handle in place_list:
place = self.database.get_place_from_handle(place_handle)
place_title = place_displayer.display(self.database, place)
place_title = _pd.display(self.database, place)
self.doc.start_row()