Moved NameDisplay into BasicUtils.
svn: r8197
This commit is contained in:
parent
5cdb7b7336
commit
70e12c490e
@ -38,7 +38,13 @@ import re
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from RelLib import Name
|
||||
import Config
|
||||
|
||||
try:
|
||||
import Config
|
||||
WITH_GRAMPS_CONFIG=True
|
||||
except ImportError:
|
||||
WITH_GRAMPS_CONFIG=False
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -93,13 +99,17 @@ class NameDisplay:
|
||||
]
|
||||
|
||||
def __init__(self):
|
||||
global WITH_GRAMP_CONFIG
|
||||
self.name_formats = {}
|
||||
self.set_name_format(self.STANDARD_FORMATS)
|
||||
|
||||
self.default_format = Config.get(Config.NAME_FORMAT)
|
||||
if self.default_format == 0:
|
||||
self.default_format = Name.LNFN
|
||||
Config.set(Config.NAME_FORMAT,self.default_format)
|
||||
if WITH_GRAMPS_CONFIG:
|
||||
self.default_format = Config.get(Config.NAME_FORMAT)
|
||||
if self.default_format == 0:
|
||||
self.default_format = Name.LNFN
|
||||
Config.set(Config.NAME_FORMAT,self.default_format)
|
||||
else:
|
||||
self.default_format = 1
|
||||
|
||||
self.set_default_format(self.default_format)
|
||||
|
@ -54,7 +54,7 @@ import gtk
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import GrampsDisplay
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import ListModel
|
||||
import Utils
|
||||
|
||||
|
@ -51,7 +51,7 @@ except:
|
||||
#-------------------------------------------------------------------------
|
||||
import RelLib
|
||||
import PageView
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import Utils
|
||||
import DateHandler
|
||||
import ImgManip
|
||||
@ -949,7 +949,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
|
||||
# Add navigation arrows
|
||||
if lst[0]:
|
||||
#l = gtk.Button("◀")
|
||||
#l = gtk.Button("‚óÄ")
|
||||
l=gtk.Button()
|
||||
l.add(gtk.Arrow(gtk.ARROW_LEFT, gtk.SHADOW_IN))
|
||||
childlist = find_children(self.dbstate.db,lst[0][0])
|
||||
@ -960,7 +960,7 @@ class PedigreeView(PageView.PersonNavView):
|
||||
l.set_sensitive(False)
|
||||
ymid = int(math.floor(ymax/2))
|
||||
table_widget.attach(l,0,1,ymid,ymid+1,0,0,0,0)
|
||||
#l = gtk.Button("▶")
|
||||
#l = gtk.Button("‚ñ∂")
|
||||
l = gtk.Button()
|
||||
l.add(gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_IN))
|
||||
if lst[1]:
|
||||
|
@ -53,7 +53,7 @@ from gtk.gdk import ACTION_COPY, BUTTON1_MASK
|
||||
import RelLib
|
||||
from DisplayModels import PeopleModel
|
||||
import PageView
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import Utils
|
||||
import QuestionDialog
|
||||
import TreeTips
|
||||
|
@ -48,7 +48,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
import RelLib
|
||||
import PageView
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import DateHandler
|
||||
import ImgManip
|
||||
import Config
|
||||
|
@ -43,7 +43,7 @@ import gtk
|
||||
import const
|
||||
import ToolTips
|
||||
import GrampsLocale
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import RelLib
|
||||
|
||||
from _BaseModel import BaseModel
|
||||
|
@ -60,7 +60,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
from RelLib import *
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import DateHandler
|
||||
import ToolTips
|
||||
import GrampsLocale
|
||||
|
@ -51,7 +51,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
import GrampsDb
|
||||
import Config
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import const
|
||||
import ManagedWindow
|
||||
|
||||
|
@ -35,7 +35,7 @@ from gettext import gettext as _
|
||||
# GRAMPS classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import Utils
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -33,7 +33,7 @@ import gtk
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import DateHandler
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import Utils
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -32,7 +32,7 @@ import gtk
|
||||
# GRAMPS classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -32,7 +32,7 @@ import gtk
|
||||
# GRAMPS classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -50,7 +50,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
import Utils
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import RelLib
|
||||
import Config
|
||||
import Errors
|
||||
|
@ -50,7 +50,7 @@ import gtk.glade
|
||||
import const
|
||||
import Config
|
||||
import RelLib
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import LdsUtils
|
||||
|
||||
from _EditSecondary import EditSecondary
|
||||
|
@ -42,7 +42,7 @@ import gtk.glade
|
||||
import const
|
||||
import Config
|
||||
import Utils
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
from _EditSecondary import EditSecondary
|
||||
|
||||
from DisplayTabs import SourceEmbedList,NoteTab
|
||||
|
@ -53,7 +53,7 @@ import Utils
|
||||
import Mime
|
||||
import RelLib
|
||||
import GrampsWidgets
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import Errors
|
||||
|
||||
from GrampsDb import set_birth_death_index
|
||||
|
@ -46,7 +46,7 @@ import gtk.glade
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
import Config
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
from _EditSecondary import EditSecondary
|
||||
|
||||
from DisplayTabs import SourceEmbedList, NoteTab
|
||||
|
@ -24,7 +24,7 @@ from gettext import gettext as _
|
||||
|
||||
import ManagedWindow
|
||||
import DateHandler
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import Config
|
||||
import GrampsDisplay
|
||||
from QuestionDialog import SaveDialog
|
||||
|
@ -60,7 +60,7 @@ import RelLib
|
||||
from Filters import Rules
|
||||
import AutoComp
|
||||
from Selectors import selector_factory
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
import Utils
|
||||
import ManagedWindow
|
||||
|
||||
|
@ -56,7 +56,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
import ManagedWindow
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
import Utils
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -41,7 +41,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
import Config
|
||||
import DateHandler
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
from RelLib import Name
|
||||
import ManagedWindow
|
||||
from GrampsWidgets import *
|
||||
|
@ -113,7 +113,7 @@ LOG = logging.getLogger(".GedcomImport")
|
||||
#-------------------------------------------------------------------------
|
||||
import Errors
|
||||
import RelLib
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import Utils
|
||||
import Mime
|
||||
import LdsUtils
|
||||
|
@ -41,7 +41,7 @@ from GrampsDb._GrampsBSDDB import GrampsBSDDB
|
||||
from QuestionDialog import ErrorDialog
|
||||
from Errors import HandleError
|
||||
from BasicUtils import UpdateCallback
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -51,7 +51,7 @@ import RelLib
|
||||
import const
|
||||
import Utils
|
||||
import DateHandler
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
from GrampsDb._GrampsDbConst import \
|
||||
PERSON_KEY,FAMILY_KEY,SOURCE_KEY,EVENT_KEY,\
|
||||
MEDIA_KEY,PLACE_KEY,REPOSITORY_KEY
|
||||
|
@ -54,7 +54,7 @@ import _GedcomInfo as GedcomInfo
|
||||
import Errors
|
||||
import ansel_utf8
|
||||
import Utils
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
from QuestionDialog import *
|
||||
from BasicUtils import UpdateCallback
|
||||
|
||||
|
@ -43,7 +43,7 @@ import pango
|
||||
#-------------------------------------------------------------------------
|
||||
import RelLib
|
||||
from ReportBase import ReportUtils
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import const
|
||||
import DateHandler
|
||||
import QuestionDialog
|
||||
|
@ -35,7 +35,7 @@ __revision__ = "$Revision$"
|
||||
#
|
||||
#-------------------------------------------------------------------
|
||||
import gtk
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
|
||||
DISABLED = -1
|
||||
|
||||
|
@ -28,7 +28,7 @@ import gtk
|
||||
import gobject
|
||||
|
||||
from RelLib import Person
|
||||
from NameDisplay import displayer
|
||||
from BasicUtils.NameDisplay import displayer
|
||||
display_name = displayer.display
|
||||
|
||||
from _ObjectFrameBase import ObjectFrameBase
|
||||
|
@ -27,7 +27,7 @@ import gobject
|
||||
|
||||
from TreeViews import PersonTreeView
|
||||
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
|
||||
from _TreeFrameBase import TreeFrameBase
|
||||
|
||||
|
@ -214,7 +214,7 @@ class BookMarkView(PageView):
|
||||
self.dbstate, self.uistate, bookmarks, self.goto_handle)
|
||||
|
||||
def add_bookmark(self, obj):
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
|
||||
if self.dbstate.active:
|
||||
self.bookmarks.add(self.dbstate.active.get_handle())
|
||||
|
@ -43,7 +43,7 @@ log = logging.getLogger(".")
|
||||
import const
|
||||
import Utils
|
||||
from Filters import CustomFilters
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import Errors
|
||||
from _Options import *
|
||||
|
||||
|
@ -25,7 +25,7 @@ from gettext import gettext as _
|
||||
import const
|
||||
import gtk
|
||||
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import ListModel
|
||||
import ManagedWindow
|
||||
|
||||
|
@ -40,7 +40,7 @@ import gtk
|
||||
# gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import BaseDoc
|
||||
import Utils
|
||||
|
||||
|
@ -24,7 +24,7 @@ import logging
|
||||
log = logging.getLogger(".")
|
||||
|
||||
import PluginUtils
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import Utils
|
||||
import BaseDoc
|
||||
from _Constants import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK
|
||||
|
@ -42,7 +42,7 @@ import cStringIO
|
||||
#------------------------------------------------------------------------
|
||||
import DateHandler
|
||||
import RelLib
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
from QuestionDialog import WarningDialog
|
||||
import BaseDoc
|
||||
|
||||
|
@ -40,7 +40,7 @@ import locale
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from RelLib import Date
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -41,7 +41,7 @@ __version__ = "$Revision$"
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import DateHandler
|
||||
import RelLib
|
||||
|
||||
|
@ -7,7 +7,7 @@ import gtk
|
||||
from Models import \
|
||||
PersonTreeModel, PersonListModel, PersonFilterModel
|
||||
|
||||
from NameDisplay import displayer
|
||||
from BasicUtils.NameDisplay import displayer
|
||||
from RelLib import Event
|
||||
import DateHandler
|
||||
import Utils
|
||||
|
@ -46,7 +46,7 @@ import gtk
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import Mime
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import RelLib
|
||||
import Errors
|
||||
from QuestionDialog import WarningDialog
|
||||
|
@ -73,7 +73,7 @@ import Navigation
|
||||
import TipOfDay
|
||||
import Bookmarks
|
||||
import RecentFiles
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import GrampsWidgets
|
||||
import UndoHistory
|
||||
from DbLoader import DbLoader
|
||||
|
@ -47,7 +47,7 @@ from SubstKeywords import SubstKeywords
|
||||
from PluginUtils import register_report
|
||||
from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
pt2cm = ReportUtils.pt2cm
|
||||
cm2pt = ReportUtils.cm2pt
|
||||
|
||||
|
@ -40,7 +40,7 @@ from PluginUtils import register_report
|
||||
from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
|
||||
import BaseDoc
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
|
||||
from RelLib import ChildRefType
|
||||
|
||||
|
@ -49,7 +49,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
import BaseDoc
|
||||
import RelLib
|
||||
from DateHandler import displayer as _dd
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -61,7 +61,7 @@ import ManagedWindow
|
||||
|
||||
from PluginUtils import Tool, register_tool
|
||||
from QuestionDialog import OkDialog, MissingMediaDialog
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -49,7 +49,7 @@ pt2cm = ReportUtils.pt2cm
|
||||
import BaseDoc
|
||||
from SubstKeywords import SubstKeywords
|
||||
import Errors
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -43,7 +43,7 @@ import gtk.glade
|
||||
# GRAMPS modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
from PluginUtils import Tool, register_tool
|
||||
import GrampsDisplay
|
||||
import ManagedWindow
|
||||
|
@ -49,7 +49,7 @@ from ReportBase import Report, ReportOptions, ReportUtils, \
|
||||
pt2cm = ReportUtils.pt2cm
|
||||
cm2pt = ReportUtils.cm2pt
|
||||
from SubstKeywords import SubstKeywords
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -42,7 +42,7 @@ import BaseDoc
|
||||
import Errors
|
||||
import Sort
|
||||
from QuestionDialog import ErrorDialog
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import DateHandler
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
@ -52,7 +52,7 @@ import BaseDoc
|
||||
import Utils
|
||||
import DateHandler
|
||||
from QuestionDialog import ErrorDialog
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -52,7 +52,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
import BaseDoc
|
||||
import const
|
||||
import DateHandler
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
@ -42,7 +42,7 @@ import BaseDoc
|
||||
import DateHandler
|
||||
import Utils
|
||||
from TransUtils import sgettext as _
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -46,7 +46,7 @@ import gtk.glade
|
||||
import RelLib
|
||||
import Utils
|
||||
import soundex
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import ListModel
|
||||
import Errors
|
||||
from Merge import PersonCompare
|
||||
|
@ -49,7 +49,7 @@ import DateHandler
|
||||
from PluginUtils import register_report
|
||||
from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
from QuestionDialog import WarningDialog
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
@ -75,7 +75,7 @@ import Utils
|
||||
import ImgManip
|
||||
import GrampsLocale
|
||||
from QuestionDialog import ErrorDialog, WarningDialog
|
||||
from NameDisplay import displayer as _nd
|
||||
from BasicUtils.NameDisplay import displayer as _nd
|
||||
from DateHandler import displayer as _dd
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
@ -43,7 +43,7 @@ import gtk.glade
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import RelLib
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
import ManagedWindow
|
||||
import ListModel
|
||||
import DateHandler
|
||||
|
@ -51,7 +51,7 @@ import BaseDoc
|
||||
from Filters import GenericFilter, Rules
|
||||
import Sort
|
||||
from QuestionDialog import ErrorDialog
|
||||
import NameDisplay
|
||||
from BasicUtils import NameDisplay
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user