2007-08-31 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_GrampsDbWriteXML.py: XML export fixes
	* src/GrampsDbUtils/_LivingProxyDb.py: XML export fixes
	* src/GrampsDbUtils/_WriteXML.py: XML export fixes
	* src/GrampsDbUtils/_ProxyDbBase.py: XML export fixes



svn: r8910
This commit is contained in:
Don Allingham
2007-08-31 22:51:16 +00:00
parent 1cac9ae4b7
commit ffcf7a5dd4
5 changed files with 64 additions and 24 deletions

View File

@@ -67,7 +67,7 @@ class LivingProxyDb(ProxyDbBase):
still consider them living.
@type years_after_death: int
"""
self.db = db
ProxyDbBase.__init__(self, db)
self.mode = mode
self.current_year = current_year
self.years_after_death = years_after_death

View File

@@ -46,6 +46,15 @@ class ProxyDbBase(DbBase):
Creates a new PrivateProxyDb instance.
"""
self.db = db
self.name_formats = db.name_formats
self.bookmarks = db.bookmarks
self.family_bookmarks = db.family_bookmarks
self.event_bookmarks = db.event_bookmarks
self.place_bookmarks = db.place_bookmarks
self.source_bookmarks = db.source_bookmarks
self.repo_bookmarks = db.repo_bookmarks
self.media_bookmarks = db.media_bookmarks
self.note_bookmarks = db.note_bookmarks
def is_open(self):
"""
@@ -99,7 +108,7 @@ class ProxyDbBase(DbBase):
"""
Returns the number of media objects currently in the databse.
"""
return len(self.get_object_handles())
return len(self.get_media_object_handles())
def get_number_of_repositories(self):
"""
@@ -428,3 +437,9 @@ class ProxyDbBase(DbBase):
> result_list = [i for i in find_backlink_handles(handle)]
"""
raise NotImplementedError
def get_gramps_ids(self, obj_key):
return self.db.get_gramps_ids(obj_key)
def has_gramps_id(self, obj_key, gramps_id):
return self.db.has_gramps_ids(obj_key, gramps_id)

View File

@@ -51,14 +51,16 @@ from QuestionDialog import ErrorDialog
from GrampsDb import GrampsDbXmlWriter, GrampsDbWriteFailure
from GrampsDb import exportData as _exportData
from GrampsDb import quick_write as _quick_write
import ExportOptions
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def exportData(database, filename, person, callback=None, version=const.version):
return _exportData(database, filename, person, version)
def exportData(database, filename, person, option_box, callback=None):
return _exportData(database, filename, person, option_box,
callback, const.version)
#-------------------------------------------------------------------------
#
@@ -103,7 +105,7 @@ _title = _('GRAMPS _XML database')
_description = _('The GRAMPS XML database is a format used by older '
'versions of GRAMPS. It is read-write compatible with '
'the present GRAMPS database format.')
_config = None
_config = (_('GRAMPS XML export options'), ExportOptions.WriterOptionBox)
_filename = 'gramps'
from PluginUtils import register_export