2007-09-05 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_GrampsDbFactories.py: XML direct load not supported
	* src/GrampsDb/Makefile.am: remove installation of GrampsXMLDB.py
	* src/GrampsDbUtils/_WriteXML.py: cleanup



svn: r8929
This commit is contained in:
Don Allingham
2007-09-05 22:34:47 +00:00
parent 4821bc4dea
commit 4899980e4c
4 changed files with 17 additions and 33 deletions

View File

@ -1,3 +1,8 @@
2007-09-05 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_GrampsDbFactories.py: XML direct load not supported
* src/GrampsDb/Makefile.am: remove installation of GrampsXMLDB.py
* src/GrampsDbUtils/_WriteXML.py: cleanup
2007-09-05 Zsolt Foldvari <zfoldvar@users.sourceforge.net> 2007-09-05 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
* src/docgen/GtkPrint.py: Some work on graphical reports. * src/docgen/GtkPrint.py: Some work on graphical reports.

View File

@ -20,7 +20,6 @@ pkgdata_PYTHON = \
_GrampsDbWriteXML.py \ _GrampsDbWriteXML.py \
_GrampsGEDDB.py\ _GrampsGEDDB.py\
_GrampsInMemDB.py\ _GrampsInMemDB.py\
_GrampsXMLDB.py\
_HelperFunctions.py\ _HelperFunctions.py\
__init__.py\ __init__.py\
_LongOpStatus.py\ _LongOpStatus.py\

View File

@ -64,9 +64,9 @@ def gramps_db_factory(db_type):
if db_type == const.app_gramps: if db_type == const.app_gramps:
from _GrampsBSDDB import GrampsBSDDB from _GrampsBSDDB import GrampsBSDDB
cls = GrampsBSDDB cls = GrampsBSDDB
elif db_type == const.app_gramps_xml: # elif db_type == const.app_gramps_xml:
from _GrampsXMLDB import GrampsXMLDB # from _GrampsXMLDB import GrampsXMLDB
cls = GrampsXMLDB # cls = GrampsXMLDB
elif db_type == const.app_gedcom: elif db_type == const.app_gedcom:
from _GrampsGEDDB import GrampsGEDDB from _GrampsGEDDB import GrampsGEDDB
cls = GrampsGEDDB cls = GrampsGEDDB

View File

@ -32,14 +32,6 @@ GRAMPS' XML file format.
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gettext import gettext as _ from gettext import gettext as _
#------------------------------------------------------------------------
#
# Set up logging
#
#------------------------------------------------------------------------
import logging
log = logging.getLogger(".WriteXML")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# load GRAMPS libraries # load GRAMPS libraries
@ -48,9 +40,7 @@ log = logging.getLogger(".WriteXML")
import const import const
from QuestionDialog import ErrorDialog from QuestionDialog import ErrorDialog
from GrampsDb import GrampsDbXmlWriter, GrampsDbWriteFailure import GrampsDb
from GrampsDb import exportData as _exportData
from GrampsDb import quick_write as _quick_write
import ExportOptions import ExportOptions
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -59,40 +49,30 @@ import ExportOptions
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def exportData(database, filename, person, option_box, callback=None): def exportData(database, filename, person, option_box, callback=None):
return _exportData(database, filename, person, option_box, return GrampsDb.exportData(database, filename, person, option_box,
callback, const.version) callback, const.version)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# # XmlWriter
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def quick_write(database, filename,callback=None,version=const.version): class XmlWriter(GramspDb.GrampsDbXmlWriter):
return _quick_write(database, filename, version)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
class XmlWriter(GrampsDbXmlWriter):
""" """
Writes a database to the XML file. Writes a database to the XML file.
""" """
def __init__(self, db, callback, strip_photos, compress=1): def __init__(self, db, callback, strip_photos, compress=1):
""" GrampsDb.GrampsDbXmlWriter.__init__(self, db, strip_photos, compress,
""" const.version, callback)
GrampsDbXmlWriter.__init__(self, db, strip_photos, compress,
const.version, callback)
def write(self,filename): def write(self,filename):
""" """
Write the database to the specified file. Write the database to the specified file.
""" """
try: try:
ret = GrampsDbXmlWriter.write(self, filename) ret = GramspDb.GrampsDbXmlWriter.write(self, filename)
except GrampsDbWriteFailure, val: except GrampsDb.GrampsDbWriteFailure, val:
ErrorDialog(val[0],val[1]) ErrorDialog(val[0],val[1])
return ret return ret