* src/docgen/LPRDoc.py (draw_path,draw_bar): Fill, then stroke.
* src/DbPrompter.py: Change file filter name. * src/Report.py (doc_type_changed): Deal with empty extensions. * src/docgen/AsciiDoc.py (add_photo): Add method; (end_row): Inlcude last cell into proper formatting. * src/GedcomInfo.py: Properly import expat.ParserCreate class. * src/TipOfDay.py: Properly import expat.ParserCreate class. * src/RecentFiles.py: Properly import expat.ParserCreate class. * src/ReadXML.py: Properly import expat.* classes. * doc/gramps-manual/C/usage.xml: Update. * doc/gramps-manual/C/usage.xml: Update. * doc/xmldocs.make: Switch Makefile from CLEANFILES to DISTCLEANFILES. * src/Makefile.am: Add const.pyc and const.pyo to CLEANFILES. svn: r4051
This commit is contained in:
parent
fdfa19fa1f
commit
8b0aa1f633
16
ChangeLog
16
ChangeLog
@ -1,3 +1,19 @@
|
|||||||
|
2005-02-18 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
|
* src/docgen/LPRDoc.py (draw_path,draw_bar): Fill, then stroke.
|
||||||
|
* src/DbPrompter.py: Change file filter name.
|
||||||
|
|
||||||
|
* src/Report.py (doc_type_changed): Deal with empty extensions.
|
||||||
|
* src/docgen/AsciiDoc.py (add_photo): Add method;
|
||||||
|
(end_row): Inlcude last cell into proper formatting.
|
||||||
|
* src/GedcomInfo.py: Properly import expat.ParserCreate class.
|
||||||
|
* src/TipOfDay.py: Properly import expat.ParserCreate class.
|
||||||
|
* src/RecentFiles.py: Properly import expat.ParserCreate class.
|
||||||
|
* src/ReadXML.py: Properly import expat.* classes.
|
||||||
|
* doc/gramps-manual/C/usage.xml: Update.
|
||||||
|
* doc/gramps-manual/C/usage.xml: Update.
|
||||||
|
* doc/xmldocs.make: Switch Makefile from CLEANFILES to DISTCLEANFILES.
|
||||||
|
* src/Makefile.am: Add const.pyc and const.pyo to CLEANFILES.
|
||||||
|
|
||||||
2005-02-18 Eero Tamminen <eerot@sf>
|
2005-02-18 Eero Tamminen <eerot@sf>
|
||||||
* src/plugins/StatisticsChart.py: fix date object checking
|
* src/plugins/StatisticsChart.py: fix date object checking
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
<chapter id="gramps-usage">
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
User Manual for Gramps - a GTK+/GNOME based genealogy program
|
User Manual for Gramps - a GTK+/GNOME based genealogy program
|
||||||
|
|
||||||
@ -22,6 +20,7 @@
|
|||||||
|
|
||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
|
|
||||||
|
<chapter id="gramps-usage">
|
||||||
<title>Usage</title>
|
<title>Usage</title>
|
||||||
<para>As commonly encountered in everyday life, in
|
<para>As commonly encountered in everyday life, in
|
||||||
&app; there is usually more than one way to
|
&app; there is usually more than one way to
|
||||||
@ -33,10 +32,19 @@
|
|||||||
<title>Starting a New Database</title>
|
<title>Starting a New Database</title>
|
||||||
<para>To start a new database, choose <menuchoice><guimenu>File</guimenu>
|
<para>To start a new database, choose <menuchoice><guimenu>File</guimenu>
|
||||||
<guimenuitem>New</guimenuitem></menuchoice>. You will then be
|
<guimenuitem>New</guimenuitem></menuchoice>. You will then be
|
||||||
prompted with the <guilabel>Save Database</guilabel> dialog asking
|
prompted with the <guilabel>Create GRAMPS database</guilabel> dialog asking
|
||||||
to specify the name under which the new database will be stored.
|
to specify the name under which the new database will be stored.
|
||||||
Choose an <replaceable>empty directory</replaceable> for your new
|
The new database will be created in the BSDDB format, with <filename>.grdb</filename>
|
||||||
database (create one if necessary). </para>
|
as the default extension.</para>
|
||||||
|
|
||||||
|
<note id="new-db-notdir-note">
|
||||||
|
<title>Selecting file</title>
|
||||||
|
<para>
|
||||||
|
Unlike the version 1.0.X of &app;, this version does not require selecting directory
|
||||||
|
for the database. Please select filename, as you would in any other application.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<!-- ================ Usage Subsection ================================ -->
|
<!-- ================ Usage Subsection ================================ -->
|
||||||
@ -45,39 +53,77 @@
|
|||||||
<para>To open a database, either choose <menuchoice>
|
<para>To open a database, either choose <menuchoice>
|
||||||
<guimenu>File</guimenu><guimenuitem>Open</guimenuitem></menuchoice>
|
<guimenu>File</guimenu><guimenuitem>Open</guimenuitem></menuchoice>
|
||||||
or click the <guibutton>Open</guibutton> button on the Toolbar.
|
or click the <guibutton>Open</guibutton> button on the Toolbar.
|
||||||
The <guilabel>Open Database</guilabel> dialog will appear.
|
The <guilabel>Open database</guilabel> dialog will appear.
|
||||||
Either type the full path into the <guilabel>Database</guilabel> text
|
</para>
|
||||||
entry field, or click the <guibutton>Browse...</guibutton> button to get
|
|
||||||
the <guilabel>Open File</guilabel> dialog in which you can select the
|
<para>
|
||||||
database that you want to open. After you have selected the database,
|
The filetype filter in the <guilabel>Open database</guilabel> dialog allows
|
||||||
click the <guibutton>OK</guibutton> button to open it. </para>
|
you to display files of a certain type. If the <guilabel>All files</guilabel>
|
||||||
|
filter is selected (the default), all the files will be shown. The type will
|
||||||
|
be deteremined by the extension of the selected filename.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<note id="open-db-note"><title>Selecting file</title>
|
||||||
|
<para>
|
||||||
|
Unlike the version 1.0.X of &app;, this version does not require selecting directory
|
||||||
|
for the database. Please select filename, as you would in any other application.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
|
||||||
|
<para>If you do not have write permissions for the selected database, it will
|
||||||
|
be opened in a Read Only mode. In this mode, the data may be viewed, but
|
||||||
|
no changes will be made to the database. To indicate this mode, the title of the
|
||||||
|
main window will be appended with <guilabel>(Read Only)</guilabel> text.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<note id="open-db-note2"><title>Opening XML and GEDCOM databases</title>
|
||||||
|
<para>
|
||||||
|
This version allows direct opening and editing of &app; XML and GEDCOM
|
||||||
|
databases. Please keep in mind that, unlike using the native grdb format,
|
||||||
|
these formats require holding all data in memory. This leads to performance
|
||||||
|
and memory consumption problems which grdb was designed to solve.</para>
|
||||||
|
|
||||||
|
<para>While direct opening of a &app; XML or GEDCOM file is convenient
|
||||||
|
for a small database, it may prove burdensome for large databases.
|
||||||
|
If you experience this, please consider creating a new native (grdb) database
|
||||||
|
and importing your XML or GEDCOM data into it. This will make accessing
|
||||||
|
your data much more efficient and quick.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
|
||||||
|
<warning id="open-db-warn">
|
||||||
|
<title>GEDCOM Editing</title>
|
||||||
|
<para>
|
||||||
|
Please keep in mind that some information in GEDCOM file may be lost
|
||||||
|
during import into &app;. Simply opening and viewing the file will not change it.
|
||||||
|
However, if any changes were made and they were not abandoned upon exit,
|
||||||
|
exiting &app; will save the data, with the possible data loss.
|
||||||
|
</para>
|
||||||
|
</warning>
|
||||||
|
|
||||||
<para>If you have previously opened databases with &app; you can
|
|
||||||
retrieve your past selections from the drop-down menu by clicking the
|
|
||||||
down arrow button. Finally, if the Revision Control System (RCS) is
|
|
||||||
enabled in the <guilabel>Preferences</guilabel> dialog, the check box
|
|
||||||
<guilabel>Revert to an older version from RCS</guilabel> will be
|
|
||||||
available. Check it to revert your database to an older RCS
|
|
||||||
version. </para>
|
|
||||||
|
|
||||||
<para>NOTE: you should open a <replaceable>DIRECTORY</replaceable> and
|
|
||||||
<replaceable>NOT a FILE</replaceable> when opening
|
|
||||||
&app; database. The directory you need to open should contain the
|
|
||||||
database file <replaceable>data.gramps</replaceable> as well as any
|
|
||||||
possible copies
|
|
||||||
of media objects. Such a directory is created by &app; when you start
|
|
||||||
a new database and is updated each time the database is saved. </para>
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<!-- ================ Usage Subsection ================================ -->
|
<!-- ================ Usage Subsection ================================ -->
|
||||||
<sect1 id="save-db">
|
<sect1 id="save-db">
|
||||||
<title>Saving a Database</title>
|
<title>Saving a Database</title>
|
||||||
<para>To save changes made to your database, choose <menuchoice>
|
|
||||||
<guimenu>File</guimenu>
|
<para>A consequence of the new database backend is that the changes, once approved
|
||||||
<guimenuitem>Save</guimenuitem></menuchoice> or click the
|
by the user, are applied immediately. In short, once you click <guibutton>OK</guibutton>
|
||||||
<guibutton>Save</guibutton> button on the Toolbar. The statusbar will then
|
in the Person, Family, Source, Place, Media object, or Event editor, all the changes made to
|
||||||
display the <guilabel>Saving <replaceable>databasename</replaceable>...</guilabel>
|
this object are recorded in the database. No saving is necessary, or even possible.
|
||||||
message, and the progressbar will advance as the saving progresses.</para>
|
</para>
|
||||||
|
|
||||||
|
<para>Choosing <menuchoice><guimenu>Edit</guimenu><guimenuitem>Undo</guimenuitem>
|
||||||
|
</menuchoice> allows you to undo the changes you made, one step at a time.</para>
|
||||||
|
|
||||||
|
<tip id="save-tip"><title>Reverting the whole session</title>
|
||||||
|
<para>If you would like to revert the whole editing session, choose
|
||||||
|
<menuchoice><guimenu>File</guimenu><guimenuitem>Abandon changes
|
||||||
|
and quit</guimenuitem></menuchoice>. This will be analogous to quitting
|
||||||
|
without saving any changes in other applications.
|
||||||
|
</para>
|
||||||
|
</tip>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<!-- ================ Usage Subsection ================================ -->
|
<!-- ================ Usage Subsection ================================ -->
|
||||||
@ -85,33 +131,71 @@
|
|||||||
<title>Importing Data</title>
|
<title>Importing Data</title>
|
||||||
<para>Importing allows you to incorporate the data from other
|
<para>Importing allows you to incorporate the data from other
|
||||||
databases into your currently open &app; database. Currently,
|
databases into your currently open &app; database. Currently,
|
||||||
&app; can import data from three different
|
&app; can import data from the following formats: &app; database (grdb),
|
||||||
formats: GEDCOM, &app; database, and &app; package. All of these are
|
GEDCOM, &app; XML, &app; package, and GeneWeb. All of these are
|
||||||
available as items of <menuchoice><guimenu>File</guimenu>
|
available by choosing <menuchoice><guimenu>File</guimenu>
|
||||||
<guisubmenu>Import</guisubmenu></menuchoice> submenu.</para>
|
<guisubmenu>Import</guisubmenu></menuchoice> and
|
||||||
|
selecting an appropriate file.</para>
|
||||||
|
|
||||||
<para>Both &app; database, and &app; package are native &app;
|
<para>&app; database (grdb), &app; XML, and &app; package are
|
||||||
formats. The package is a compressed archive containing the database
|
all native &app; formats in that there is no information loss resulting
|
||||||
file and all media objects (images, sound files, etc.) that the
|
from reading from and writing into these formats.
|
||||||
database refers to. The package is created by exporting data to
|
<variablelist>
|
||||||
the &app; package, see <xref linkend="export-data"/>.
|
|
||||||
The &app; database is a directory containing the database file and
|
<varlistentry><term>&app; database (grdb)</term>
|
||||||
the local media objects. The database may also have references
|
<listitem><para>
|
||||||
|
The native &app; database format is a specific form of Berkeley database (BSDDB)
|
||||||
|
with special structure of data tables. This format is binary and architecture-dependent.
|
||||||
|
It is very quick and efficient, but not generally portable across computers with
|
||||||
|
different binary architecture (e.g. i386 vs alpha).
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry><term>&app; XML</term>
|
||||||
|
<listitem><para>
|
||||||
|
The &app; XML file was the default format for the previous stable
|
||||||
|
version of &app;. Unlike the grdb format, it is architecture
|
||||||
|
independent and human-readable. The database may also have references
|
||||||
to non-local (external) media objects, therefore it is not guaranteed
|
to non-local (external) media objects, therefore it is not guaranteed
|
||||||
to be completely portable. The &app; database is created by saving
|
to be completely portable. The &app; XML database is created by saving
|
||||||
the data in a usual way, see <xref linkend="save-db"/>.
|
(<menuchoice><guimenu>File</guimenu><guimenuitem>Save
|
||||||
|
As...</guimenuitem></menuchoice>) or exporting (<menuchoice>
|
||||||
|
<guimenu>File</guimenu><guimenuitem>Export...</guimenuitem>
|
||||||
|
</menuchoice>) data in that format.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry><term>&app; package</term>
|
||||||
|
<listitem><para>
|
||||||
|
The package is a compressed archive containing the &app; XML
|
||||||
|
file and all media objects (images, sound files, etc.) that the
|
||||||
|
database refers to. The &app; package is created by exporting
|
||||||
|
(<menuchoice> <guimenu>File</guimenu><guimenuitem>
|
||||||
|
Export...</guimenuitem></menuchoice>) data in that format.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>Note that the difference between opening &app; database and
|
<tip id="import-tip"><title>Opening vs importing</title>
|
||||||
importing from &app; database is that importing incorporates all the
|
<para>The difference between opening &app; database (in any format) and
|
||||||
data into your currently open database, if any. </para>
|
importing from &app; or GEDCOM database is that importing incorporates all the
|
||||||
|
data into your currently open database, if any. In contrast, opening the database
|
||||||
|
will switch from editing your current data to editing another file.</para></tip>
|
||||||
|
|
||||||
<para>After choosing an import format, you will be prompted with the
|
<para>After choosing an import format, you will be prompted with the
|
||||||
<guilabel>Open File</guilabel> dialog asking you to specify the
|
<guilabel>Import database</guilabel> dialog asking you to specify the
|
||||||
file name from which to import. For GEDCOM and
|
file name from which to import.
|
||||||
&app; package, select an appropriate file.
|
</para>
|
||||||
For &app; database, select a directory which stores
|
|
||||||
the database and all media files (if any).</para>
|
<note id="import-note"><title>Selecting file</title>
|
||||||
|
<para>
|
||||||
|
Unlike the version 1.0.X of &app;, this version does not require selecting directory
|
||||||
|
for the database. Please select filename, as you would in any other application.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
|
||||||
<para>Upon starting the GEDCOM import, &app;
|
<para>Upon starting the GEDCOM import, &app;
|
||||||
will display the following GEDCOM import dialog with the summary of the
|
will display the following GEDCOM import dialog with the summary of the
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# $Id$
|
||||||
#
|
#
|
||||||
# No modifications of this Makefile should be necessary.
|
# No modifications of this Makefile should be necessary.
|
||||||
#
|
#
|
||||||
@ -43,7 +44,8 @@ xml_files = $(entities) $(docname).xml
|
|||||||
omf_dir=$(top_srcdir)/omf-install
|
omf_dir=$(top_srcdir)/omf-install
|
||||||
|
|
||||||
EXTRA_DIST = $(xml_files) $(omffile)
|
EXTRA_DIST = $(xml_files) $(omffile)
|
||||||
CLEANFILES = omf_timestamp Makefile
|
CLEANFILES = omf_timestamp
|
||||||
|
DISTCLEANFILES = Makefile
|
||||||
|
|
||||||
include $(top_srcdir)/doc/omf.make
|
include $(top_srcdir)/doc/omf.make
|
||||||
|
|
||||||
@ -61,6 +63,7 @@ distclean-hook:
|
|||||||
then \
|
then \
|
||||||
rm -f $(entities); \
|
rm -f $(entities); \
|
||||||
fi
|
fi
|
||||||
|
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||||
|
|
||||||
app-dist-hook:
|
app-dist-hook:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Gramps - a GTK+/GNOME based genealogy program
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
#
|
#
|
||||||
# Copyright (C) 2000 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
|
||||||
@ -18,6 +18,8 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# $Id$
|
||||||
|
|
||||||
import const
|
import const
|
||||||
|
|
||||||
ADOPT_NONE = 0
|
ADOPT_NONE = 0
|
||||||
@ -50,7 +52,7 @@ SOURCE_REFS_YES = 1
|
|||||||
# XML parser
|
# XML parser
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import xml.parsers.expat
|
from xml.parsers.expat import ParserCreate
|
||||||
|
|
||||||
class GedcomDescription:
|
class GedcomDescription:
|
||||||
def __init__(self,name):
|
def __init__(self,name):
|
||||||
@ -190,7 +192,7 @@ class GedInfoParser:
|
|||||||
self.current = None
|
self.current = None
|
||||||
|
|
||||||
def parse(self,file):
|
def parse(self,file):
|
||||||
p = xml.parsers.expat.ParserCreate()
|
p = ParserCreate()
|
||||||
p.StartElementHandler = self.startElement
|
p.StartElementHandler = self.startElement
|
||||||
p.ParseFile(file)
|
p.ParseFile(file)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ SUBDIRS = docgen plugins dates data po
|
|||||||
|
|
||||||
# For intl. support, how do we compile?
|
# For intl. support, how do we compile?
|
||||||
MOSTLYCLEANFILES =
|
MOSTLYCLEANFILES =
|
||||||
|
CLEANFILES = const.pyc const.pyo
|
||||||
# What are the PYTHON scripts for this package that need to be handled?
|
# What are the PYTHON scripts for this package that need to be handled?
|
||||||
#
|
#
|
||||||
# We only want optimized byte-compiled (.pyo) versions, no .pyc
|
# We only want optimized byte-compiled (.pyo) versions, no .pyc
|
||||||
|
@ -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,7 +29,7 @@ import string
|
|||||||
import os
|
import os
|
||||||
import gtk
|
import gtk
|
||||||
import shutil
|
import shutil
|
||||||
import xml.parsers.expat
|
from xml.parsers.expat import ExpatError, ParserCreate
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -125,7 +125,7 @@ def importData(database, filename, callback=None,cl=0,use_trans=True):
|
|||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return
|
return
|
||||||
except xml.parsers.expat.ExpatError, msg:
|
except ExpatError, msg:
|
||||||
if cl:
|
if cl:
|
||||||
print "Error reading %s" % filename
|
print "Error reading %s" % filename
|
||||||
print "The file is probably either corrupt or not a valid GRAMPS database."
|
print "The file is probably either corrupt or not a valid GRAMPS database."
|
||||||
@ -538,7 +538,7 @@ class GrampsParser:
|
|||||||
self.trans = self.db.transaction_begin()
|
self.trans = self.db.transaction_begin()
|
||||||
else:
|
else:
|
||||||
self.trans = None
|
self.trans = None
|
||||||
p = xml.parsers.expat.ParserCreate()
|
p = ParserCreate()
|
||||||
p.StartElementHandler = self.startElement
|
p.StartElementHandler = self.startElement
|
||||||
p.EndElementHandler = self.endElement
|
p.EndElementHandler = self.endElement
|
||||||
p.CharacterDataHandler = self.characters
|
p.CharacterDataHandler = self.characters
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Gramps - a GTK+/GNOME based genealogy program
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
#
|
#
|
||||||
# Copyright (C) 2004 Donald N. Allingham
|
# Copyright (C) 2004-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
|
||||||
@ -30,7 +30,7 @@
|
|||||||
import os
|
import os
|
||||||
import fcntl
|
import fcntl
|
||||||
import time
|
import time
|
||||||
import xml.parsers.expat
|
from xml.parsers.expat import ParserCreate
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -285,7 +285,7 @@ class GnomeRecentParser:
|
|||||||
xml_file = open(os.path.expanduser(GNOME_FILENAME))
|
xml_file = open(os.path.expanduser(GNOME_FILENAME))
|
||||||
fcntl.lockf(xml_file,fcntl.LOCK_SH)
|
fcntl.lockf(xml_file,fcntl.LOCK_SH)
|
||||||
|
|
||||||
p = xml.parsers.expat.ParserCreate()
|
p = ParserCreate()
|
||||||
p.StartElementHandler = self.startElement
|
p.StartElementHandler = self.startElement
|
||||||
p.EndElementHandler = self.endElement
|
p.EndElementHandler = self.endElement
|
||||||
p.CharacterDataHandler = self.characters
|
p.CharacterDataHandler = self.characters
|
||||||
@ -345,7 +345,7 @@ class GrampsRecentParser:
|
|||||||
xml_file = open(os.path.expanduser(GRAMPS_FILENAME))
|
xml_file = open(os.path.expanduser(GRAMPS_FILENAME))
|
||||||
fcntl.lockf(xml_file,fcntl.LOCK_SH)
|
fcntl.lockf(xml_file,fcntl.LOCK_SH)
|
||||||
|
|
||||||
p = xml.parsers.expat.ParserCreate()
|
p = ParserCreate()
|
||||||
p.StartElementHandler = self.startElement
|
p.StartElementHandler = self.startElement
|
||||||
p.EndElementHandler = self.endElement
|
p.EndElementHandler = self.endElement
|
||||||
p.CharacterDataHandler = self.characters
|
p.CharacterDataHandler = self.characters
|
||||||
|
@ -1050,6 +1050,8 @@ class ReportDialog(BareReportDialog):
|
|||||||
ext_val = obj.get_ext()
|
ext_val = obj.get_ext()
|
||||||
if ext_val:
|
if ext_val:
|
||||||
fname = spath + ext_val
|
fname = spath + ext_val
|
||||||
|
else:
|
||||||
|
fname = spath
|
||||||
self.target_fileentry.set_filename(fname)
|
self.target_fileentry.set_filename(fname)
|
||||||
|
|
||||||
# Does this report format use styles?
|
# Does this report format use styles?
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
# standard python modules
|
# standard python modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import xml.parsers.expat
|
from xml.parsers.expat import ParserCreate
|
||||||
from random import Random
|
from random import Random
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -100,7 +100,7 @@ class TipParser:
|
|||||||
self.mylist = []
|
self.mylist = []
|
||||||
xml_file = open(const.tipdata)
|
xml_file = open(const.tipdata)
|
||||||
self.tlist = []
|
self.tlist = []
|
||||||
p = xml.parsers.expat.ParserCreate()
|
p = ParserCreate()
|
||||||
p.StartElementHandler = self.startElement
|
p.StartElementHandler = self.startElement
|
||||||
p.EndElementHandler = self.endElement
|
p.EndElementHandler = self.endElement
|
||||||
p.CharacterDataHandler = self.characters
|
p.CharacterDataHandler = self.characters
|
||||||
|
@ -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
|
||||||
@ -25,20 +25,18 @@
|
|||||||
# python modules
|
# python modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
import string
|
|
||||||
import os
|
import os
|
||||||
import GrampsMime
|
from gettext import gettext as _
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Load the base BaseDoc class
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
import BaseDoc
|
import BaseDoc
|
||||||
import PluginMgr
|
import PluginMgr
|
||||||
import Errors
|
import Errors
|
||||||
|
import GrampsMime
|
||||||
from gettext import gettext as _
|
|
||||||
|
|
||||||
LEFT,RIGHT,CENTER = 'LEFT','RIGHT','CENTER'
|
LEFT,RIGHT,CENTER = 'LEFT','RIGHT','CENTER'
|
||||||
_WIDTH_IN_CHARS = 72
|
_WIDTH_IN_CHARS = 72
|
||||||
@ -291,7 +289,7 @@ class AsciiDoc(BaseDoc.BaseDoc):
|
|||||||
for cell in range(self.ncols):
|
for cell in range(self.ncols):
|
||||||
if self.cell_widths[cell]:
|
if self.cell_widths[cell]:
|
||||||
blanks = ' '*self.cell_widths[cell] + '\n'
|
blanks = ' '*self.cell_widths[cell] + '\n'
|
||||||
if self.cell_lines[cell] < self.maxlines and cell < self.ncols - 1:
|
if self.cell_lines[cell] < self.maxlines:
|
||||||
self.cellpars[cell] = self.cellpars[cell] \
|
self.cellpars[cell] = self.cellpars[cell] \
|
||||||
+ blanks * (self.maxlines-self.cell_lines[cell])
|
+ blanks * (self.maxlines-self.cell_lines[cell])
|
||||||
cell_text[cell] = self.cellpars[cell].split('\n')
|
cell_text[cell] = self.cellpars[cell].split('\n')
|
||||||
@ -327,6 +325,13 @@ class AsciiDoc(BaseDoc.BaseDoc):
|
|||||||
if self.cell_lines[self.cellnum] > self.maxlines:
|
if self.cell_lines[self.cellnum] > self.maxlines:
|
||||||
self.maxlines = self.cell_lines[self.cellnum]
|
self.maxlines = self.cell_lines[self.cellnum]
|
||||||
|
|
||||||
|
def add_photo(self,name,pos,x,y):
|
||||||
|
this_text = '(photo)'
|
||||||
|
if self.in_cell:
|
||||||
|
self.cellpars[self.cellnum] = self.cellpars[self.cellnum] + this_text
|
||||||
|
else:
|
||||||
|
self.f.write(this_text)
|
||||||
|
|
||||||
def write_note(self,text,format,style_name):
|
def write_note(self,text,format,style_name):
|
||||||
if format == 1:
|
if format == 1:
|
||||||
for line in text.split('\n'):
|
for line in text.split('\n'):
|
||||||
@ -337,7 +342,7 @@ class AsciiDoc(BaseDoc.BaseDoc):
|
|||||||
for line in text.split('\n\n'):
|
for line in text.split('\n\n'):
|
||||||
self.start_paragraph(style_name)
|
self.start_paragraph(style_name)
|
||||||
line = line.replace('\n',' ')
|
line = line.replace('\n',' ')
|
||||||
line = string.join(string.split(line))
|
line = ' '.join(line.split())
|
||||||
self.write_text(line)
|
self.write_text(line)
|
||||||
self.end_paragraph()
|
self.end_paragraph()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user