0003796: Make export available when no GUI available. Patch from jmodule (Jakim Friant).
svn: r15294
This commit is contained in:
autogen.shconfigure.in
src
ExportAssistant.pyMakefile.am
Merge
PluginUtils
ReportBase
Makefile.am_Bibliography.py_CommandLineReport.py_Constants.py_DocReportDialog.py_DrawReportDialog.py_Endnotes.py_FileEntry.py_GraphvizReportDialog.py_PaperMenu.py_Report.py_ReportDialog.py_ReportOptions.py_ReportUtils.py_StyleComboBox.py_StyleEditor.py_TextReportDialog.py_WebReportDialog.py__init__.py
Simple
cli
gen
plug
gui
Makefile.am
plug
Makefile.am__init__.py_dialogs.py_guioptions.py_windows.py
viewmanager.pyreport
Makefile.am__init__.py_docreportdialog.py_drawreportdialog.py_fileentry.py_graphvizreportdialog.py_options.py_papermenu.py_reportdialog.py_stylecombobox.py_styleeditor.py_textreportdialog.py_webreportdialog.py
tool.pyplugins
BookReport.pyRecords.py
docgen
drawreport
export
ExportCsv.pyExportFtree.pyExportGedcom.pyExportGeneWeb.pyExportPkg.pyExportVCalendar.pyExportVCard.pyExportXml.py
gramplet
graph
lib
textreport
AncestorReport.pyBirthdayReport.pyCustomBookText.pyDescendReport.pyDetAncestralReport.pyDetDescendantReport.pyEndOfLineReport.pyFamilyGroup.pyIndivComplete.pyKinshipReport.pyMarkerReport.pyNumberOfAncestorsReport.pyPlaceReport.pySimpleBookTitle.pySummary.py
tool
ChangeNames.pyChangeTypes.pyCheck.pyDateParserDisplayTest.pyDesbrowser.pyDumpGenderStats.pyEval.pyEventCmp.pyEventNames.pyExtractCity.pyFindDupes.pyLeak.pyMediaManager.pyNotRelated.pyOwnerEditor.pyPatchNames.pyRebuild.pyRebuildRefMap.pyRelCalc.pyRemoveUnused.pyReorderIds.pySortEvents.pySoundGen.pyTestcaseGenerator.pyVerify.py
webreport
@ -5,6 +5,7 @@
|
||||
# Copyright (C) 2008 Brian G. Matherly
|
||||
# Copyright (C) 2008 Gary Burton
|
||||
# Copyright (C) 2008 Robert Cheramy <robert@cheramy.net>
|
||||
# Copyright (C) 2010 Jakim Friant
|
||||
#
|
||||
# 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
|
||||
@ -69,7 +70,7 @@ import constfunc
|
||||
# writeData
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def writeData(database, filename, option_box=None, callback=None):
|
||||
def writeData(database, filename, msg_callback, option_box=None, callback=None):
|
||||
|
||||
# Rename file, if it exists already, with <filename>.bak
|
||||
# as it it for normal XML export.
|
||||
@ -105,7 +106,7 @@ def writeData(database, filename, option_box=None, callback=None):
|
||||
if option_box.unlinked:
|
||||
database = gen.proxy.ReferencedProxyDb(database)
|
||||
|
||||
writer = PackageWriter(database, filename, callback)
|
||||
writer = PackageWriter(database, filename, msg_callback, callback)
|
||||
return writer.export()
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -115,9 +116,10 @@ def writeData(database, filename, option_box=None, callback=None):
|
||||
#-------------------------------------------------------------------------
|
||||
class PackageWriter(object):
|
||||
|
||||
def __init__(self, database, filename, callback=None):
|
||||
def __init__(self, database, filename, msg_callback, callback=None):
|
||||
self.db = database
|
||||
self.callback = callback
|
||||
self.msg_callback = msg_callback
|
||||
self.filename = filename
|
||||
|
||||
def export(self):
|
||||
@ -228,7 +230,7 @@ class PackageWriter(object):
|
||||
|
||||
# Write XML now
|
||||
g = StringIO()
|
||||
gfile = XmlWriter(self.db, self.callback, 2)
|
||||
gfile = XmlWriter(self.db, msg_callback, self.callback, 2)
|
||||
gfile.write_handle(g)
|
||||
tarinfo = tarfile.TarInfo('data.gramps')
|
||||
tarinfo.size = len(g.getvalue())
|
||||
|
Reference in New Issue
Block a user