diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 8a2fa0963..f92468e67 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -16,6 +16,17 @@ * src/plugins/ImportGeneWeb.py: Comment out debugging messages. * src/plugins/WriteGeneWeb.py: Support for command-line export. + * doc/gramps-manual/C/usage.xml: Update. + * doc/gramps-manual/C/gramps-manual.xml: Chunk to depth 3. + * doc/gramps-manual/C/figures/gedcom-export.png: Update. + * doc/gramps-manual/C/figures/export-druid.png: Add figure. + * src/Exporter.py: Change labels, support CD export (lame). + * src/WriteGedcom.py: Correct label. + * src/WriteXML.py: Return status on success. + * src/plugins/WriteCD.py: Support for wizard (lame). + * src/plugins/WritePkg.py: Correct label. + * src/ArgHandler.py: Re-enable CD export. + 2005-02-18 Don Allingham * src/EditPerson.py: more readonly patches * src/EventEdit.py: more readonly patches diff --git a/gramps2/doc/gramps-manual/C/figures/export-druid.png b/gramps2/doc/gramps-manual/C/figures/export-druid.png new file mode 100644 index 000000000..a8f645e86 Binary files /dev/null and b/gramps2/doc/gramps-manual/C/figures/export-druid.png differ diff --git a/gramps2/doc/gramps-manual/C/figures/gedcom-export.png b/gramps2/doc/gramps-manual/C/figures/gedcom-export.png index 494000951..d760f5364 100644 Binary files a/gramps2/doc/gramps-manual/C/figures/gedcom-export.png and b/gramps2/doc/gramps-manual/C/figures/gedcom-export.png differ diff --git a/gramps2/doc/gramps-manual/C/gramps-manual.xml b/gramps2/doc/gramps-manual/C/gramps-manual.xml index aecc203ae..28dd7a4aa 100644 --- a/gramps2/doc/gramps-manual/C/gramps-manual.xml +++ b/gramps2/doc/gramps-manual/C/gramps-manual.xml @@ -1,5 +1,5 @@ - + -
- Export GEDCOM File dialog +
+ Export druid: format selection + fileref="figures/export-druid.png" format="PNG"/> - Shows Export GEDCOM File dialog + Shows format selection page of an Export druid
- - Type the desired GEDCOM filename into the text entry box or - click the Browse... button to evoke the - Save File dialog. + + GEDCOM export + + GEDCOM export options allow you to fine tune your export + (see ). Choose the desired Encoding of the exported file. Use the Filter pop-up menu to limit the scope of the export according to the stated rule. @@ -325,19 +330,51 @@ images when writing image references in GEDCOM. - Upon starting the export, &app; will - display the following GEDCOM export progress window with the - progressbars reflecting the current state of exporting. - -
- Export GEDCOM progress dialog +
+ Export druid: GEDCOM options + fileref="figures/gedcom-export.png" format="PNG"/> - Shows Export GEDCOM progress dialog. + Shows GEDCOM options page of an Export druid
+ + + + &app; database (grdb) export + Exporting to the native format will simply make a copy + of your data under another name. It also may be useful if you have + directly opened XML or GEDCOM file and would like to save it + as the grdb file. + + + + &app; XML database export + Exporting into &app; XML format will + produce a database compatible with the previous versions of &app;. + As XML is a text-based human-readable format, you may also use it + to take a look at your data. + + + + + Export to CD + Exporting to CD will prepare you database directory with all its + contents to be recorded to the CD. This is done through the + burn:/// location in Nautilus. After exporting to + CD, go to the burn:/// location by + selecting Go + CD Creator in Nautilus menu + (unless this location is already displayed by &app;). Your + database directory will show up. To record it onto the CD, click the CD + icon on the Nautilus toolbar, or select File + Write to CD in Nautilus menu. + + + + + &app; package export Exporting to &app; package will create a gzip-compressed tar archive (also known as tarball) which contains gramps database, all @@ -346,13 +383,25 @@ it with somebody, while retaining all the features provided by &app;. - + + + + Web Family Tree export Exporting to Web Family Tree will create the text file suitable - as an input for the WFT program. Use the Filter - pop-up menu to limit the scope of the export according to the stated rule. - Check Restrict data on living people to limit living + as an input for the WFT program. Specific options include filter selecton + and the ability to restrict data on living people, that is to limit living people's data to family ties. + + + + GeneWeb export + Exporting to GeneWeb will save a copy of your data into + a popular web genealogy format. To find out more about GeneWeb + and its format, visit this site. + + If a media file is not found during export, the following dialog will prompt you for the possible actions: diff --git a/gramps2/src/ArgHandler.py b/gramps2/src/ArgHandler.py index 502ec68b0..126f43e23 100644 --- a/gramps2/src/ArgHandler.py +++ b/gramps2/src/ArgHandler.py @@ -521,13 +521,13 @@ class ArgHandler: print "Error creating %s" % filename os._exit(1) elif format == 'iso': - print "\tISO format is temporarily disabled." - #import WriteCD - #try: - # WriteCD.PackageWriter(self.parent.db,1,filename) - #except: - # print "Error exporting %s" % filename - # os._exit(1) + import WriteCD + try: + writer = WriteCD.PackageWriter(self.parent.db,filename,1) + ret = writer.export() + except: + print "Error exporting %s" % filename + os._exit(1) elif format == 'wft': import WriteFtree try: diff --git a/gramps2/src/Exporter.py b/gramps2/src/Exporter.py index 4bd67cb48..ab7d10532 100644 --- a/gramps2/src/Exporter.py +++ b/gramps2/src/Exporter.py @@ -93,6 +93,7 @@ class Exporter: self.d = Druid() self.w.add(self.d) + self.w.set_title(_('GRAMPS: Export')) self.d.add(self.build_info_page()) self.d.add(self.build_format_page()) self.file_sel_page = self.build_file_sel_page() @@ -314,6 +315,7 @@ class Exporter: p.set_logo(self.logo) self.chooser = gtk.FileChooserWidget(gtk.FILE_CHOOSER_ACTION_SAVE) + self.chooser.set_local_only(gtk.FALSE) p.append_item("",self.chooser,"") # Dirty hack to enable proper EXPAND and FILL properties of the chooser parent = self.chooser.get_parent() @@ -339,6 +341,8 @@ class Exporter: if ext == 'gramps': new_filename = os.path.expanduser(default_dir + 'data.gramps') + elif ext == 'burn': + new_filename = os.path.basename(self.parent.db.get_save_path()) else: new_filename = Utils.get_new_filename(ext,default_dir) self.chooser.set_current_folder(default_dir) diff --git a/gramps2/src/WriteGedcom.py b/gramps2/src/WriteGedcom.py index 452f35c5d..06216c018 100644 --- a/gramps2/src/WriteGedcom.py +++ b/gramps2/src/WriteGedcom.py @@ -1235,10 +1235,9 @@ def exportData(database,filename,person,option_box): # # #------------------------------------------------------------------------- -_title = _('GE_DCOM 5.5') +_title = _('GE_DCOM') _description = _('GEDCOM is used to transfer data between genealogy programs. ' 'Most genealogy software will accept a GEDCOM file as input. ') -#option_box = GedcomWriterOptionBox() _config = (_('GEDCOM export options'),GedcomWriterOptionBox) _filename = 'ged' diff --git a/gramps2/src/WriteXML.py b/gramps2/src/WriteXML.py index a5b06c45f..15f39c331 100644 --- a/gramps2/src/WriteXML.py +++ b/gramps2/src/WriteXML.py @@ -192,6 +192,7 @@ class XmlWriter: self.write_xml_data() g.close() + return 1 def write_xml_data(self): diff --git a/gramps2/src/plugins/WriteCD.py b/gramps2/src/plugins/WriteCD.py index 58ec04f1e..4271edfd9 100644 --- a/gramps2/src/plugins/WriteCD.py +++ b/gramps2/src/plugins/WriteCD.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2004 Donald N. Allingham +# Copyright (C) 2000-2005 Donald N. Allingham # # 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 @@ -29,6 +29,7 @@ #------------------------------------------------------------------------- import os from cStringIO import StringIO +from gettext import gettext as _ #------------------------------------------------------------------------- # @@ -56,8 +57,6 @@ import const import QuestionDialog import ImgManip -from gettext import gettext as _ - _title_string = _("Export to CD") #------------------------------------------------------------------------- @@ -65,12 +64,15 @@ _title_string = _("Export to CD") # writeData # #------------------------------------------------------------------------- -def writeData(database,person): +def writeData(database,filename,person,option_box=None): + ret = 0 try: - PackageWriter(database) + writer = PackageWriter(database,filename) + ret = writer.export() except: import DisplayTrace DisplayTrace.DisplayTrace() + return ret #------------------------------------------------------------------------- # @@ -79,56 +81,19 @@ def writeData(database,person): #------------------------------------------------------------------------- class PackageWriter: - def __init__(self,database,cl=0,name=""): + def __init__(self,database,filename="",cl=0): self.db = database self.cl = cl - self.name = name - + self.filename = filename + + def export(self): if self.cl: - self.cl_run() + self.cl_run() else: - base = os.path.dirname(__file__) - glade_file = "%s/%s" % (base,"cdexport.glade") - - dic = { - "destroy_passed_object" : Utils.destroy_passed_object, - "on_ok_clicked" : self.on_ok_clicked, - "on_help_clicked" : self.on_help_clicked - } - - self.top = gtk.glade.XML(glade_file,"packageExport","gramps") + self.gui_run() - Utils.set_titles(self.top.get_widget('packageExport'), - self.top.get_widget('title'),_title_string) - - self.top.signal_autoconnect(dic) - self.top.get_widget("packageExport").show() - - def copy_file(self,src,dest): - original = open(src,"r") - destobj = URI(dest) - target = create(destobj,OPEN_WRITE) - done = 0 - while 1: - buf = original.read(2048) - if buf == '': - break - else: - target.write(buf) - target.close() - original.close() - - def make_thumbnail(self,dbname,root,path): - img = ImgManip.ImgManip(path) - data = img.jpg_scale_data(const.thumbScale,const.thumbScale) - - uri = URI('burn:///%s/.thumb/%s.jpg' % (dbname,root)) - th = create(uri,OPEN_WRITE) - th.write(data) - th.close() - def cl_run(self): - base = os.path.basename(self.name) + base = os.path.basename(self.filename) try: uri = URI('burn:///%s' % base) @@ -168,15 +133,11 @@ class PackageWriter: gfile.write_handle(g) g.close() - def on_help_clicked(self,obj): - """Display the relevant portion of GRAMPS manual""" - gnome.help_display('gramps-manual','export-data') - - def on_ok_clicked(self,obj): - Utils.destroy_passed_object(obj) + def gui_run(self): missmedia_action = 0 - base = os.path.basename(self.db.get_save_path()) +# base = os.path.basename(self.db.get_save_path()) + base = os.path.basename(self.filename) try: uri = URI('burn:///%s' % base) @@ -261,10 +222,10 @@ class PackageWriter: newfile = fs_top.get_filename() if os.path.isfile(newfile): self.copy_file(newfile,'burn:///%s/%s' % (base,obase)) - ntype = GrampsMime.get_type(newfile) - if ntype[0:5] == "image": + ntype = GrampsMime.get_type(newfile) + if ntype[0:5] == "image": self.make_thumbnail(base,obase,newfile) - + fs_top = gtk.FileSelection("%s - GRAMPS" % _("Select file")) fs_top.hide_fileop_buttons() fs_top.ok_button.connect('clicked',fs_ok_clicked) @@ -290,7 +251,7 @@ class PackageWriter: self.object_handle = obj.get_handle() if missmedia_action == 0: mmd = QuestionDialog.MissingMediaDialog(_("Media object could not be found"), - _("%(file_name)s is referenced in the database, but no longer exists. " + _("%(file_name)s is referenced in the database, but no longer exists. " "The file may have been deleted or moved to a different location. " "You may choose to either remove the reference from the database, " "keep the reference to the missing file, or select a new file." @@ -310,12 +271,43 @@ class PackageWriter: gfile.write_handle(g) g.close() os.system("nautilus --no-desktop burn:///") - + return 1 + + def copy_file(self,src,dest): + original = open(src,"r") + destobj = URI(dest) + target = create(destobj,OPEN_WRITE) + done = 0 + while 1: + buf = original.read(2048) + if buf == '': + break + else: + target.write(buf) + target.close() + original.close() + + def make_thumbnail(self,dbname,root,path): + img = ImgManip.ImgManip(path) + data = img.jpg_scale_data(const.thumbScale,const.thumbScale) + + uri = URI('burn:///%s/.thumb/%s.jpg' % (dbname,root)) + th = create(uri,OPEN_WRITE) + th.write(data) + th.close() + #------------------------------------------------------------------------- # # Register the plugin # #------------------------------------------------------------------------- -from PluginMgr import register_export +_title = _('Export to CD (p_ortable XML)') +_description = _('Exporting to CD copies all your data and media ' + 'object files to the CD Creator. You may later burn the CD ' + 'with this data, and that copy will be completely portable ' + 'across different machines and binary architectures.') +_config = None +_filename = 'burn' -register_export(writeData,_title_string) +from PluginMgr import register_export +register_export(writeData,_title,_description,_config,_filename) diff --git a/gramps2/src/plugins/WritePkg.py b/gramps2/src/plugins/WritePkg.py index 07c9b71e6..7ce8feb6c 100644 --- a/gramps2/src/plugins/WritePkg.py +++ b/gramps2/src/plugins/WritePkg.py @@ -199,7 +199,7 @@ class PackageWriter: # Register the plugin # #------------------------------------------------------------------------- -_title = _('GRAM_PS package') +_title = _('GRAM_PS package (portable XML)') _description = _('GRAMPS package is an archived XML database together with the media object files.') _config = None _filename = 'gpkg'