* 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.


svn: r4059
This commit is contained in:
Alex Roitman 2005-02-19 22:33:24 +00:00
parent c722d6bc86
commit 94abe8583c
11 changed files with 166 additions and 110 deletions

View File

@ -16,6 +16,17 @@
* src/plugins/ImportGeneWeb.py: Comment out debugging messages. * src/plugins/ImportGeneWeb.py: Comment out debugging messages.
* src/plugins/WriteGeneWeb.py: Support for command-line export. * 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 <dallingham@users.sourceforge.net> 2005-02-18 Don Allingham <dallingham@users.sourceforge.net>
* src/EditPerson.py: more readonly patches * src/EditPerson.py: more readonly patches
* src/EventEdit.py: more readonly patches * src/EventEdit.py: more readonly patches

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<?yelp:chunk-depth 3?>
<!-- <!--
User Manual for Gramps - a GTK+/GNOME based genealogy program User Manual for Gramps - a GTK+/GNOME based genealogy program

View File

@ -276,38 +276,43 @@
<para>Exporting allows you to share any portion of your &app; database <para>Exporting allows you to share any portion of your &app; database
with other researchers as well as to make your database completely with other researchers as well as to make your database completely
portable to another computer. Currently, &app; portable to another computer. Currently, &app;
can export data to four different formats: CD, GEDCOM, &app; package, can export data to the following formats: &app; database (grdb), &app; XML,
and Web Family Tree. All of these are available as items of GEDCOM, &app; package, Web Family Tree, and GeneWeb.</para>
<menuchoice><guimenu>File</guimenu>
<guisubmenu>Export</guisubmenu></menuchoice> submenu.</para> <note id="export-note"><title>Export is saving a copy</title>
<para>Exporting will create another file with the copy of your data.
The database currently opened in your &app; window is NOT
the file saved by your export. Future editing of the currently
opened database will not alter the copy produced by the export.
</para></note>
<para>Exporting to CD will prepare you database directory with all its
contents to be recorded to the CD. This is done through the <para>
<guilabel>burn:///</guilabel> location in Nautilus. After exporting to To export data, choose <menuchoice><guimenu>File</guimenu>
CD, go to the <guilabel>burn:///</guilabel> location by <guimenuitem>Export</guimenuitem></menuchoice>. This will bring up the
selecting <menuchoice><guimenu>Go</guimenu> <guilabel>Export</guilabel> druid. Its pages will guide you through the
<guisubmenu>CD Creator</guisubmenu></menuchoice> in Nautilus menu. Your format selection (see <xref linkend="export-druid-fig"/>), file selection,
database directory will show up. To record it onto the CD, click the CD and format specific export options (see <xref linkend="gedcom-export-fig"/>).
icon on the Nautilus toolbar, or select <menuchoice><guimenu>File</guimenu> After a final confirmation page, the export will be performed according
<guisubmenu>Write to CD</guisubmenu></menuchoice> in Nautilus menu. to the choices you have made. At any time, you can click the
<guibutton>Back</guibutton> and revise any selection, and then go
forward to redo the export.
</para> </para>
<para>Exporting to GEDCOM will create a GEDCOM file, according to the
settings set in the following dialog:</para>
<!-- ==== Figure: GEDCOM Export ==== --> <!-- ==== Figure: GEDCOM Export ==== -->
<figure id="gedcom-export-fig"> <figure id="export-druid-fig">
<title>Export GEDCOM File dialog</title> <title>Export druid: format selection</title>
<screenshot><mediaobject><imageobject><imagedata <screenshot><mediaobject><imageobject><imagedata
fileref="figures/gedcom-export.png" format="PNG"/></imageobject> fileref="figures/export-druid.png" format="PNG"/></imageobject>
<textobject> <textobject>
<phrase>Shows Export GEDCOM File dialog</phrase> <phrase>Shows format selection page of an Export druid</phrase>
</textobject></mediaobject></screenshot></figure> </textobject></mediaobject></screenshot></figure>
<!-- ==== End of Export ==== -->
<para>Type the desired GEDCOM filename into the text entry box or <sect2 id="export-gedcom">
click the <guibutton>Browse...</guibutton> button to evoke the <title>GEDCOM export</title>
<guilabel>Save File</guilabel> dialog.
<para> GEDCOM export options allow you to fine tune your export
(see <xref linkend="gedcom-export-fig"/>).
Choose the desired <guilabel>Encoding</guilabel> of the exported file. Choose the desired <guilabel>Encoding</guilabel> of the exported file.
Use the <guilabel>Filter</guilabel> Use the <guilabel>Filter</guilabel>
pop-up menu to limit the scope of the export according to the stated rule. 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. images when writing image references in GEDCOM.
</para> </para>
<para>Upon starting the export, &app; will
display the following GEDCOM export progress window with the
progressbars reflecting the current state of exporting. </para>
<!-- ==== Figure: GEDCOM Export ==== --> <!-- ==== Figure: GEDCOM Export ==== -->
<figure id="gedcom-export-progress-fig"> <figure id="gedcom-export-fig">
<title>Export GEDCOM progress dialog</title> <title>Export druid: GEDCOM options</title>
<screenshot><mediaobject><imageobject><imagedata <screenshot><mediaobject><imageobject><imagedata
fileref="figures/gedcom-export-progress.png" format="PNG"/></imageobject> fileref="figures/gedcom-export.png" format="PNG"/></imageobject>
<textobject> <textobject>
<phrase>Shows Export GEDCOM progress dialog. </phrase> <phrase>Shows GEDCOM options page of an Export druid</phrase>
</textobject></mediaobject></screenshot></figure> </textobject></mediaobject></screenshot></figure>
<!-- ==== End of Export ==== --> <!-- ==== End of Export ==== -->
</sect2>
<sect2 id="export-grdb">
<title>&app; database (grdb) export</title>
<para>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.</para>
</sect2>
<sect2 id="export-xml">
<title>&app; XML database export</title>
<para>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.
</para>
</sect2>
<sect2 id="export-cd">
<title>Export to CD</title>
<para>Exporting to CD will prepare you database directory with all its
contents to be recorded to the CD. This is done through the
<guilabel>burn:///</guilabel> location in Nautilus. After exporting to
CD, go to the <guilabel>burn:///</guilabel> location by
selecting <menuchoice><guimenu>Go</guimenu>
<guisubmenu>CD Creator</guisubmenu></menuchoice> 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 <menuchoice><guimenu>File</guimenu>
<guisubmenu>Write to CD</guisubmenu></menuchoice> in Nautilus menu.
</para>
</sect2>
<sect2 id="export-package">
<title>&app; package export</title>
<para>Exporting to &app; package will create a gzip-compressed tar <para>Exporting to &app; package will create a gzip-compressed tar
archive (also known as tarball) which contains gramps database, all archive (also known as tarball) which contains gramps database, all
@ -346,13 +383,25 @@
it with somebody, while retaining all the features provided it with somebody, while retaining all the features provided
by &app;. by &app;.
</para> </para>
</sect2>
<sect2 id="export-wft">
<title>Web Family Tree export</title>
<para>Exporting to Web Family Tree will create the text file suitable <para>Exporting to Web Family Tree will create the text file suitable
as an input for the WFT program. Use the <guilabel>Filter</guilabel> as an input for the WFT program. Specific options include filter selecton
pop-up menu to limit the scope of the export according to the stated rule. and the ability to restrict data on living people, that is to limit living
Check <guilabel>Restrict data on living people</guilabel> to limit living
people's data to family ties. people's data to family ties.
</para> </para>
</sect2>
<sect2 id="export-gw">
<title>GeneWeb export</title>
<para>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 <ulink url="http://cristal.inria.fr/~ddr/GeneWeb/en/"
type="http">this site.</ulink>
</para>
</sect2>
<para>If a media file is not found during export, the following dialog <para>If a media file is not found during export, the following dialog
will prompt you for the possible actions:</para> will prompt you for the possible actions:</para>

View File

@ -521,13 +521,13 @@ class ArgHandler:
print "Error creating %s" % filename print "Error creating %s" % filename
os._exit(1) os._exit(1)
elif format == 'iso': elif format == 'iso':
print "\tISO format is temporarily disabled." import WriteCD
#import WriteCD try:
#try: writer = WriteCD.PackageWriter(self.parent.db,filename,1)
# WriteCD.PackageWriter(self.parent.db,1,filename) ret = writer.export()
#except: except:
# print "Error exporting %s" % filename print "Error exporting %s" % filename
# os._exit(1) os._exit(1)
elif format == 'wft': elif format == 'wft':
import WriteFtree import WriteFtree
try: try:

View File

@ -93,6 +93,7 @@ class Exporter:
self.d = Druid() self.d = Druid()
self.w.add(self.d) self.w.add(self.d)
self.w.set_title(_('GRAMPS: Export'))
self.d.add(self.build_info_page()) self.d.add(self.build_info_page())
self.d.add(self.build_format_page()) self.d.add(self.build_format_page())
self.file_sel_page = self.build_file_sel_page() self.file_sel_page = self.build_file_sel_page()
@ -314,6 +315,7 @@ class Exporter:
p.set_logo(self.logo) p.set_logo(self.logo)
self.chooser = gtk.FileChooserWidget(gtk.FILE_CHOOSER_ACTION_SAVE) self.chooser = gtk.FileChooserWidget(gtk.FILE_CHOOSER_ACTION_SAVE)
self.chooser.set_local_only(gtk.FALSE)
p.append_item("",self.chooser,"") p.append_item("",self.chooser,"")
# Dirty hack to enable proper EXPAND and FILL properties of the chooser # Dirty hack to enable proper EXPAND and FILL properties of the chooser
parent = self.chooser.get_parent() parent = self.chooser.get_parent()
@ -339,6 +341,8 @@ class Exporter:
if ext == 'gramps': if ext == 'gramps':
new_filename = os.path.expanduser(default_dir + 'data.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: else:
new_filename = Utils.get_new_filename(ext,default_dir) new_filename = Utils.get_new_filename(ext,default_dir)
self.chooser.set_current_folder(default_dir) self.chooser.set_current_folder(default_dir)

View File

@ -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. ' _description = _('GEDCOM is used to transfer data between genealogy programs. '
'Most genealogy software will accept a GEDCOM file as input. ') 'Most genealogy software will accept a GEDCOM file as input. ')
#option_box = GedcomWriterOptionBox()
_config = (_('GEDCOM export options'),GedcomWriterOptionBox) _config = (_('GEDCOM export options'),GedcomWriterOptionBox)
_filename = 'ged' _filename = 'ged'

View File

@ -192,6 +192,7 @@ class XmlWriter:
self.write_xml_data() self.write_xml_data()
g.close() g.close()
return 1
def write_xml_data(self): def write_xml_data(self):

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # 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 # 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 # it under the terms of the GNU General Public License as published by
@ -29,6 +29,7 @@
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import os import os
from cStringIO import StringIO from cStringIO import StringIO
from gettext import gettext as _
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -56,8 +57,6 @@ import const
import QuestionDialog import QuestionDialog
import ImgManip import ImgManip
from gettext import gettext as _
_title_string = _("Export to CD") _title_string = _("Export to CD")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -65,12 +64,15 @@ _title_string = _("Export to CD")
# writeData # writeData
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def writeData(database,person): def writeData(database,filename,person,option_box=None):
ret = 0
try: try:
PackageWriter(database) writer = PackageWriter(database,filename)
ret = writer.export()
except: except:
import DisplayTrace import DisplayTrace
DisplayTrace.DisplayTrace() DisplayTrace.DisplayTrace()
return ret
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -79,56 +81,19 @@ def writeData(database,person):
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class PackageWriter: class PackageWriter:
def __init__(self,database,cl=0,name=""): def __init__(self,database,filename="",cl=0):
self.db = database self.db = database
self.cl = cl self.cl = cl
self.name = name self.filename = filename
def export(self):
if self.cl: if self.cl:
self.cl_run() self.cl_run()
else: else:
base = os.path.dirname(__file__) self.gui_run()
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")
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): def cl_run(self):
base = os.path.basename(self.name) base = os.path.basename(self.filename)
try: try:
uri = URI('burn:///%s' % base) uri = URI('burn:///%s' % base)
@ -168,15 +133,11 @@ class PackageWriter:
gfile.write_handle(g) gfile.write_handle(g)
g.close() g.close()
def on_help_clicked(self,obj): def gui_run(self):
"""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)
missmedia_action = 0 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: try:
uri = URI('burn:///%s' % base) uri = URI('burn:///%s' % base)
@ -261,10 +222,10 @@ class PackageWriter:
newfile = fs_top.get_filename() newfile = fs_top.get_filename()
if os.path.isfile(newfile): if os.path.isfile(newfile):
self.copy_file(newfile,'burn:///%s/%s' % (base,obase)) self.copy_file(newfile,'burn:///%s/%s' % (base,obase))
ntype = GrampsMime.get_type(newfile) ntype = GrampsMime.get_type(newfile)
if ntype[0:5] == "image": if ntype[0:5] == "image":
self.make_thumbnail(base,obase,newfile) self.make_thumbnail(base,obase,newfile)
fs_top = gtk.FileSelection("%s - GRAMPS" % _("Select file")) fs_top = gtk.FileSelection("%s - GRAMPS" % _("Select file"))
fs_top.hide_fileop_buttons() fs_top.hide_fileop_buttons()
fs_top.ok_button.connect('clicked',fs_ok_clicked) fs_top.ok_button.connect('clicked',fs_ok_clicked)
@ -290,7 +251,7 @@ class PackageWriter:
self.object_handle = obj.get_handle() self.object_handle = obj.get_handle()
if missmedia_action == 0: if missmedia_action == 0:
mmd = QuestionDialog.MissingMediaDialog(_("Media object could not be found"), 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. " "The file may have been deleted or moved to a different location. "
"You may choose to either remove the reference from the database, " "You may choose to either remove the reference from the database, "
"keep the reference to the missing file, or select a new file." "keep the reference to the missing file, or select a new file."
@ -310,12 +271,43 @@ class PackageWriter:
gfile.write_handle(g) gfile.write_handle(g)
g.close() g.close()
os.system("nautilus --no-desktop burn:///") 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 # 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)

View File

@ -199,7 +199,7 @@ class PackageWriter:
# Register the plugin # 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.') _description = _('GRAMPS package is an archived XML database together with the media object files.')
_config = None _config = None
_filename = 'gpkg' _filename = 'gpkg'