* src/ArgHandler.py (cl_export): Add grdb export from the CLI.

* src/plugins/Check.py (check_parent_relationships): Step through
the progress bar.
* test/runtest.sh: Add txt format and family_group report.
* test/impex.sh: Add import/export test set.
* example/gramps/example.gramps: Correct errors.


svn: r5424
This commit is contained in:
Alex Roitman 2005-11-23 20:16:39 +00:00
parent 31e94e89bd
commit dc14e4de37
6 changed files with 3771 additions and 3775 deletions

View File

@ -1,3 +1,11 @@
2005-11-23 Alex Roitman <shura@gramps-project.org>
* src/ArgHandler.py (cl_export): Add grdb export from the CLI.
* src/plugins/Check.py (check_parent_relationships): Step through
the progress bar.
* test/runtest.sh: Add txt format and family_group report.
* test/impex.sh: Add import/export test set.
* example/gramps/example.gramps: Correct errors.
2005-11-22 Don Allingham <don@gramps-project.org>
* src/docgen/AbiWord2Doc.py: fix spacing for top and bottom margin
* src/ArgHandler.py: fix typo

File diff suppressed because it is too large Load Diff

View File

@ -203,8 +203,8 @@ class ArgHandler:
outformat = 'geneweb'
elif outfname[-6:].upper() == "GRAMPS":
outformat = 'gramps-xml'
elif outfname[-3:].upper() == "GRDB":
format = 'grdb'
elif outfname[-4:].upper() == "GRDB":
outformat = 'grdb'
else:
print "Unrecognized format for output file %s" % outfname
print "Ignoring output file: %s" % outfname
@ -511,7 +511,14 @@ class ArgHandler:
Try to write into filename using the format.
Any errors will cause the os._exit(1) call.
"""
if format == 'gedcom':
if format == 'grdb':
import WriteGrdb
try:
WriteGrdb.exportData(self.parent.db,filename)
except:
print "Error exporting %s" % filename
os._exit(1)
elif format == 'gedcom':
import WriteGedcom
try:
gw = WriteGedcom.GedcomWriter(self.parent.db,None,1,filename)

View File

@ -408,6 +408,7 @@ class CheckIntegrity:
len(fhandle_list))
for family_handle in fhandle_list:
self.progress.step()
family = self.db.get_family_from_handle(family_handle)
mother_handle = family.get_mother_handle()
father_handle = family.get_father_handle()

46
gramps2/test/impex.sh Executable file
View File

@ -0,0 +1,46 @@
#! /bin/sh
# $Id$
TOP_DIR=`dirname $PWD`
TEST_DIR=$TOP_DIR/test
SRC_DIR=$TOP_DIR/src
PRG="python gramps.py"
EXAMPLE_XML=$TOP_DIR/example/gramps/example.gramps
OUT_FMT="gedcom gramps-xml gramps-pkg wft geneweb"
echo ""
echo "+--------------------------------------------------------------"
echo "| Import XML, write GRDB"
echo "+--------------------------------------------------------------"
rm $TEST_DIR/example.grdb
OPTS="-i $EXAMPLE_XML -o $TEST_DIR/example.grdb"
(cd $SRC_DIR; $PRG $OPTS)
echo ""
echo "+--------------------------------------------------------------"
echo "| Check GRDB for errors"
echo "+--------------------------------------------------------------"
OPTS="-O $TEST_DIR/example.grdb -a tool -p name=check"
(cd $SRC_DIR; $PRG $OPTS)
echo ""
echo "+--------------------------------------------------------------"
echo "| Open GRDB, write all other formats"
echo "+--------------------------------------------------------------"
OPTS="-O $TEST_DIR/example.grdb"
for fmt in $OUT_FMT; do
OPTS="$OPTS -o $TEST_DIR/example.$fmt -f $fmt"
done
(cd $SRC_DIR; $PRG $OPTS)
echo ""
echo "+--------------------------------------------------------------"
echo "| Validate produced XML"
echo "+--------------------------------------------------------------"
echo "* Regular well-formedness and DTD validation"
xmllint --noout --valid example.gramps-xml
echo "* Post-parsing DTD validation"
xmllint --noout --postvalid example.gramps-xml
echo "* Validate against RelaxNG schema"
xmllint --noout --relaxng ../doc/grampsxml.rng example.gramps-xml

View File

@ -1,23 +1,19 @@
#! /bin/sh
# $Id$
GDIR=`dirname $PWD`
TDIR=$GDIR/test
OPTS="-i $GDIR/example/gramps/example.gramps -f gramps-xml"
PRG="python gramps.py"
GRPH_FMT="sxw ps pdf svg"
TEXT_FMT="sxw pdf kwd abw rtf"
TEXT_FMT="sxw pdf kwd abw rtf txt"
GRPH_REP="ancestor_chart ancestor_chart2 descendant_graph"
TEXT_REP="ancestor_report ancestors_report descend_report det_ancestor_report det_descendant_report"
TEXT_REP="ancestor_report ancestors_report descend_report det_ancestor_report det_descendant_report family_group"
# Single run with all graphical reports in all formats
action=
for report in $GRPH_REP; do
for fmt in $GRPH_FMT; do
action="$action -a report -p name=$report,id=I44,off=$fmt,of=$TDIR/$report.$fmt"
done
done
echo ""
echo "+--------------------------------------------------------------"
echo "| Reports:"
@ -25,15 +21,15 @@ echo "| "$GRPH_REP
echo "| Formats:"
echo "| "$GRPH_FMT
echo "+--------------------------------------------------------------"
(cd $GDIR/src; $PRG $OPTS $action)
# Single run with all textual reports in all formats
action=
for report in $TEXT_REP; do
for fmt in $TEXT_FMT; do
for report in $GRPH_REP; do
for fmt in $GRPH_FMT; do
action="$action -a report -p name=$report,id=I44,off=$fmt,of=$TDIR/$report.$fmt"
done
done
(cd $GDIR/src; $PRG $OPTS $action)
# Single run with all textual reports in all formats
echo ""
echo "+--------------------------------------------------------------"
echo "| Reports:"
@ -41,4 +37,10 @@ echo "| "$TEXT_REP
echo "| Formats:"
echo "| "$TEXT_FMT
echo "+--------------------------------------------------------------"
action=
for report in $TEXT_REP; do
for fmt in $TEXT_FMT; do
action="$action -a report -p name=$report,id=I44,off=$fmt,of=$TDIR/$report.$fmt"
done
done
(cd $GDIR/src; $PRG $OPTS $action)