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

* various: create gen package, move proxy files to this library



svn: r9066
This commit is contained in:
Don Allingham 2007-10-03 17:14:26 +00:00
parent ca5a7367e2
commit dc8b47a270
16 changed files with 39 additions and 58 deletions

View File

@ -1,3 +1,6 @@
2007-10-03 Don Allingham <don@gramps-project.org>
* various: create gen package, move proxy files to this library
2007-10-03 Benny Malengier <benny.malengier@gramps-project.org>
* src/DataViews/_PedigreeView.py: correctly load bookmarks, issue 1271
* src/DataViews/_RelationView.py: correctly load bookmarks, issue 1271

View File

@ -113,31 +113,6 @@ then
fi
AC_MSG_RESULT($has_pygnome)
AC_MSG_CHECKING(Python bindings for gnome vfs)
cat > conftest.py <<EOF
$pygtk_require
try:
# Do not import gnome.vfs, this can raise a RuntimeError if the
# display cannot be opened. Just search it.
import imp
imp.find_module('gnome/vfs')
out("gnome.vfs")
except ImportError:
imp.find_module('gnomevfs')
out("gnomevfs")
except:
out("NO")
EOF
$PYTHON conftest.py
has_vfs=`cat conftest.out`
rm -f conftest.out conftest.py
if test NO = "$has_vfs"
then
AC_MSG_ERROR([
**** The python bindings for GNOME VFS (gnome2-python-vfs) could not be found.])
fi
AC_MSG_RESULT($has_vfs)
AC_MSG_CHECKING(Python bindings for glade)
cat > conftest.py <<EOF
$pygtk_require
@ -202,6 +177,8 @@ src/PluginUtils/Makefile
src/ReportBase/Makefile
src/plugins/Makefile
src/DateHandler/Makefile
src/gen/Makefile
src/gen/proxy/Makefile
src/data/Makefile
src/data/templates/Makefile
src/glade/Makefile

View File

@ -213,9 +213,6 @@ src/GrampsDbUtils/_GedcomStageOne.py
src/GrampsDbUtils/_GedcomParse.py
src/GrampsDbUtils/_GedcomTokens.py
src/GrampsDbUtils/_GrampsDbWRFactories.py
src/GrampsDbUtils/_LivingProxyDb.py
src/GrampsDbUtils/_PrivateProxyDb.py
src/GrampsDbUtils/_ProxyDbBase.py
src/GrampsDbUtils/_ReadGedcom.py
src/GrampsDbUtils/_ReadXML.py
src/GrampsDbUtils/_WriteGedcom.py
@ -223,6 +220,13 @@ src/GrampsDbUtils/_WriteGrdb.py
src/GrampsDbUtils/_WriteXML.py
src/GrampsDbUtils/__init__.py
# gen/proxy
src/gen/proxy/livingproxy.py
src/gen/proxy/privateproxy.py
src/gen/proxy/proxybase.py
src/gen/proxy/dbbase.py
src/gen/proxy/__init__.py
# GrampsLocale package
src/GrampsLocale/_GrampsLocale.py

View File

@ -8,7 +8,6 @@ pkgdatadir = $(datadir)/@PACKAGE@/GrampsDb
pkgdata_PYTHON = \
_CursorIterator.py \
_DbUtils.py \
_DbBase.py \
_GrampsBSDDB.py\
_GrampsCursor.py\
_GrampsDbBase.py\

View File

@ -61,6 +61,8 @@ from _GrampsDbConst import \
from _GrampsDbExceptions import *
from _LongOpStatus import LongOpStatus
import gen.proxy
#-------------------------------------------------------------------------
#
# Attempt to load the GZIP library. Some version of python do not seem
@ -105,16 +107,14 @@ def exportData(database, filename, person, option_box, callback, version="unknow
private = option_box.private
if private:
from GrampsDbUtils._PrivateProxyDb import PrivateProxyDb
database = PrivateProxyDb(database)
database = gen.proxy.PrivateProxyDb(database)
if restrict:
from GrampsDbUtils._LivingProxyDb import LivingProxyDb
database = LivingProxyDb(database, LivingProxyDb.MODE_RESTRICT)
database = gen.proxy.LivingProxyDb(
database, gen.proxy.LivingProxyDb.MODE_RESTRICT)
if not option_box.cfilter.is_empty():
from GrampsDbUtils._FilterProxyDb import FilterProxyDb
database = FilterProxyDb(database, option_box.cfilter)
database = gen.proxy.FilterProxyDb(database, option_box.cfilter)
g = GrampsDbXmlWriter(database, 0, compress, version, callback)
ret = g.write(filename)

View File

@ -16,9 +16,6 @@ pkgdata_PYTHON = \
_GedcomUtils.py\
_GrampsDbWRFactories.py\
__init__.py\
_LivingProxyDb.py\
_PrivateProxyDb.py\
_ProxyDbBase.py\
_ReadGedcom.py\
_ReadXML.py\
_WriteGedcom.py\

View File

@ -41,6 +41,7 @@ import _GedcomInfo as GedcomInfo
import Errors
import ExportOptions
import BasicUtils
import gen.proxy
from QuestionDialog import ErrorDialog
#-------------------------------------------------------------------------
@ -290,20 +291,18 @@ class GedcomWriter(BasicUtils.UpdateCallback):
# If the private flag is set, apply the PrivateProxyDb
if option_box.private:
from _PrivateProxyDb import PrivateProxyDb
self.dbase = PrivateProxyDb(self.dbase)
self.dbase = gen.proxy.PrivateProxyDb(self.dbase)
# If the restrict flag is set, apply the LivingProxyDb
if option_box.restrict:
from _LivingProxyDb import LivingProxyDb
self.dbase = LivingProxyDb(self.dbase,
LivingProxyDb.MODE_RESTRICT)
self.dbase = gen.proxy.LivingProxyDb(
self.dbase, gen.proxy.LivingProxyDb.MODE_RESTRICT)
# If the filter returned by cfilter is not empty, apply the
# FilterProxyDb
if not option_box.cfilter.is_empty():
from _FilterProxyDb import FilterProxyDb
self.dbase = FilterProxyDb(self.dbase, option_box.cfilter)
self.dbase = gen.proxy.FilterProxyDb(
self.dbase, option_box.cfilter)
def write_gedcom_file(self, filename):
"""

View File

@ -35,6 +35,7 @@ on using these factories see the _GrampsDbUtilsFactories.py file comments.
"""
__version__ = "$Revision$"
from _GrampsDbWRFactories import \
gramps_db_writer_factory, \
@ -48,6 +49,6 @@ from _WriteXML import XmlWriter
import _Backup as Backup
from _PrivateProxyDb import PrivateProxyDb
from _LivingProxyDb import LivingProxyDb
#from _PrivateProxyDb import PrivateProxyDb
#from _LivingProxyDb import LivingProxyDb

View File

@ -9,6 +9,7 @@ SUBDIRS = \
Editors \
Filters \
FilterEditor \
gen \
GrampsDb \
GrampsDbUtils \
GrampsLocale \

View File

@ -33,7 +33,7 @@ __revision__ = "$Revision: 8864 $"
#
#-------------------------------------------------------------------------
from RelLib import *
from _ProxyDbBase import ProxyDbBase
from proxybase import ProxyDbBase
class FilterProxyDb(ProxyDbBase):
"""

View File

@ -32,7 +32,7 @@ __revision__ = "$Revision$"
# GRAMPS libraries
#
#-------------------------------------------------------------------------
from _ProxyDbBase import ProxyDbBase
from proxybase import ProxyDbBase
from RelLib import *
from Utils import probably_alive

View File

@ -33,7 +33,7 @@ __revision__ = "$Revision$"
#
#-------------------------------------------------------------------------
from RelLib import *
from _ProxyDbBase import ProxyDbBase
from proxybase import ProxyDbBase
class PrivateProxyDb(ProxyDbBase):
"""

View File

@ -32,7 +32,7 @@ __revision__ = "$Revision: 8864 $"
# GRAMPS libraries
#
#-------------------------------------------------------------------------
from GrampsDb import DbBase
from dbbase import DbBase
class ProxyDbBase(DbBase):
"""

View File

@ -82,7 +82,8 @@ from QuestionDialog import ErrorDialog, WarningDialog
from BasicUtils import name_displayer as _nd
from DateHandler import displayer as _dd
from DateHandler import parser as _dp
from GrampsDbUtils import PrivateProxyDb, LivingProxyDb
from gen.proxy import PrivateProxyDb
from gen.proxy import LivingProxyDb
#------------------------------------------------------------------------
#

View File

@ -35,6 +35,7 @@ from cStringIO import StringIO
from gettext import gettext as _
import ExportOptions
from BasicUtils import UpdateCallback
import gen.proxy
#------------------------------------------------------------------------
#
@ -76,16 +77,14 @@ def writeData(database, filename, person, option_box, callback=None):
private = option_box.private
if private:
from GrampsDbUtils._PrivateProxyDb import PrivateProxyDb
database = PrivateProxyDb(database)
database = gen.proxy.PrivateProxyDb(database)
if restrict:
from GrampsDbUtils._LivingProxyDb import LivingProxyDb
database = LivingProxyDb(database, LivingProxyDb.MODE_RESTRICT)
database = gen.proxy.LivingProxyDb(
database, gen.proxy.LivingProxyDb.MODE_RESTRICT)
if not option_box.cfilter.is_empty():
from GrampsDbUtils._FilterProxyDb import FilterProxyDb
database = FilterProxyDb(database, option_box.cfilter)
database = gen.proxy.FilterProxyDb(database, option_box.cfilter)
writer = PackageWriter(database, filename, callback)