* various: transactions are now required for commits

svn: r3186
This commit is contained in:
Don Allingham 2004-05-24 04:32:19 +00:00
parent 109fe90e97
commit 2439564ba2
38 changed files with 279 additions and 200 deletions

View File

@ -1,3 +1,6 @@
2004-05-23 Don Allingham <dallingham@users.sourceforge.net>
* various: transactions are now required for commits
2004-05-19 Don Allingham <dallingham@users.sourceforge.net>
* src/plugins/ReadGedcom.py: full support for undo
* src/ImageSelect.py: undo messages

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -41,14 +41,14 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/gramps-mdk.spec.in \
$(srcdir)/gramps.sh.in $(srcdir)/gramps.spec.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
TODO install-sh missing py-compile
TODO install-sh missing mkinstalldirs py-compile
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = gramps.spec gramps-mdk.spec gramps.sh
am__installdirs = "$(DESTDIR)$(bindir)"
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
@ -292,10 +292,12 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
@ -309,9 +311,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -z "$$unique" && unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@ -420,7 +424,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac

5
gramps2/aclocal.m4 vendored
View File

@ -1,4 +1,4 @@
# generated automatically by aclocal 1.8.3 -*- Autoconf -*-
# generated automatically by aclocal 1.8.4 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
@ -98,7 +98,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"])
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.8.3])])
[AM_AUTOMAKE_VERSION([1.8.4])])
# AM_AUX_DIR_EXPAND
@ -571,6 +571,7 @@ python2.1 python2.0 python1.6 python1.5])
AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
[AC_MSG_RESULT(yes)],
[AC_MSG_ERROR(too old)])
am_display_PYTHON=$PYTHON
else
# Otherwise, try each interpreter until we find one that satisfies
# VERSION.

1
gramps2/configure vendored
View File

@ -1832,6 +1832,7 @@ echo "$as_me: error: too old" >&2;}
{ (exit 1); exit 1; }; }
fi
am_display_PYTHON=$PYTHON
else
# Otherwise, try each interpreter until we find one that satisfies
# VERSION.

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -41,7 +41,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
@ -293,10 +293,12 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
@ -310,9 +312,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -z "$$unique" && unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -102,7 +102,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -41,7 +41,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
@ -240,10 +240,12 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
@ -257,9 +259,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -z "$$unique" && unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -102,7 +102,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -102,7 +102,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -39,7 +39,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
@ -238,10 +238,12 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
@ -255,9 +257,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -z "$$unique" && unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -39,7 +39,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =

View File

@ -1,5 +1,5 @@
%define ver 1.1.0
%define rel 0.CVS20040516
%define rel 0.CVS20040519
%define prefix /usr
%define localstatedir /var/lib
# Ensure that internal RPM macros for configure & makeinstall

View File

@ -1,5 +1,5 @@
%define ver 1.1.0
%define rel 0.CVS20040516
%define rel 0.CVS20040519
%define prefix /usr
%define localstatedir /var/lib
# Ensure that internal RPM macros for configure & makeinstall

View File

@ -98,7 +98,7 @@ class DbPrompter:
gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN,
gtk.RESPONSE_OK))
choose.set_local_only(gtk.FALSE)
filter = gtk.FileFilter()
filter.set_name(_('GRAMPS databases'))
filter.add_pattern('*.grdb')

View File

@ -102,6 +102,7 @@ class DisplayTrace:
self.top.set_title("%s - GRAMPS" % _('Internal Error'))
window.get_buffer().set_text(msg.getvalue())
print msg.getvalue()
self.glade.signal_autoconnect({'on_close_clicked':self.close})
def close(self,obj):

View File

@ -475,7 +475,7 @@ class EditPerson:
build_dropdown(place,self.place_list)
if ord and ord.get_place_id():
ord_place = self.db.find_place_from_id(ord.get_place_id())
ord_place = self.db.find_place_from_id(ord.get_place_id(),None)
place.set_text(ord_place.get_title())
return stat
@ -1659,7 +1659,7 @@ class EditPerson:
if media_list:
ph = media_list[0]
object_id = ph.get_reference_id()
object = self.db.find_object_from_id(object_id)
object = self.db.find_object_from_id(object_id,None)
if self.load_obj != object.get_path():
if object.get_mime_type()[0:5] == "image":
self.load_photo(object.get_path())
@ -1811,7 +1811,7 @@ def short(val,size=60):
def place_title(db,event):
pid = event.get_place_id()
if pid:
return db.find_place_from_id(pid).get_title()
return db.find_place_from_id(pid,None).get_title()
else:
return u''

View File

@ -218,7 +218,7 @@ class EditSource:
if sref.get_base_id() == self.source.get_id():
p_addr_list.append((name,v.get_street()))
for object_id in self.db.get_object_keys():
object = self.db.find_object_from_id(object_id)
object = self.db.find_object_from_id(object_id,None)
name = object.get_description()
for sref in object.get_source_references():
if sref.get_base_id() == self.source.get_id():
@ -228,9 +228,9 @@ class EditSource:
f_id = family.get_father_id()
m_id = family.get_mother_id()
if f_id:
f = self.db.find_person_from_id(f_id)
f = self.db.find_person_from_id(f_id,None)
if m_id:
m = self.db.find_person_from_id(m_id)
m = self.db.find_person_from_id(m_id,None)
if f_id and m_id:
name = _("%(father)s and %(mother)s") % {
"father" : GrampsCfg.nameof(f),
@ -404,7 +404,7 @@ class DelSrcQuery:
self.db.commit_family(p,trans)
for p_id in self.db.get_object_keys():
p = self.db.find_object_from_id(p_id)
p = self.db.find_object_from_id(p_id,trans)
if self.delete_source(p):
self.db.commit_media_object(p,trans)

View File

@ -505,8 +505,7 @@ class FamilyView:
else:
row = model.get_path(iter)
id = self.person.get_family_id_list()[row[0]]
fam = self.parent.db.find_family_from_id(id)
self.display_marriage(fam)
def build_spouse_menu(self,event):
@ -838,7 +837,7 @@ class FamilyView:
person_id = family.get_father_id()
else:
person_id = family.get_mother_id()
person = self.parent.db.find_person_from_id(person_id)
person = self.parent.db.find_person_from_id(person_id,None)
self.parent.change_active_person(person)
n = person.get_primary_name().get_name()
@ -858,7 +857,7 @@ class FamilyView:
if self.parent.active_person:
id = self.parent.active_person.get_id()
self.person = self.parent.db.find_person_from_id(id)
self.person = self.parent.db.find_person_from_id(id,None)
else:
self.person = None
self.clear()
@ -899,7 +898,7 @@ class FamilyView:
for f in splist:
if not f:
continue
fm = self.parent.db.find_family_no_map(f)
fm = self.parent.db.find_family_no_map(f,None)
if fm.get_father_id() == self.person.get_id():
sp_id = fm.get_mother_id()
@ -910,7 +909,7 @@ class FamilyView:
flist[f] = iter
if sp_id:
sp = self.parent.db.find_person_from_id(sp_id)
sp = self.parent.db.find_person_from_id(sp_id,None)
event = self.find_marriage(fm)
if event:
mdate = " - %s" % event.get_date()
@ -956,8 +955,8 @@ class FamilyView:
fam = self.parent.db.find_family_from_id(f)
father_id = fam.get_father_id()
mother_id = fam.get_mother_id()
f = self.parent.db.find_person_from_id(father_id)
m = self.parent.db.find_person_from_id(mother_id)
f = self.parent.db.find_person_from_id(father_id,None)
m = self.parent.db.find_person_from_id(mother_id,None)
father = self.nameof(_("Father"),f,frel)
mother = self.nameof(_("Mother"),m,mrel)
@ -1002,13 +1001,13 @@ class FamilyView:
if self.family.get_father_id() == self.person.get_id():
sp_id = self.family.get_mother_id()
if sp_id:
self.selected_spouse = self.parent.db.find_person_from_id(sp_id)
self.selected_spouse = self.parent.db.find_person_from_id(sp_id,None)
else:
self.selected_spouse = None
else:
sp_id = self.family.get_father_id()
if sp_id:
self.selected_spouse = self.parent.db.find_person_from_id(sp_id)
self.selected_spouse = self.parent.db.find_person_from_id(sp_id,None)
else:
self.selected_spouse = None
@ -1025,7 +1024,7 @@ class FamilyView:
for child_id in child_list:
status = _("Unknown")
child = self.parent.db.find_person_from_id(child_id)
child = self.parent.db.find_person_from_id(child_id,None)
for fam in child.get_parent_family_id_list():
if fam[0] == self.family.get_id():
if self.person == self.family.get_father_id():
@ -1382,7 +1381,7 @@ class FamilyView:
prev_date = "00000000"
for i in range(len(list)):
child_id = list[i]
child = self.parent.db.find_person_from_id(child_id)
child = self.parent.db.find_person_from_id(child_id,None)
birth_id = child.get_birth_id()
birth = self.parent.db.find_event_from_id(birth_id)
if not birth:

View File

@ -166,12 +166,17 @@ class ImageSelect:
return
already_imported = None
trans = self.db.start_transactions()
for o_id in self.db.get_object_keys():
o = self.db.find_object_from_id(o_id)
o = self.db.find_object_from_id(o_id,trans)
if o.get_path() == filename:
already_imported = o
break
# fix referenes here
# dna
if (already_imported):
oref = RelLib.MediaRef()
oref.set_reference_id(already_imported.get_id())
@ -186,7 +191,9 @@ class ImageSelect:
mobj.set_mime_type(type)
self.savephoto(mobj)
mobj.set_path(filename)
self.db.commit_media_object(mobj)
self.db.commit_media_object(mobj,trans)
self.db.add_transaction(trans,'Edit Media Objects')
self.parent.lists_changed = 1
self.load_images()
@ -269,7 +276,7 @@ class Gallery(ImageSelect):
def on_drag_begin(self,obj,context):
if const.dnd_images:
id = self.sel_obj.get_reference_id()
obj = self.db.find_object_from_id(id)
obj = self.db.find_object_from_id(id,None)
mtype = obj.get_mime_type()
name = Utils.thumb_path(self.db.get_save_path(),obj)
pix = gtk.gdk.pixbuf_new_from_file(name)
@ -363,7 +370,7 @@ class Gallery(ImageSelect):
def add_thumbnail(self, photo):
"""Scale the image and add it to the IconList."""
oid = photo.get_reference_id()
object = self.db.find_object_from_id(oid)
object = self.db.find_object_from_id(oid,None)
if self.canvas_list.has_key(oid):
(grp,item,text,x,y) = self.canvas_list[oid]
if x != self.cx or y != self.cy:
@ -596,7 +603,7 @@ class Gallery(ImageSelect):
menu = gtk.Menu()
menu.set_title(_("Media Object"))
object = self.db.find_object_from_id(photo.get_reference_id())
object = self.db.find_object_from_id(photo.get_reference_id(),None)
mtype = object.get_mime_type()
progname = GrampsMime.get_application(mtype)
@ -613,20 +620,21 @@ class Gallery(ImageSelect):
def popup_view_photo(self, obj):
"""Open this picture in a picture viewer"""
photo = obj.get_data('o')
Utils.view_photo(self.db.find_object_from_id(photo.get_reference_id()))
Utils.view_photo(self.db.find_object_from_id(photo.get_reference_id(),
None))
def popup_edit_photo(self, obj):
"""Open this picture in a picture editor"""
photo = obj.get_data('o')
if os.fork() == 0:
obj = self.db.find_object_from_id(photo.get_reference_id())
obj = self.db.find_object_from_id(photo.get_reference_id(),None)
os.execvp(const.editor,[const.editor, obj.get_path()])
def popup_convert_to_private(self, obj):
"""Copy this picture into gramps private database instead of
leaving it as an external data object."""
photo = obj.get_data('o')
object = self.db.find_object_from_id(photo.get_reference_id())
object = self.db.find_object_from_id(photo.get_reference_id(),None)
name = RelImage.import_media_object(object.get_path(),self.path,
object.get_id())
object.set_path(name)
@ -657,7 +665,8 @@ class LocalMediaProperties:
self.child_windows = {}
self.photo = photo
self.db = parent.db
self.object = self.db.find_object_from_id(photo.get_reference_id())
self.object = self.db.find_object_from_id(photo.get_reference_id(),
None)
self.alist = photo.get_attribute_list()[:]
self.lists_changed = 0

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -42,7 +42,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = const.py
SOURCES =
DIST_SOURCES =
@ -403,10 +403,12 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
@ -420,9 +422,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -z "$$unique" && unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)

View File

@ -177,7 +177,7 @@ class MediaView:
id = store.get_value(iter,1)
mobj = self.db.find_object_from_id(id)
mobj = self.db.find_object_from_id(id,None)
type = mobj.get_mime_type()
type_name = Utils.get_mime_description(type)
path = mobj.get_path()
@ -225,7 +225,7 @@ class MediaView:
store,iter = self.selection.get_selected()
if iter:
id = store.get_value(iter,1)
object = self.db.find_object_from_id(id)
object = self.db.find_object_from_id(id,None)
self.obj = object
mime_type = object.get_mime_type()
@ -290,7 +290,7 @@ class MediaView:
list_store, iter = self.selection.get_selected()
if iter:
id = list_store.get_value(iter,1)
object = self.db.find_object_from_id(id)
object = self.db.find_object_from_id(id,None)
ImageSelect.GlobalMediaProperties(self.db,object,self.load_media)
def on_delete_clicked(self,obj):
@ -299,7 +299,7 @@ class MediaView:
return
id = store.get_value(iter,1)
mobj = self.db.find_object_from_id(id)
mobj = self.db.find_object_from_id(id,None)
if self.is_object_used(mobj):
ans = ImageSelect.DeleteMediaQuery(mobj,self.db,self.build_tree)
QuestionDialog(_('Delete Media Object?'),
@ -343,7 +343,7 @@ class MediaView:
if not iter:
return
if (const.dnd_images):
object = self.db.find_object_from_id(store.get_value(iter,1))
object = self.db.find_object_from_id(store.get_value(iter,1),None)
mtype = object.get_mime_type()
name = Utils.thumb_path(self.db.get_save_path(),object)
pix = gtk.gdk.pixbuf_new_from_file(name)

View File

@ -366,13 +366,13 @@ class PedigreeView:
childlist = find_children(self.active_person)
if len(childlist) == 1:
child = self.parent.db.find_person_from_id(childlist[0])
child = self.parent.db.find_person_from_id(childlist[0],None)
if child:
self.load_canvas(child)
elif len(childlist) > 1:
myMenu = gtk.Menu()
for child_id in childlist:
child = self.parent.db.find_person_from_id(child_id)
child = self.parent.db.find_person_from_id(child_id,None)
cname = GrampsCfg.nameof(child)
menuitem = gtk.MenuItem(None)
if find_children(child):
@ -485,11 +485,11 @@ class PedigreeView:
if family != None:
father_id = family.get_father_id()
if father_id != None:
father = self.parent.db.find_person_from_id(father_id)
father = self.parent.db.find_person_from_id(father_id,None)
self.find_tree(father,(2*index)+1,depth+1,list,frel)
mother_id = family.get_mother_id()
if mother_id != None:
mother = self.parent.db.find_person_from_id(mother_id)
mother = self.parent.db.find_person_from_id(mother_id,None)
self.find_tree(mother,(2*index)+2,depth+1,list,mrel)
def on_canvas1_event(self,obj,event):

View File

@ -88,6 +88,10 @@ class PeopleModel(gtk.GenericTreeModel):
self.rebuild_data()
self.connect('row-deleted',self.on_row_deleted)
self.connect('row-inserted',self.on_row_inserted)
def on_row_inserted(self,model,path,iter):
print "row inserted",model,path,iter
def on_row_deleted(self,model,path):
surname = self.top_path2iter[path[0]]
@ -123,7 +127,7 @@ class PeopleModel(gtk.GenericTreeModel):
for person_id in self.db.get_person_keys():
person = self.db.find_person_from_id(person_id)
person = self.db.find_person_from_id(person_id,None)
surname = unicode(person.get_primary_name().get_surname())
if self.sname_sub.has_key(surname):
@ -149,6 +153,7 @@ class PeopleModel(gtk.GenericTreeModel):
def add_person(self,person):
pid = person.get_id()
need = 0
surname = person.get_primary_name().get_surname()
if self.sname_sub.has_key(surname):
self.sname_sub[surname].append(pid)
@ -164,11 +169,10 @@ class PeopleModel(gtk.GenericTreeModel):
self.top_path2iter[sval] = name
if name == surname:
inscol = (sval,)
need = 1
sval += 1
self.row_inserted(inscol,self.get_iter(inscol))
inscol = 0
column = 0
val = 0
entries = self.sname_sub[surname]
entries.sort(self.byname)
@ -177,11 +181,13 @@ class PeopleModel(gtk.GenericTreeModel):
self.iter2path[person_id] = tpl
self.path2iter[tpl] = person_id
if person_id == pid:
inscol = val
column = val
val += 1
col = self.top_iter2path[surname]
mypath = (col[0],inscol)
mypath = (col[0],column)
if need:
self.row_inserted(inscol,self.get_iter(inscol))
self.row_inserted(mypath,self.get_iter(mypath))
def byname(self,f,s):

View File

@ -383,6 +383,7 @@ class GrampsParser:
def parse(self,file):
self.trans = self.db.start_transaction()
p = xml.parsers.expat.ParserCreate()
p.StartElementHandler = self.startElement
p.EndElementHandler = self.endElement
@ -400,6 +401,7 @@ class GrampsParser:
del self.func_map
del self.func_list
del p
self.db.add_transaction(self.trans,_("GRAMPS XML import"))
def start_lds_ord(self,attrs):
type = attrs['type']
@ -423,13 +425,15 @@ class GrampsParser:
def start_sealed_to(self,attrs):
id = attrs['ref']
self.ord.set_family_id(self.db.find_family_no_map(id))
self.ord.set_family_id(self.db.find_family_no_map(id,self.trans))
def start_place(self,attrs):
self.placeobj = self.db.find_place_no_conflicts(attrs['ref'],self.lmap)
self.placeobj = self.db.find_place_no_conflicts(attrs['ref'],
self.lmap, self.trans)
def start_placeobj(self,attrs):
self.placeobj = self.db.find_place_no_conflicts(attrs['id'],self.lmap)
self.placeobj = self.db.find_place_no_conflicts(attrs['id'],
self.lmap,self.trans)
title = attrs['title']
if title == "":
title = attrs['id']
@ -480,7 +484,7 @@ class GrampsParser:
def start_event(self,attrs):
self.event = RelLib.Event()
self.db.add_event(self.event)
self.db.add_event(self.event,self.trans)
self.event_type = const.save_event(attrs["type"])
if attrs.has_key("conf"):
self.event.conf = int(attrs["conf"])
@ -523,14 +527,16 @@ class GrampsParser:
self.address.private = int(attrs["priv"])
def start_bmark(self,attrs):
person = self.db.find_person_no_conflicts(attrs["ref"],self.pmap)
person = self.db.find_person_no_conflicts(attrs["ref"],
self.pmap,self.trans)
self.db.bookmarks.append(person.get_id())
def start_person(self,attrs):
if self.callback != None and self.count % self.increment == 0:
self.callback(float(self.count)/float(self.entries))
self.count = self.count + 1
self.person = self.db.find_person_no_conflicts(attrs["id"],self.pmap)
self.person = self.db.find_person_no_conflicts(attrs["id"],
self.pmap, self.trans)
if attrs.has_key("complete"):
self.person.set_complete(int(attrs['complete']))
else:
@ -575,7 +581,8 @@ class GrampsParser:
if self.callback != None and self.count % self.increment == 0:
self.callback(float(self.count)/float(self.entries))
self.count = self.count + 1
self.family = self.db.find_family_no_conflicts(attrs["id"],self.fmap)
self.family = self.db.find_family_no_conflicts(attrs["id"],
self.fmap,self.trans)
if attrs.has_key("type"):
self.family.set_relationship(const.save_frel(attrs["type"]))
if attrs.has_key("complete"):
@ -584,7 +591,8 @@ class GrampsParser:
self.family.set_complete(0)
def start_childof(self,attrs):
family = self.db.find_family_no_conflicts(attrs["ref"],self.fmap)
family = self.db.find_family_no_conflicts(attrs["ref"],
self.fmap,self.trans)
if attrs.has_key("mrel"):
mrel = attrs["mrel"]
else:
@ -622,7 +630,8 @@ class GrampsParser:
def start_sourceref(self,attrs):
self.source_ref = RelLib.SourceRef()
source = self.db.find_source_no_conflicts(attrs["ref"],self.smap)
source = self.db.find_source_no_conflicts(attrs["ref"],
self.smap,self.trans)
if attrs.has_key("conf"):
self.source_ref.confidence = int(attrs["conf"])
else:
@ -648,11 +657,13 @@ class GrampsParser:
self.family.add_source_reference(self.source_ref)
def start_source(self,attrs):
self.source = self.db.find_source_no_conflicts(attrs["id"],self.smap)
self.source = self.db.find_source_no_conflicts(attrs["id"],
self.smap,self.trans)
def start_objref(self,attrs):
self.objref = RelLib.MediaRef()
id = self.db.find_object_no_conflicts(attrs['ref'],self.media_file_map).get_id()
id = self.db.find_object_no_conflicts(attrs['ref'],
self.media_file_map,self.trans).get_id()
self.objref.set_reference_id(id)
if attrs.has_key('priv'):
self.objref.set_privacy(int(attrs['priv']))
@ -666,7 +677,9 @@ class GrampsParser:
self.placeobj.add_media_reference(self.objref)
def start_object(self,attrs):
self.object = self.db.find_object_no_conflicts(attrs['id'],self.media_file_map)
self.object = self.db.find_object_no_conflicts(attrs['id'],
self.media_file_map,
self.trans)
self.object.set_mime_type(attrs['mime'])
self.object.set_description(attrs['description'])
src = attrs["src"]
@ -680,7 +693,7 @@ class GrampsParser:
pass
def stop_object(self,*tag):
self.db.commit_media_object(self.object)
self.db.commit_media_object(self.object,self.trans)
self.object = None
def stop_objref(self,*tag):
@ -826,11 +839,11 @@ class GrampsParser:
if self.placeobj.get_title() == "":
loc = self.placeobj.get_main_location()
self.placeobj.set_title(build_place_title(loc))
self.db.commit_place(self.placeobj)
self.db.commit_place(self.placeobj,self.trans)
self.placeobj = None
def stop_family(self,*tag):
self.db.commit_family(self.family)
self.db.commit_family(self.family,self.trans)
self.family = None
def stop_event(self,*tag):
@ -845,7 +858,7 @@ class GrampsParser:
self.person.set_death_id(self.event.get_id())
else:
self.person.add_event_id(self.event.get_id())
self.db.commit_event(self.event)
self.db.commit_event(self.event,self.trans)
self.event = None
def stop_name(self,tag):
@ -872,7 +885,7 @@ class GrampsParser:
self.ord.set_place_id(self.placeobj.get_id())
else:
self.event.set_place_id(self.placeobj.get_id())
self.db.commit_place(self.placeobj)
self.db.commit_place(self.placeobj,self.trans)
self.placeobj = None
def stop_date(self,tag):
@ -889,7 +902,7 @@ class GrampsParser:
self.family = None
def stop_person(self,*tag):
self.db.commit_person(self.person)
self.db.commit_person(self.person,self.trans)
self.person = None
def stop_description(self,tag):
@ -914,7 +927,7 @@ class GrampsParser:
self.source_ref = None
def stop_source(self,*tag):
self.db.commit_source(self.source)
self.db.commit_source(self.source,self.trans)
self.source = None
def stop_sauthor(self,tag):

View File

@ -336,8 +336,12 @@ class Place(SourceNote):
self.alt_loc, self.urls, self.media_list, self.source_list, self.note)
def unserialize(self,data):
(self.id, self.title, self.long, self.lat, self.main_loc,
self.alt_loc, self.urls, self.media_list, self.source_list, self.note) = data
try:
(self.id, self.title, self.long, self.lat, self.main_loc,
self.alt_loc, self.urls, self.media_list, self.source_list,
self.note) = data
except:
print data
def get_url_list(self):
"""Return the list of URLs"""
@ -2565,42 +2569,42 @@ class GrampsDB:
data[5],
GrampsCfg.display_surname(data[2])]
def commit_person(self,person,transaction=None):
def commit_person(self,person,transaction):
gid = str(person.get_id())
if transaction != None:
old_data = self.person_map.get(gid)
transaction.add(PERSON_KEY,gid,old_data)
self.person_map.put(gid,person.serialize())
def commit_media_object(self,object,transaction=None):
def commit_media_object(self,object,transaction):
gid = str(object.get_id())
if transaction != None:
old_data = self.media_map.get(gid)
transaction.add(MEDIA_KEY,gid,old_data)
self.media_map.put(str(object.get_id()),object.serialize())
def commit_source(self,source,transaction=None):
def commit_source(self,source,transaction):
gid = str(source.get_id())
if transaction != None:
old_data = self.source_map.get(gid)
transaction.add(SOURCE_KEY,gid,old_data)
self.source_map.put(str(source.get_id()),source.serialize())
def commit_place(self,place,transaction=None):
def commit_place(self,place,transaction):
gid = str(place.get_id())
if transaction != None:
old_data = self.place_map.get(gid)
transaction.add(PLACE_KEY,gid,old_data)
self.place_map.put(str(place.get_id()),place.serialize())
def commit_event(self,event,transaction=None):
def commit_event(self,event,transaction):
gid = str(event.get_id())
if transaction != None:
old_data = self.event_map.get(gid)
transaction.add(EVENT_KEY,gid,old_data)
self.event_map.put(str(event.get_id()),event.serialize())
def commit_family(self,family,transaction=None):
def commit_family(self,family,transaction):
gid = str(family.get_id())
if transaction != None:
old_data = self.family_map.get(gid)
@ -2889,33 +2893,33 @@ class GrampsDB:
# map[family.get_relationship()] = 1
return map.keys()
def remove_person_id(self,gid,transaction=None):
def remove_person_id(self,gid,transaction):
# self.genderStats.uncount_person (self.person_map[gid])
if transaction != None:
old_data = self.person_map.get(str(gid))
transaction.add(PERSON_KEY,gid,old_data)
self.person_map.delete(str(gid))
def remove_source_id(self,gid,transaction=None):
def remove_source_id(self,gid,transaction):
if transaction != None:
old_data = self.source_map.get(str(gid))
transaction.add(SOURCE_KEY,gid,old_data)
self.source_map.delete(str(gid))
def remove_event_id(self,gid,transaction=None):
def remove_event_id(self,gid,transaction):
if transaction != None:
old_data = self.event_map.get(str(gid))
transaction.add(EVENT_KEY,gid,old_data)
self.event_map.delete(str(gid))
def add_person_as(self,person,trans=None):
def add_person_as(self,person,trans):
if trans != None:
trans.add(PERSON_KEY, person.get_id(),None)
self.person_map.put(str(person.get_id()),person.serialize())
# self.genderStats.count_person (person, self)
return person.get_id()
def add_person(self,person,trans=None):
def add_person(self,person,trans):
"""adds a Person to the database, assigning a gramps' ID"""
index = self.iprefix % self.pmap_index
while self.person_map.get(str(index)):
@ -2929,7 +2933,7 @@ class GrampsDB:
self.genderStats.count_person (person, self)
return index
def find_person(self,gid,map,trans=None):
def find_person(self,gid,map,trans):
"""finds a Person in the database using the gid and map
variables to translate between the external ID and gramps'
internal ID. If no such Person exists, a new Person instance
@ -2954,7 +2958,7 @@ class GrampsDB:
def has_family_id(self,val):
return self.family_map.get(str(val))
def try_to_find_person_from_id(self,val,trans=None):
def try_to_find_person_from_id(self,val,trans):
"""finds a Person in the database from the passed gramps' ID.
If no such Person exists, a new Person is added to the database."""
@ -2967,7 +2971,7 @@ class GrampsDB:
else:
return None
def find_person_from_id(self,val,trans=None):
def find_person_from_id(self,val,trans):
"""finds a Person in the database from the passed gramps' ID.
If no such Person exists, a new Person is added to the database."""
@ -2985,7 +2989,7 @@ class GrampsDB:
# self.genderStats.count_person (person, self)
return person
def add_person_no_map(self,person,gid,trans=None):
def add_person_no_map(self,person,gid,trans):
"""adds a Person to the database if the gramps' ID is known"""
gid = str(gid)
@ -2997,7 +3001,7 @@ class GrampsDB:
# self.genderStats.count_person (person, self)
return gid
def add_source(self,source,trans=None):
def add_source(self,source,trans):
"""adds a Source instance to the database, assigning it a gramps'
ID number"""
@ -3012,7 +3016,7 @@ class GrampsDB:
self.smap_index = self.smap_index + 1
return index
def add_event(self,event,trans=None):
def add_event(self,event,trans):
"""adds a Event instance to the database, assigning it a gramps'
ID number"""
index = self.eprefix % self.emap_index
@ -3026,7 +3030,7 @@ class GrampsDB:
self.emap_index += 1
return index
def add_source_no_map(self,source,index,trans=None):
def add_source_no_map(self,source,index,trans):
"""adds a Source to the database if the gramps' ID is known"""
source.set_id(index)
if trans != None:
@ -3035,7 +3039,7 @@ class GrampsDB:
self.smap_index = self.smap_index + 1
return index
def add_event_no_map(self,event,index,trans=None):
def add_event_no_map(self,event,index,trans):
"""adds a Source to the database if the gramps' ID is known"""
return
event.set_id(index)
@ -3045,7 +3049,7 @@ class GrampsDB:
self.emap_index += 1
return index
def find_source(self,gid,map,trans=None):
def find_source(self,gid,map,trans):
"""finds a Source in the database using the gid and map
variables to translate between the external ID and gramps'
internal ID. If no such Source exists, a new Source instance
@ -3063,7 +3067,7 @@ class GrampsDB:
map[gid] = self.add_source(source,trans)
return source
def find_event(self,gid,map,trans=None):
def find_event(self,gid,map,trans):
"""finds a Event in the database using the gid and map
variables to translate between the external ID and gramps'
internal ID. If no such Event exists, a new Event instance
@ -3080,7 +3084,7 @@ class GrampsDB:
map[gid] = self.add_event(event,trans)
return event
def find_source_from_id(self,val,trans=None):
def find_source_from_id(self,val,trans):
"""finds a Source in the database from the passed gramps' ID.
If no such Source exists, a new Source is added to the database."""
@ -3102,7 +3106,7 @@ class GrampsDB:
else:
return None
def add_object(self,object,trans=None):
def add_object(self,object,trans):
"""adds an Object instance to the database, assigning it a gramps'
ID number"""
@ -3119,7 +3123,7 @@ class GrampsDB:
return index
def find_object(self,gid,map,trans=None):
def find_object(self,gid,map,trans):
"""finds an Object in the database using the gid and map
variables to translate between the external ID and gramps'
internal ID. If no such Object exists, a new Object instance
@ -3137,7 +3141,7 @@ class GrampsDB:
map[gid] = self.add_object(object,trans)
return object
def find_object_no_conflicts(self,gid,map,trans=None):
def find_object_no_conflicts(self,gid,map,trans):
"""finds an Object in the database using the gid and map
variables to translate between the external ID and gramps'
internal ID. If no such Object exists, a new Object instance
@ -3157,7 +3161,7 @@ class GrampsDB:
map[gid] = self.add_object_no_map(object,gid,trans)
return object
def add_object_no_map(self,object,index,trans=None):
def add_object_no_map(self,object,index,trans):
"""adds an Object to the database if the gramps' ID is known"""
index = str(index)
object.set_id(index)
@ -3168,7 +3172,7 @@ class GrampsDB:
self.added_files.append(object)
return index
def find_object_from_id(self,gid,trans=None):
def find_object_from_id(self,gid,trans):
"""finds an Object in the database from the passed gramps' ID.
If no such Source exists, a new Source is added to the database."""
@ -3185,7 +3189,7 @@ class GrampsDB:
return self.media_map.get(str(gid)) != None
def add_place(self,place,trans=None):
def add_place(self,place,trans):
"""adds a Place instance to the database, assigning it a gramps'
ID number"""
@ -3200,25 +3204,25 @@ class GrampsDB:
self.lmap_index = self.lmap_index + 1
return index
def remove_object(self,gid,transaction=None):
def remove_object(self,gid,transaction):
if transaction != None:
old_data = self.media_map.get(str(gid))
transaction.add(MEDIA_KEY,gid,old_data)
self.media_map.delete(str(gid))
def remove_place(self,gid,transaction=None):
def remove_place(self,gid,transaction):
if transaction != None:
old_data = self.place_map.get(str(gid))
transaction.add(PLACE_KEY,gid,old_data)
self.place_map.delete(str(gid))
def add_place_as(self,place,trans=None):
def add_place_as(self,place,trans):
if trans != None:
trans.add(PLACE_KEY,place.get_id(),None)
self.place_map.put(str(place.get_id()),place.serialize())
return place.get_id()
def find_place_no_conflicts(self,gid,map,trans=None):
def find_place_no_conflicts(self,gid,map,trans):
"""finds a Place in the database using the gid and map
variables to translate between the external ID and gramps'
internal ID. If no such Place exists, a new Place instance
@ -3241,7 +3245,7 @@ class GrampsDB:
self.place_map.put(str(gid),place.serialize())
return place
def add_place_no_map(self,place,index,trans=None):
def add_place_no_map(self,place,index,trans):
"""adds a Place to the database if the gramps' ID is known"""
index = str(index)
@ -3252,7 +3256,7 @@ class GrampsDB:
self.lmap_index = self.lmap_index + 1
return index
def find_place_from_id(self,gid,trans=None):
def find_place_from_id(self,gid,trans):
"""finds a Place in the database from the passed gramps' ID.
If no such Place exists, a new Place is added to the database."""
@ -3358,7 +3362,7 @@ class GrampsDB:
def build_source_display(self,nkey,okey=None):
pass
def new_family(self,trans=None):
def new_family(self,trans):
"""adds a Family to the database, assigning a gramps' ID"""
index = self.fprefix % self.fmap_index
@ -3373,7 +3377,7 @@ class GrampsDB:
self.family_map.put(str(index),family.serialize())
return family
def new_family_no_map(self,gid,trans=None):
def new_family_no_map(self,gid,trans):
"""finds a Family in the database from the passed gramps' ID.
If no such Family exists, a new Family is added to the database."""
@ -3385,7 +3389,7 @@ class GrampsDB:
self.fmap_index = self.fmap_index + 1
return family
def find_family_with_map(self,gid,map,trans=None):
def find_family_with_map(self,gid,map,trans):
"""finds a Family in the database using the gid and map
variables to translate between the external ID and gramps'
internal ID. If no such Family exists, a new Family instance
@ -3399,11 +3403,11 @@ class GrampsDB:
data = self.family_map.get(str(map[gid]))
family.unserialize(data)
else:
family = self.new_family()
family = self.new_family(trans)
map[gid] = family.get_id()
return family
def find_family_no_map(self,val,trans=None):
def find_family_no_map(self,val,trans):
"""finds a Family in the database from the passed gramps' ID.
If no such Family exists, a new Family is added to the database."""
@ -3430,7 +3434,7 @@ class GrampsDB:
else:
return None
def delete_family(self,family_id,trans=None):
def delete_family(self,family_id,trans):
"""deletes the Family instance from the database"""
if self.family_map.get(str(family_id)):
if trans != None:
@ -3438,7 +3442,7 @@ class GrampsDB:
trans.add(FAMILY_KEY,family_id,old_data)
self.family_map.delete(str(family_id))
def find_person_no_conflicts(self,gid,map,trans=None):
def find_person_no_conflicts(self,gid,map,trans):
"""finds a Person in the database using the gid and map
variables to translate between the external ID and gramps'
internal ID. If no such Person exists, a new Person instance
@ -3458,7 +3462,7 @@ class GrampsDB:
map[gid] = self.add_person_as(person,trans)
return person
def find_family_no_conflicts(self,gid,map,trans=None):
def find_family_no_conflicts(self,gid,map,trans):
"""finds a Family in the database using the gid and map
variables to translate between the external ID and gramps'
internal ID. If no such Family exists, a new Family instance
@ -3478,7 +3482,7 @@ class GrampsDB:
map[gid] = family.get_id()
return family
def find_source_no_conflicts(self,gid,map,trans=None):
def find_source_no_conflicts(self,gid,map,trans):
"""finds a Source in the database using the gid and map
variables to translate between the external ID and gramps'
internal ID. If no such Source exists, a new Source instance

View File

@ -98,7 +98,7 @@ class SelectObject:
self.object_model.new_model()
for key in self.db.get_object_keys():
object = self.db.find_object_from_id(key)
object = self.db.find_object_from_id(key,None)
title = object.get_description()
the_id = object.get_id()
the_type = Utils.get_mime_description(object.get_mime_type())
@ -115,7 +115,7 @@ class SelectObject:
return
data = self.object_model.get_data(iter,range(self.ncols))
the_id = data[4]
object = self.db.find_object_from_id(the_id)
object = self.db.find_object_from_id(the_id,None)
the_type = Utils.get_mime_description(object.get_mime_type())
path = object.get_path()
@ -148,7 +148,7 @@ class SelectObject:
if iter:
data = self.object_model.get_data(iter,range(self.ncols))
the_id = data[4]
return_value = self.db.find_object_from_id(the_id)
return_value = self.db.find_object_from_id(the_id,None)
else:
return_value = None
self.top.destroy()

View File

@ -123,8 +123,8 @@ def family_name(family,db):
"""Builds a name for the family from the parents names"""
father_id = family.get_father_id()
mother_id = family.get_mother_id()
father = db.find_person_from_id(father_id)
mother = db.find_person_from_id(mother_id)
father = db.find_person_from_id(father_id,None)
mother = db.find_person_from_id(mother_id,None)
if father and mother:
fname = father.get_primary_name().get_name()
mname = mother.get_primary_name().get_name()
@ -139,8 +139,8 @@ def family_upper_name(family,db):
"""Builds a name for the family from the parents names"""
father_id = family.get_father_id()
mother_id = family.get_mother_id()
father = db.find_person_from_id(father_id)
mother = db.find_person_from_id(mother_id)
father = db.find_person_from_id(father_id,None)
mother = db.find_person_from_id(mother_id,None)
if father and mother:
fname = father.get_primary_name().get_upper_name()
mname = mother.get_primary_name().get_upper_name()

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -43,7 +43,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -39,7 +39,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
@ -263,10 +263,12 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
@ -280,9 +282,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -z "$$unique" && unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -39,7 +39,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -44,7 +44,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =

View File

@ -1,4 +1,3 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2004 Donald N. Allingham
@ -357,7 +356,7 @@ class Gramps:
def undo(self,*args):
self.db.undo()
if self.active_person:
p = self.db.try_to_find_person_from_id(self.active_person.get_id())
p = self.db.try_to_find_person_from_id(self.active_person.get_id(),None)
self.change_active_person(p)
self.place_view.change_db(self.db)
self.people_view.change_db(self.db)
@ -882,11 +881,19 @@ class Gramps:
def on_contents_activate(self,obj):
"""Display the GRAMPS manual"""
gnome.help_display('gramps-manual','index')
try:
gnome.help_display('gramps-manual','index')
except gobject.GError, msg:
ErrorDialog(_("Could not open help"),
str(msg))
def on_faq_activate(self,obj):
"""Display FAQ"""
gnome.help_display('gramps-manual','faq')
try:
gnome.help_display('gramps-manual','faq')
except gobject.GError, msg:
ErrorDialog(_("Could not open help"),
str(msg))
def on_new_clicked(self,obj):
"""Prompt for permission to close the current database"""
@ -948,6 +955,10 @@ class Gramps:
self.change_active_person(self.find_initial_person())
else:
self.goto_active_person()
self.place_view.change_db(self.db)
self.source_view.change_db(self.db)
self.media_view.change_db(self.db)
def full_update(self):
"""Brute force display update, updating all the pages"""
@ -988,7 +999,11 @@ class Gramps:
def on_help_dbopen_clicked(self,obj):
"""Display the relevant portion of GRAMPS manual"""
gnome.help_display('gramps-manual','open-db')
try:
gnome.help_display('gramps-manual','open-db')
except gobject.GError, msg:
ErrorDialog(_("Could not open help"),
str(msg))
self.dbopen_button = self.dbopen_fs.run()
def auto_save_load(self,filename):
@ -1076,7 +1091,7 @@ class Gramps:
#-------------------------------------------------------------------------
def remove_clicked():
# File is lost => remove all references and the object itself
mobj = self.db.find_object_from_id(ObjectId)
mobj = self.db.find_object_from_id(ObjectId,trans)
for p in self.db.get_family_id_map().values():
nl = p.get_media_list()
for o in nl:
@ -1132,13 +1147,13 @@ class Gramps:
name = choose.get_filename()
if os.path.isfile(name):
RelImage.import_media_object(name,filename,base)
object = self.db.find_object_from_id(ObjectId)
object = self.db.find_object_from_id(ObjectId,trans)
object.set_path(name)
choose.destroy()
#-------------------------------------------------------------------------
for ObjectId in self.db.get_object_keys():
object = self.db.find_object_from_id(ObjectId)
object = self.db.find_object_from_id(ObjectId,trans)
if 0:
oldfile = object.get_path()
(base,ext) = os.path.splitext(os.path.basename(oldfile))
@ -1261,6 +1276,8 @@ class Gramps:
def delete_person_response(self):
trans = self.db.start_transaction()
n = self.active_person.get_primary_name().get_regular_name()
if self.db.get_default_person() == self.active_person:
self.db.set_default_person(None)
@ -1271,7 +1288,7 @@ class Gramps:
if self.active_person.get_id() == family.get_father_id():
if family.get_mother_id() == None:
for child_id in family.get_child_id_list():
child = self.db.find_person_from_id(child_id)
child = self.db.find_person_from_id(child_id,trans)
child.remove_parent_family_id(family.get_id())
self.db.commit_person(child,trans)
self.db.delete_family(family.get_id(),trans)
@ -1280,7 +1297,7 @@ class Gramps:
else:
if family.get_father_id() == None:
for child_id in family.get_child_id_list():
child = self.db.find_person_from_id(child_id)
child = self.db.find_person_from_id(child_id,trans)
child.remove_parent_family_id(family)
self.db.commit_person(child,trans)
self.db.delete_family(family,trans)
@ -1300,10 +1317,9 @@ class Gramps:
self.db.remove_person_id(id, trans)
if self.hindex >= 0:
self.active_person = self.db.find_person_from_id(self.history[self.hindex])
self.active_person = self.db.find_person_from_id(self.history[self.hindex],trans)
else:
self.change_active_person(None)
n = self.active_person.get_primary_name().get_regular_name()
self.db.add_transaction(trans,_("Delete Person (%s)") % n)
self.redraw_histmenu()
@ -1326,7 +1342,8 @@ class Gramps:
self.modify_statusbar()
elif self.active_person == None or \
person.get_id() != self.active_person.get_id():
self.active_person = self.db.find_person_from_id(person.get_id())
self.active_person = self.db.find_person_from_id(person.get_id(),
None)
self.modify_statusbar()
self.set_buttons(1)
if person:
@ -1352,7 +1369,8 @@ class Gramps:
self.backbtn.set_sensitive(0)
self.back.set_sensitive(0)
else:
self.active_person = self.db.find_person_from_id(person.get_id())
self.active_person = self.db.find_person_from_id(person.get_id(),
None)
self.set_buttons(1)
def modify_statusbar(self):
@ -1656,7 +1674,7 @@ class Gramps:
def bookmark_callback(self,obj,person_id):
old_person = self.active_person
person = self.db.find_person_from_id(person_id)
person = self.db.find_person_from_id(person_id,None)
try:
self.change_active_person(person)
self.update_display(0)

View File

@ -232,8 +232,8 @@ class CheckIntegrity:
select_clicked()
def cleanup_empty_families(self,automatic):
for key in self.db.get_family_keys():
family = self.db.find_family_from_id(key)
for family_id in self.db.get_family_keys():
family = self.db.find_family_from_id(family_id)
if not family.get_father_id() and not family.get_mother_id():
self.empty_family.append(family_id)
self.delete_empty_family(family_id)

View File

@ -428,7 +428,7 @@ def dump_person(database,person_list,file,adoptionsdashed,arrowheadstyle,
else:
file.write('style=solid')
file.write('];\n')
if mother_id and person_dict.has_key(mother.get_id()):
if mother_id and person_dict.has_key(mother_id):
mid = string.replace(mother_id,'-','_')
file.write('p%s -> p%s [' % (pid, mid))
file.write('arrowhead=%s, arrowtail=%s, ' %

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -40,7 +40,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =

View File

@ -1092,7 +1092,7 @@ class GedcomParser:
self.backup()
break
elif matches[1] == "TEMP":
value = extract_temple(matches[2])
value = extract_temple(matches)
if value:
ord.setTemple(value)
elif matches[1] == "DATE":
@ -1730,14 +1730,14 @@ class GedcomParser:
# new ID is not used
if not self.db.has_person_id(new_key):
self.db.remove_person_id(pid)
self.db.remove_person_id(pid,self.trans)
person.set_id(new_key)
self.db.add_person(person,self.trans)
else:
tp = self.db.find_person_from_id(new_key,self.trans)
# same person, just change it
if person == tp:
self.db.remove_person_id(pid)
self.db.remove_person_id(pid,self.trans)
person.set_id(new_key)
self.db.add_person_as(person,self.trans)
# give up trying to use the refn as a key
@ -1746,12 +1746,12 @@ class GedcomParser:
self.db.pmap_index = new_pmax
def extract_temple(text):
def extract_temple(matches):
try:
if const.lds_temple_to_abrev.has_key(matches[2]):
return const.lds_temple_to_abrev[matches[2]]
else:
values = split(matches[2])
values = matches[2].split()
return const.lds_temple_to_abrev[values[0]]
except:
return None
@ -1764,7 +1764,7 @@ def extract_temple(text):
def readData(database,active_person,cb):
global db
global callback
global file_top
global file_topa
db = database
callback = cb

View File

@ -852,7 +852,7 @@ class WebReport(Report.Report):
doc.write_text(_("Section %s") % n)
doc.end_paragraph()
n_rows = len(p_list)/self.n_cols
n_rows = len(p_id_list)/self.n_cols
td_width = 100/self.n_cols
doc.write_raw('<table width="100%" border="0">')

View File

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.8.3 from Makefile.am.
# Makefile.in generated by automake 1.8.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -39,7 +39,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =