From 710eb4cc1328f612c992e7b25065d3f6c1e3e9fb Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Tue, 9 May 2006 22:00:07 +0000 Subject: [PATCH] * src/plugins/WriteCD.py: Correctly import XmlWriter. svn: r6599 --- gramps2/ChangeLog | 1 + gramps2/src/plugins/WriteCD.py | 15 +++++++-------- gramps2/src/plugins/WritePkg.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 704c53f0c..0eb5b7992 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,5 @@ 2006-05-09 Alex Roitman + * src/plugins/WriteCD.py: Correctly import XmlWriter. * src/GrampsDb/_WriteXML.py (write_object): Check whether path is empty before removing leading slash. * src/GrampsDb/_WriteGedcom.py: Bring to new API. diff --git a/gramps2/src/plugins/WriteCD.py b/gramps2/src/plugins/WriteCD.py index b63bb8fdb..03208b6a9 100644 --- a/gramps2/src/plugins/WriteCD.py +++ b/gramps2/src/plugins/WriteCD.py @@ -58,8 +58,7 @@ except: # GRAMPS modules # #------------------------------------------------------------------------- -import GrampsDb -import Utils +from GrampsDb import XmlWriter import Mime import const import QuestionDialog @@ -73,9 +72,9 @@ _title_string = _("Export to CD") # writeData # #------------------------------------------------------------------------- -def writeData(database,filename,person,option_box=None): +def writeData(database,filename,person,option_box=None,callback=None): ret = 0 - writer = PackageWriter(database,filename) + writer = PackageWriter(database,filename,callback) ret = writer.export() return ret @@ -86,10 +85,11 @@ def writeData(database,filename,person,option_box=None): #------------------------------------------------------------------------- class PackageWriter: - def __init__(self,database,filename="",cl=0): + def __init__(self,database,filename="",cl=0,callback=None): self.db = database self.cl = cl self.filename = filename + self.callback = callback def export(self): if self.cl: @@ -136,14 +136,13 @@ class PackageWriter: # Write XML now g = create('burn:///%s/data.gramps' % base,OPEN_WRITE ) - gfile = GrampsDb.XmlWriter(self.db,None,1) + gfile = XmlWriter(self.db,None,2) gfile.write_handle(g) g.close() def gui_run(self): missmedia_action = 0 -# base = os.path.basename(self.db.get_save_path()) base = os.path.basename(self.filename) try: @@ -277,7 +276,7 @@ class PackageWriter: # Write XML now g = create('burn:///%s/data.gramps' % base,OPEN_WRITE ) - gfile = WriteXML.XmlWriter(self.db,None,1) + gfile = XmlWriter(self.db,self.callback,2) gfile.write_handle(g) g.close() os.system("nautilus --no-desktop burn:///") diff --git a/gramps2/src/plugins/WritePkg.py b/gramps2/src/plugins/WritePkg.py index 0f61c0d7f..36b2b106a 100644 --- a/gramps2/src/plugins/WritePkg.py +++ b/gramps2/src/plugins/WritePkg.py @@ -54,7 +54,7 @@ import gtk.glade # GRAMPS modules # #------------------------------------------------------------------------- -from GrampsDb._WriteXML import XmlWriter +from GrampsDb import XmlWriter import Utils from QuestionDialog import MissingMediaDialog from PluginUtils import register_export