* 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> 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 * src/GrampsDb/_WriteXML.py (write_object): Check whether path is
empty before removing leading slash. empty before removing leading slash.
* src/GrampsDb/_WriteGedcom.py: Bring to new API. * src/GrampsDb/_WriteGedcom.py: Bring to new API.

View File

@ -58,8 +58,7 @@ except:
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import GrampsDb from GrampsDb import XmlWriter
import Utils
import Mime import Mime
import const import const
import QuestionDialog import QuestionDialog
@ -73,9 +72,9 @@ _title_string = _("Export to CD")
# writeData # writeData
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def writeData(database,filename,person,option_box=None): def writeData(database,filename,person,option_box=None,callback=None):
ret = 0 ret = 0
writer = PackageWriter(database,filename) writer = PackageWriter(database,filename,callback)
ret = writer.export() ret = writer.export()
return ret return ret
@ -86,10 +85,11 @@ def writeData(database,filename,person,option_box=None):
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class PackageWriter: class PackageWriter:
def __init__(self,database,filename="",cl=0): def __init__(self,database,filename="",cl=0,callback=None):
self.db = database self.db = database
self.cl = cl self.cl = cl
self.filename = filename self.filename = filename
self.callback = callback
def export(self): def export(self):
if self.cl: if self.cl:
@ -136,14 +136,13 @@ class PackageWriter:
# Write XML now # Write XML now
g = create('burn:///%s/data.gramps' % base,OPEN_WRITE ) 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) gfile.write_handle(g)
g.close() g.close()
def gui_run(self): def gui_run(self):
missmedia_action = 0 missmedia_action = 0
# base = os.path.basename(self.db.get_save_path())
base = os.path.basename(self.filename) base = os.path.basename(self.filename)
try: try:
@ -277,7 +276,7 @@ class PackageWriter:
# Write XML now # Write XML now
g = create('burn:///%s/data.gramps' % base,OPEN_WRITE ) 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) gfile.write_handle(g)
g.close() g.close()
os.system("nautilus --no-desktop burn:///") os.system("nautilus --no-desktop burn:///")

View File

@ -54,7 +54,7 @@ import gtk.glade
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from GrampsDb._WriteXML import XmlWriter from GrampsDb import XmlWriter
import Utils import Utils
from QuestionDialog import MissingMediaDialog from QuestionDialog import MissingMediaDialog
from PluginUtils import register_export from PluginUtils import register_export