2007-02-04 01:38:41 +05:30
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
2007-02-20 06:09:10 +05:30
|
|
|
# Copyright (C) 2004-2007 Donald N. Allingham
|
2007-02-04 01:38:41 +05:30
|
|
|
#
|
|
|
|
# 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
|
|
|
|
#
|
|
|
|
|
2008-01-22 15:47:42 +05:30
|
|
|
# $Id$
|
2007-02-04 01:38:41 +05:30
|
|
|
|
2009-09-01 00:12:29 +05:30
|
|
|
"""
|
|
|
|
Declare constants used by database modules
|
|
|
|
"""
|
|
|
|
|
2007-02-20 06:09:10 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# standard python modules
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2007-02-03 22:41:05 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# constants
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2009-09-01 00:12:29 +05:30
|
|
|
__all__ = (
|
|
|
|
('DBPAGE', 'DBMODE', 'DBCACHE', 'DBLOCKS', 'DBOBJECTS', 'DBUNDO',
|
|
|
|
'DBEXT', 'DBMODE_R', 'DBMODE_W', 'DBUNDOFN', 'DBLOCKFN',
|
|
|
|
'DBRECOVFN', 'DBLOGNAME', 'DBFLAGS_O', 'DBFLAGS_R', 'DBFLAGS_D',
|
|
|
|
) +
|
|
|
|
|
|
|
|
('PERSON_KEY', 'FAMILY_KEY', 'SOURCE_KEY', 'EVENT_KEY',
|
|
|
|
'MEDIA_KEY', 'PLACE_KEY', 'REPOSITORY_KEY', 'NOTE_KEY',
|
|
|
|
'REFERENCE_KEY', 'PERSON_COL_KEY', 'FAMILY_COL_KEY',
|
|
|
|
'CHILD_COL_KEY'
|
|
|
|
) +
|
|
|
|
|
|
|
|
('PERSON_COL_KEY', 'FAMILY_COL_KEY', 'CHILD_COL_KEY',
|
|
|
|
'PLACE_COL_KEY', 'SOURCE_COL_KEY', 'MEDIA_COL_KEY',
|
|
|
|
'EVENT_COL_KEY', 'REPOSITORY_COL_KEY', 'NOTE_COL_KEY'
|
|
|
|
) +
|
|
|
|
|
|
|
|
('TXNADD', 'TXNUPD', 'TXNDEL')
|
|
|
|
)
|
|
|
|
|
|
|
|
DBEXT = ".db" # File extension to be used for database files
|
|
|
|
DBUNDOFN = "undo.db" # File name of 'undo' database
|
|
|
|
DBLOCKFN = "lock" # File name of lock file
|
|
|
|
DBRECOVFN = "need_recover" # File name of recovery file
|
|
|
|
DBLOGNAME = ".GrampsDb" # Name of logger
|
|
|
|
DBMODE_R = "r" # Read-only access
|
|
|
|
DBMODE_W = "w" # Full Reaw/Write access
|
|
|
|
DBPAGE = 16384 # Size of the pages used to hold items in the database
|
|
|
|
DBMODE = 0666 # Unix mode for database creation
|
|
|
|
DBCACHE = 0x4000000 # Size of the shared memory buffer pool
|
|
|
|
DBLOCKS = 25000 # Maximum number of locks supported
|
|
|
|
DBOBJECTS = 25000 # Maximum number of simultaneously locked objects
|
|
|
|
DBUNDO = 1000 # Maximum size of undo buffer
|
|
|
|
|
|
|
|
from bsddb.db import DB_CREATE, DB_AUTO_COMMIT, DB_DUP, DB_DUPSORT, DB_RDONLY
|
|
|
|
DBFLAGS_O = DB_CREATE | DB_AUTO_COMMIT # Default flags for database open
|
|
|
|
DBFLAGS_R = DB_RDONLY # Flags to open a database read-only
|
|
|
|
DBFLAGS_D = DB_DUP | DB_DUPSORT # Default flags for duplicate keys
|
2007-02-03 22:41:05 +05:30
|
|
|
|
|
|
|
PERSON_KEY = 0
|
|
|
|
FAMILY_KEY = 1
|
|
|
|
SOURCE_KEY = 2
|
|
|
|
EVENT_KEY = 3
|
|
|
|
MEDIA_KEY = 4
|
|
|
|
PLACE_KEY = 5
|
|
|
|
REPOSITORY_KEY = 6
|
|
|
|
REFERENCE_KEY = 7
|
2007-02-20 06:09:10 +05:30
|
|
|
NOTE_KEY = 8
|
2007-02-03 22:41:05 +05:30
|
|
|
|
2009-12-05 12:22:53 +05:30
|
|
|
PERSON_COL_KEY = 'person-view.columns'
|
|
|
|
CHILD_COL_KEY = 'child-view.columns'
|
|
|
|
PLACE_COL_KEY = 'place-view.columns'
|
|
|
|
SOURCE_COL_KEY = 'source-view.columns'
|
|
|
|
MEDIA_COL_KEY = 'media-view.columns'
|
|
|
|
REPOSITORY_COL_KEY = 'repository-view.columns'
|
|
|
|
EVENT_COL_KEY = 'event-view.columns'
|
|
|
|
FAMILY_COL_KEY = 'family-view.columns'
|
|
|
|
NOTE_COL_KEY = 'note-view.columns'
|
2009-09-01 00:12:29 +05:30
|
|
|
|
|
|
|
TXNADD, TXNUPD, TXNDEL = 0, 1, 2
|