Improved date format, minor reporting bugs, family view edit button fixes.

svn: r61
This commit is contained in:
Don Allingham 2001-05-26 13:38:00 +00:00
parent 0ce5ae5ff4
commit 5d4e64102f
9 changed files with 83 additions and 27 deletions

View File

@ -1,3 +1,26 @@
Version 0.1.5
* Plenty of bug fixes in the report generators and merging due to the
previous addition of date ranges.
* Added PDF file type generation for reports. Depends on the reportlab
package (available at www.reportlab.com). If the package is not
installed, gramps will run, but without PDF generation ability.
* Will use the Python Imaging Library if present to handle images. If
not, it will revert to the old method of using Imagick (convert).
* The user can select an attribute (from the attribute list) to display
on the Edit Person window.
* The internal gramps ID is now displayed on the Edit Person window.
* Marriage types can now be recorded.
* Addresses now use a single date instead of multiple dates, since
dates can now deal with ranges.
* Due to a bug in Python 2.0/GTK interaction, list colors are disabled
for Python 2.0 and above.
* configure script now properly deals with Python include paths,
eliminating the need to hand edit the src/Makefile to get gramps to
run under Python 2.X.
* Photos are now displayed properly again in the Edit Person gallery.
* Family notes are now implemented.
Version 0.1.4 Version 0.1.4
* Implemented date ranges. Valid forms are "from <date> to <date>" and * Implemented date ranges. Valid forms are "from <date> to <date>" and

View File

@ -1,4 +1,4 @@
#
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2000 Donald N. Allingham # Copyright (C) 2000 Donald N. Allingham
@ -240,7 +240,9 @@ class SingleDate:
re.IGNORECASE) re.IGNORECASE)
quick= re.compile(start + "(\d+)?\s(\S\S\S)?\s(\d+)?", quick= re.compile(start + "(\d+)?\s(\S\S\S)?\s(\d+)?",
re.IGNORECASE) re.IGNORECASE)
fmt3 = re.compile(start + "(\d+)\s*[./-]\s*(\d+)\s*[./-]\s*(\d+)\s*$", fmt3 = re.compile(start + r"([?\d]+)\s*[./-]\s*([?\d]+)\s*[./-]\s*([?\d]+)\s*$",
re.IGNORECASE)
fmt7 = re.compile(start + r"([?\d]+)\s*[./-]\s*([?\d]+)\s*$",
re.IGNORECASE) re.IGNORECASE)
fmt4 = re.compile(start + "(\S+)\s+(\d+)\s*$", fmt4 = re.compile(start + "(\S+)\s+(\d+)\s*$",
re.IGNORECASE) re.IGNORECASE)
@ -540,7 +542,7 @@ class SingleDate:
else: else:
retval = "%d/??/%d" % (self.month+1,self.year) retval = "%d/??/%d" % (self.month+1,self.year)
elif self.month == -1: elif self.month == -1:
retval = "%d" % self.year retval = "??-%d-%d" % (self.day,self.year)
else: else:
if self.year == -1: if self.year == -1:
retval = "%d/%d/????" % (self.month+1,self.day) retval = "%d/%d/????" % (self.month+1,self.day)
@ -575,7 +577,7 @@ class SingleDate:
else: else:
retval = "%d-??-%d" % (self.month+1,self.year) retval = "%d-??-%d" % (self.month+1,self.year)
elif self.month == -1: elif self.month == -1:
retval = "%d" % self.year retval = "??-%d-%d" % (self.day,self.year)
else: else:
if self.year == -1: if self.year == -1:
retval = "%d-%d-????" % (self.month+1,self.day) retval = "%d-%d-????" % (self.month+1,self.day)
@ -610,7 +612,7 @@ class SingleDate:
else: else:
retval = "??/%d/%d" % (self.month+1,self.year) retval = "??/%d/%d" % (self.month+1,self.year)
elif self.month == -1: elif self.month == -1:
retval = "%d" % self.year retval = "%d/??/%d" % (self.day,self.year)
else: else:
if self.year == -1: if self.year == -1:
retval = "%d/%d/????" % (self.day,self.month+1) retval = "%d/%d/????" % (self.day,self.month+1)
@ -644,7 +646,7 @@ class SingleDate:
else: else:
retval = "??-%d-%d" % (self.month+1,self.year) retval = "??-%d-%d" % (self.month+1,self.year)
elif self.month == -1: elif self.month == -1:
retval = "%d" % self.year retval = "%d-??-%d" % (self.day,self.year)
elif self.year == -1: elif self.year == -1:
retval = "%d-%d-????" % (self.day,self.month+1) retval = "%d-%d-????" % (self.day,self.month+1)
else: else:
@ -722,16 +724,42 @@ class SingleDate:
self.setYear(string.atoi(matches[1])) self.setYear(string.atoi(matches[1]))
return 1 return 1
match = SingleDate.fmt7.match(text)
if match != None:
matches = match.groups()
self.getMode(matches[0])
try:
self.setMonth(string.atoi(matches[1]))
except:
self.setMonth(-1)
try:
self.setYear(string.atoi(matches[2]))
except:
self.setYear(-1)
return 1
match = SingleDate.fmt3.match(text) match = SingleDate.fmt3.match(text)
if match != None: if match != None:
matches = match.groups() matches = match.groups()
self.getMode(matches[0]) self.getMode(matches[0])
if Date.entryCode == 0: if Date.entryCode == 0:
try:
self.setMonth(string.atoi(matches[1])) self.setMonth(string.atoi(matches[1]))
except:
self.setMonth(-1)
try:
self.setDay(string.atoi(matches[2])) self.setDay(string.atoi(matches[2]))
except:
self.setDay(-1)
else: else:
try:
self.setMonth(string.atoi(matches[2])) self.setMonth(string.atoi(matches[2]))
except:
self.setMonth(-1)
try:
self.setDay(string.atoi(matches[1])) self.setDay(string.atoi(matches[1]))
except:
self.setDay(-1)
val = matches[3] val = matches[3]
if val == None or val[0] == '?': if val == None or val[0] == '?':
self.setYear(-1) self.setYear(-1)
@ -839,6 +867,8 @@ if __name__ == "__main__":
checkit("11 JAN 1923") checkit("11 JAN 1923")
checkit("11-1-1929") checkit("11-1-1929")
checkit("4/3/1203") checkit("4/3/1203")
checkit("3/1203")
checkit("?/3/1203")
checkit("January 4, 1923") checkit("January 4, 1923")
checkit("before 3/3/1239") checkit("before 3/3/1239")
checkit("est 2-3-1023") checkit("est 2-3-1023")

View File

@ -51,7 +51,6 @@ class OpenOfficeDoc(TextDoc):
def open(self,filename): def open(self,filename):
import time import time
print filename
t = time.localtime(time.time()) t = time.localtime(time.time())
self.time = "%04d-%02d-%02dT%02d:%02d:%02d" % \ self.time = "%04d-%02d-%02dT%02d:%02d:%02d" % \
(t[0],t[1],t[2],t[3],t[4],t[5]) (t[0],t[1],t[2],t[3],t[4],t[5])

View File

@ -122,7 +122,6 @@ class PdfDoc(TextDoc):
def end_paragraph(self): def end_paragraph(self):
if self.in_table == 0 and self.image == 0: if self.in_table == 0 and self.image == 0:
print self.text
self.story.append(Paragraph(self.text,self.current_para)) self.story.append(Paragraph(self.text,self.current_para))
self.story.append(Spacer(1,0.25*cm)) self.story.append(Spacer(1,0.25*cm))
else: else:

View File

@ -104,8 +104,6 @@ class PdfDrawDoc(DrawDoc):
start_y = (y + h/2.0 + l/2.0 + l) - ((l*size) + ((l-1)*0.2))/2.0 start_y = (y + h/2.0 + l/2.0 + l) - ((l*size) + ((l-1)*0.2))/2.0
start_x = (x + w/2.0) start_x = (x + w/2.0)
print y,y+h,start_y
self.f.saveState() self.f.saveState()
self.f.setFillColor(make_color(font.get_color())) self.f.setFillColor(make_color(font.get_color()))
if font.get_type_face() == FONT_SANS_SERIF: if font.get_type_face() == FONT_SANS_SERIF:

View File

@ -67,7 +67,7 @@ gtkrcFile = rootDir + os.sep + "gtkrc"
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
progName = "gramps" progName = "gramps"
version = "0.1.5pre" version = "0.1.5"
copyright = "(C) 2001 Donald N. Allingham" copyright = "(C) 2001 Donald N. Allingham"
authors = ["Donald N. Allingham"] authors = ["Donald N. Allingham"]
comments = _("Gramps (Genealogical Research and Analysis Management ") +\ comments = _("Gramps (Genealogical Research and Analysis Management ") +\

View File

@ -449,9 +449,6 @@ def on_choose_parents_clicked(obj):
global select_father global select_father
global family_window global family_window
# select_father = active_father
# select_mother = active_mother
if active_parents: if active_parents:
select_father = active_parents.getFather() select_father = active_parents.getFather()
select_mother = active_parents.getMother() select_mother = active_parents.getMother()
@ -725,7 +722,11 @@ def find_family(father,mother):
family = database.newFamily() family = database.newFamily()
family.setFather(father) family.setFather(father)
family.setMother(mother) family.setMother(mother)
if father:
father.addFamily(family) father.addFamily(family)
if mother:
mother.addFamily(family) mother.addFamily(family)
return family return family
@ -865,6 +866,7 @@ def on_select_spouse_clicked(obj):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def on_edit_active_person(obj): def on_edit_active_person(obj):
if active_person:
load_person(active_person) load_person(active_person)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -873,6 +875,7 @@ def on_edit_active_person(obj):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def on_edit_spouse_clicked(obj): def on_edit_spouse_clicked(obj):
if active_spouse:
load_person(active_spouse) load_person(active_spouse)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -881,6 +884,7 @@ def on_edit_spouse_clicked(obj):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def on_edit_mother_clicked(obj): def on_edit_mother_clicked(obj):
if active_mother:
load_person(active_mother) load_person(active_mother)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -889,6 +893,7 @@ def on_edit_mother_clicked(obj):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def on_edit_father_clicked(obj): def on_edit_father_clicked(obj):
if active_father:
load_person(active_father) load_person(active_father)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -1483,8 +1488,6 @@ def load_person(person):
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def load_family(): def load_family():
global active_mother global active_mother
global active_father
global active_family
global active_parents global active_parents
global active_spouse global active_spouse
@ -1612,11 +1615,15 @@ def change_parents(family):
fv_mother.set_text("") fv_mother.set_text("")
mother_next.set_sensitive(0) mother_next.set_sensitive(0)
father_next.set_sensitive(0) father_next.set_sensitive(0)
active_father = None
active_mother = None
else : else :
fv_father.set_text("") fv_father.set_text("")
fv_mother.set_text("") fv_mother.set_text("")
mother_next.set_sensitive(0) mother_next.set_sensitive(0)
father_next.set_sensitive(0) father_next.set_sensitive(0)
active_father = None
active_mother = None
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -188,6 +188,7 @@ def on_ok_clicked(obj):
txtcolor, txtcolor,
bdrcolor, bdrcolor,
font) font)
displayWindow.show() displayWindow.show()
utils.destroy_passed_object(obj) utils.destroy_passed_object(obj)

View File

@ -107,7 +107,6 @@ class DescendantReport:
self.doc.start_paragraph("Title") self.doc.start_paragraph("Title")
name = self.person.getPrimaryName().getRegularName() name = self.person.getPrimaryName().getRegularName()
self.doc.write_text(_("Descendants of %s") % name) self.doc.write_text(_("Descendants of %s") % name)
self.doc.write_text()
self.doc.end_paragraph() self.doc.end_paragraph()
self.dump(1,self.person) self.dump(1,self.person)