* src/plugins/DetDescendantReport.py: Correct image insertion.
* src/plugins/DetAncestralReport.py: Correct image insertion. svn: r2602
This commit is contained in:
parent
e45cfd5d72
commit
1668c0830d
@ -1,6 +1,8 @@
|
|||||||
2004-01-06 Egyeki Gergely <egeri@elte.hu>
|
2004-01-06 Egyeki Gergely <egeri@elte.hu>
|
||||||
* src/plugins/rel_hu.py: Add to CVS.
|
* src/plugins/rel_hu.py: Add to CVS.
|
||||||
* src/plugins/Makefile.am: Ship rel_hu.py.
|
* src/plugins/Makefile.am: Ship rel_hu.py.
|
||||||
|
* src/plugins/DetDescendantReport.py: Correct image insertion.
|
||||||
|
* src/plugins/DetAncestralReport.py: Correct image insertion.
|
||||||
|
|
||||||
2004-01-06 Alex Roitman <shura@alex.neuro.umn.edu>
|
2004-01-06 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
* src/plugins/IndivComplete.py (write_note): Typo.
|
* src/plugins/IndivComplete.py (write_note): Typo.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Gramps - a GTK+/GNOME based genealogy program
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
#
|
#
|
||||||
# Copyright (C) 2000-2003 Bruce J. DeGrasse
|
# Copyright (C) 2000-2004 Bruce J. DeGrasse
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -204,7 +204,7 @@ class DetAncestorReport(Report.Report):
|
|||||||
|
|
||||||
person = self.map[key]
|
person = self.map[key]
|
||||||
if rptOptions.addImages == reportOptions.Yes:
|
if rptOptions.addImages == reportOptions.Yes:
|
||||||
self.insert_images(person, rptOptions.imageAttrTag)
|
self.insert_images(person)
|
||||||
|
|
||||||
name = person.getPrimaryName().getRegularName()
|
name = person.getPrimaryName().getRegularName()
|
||||||
|
|
||||||
@ -538,7 +538,7 @@ class DetAncestorReport(Report.Report):
|
|||||||
self.doc.start_paragraph("DAR-Entry")
|
self.doc.start_paragraph("DAR-Entry")
|
||||||
|
|
||||||
if rptOptions.addImages == reportOptions.Yes:
|
if rptOptions.addImages == reportOptions.Yes:
|
||||||
self.insert_images(ind, rptOptions.imageAttrTag)
|
self.insert_images(ind)
|
||||||
|
|
||||||
if rptOptions.firstName == reportOptions.No:
|
if rptOptions.firstName == reportOptions.No:
|
||||||
firstName= heshe
|
firstName= heshe
|
||||||
@ -562,58 +562,20 @@ class DetAncestorReport(Report.Report):
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
def insert_images(self, person, tag):
|
def insert_images(self, person):
|
||||||
|
|
||||||
photos= person.getPhotoList()
|
photos = person.getPhotoList()
|
||||||
|
paragraph_started = 0
|
||||||
for photo in photos :
|
for photo in photos :
|
||||||
if photo.getMimeType()[0:5] != "image":
|
object = photo.getReference()
|
||||||
continue
|
if object.getMimeType()[0:5] == "image":
|
||||||
attribs= photo.getAttributeList()
|
file = object.getPath()
|
||||||
for attrib in attribs :
|
if not paragraph_started:
|
||||||
if attrib.getType() == tag:
|
self.doc.start_paragraph("DAR-Entry")
|
||||||
vlist= string.split(attrib.getValue())
|
paragraph_started = 1
|
||||||
if vlist[0] == 'left' or vlist[0] == 'right':
|
self.doc.add_photo(file,"row",4.0,4.0)
|
||||||
self.doc.add_photo(photo.ref.getPath(), vlist[0], \
|
|
||||||
float(vlist[1]), float(vlist[2]))
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#--------------------------------------------------------------------
|
|
||||||
def append_images(self, person, tag):
|
|
||||||
|
|
||||||
photos= person.getPhotoList()
|
|
||||||
numPhotos= 0 # Number of photos
|
|
||||||
for photo in photos :
|
|
||||||
if photo.getMimeType()[0:5] != "image":
|
|
||||||
continue
|
|
||||||
attribs= photo.getAttributeList()
|
|
||||||
for attrib in attribs :
|
|
||||||
if attrib.getType() == tag:
|
|
||||||
vlist= string.split(attrib.getValue())
|
|
||||||
if vlist[0] == 'single':
|
|
||||||
#if numPhotos > 0:
|
|
||||||
# self.doc.end_paragraph()
|
|
||||||
|
|
||||||
numPhotos= numPhotos + 1
|
|
||||||
if numPhotos == 1:
|
|
||||||
self.doc.start_paragraph("DAR-Entry")
|
|
||||||
self.doc.add_photo(photo.ref.getPath(), vlist[0], \
|
|
||||||
float(vlist[1]), float(vlist[2]))
|
|
||||||
#self.doc.end_paragraph()
|
|
||||||
#numPhotos= 0
|
|
||||||
elif vlist[0] == 'row':
|
|
||||||
numPhotos= numPhotos + 1
|
|
||||||
if numPhotos == 1:
|
|
||||||
self.doc.start_paragraph("DAR-Entry")
|
|
||||||
self.doc.add_photo(photo.ref.getPath(), vlist[0], \
|
|
||||||
float(vlist[1]), float(vlist[2]))
|
|
||||||
|
|
||||||
if numPhotos > 0 :
|
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@ -661,8 +623,8 @@ class DetAncestorReport(Report.Report):
|
|||||||
family= person.getFamilyList()[0]
|
family= person.getFamilyList()[0]
|
||||||
self.write_children(family, rptOpt)
|
self.write_children(family, rptOpt)
|
||||||
|
|
||||||
if rptOpt.addImages == reportOptions.Yes:
|
#if rptOpt.addImages == reportOptions.Yes:
|
||||||
self.append_images(person, rptOpt.imageAttrTag)
|
# self.append_images(person)
|
||||||
|
|
||||||
if self.standalone:
|
if self.standalone:
|
||||||
self.doc.close()
|
self.doc.close()
|
||||||
@ -1323,7 +1285,7 @@ class reportOptions:
|
|||||||
|
|
||||||
#Add Photos and Images to report
|
#Add Photos and Images to report
|
||||||
self.addImages= reportOptions.Yes
|
self.addImages= reportOptions.Yes
|
||||||
self.imageAttrTag= "DetAncestralReport-H"
|
#self.imageAttrTag= "DetAncestralReport-H"
|
||||||
#self.imageAttrTag= "DetAncestralReport-L"
|
#self.imageAttrTag= "DetAncestralReport-L"
|
||||||
|
|
||||||
#Omit sensitive information such as birth, christening, marriage
|
#Omit sensitive information such as birth, christening, marriage
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Gramps - a GTK+/GNOME based genealogy program
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
#
|
#
|
||||||
# Copyright (C) 2000-2003 Bruce J. DeGrasse
|
# Copyright (C) 2000-2004 Bruce J. DeGrasse
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -211,7 +211,7 @@ class DetDescendantReport(Report.Report):
|
|||||||
|
|
||||||
person = self.map[key]
|
person = self.map[key]
|
||||||
if rptOptions.addImages == reportOptions.Yes:
|
if rptOptions.addImages == reportOptions.Yes:
|
||||||
self.insert_images(person, rptOptions.imageAttrTag)
|
self.insert_images(person)
|
||||||
|
|
||||||
name = person.getPrimaryName().getRegularName()
|
name = person.getPrimaryName().getRegularName()
|
||||||
|
|
||||||
@ -535,7 +535,7 @@ class DetDescendantReport(Report.Report):
|
|||||||
self.doc.start_paragraph("DDR-Entry")
|
self.doc.start_paragraph("DDR-Entry")
|
||||||
|
|
||||||
if rptOptions.addImages == reportOptions.Yes:
|
if rptOptions.addImages == reportOptions.Yes:
|
||||||
self.insert_images(mate, rptOptions.imageAttrTag)
|
self.insert_images(mate)
|
||||||
|
|
||||||
if rptOptions.firstName == reportOptions.No:
|
if rptOptions.firstName == reportOptions.No:
|
||||||
mateFirstName = heshe
|
mateFirstName = heshe
|
||||||
@ -555,58 +555,20 @@ class DetDescendantReport(Report.Report):
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
def insert_images(self, person, tag):
|
def insert_images(self, person):
|
||||||
|
|
||||||
photos= person.getPhotoList()
|
photos = person.getPhotoList()
|
||||||
|
paragraph_started = 0
|
||||||
for photo in photos :
|
for photo in photos :
|
||||||
if photo.getMimeType()[0:5] != "image":
|
object = photo.getReference()
|
||||||
continue
|
if object.getMimeType()[0:5] == "image":
|
||||||
attribs= photo.getAttributeList()
|
file = object.getPath()
|
||||||
for attrib in attribs :
|
if not paragraph_started:
|
||||||
if attrib.getType() == tag:
|
self.doc.start_paragraph("DDR-Entry")
|
||||||
vlist= string.split(attrib.getValue())
|
paragraph_started = 1
|
||||||
if vlist[0] == 'left' or vlist[0] == 'right':
|
self.doc.add_photo(file,"row",4.0,4.0)
|
||||||
self.doc.add_photo(photo.ref.getPath(), vlist[0], \
|
|
||||||
float(vlist[1]), float(vlist[2]))
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#--------------------------------------------------------------------
|
|
||||||
def append_images(self, person, tag):
|
|
||||||
|
|
||||||
photos= person.getPhotoList()
|
|
||||||
numPhotos= 0 # Number of photos
|
|
||||||
for photo in photos :
|
|
||||||
if photo.getMimeType()[0:5] != "image":
|
|
||||||
continue
|
|
||||||
attribs= photo.getAttributeList()
|
|
||||||
for attrib in attribs :
|
|
||||||
if attrib.getType() == tag:
|
|
||||||
vlist= string.split(attrib.getValue())
|
|
||||||
if vlist[0] == 'single':
|
|
||||||
#if numPhotos > 0:
|
|
||||||
# self.doc.end_paragraph()
|
|
||||||
|
|
||||||
numPhotos= numPhotos + 1
|
|
||||||
if numPhotos == 1:
|
|
||||||
self.doc.start_paragraph("DDR-Entry")
|
|
||||||
self.doc.add_photo(photo.ref.getPath(), vlist[0], \
|
|
||||||
float(vlist[1]), float(vlist[2]))
|
|
||||||
#self.doc.end_paragraph()
|
|
||||||
#numPhotos= 0
|
|
||||||
elif vlist[0] == 'row':
|
|
||||||
numPhotos= numPhotos + 1
|
|
||||||
if numPhotos == 1:
|
|
||||||
self.doc.start_paragraph("DDR-Entry")
|
|
||||||
self.doc.add_photo(photo.ref.getPath(), vlist[0], \
|
|
||||||
float(vlist[1]), float(vlist[2]))
|
|
||||||
|
|
||||||
if numPhotos > 0 :
|
|
||||||
self.doc.end_paragraph()
|
self.doc.end_paragraph()
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@ -669,8 +631,8 @@ class DetDescendantReport(Report.Report):
|
|||||||
family= person.getFamilyList()[0]
|
family= person.getFamilyList()[0]
|
||||||
self.write_children(family, rptOpt)
|
self.write_children(family, rptOpt)
|
||||||
|
|
||||||
if rptOpt.addImages == reportOptions.Yes:
|
#if rptOpt.addImages == reportOptions.Yes:
|
||||||
self.append_images(person, rptOpt.imageAttrTag)
|
# self.append_images(person)
|
||||||
|
|
||||||
if self.standalone:
|
if self.standalone:
|
||||||
self.doc.close()
|
self.doc.close()
|
||||||
@ -1331,7 +1293,7 @@ class reportOptions:
|
|||||||
|
|
||||||
#Add Photos and Images to report
|
#Add Photos and Images to report
|
||||||
self.addImages= reportOptions.No
|
self.addImages= reportOptions.No
|
||||||
self.imageAttrTag= "DetDescendantReport"
|
#self.imageAttrTag= "DetDescendantReport"
|
||||||
|
|
||||||
#Omit sensitive information such as birth, christening, marriage
|
#Omit sensitive information such as birth, christening, marriage
|
||||||
# for living after XXXXX date.
|
# for living after XXXXX date.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user