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 from ...const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
from ...datehandler import get_date 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 ...utils.file import media_path_full
from ..docgen import IndexMark, INDEX_TYPE_ALP from ..docgen import IndexMark, INDEX_TYPE_ALP
@ -120,7 +120,7 @@ def roman(num):
def place_name(db, place_handle): def place_name(db, place_handle):
if place_handle: if place_handle:
place = db.get_place_from_handle(place_handle) place = db.get_place_from_handle(place_handle)
name = place_displayer.display(db, place) name = _pd.display(db, place)
else: else:
name = "" name = ""
return str(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 MenuReportOptions
from gramps.gen.plug.report import stdoptions from gramps.gen.plug.report import stdoptions
from gramps.gen.datehandler import parser 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 from gramps.gen.proxy import CacheProxyDb
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -437,7 +437,7 @@ class Extract:
"return place for given event" "return place for given event"
place_handle = event.get_place_handle() place_handle = event.get_place_handle()
if place_handle: if place_handle:
place = place_displayer.display_event(self.db, event) place = _pd.display_event(self.db, event)
if place: if place:
return [place] return [place]
return [_T_("Place missing")] return [_T_("Place missing")]
@ -450,7 +450,7 @@ class Extract:
event = self.db.get_event_from_handle(event_handle) event = self.db.get_event_from_handle(event_handle)
place_handle = event.get_place_handle() place_handle = event.get_place_handle()
if place_handle: if place_handle:
place = place_displayer.display_event(self.db, event) place = _pd.display_event(self.db, event)
if place: if place:
places.append(place) places.append(place)
else: 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.file import media_path_full
from gramps.gen.utils.place import conv_lat_lon from gramps.gen.utils.place import conv_lat_lon
from gramps.gen.utils.location import get_main_location 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} +1 <<NOTE_STRUCTURE>> {0:M}
""" """
if place is None: return 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) self._writeln(level, "PLAC", place_name.replace('\r', ' '), limit=120)
longitude = place.get_longitude() longitude = place.get_longitude()
latitude = place.get_latitude() 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.utils.thumbnails import get_thumbnail_path
from gramps.gen.relationship import get_relationship_calculator 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.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 from gramps.gen.proxy import CacheProxyDb
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -633,7 +633,7 @@ class RelGraphReport(Report):
empty string empty string
""" """
if event and self.event_choice in [2, 3, 5, 6, 7]: 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 '' 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.const import IDENTICAL, DIFFERENT
from gramps.gen.lib import (StyledText, StyledTextTag, StyledTextTagType) from gramps.gen.lib import (StyledText, StyledTextTag, StyledTextTagType)
from gramps.plugins.lib.libplaceimport import PlaceImport 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()) sub_state.place.get_placeref_list())
if place is None: if place is None:
place = sub_state.place 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) location = sub_state.pf.load_place(self.place_import, place, place_title)
self.dbase.add_place(place, self.trans) self.dbase.add_place(place, self.trans)
# if 'location was created, then store it, now that we have a handle. # 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()) event.set_place_handle(place.get_handle())
else: else:
place.merge(sub_state.place) 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) location = sub_state.pf.load_place(self.place_import, place, place_title)
self.dbase.commit_place(place, self.trans) self.dbase.commit_place(place, self.trans)
if location: if location:
@ -4502,7 +4502,7 @@ class GedcomParser(UpdateCallback):
state.msg += sub_state.msg state.msg += sub_state.msg
if sub_state.place: 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_fields.load_place(self.place_import,
sub_state.place, sub_state.place,
place_title) place_title)
@ -5077,7 +5077,7 @@ class GedcomParser(UpdateCallback):
state.msg += sub_state.msg state.msg += sub_state.msg
if sub_state.place: 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_fields.load_place(self.place_import,
sub_state.place, sub_state.place,
place_title) place_title)
@ -5570,7 +5570,7 @@ class GedcomParser(UpdateCallback):
else: else:
place.merge(state.place) place.merge(state.place)
self.dbase.commit_place(place, self.trans) 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) state.pf.load_place(self.place_import, place, place_title)
# Create the Place Details (it is committed with the event) # 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.lib import EventType, PlaceType, Location
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback 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.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 from gramps.gen.const import GRAMPS_LOCALE as glocale
@ -347,7 +347,7 @@ class PlaceFormat(GenericFormat):
return None return None
def _default_format(self, place): def _default_format(self, place):
return place_displayer.display(self.database, place) return _pd.display(self.database, place)
def parse_format(self, database, place): def parse_format(self, database, place):
""" Parse the 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 MenuReportOptions
from gramps.gen.plug.report import stdoptions from gramps.gen.plug.report import stdoptions
from gramps.plugins.lib.libnarrate import Narrator 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 from gramps.gen.proxy import CacheProxyDb
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -431,7 +431,7 @@ class DetAncestorReport(Report):
else: else:
date = event.get_date_object().get_year() 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') self.doc.start_paragraph('DAR-MoreDetails')
if date and place: 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 MenuReportOptions
from gramps.gen.plug.report import stdoptions from gramps.gen.plug.report import stdoptions
from gramps.plugins.lib.libnarrate import Narrator 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 from gramps.gen.proxy import CacheProxyDb
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -440,7 +440,7 @@ class DetDescendantReport(Report):
else: else:
date = event.get_date_object().get_year() 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') self.doc.start_paragraph('DDR-MoreDetails')
event_name = self._get_type(event.get_type()) 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, TableStyle, TableCellStyle,
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.display.place import displayer as place_displayer from gramps.gen.display.place import displayer as _pd
from gramps.gen.proxy import CacheProxyDb from gramps.gen.proxy import CacheProxyDb
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -120,7 +120,7 @@ class FamilyGroup(Report):
descr = "" descr = ""
if event: if event:
date = self._get_date(event.get_date_object()) 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: if place is None:
place = '' place = ''
descr = event.get_description() descr = event.get_description()
@ -435,7 +435,7 @@ class FamilyGroup(Report):
date = self._get_date(event.get_date_object()) date = self._get_date(event.get_date_object())
place_handle = event.get_place_handle() place_handle = event.get_place_handle()
if place_handle: if place_handle:
place = place_displayer.display_event(self.db, event) place = _pd.display_event(self.db, event)
if place is None: if place is None:
place = '' place = ''

View File

@ -47,7 +47,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
TableStyle, TableCellStyle, TableStyle, TableCellStyle,
FONT_SANS_SERIF, INDEX_TYPE_TOC, FONT_SANS_SERIF, INDEX_TYPE_TOC,
PARA_ALIGN_CENTER, PARA_ALIGN_RIGHT) 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, from gramps.gen.plug.menu import (BooleanOption, FilterOption, PersonOption,
BooleanListOption) BooleanListOption)
from gramps.gen.plug.report import Report from gramps.gen.plug.report import Report
@ -172,7 +172,7 @@ class IndivCompleteReport(Report):
place_handle = event.get_place_handle() place_handle = event.get_place_handle()
if place_handle: if place_handle:
place = self._db.get_place_from_handle(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) place_endnote = self._cite_endnote(place)
# make sure it's translated, so it can be used below, in "combine" # make sure it's translated, so it can be used below, in "combine"
ignore = _('%(str1)s in %(str2)s. ') % {'str1':'', 'str2':''} ignore = _('%(str1)s in %(str2)s. ') % {'str1':'', 'str2':''}
@ -471,7 +471,7 @@ class IndivCompleteReport(Report):
place_handle = lds_ord.get_place_handle() place_handle = lds_ord.get_place_handle()
if place_handle: if place_handle:
place = self._db.get_place_from_handle(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) place_endnote = self._cite_endnote(place)
endnotes = self._cite_endnote(lds_ord, prior=place_endnote) endnotes = self._cite_endnote(lds_ord, prior=place_endnote)
self.doc.start_row() self.doc.start_row()
@ -666,8 +666,7 @@ class IndivCompleteReport(Report):
place_handle = lds_ord.get_place_handle() place_handle = lds_ord.get_place_handle()
if place_handle: if place_handle:
place = self._db.get_place_from_handle(place_handle) place = self._db.get_place_from_handle(place_handle)
place_name = place_displayer.display_event(self._db, place_name = _pd.display_event(self._db, lds_ord)
lds_ord)
place_endnote = self._cite_endnote(place) place_endnote = self._cite_endnote(place)
endnotes = self._cite_endnote(lds_ord, prior=place_endnote) endnotes = self._cite_endnote(lds_ord, prior=place_endnote)
self.doc.start_row() 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) 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_location_list 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.errors import ReportError
from gramps.gen.proxy import LivingProxyDb, CacheProxyDb from gramps.gen.proxy import LivingProxyDb, CacheProxyDb
@ -193,7 +193,7 @@ class PlaceReport(Report):
place_names += ' (%s)' % place_name.get_language() place_names += ' (%s)' % place_name.get_language()
place_details += [self._("places|All Names: %s") % place_names,] place_details += [self._("places|All Names: %s") % place_names,]
self.doc.start_paragraph("PLC-PlaceTitle") 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, self.doc.write_text(("%(nbr)s. %(place)s") % {'nbr' : place_nbr,
'place' : place_title}) 'place' : place_title})
self.doc.end_paragraph() 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.filters import GenericFilterFactory, rules
from gramps.gen.errors import ReportError from gramps.gen.errors import ReportError
from gramps.gen.utils.db import get_participant_from_event 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 from gramps.gen.proxy import LivingProxyDb, CacheProxyDb
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -437,7 +437,7 @@ class TagReport(Report):
for place_handle in place_list: for place_handle in place_list:
place = self.database.get_place_from_handle(place_handle) 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() self.doc.start_row()