diff --git a/ChangeLog b/ChangeLog index d46485626..763123f5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,60 @@ 2007-06-27 Alex Roitman + * src/TreeViews/_PersonTreeView.py: Use name_displayer. + * src/ReportBase/_ReportUtils.py: Use name_displayer. + * src/ReportBase/_CommandLineReport.py: Use name_displayer. + * src/ReportBase/_BareReportDialog.py: Use name_displayer. + * src/PluginUtils/_Tool.py: Use name_displayer. + * src/plugins/TimeLine.py: Use name_displayer. + * src/plugins/RelCalc.py: Use name_displayer. + * src/plugins/ReadGrdb.py: Use name_displayer. + * src/plugins/NarrativeWeb.py: Use name_displayer. + * src/plugins/IndivComplete.py: Use name_displayer. + * src/plugins/GraphViz.py: Use name_displayer. + * src/plugins/FindDupes.py: Use name_displayer. + * src/plugins/FamilyGroup.py: Use name_displayer. + * src/plugins/DetDescendantReport.py: Use name_displayer. + * src/plugins/DetAncestralReport.py: Use name_displayer. + * src/plugins/DesGraph.py: Use name_displayer. + * src/plugins/DescendReport.py: Use name_displayer. + * src/plugins/DescendChart.py: Use name_displayer. + * src/plugins/Check.py: Use name_displayer. + * src/plugins/Ancestors.py: Use name_displayer. + * src/plugins/AncestorReport.py: Use name_displayer. + * src/plugins/AncestorChart2.py: Use name_displayer. + * src/ObjectSelector/_PersonTreeFrame.py: Use name_displayer. + * src/ObjectSelector/_PersonFrame.py: Use name_displayer. + * src/Merge/_MergePerson.py: Use name_displayer. + * src/GrampsDbUtils/_WriteGedcom.py: Use name_displayer. + * src/GrampsDbUtils/_ReadXML.py: Use name_displayer. + * src/GrampsDbUtils/_GedcomParse.py: Use name_displayer. + * src/FilterEditor/_ShowResults.py: Use name_displayer. + * src/FilterEditor/_EditRule.py: Use name_displayer. + * src/Editors/_EditPrimary.py: Use name_displayer. + * src/Editors/_EditPersonRef.py: Use name_displayer. + * src/Editors/_EditPerson.py: Use name_displayer. + * src/Editors/_EditName.py: Use name_displayer. + * src/Editors/_EditLdsOrd.py: Use name_displayer. + * src/Editors/_EditFamily.py: Use name_displayer. + * src/DisplayTabs/_PersonRefModel.py: Use name_displayer. + * src/DisplayTabs/_NameModel.py: Use name_displayer. + * src/DisplayTabs/_ChildModel.py: Use name_displayer. + * src/DisplayTabs/_BackRefModel.py: Use name_displayer. + * src/DisplayModels/_PeopleModel.py: Use name_displayer. + * src/DisplayModels/_FamilyModel.py: Use name_displayer. + * src/DataViews/_PersonView.py: Use name_displayer. + * src/DataViews/_RelationView.py: Use name_displayer. + * src/DataViews/_PedigreeView.py: Use name_displayer. + * src/Utils.py: Use name_displayer. + * src/SubstKeywords.py: Use name_displayer. + * src/Sort.py: Use name_displayer. + * src/Reorder.py: Use name_displayer. + * src/PageView.py (BookMarkView.add_bookmark): Use name_displayer. + * src/Navigation.py: Use name_displayer. + * src/DisplayState.py: Use name_displayer. + * src/GrampsCfg.py: Use name_displayer. + * src/Bookmarks.py (Bookmarks.make_label): Use name_displayer. + * src/GrampsDb/Makefile.am (pkgdata_PYTHON): Ship new files. + * src/Makefile.am (gdir_PYTHON): Ship ProgressDialog.py * src/ReportBase/Makefile.am: Ship new files. * src/GrampsLocale/Makefile.am: Ship __init__.py. * src/RelLib/Makefile.am: Ship _BasicPrimaryObject.py. diff --git a/gramps.sh.in b/gramps.sh.in index eeed1add4..d80158720 100644 --- a/gramps.sh.in +++ b/gramps.sh.in @@ -21,19 +21,8 @@ # prefix=@prefix@ -exec_prefix=@exec_prefix@ PACKAGE=@PACKAGE@ export GRAMPSDIR=@datadir@/@PACKAGE@ -export GRAMPSPLUGINSDIR=$GRAMPSDIR/plugins:$GRAMPSDIR/docgen -export GRAMPSLIBDIR=@libdir@/@PACKAGE@ -export GRAMPSI18N=@prefix@/share/locale - -if [ "$PYTHONPATH" = "" ] -then - export PYTHONPATH=$GRAMPSDIR:$GRAMPSPLUGINSDIR:$GRAMPSLIBDIR -else - export PYTHONPATH=$GRAMPSDIR:$GRAMPSLIBDIR:$GRAMPSPLUGINSDIR:$PYTHONPATH -fi exec @PYTHON@ $GRAMPSDIR/gramps.py "$@" diff --git a/src/BasicUtils/NameDisplay.py b/src/BasicUtils/_NameDisplay.py similarity index 100% rename from src/BasicUtils/NameDisplay.py rename to src/BasicUtils/_NameDisplay.py diff --git a/src/BasicUtils/BasicUtils.py b/src/BasicUtils/_UpdateCallback.py similarity index 98% rename from src/BasicUtils/BasicUtils.py rename to src/BasicUtils/_UpdateCallback.py index 2430a5565..0b7d96f6c 100644 --- a/src/BasicUtils/BasicUtils.py +++ b/src/BasicUtils/_UpdateCallback.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2004-2006 Donald N. Allingham +# Copyright (C) 2004-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/BasicUtils/__init__.py b/src/BasicUtils/__init__.py index f982c1810..bb30a89b2 100644 --- a/src/BasicUtils/__init__.py +++ b/src/BasicUtils/__init__.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2004-2006 Donald N. Allingham +# Copyright (C) 2004-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,4 +20,5 @@ # $Id: $ -from BasicUtils import UpdateCallback +from _UpdateCallback import UpdateCallback +from _NameDisplay import displayer as name_displayer diff --git a/src/Bookmarks.py b/src/Bookmarks.py index 2ad08f173..d6d5a5a73 100644 --- a/src/Bookmarks.py +++ b/src/Bookmarks.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -54,7 +54,7 @@ import gtk # #------------------------------------------------------------------------- import GrampsDisplay -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import ListModel import Utils @@ -159,7 +159,7 @@ class Bookmarks : def make_label(self, handle): person = self.dbstate.db.get_person_from_handle(handle) - name = NameDisplay.displayer.display(person) + name = name_displayer.display(person) return ("%s [%s]" % (name, person.gramps_id), person) def callback(self, handle): diff --git a/src/DataViews/_PedigreeView.py b/src/DataViews/_PedigreeView.py index e691e63aa..1785acd5a 100644 --- a/src/DataViews/_PedigreeView.py +++ b/src/DataViews/_PedigreeView.py @@ -3,7 +3,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2001-2006 Donald N. Allingham, Martin Hawlisch +# Copyright (C) 2001-2007 Donald N. Allingham, Martin Hawlisch # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ except: #------------------------------------------------------------------------- import RelLib import PageView -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import Utils import DateHandler import ImgManip @@ -393,12 +393,12 @@ class FormattingHelper: if person.handle in self._markup_cache: if line_count in self._markup_cache[person.handle]: return self._markup_cache[person.handle][line_count] - name = escape(NameDisplay.displayer.display(person)) + name = escape(name_displayer.display(person)) else: if person.handle in self._text_cache: if line_count in self._text_cache[person.handle]: return self._text_cache[person.handle][line_count] - name = NameDisplay.displayer.display(person) + name = name_displayer.display(person) text = name if line_count >= 3: birth = ReportUtils.get_birth_or_fallback(self.dbstate.db, person) @@ -1182,7 +1182,7 @@ class PedigreeView(PageView.PersonNavView): myMenu = gtk.Menu() for child_handle in childlist: child = self.dbstate.db.get_person_from_handle(child_handle) - cname = escape(NameDisplay.displayer.display(child)) + cname = escape(name_displayer.display(child)) if find_children(self.dbstate.db,child): label = gtk.Label('%s' % cname) else: @@ -1416,7 +1416,7 @@ class PedigreeView(PageView.PersonNavView): go_image = gtk.image_new_from_stock(gtk.STOCK_JUMP_TO,gtk.ICON_SIZE_MENU) go_image.show() - go_item = gtk.ImageMenuItem(NameDisplay.displayer.display(person)) + go_item = gtk.ImageMenuItem(name_displayer.display(person)) go_item.set_image(go_image) go_item.connect("activate",self.on_childmenu_changed,person_handle) go_item.show() @@ -1456,7 +1456,7 @@ class PedigreeView(PageView.PersonNavView): go_image = gtk.image_new_from_stock(gtk.STOCK_JUMP_TO,gtk.ICON_SIZE_MENU) go_image.show() - sp_item = gtk.ImageMenuItem(NameDisplay.displayer.display(spouse)) + sp_item = gtk.ImageMenuItem(name_displayer.display(spouse)) sp_item.set_image(go_image) linked_persons.append(sp_id) sp_item.connect("activate",self.on_childmenu_changed,sp_id) @@ -1490,9 +1490,9 @@ class PedigreeView(PageView.PersonNavView): sib_menu = item.get_submenu() if find_children(self.dbstate.db,sib): - label = gtk.Label('%s' % escape(NameDisplay.displayer.display(sib))) + label = gtk.Label('%s' % escape(name_displayer.display(sib))) else: - label = gtk.Label(escape(NameDisplay.displayer.display(sib))) + label = gtk.Label(escape(name_displayer.display(sib))) go_image = gtk.image_new_from_stock(gtk.STOCK_JUMP_TO,gtk.ICON_SIZE_MENU) go_image.show() @@ -1527,9 +1527,9 @@ class PedigreeView(PageView.PersonNavView): child_menu = item.get_submenu() if find_children(self.dbstate.db,child): - label = gtk.Label('%s' % escape(NameDisplay.displayer.display(child))) + label = gtk.Label('%s' % escape(name_displayer.display(child))) else: - label = gtk.Label(escape(NameDisplay.displayer.display(child))) + label = gtk.Label(escape(name_displayer.display(child))) go_image = gtk.image_new_from_stock(gtk.STOCK_JUMP_TO,gtk.ICON_SIZE_MENU) go_image.show() @@ -1564,9 +1564,9 @@ class PedigreeView(PageView.PersonNavView): par_menu = item.get_submenu() if find_parents(self.dbstate.db,par): - label = gtk.Label('%s' % escape(NameDisplay.displayer.display(par))) + label = gtk.Label('%s' % escape(name_displayer.display(par))) else: - label = gtk.Label(escape(NameDisplay.displayer.display(par))) + label = gtk.Label(escape(name_displayer.display(par))) go_image = gtk.image_new_from_stock(gtk.STOCK_JUMP_TO,gtk.ICON_SIZE_MENU) go_image.show() @@ -1602,7 +1602,7 @@ class PedigreeView(PageView.PersonNavView): item.set_submenu(gtk.Menu()) per_menu = item.get_submenu() - label = gtk.Label(escape(NameDisplay.displayer.display(per))) + label = gtk.Label(escape(name_displayer.display(per))) go_image = gtk.image_new_from_stock(gtk.STOCK_JUMP_TO,gtk.ICON_SIZE_MENU) go_image.show() @@ -1743,7 +1743,7 @@ def find_witnessed_people(db,p): #------------------------------------------------------------------------- def build_detail_string(db,person): - detail_text = NameDisplay.displayer.display(person) + detail_text = name_displayer.display(person) def format_event(db, label, event): if not event: diff --git a/src/DataViews/_PersonView.py b/src/DataViews/_PersonView.py index c2063ea0d..3ba829118 100644 --- a/src/DataViews/_PersonView.py +++ b/src/DataViews/_PersonView.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ from gtk.gdk import ACTION_COPY, BUTTON1_MASK import RelLib from DisplayModels import PeopleModel import PageView -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import Utils import QuestionDialog import TreeTips @@ -602,7 +602,7 @@ class PersonView(PageView.PersonNavView): for sel in mlist: person = self.dbstate.db.get_person_from_handle(sel) self.active_person = person - name = NameDisplay.displayer.display(person) + name = name_displayer.display(person) msg = _('Deleting the person will remove the person ' 'from the database.') @@ -624,7 +624,7 @@ class PersonView(PageView.PersonNavView): # create name to save person = self.active_person - active_name = _("Delete Person (%s)") % NameDisplay.displayer.display(person) + active_name = _("Delete Person (%s)") % name_displayer.display(person) # delete the person from the database GrampsDb.delete_person_from_database(self.dbstate.db, person, trans) @@ -720,7 +720,7 @@ class PersonView(PageView.PersonNavView): for node in handle_list: person = self.dbstate.db.get_person_from_handle(node) pname = person.get_primary_name() - top = NameDisplay.displayer.name_grouping_name(self.db, pname) + top = name_displayer.name_grouping_name(self.db, pname) self.model.rebuild_data(self.model.current_filter) diff --git a/src/DataViews/_RelationView.py b/src/DataViews/_RelationView.py index dda1f6de5..b8e014c1e 100644 --- a/src/DataViews/_RelationView.py +++ b/src/DataViews/_RelationView.py @@ -1,6 +1,6 @@ # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2001-2006 Donald N. Allingham +# Copyright (C) 2001-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -48,7 +48,7 @@ import gtk #------------------------------------------------------------------------- import RelLib import PageView -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import DateHandler import ImgManip import Config @@ -371,7 +371,7 @@ class RelationshipView(PageView.PersonNavView): def get_name(self, handle, use_gender=False): if handle: person = self.dbstate.db.get_person_from_handle(handle) - name = NameDisplay.displayer.display(person) + name = name_displayer.display(person) if use_gender: gender = _GenderCode[person.gender] else: @@ -497,7 +497,7 @@ class RelationshipView(PageView.PersonNavView): table.set_row_spacings(6) # name and edit button - name = NameDisplay.displayer.display(person) + name = name_displayer.display(person) fmt = '%s' text = fmt % cgi.escape(name) label = GrampsWidgets.DualMarkupLabel(text, _GenderCode[person.gender]) @@ -866,7 +866,7 @@ class RelationshipView(PageView.PersonNavView): def build_menu_item(self, handle): person = self.dbstate.db.get_person_from_handle(handle) - name = NameDisplay.displayer.display(person) + name = name_displayer.display(person) item = gtk.ImageMenuItem(None) image = gtk.image_new_from_stock(gtk.STOCK_EDIT, gtk.ICON_SIZE_MENU) diff --git a/src/DisplayModels/_FamilyModel.py b/src/DisplayModels/_FamilyModel.py index 2caeafb2d..c97c5dde9 100644 --- a/src/DisplayModels/_FamilyModel.py +++ b/src/DisplayModels/_FamilyModel.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ import const import ToolTips import GrampsLocale import DateHandler -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import RelLib import GrampsDb @@ -100,28 +100,28 @@ class FamilyModel(BaseModel): def column_father(self, data): if data[2]: person = self.db.get_person_from_handle(data[2]) - return unicode(NameDisplay.displayer.sorted_name(person.primary_name)) + return unicode(name_displayer.sorted_name(person.primary_name)) else: return u"" def sort_father(self, data): if data[2]: person = self.db.get_person_from_handle(data[2]) - return NameDisplay.displayer.sort_string(person.primary_name) + return name_displayer.sort_string(person.primary_name) else: return u"" def column_mother(self, data): if data[3]: person = self.db.get_person_from_handle(data[3]) - return unicode(NameDisplay.displayer.sorted_name(person.primary_name)) + return unicode(name_displayer.sorted_name(person.primary_name)) else: return u"" def sort_mother(self, data): if data[3]: person = self.db.get_person_from_handle(data[3]) - return NameDisplay.displayer.sort_string(person.primary_name) + return name_displayer.sort_string(person.primary_name) else: return u"" diff --git a/src/DisplayModels/_PeopleModel.py b/src/DisplayModels/_PeopleModel.py index a844b26b1..c47ec3be5 100644 --- a/src/DisplayModels/_PeopleModel.py +++ b/src/DisplayModels/_PeopleModel.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ import gtk #------------------------------------------------------------------------- import const from RelLib import * -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import DateHandler import ToolTips import GrampsLocale @@ -320,8 +320,8 @@ class PeopleModel(gtk.GenericTreeModel): def _build_search_sub(self,dfilter, skip): - ngn = NameDisplay.displayer.name_grouping_data - nsn = NameDisplay.displayer.raw_sorted_name + ngn = name_displayer.name_grouping_data + nsn = name_displayer.raw_sorted_name self.mapper.clear_sort_names() @@ -347,8 +347,8 @@ class PeopleModel(gtk.GenericTreeModel): def _build_filter_sub(self,dfilter, skip): - ngn = NameDisplay.displayer.name_grouping_data - nsn = NameDisplay.displayer.raw_sorted_name + ngn = name_displayer.name_grouping_data + nsn = name_displayer.raw_sorted_name plist = self.db.get_person_handles() @@ -494,7 +494,7 @@ class PeopleModel(gtk.GenericTreeModel): def column_sort_name(self, data, node): n = Name() n.unserialize(data[PeopleModel._NAME_COL]) - return NameDisplay.displayer.sort_string(n) + return name_displayer.sort_string(n) def column_spouse(self, data, node): spouses_names = u"" @@ -510,14 +510,14 @@ class PeopleModel(gtk.GenericTreeModel): spouse = self.db.get_person_from_handle(spouse_id) if len(spouses_names) > 0: spouses_names += ", " - spouses_names += NameDisplay.displayer.display(spouse) + spouses_names += name_displayer.display(spouse) return spouses_names def column_name(self, data, node): try: name = self.lru_name[node] except: - name = NameDisplay.displayer.raw_sorted_name(data[PeopleModel._NAME_COL]) + name = name_displayer.raw_sorted_name(data[PeopleModel._NAME_COL]) if not self.in_build: self.lru_name[node] = name return name diff --git a/src/DisplayState.py b/src/DisplayState.py index 7fb647f14..808442dd8 100644 --- a/src/DisplayState.py +++ b/src/DisplayState.py @@ -51,7 +51,7 @@ import gtk #------------------------------------------------------------------------- import GrampsDb import Config -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import const import ManagedWindow @@ -303,7 +303,7 @@ class DisplayState(GrampsDb.GrampsDBCallback): if default_person == None or active == None: return u'' - pname = NameDisplay.displayer.display(default_person) + pname = name_displayer.display(default_person) (name, plist) = self.relationship.get_relationship( default_person,active) @@ -356,7 +356,7 @@ class DisplayState(GrampsDb.GrampsDBCallback): else: person = dbstate.get_active_person() if person: - pname = NameDisplay.displayer.display(person) + pname = name_displayer.display(person) name = "[%s] %s" % (person.get_gramps_id(), pname) if Config.get(Config.STATUSBAR) > 1: if person.handle != dbstate.db.get_default_handle(): diff --git a/src/DisplayTabs/_BackRefModel.py b/src/DisplayTabs/_BackRefModel.py index 6088ade58..4d7f4fb6a 100644 --- a/src/DisplayTabs/_BackRefModel.py +++ b/src/DisplayTabs/_BackRefModel.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ from gettext import gettext as _ # GRAMPS classes # #------------------------------------------------------------------------- -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import Utils #------------------------------------------------------------------------- @@ -64,7 +64,7 @@ class BackRefModel(gtk.ListStore): p = self.db.get_person_from_handle(ref[1]) gid = p.gramps_id handle = p.handle - name = NameDisplay.displayer.display(p) + name = name_displayer.display(p) elif dtype == 'Family': p = self.db.get_family_from_handle(ref[1]) gid = p.gramps_id diff --git a/src/DisplayTabs/_ChildModel.py b/src/DisplayTabs/_ChildModel.py index 307a80e7c..13b46402b 100644 --- a/src/DisplayTabs/_ChildModel.py +++ b/src/DisplayTabs/_ChildModel.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ import gtk # #------------------------------------------------------------------------- import DateHandler -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import Utils #------------------------------------------------------------------------- @@ -56,7 +56,7 @@ class ChildModel(gtk.ListStore): self.append(row=[ index, child.get_gramps_id(), - NameDisplay.displayer.display(child), + name_displayer.display(child), Utils.gender[child.get_gender()], str(child_ref.get_father_relation()), str(child_ref.get_mother_relation()), @@ -65,7 +65,7 @@ class ChildModel(gtk.ListStore): self.column_birth_place(child), self.column_death_place(child), child.get_handle(), - NameDisplay.displayer.sort_string(child.primary_name), + name_displayer.sort_string(child.primary_name), self.column_birth_sort(child), self.column_death_sort(child), ]) diff --git a/src/DisplayTabs/_NameModel.py b/src/DisplayTabs/_NameModel.py index 066a5e535..a4894d17a 100644 --- a/src/DisplayTabs/_NameModel.py +++ b/src/DisplayTabs/_NameModel.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ import gtk # GRAMPS classes # #------------------------------------------------------------------------- -from BasicUtils import NameDisplay +from BasicUtils import name_displayer #------------------------------------------------------------------------- # @@ -46,7 +46,7 @@ class NameModel(gtk.ListStore): self.db = db for obj in obj_list: self.append(row=[ - NameDisplay.displayer.display_name(obj), + name_displayer.display_name(obj), str(obj.get_type()), obj, ]) diff --git a/src/DisplayTabs/_PersonRefModel.py b/src/DisplayTabs/_PersonRefModel.py index 953fd770a..52d945260 100644 --- a/src/DisplayTabs/_PersonRefModel.py +++ b/src/DisplayTabs/_PersonRefModel.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ import gtk # GRAMPS classes # #------------------------------------------------------------------------- -from BasicUtils import NameDisplay +from BasicUtils import name_displayer #------------------------------------------------------------------------- # @@ -47,7 +47,7 @@ class PersonRefModel(gtk.ListStore): for obj in obj_list: p = self.db.get_person_from_handle(obj.ref) if p: - data = [NameDisplay.displayer.display(p), p.gramps_id, obj.rel, obj] + data = [name_displayer.display(p), p.gramps_id, obj.rel, obj] else: data = ['unknown','unknown',obj.rel,obj] self.append(row=data) diff --git a/src/Editors/_EditFamily.py b/src/Editors/_EditFamily.py index 56184851a..3fdbdaf42 100644 --- a/src/Editors/_EditFamily.py +++ b/src/Editors/_EditFamily.py @@ -50,7 +50,7 @@ import gtk #------------------------------------------------------------------------- import const import Utils -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import RelLib import Config import Errors @@ -254,7 +254,7 @@ class ChildEmbedList(EmbeddedList): for ref in self.family.get_child_ref_list(): if ref.ref == handle: p = self.dbstate.db.get_person_from_handle(handle) - n = NameDisplay.displayer.display(p) + n = name_displayer.display(p) try: EditChildRef(n, self.dbstate, self.uistate, self.track, ref, self.child_ref_edited) @@ -744,7 +744,7 @@ class EditFamily(EditPrimary): btn2_obj.hide() db = self.db person = db.get_person_from_handle(handle) - name = "%s [%s]" % (NameDisplay.displayer.display(person), + name = "%s [%s]" % (name_displayer.display(person), person.gramps_id) data = ReportUtils.get_birth_death_strings(db,person) birth = data[0] @@ -813,7 +813,7 @@ class EditFamily(EditPrimary): if self.obj.get_father_handle() in child_list: father = self.db.get_person_from_handle(self.obj.get_father_handle()) - name = "%s [%s]" % (NameDisplay.displayer.display(father), + name = "%s [%s]" % (name_displayer.display(father), father.gramps_id) QuestionDialog.ErrorDialog(_("A father cannot be his own child"), _("%s is listed as both the father and child " @@ -823,7 +823,7 @@ class EditFamily(EditPrimary): elif self.obj.get_mother_handle() in child_list: mother = self.db.get_person_from_handle(self.obj.get_mother_handle()) - name = "%s [%s]" % (NameDisplay.displayer.display(mother), + name = "%s [%s]" % (name_displayer.display(mother), mother.gramps_id) QuestionDialog.ErrorDialog(_("A mother cannot be her own child"), _("%s is listed as both the mother and child " diff --git a/src/Editors/_EditLdsOrd.py b/src/Editors/_EditLdsOrd.py index 72f71f646..631c5b6eb 100644 --- a/src/Editors/_EditLdsOrd.py +++ b/src/Editors/_EditLdsOrd.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ import gtk.glade import const import Config import RelLib -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import LdsUtils from _EditSecondary import EditSecondary @@ -273,18 +273,18 @@ class EditLdsOrd(EditSecondary): family.get_mother_handle()) if f and m: label = _("%(father)s and %(mother)s [%(gramps_id)s]") % { - 'father' : NameDisplay.displayer.display(f), - 'mother' : NameDisplay.displayer.display(m), + 'father' : name_displayer.display(f), + 'mother' : name_displayer.display(m), 'gramps_id' : family.gramps_id, } elif f: label = _("%(father)s [%(gramps_id)s]") % { - 'father' : NameDisplay.displayer.display(f), + 'father' : name_displayer.display(f), 'gramps_id' : family.gramps_id, } elif m: label = _("%(mother)s [%(gramps_id)s]") % { - 'mother' : NameDisplay.displayer.display(m), + 'mother' : name_displayer.display(m), 'gramps_id' : family.gramps_id, } else: diff --git a/src/Editors/_EditName.py b/src/Editors/_EditName.py index 402772999..8d712d79c 100644 --- a/src/Editors/_EditName.py +++ b/src/Editors/_EditName.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,7 +42,7 @@ import gtk.glade import const import Config import Utils -from BasicUtils import NameDisplay +from BasicUtils import name_displayer from _EditSecondary import EditSecondary from RelLib import NoteType @@ -101,7 +101,7 @@ class EditName(EditSecondary): self.group_as.force_value(self.obj.get_surname()) format_list = [(name,number) for (number,name,fmt_str,act) - in NameDisplay.displayer.get_name_format(also_default=True)] + in name_displayer.get_name_format(also_default=True)] self.sort_as = MonitoredMenu( self.top.get_widget('sort_as'), @@ -199,7 +199,7 @@ class EditName(EditSecondary): def build_menu_names(self,name): if name: - ntext = NameDisplay.displayer.display_name(name) + ntext = name_displayer.display_name(name) submenu_label = '%s: %s' % (_('Name'),ntext) else: submenu_label = _('New Name') diff --git a/src/Editors/_EditPerson.py b/src/Editors/_EditPerson.py index be8f07e88..e48f4319b 100644 --- a/src/Editors/_EditPerson.py +++ b/src/Editors/_EditPerson.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ import Utils import Mime import RelLib import GrampsWidgets -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import Errors from GrampsDb import set_birth_death_index @@ -103,7 +103,7 @@ class EditPerson(EditPrimary): def get_menu_title(self): if self.obj.get_handle(): - name = NameDisplay.displayer.display(self.obj) + name = name_displayer.display(self.obj) title = _('Person') + ': %s' % name else: title = _('New Person') diff --git a/src/Editors/_EditPersonRef.py b/src/Editors/_EditPersonRef.py index 78fffee48..5ef9c6240 100644 --- a/src/Editors/_EditPersonRef.py +++ b/src/Editors/_EditPersonRef.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ import gtk.glade #------------------------------------------------------------------------- import const import Config -from BasicUtils import NameDisplay +from BasicUtils import name_displayer from _EditSecondary import EditSecondary from RelLib import NoteType @@ -86,7 +86,7 @@ class EditPersonRef(EditSecondary): if self.obj.ref: p = self.dbstate.db.get_person_from_handle(self.obj.ref) - self.person_label.set_text(NameDisplay.displayer.display(p)) + self.person_label.set_text(name_displayer.display(p)) self.street = MonitoredEntry( self.top.get_widget("relationship"), @@ -114,7 +114,7 @@ class EditPersonRef(EditSecondary): if person: self.obj.ref = person.get_handle() - self.person_label.set_text(NameDisplay.displayer.display(person)) + self.person_label.set_text(name_displayer.display(person)) def _create_tabbed_pages(self): """ diff --git a/src/Editors/_EditPrimary.py b/src/Editors/_EditPrimary.py index 3a6562819..ca371375b 100644 --- a/src/Editors/_EditPrimary.py +++ b/src/Editors/_EditPrimary.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2005 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ from gettext import gettext as _ import ManagedWindow import DateHandler -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import Config import GrampsDisplay from QuestionDialog import SaveDialog @@ -36,7 +36,7 @@ class EditPrimary(ManagedWindow.ManagedWindow): self.dp = DateHandler.parser self.dd = DateHandler.displayer - self.nd = NameDisplay.displayer + self.nd = name_displayer self.obj = obj self.dbstate = state self.uistate = uistate diff --git a/src/FilterEditor/_EditRule.py b/src/FilterEditor/_EditRule.py index 995ef056f..218bdb1cc 100644 --- a/src/FilterEditor/_EditRule.py +++ b/src/FilterEditor/_EditRule.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ import RelLib from Filters import Rules import AutoComp from Selectors import selector_factory -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd import Utils import ManagedWindow diff --git a/src/FilterEditor/_ShowResults.py b/src/FilterEditor/_ShowResults.py index d6b7573c6..7fb4a0034 100644 --- a/src/FilterEditor/_ShowResults.py +++ b/src/FilterEditor/_ShowResults.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -56,7 +56,7 @@ import gtk #------------------------------------------------------------------------- import const import ManagedWindow -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd import Utils #------------------------------------------------------------------------- diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index 3e8ceb2b4..b2298c79c 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -42,7 +42,7 @@ import gtk #------------------------------------------------------------------------- import Config import DateHandler -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd from RelLib import Name import ManagedWindow from GrampsWidgets import * diff --git a/src/GrampsDb/Makefile.am b/src/GrampsDb/Makefile.am index 3f354ecdf..3bfa234f7 100644 --- a/src/GrampsDb/Makefile.am +++ b/src/GrampsDb/Makefile.am @@ -6,19 +6,24 @@ pkgdatadir = $(datadir)/@PACKAGE@/GrampsDb pkgdata_PYTHON = \ + _CursorIterator.py \ _DbUtils.py \ _GrampsBSDDB.py\ - _GrampsDbBase.py\ _GrampsCursor.py\ + _GrampsDbBase.py\ _GrampsDBCallback.py\ + _GrampsDbConst.py\ + _GrampsDBDir.py \ _GrampsDbExceptions.py\ _GrampsDbFactories.py\ + _GrampsDbWriteXML.py \ _GrampsGEDDB.py\ _GrampsInMemDB.py\ _GrampsXMLDB.py\ - _GrampsDbConst.py\ _HelperFunctions.py\ - __init__.py + __init__.py\ + _LongOpStatus.py\ + _ProgressMonitor.py pkgpyexecdir = @pkgpyexecdir@/GrampsDb pkgpythondir = @pkgpythondir@/GrampsDb diff --git a/src/GrampsDbUtils/_GedcomParse.py b/src/GrampsDbUtils/_GedcomParse.py index 44e195bd3..227f2aceb 100644 --- a/src/GrampsDbUtils/_GedcomParse.py +++ b/src/GrampsDbUtils/_GedcomParse.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -111,7 +111,7 @@ LOG = logging.getLogger(".GedcomImport") #------------------------------------------------------------------------- import Errors import RelLib -from BasicUtils import NameDisplay, UpdateCallback +from BasicUtils import name_displayer, UpdateCallback import Utils import Mime import LdsUtils @@ -4493,7 +4493,7 @@ def person_event_name(event, person): if not event.get_description(): text = EVENT_PERSON_STR % { 'event_name' : str(event.get_type()), - 'person' : NameDisplay.displayer.display(person), + 'person' : name_displayer.display(person), } event.set_description(text) diff --git a/src/GrampsDbUtils/_ReadXML.py b/src/GrampsDbUtils/_ReadXML.py index d27e3ea9b..714bd8ec4 100644 --- a/src/GrampsDbUtils/_ReadXML.py +++ b/src/GrampsDbUtils/_ReadXML.py @@ -52,7 +52,7 @@ import RelLib import const import Utils import DateHandler -from BasicUtils import NameDisplay +from BasicUtils import name_displayer from GrampsDb._GrampsDbConst import \ PERSON_KEY,FAMILY_KEY,SOURCE_KEY,EVENT_KEY,\ MEDIA_KEY,PLACE_KEY,REPOSITORY_KEY,NOTE_KEY @@ -642,7 +642,7 @@ class GrampsParser(UpdateCallback): # add new name formats to the existing table self.db.name_formats += self.name_formats # Register new formats - NameDisplay.displayer.set_name_format(self.db.name_formats) + name_displayer.set_name_format(self.db.name_formats) self.db.set_researcher(self.owner) if self.home != None: @@ -1702,7 +1702,7 @@ class GrampsParser(UpdateCallback): elif self.person: text = _event_person_str % { 'event_name' : str(self.event.get_type()), - 'person' : NameDisplay.displayer.display(self.person), + 'person' : name_displayer.display(self.person), } else: text = u'' diff --git a/src/GrampsDbUtils/_WriteGedcom.py b/src/GrampsDbUtils/_WriteGedcom.py index ba6392375..d51d6d49f 100644 --- a/src/GrampsDbUtils/_WriteGedcom.py +++ b/src/GrampsDbUtils/_WriteGedcom.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -54,7 +54,7 @@ import _GedcomInfo as GedcomInfo import Errors import ansel_utf8 import Utils -from BasicUtils import NameDisplay +from BasicUtils import name_displayer from QuestionDialog import * from BasicUtils import UpdateCallback @@ -296,19 +296,19 @@ class GedcomWriterOptionBox: if self.person: des = GenericFilter() des.set_name(_("Descendants of %s") % - NameDisplay.displayer.display(self.person)) + name_displayer.display(self.person)) des.add_rule(Rules.Person.IsDescendantOf( [self.person.get_gramps_id(),1])) ans = GenericFilter() ans.set_name(_("Ancestors of %s") - % NameDisplay.displayer.display(self.person)) + % name_displayer.display(self.person)) ans.add_rule(Rules.Person.IsAncestorOf( [self.person.get_gramps_id(),1])) com = GenericFilter() com.set_name(_("People with common ancestor with %s") % - NameDisplay.displayer.display(self.person)) + name_displayer.display(self.person)) com.add_rule(Rules.Person.HasCommonAncestorWith( [self.person.get_gramps_id()])) diff --git a/src/GrampsDbUtils/_WriteXML.py b/src/GrampsDbUtils/_WriteXML.py index 161725aec..b50969c03 100644 --- a/src/GrampsDbUtils/_WriteXML.py +++ b/src/GrampsDbUtils/_WriteXML.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/Makefile.am b/src/Makefile.am index e8907c00c..4c35072d5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -79,7 +79,8 @@ gdir_PYTHON = \ Utils.py\ ViewManager.py\ UndoHistory.py\ - PlaceUtils.py + PlaceUtils.py\ + ProgressDialog.py # Clean up all the byte-compiled files MOSTLYCLEANFILES = *pyc *pyo diff --git a/src/Merge/_MergePerson.py b/src/Merge/_MergePerson.py index 55a26c988..2631a6a30 100644 --- a/src/Merge/_MergePerson.py +++ b/src/Merge/_MergePerson.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ import pango #------------------------------------------------------------------------- import RelLib from ReportBase import ReportUtils -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import const import DateHandler import QuestionDialog @@ -120,7 +120,7 @@ class PersonCompare(ManagedWindow.ManagedWindow): title = tobj.create_tag() title.set_property('weight',pango.WEIGHT_BOLD) title.set_property('scale',pango.SCALE_LARGE) - self.add(tobj,title,NameDisplay.displayer.display(person)) + self.add(tobj,title,name_displayer.display(person)) self.add(tobj,normal,"%s:\t%s" % (_('ID'),person.get_gramps_id())) self.add(tobj,normal,"%s:\t%s" % (_('Gender'),sex[person.get_gender()])) bref = person.get_birth_ref() @@ -134,7 +134,7 @@ class PersonCompare(ManagedWindow.ManagedWindow): if len(nlist) > 0: self.add(tobj,title,_("Alternate Names")) for name in nlist: - self.add(tobj,normal,NameDisplay.displayer.display_name(name)) + self.add(tobj,normal,name_displayer.display_name(name)) elist = person.get_event_ref_list() if len(elist) > 0: @@ -330,7 +330,7 @@ class MergePeopleUI(ManagedWindow.ManagedWindow): def name_of(p): if not p: return "" - return "%s [%s]" % (NameDisplay.displayer.display(p),p.get_gramps_id()) + return "%s [%s]" % (name_displayer.display(p),p.get_gramps_id()) #------------------------------------------------------------------------- # diff --git a/src/Navigation.py b/src/Navigation.py index c6a32fd7f..754e403f2 100644 --- a/src/Navigation.py +++ b/src/Navigation.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2005 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ __revision__ = "$Revision$" # #------------------------------------------------------------------- import gtk -from BasicUtils import NameDisplay +from BasicUtils import name_displayer DISABLED = -1 @@ -167,7 +167,7 @@ class PersonNavigation(BaseNavigation): Builds a name in the format of 'NAME [GRAMPSID]' """ person = self.dbstate.db.get_person_from_handle(item) - return "%s [%s]" % (NameDisplay.displayer.display(person), + return "%s [%s]" % (name_displayer.display(person), person.gramps_id) def generate(func, items, index): diff --git a/src/ObjectSelector/_PersonFrame.py b/src/ObjectSelector/_PersonFrame.py index 70f6f46c3..f14e2ba85 100644 --- a/src/ObjectSelector/_PersonFrame.py +++ b/src/ObjectSelector/_PersonFrame.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,8 +28,8 @@ import gtk import gobject from RelLib import Person -from BasicUtils.NameDisplay import displayer -display_name = displayer.display +from BasicUtils import name_displayer +display_name = name_displayer.display from _ObjectFrameBase import ObjectFrameBase from _PersonFilterFrame import PersonFilterFrame diff --git a/src/ObjectSelector/_PersonTreeFrame.py b/src/ObjectSelector/_PersonTreeFrame.py index 164182a5e..0384dab23 100644 --- a/src/ObjectSelector/_PersonTreeFrame.py +++ b/src/ObjectSelector/_PersonTreeFrame.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,8 +27,6 @@ import gobject from TreeViews import PersonTreeView -from BasicUtils import NameDisplay - from _TreeFrameBase import TreeFrameBase column_names = [ diff --git a/src/PageView.py b/src/PageView.py index ca59301db..2b24300df 100644 --- a/src/PageView.py +++ b/src/PageView.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2001-2006 Donald N. Allingham +# Copyright (C) 2001-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -212,11 +212,11 @@ class BookMarkView(PageView): self.dbstate, self.uistate, bookmarks, self.goto_handle) def add_bookmark(self, obj): - from BasicUtils import NameDisplay + from BasicUtils import name_displayer if self.dbstate.active: self.bookmarks.add(self.dbstate.active.get_handle()) - name = NameDisplay.displayer.display(self.dbstate.active) + name = name_displayer.display(self.dbstate.active) self.uistate.push_message(self.dbstate, _("%s has been bookmarked") % name) else: diff --git a/src/PluginUtils/_Tool.py b/src/PluginUtils/_Tool.py index a601d618e..d09761e12 100644 --- a/src/PluginUtils/_Tool.py +++ b/src/PluginUtils/_Tool.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2005-2006 Donald N. Allingham +# Copyright (C) 2005-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ log = logging.getLogger(".") import const import Utils from Filters import CustomFilters -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import Errors from _Options import * @@ -204,7 +204,7 @@ class CommandLineTool: person = self.database.get_person_from_handle(person_handle) id_list.append("%s\t%s" % ( person.get_gramps_id(), - NameDisplay.displayer.display(person))) + name_displayer.display(person))) self.options_help['id'].append(id_list) self.options_help['id'].append(False) diff --git a/src/Reorder.py b/src/Reorder.py index 6670d6a28..93279e609 100644 --- a/src/Reorder.py +++ b/src/Reorder.py @@ -1,6 +1,6 @@ # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2001-2006 Donald N. Allingham +# Copyright (C) 2001-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ from gettext import gettext as _ import const import gtk -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import ListModel import ManagedWindow @@ -94,13 +94,13 @@ class Reorder(ManagedWindow.ManagedWindow): if fhandle: father = self.dbstate.db.get_person_from_handle(fhandle) if father: - fname = NameDisplay.displayer.display(father) + fname = name_displayer.display(father) mname = "" if mhandle: mother = self.dbstate.db.get_person_from_handle(mhandle) if mother: - mname = NameDisplay.displayer.display(mother) + mname = name_displayer.display(mother) self.pmodel.add([fname, mname, handle]) @@ -116,11 +116,11 @@ class Reorder(ManagedWindow.ManagedWindow): if fhandle and fhandle != self.person.handle: spouse = self.dbstate.db.get_person_from_handle(fhandle) if spouse: - name = NameDisplay.displayer.display(spouse) + name = name_displayer.display(spouse) elif mhandle: spouse = self.dbstate.db.get_person_from_handle(mhandle) if spouse: - name = NameDisplay.displayer.display(spouse) + name = name_displayer.display(spouse) reltype = str(family.get_relationship()) @@ -132,7 +132,7 @@ class Reorder(ManagedWindow.ManagedWindow): def ok_clicked(self, obj): trans = self.dbstate.db.transaction_begin() self.dbstate.db.commit_person(self.person, trans) - name = NameDisplay.displayer.display(self.person) + name = name_displayer.display(self.person) msg = _("Reorder Relationships: %s") % name self.dbstate.db.transaction_commit(trans, msg) diff --git a/src/ReportBase/_BareReportDialog.py b/src/ReportBase/_BareReportDialog.py index 6e8efe72c..bfac52992 100644 --- a/src/ReportBase/_BareReportDialog.py +++ b/src/ReportBase/_BareReportDialog.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2001-2006 Donald N. Allingham +# Copyright (C) 2001-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import BaseDoc import Utils @@ -270,7 +270,7 @@ class BareReportDialog(ManagedWindow.ManagedWindow): on the get_title() customization function for what the title should be.""" if self.person: - self.name = NameDisplay.displayer.display(self.person) + self.name = name_displayer.display(self.person) else: self.name = '' self.window.set_title(self.get_title()) @@ -309,7 +309,7 @@ class BareReportDialog(ManagedWindow.ManagedWindow): self.tbl.attach(center_label,0,4,self.col,self.col+1) self.col += 1 - name = NameDisplay.displayer.display(self.person) + name = name_displayer.display(self.person) self.person_label = gtk.Label( "%s" % name ) self.person_label.set_alignment(0.0,0.5) self.tbl.attach(self.person_label,2,3,self.col,self.col+1) @@ -495,7 +495,7 @@ class BareReportDialog(ManagedWindow.ManagedWindow): new_person = sel_person.run() if new_person: self.new_person = new_person - new_name = NameDisplay.displayer.display(new_person) + new_name = name_displayer.display(new_person) if new_name: self.person_label.set_text( "%s" % new_name ) self.person_label.set_use_markup(True) diff --git a/src/ReportBase/_CommandLineReport.py b/src/ReportBase/_CommandLineReport.py index 61af2c042..3da1b60f9 100644 --- a/src/ReportBase/_CommandLineReport.py +++ b/src/ReportBase/_CommandLineReport.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2001-2006 Donald N. Allingham +# Copyright (C) 2001-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ import logging log = logging.getLogger(".") import PluginUtils -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import Utils import BaseDoc from _Constants import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK @@ -110,7 +110,7 @@ class CommandLineReport: person = self.database.get_person_from_handle(person_handle) id_list.append("%s\t%s" % ( person.get_gramps_id(), - NameDisplay.displayer.display(person))) + name_displayer.display(person))) self.options_help['id'].append(id_list) self.options_help['id'].append(False) diff --git a/src/ReportBase/_ReportUtils.py b/src/ReportBase/_ReportUtils.py index c60d85969..9ba08410a 100644 --- a/src/ReportBase/_ReportUtils.py +++ b/src/ReportBase/_ReportUtils.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # @@ -42,7 +42,7 @@ from gettext import gettext as _ #------------------------------------------------------------------------ import DateHandler import RelLib -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd from QuestionDialog import WarningDialog import BaseDoc diff --git a/src/Simple/_SimpleAccess.py b/src/Simple/_SimpleAccess.py index a9cfa4db9..7fc1957bd 100644 --- a/src/Simple/_SimpleAccess.py +++ b/src/Simple/_SimpleAccess.py @@ -28,7 +28,7 @@ import RelLib import DateHandler import Utils -from BasicUtils import NameDisplay +from BasicUtils import name_displayer from ReportBase import ReportUtils from RelLib import EventType @@ -113,7 +113,7 @@ class SimpleAccess: """ assert(isinstance(person, (RelLib.Person, NoneType))) if person: - return NameDisplay.displayer.display(person) + return name_displayer.display(person) else: return u'' diff --git a/src/Sort.py b/src/Sort.py index 8a4acba5b..22e64a50a 100644 --- a/src/Sort.py +++ b/src/Sort.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ import locale # #------------------------------------------------------------------------- from RelLib import Date -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd #------------------------------------------------------------------------- # diff --git a/src/SubstKeywords.py b/src/SubstKeywords.py index 75a62e1fd..a5edd6988 100644 --- a/src/SubstKeywords.py +++ b/src/SubstKeywords.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2005 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ __version__ = "$Revision$" # #------------------------------------------------------------------------ -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import DateHandler import RelLib @@ -72,8 +72,8 @@ class SubstKeywords: """Creates a new object and associates a person with it.""" person = database.get_person_from_handle(person_handle) - self.n = NameDisplay.displayer.display(person) - self.N = NameDisplay.displayer.sorted(person) + self.n = name_displayer.display(person) + self.N = name_displayer.sorted(person) self.b = "" self.B = "" self.d = "" @@ -107,13 +107,13 @@ class SubstKeywords: if father_handle == person_handle: if mother_handle: mother = database.get_person_from_handle(mother_handle) - self.s = NameDisplay.displayer.display(mother) - self.S = NameDisplay.displayer.sorted(mother) + self.s = name_displayer.display(mother) + self.S = name_displayer.sorted(mother) else: if father_handle: father = database.get_person_from_handle(father_handle) - self.s = NameDisplay.displayer.display(father) - self.S = NameDisplay.displayer.sorted(father) + self.s = name_displayer.display(father) + self.S = name_displayer.sorted(father) for e_ref in f.get_event_ref_list(): if not e_ref: continue diff --git a/src/TreeViews/_PersonTreeView.py b/src/TreeViews/_PersonTreeView.py index 9b46c438b..0da411457 100644 --- a/src/TreeViews/_PersonTreeView.py +++ b/src/TreeViews/_PersonTreeView.py @@ -7,12 +7,12 @@ import gtk from Models import \ PersonTreeModel, PersonListModel, PersonFilterModel -from BasicUtils.NameDisplay import displayer +from BasicUtils import name_displayer from RelLib import Event import DateHandler import Utils -display_given = displayer.display_given +display_given = name_displayer.display_given class PersonTreeView(gtk.TreeView): diff --git a/src/Utils.py b/src/Utils.py index a791eda43..188d94cd5 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ import gtk # #------------------------------------------------------------------------- import Mime -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import RelLib import Errors from QuestionDialog import WarningDialog @@ -159,15 +159,15 @@ def family_name(family, db, noname=_("unknown")): father = db.get_person_from_handle(father_handle) mother = db.get_person_from_handle(mother_handle) if father and mother: - fname = NameDisplay.displayer.display(father) - mname = NameDisplay.displayer.display(mother) + fname = name_displayer.display(father) + mname = name_displayer.display(mother) name = _("%(father)s and %(mother)s") % { "father" : fname, "mother" : mname} elif father: - name = NameDisplay.displayer.display(father) + name = name_displayer.display(father) elif mother: - name = NameDisplay.displayer.display(mother) + name = name_displayer.display(mother) else: name = noname return name @@ -694,7 +694,7 @@ def probably_alive(person,db,current_year=None,limit=0): except RuntimeError: raise Errors.DatabaseError( _("Database error: %s is defined as his or her own ancestor") % - NameDisplay.displayer.display(person)) + name_displayer.display(person)) average_generation_gap = 20 diff --git a/src/ViewManager.py b/src/ViewManager.py index 6431682ab..d17e3def2 100644 --- a/src/ViewManager.py +++ b/src/ViewManager.py @@ -73,7 +73,7 @@ import Navigation import TipOfDay import Bookmarks import RecentFiles -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import GrampsWidgets import UndoHistory from DbLoader import DbLoader @@ -1051,10 +1051,10 @@ class ViewManager: self.setup_bookmarks() - NameDisplay.displayer.set_name_format(self.state.db.name_formats) + name_displayer.set_name_format(self.state.db.name_formats) fmt_default = Config.get(Config.NAME_FORMAT) if fmt_default < 0: - NameDisplay.displayer.set_default_format(fmt_default) + name_displayer.set_default_format(fmt_default) self.state.db.enable_signals() self.state.signal_change() @@ -1136,7 +1136,7 @@ class ViewManager: def add_bookmark(self, obj): if self.state.active: self.bookmarks.add(self.state.active.get_handle()) - name = NameDisplay.displayer.display(self.state.active) + name = name_displayer.display(self.state.active) self.uistate.push_message(self.state, _("%s has been bookmarked") % name) else: diff --git a/src/plugins/AncestorChart2.py b/src/plugins/AncestorChart2.py index 8f5d835ce..a8c31fbab 100644 --- a/src/plugins/AncestorChart2.py +++ b/src/plugins/AncestorChart2.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify @@ -48,7 +48,7 @@ from SubstKeywords import SubstKeywords from PluginUtils import register_report from ReportBase import Report, ReportUtils, ReportOptions, \ CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI -from BasicUtils import NameDisplay +from BasicUtils import name_displayer pt2cm = ReportUtils.pt2cm cm2pt = ReportUtils.cm2pt @@ -192,7 +192,7 @@ class AncestorChart(Report): self.incblank = options_class.handler.options_dict['incblank'] self.compress = options_class.handler.options_dict['compress'] - name = NameDisplay.displayer.display_formal(person) + name = name_displayer.display_formal(person) self.title = _("Ancestor Graph for %s") % name self.map = {} diff --git a/src/plugins/AncestorReport.py b/src/plugins/AncestorReport.py index ddf443d01..767c29352 100644 --- a/src/plugins/AncestorReport.py +++ b/src/plugins/AncestorReport.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify @@ -41,7 +41,7 @@ from PluginUtils import register_report from ReportBase import Report, ReportUtils, ReportOptions, \ CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI import BaseDoc -from BasicUtils import NameDisplay +from BasicUtils import name_displayer from RelLib import ChildRefType @@ -147,7 +147,7 @@ class AncestorReport(Report): # Write the title line. Set in INDEX marker so that this section will be # identified as a major category if this is included in a Book report. - name = NameDisplay.displayer.display_formal(self.start_person) + name = name_displayer.display_formal(self.start_person) title = _("Ahnentafel Report for %s") % name mark = BaseDoc.IndexMark(title, BaseDoc.INDEX_TYPE_TOC,1 ) self.doc.start_paragraph("AHN-Title") @@ -180,7 +180,7 @@ class AncestorReport(Report): self.doc.start_paragraph("AHN-Entry","%d." % key) person = self.database.get_person_from_handle(self.map[key]) - name = NameDisplay.displayer.display(person) + name = name_displayer.display(person) mark = ReportUtils.get_person_mark(self.database, person) # write the name in bold diff --git a/src/plugins/Ancestors.py b/src/plugins/Ancestors.py index f469a7e48..1a8abdbe4 100644 --- a/src/plugins/Ancestors.py +++ b/src/plugins/Ancestors.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2003-2006 Donald N. Allingham +# Copyright (C) 2003-2007 Donald N. Allingham # Copyright (C) 2003 Tim Waugh # # This program is free software; you can redistribute it and/or modify @@ -49,7 +49,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \ import BaseDoc import RelLib from DateHandler import displayer as _dd -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd #------------------------------------------------------------------------ # diff --git a/src/plugins/Check.py b/src/plugins/Check.py index fbcfbb627..ac8e75ff1 100644 --- a/src/plugins/Check.py +++ b/src/plugins/Check.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -61,7 +61,7 @@ import ManagedWindow from PluginUtils import Tool, register_tool from QuestionDialog import OkDialog, MissingMediaDialog -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd #------------------------------------------------------------------------- # diff --git a/src/plugins/DesGraph.py b/src/plugins/DesGraph.py index 01494e068..a0c16b0d3 100644 --- a/src/plugins/DesGraph.py +++ b/src/plugins/DesGraph.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -49,7 +49,7 @@ pt2cm = ReportUtils.pt2cm import BaseDoc from SubstKeywords import SubstKeywords import Errors -from BasicUtils import NameDisplay +from BasicUtils import name_displayer #------------------------------------------------------------------------ # @@ -87,7 +87,7 @@ class DescendLine(GraphLayout): person = self.database.get_person_from_handle(self.person_handle) raise Errors.DatabaseError( _("Database error: %s is defined as his or her own ancestor") % - NameDisplay.displayer.display(person)) + name_displayer.display(person)) return (self.v,self.e[1:]) diff --git a/src/plugins/Desbrowser.py b/src/plugins/Desbrowser.py index 9db469224..2ffc6091f 100644 --- a/src/plugins/Desbrowser.py +++ b/src/plugins/Desbrowser.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ import gtk.glade # GRAMPS modules # #------------------------------------------------------------------------ -from BasicUtils import NameDisplay +from BasicUtils import name_displayer from PluginUtils import Tool, register_tool import GrampsDisplay import ManagedWindow @@ -65,7 +65,7 @@ class DesBrowse(Tool.ActivePersonTool, ManagedWindow.ManagedWindow): self.active = dbstate.get_active_person() self.callback = callback self.active_name = _("Descendant Browser: %s") \ - % NameDisplay.displayer.display(self.active) + % name_displayer.display(self.active) ManagedWindow.ManagedWindow.__init__(self, uistate, [], self) @@ -109,7 +109,7 @@ class DesBrowse(Tool.ActivePersonTool, ManagedWindow.ManagedWindow): item_id = self.model.insert_after(parent_id, sib_id) person = self.db.get_person_from_handle(person_handle) - self.model.set(item_id, 0, NameDisplay.displayer.display(person)) + self.model.set(item_id, 0, name_displayer.display(person)) self.model.set(item_id, 1, person_handle) prev_id = None for family_handle in person.get_family_handle_list(): diff --git a/src/plugins/DescendChart.py b/src/plugins/DescendChart.py index 574063ca3..366fe58fd 100644 --- a/src/plugins/DescendChart.py +++ b/src/plugins/DescendChart.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify @@ -50,7 +50,7 @@ from ReportBase import Report, ReportOptions, ReportUtils, \ pt2cm = ReportUtils.pt2cm cm2pt = ReportUtils.cm2pt from SubstKeywords import SubstKeywords -from BasicUtils import NameDisplay +from BasicUtils import name_displayer #------------------------------------------------------------------------ # @@ -132,7 +132,7 @@ class DescendChart(Report): self.force_fit = options_class.handler.options_dict['singlep'] self.incblank = options_class.handler.options_dict['incblank'] - name = NameDisplay.displayer.display_formal(person) + name = name_displayer.display_formal(person) self.title = _("Descendant Chart for %s") % name self.map = {} diff --git a/src/plugins/DescendReport.py b/src/plugins/DescendReport.py index 9ba9af3bb..43cd8a95c 100644 --- a/src/plugins/DescendReport.py +++ b/src/plugins/DescendReport.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify @@ -43,7 +43,7 @@ import BaseDoc import Errors import Sort from QuestionDialog import ErrorDialog -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import DateHandler #------------------------------------------------------------------------ @@ -148,7 +148,7 @@ class DescendantReport(Report): def write_report(self): self.doc.start_paragraph("DR-Title") - name = NameDisplay.displayer.display(self.start_person) + name = name_displayer.display(self.start_person) title = _("Descendants of %s") % name mark = BaseDoc.IndexMark(title,BaseDoc.INDEX_TYPE_TOC,1) self.doc.write_text(title,mark) @@ -159,7 +159,7 @@ class DescendantReport(Report): self.doc.start_paragraph("DR-Level%d" % min(level,32),"%d." % level) mark = ReportUtils.get_person_mark(self.database,person) - self.doc.write_text(NameDisplay.displayer.display(person),mark) + self.doc.write_text(name_displayer.display(person),mark) self.dump_dates(person) self.doc.end_paragraph() @@ -174,7 +174,7 @@ class DescendantReport(Report): spouse = self.database.get_person_from_handle(spouse_handle) mark = ReportUtils.get_person_mark(self.database,person) self.doc.start_paragraph("DR-Spouse%d" % min(level,32)) - name = NameDisplay.displayer.display(spouse) + name = name_displayer.display(spouse) self.doc.write_text(_("sp. %(spouse)s") % {'spouse':name},mark) self.dump_dates(spouse) self.doc.end_paragraph() diff --git a/src/plugins/DetAncestralReport.py b/src/plugins/DetAncestralReport.py index e275bcad2..cad71db74 100644 --- a/src/plugins/DetAncestralReport.py +++ b/src/plugins/DetAncestralReport.py @@ -2,7 +2,7 @@ # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2002 Bruce J. DeGrasse -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ import BaseDoc import Utils import DateHandler from QuestionDialog import ErrorDialog -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd #------------------------------------------------------------------------ # diff --git a/src/plugins/DetDescendantReport.py b/src/plugins/DetDescendantReport.py index 20c2ac2a6..8a625f24e 100644 --- a/src/plugins/DetDescendantReport.py +++ b/src/plugins/DetDescendantReport.py @@ -2,7 +2,7 @@ # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2002 Bruce J. DeGrasse -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ from ReportBase import Bibliography, Endnotes import BaseDoc import const import DateHandler -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd from QuestionDialog import ErrorDialog #------------------------------------------------------------------------ diff --git a/src/plugins/FamilyGroup.py b/src/plugins/FamilyGroup.py index 16ef1e2b4..6ec877789 100644 --- a/src/plugins/FamilyGroup.py +++ b/src/plugins/FamilyGroup.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify @@ -43,7 +43,7 @@ import BaseDoc import DateHandler import Utils from TransUtils import sgettext as _ -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd #------------------------------------------------------------------------ # diff --git a/src/plugins/FindDupes.py b/src/plugins/FindDupes.py index 412c8290e..d58ca58ad 100644 --- a/src/plugins/FindDupes.py +++ b/src/plugins/FindDupes.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ import gtk.glade import RelLib import Utils import soundex -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import ListModel import Errors from Merge import PersonCompare @@ -604,8 +604,8 @@ class ShowMatches(ManagedWindow.ManagedWindow): p2 = self.db.get_person_from_handle(p2key) if not p1 or not p2: continue - pn1 = NameDisplay.displayer.display(p1) - pn2 = NameDisplay.displayer.display(p2) + pn1 = name_displayer.display(p1) + pn2 = name_displayer.display(p2) self.list.add([c, pn1, pn2,c2],(p1key,p2key)) def on_do_merge_clicked(self,obj): @@ -640,7 +640,7 @@ class ShowMatches(ManagedWindow.ManagedWindow): def name_of(p): if not p: return "" - return "%s (%s)" % (NameDisplay.displayer.display(p),p.get_handle()) + return "%s (%s)" % (name_displayer.display(p),p.get_handle()) def get_name_obj(person): if person: diff --git a/src/plugins/GraphViz.py b/src/plugins/GraphViz.py index 1062b0edb..0aa00231b 100644 --- a/src/plugins/GraphViz.py +++ b/src/plugins/GraphViz.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # Contributions by Lorenzo Cappelletti # # This program is free software; you can redistribute it and/or modify @@ -61,7 +61,7 @@ from ReportBase._CommandLineReport import CommandLineReport from Filters import GenericFilter, Rules import RelLib import DateHandler -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import const from BaseDoc import PAPER_LANDSCAPE from QuestionDialog import ErrorDialog @@ -510,7 +510,7 @@ just use iconv: def get_person_label(self, person): "return person label string" - label = NameDisplay.displayer.display_name(person.get_primary_name()) + label = name_displayer.display_name(person.get_primary_name()) p_id = person.get_gramps_id() if self.includeid: label = label + " (%s)" % p_id diff --git a/src/plugins/IndivComplete.py b/src/plugins/IndivComplete.py index 2b02982df..a1f10db31 100644 --- a/src/plugins/IndivComplete.py +++ b/src/plugins/IndivComplete.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify @@ -51,7 +51,7 @@ from PluginUtils import register_report from ReportBase import Report, ReportUtils, ReportOptions, \ CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI from ReportBase import Bibliography, Endnotes -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd from QuestionDialog import WarningDialog #------------------------------------------------------------------------ diff --git a/src/plugins/NarrativeWeb.py b/src/plugins/NarrativeWeb.py index 39922df42..f58c0b5c0 100644 --- a/src/plugins/NarrativeWeb.py +++ b/src/plugins/NarrativeWeb.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Pubilc License as published by @@ -75,7 +75,7 @@ import Utils import ImgManip import GrampsLocale from QuestionDialog import ErrorDialog, WarningDialog -from BasicUtils.NameDisplay import displayer as _nd +from BasicUtils import name_displayer as _nd from DateHandler import displayer as _dd #------------------------------------------------------------------------ diff --git a/src/plugins/ReadGrdb.py b/src/plugins/ReadGrdb.py index 3785c188b..409d7ab76 100644 --- a/src/plugins/ReadGrdb.py +++ b/src/plugins/ReadGrdb.py @@ -49,7 +49,7 @@ from GrampsDb._GrampsBSDDB import GrampsBSDDB from QuestionDialog import ErrorDialog from Errors import HandleError from BasicUtils import UpdateCallback -from BasicUtils import NameDisplay +from BasicUtils import name_displayer from PluginUtils import register_import #------------------------------------------------------------------------- @@ -106,7 +106,7 @@ def importData(database, filename, callback=None,cl=0,use_trans=True): # we need to do tricks to remap the format numbers if len(other_database.name_formats) > 0: formats_map = remap_name_formats(database,other_database) - NameDisplay.displayer.set_name_format(database.name_formats) + name_displayer.set_name_format(database.name_formats) get_person = make_peron_name_remapper(other_database,formats_map) else: # No remapping necessary, proceed as usual diff --git a/src/plugins/RelCalc.py b/src/plugins/RelCalc.py index 619a9b9ca..f223346a1 100644 --- a/src/plugins/RelCalc.py +++ b/src/plugins/RelCalc.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ import gtk.glade # #------------------------------------------------------------------------- import RelLib -from BasicUtils import NameDisplay +from BasicUtils import name_displayer import ManagedWindow import ListModel import DateHandler @@ -93,7 +93,7 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow): glade_file = "%s/relcalc.glade" % base self.glade = gtk.glade.XML(glade_file,"relcalc","gramps") - name = NameDisplay.displayer.display(self.person) + name = name_displayer.display(self.person) self.title = _('Relationship calculator: %(person_name)s' ) % {'person_name' : name} window = self.glade.get_widget('relcalc') @@ -158,13 +158,13 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow): commontext = "" elif length == 1: person = self.db.get_person_from_handle(common[0]) - name = NameDisplay.displayer.display(person) + name = name_displayer.display(person) commontext = " " + _("Their common ancestor is %s.") % name elif length == 2: p1 = self.db.get_person_from_handle(common[0]) p2 = self.db.get_person_from_handle(common[1]) - p1str = NameDisplay.displayer.display(p1) - p2str = NameDisplay.displayer.display(p2) + p1str = name_displayer.display(p1) + p2str = name_displayer.display(p2) commontext = " " + _("Their common ancestors are %s and %s." ) % (p1str,p2str) elif length > 2: @@ -174,7 +174,7 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow): person = self.db.get_person_from_handle(person_handle) if index != 0: commontext = commontext + ", " - commontext = commontext + NameDisplay.displayer.display(person) + commontext = commontext + name_displayer.display(person) index = index + 1 commontext = commontext + "." else: @@ -183,8 +183,8 @@ class RelCalc(Tool.Tool, ManagedWindow.ManagedWindow): text1 = self.glade.get_widget("text1").get_buffer() if other_person: - p1 = NameDisplay.displayer.display(self.person) - p2 = NameDisplay.displayer.display(other_person) + p1 = name_displayer.display(self.person) + p2 = name_displayer.display(other_person) if other_person == None: rstr = "" diff --git a/src/plugins/TimeLine.py b/src/plugins/TimeLine.py index 15a5546a0..f8e4ee510 100644 --- a/src/plugins/TimeLine.py +++ b/src/plugins/TimeLine.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2003-2006 Donald N. Allingham +# Copyright (C) 2003-2007 Donald N. Allingham # Copyright (C) 2007 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify @@ -52,7 +52,7 @@ import BaseDoc from Filters import GenericFilter, Rules import Sort from QuestionDialog import ErrorDialog -from BasicUtils import NameDisplay +from BasicUtils import name_displayer #------------------------------------------------------------------------ # @@ -89,7 +89,7 @@ class TimeLine(Report): filters = ReportUtils.get_person_filters(person,False) self.filter = filters[filter_num] - name = NameDisplay.displayer.display_formal(person) + name = name_displayer.display_formal(person) self.title = _("Timeline Graph for %s") % name sort_func_num = options_class.handler.options_dict['sortby'] @@ -147,7 +147,7 @@ class TimeLine(Report): else: d = None - n = NameDisplay.displayer.display_formal(p) + n = name_displayer.display_formal(p) self.doc.draw_text('TLG-text',n,incr+pad,self.header + (incr+pad)*index) y1 = self.header + (pad+incr)*index @@ -283,7 +283,7 @@ class TimeLine(Report): size = 0 for p_id in self.plist: p = self.database.get_person_from_handle(p_id) - n = NameDisplay.displayer.display_formal(p) + n = name_displayer.display_formal(p) size = max(self.doc.string_width(font,n),size) return pt2cm(size)