2004-03-22 10:11:35 +05:30
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
* src/RelLib.py (Transaction.__len__): Redefine length.
* src/ChooseParents.py, src/EditPerson.py, src/EditSource.py,
src/EventEdit.py, src/FamilyView.py, src/gramps_main.py,
src/ImageSelect.py, src/Marriage.py, src/MediaView.py,
src/PedView.py, src/PeopleModel.py, src/PlaceView.py,
src/SelectChild.py, src/SelectObject.py, src/Sources.py,
src/SourceView.py, src/Utils.py, src/Witness.py,
src/WriteXML.py: Switch from find_* to try_to_find_* methods.
svn: r3193
2004-05-26 08:56:18 +05:30
|
|
|
# Copyright (C) 2000-2004 Donald N. Allingham
|
2004-03-22 10:11:35 +05:30
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
* src/RelLib.py (Transaction.__len__): Redefine length.
* src/ChooseParents.py, src/EditPerson.py, src/EditSource.py,
src/EventEdit.py, src/FamilyView.py, src/gramps_main.py,
src/ImageSelect.py, src/Marriage.py, src/MediaView.py,
src/PedView.py, src/PeopleModel.py, src/PlaceView.py,
src/SelectChild.py, src/SelectObject.py, src/Sources.py,
src/SourceView.py, src/Utils.py, src/Witness.py,
src/WriteXML.py: Switch from find_* to try_to_find_* methods.
svn: r3193
2004-05-26 08:56:18 +05:30
|
|
|
# $Id$
|
|
|
|
|
2004-04-28 09:36:25 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Standard python modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
from gettext import gettext as _
|
2004-08-24 09:18:15 +05:30
|
|
|
import time
|
2004-04-28 09:36:25 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GTK modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2004-03-08 03:20:41 +05:30
|
|
|
import gobject
|
|
|
|
import gtk
|
2004-04-28 09:36:25 +05:30
|
|
|
import pango
|
2004-03-08 03:20:41 +05:30
|
|
|
|
2004-04-28 09:36:25 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# GRAMPS modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
from RelLib import *
|
2004-08-18 09:25:55 +05:30
|
|
|
import accent
|
2004-04-28 09:36:25 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# constants
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2004-03-23 10:31:19 +05:30
|
|
|
COLUMN_NAME = 0
|
2004-08-24 09:18:15 +05:30
|
|
|
COLUMN_VIEW = 9
|
2004-06-03 08:58:46 +05:30
|
|
|
COLUMN_BOLD = COLUMN_VIEW + 1
|
2004-06-27 08:40:06 +05:30
|
|
|
COLUMN_INT_ID = COLUMN_BOLD + 1
|
|
|
|
|
|
|
|
_INT_ID_COL= 0
|
|
|
|
_ID_COL = 1
|
|
|
|
_GENDER_COL= 2
|
|
|
|
_NAME_COL = 3
|
|
|
|
_DEATH_COL = 6
|
|
|
|
_BIRTH_COL = 7
|
|
|
|
_FAMILY_COL= 9
|
2004-08-24 09:18:15 +05:30
|
|
|
_CHANGE_COL= 21
|
2004-03-23 10:31:19 +05:30
|
|
|
|
2004-04-28 09:36:25 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# PeopleModel
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2004-03-08 03:20:41 +05:30
|
|
|
class PeopleModel(gtk.GenericTreeModel):
|
|
|
|
|
2004-06-27 23:38:19 +05:30
|
|
|
def __init__(self,db):
|
2004-03-08 03:20:41 +05:30
|
|
|
gtk.GenericTreeModel.__init__(self)
|
2004-03-22 10:11:35 +05:30
|
|
|
|
2004-03-08 03:20:41 +05:30
|
|
|
self.db = db
|
2004-04-28 09:36:25 +05:30
|
|
|
self.visible = {}
|
2004-04-30 08:31:51 +05:30
|
|
|
self.top_visible = {}
|
2004-03-22 10:11:35 +05:30
|
|
|
|
2004-03-10 10:45:06 +05:30
|
|
|
self.fmap = [
|
|
|
|
self.column_name,
|
|
|
|
self.column_id,
|
|
|
|
self.column_gender,
|
|
|
|
self.column_birth_day,
|
|
|
|
self.column_birth_place,
|
|
|
|
self.column_death_day,
|
|
|
|
self.column_death_place,
|
2004-06-03 08:58:46 +05:30
|
|
|
self.column_spouse,
|
2004-08-24 09:18:15 +05:30
|
|
|
self.column_change,
|
2004-08-19 09:14:10 +05:30
|
|
|
self.sort_name,
|
2004-03-10 10:45:06 +05:30
|
|
|
]
|
2004-03-08 03:20:41 +05:30
|
|
|
|
2004-04-28 09:36:25 +05:30
|
|
|
maps = self.db.get_people_view_maps()
|
2004-08-01 09:51:31 +05:30
|
|
|
if maps[0] != None and len(maps[0]) != 0:
|
2004-04-28 09:36:25 +05:30
|
|
|
self.top_path2iter = maps[1]
|
|
|
|
self.iter2path = maps[2]
|
|
|
|
self.path2iter = maps[3]
|
|
|
|
self.sname_sub = maps[4]
|
|
|
|
else:
|
|
|
|
self.rebuild_data()
|
|
|
|
|
2004-08-20 07:50:06 +05:30
|
|
|
# self.connect('row-deleted',self.on_row_deleted)
|
|
|
|
# self.connect('row-inserted',self.on_row_inserted)
|
2004-04-28 09:36:25 +05:30
|
|
|
|
2004-03-08 03:20:41 +05:30
|
|
|
def rebuild_data(self):
|
2004-08-20 03:05:16 +05:30
|
|
|
self.top_path2iter = []
|
2004-03-08 03:20:41 +05:30
|
|
|
self.iter2path = {}
|
|
|
|
self.path2iter = {}
|
|
|
|
self.sname_sub = {}
|
2004-04-28 09:36:25 +05:30
|
|
|
self.visible = {}
|
2004-04-30 08:31:51 +05:30
|
|
|
self.top_visible = {}
|
2004-03-08 03:20:41 +05:30
|
|
|
|
|
|
|
if not self.db.is_open():
|
|
|
|
return
|
2004-03-30 10:20:24 +05:30
|
|
|
|
2004-08-13 10:04:07 +05:30
|
|
|
for person_handle in self.db.get_person_handles(sort_handles=False):
|
2004-08-01 09:51:31 +05:30
|
|
|
|
2004-08-07 10:46:57 +05:30
|
|
|
person = self.db.get_person_from_handle(person_handle)
|
2004-03-08 03:20:41 +05:30
|
|
|
surname = unicode(person.get_primary_name().get_surname())
|
|
|
|
|
|
|
|
if self.sname_sub.has_key(surname):
|
2004-07-28 07:59:07 +05:30
|
|
|
self.sname_sub[surname].append(person_handle)
|
2004-03-08 03:20:41 +05:30
|
|
|
else:
|
2004-07-28 07:59:07 +05:30
|
|
|
self.sname_sub[surname] = [person_handle]
|
2004-03-22 10:11:35 +05:30
|
|
|
|
2004-08-13 10:04:07 +05:30
|
|
|
name_list = self.db.get_surname_list()
|
2004-03-22 10:11:35 +05:30
|
|
|
for name in name_list:
|
|
|
|
if self.sname_sub.has_key(name):
|
2004-08-20 03:05:16 +05:30
|
|
|
self.top_path2iter.append(name)
|
2004-03-23 10:31:19 +05:30
|
|
|
val = 0
|
|
|
|
entries = self.sname_sub[name]
|
|
|
|
entries.sort(self.byname)
|
2004-07-28 07:59:07 +05:30
|
|
|
for person_handle in entries:
|
2004-03-23 10:31:19 +05:30
|
|
|
tpl = (name,val)
|
2004-07-28 07:59:07 +05:30
|
|
|
self.iter2path[person_handle] = tpl
|
|
|
|
self.path2iter[tpl] = person_handle
|
2004-03-23 10:31:19 +05:30
|
|
|
val += 1
|
2004-06-28 06:57:37 +05:30
|
|
|
self.db.set_people_view_maps(self.get_maps())
|
|
|
|
|
|
|
|
def get_maps(self):
|
2004-08-20 03:05:16 +05:30
|
|
|
return (None,
|
2004-06-28 06:57:37 +05:30
|
|
|
self.top_path2iter,
|
|
|
|
self.iter2path,
|
|
|
|
self.path2iter,
|
|
|
|
self.sname_sub)
|
2004-04-28 09:36:25 +05:30
|
|
|
|
2004-03-23 10:31:19 +05:30
|
|
|
def byname(self,f,s):
|
2004-06-27 08:40:06 +05:30
|
|
|
n1 = self.db.person_map.get(str(f))[_NAME_COL].get_sort_name()
|
|
|
|
n2 = self.db.person_map.get(str(s))[_NAME_COL].get_sort_name()
|
2004-03-23 10:31:19 +05:30
|
|
|
return cmp(n1,n2)
|
2004-03-22 10:11:35 +05:30
|
|
|
|
2004-03-08 03:20:41 +05:30
|
|
|
def on_get_flags(self):
|
|
|
|
'''returns the GtkTreeModelFlags for this particular type of model'''
|
2004-04-28 09:36:25 +05:30
|
|
|
return gtk.TREE_MODEL_ITERS_PERSIST
|
2004-03-08 03:20:41 +05:30
|
|
|
|
|
|
|
def on_get_n_columns(self):
|
2004-06-27 08:40:06 +05:30
|
|
|
return COLUMN_INT_ID + 1
|
2004-03-08 03:20:41 +05:30
|
|
|
|
|
|
|
def on_get_path(self, node):
|
|
|
|
'''returns the tree path (a tuple of indices at the various
|
|
|
|
levels) for a particular node.'''
|
2004-08-20 03:05:16 +05:30
|
|
|
try:
|
|
|
|
return (self.top_path2iter.index(node),)
|
|
|
|
except ValueError:
|
2004-03-08 03:20:41 +05:30
|
|
|
(surname,index) = self.iter2path[node]
|
2004-08-20 03:05:16 +05:30
|
|
|
return (self.top_path2iter.index(surname),index)
|
2004-03-08 03:20:41 +05:30
|
|
|
|
|
|
|
def on_get_column_type(self,index):
|
2004-04-28 09:36:25 +05:30
|
|
|
"""The visibility column is a boolean, the weight column is an integer,
|
|
|
|
everthing else is a string"""
|
|
|
|
if index == COLUMN_VIEW:
|
|
|
|
return gobject.TYPE_BOOLEAN
|
|
|
|
elif index == COLUMN_BOLD:
|
|
|
|
return gobject.TYPE_INT
|
|
|
|
else:
|
|
|
|
return gobject.TYPE_STRING
|
2004-03-08 03:20:41 +05:30
|
|
|
|
|
|
|
def on_get_iter(self, path):
|
|
|
|
try:
|
2004-04-28 09:36:25 +05:30
|
|
|
if len(path)==1: # Top Level
|
2004-03-08 03:20:41 +05:30
|
|
|
return self.top_path2iter[path[0]]
|
2004-04-28 09:36:25 +05:30
|
|
|
else: # Sublevel
|
2004-03-08 03:20:41 +05:30
|
|
|
surname = self.top_path2iter[path[0]]
|
|
|
|
return self.path2iter[(surname,path[1])]
|
|
|
|
except:
|
|
|
|
return None
|
|
|
|
|
|
|
|
def on_get_value(self,iter,col):
|
2004-06-27 08:40:06 +05:30
|
|
|
if col == COLUMN_INT_ID:
|
|
|
|
return iter
|
|
|
|
elif col == COLUMN_BOLD:
|
2004-08-20 03:05:16 +05:30
|
|
|
if self.sname_sub.has_key(iter):
|
2004-04-28 09:36:25 +05:30
|
|
|
return pango.WEIGHT_BOLD
|
|
|
|
else:
|
|
|
|
return pango.WEIGHT_NORMAL
|
|
|
|
elif col == COLUMN_VIEW:
|
2004-08-20 03:05:16 +05:30
|
|
|
if self.sname_sub.has_key(iter):
|
2004-04-30 08:31:51 +05:30
|
|
|
return self.top_visible.has_key(iter)
|
2004-04-28 09:36:25 +05:30
|
|
|
return self.visible.has_key(iter)
|
2004-08-20 03:05:16 +05:30
|
|
|
elif self.sname_sub.has_key(iter):
|
2004-03-08 03:20:41 +05:30
|
|
|
if col == 0:
|
|
|
|
return iter
|
|
|
|
else:
|
2004-03-22 10:11:35 +05:30
|
|
|
return u''
|
2004-03-08 03:20:41 +05:30
|
|
|
else:
|
2004-08-25 09:07:48 +05:30
|
|
|
try:
|
|
|
|
return self.fmap[col](self.db.person_map[str(iter)])
|
|
|
|
except:
|
|
|
|
return u''
|
2004-03-08 03:20:41 +05:30
|
|
|
|
2004-04-28 09:36:25 +05:30
|
|
|
def reset_visible(self):
|
|
|
|
self.visible = {}
|
2004-04-30 08:31:51 +05:30
|
|
|
self.top_visible = {}
|
2004-04-28 09:36:25 +05:30
|
|
|
|
|
|
|
def set_visible(self,iter,val):
|
2004-05-04 10:04:48 +05:30
|
|
|
try:
|
|
|
|
col = self.iter2path[iter]
|
|
|
|
self.top_visible[col[0]] = val
|
|
|
|
self.visible[iter] = val
|
|
|
|
except:
|
|
|
|
self.visible[iter] = val
|
2004-04-28 09:36:25 +05:30
|
|
|
|
2004-03-08 03:20:41 +05:30
|
|
|
def on_iter_next(self, node):
|
|
|
|
'''returns the next node at this level of the tree'''
|
2004-08-20 03:05:16 +05:30
|
|
|
try:
|
|
|
|
path = self.top_path2iter.index(node)
|
|
|
|
if path+1 == len(self.top_path2iter):
|
|
|
|
return None
|
|
|
|
return self.top_path2iter[path+1]
|
|
|
|
except:
|
2004-03-08 03:20:41 +05:30
|
|
|
(surname,val) = self.iter2path[node]
|
|
|
|
return self.path2iter.get((surname,val+1))
|
|
|
|
|
|
|
|
def on_iter_children(self,node):
|
2004-03-22 10:11:35 +05:30
|
|
|
"""Return the first child of the node"""
|
2004-03-08 03:20:41 +05:30
|
|
|
if node == None:
|
|
|
|
return self.top_path2iter[0]
|
2004-04-28 09:36:25 +05:30
|
|
|
else:
|
|
|
|
return self.path2iter.get((node,0))
|
2004-03-08 03:20:41 +05:30
|
|
|
|
|
|
|
def on_iter_has_child(self, node):
|
|
|
|
'''returns true if this node has children'''
|
|
|
|
if node == None:
|
2004-08-20 03:05:16 +05:30
|
|
|
return len(self.sname_sub)
|
2004-03-22 10:11:35 +05:30
|
|
|
if self.sname_sub.has_key(node) and len(self.sname_sub[node]) > 0:
|
2004-04-28 09:36:25 +05:30
|
|
|
return gtk.TRUE
|
|
|
|
return gtk.FALSE
|
2004-03-08 03:20:41 +05:30
|
|
|
|
|
|
|
def on_iter_n_children(self,node):
|
2004-03-22 10:11:35 +05:30
|
|
|
if node == None:
|
2004-08-20 03:05:16 +05:30
|
|
|
return len(self.sname_sub)
|
|
|
|
try:
|
2004-03-08 03:20:41 +05:30
|
|
|
return len(self.sname_sub[node])
|
2004-08-20 03:05:16 +05:30
|
|
|
except:
|
|
|
|
return 0
|
2004-03-08 03:20:41 +05:30
|
|
|
|
|
|
|
def on_iter_nth_child(self,node,n):
|
2004-04-28 09:36:25 +05:30
|
|
|
if node == None:
|
|
|
|
return self.top_path2iter.get(n)
|
2004-08-20 03:05:16 +05:30
|
|
|
try:
|
|
|
|
path = self.top_path2iter.index(node)
|
|
|
|
return self.path2iter[(node,n)]
|
|
|
|
except:
|
2004-03-08 03:20:41 +05:30
|
|
|
return None
|
|
|
|
|
|
|
|
def on_iter_parent(self, node):
|
|
|
|
'''returns the parent of this node'''
|
2004-03-22 10:11:35 +05:30
|
|
|
path = self.iter2path.get(node)
|
2004-03-08 03:20:41 +05:30
|
|
|
if path:
|
|
|
|
return path[0]
|
|
|
|
return None
|
2004-03-10 10:45:06 +05:30
|
|
|
|
2004-03-23 10:31:19 +05:30
|
|
|
def sort_name(self,data):
|
2004-06-27 08:40:06 +05:30
|
|
|
return data[_NAME_COL].get_sort_name()
|
2004-03-23 10:31:19 +05:30
|
|
|
|
2004-06-03 08:58:46 +05:30
|
|
|
def column_spouse(self,data):
|
2004-08-24 09:44:08 +05:30
|
|
|
spouses_names = u""
|
|
|
|
handle = data[0]
|
|
|
|
for family_handle in data[_FAMILY_COL]:
|
|
|
|
family = self.db.get_family_from_handle(family_handle)
|
|
|
|
for spouse_id in [family.get_father_handle(), family.get_mother_handle()]:
|
|
|
|
if not spouse_id:
|
|
|
|
continue
|
|
|
|
if spouse_id == handle:
|
|
|
|
continue
|
|
|
|
spouse = self.db.get_person_from_handle(spouse_id)
|
|
|
|
if len(spouses_names) > 0:
|
|
|
|
spouses_names += ", "
|
|
|
|
spouses_names += spouse.get_primary_name().get_regular_name()
|
|
|
|
return spouses_names
|
2004-06-03 08:58:46 +05:30
|
|
|
|
2004-03-10 10:45:06 +05:30
|
|
|
def column_name(self,data):
|
2004-06-27 08:40:06 +05:30
|
|
|
return data[_NAME_COL].get_name()
|
2004-03-10 10:45:06 +05:30
|
|
|
|
|
|
|
def column_id(self,data):
|
2004-06-27 08:40:06 +05:30
|
|
|
return data[_ID_COL]
|
2004-03-10 10:45:06 +05:30
|
|
|
|
2004-08-24 09:18:15 +05:30
|
|
|
def column_change(self,data):
|
|
|
|
return time.asctime(time.localtime(data[_CHANGE_COL]))
|
|
|
|
|
2004-03-10 10:45:06 +05:30
|
|
|
def column_gender(self,data):
|
2004-06-27 08:40:06 +05:30
|
|
|
return _GENDER[data[_GENDER_COL]]
|
2004-03-10 10:45:06 +05:30
|
|
|
|
|
|
|
def column_birth_day(self,data):
|
2004-06-27 08:40:06 +05:30
|
|
|
if data[_BIRTH_COL]:
|
* src/AddSpouse.py, src/ChooseParents.py, src/EditPerson.py,
src/EditPlace.py, src/EditSource.py, src/EventEdit.py,
src/FamilyView.py, src/GenericFilter.py,
src/Marriage.py, src/PedView.py, src/PeopleModel.py,
src/PlaceView.py, src/RelLib.py, src/SelectChild.py,
src/Sort.py, src/SourceView.py, src/SubstKeywords.py,
src/WriteGedcom.py, src/WriteXML.py, src/plugins/AncestorReport.py,
src/plugins/Ancestors.py, src/plugins/ChangeTypes.py,
src/plugins/DescendReport.py, src/plugins/DetDescendantReport.py,
src/plugins/EventCmp.py, src/plugins/FamilyGroup.py,
src/plugins/FanChart.py, src/plugins/FtmStyleAncestors.py,
src/plugins/FtmStyleDescendants.py, src/plugins/GraphViz.py,
src/plugins/IndivComplete.py, src/plugins/IndivSummary.py,
src/plugins/Merge.py, src/plugins/RelCalc.py, src/plugins/RelGraph.py,
src/plugins/Summary.py, src/plugins/TimeLine.py, src/plugins/Verify.py,
src/plugins/WebPage.py, src/plugins/WriteCD.py,
src/plugins/WritePkg.py, src/plugins/DetAncestralReport.py:
Use get_event_from_handle (not find_ ).
svn: r3462
2004-08-22 00:26:01 +05:30
|
|
|
return self.db.get_event_from_handle(data[_BIRTH_COL]).get_date()
|
2004-03-10 10:45:06 +05:30
|
|
|
else:
|
|
|
|
return u""
|
|
|
|
|
|
|
|
def column_death_day(self,data):
|
2004-06-27 08:40:06 +05:30
|
|
|
if data[_DEATH_COL]:
|
* src/AddSpouse.py, src/ChooseParents.py, src/EditPerson.py,
src/EditPlace.py, src/EditSource.py, src/EventEdit.py,
src/FamilyView.py, src/GenericFilter.py,
src/Marriage.py, src/PedView.py, src/PeopleModel.py,
src/PlaceView.py, src/RelLib.py, src/SelectChild.py,
src/Sort.py, src/SourceView.py, src/SubstKeywords.py,
src/WriteGedcom.py, src/WriteXML.py, src/plugins/AncestorReport.py,
src/plugins/Ancestors.py, src/plugins/ChangeTypes.py,
src/plugins/DescendReport.py, src/plugins/DetDescendantReport.py,
src/plugins/EventCmp.py, src/plugins/FamilyGroup.py,
src/plugins/FanChart.py, src/plugins/FtmStyleAncestors.py,
src/plugins/FtmStyleDescendants.py, src/plugins/GraphViz.py,
src/plugins/IndivComplete.py, src/plugins/IndivSummary.py,
src/plugins/Merge.py, src/plugins/RelCalc.py, src/plugins/RelGraph.py,
src/plugins/Summary.py, src/plugins/TimeLine.py, src/plugins/Verify.py,
src/plugins/WebPage.py, src/plugins/WriteCD.py,
src/plugins/WritePkg.py, src/plugins/DetAncestralReport.py:
Use get_event_from_handle (not find_ ).
svn: r3462
2004-08-22 00:26:01 +05:30
|
|
|
return self.db.get_event_from_handle(data[_DEATH_COL]).get_date()
|
2004-03-10 10:45:06 +05:30
|
|
|
else:
|
|
|
|
return u""
|
|
|
|
|
|
|
|
def column_birth_place(self,data):
|
2004-06-27 08:40:06 +05:30
|
|
|
if data[_BIRTH_COL]:
|
* src/AddSpouse.py, src/ChooseParents.py, src/EditPerson.py,
src/EditPlace.py, src/EditSource.py, src/EventEdit.py,
src/FamilyView.py, src/GenericFilter.py,
src/Marriage.py, src/PedView.py, src/PeopleModel.py,
src/PlaceView.py, src/RelLib.py, src/SelectChild.py,
src/Sort.py, src/SourceView.py, src/SubstKeywords.py,
src/WriteGedcom.py, src/WriteXML.py, src/plugins/AncestorReport.py,
src/plugins/Ancestors.py, src/plugins/ChangeTypes.py,
src/plugins/DescendReport.py, src/plugins/DetDescendantReport.py,
src/plugins/EventCmp.py, src/plugins/FamilyGroup.py,
src/plugins/FanChart.py, src/plugins/FtmStyleAncestors.py,
src/plugins/FtmStyleDescendants.py, src/plugins/GraphViz.py,
src/plugins/IndivComplete.py, src/plugins/IndivSummary.py,
src/plugins/Merge.py, src/plugins/RelCalc.py, src/plugins/RelGraph.py,
src/plugins/Summary.py, src/plugins/TimeLine.py, src/plugins/Verify.py,
src/plugins/WebPage.py, src/plugins/WriteCD.py,
src/plugins/WritePkg.py, src/plugins/DetAncestralReport.py:
Use get_event_from_handle (not find_ ).
svn: r3462
2004-08-22 00:26:01 +05:30
|
|
|
event = self.db.get_event_from_handle(data[_BIRTH_COL])
|
2004-03-22 10:11:35 +05:30
|
|
|
if event:
|
2004-07-28 07:59:07 +05:30
|
|
|
place_handle = event.get_place_handle()
|
|
|
|
if place_handle:
|
2004-08-07 10:46:57 +05:30
|
|
|
return self.db.get_place_from_handle(place_handle).get_title()
|
2004-03-10 10:45:06 +05:30
|
|
|
return u""
|
|
|
|
|
|
|
|
def column_death_place(self,data):
|
2004-06-27 08:40:06 +05:30
|
|
|
if data[_DEATH_COL]:
|
* src/AddSpouse.py, src/ChooseParents.py, src/EditPerson.py,
src/EditPlace.py, src/EditSource.py, src/EventEdit.py,
src/FamilyView.py, src/GenericFilter.py,
src/Marriage.py, src/PedView.py, src/PeopleModel.py,
src/PlaceView.py, src/RelLib.py, src/SelectChild.py,
src/Sort.py, src/SourceView.py, src/SubstKeywords.py,
src/WriteGedcom.py, src/WriteXML.py, src/plugins/AncestorReport.py,
src/plugins/Ancestors.py, src/plugins/ChangeTypes.py,
src/plugins/DescendReport.py, src/plugins/DetDescendantReport.py,
src/plugins/EventCmp.py, src/plugins/FamilyGroup.py,
src/plugins/FanChart.py, src/plugins/FtmStyleAncestors.py,
src/plugins/FtmStyleDescendants.py, src/plugins/GraphViz.py,
src/plugins/IndivComplete.py, src/plugins/IndivSummary.py,
src/plugins/Merge.py, src/plugins/RelCalc.py, src/plugins/RelGraph.py,
src/plugins/Summary.py, src/plugins/TimeLine.py, src/plugins/Verify.py,
src/plugins/WebPage.py, src/plugins/WriteCD.py,
src/plugins/WritePkg.py, src/plugins/DetAncestralReport.py:
Use get_event_from_handle (not find_ ).
svn: r3462
2004-08-22 00:26:01 +05:30
|
|
|
event = self.db.get_event_from_handle(data[_DEATH_COL])
|
2004-03-22 10:11:35 +05:30
|
|
|
if event:
|
2004-07-28 07:59:07 +05:30
|
|
|
place_handle = event.get_place_handle()
|
|
|
|
if place_handle:
|
2004-08-07 10:46:57 +05:30
|
|
|
return self.db.get_place_from_handle(place_handle).get_title()
|
2004-03-10 10:45:06 +05:30
|
|
|
return u""
|
|
|
|
|
2004-08-20 07:50:06 +05:30
|
|
|
# def add_person(self,person):
|
|
|
|
# pid = person.get_handle()
|
|
|
|
# need = 0
|
|
|
|
# surname = person.get_primary_name().get_surname()
|
|
|
|
# if self.sname_sub.has_key(surname):
|
|
|
|
# self.sname_sub[surname].append(pid)
|
|
|
|
# else:
|
|
|
|
# self.sname_sub[surname] = [pid]
|
|
|
|
|
|
|
|
# inscol = 0
|
|
|
|
# sval = 0
|
|
|
|
# name_list = self.db.get_surname_list()
|
|
|
|
# for name in name_list:
|
|
|
|
# if self.sname_sub.has_key(name):
|
|
|
|
# self.top_path2iter[sval] = name
|
|
|
|
# if name == surname:
|
|
|
|
# inscol = (sval,)
|
|
|
|
# need = 1
|
|
|
|
# sval += 1
|
|
|
|
|
|
|
|
# column = 0
|
|
|
|
# val = 0
|
|
|
|
# entries = self.sname_sub[surname]
|
|
|
|
# entries.sort(self.byname)
|
|
|
|
# for person_handle in entries:
|
|
|
|
# tpl = (surname,val)
|
|
|
|
# self.iter2path[person_handle] = tpl
|
|
|
|
# self.path2iter[tpl] = person_handle
|
|
|
|
# if person_handle == pid:
|
|
|
|
# column = val
|
|
|
|
# val += 1
|
|
|
|
|
|
|
|
# col = self.top_path2iter.index(surname)
|
|
|
|
# mypath = (col[0],column)
|
|
|
|
# if need:
|
|
|
|
# self.row_inserted(inscol,self.get_iter(inscol))
|
|
|
|
# self.row_inserted(mypath,self.get_iter(mypath))
|
|
|
|
|
|
|
|
# def on_row_inserted(self,model,path,iter):
|
|
|
|
# pass
|
|
|
|
|
|
|
|
# def on_row_deleted(self,model,path):
|
|
|
|
# surname = self.top_path2iter[path[0]]
|
|
|
|
# pid = self.path2iter[(surname,path[1])]
|
|
|
|
|
|
|
|
# for idval in self.sname_sub[surname]:
|
|
|
|
# key = self.iter2path[idval]
|
|
|
|
# del self.iter2path[idval]
|
|
|
|
# del self.path2iter[key]
|
|
|
|
# self.sname_sub[surname].remove(pid)
|
|
|
|
|
|
|
|
# val = 0
|
|
|
|
# entries = self.sname_sub[surname]
|
|
|
|
# entries.sort(self.byname)
|
|
|
|
# for person_handle in entries:
|
|
|
|
# tpl = (surname,val)
|
|
|
|
# self.iter2path[person_handle] = tpl
|
|
|
|
# self.path2iter[tpl] = person_handle
|
|
|
|
# val += 1
|
|
|
|
# return 0
|
|
|
|
|
2004-04-28 09:36:25 +05:30
|
|
|
_GENDER = [ _(u'female'), _(u'male'), _(u'unknown') ]
|