diff --git a/ChangeLog b/ChangeLog index 704c53f0c..0eb5b7992 100644 --- a/ChangeLog +++ b/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/src/plugins/WriteCD.py b/src/plugins/WriteCD.py index b63bb8fdb..03208b6a9 100644 --- a/src/plugins/WriteCD.py +++ b/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/src/plugins/WritePkg.py b/src/plugins/WritePkg.py index 0f61c0d7f..36b2b106a 100644 --- a/src/plugins/WritePkg.py +++ b/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