* src/plugins/WriteCD.py: Correctly import XmlWriter.

svn: r6599
This commit is contained in:
Alex Roitman 2006-05-09 22:00:07 +00:00
parent c50c23de4d
commit 710eb4cc13
3 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,5 @@
2006-05-09 Alex Roitman <shura@gramps-project.org>
* 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.

View File

@ -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:///")

View File

@ -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