First DB pass
svn: r2884
This commit is contained in:
@@ -305,7 +305,7 @@ class ComprehensiveAncestorsReport (Report.Report):
|
||||
person = self.database.find_person_from_id(person_id)
|
||||
name = self.person_name (person_id)
|
||||
if name:
|
||||
photos = person.get_photo_list ()
|
||||
photos = person.get_media_list ()
|
||||
|
||||
bits = ''
|
||||
bits += self.short_occupation (person)
|
||||
@@ -342,9 +342,9 @@ class ComprehensiveAncestorsReport (Report.Report):
|
||||
if (suppress_children or
|
||||
(partner != from_family_father and
|
||||
partner != from_family_mother)):
|
||||
for photo in partner.get_photo_list ()[:1]:
|
||||
for photo in partner.get_media_list ()[:1]:
|
||||
if photo.ref.get_mime_type()[0:5] == "image":
|
||||
spouse.append ((self.doc.add_photo,
|
||||
spouse.append ((self.doc.add_media_object,
|
||||
[photo.ref.get_path (),
|
||||
'right', 2, 2]))
|
||||
|
||||
@@ -375,7 +375,7 @@ class ComprehensiveAncestorsReport (Report.Report):
|
||||
ret.append ((self.doc.start_cell, ["AR-Photo"]))
|
||||
for photo in photos[:1]:
|
||||
if photo.ref.get_mime_type()[0:5] == "image":
|
||||
ret.append ((self.doc.add_photo,
|
||||
ret.append ((self.doc.add_media_object,
|
||||
[photo.ref.get_path (), 'left', 2, 2]))
|
||||
ret.append ((self.doc.end_cell, []))
|
||||
|
||||
|
||||
@@ -120,32 +120,32 @@ class CheckIntegrity:
|
||||
# File is lost => remove all references and the object itself
|
||||
mobj = ObjectMap[ObjectId]
|
||||
for p in self.db.get_family_id_map().values():
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
for key in self.db.get_person_keys():
|
||||
p = self.db.get_person(key)
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
for key in self.db.get_source_keys():
|
||||
p = self.db.get_source(key)
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
for key in self.db.get_place_id_keys():
|
||||
p = self.db.get_place_id(key)
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
self.removed_photo.append(ObjectMap[ObjectId])
|
||||
self.db.remove_object(ObjectId)
|
||||
Utils.modified()
|
||||
|
||||
@@ -562,7 +562,7 @@ class DetAncestorReport(Report.Report):
|
||||
#--------------------------------------------------------------------
|
||||
def insert_images(self, person):
|
||||
|
||||
photos = person.get_photo_list()
|
||||
photos = person.get_media_list()
|
||||
paragraph_started = 0
|
||||
for photo in photos :
|
||||
object = photo.get_reference()
|
||||
@@ -571,7 +571,7 @@ class DetAncestorReport(Report.Report):
|
||||
if not paragraph_started:
|
||||
self.doc.start_paragraph("DAR-Entry")
|
||||
paragraph_started = 1
|
||||
self.doc.add_photo(file,"row",4.0,4.0)
|
||||
self.doc.add_media_object(file,"row",4.0,4.0)
|
||||
self.doc.end_paragraph()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
@@ -555,7 +555,7 @@ class DetDescendantReport(Report.Report):
|
||||
#--------------------------------------------------------------------
|
||||
def insert_images(self, person):
|
||||
|
||||
photos = person.get_photo_list()
|
||||
photos = person.get_media_list()
|
||||
paragraph_started = 0
|
||||
for photo in photos :
|
||||
object = photo.get_reference()
|
||||
@@ -564,7 +564,7 @@ class DetDescendantReport(Report.Report):
|
||||
if not paragraph_started:
|
||||
self.doc.start_paragraph("DDR-Entry")
|
||||
paragraph_started = 1
|
||||
self.doc.add_photo(file,"row",4.0,4.0)
|
||||
self.doc.add_media_object(file,"row",4.0,4.0)
|
||||
self.doc.end_paragraph()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
@@ -372,7 +372,7 @@ class IndivComplete(Report.Report):
|
||||
self.d.page_break()
|
||||
self.slist = []
|
||||
|
||||
photo_list = self.person.get_photo_list()
|
||||
media_list = self.person.get_media_list()
|
||||
name = self.person.get_primary_name().get_regular_name()
|
||||
self.d.start_paragraph("IDS-Title")
|
||||
self.d.write_text(_("Summary of %s") % name)
|
||||
@@ -381,12 +381,12 @@ class IndivComplete(Report.Report):
|
||||
self.d.start_paragraph("IDS-Normal")
|
||||
self.d.end_paragraph()
|
||||
|
||||
if len(photo_list) > 0:
|
||||
object = photo_list[0].get_reference()
|
||||
if len(media_list) > 0:
|
||||
object = media_list[0].get_reference()
|
||||
if object.get_mime_type()[0:5] == "image":
|
||||
file = object.get_path()
|
||||
self.d.start_paragraph("IDS-Normal")
|
||||
self.d.add_photo(file,"row",4.0,4.0)
|
||||
self.d.add_media_object(file,"row",4.0,4.0)
|
||||
self.d.end_paragraph()
|
||||
|
||||
self.d.start_table("one","IDS-IndTable")
|
||||
|
||||
@@ -209,7 +209,7 @@ class IndivSummary(Report.Report):
|
||||
if self.newpage:
|
||||
self.d.page_break()
|
||||
|
||||
photo_list = self.person.get_photo_list()
|
||||
media_list = self.person.get_media_list()
|
||||
|
||||
name = self.person.get_primary_name().get_regular_name()
|
||||
self.d.start_paragraph("IVS-Title")
|
||||
@@ -219,12 +219,12 @@ class IndivSummary(Report.Report):
|
||||
self.d.start_paragraph("IVS-Normal")
|
||||
self.d.end_paragraph()
|
||||
|
||||
if len(photo_list) > 0:
|
||||
object = photo_list[0].get_reference()
|
||||
if len(media_list) > 0:
|
||||
object = media_list[0].get_reference()
|
||||
if object.get_mime_type()[0:5] == "image":
|
||||
file = object.get_path()
|
||||
self.d.start_paragraph("IVS-Normal")
|
||||
self.d.add_photo(file,"row",4.0,4.0)
|
||||
self.d.add_media_object(file,"row",4.0,4.0)
|
||||
self.d.end_paragraph()
|
||||
|
||||
self.d.start_table("one","IVS-IndTable")
|
||||
|
||||
+44
-90
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.7.8 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.6.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -13,21 +13,45 @@
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ../..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
transform = @program_transform_name@
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
@@ -35,54 +59,28 @@ NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
|
||||
EXEEXT = @EXEEXT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/plugins
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BINSH = @BINSH@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EXEEXT = @EXEEXT@
|
||||
GNOMEHELP = @GNOMEHELP@
|
||||
GNOMEINC = @GNOMEINC@
|
||||
GNOMELIB = @GNOMELIB@
|
||||
GPREFIX = @GPREFIX@
|
||||
HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@
|
||||
ICONV = @ICONV@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LANGUAGES = @LANGUAGES@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MOFILES = @MOFILES@
|
||||
MSGCONV = @MSGCONV@
|
||||
MSGFMT = @MSGFMT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
POFILES = @POFILES@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
|
||||
@@ -92,44 +90,19 @@ PYTHON_PREFIX = @PYTHON_PREFIX@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RELEASE = @RELEASE@
|
||||
SCROLLKEEPER_BUILD_REQUIRED = @SCROLLKEEPER_BUILD_REQUIRED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SK_CONFIG = @SK_CONFIG@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
VERSIONSTRING = @VERSIONSTRING@
|
||||
ZIP = @ZIP@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
oldincludedir = @oldincludedir@
|
||||
|
||||
pkgpyexecdir = @pkgpyexecdir@/plugins
|
||||
pkgpythondir = @pkgpythondir@/plugins
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
pyexecdir = @pyexecdir@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
|
||||
# This is the src/plugins level Makefile for Gramps
|
||||
# We could use GNU make's ':=' syntax for nice wildcard use,
|
||||
@@ -210,15 +183,14 @@ dist_pkgdata_DATA = $(GLADEFILES)
|
||||
|
||||
GRAMPS_PY_MODPATH = "../:../docgen"
|
||||
subdir = src/plugins
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
py_compile = $(top_srcdir)/py-compile
|
||||
DATA = $(dist_pkgdata_DATA)
|
||||
|
||||
DIST_COMMON = $(dist_pkgdata_DATA) $(pkgpython_PYTHON) \
|
||||
$(srcdir)/Makefile.in Makefile.am
|
||||
DIST_COMMON = $(dist_pkgdata_DATA) $(pkgpython_PYTHON) Makefile.am \
|
||||
Makefile.in
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -233,12 +205,11 @@ install-pkgpythonPYTHON: $(pkgpython_PYTHON)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgpythondir)
|
||||
@list='$(pkgpython_PYTHON)'; dlist=''; for p in $$list; do\
|
||||
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
|
||||
if test -f $$b$$p; then \
|
||||
if test -f $(srcdir)/$$p; then \
|
||||
d=`echo "$$p" | sed -e 's,^.*/,,'`; \
|
||||
dlist="$$dlist $$d"; \
|
||||
echo " $(pkgpythonPYTHON_INSTALL) $$b$$p $(DESTDIR)$(pkgpythondir)/$$d"; \
|
||||
$(pkgpythonPYTHON_INSTALL) $$b$$p $(DESTDIR)$(pkgpythondir)/$$d; \
|
||||
echo " $(pkgpythonPYTHON_INSTALL) $(srcdir)/$$p $(DESTDIR)$(pkgpythondir)/$$d"; \
|
||||
$(pkgpythonPYTHON_INSTALL) $(srcdir)/$$p $(DESTDIR)$(pkgpythondir)/$$d; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
PYTHON=$(PYTHON) $(py_compile) --basedir $(DESTDIR)$(pkgpythondir) $$dlist
|
||||
@@ -272,22 +243,13 @@ uninstall-dist_pkgdataDATA:
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = ../..
|
||||
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
@list='$(DISTFILES)'; for file in $$list; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
@@ -313,6 +275,7 @@ all-am: Makefile $(DATA)
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgpythondir) $(DESTDIR)$(pkgdatadir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
@@ -332,7 +295,7 @@ mostlyclean-generic:
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@@ -342,7 +305,7 @@ clean: clean-am
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
@@ -364,21 +327,13 @@ install-man:
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-dist_pkgdataDATA uninstall-info-am \
|
||||
uninstall-pkgpythonPYTHON
|
||||
|
||||
@@ -389,10 +344,9 @@ uninstall-am: uninstall-dist_pkgdataDATA uninstall-info-am \
|
||||
install-info install-info-am install-man \
|
||||
install-pkgpythonPYTHON install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
||||
pdf-am ps ps-am uninstall uninstall-am \
|
||||
uninstall-dist_pkgdataDATA uninstall-info-am \
|
||||
uninstall-pkgpythonPYTHON
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
uninstall uninstall-am uninstall-dist_pkgdataDATA \
|
||||
uninstall-info-am uninstall-pkgpythonPYTHON
|
||||
|
||||
|
||||
pycheck:
|
||||
|
||||
+69
-55
@@ -443,7 +443,7 @@ class GedcomParser:
|
||||
self.source.set_note(note)
|
||||
if not self.source.get_title():
|
||||
self.source.set_title("No title - ID %s" % self.source.get_id())
|
||||
self.db.build_source_display(self.source.get_id())
|
||||
self.db.commit_source(self.source)
|
||||
self.backup()
|
||||
return
|
||||
elif matches[1] == "TITL":
|
||||
@@ -471,7 +471,7 @@ class GedcomParser:
|
||||
else:
|
||||
note = "%s %s%s" % (matches[1],matches[2],d)
|
||||
elif matches[1] == "ABBR":
|
||||
self.source.setAbbrev(matches[2] + self.parse_continue_data(level+1))
|
||||
self.source.set_abbreviation(matches[2] + self.parse_continue_data(level+1))
|
||||
else:
|
||||
note = self.source.get_note()
|
||||
if note:
|
||||
@@ -497,16 +497,19 @@ class GedcomParser:
|
||||
mother.add_address(self.addr)
|
||||
for child in self.family.get_child_id_list():
|
||||
child.add_address(self.addr)
|
||||
self.db.commit_family(self.family)
|
||||
elif matches[2] == "INDI":
|
||||
if self.indi_count % UPDATE == 0 and self.window:
|
||||
self.update(self.people_obj,str(self.indi_count))
|
||||
self.indi_count = self.indi_count + 1
|
||||
id = matches[1]
|
||||
id = id[1:-1]
|
||||
print id
|
||||
self.person = self.find_or_create_person(id)
|
||||
self.added[self.person.get_id()] = self.person
|
||||
self.parse_individual()
|
||||
self.db.build_person_display(self.person.get_id())
|
||||
self.db.commit_person(self.person)
|
||||
elif matches[2] in ["SUBM","SUBN","REPO"]:
|
||||
self.ignore_sub_junk(1)
|
||||
elif matches[1] in ["SUBM","SUBN","OBJE","_EVENT_DEFN"]:
|
||||
@@ -532,7 +535,7 @@ class GedcomParser:
|
||||
def find_or_create_person(self,id):
|
||||
if self.pmap.has_key(id):
|
||||
person = self.db.find_person_from_id(self.pmap[id])
|
||||
elif self.db.get_person_id_map().has_key(id):
|
||||
elif self.db.has_person_id(id):
|
||||
person = RelLib.Person()
|
||||
self.pmap[id] = self.db.add_person(person)
|
||||
else:
|
||||
@@ -607,12 +610,12 @@ class GedcomParser:
|
||||
elif matches[1] == "HUSB":
|
||||
id = matches[2]
|
||||
person = self.find_or_create_person(id[1:-1])
|
||||
self.family.set_father_id(person)
|
||||
self.family.set_father_id(person.get_id())
|
||||
self.ignore_sub_junk(2)
|
||||
elif matches[1] == "WIFE":
|
||||
id = matches[2]
|
||||
person = self.find_or_create_person(id[1:-1])
|
||||
self.family.set_mother_id(person)
|
||||
self.family.set_mother_id(person.get_id())
|
||||
self.ignore_sub_junk(2)
|
||||
elif matches[1] == "SLGS":
|
||||
ord = RelLib.LdsOrd()
|
||||
@@ -626,18 +629,19 @@ class GedcomParser:
|
||||
mrel,frel = self.parse_ftw_relations(2)
|
||||
id = matches[2]
|
||||
child = self.find_or_create_person(id[1:-1])
|
||||
self.family.add_child_id(child)
|
||||
self.family.add_child_id(child.get_id())
|
||||
|
||||
for f in child.get_parent_family_id_list():
|
||||
if f[0] == self.family:
|
||||
if f[0] == self.family.get_id():
|
||||
break
|
||||
else:
|
||||
if (mrel=="Birth" or mrel=="") and (frel=="Birth" or frel==""):
|
||||
child.set_main_parent_family_id(self.family)
|
||||
child.set_main_parent_family_id(self.family.get_id())
|
||||
else:
|
||||
if child.get_main_parents_family_id() == self.family:
|
||||
child.set_main_parent_family_id(None)
|
||||
child.add_parent_family_id(self.family,mrel,frel)
|
||||
child.add_parent_family_id(self.family.get_id(),mrel,frel)
|
||||
self.db.commit_person(child)
|
||||
elif matches[1] == "NCHI":
|
||||
a = RelLib.Attribute()
|
||||
a.set_type("Number of Children")
|
||||
@@ -664,8 +668,9 @@ class GedcomParser:
|
||||
event.set_name(matches[1])
|
||||
if event.get_name() == "Marriage":
|
||||
self.family.set_relationship("Married")
|
||||
self.family.add_event(event)
|
||||
self.family.add_event_id(event.get_id())
|
||||
self.parse_family_event(event,2)
|
||||
self.db.add_event(event)
|
||||
|
||||
def parse_note_base(self,matches,obj,level,old_note,task):
|
||||
note = old_note
|
||||
@@ -766,28 +771,30 @@ class GedcomParser:
|
||||
self.parse_ord(ord,2)
|
||||
elif matches[1] == "FAMS":
|
||||
family = self.db.find_family_with_map(matches[2],self.fmap)
|
||||
self.person.add_family_id(family)
|
||||
self.person.add_family_id(family.get_id())
|
||||
if note == "":
|
||||
note = self.parse_optional_note(2)
|
||||
else:
|
||||
note = "%s\n\n%s" % (note,self.parse_optional_note(2))
|
||||
self.db.commit_family(family)
|
||||
elif matches[1] == "FAMC":
|
||||
type,note = self.parse_famc_type(2)
|
||||
family = self.db.find_family_with_map(matches[2],self.fmap)
|
||||
|
||||
for f in self.person.get_parent_family_id_list():
|
||||
if f[0] == family:
|
||||
if f[0] == family.get_id():
|
||||
break
|
||||
else:
|
||||
if type == "" or type == "Birth":
|
||||
if self.person.get_main_parents_family_id() == None:
|
||||
self.person.set_main_parent_family_id(family)
|
||||
self.person.set_main_parent_family_id(family.get_id())
|
||||
else:
|
||||
self.person.add_parent_family_id(family,"Unknown","Unknown")
|
||||
self.person.add_parent_family_id(family.get_id(),"Unknown","Unknown")
|
||||
else:
|
||||
if self.person.get_main_parents_family_id() == family:
|
||||
if self.person.get_main_parents_family_id() == family.get_id():
|
||||
self.person.set_main_parent_family_id(None)
|
||||
self.person.add_parent_family_id(family,type,type)
|
||||
self.person.add_parent_family_id(family.get_id(),type,type)
|
||||
self.db.commit_family(family)
|
||||
elif matches[1] == "RESI":
|
||||
addr = RelLib.Address()
|
||||
self.person.add_address(addr)
|
||||
@@ -804,33 +811,34 @@ class GedcomParser:
|
||||
self.person.add_address(addr)
|
||||
elif matches[1] == "BIRT":
|
||||
event = RelLib.Event()
|
||||
if self.person.get_birth().get_date() != "" or \
|
||||
self.person.get_birth().get_place_id() != None:
|
||||
if self.person.get_birth_id():
|
||||
event.set_name("Alternate Birth")
|
||||
self.person.add_event(event)
|
||||
self.person.add_event_id(event.get_id())
|
||||
else:
|
||||
event.set_name("Birth")
|
||||
self.person.set_birth(event)
|
||||
self.person.set_birth_id(event.get_id())
|
||||
self.parse_person_event(event,2)
|
||||
self.db.add_event(event)
|
||||
elif matches[1] == "ADOP":
|
||||
event = RelLib.Event()
|
||||
event.set_name("Adopted")
|
||||
self.person.add_event(event)
|
||||
self.person.add_event_id(event.get_id())
|
||||
self.parse_adopt_event(event,2)
|
||||
self.db.add_event(event)
|
||||
elif matches[1] == "DEAT":
|
||||
event = RelLib.Event()
|
||||
if self.person.get_death().get_date() != "" or \
|
||||
self.person.get_death().get_place_id() != None:
|
||||
if self.person.get_death_id():
|
||||
event.set_name("Alternate Death")
|
||||
self.person.add_event(event)
|
||||
self.person.add_event_id(event.get_id())
|
||||
else:
|
||||
event.set_name("Death")
|
||||
self.person.set_death(event)
|
||||
self.person.set_death_id(event.get_id())
|
||||
self.parse_person_event(event,2)
|
||||
self.db.add_event(event)
|
||||
elif matches[1] == "EVEN":
|
||||
event = RelLib.Event()
|
||||
if matches[2]:
|
||||
event.setDescription(matches[2])
|
||||
event.set_description(matches[2])
|
||||
self.parse_person_event(event,2)
|
||||
n = string.strip(event.get_name())
|
||||
if n in self.attrs:
|
||||
@@ -839,7 +847,8 @@ class GedcomParser:
|
||||
attr.set_value(event.get_description())
|
||||
self.person.add_attribute(attr)
|
||||
else:
|
||||
self.person.add_event(event)
|
||||
self.db.add_event(event)
|
||||
self.person.add_event_id(event.get_id())
|
||||
elif matches[1] == "SOUR":
|
||||
source_ref = self.handle_source(matches,2)
|
||||
self.person.get_primary_name().add_source_reference(source_ref)
|
||||
@@ -875,7 +884,8 @@ class GedcomParser:
|
||||
self.parse_person_event(event,2)
|
||||
if matches[2]:
|
||||
event.set_description(matches[2])
|
||||
self.person.add_event(event)
|
||||
self.db.add_event(event)
|
||||
self.person.add_event_id(event.get_id())
|
||||
|
||||
def parse_optional_note(self,level):
|
||||
note = ""
|
||||
@@ -955,14 +965,14 @@ class GedcomParser:
|
||||
self.warn(string.join(path,"\n\t\t"))
|
||||
self.warn('\n')
|
||||
else:
|
||||
photo = RelLib.Photo()
|
||||
photo = RelLib.MediaObject()
|
||||
photo.set_path(path)
|
||||
photo.set_description(title)
|
||||
photo.set_mime_type(Utils.get_mime_type(path))
|
||||
self.db.add_object(photo)
|
||||
oref = RelLib.ObjectRef()
|
||||
oref = RelLib.MediaRef()
|
||||
oref.set_reference(photo)
|
||||
self.person.add_photo(oref)
|
||||
self.person.add_media_object(oref)
|
||||
|
||||
def parse_family_object(self,level):
|
||||
form = ""
|
||||
@@ -993,14 +1003,15 @@ class GedcomParser:
|
||||
self.warn(string.join(path,"\n\t\t"))
|
||||
self.warn('\n')
|
||||
else:
|
||||
photo = RelLib.Photo()
|
||||
photo = RelLib.MediaObject()
|
||||
photo.set_path(path)
|
||||
photo.set_description(title)
|
||||
photo.set_mime_type(Utils.get_mime_type(path))
|
||||
self.db.add_object(photo)
|
||||
oref = RelLib.ObjectRef()
|
||||
oref = RelLib.MediaRef()
|
||||
oref.set_reference(photo)
|
||||
self.family.add_photo(photo)
|
||||
self.family.add_media_object(photo)
|
||||
self.db.commit_family(self.family)
|
||||
|
||||
def parse_residence(self,address,level):
|
||||
note = ""
|
||||
@@ -1078,13 +1089,14 @@ class GedcomParser:
|
||||
try:
|
||||
val = matches[2]
|
||||
if self.placemap.has_key(val):
|
||||
place = self.placemap[val]
|
||||
place_id = self.placemap[val]
|
||||
else:
|
||||
place = RelLib.Place()
|
||||
place.set_title(matches[2])
|
||||
self.db.add_place(place)
|
||||
self.placemap[val] = place
|
||||
ord.set_place_id(place)
|
||||
place_id = place.get_id()
|
||||
self.placemap[val] = place_id
|
||||
ord.set_place_id(place_id)
|
||||
self.ignore_sub_junk(level+1)
|
||||
except NameError:
|
||||
pass
|
||||
@@ -1130,13 +1142,14 @@ class GedcomParser:
|
||||
self.ignore_sub_junk(level+1)
|
||||
else:
|
||||
if self.placemap.has_key(val):
|
||||
place = self.placemap[val]
|
||||
place_id = self.placemap[val]
|
||||
else:
|
||||
place = RelLib.Place()
|
||||
place.set_title(matches[2])
|
||||
self.db.add_place(place)
|
||||
self.placemap[val] = place
|
||||
event.set_place_id(place)
|
||||
place_id = place.get_id()
|
||||
self.placemap[val] = place_id
|
||||
event.set_place_id(place_id)
|
||||
self.ignore_sub_junk(level+1)
|
||||
elif matches[1] == "CAUS":
|
||||
info = matches[2] + self.parse_continue_data(level+1)
|
||||
@@ -1179,19 +1192,20 @@ class GedcomParser:
|
||||
elif matches[1] == "FAMC":
|
||||
family = self.db.find_family_with_map(matches[2],self.fmap)
|
||||
mrel,frel = self.parse_adopt_famc(level+1);
|
||||
if self.person.get_main_parents_family_id() == family:
|
||||
if self.person.get_main_parents_family_id() == family.get_id():
|
||||
self.person.set_main_parent_family_id(None)
|
||||
self.person.add_parent_family_id(family,mrel,frel)
|
||||
self.person.add_parent_family_id(family.get_id(),mrel,frel)
|
||||
elif matches[1] == "PLAC":
|
||||
val = matches[2]
|
||||
if self.placemap.has_key(val):
|
||||
place = self.placemap[val]
|
||||
place_id = self.placemap[val]
|
||||
else:
|
||||
place = RelLib.Place()
|
||||
place.set_title(matches[2])
|
||||
self.db.add_place(place)
|
||||
self.placemap[val] = place
|
||||
event.set_place_id(place)
|
||||
place_id = place.get_id()
|
||||
self.placemap[val] = place_id
|
||||
event.set_place_id(place_id)
|
||||
self.ignore_sub_junk(level+1)
|
||||
elif matches[1] == "TYPE":
|
||||
# eventually do something intelligent here
|
||||
@@ -1312,13 +1326,14 @@ class GedcomParser:
|
||||
elif matches[1] == "PLAC":
|
||||
val = matches[2]
|
||||
if self.placemap.has_key(val):
|
||||
place = self.placemap[val]
|
||||
place_id = self.placemap[val]
|
||||
else:
|
||||
place = RelLib.Place()
|
||||
place.set_title(matches[2])
|
||||
self.db.add_place(place)
|
||||
self.placemap[val] = place
|
||||
event.set_place_id(place)
|
||||
place_id = place.get_id()
|
||||
self.placemap[val] = place_id
|
||||
event.set_place_id(place_id)
|
||||
self.ignore_sub_junk(level+1)
|
||||
elif matches[1] == 'OFFI':
|
||||
if note == "":
|
||||
@@ -1680,21 +1695,20 @@ class GedcomParser:
|
||||
self.localref = self.localref + 1
|
||||
ref = "gsr%d" % self.localref
|
||||
s = self.db.find_source(ref,self.smap)
|
||||
source_ref.set_base_id(s)
|
||||
source_ref.set_base_id(s.get_id())
|
||||
s.set_title('Imported Source #%d' % self.localref)
|
||||
s.set_note(matches[2] + self.parse_continue_data(level))
|
||||
self.db.build_source_display(s.get_id())
|
||||
self.ignore_sub_junk(level+1)
|
||||
else:
|
||||
source_ref.set_base_id(self.db.find_source(matches[2],self.smap))
|
||||
source_ref.set_base_id(self.db.find_source(matches[2],self.smap).get_id())
|
||||
self.parse_source_reference(source_ref,level)
|
||||
return source_ref
|
||||
|
||||
def resolve_refns(self):
|
||||
prefix = self.db.iprefix
|
||||
index = 0
|
||||
new_pmax = self.db.pmapIndex
|
||||
pmap = self.db.get_person_id_map()
|
||||
new_pmax = self.db.pmap_index
|
||||
for pid, person in self.added.items():
|
||||
index = index + 1
|
||||
if self.refn.has_key(pid):
|
||||
@@ -1703,12 +1717,12 @@ class GedcomParser:
|
||||
new_pmax = max(new_pmax,val)
|
||||
|
||||
# new ID is not used
|
||||
if not pmap.has_key(new_key):
|
||||
if not self.db.has_person_id(new_key):
|
||||
self.db.remove_person_id(person.get_id())
|
||||
person.set_id(new_key)
|
||||
self.db.add_person_as(person)
|
||||
else:
|
||||
tp = pmap[new_key]
|
||||
tp = self.db.find_person_from_id(new_key)
|
||||
# same person, just change it
|
||||
if person == tp:
|
||||
self.db.remove_person_id(person.get_id())
|
||||
@@ -1718,7 +1732,7 @@ class GedcomParser:
|
||||
else:
|
||||
pass
|
||||
|
||||
self.db.pmapIndex = new_pmax
|
||||
self.db.pmap_index = new_pmax
|
||||
|
||||
global file_top
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ class SimpleBookTitle(Report.Report):
|
||||
image_size = min(
|
||||
0.8 * self.doc.get_usable_width(),
|
||||
0.7 * self.doc.get_usable_height() )
|
||||
self.doc.add_photo(name,'center',image_size,image_size)
|
||||
self.doc.add_media_object(name,'center',image_size,image_size)
|
||||
|
||||
self.doc.start_paragraph('SBT-Footer')
|
||||
self.doc.write_text(self.footer_string)
|
||||
|
||||
@@ -75,7 +75,7 @@ def build_report(database,person):
|
||||
notfound.append(photo.get_path())
|
||||
|
||||
for person in personList:
|
||||
length = len(person.get_photo_list())
|
||||
length = len(person.get_media_list())
|
||||
if length > 0:
|
||||
with_photos = with_photos + 1
|
||||
total_photos = total_photos + length
|
||||
|
||||
@@ -292,7 +292,7 @@ class IndividualPage:
|
||||
filebase = "%s.%s" % (self.person.get_id(),self.ext)
|
||||
self.doc.open("%s/%s" % (self.dir,filebase))
|
||||
|
||||
photo_list = self.person.get_photo_list()
|
||||
media_list = self.person.get_media_list()
|
||||
name_obj = self.person.get_primary_name()
|
||||
name = name_obj.get_regular_name()
|
||||
|
||||
@@ -311,13 +311,13 @@ class IndividualPage:
|
||||
# make sure that the media object is an image. If so, insert it
|
||||
# into the document.
|
||||
|
||||
if self.photos and len(photo_list) > 0:
|
||||
object = photo_list[0].get_reference()
|
||||
if self.photos and len(media_list) > 0:
|
||||
object = media_list[0].get_reference()
|
||||
if object.get_mime_type()[0:5] == "image":
|
||||
file = object.get_path()
|
||||
if os.path.isfile(file):
|
||||
self.doc.start_paragraph("Data")
|
||||
self.doc.add_photo(file,"row",4.0,4.0)
|
||||
self.doc.add_media_object(file,"row",4.0,4.0)
|
||||
self.doc.end_paragraph()
|
||||
|
||||
# Start the first table, which consists of basic information, including
|
||||
@@ -394,7 +394,7 @@ class IndividualPage:
|
||||
|
||||
my_list = []
|
||||
index = 0
|
||||
for object in self.person.get_photo_list():
|
||||
for object in self.person.get_media_list():
|
||||
if object.get_reference().get_mime_type()[0:5] == "image":
|
||||
if object.get_privacy() == 0 and index != 0:
|
||||
my_list.append(object)
|
||||
@@ -439,7 +439,7 @@ class IndividualPage:
|
||||
self.doc.start_link("%s/%s" % (self.image_dir,base))
|
||||
else:
|
||||
self.doc.start_link("%s" % base)
|
||||
self.doc.add_photo(src,"row",1.5,1.5)
|
||||
self.doc.add_media_object(src,"row",1.5,1.5)
|
||||
self.doc.end_link()
|
||||
|
||||
self.doc.end_paragraph()
|
||||
|
||||
@@ -183,32 +183,32 @@ class PackageWriter:
|
||||
# File is lost => remove all references and the object itself
|
||||
mobj = self.db.get_object(self.object_id)
|
||||
for p in self.db.get_family_id_map().values():
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
for key in self.db.get_person_keys():
|
||||
p = self.db.get_person(key)
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
for key in self.db.get_source_keys():
|
||||
p = self.db.get_source(key)
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
for key in self.db.get_place_id_keys():
|
||||
p = self.db.get_place_id(key)
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
self.db.remove_object(self.object_id)
|
||||
Utils.modified()
|
||||
|
||||
|
||||
@@ -945,7 +945,7 @@ class GedcomWriter:
|
||||
self.write_source_ref(2,srcref)
|
||||
|
||||
if self.images:
|
||||
photos = person.get_photo_list ()
|
||||
photos = person.get_media_list ()
|
||||
else:
|
||||
photos = []
|
||||
|
||||
|
||||
@@ -110,32 +110,32 @@ class PackageWriter:
|
||||
# File is lost => remove all references and the object itself
|
||||
mobj = ObjectMap[ObjectId]
|
||||
for p in self.db.get_family_id_map().values():
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
for key in self.db.get_person_keys():
|
||||
p = self.db.get_person(key)
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
for key in self.db.get_source_keys():
|
||||
p = self.db.get_source(key)
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
for key in self.db.get_place_id_keys():
|
||||
p = self.db.get_place_id(key)
|
||||
nl = p.get_photo_list()
|
||||
nl = p.get_media_list()
|
||||
for o in nl:
|
||||
if o.get_reference() == mobj:
|
||||
nl.remove(o)
|
||||
p.set_photo_list(nl)
|
||||
p.set_media_list(nl)
|
||||
self.db.remove_object(ObjectId)
|
||||
Utils.modified()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user