* src/gramps_main.py (on_export_activate): Delegate work

to DbPrompter.
* src/WriteXML.py: Register with the new scheme.
* src/DbPrompter.py (SaveAsDbPrompter): Add class.


svn: r3246
This commit is contained in:
Alex Roitman
2004-07-01 04:09:55 +00:00
parent 7592aa4d62
commit 99d6b38312
4 changed files with 114 additions and 54 deletions

View File

@ -36,6 +36,13 @@ import shutil
import os
import codecs
#-------------------------------------------------------------------------
#
# load gtk libraries
#
#-------------------------------------------------------------------------
import gtk
#-------------------------------------------------------------------------
#
# load GRAMPS libraries
@ -66,7 +73,7 @@ except:
#
#
#-------------------------------------------------------------------------
def exportData(database, filename, callback):
def exportData(database, filename, callback=None):
if os.path.isfile(filename):
try:
shutil.copyfile(filename, filename + ".bak")
@ -74,7 +81,7 @@ def exportData(database, filename, callback):
except:
pass
compress = GrampsCfg.uncompress == 0 and _gzip_ok == 1
compress = _gzip_ok == 1
try:
g = XmlWriter(database,callback,0,compress)
@ -798,3 +805,17 @@ def conf_priv(obj):
return ' priv="%d"' % obj.get_privacy()
else:
return ''
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
_mime_type = 'data.gramps'
_filter = gtk.FileFilter()
_filter.set_name(_('GRAMPS XML databases'))
_filter.add_pattern(_mime_type)
_ext_list = '.gramps'
from Plugins import register_export
register_export(exportData,_filter,_ext_list)