2008-01-10 Raphael Ackermann <raphael.ackermann@gmail.com>

* src/gen/db/dbdir.py: add doc, remove unused variable
    * src/GrampsDbUtils/_GrampsBSDDB.py: : add doc, remove unused variable
    * src/plugins/AncestorChart.py: cleanup unused vars
    * src/plugins/Calendar.py: typo in doc
    * src/plugins/ChangeNames.py: cleanup unused vars
    * src/plugins/DescendChart.py: cleanup unused vars
    * src/plugins/FamilyLines.py: cleanup unused vars
    * src/ReportBase/_ReportUtils.py: fix typo in variable Name

svn: r9779
This commit is contained in:
Raphael Ackermann 2008-01-11 06:50:46 +00:00
parent d28b01f4b0
commit 1abb8df85f
9 changed files with 22 additions and 29 deletions

View File

@ -1,3 +1,13 @@
2008-01-10 Raphael Ackermann <raphael.ackermann@gmail.com>
* src/gen/db/dbdir.py: add doc, remove unused variable
* src/GrampsDbUtils/_GrampsBSDDB.py: : add doc, remove unused variable
* src/plugins/AncestorChart.py: cleanup unused vars
* src/plugins/Calendar.py: typo in doc
* src/plugins/ChangeNames.py: cleanup unused vars
* src/plugins/DescendChart.py: cleanup unused vars
* src/plugins/FamilyLines.py: cleanup unused vars
* src/ReportBase/_ReportUtils.py: fix typo in variable Name
2008-01-10 Raphael Ackermann <raphael.ackermann@gmail.com>
* src/MarkupText.py: in _hex_to_color removed dupe assignment to color
* src/PageView.py: doc typo and delete unused statements in filter_toggle

View File

@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2000-2008 Donald N. Allingham
#
# 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
@ -21,7 +21,9 @@
# $Id$
"""
Provides the Berkeley DB (BSDDB) database backend for GRAMPS
Provides the Berkeley DB (BSDDB) database backend for GRAMPS for GRAMPS up
to version 2.2.x
"""
#-------------------------------------------------------------------------
@ -1610,10 +1612,6 @@ class GrampsBSDDB(GrampsDbBase, UpdateCallback):
def gramps_upgrade(self, callback=None):
UpdateCallback.__init__(self, callback)
child_rel_notrans = [
"None", "Birth", "Adopted", "Stepchild",
"Sponsored", "Foster", "Unknown", "Other", ]
version = self.metadata.get('version', default=_MINVERSION)
t = time.time()

View File

@ -2556,7 +2556,7 @@ def old_calc_age(database, person):
and birth.get_day_valid() and death.get_day_valid() \
and birth.get_day() > death.get_day():
age = death.get_day() + 31 - birth.get_day()
unit = DAYS
units = DAYS
return (age, units)

View File

@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2000-2008 Donald N. Allingham
#
# 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
@ -22,6 +22,8 @@
"""
Provides the Berkeley DB (DBDir) database backend for GRAMPS
This is used since GRAMPS version 3.0
"""
#-------------------------------------------------------------------------
@ -1733,11 +1735,7 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback):
def gramps_upgrade(self,callback=None):
UpdateCallback.__init__(self,callback)
child_rel_notrans = [
"None", "Birth", "Adopted", "Stepchild",
"Sponsored", "Foster", "Unknown", "Other", ]
version = self.metadata.get('version',default=_MINVERSION)
# version = self.metadata.get('version',default=_MINVERSION)
t = time.time()
# if version < 13:

View File

@ -249,9 +249,6 @@ class AncestorChart(Report):
def write_report(self):
generation = 1
done = 0
page = 1
(maxy,maxx) = self.genchart.dimensions()
maxh = int(self.uh/self.box_height)
@ -330,12 +327,9 @@ class AncestorChart(Report):
self.generations_per_page = int(log2(maxh))
else:
self.generations_per_page = maxw
acty = 2**self.generations_per_page
# build array of x indices
xstart = 0
ystart = self.offset-self.box_height/2.0
self.delta = pt2cm(self.box_pad_pts) + self.box_width + 0.2
if not self.force_fit:
calc_width = self.box_width + 0.2 + pt2cm(self.box_pad_pts)

View File

@ -726,7 +726,7 @@ class Xml2Obj:
return
def Parse(self,filename):
'Creat a SAX parser and parse filename '
'Create a SAX parser and parse filename '
Parser = expat.ParserCreate()
# SAX event handlers
Parser.StartElementHandler = self.StartElement

View File

@ -154,7 +154,6 @@ class ChangeNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
for node in self.iter_list
if self.model.get_value(node,0)]
anychange = False
for handle in self.db.get_person_handles():
change = False
person = self.db.get_person_from_handle(handle)
@ -162,7 +161,6 @@ class ChangeNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
sname = name.get_surname()
if sname in changelist:
change = True
anychange = True
name.set_surname(sname.capitalize())
if change:
self.db.commit_person(person,self.trans)

View File

@ -226,9 +226,6 @@ class DescendChart(Report):
def write_report(self):
generation = 1
done = 0
page = 1
(maxy,maxx) = self.genchart.dimensions()
maxx = (maxx-1)*2
maxh = int((self.uh-0.75)/(self.box_height*1.25))
@ -302,15 +299,13 @@ class DescendChart(Report):
self.box_pad_pts = self.box_pad_pts/self.scale
self.box_gap = self.box_gap/self.scale
maxh = int((self.uh)/(self.box_height+self.box_gap))
# maxh = int((self.uh)/(self.box_height+self.box_gap))
maxw = int(uw/calc_width)
# build array of x indices
self.generations_per_page = maxw
xstart = 0
ystart = self.offset-self.box_height/2.0
self.delta = pt2cm(self.box_pad_pts) + self.box_width + self.box_gap
if not self.force_fit:
calc_width = self.box_width + pt2cm(self.box_pad_pts)

View File

@ -732,7 +732,7 @@ class FamilyLinesReport(Report):
try:
self.of = open(self.filename, "w")
except (OSError,IOError),value:
except (OSError,IOError):
ErrorDialog(_("Could not create %s") % self.filename)
return