* 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:
@@ -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>
|
2005-11-22 Don Allingham <don@gramps-project.org>
|
||||||
* src/docgen/AbiWord2Doc.py: fix spacing for top and bottom margin
|
* src/docgen/AbiWord2Doc.py: fix spacing for top and bottom margin
|
||||||
* src/ArgHandler.py: fix typo
|
* src/ArgHandler.py: fix typo
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -203,8 +203,8 @@ class ArgHandler:
|
|||||||
outformat = 'geneweb'
|
outformat = 'geneweb'
|
||||||
elif outfname[-6:].upper() == "GRAMPS":
|
elif outfname[-6:].upper() == "GRAMPS":
|
||||||
outformat = 'gramps-xml'
|
outformat = 'gramps-xml'
|
||||||
elif outfname[-3:].upper() == "GRDB":
|
elif outfname[-4:].upper() == "GRDB":
|
||||||
format = 'grdb'
|
outformat = 'grdb'
|
||||||
else:
|
else:
|
||||||
print "Unrecognized format for output file %s" % outfname
|
print "Unrecognized format for output file %s" % outfname
|
||||||
print "Ignoring output file: %s" % outfname
|
print "Ignoring output file: %s" % outfname
|
||||||
@@ -511,7 +511,14 @@ class ArgHandler:
|
|||||||
Try to write into filename using the format.
|
Try to write into filename using the format.
|
||||||
Any errors will cause the os._exit(1) call.
|
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
|
import WriteGedcom
|
||||||
try:
|
try:
|
||||||
gw = WriteGedcom.GedcomWriter(self.parent.db,None,1,filename)
|
gw = WriteGedcom.GedcomWriter(self.parent.db,None,1,filename)
|
||||||
|
|||||||
@@ -408,6 +408,7 @@ class CheckIntegrity:
|
|||||||
len(fhandle_list))
|
len(fhandle_list))
|
||||||
|
|
||||||
for family_handle in fhandle_list:
|
for family_handle in fhandle_list:
|
||||||
|
self.progress.step()
|
||||||
family = self.db.get_family_from_handle(family_handle)
|
family = self.db.get_family_from_handle(family_handle)
|
||||||
mother_handle = family.get_mother_handle()
|
mother_handle = family.get_mother_handle()
|
||||||
father_handle = family.get_father_handle()
|
father_handle = family.get_father_handle()
|
||||||
|
|||||||
46
gramps2/test/impex.sh
Executable file
46
gramps2/test/impex.sh
Executable 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
|
||||||
@@ -1,23 +1,19 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
|
# $Id$
|
||||||
|
|
||||||
GDIR=`dirname $PWD`
|
GDIR=`dirname $PWD`
|
||||||
TDIR=$GDIR/test
|
TDIR=$GDIR/test
|
||||||
OPTS="-i $GDIR/example/gramps/example.gramps -f gramps-xml"
|
OPTS="-i $GDIR/example/gramps/example.gramps -f gramps-xml"
|
||||||
PRG="python gramps.py"
|
PRG="python gramps.py"
|
||||||
|
|
||||||
GRPH_FMT="sxw ps pdf svg"
|
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"
|
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
|
# 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 "+--------------------------------------------------------------"
|
echo "+--------------------------------------------------------------"
|
||||||
echo "| Reports:"
|
echo "| Reports:"
|
||||||
@@ -25,15 +21,15 @@ echo "| "$GRPH_REP
|
|||||||
echo "| Formats:"
|
echo "| Formats:"
|
||||||
echo "| "$GRPH_FMT
|
echo "| "$GRPH_FMT
|
||||||
echo "+--------------------------------------------------------------"
|
echo "+--------------------------------------------------------------"
|
||||||
(cd $GDIR/src; $PRG $OPTS $action)
|
|
||||||
|
|
||||||
# Single run with all textual reports in all formats
|
|
||||||
action=
|
action=
|
||||||
for report in $TEXT_REP; do
|
for report in $GRPH_REP; do
|
||||||
for fmt in $TEXT_FMT; do
|
for fmt in $GRPH_FMT; do
|
||||||
action="$action -a report -p name=$report,id=I44,off=$fmt,of=$TDIR/$report.$fmt"
|
action="$action -a report -p name=$report,id=I44,off=$fmt,of=$TDIR/$report.$fmt"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
(cd $GDIR/src; $PRG $OPTS $action)
|
||||||
|
|
||||||
|
# Single run with all textual reports in all formats
|
||||||
echo ""
|
echo ""
|
||||||
echo "+--------------------------------------------------------------"
|
echo "+--------------------------------------------------------------"
|
||||||
echo "| Reports:"
|
echo "| Reports:"
|
||||||
@@ -41,4 +37,10 @@ echo "| "$TEXT_REP
|
|||||||
echo "| Formats:"
|
echo "| Formats:"
|
||||||
echo "| "$TEXT_FMT
|
echo "| "$TEXT_FMT
|
||||||
echo "+--------------------------------------------------------------"
|
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)
|
(cd $GDIR/src; $PRG $OPTS $action)
|
||||||
|
|||||||
Reference in New Issue
Block a user