2007-10-07 Don Allingham <don@gramps-project.org>

* various: gen.utils integrationk



svn: r9100
This commit is contained in:
Don Allingham 2007-10-08 04:02:34 +00:00
parent 4f7ebd5b3e
commit 8038bc0dca
15 changed files with 74 additions and 22 deletions

View File

@ -1,3 +1,6 @@
2007-10-07 Don Allingham <don@gramps-project.org>
* various: gen.utils integrationk
2007-10-07 Gary Burton <gary.burton@zen.co.uk>
* src/DataViews/_RelationView.py: init scroll pos on new person, issue #442

View File

@ -180,6 +180,7 @@ src/DateHandler/Makefile
src/gen/Makefile
src/gen/proxy/Makefile
src/gen/db/Makefile
src/gen/utils/Makefile
src/data/Makefile
src/data/templates/Makefile
src/glade/Makefile

View File

@ -201,13 +201,13 @@ class FamilyListView(PageView.ListView):
def remove(self, obj):
self.uistate.set_busy_cursor(1)
import GrampsDb
import gen.utils
mlist = []
self.selection.selected_foreach(self.blist, mlist)
for handle in mlist:
GrampsDb.remove_family_relationships(self.dbstate.db, handle)
gen.utils.remove_family_relationships(self.dbstate.db, handle)
self.build_tree()
self.uistate.set_busy_cursor(0)

View File

@ -54,7 +54,7 @@ import ThumbNails
import Config
import GrampsWidgets
import Errors
import GrampsDb
import gen.utils
from ReportBase import ReportUtils
@ -1226,7 +1226,7 @@ class RelationshipView(PageView.PersonNavView):
active_handle = self.dbstate.active.handle
child = self.dbstate.db.get_person_from_handle(active_handle)
GrampsDb.add_child_to_family(
gen.utils.add_child_to_family(
self.dbstate.db,
family,
child)
@ -1246,7 +1246,7 @@ class RelationshipView(PageView.PersonNavView):
active_handle = self.dbstate.active.handle
child = self.dbstate.db.get_person_from_handle(active_handle)
GrampsDb.add_child_to_family(
gen.utils.add_child_to_family(
self.dbstate.db,
family,
child)
@ -1285,15 +1285,15 @@ class RelationshipView(PageView.PersonNavView):
def delete_family(self, obj, event, handle):
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
GrampsDb.remove_parent_from_family(self.dbstate.db,
self.dbstate.active.handle,
handle)
gen.utils.remove_parent_from_family(self.dbstate.db,
self.dbstate.active.handle,
handle)
def delete_parent_family(self, obj, event, handle):
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1:
GrampsDb.remove_child_from_family(self.dbstate.db,
self.dbstate.active.handle,
handle)
gen.utils.remove_child_from_family(self.dbstate.db,
self.dbstate.active.handle,
handle)
def change_to(self, obj, handle):
self.dbstate.change_active_handle(handle)

View File

@ -46,7 +46,7 @@ import GrampsLocale
import DateHandler
from BasicUtils import name_displayer
import RelLib
import GrampsDb
import gen.utils
from _BaseModel import BaseModel
@ -130,7 +130,7 @@ class FamilyModel(BaseModel):
def column_marriage(self, data):
erlist = [ RelLib.EventRef().unserialize(d) for d in data[6] ]
event = GrampsDb.marriage_from_eventref_list(self.db, erlist)
event = gen.utils.marriage_from_eventref_list(self.db, erlist)
if event:
return DateHandler.displayer.display(event.date)
else:
@ -138,7 +138,7 @@ class FamilyModel(BaseModel):
def sort_marriage(self, data):
erlist = [ RelLib.EventRef().unserialize(d) for d in data[6] ]
event = GrampsDb.marriage_from_eventref_list(self.db, erlist)
event = gen.utils.marriage_from_eventref_list(self.db, erlist)
if event:
return "%09d" % event.date.get_sort_value()
else:

View File

@ -56,7 +56,7 @@ import GrampsWidgets
from BasicUtils import name_displayer
import Errors
from GrampsDb import set_birth_death_index
from gen.utils import set_birth_death_index
from _EditPrimary import EditPrimary
from QuestionDialog import *

View File

@ -46,7 +46,7 @@ __LOG = logging.getLogger(".GrampsDb")
#-------------------------------------------------------------------------
from RelLib import *
from gen.db.base import *
from _DbUtils import db_copy
from gen.utils import db_copy
import gen.db.const as const
from _GrampsDbExceptions import FileVersionError
from BasicUtils import UpdateCallback

View File

@ -29,7 +29,7 @@ from RelLib import *
from _GrampsInMemDB import *
from _GrampsDbExceptions import GrampsDbException
from _DbUtils import db_copy
from gen.utils import db_copy
#-------------------------------------------------------------------------
#

View File

@ -32,7 +32,7 @@ from RelLib import *
from _GrampsInMemDB import *
from _GrampsDbExceptions import GrampsDbException
from _DbUtils import db_copy
from gen.utils import db_copy
#-------------------------------------------------------------------------

View File

@ -46,7 +46,7 @@ from _GrampsDbFactories import gramps_db_factory
#from _GrampsDBCallback import GrampsDBCallback
from _DbUtils import *
#from _DbUtils import *
#import _GrampsDbConst as GrampsDbConst

View File

@ -37,7 +37,7 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
from _GrampsBSDDB import GrampsBSDDB
from QuestionDialog import ErrorDialog
from _DbUtils import db_copy
from gen.utils import db_copy
#-------------------------------------------------------------------------
#

View File

@ -48,7 +48,7 @@ import DateHandler
import QuestionDialog
import GrampsDisplay
import ManagedWindow
import GrampsDb
import gen.utils
sex = ( _("female"), _("male"), _("unknown"))
@ -422,7 +422,7 @@ class MergePeople:
# merge the event lists
self.merge_event_lists(new)
GrampsDb.set_birth_death_index(self.db, new)
gen.utils.set_birth_death_index(self.db, new)
# copy attributes
new.set_attribute_list(self.p1.get_attribute_list() +

24
src/gen/utils/Makefile.am Normal file
View File

@ -0,0 +1,24 @@
# This is the src/RelLib level Makefile for Gramps
# We could use GNU make's ':=' syntax for nice wildcard use,
# but that is not necessarily portable.
# If not using GNU make, then list all .py files individually
pkgdatadir = $(datadir)/@PACKAGE@/utils
pkgdata_PYTHON = \
__init__.py \
dbutils.py
pkgpyexecdir = @pkgpyexecdir@/utils
pkgpythondir = @pkgpythondir@/utils
# Clean up all the byte-compiled files
MOSTLYCLEANFILES = *pyc *pyo
GRAMPS_PY_MODPATH = "../"
pycheck:
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
pychecker $(pkgdata_PYTHON));

24
src/gen/utils/__init__.py Normal file
View File

@ -0,0 +1,24 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
__version__ = "$Revision: $"
from dbutils import *