From cc19349f6316a4e7cce65515396264f0370a7acc Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Tue, 17 Feb 2004 04:47:24 +0000 Subject: [PATCH] * src/Relationship.py: Factor out relationship distance computation. * src/plugins/rel_ru.py: Use self.get_distance(). * src/plugins/rel_de.py: Use self.get_distance(). * configure.in, configure: Change version. * src/plugins/rel_hu.py: Convert to class. svn: r2858 --- ChangeLog | 7 + configure | 711 ++++++++++++++++++++++++------------------ configure.in | 6 +- src/Relationship.py | 100 +++--- src/plugins/rel_de.py | 95 +----- src/plugins/rel_hu.py | 474 ++++++++++++++-------------- src/plugins/rel_ru.py | 97 +----- 7 files changed, 729 insertions(+), 761 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f471c594..b26afa36a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-02-16 Alex Roitman + * src/Relationship.py: Factor out relationship distance computation. + * src/plugins/rel_ru.py: Use self.get_distance(). + * src/plugins/rel_de.py: Use self.get_distance(). + * configure.in, configure: Change version. + * src/plugins/rel_hu.py: Convert to class. + 2004-02-15 Don Allingham * src/Relationship.py: more fixes * src/gramps_main.py: changed db on relationship calculator when db changes. diff --git a/configure b/configure index 9d651e191..080f64f65 100755 --- a/configure +++ b/configure @@ -1,11 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57 for gramps 0.99. +# Generated by GNU Autoconf 2.59 for gramps 1.1.0. # # Report bugs to . # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -22,9 +21,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -43,7 +43,7 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -220,16 +220,17 @@ rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -268,12 +269,12 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='gramps' PACKAGE_TARNAME='gramps' -PACKAGE_VERSION='0.99' -PACKAGE_STRING='gramps 0.99' +PACKAGE_VERSION='1.1.0' +PACKAGE_STRING='gramps 1.1.0' PACKAGE_BUGREPORT='gramps-bugs@lists.sourceforge.net' ac_unique_file="src/gramps.py" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot RELEASE VERSIONSTRING MSGFMT MSGCONV ICONV LANGUAGES POFILES MOFILES PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir BINSH ZIP CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE HAVE_PKG_CONFIG PYTHON_CPPFLAGS SK_CONFIG SCROLLKEEPER_BUILD_REQUIRED GNOMEHELP GPREFIX GNOMEINC GNOMELIB LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE RELEASE VERSIONSTRING MSGFMT MSGCONV ICONV LANGUAGES POFILES MOFILES PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir BINSH ZIP CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE HAVE_PKG_CONFIG PYTHON_CPPFLAGS SK_CONFIG SCROLLKEEPER_BUILD_REQUIRED GNOMEHELP GPREFIX GNOMEINC GNOMELIB LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -632,7 +633,7 @@ done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -672,10 +673,10 @@ if test -z "$srcdir"; then # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -738,7 +739,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gramps 0.99 to adapt to many kinds of systems. +\`configure' configures gramps 1.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -763,9 +764,9 @@ _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -800,7 +801,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gramps 0.99:";; + short | recursive ) echo "Configuration of gramps 1.1.0:";; esac cat <<\_ACEOF @@ -855,12 +856,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. @@ -871,24 +905,23 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then + test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -gramps configure 0.99 -generated by GNU Autoconf 2.57 +gramps configure 1.1.0 +generated by GNU Autoconf 2.59 -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -899,8 +932,8 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gramps $as_me 0.99, which was -generated by GNU Autoconf 2.57. Invocation command line was +It was created by gramps $as_me 1.1.0, which was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -977,19 +1010,19 @@ do 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. @@ -1023,12 +1056,12 @@ _ASBOX case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } @@ -1057,7 +1090,7 @@ _ASBOX for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi @@ -1076,7 +1109,7 @@ _ASBOX echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && + rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -1156,7 +1189,7 @@ fi # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" @@ -1173,13 +1206,13 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. @@ -1236,7 +1269,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version="1.7" +am__api_version="1.6" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -1273,6 +1306,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 @@ -1289,6 +1323,7 @@ do case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -1296,20 +1331,20 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; @@ -1453,7 +1488,7 @@ done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1480,15 +1515,6 @@ echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then @@ -1497,19 +1523,9 @@ echo "$as_me: error: source directory already configured; run \"make distclean\" { (exit 1); exit 1; }; } fi -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - # Define the identity of the package. - PACKAGE='gramps' - VERSION='0.99' + PACKAGE=gramps + VERSION=1.1.0 cat >>confdefs.h <<_ACEOF @@ -1635,7 +1651,7 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -RELEASE=1 +RELEASE=0.CVS$(head -c 10 ${srcdir}/ChangeLog | tr -d '-') VERSIONSTRING=$VERSION if test x"$RELEASE" != "x" @@ -1814,7 +1830,7 @@ if test "${am_cv_pathless_PYTHON+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - for am_cv_pathless_PYTHON in python python2 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 : ; do + for am_cv_pathless_PYTHON in python python2 python2.2 python2.1 python2.0 python1.6 python1.5 : ; do if test "$am_cv_pathless_PYTHON" = : ; then { { echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 echo "$as_me: error: no suitable Python interpreter found" >&2;} @@ -1917,34 +1933,16 @@ echo "${ECHO_T}$am_cv_python_platform" >&6 - echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 -echo $ECHO_N "checking for $am_display_PYTHON script directory... $ECHO_C" >&6 -if test "${am_cv_python_pythondir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || - echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` -fi -echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 -echo "${ECHO_T}$am_cv_python_pythondir" >&6 - pythondir=$am_cv_python_pythondir + + pythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/site-packages pkgpythondir=\${pythondir}/$PACKAGE - echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 -echo $ECHO_N "checking for $am_display_PYTHON extension module directory... $ECHO_C" >&6 -if test "${am_cv_python_pyexecdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || - echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"` -fi -echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 -echo "${ECHO_T}$am_cv_python_pyexecdir" >&6 - pyexecdir=$am_cv_python_pyexecdir + + pyexecdir=${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages @@ -2372,7 +2370,6 @@ ac_compiler=`set X $ac_compile; echo $2` (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2392,8 +2389,8 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 @@ -2413,23 +2410,23 @@ do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; + ;; conftest.$ac_ext ) - # This is the source file. - ;; + # This is the source file. + ;; [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; + # We found the default executable, but exeext='' is most + # certainly right. + break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; * ) - break;; + break;; esac done else @@ -2503,8 +2500,8 @@ for ac_file in conftest.exe conftest conftest.*; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + export ac_cv_exeext + break;; * ) break;; esac done @@ -2529,7 +2526,6 @@ if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2580,7 +2576,6 @@ if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2600,11 +2595,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2617,7 +2621,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -2633,7 +2637,6 @@ if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2650,11 +2653,20 @@ main () _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2667,7 +2679,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 @@ -2694,7 +2706,6 @@ else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2722,6 +2733,16 @@ static char *f (char * (*g) (char **, int), char **p, ...) va_end (v); return s; } + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2748,11 +2769,20 @@ do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2765,7 +2795,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.$ac_objext +rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC @@ -2793,19 +2823,27 @@ cat >conftest.$ac_ext <<_ACEOF _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ - ''\ - '#include ' \ + '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ @@ -2813,14 +2851,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include $ac_declaration +#include int main () { @@ -2831,11 +2868,20 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2848,9 +2894,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 continue fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2867,11 +2912,20 @@ exit (42); _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2883,7 +2937,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then @@ -2897,22 +2951,30 @@ else sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" +rm -f .deps 2>/dev/null +mkdir .deps 2>/dev/null +if test -d .deps; then + DEPDIR=.deps +else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps +fi +rmdir .deps 2>/dev/null + ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' -am__doit: +doit: @echo done -.PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 @@ -2927,7 +2989,7 @@ echo "include confinc" > confmf # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then +if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU @@ -2987,32 +3049,18 @@ else # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - : > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) @@ -3030,20 +3078,13 @@ else # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # (even with -Werror). So we grep stderr for any message - # that says an option was ignored. - if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi + am_cv_CC_dependencies_compiler_type=$depmode + break fi done @@ -3060,18 +3101,6 @@ CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type -if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 @@ -3397,13 +3426,13 @@ _ACEOF # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | @@ -3433,13 +3462,13 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ + ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; +s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; -s/^[^=]*=[ ]*$//; +s/^[^=]*=[ ]*$//; }' fi @@ -3453,13 +3482,13 @@ fi cat >confdef2opt.sed <<\_ACEOF t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g @@ -3481,7 +3510,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' @@ -3498,13 +3527,6 @@ echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -3539,9 +3561,10 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -3560,7 +3583,7 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -3739,16 +3762,17 @@ rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -3774,8 +3798,8 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by gramps $as_me 0.99, which was -generated by GNU Autoconf 2.57. Invocation command line was +This file was extended by gramps $as_me 1.1.0, which was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -3819,7 +3843,7 @@ Usage: $0 [OPTIONS] [FILE]... -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE Configuration files: $config_files @@ -3832,12 +3856,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -gramps config.status 0.99 -configured by $0, generated by GNU Autoconf 2.57, +gramps config.status 1.1.0 +configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir @@ -4051,7 +4074,6 @@ s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t @@ -4066,7 +4088,6 @@ s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t -s,@am__leading_dot@,$am__leading_dot,;t t s,@RELEASE@,$RELEASE,;t t s,@VERSIONSTRING@,$VERSIONSTRING,;t t s,@MSGFMT@,$MSGFMT,;t t @@ -4100,8 +4121,6 @@ s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t -s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t -s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@HAVE_PKG_CONFIG@,$HAVE_PKG_CONFIG,;t t s,@PYTHON_CPPFLAGS@,$PYTHON_CPPFLAGS,;t t s,@SK_CONFIG@,$SK_CONFIG,;t t @@ -4141,9 +4160,9 @@ _ACEOF (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end @@ -4161,21 +4180,21 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -4191,10 +4210,10 @@ echo X"$ac_file" | as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -4232,12 +4251,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac case $INSTALL in @@ -4245,11 +4297,6 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -4259,7 +4306,7 @@ echo "$as_me: creating $ac_file" >&6;} configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." + sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. @@ -4268,26 +4315,32 @@ echo "$as_me: creating $ac_file" >&6;} case $f in -) echo $tmp/stdin ;; [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - echo $f;; + echo "$f";; *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - fi;; + fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub @@ -4327,16 +4380,41 @@ for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. if test "$ac_dir" != .; then @@ -4362,12 +4440,45 @@ case $srcdir in ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 @@ -4385,10 +4496,10 @@ echo "$as_me: executing $ac_dest commands" >&6;} if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -4424,10 +4535,10 @@ echo X"$mf" | test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -4443,10 +4554,10 @@ echo X"$file" | as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } diff --git a/configure.in b/configure.in index e793565ec..f9660283e 100644 --- a/configure.in +++ b/configure.in @@ -2,11 +2,11 @@ dnl Process this file with autoconf to produce a configure script. dnl May need to run automake && aclocal first AC_PREREQ(2.57) -AC_INIT(gramps, 0.99, gramps-bugs@lists.sourceforge.net) +AC_INIT(gramps, 1.1.0, gramps-bugs@lists.sourceforge.net) AC_CONFIG_SRCDIR(src/gramps.py) AM_INIT_AUTOMAKE(1.6.3) -dnl RELEASE=0.CVS$(head -c 10 ${srcdir}/ChangeLog | tr -d '-') -RELEASE=1 +RELEASE=0.CVS$(head -c 10 ${srcdir}/ChangeLog | tr -d '-') +dnl RELEASE=1 VERSIONSTRING=$VERSION if test x"$RELEASE" != "x" diff --git a/src/Relationship.py b/src/Relationship.py index 5a1cb5faf..443929bab 100644 --- a/src/Relationship.py +++ b/src/Relationship.py @@ -27,7 +27,7 @@ #------------------------------------------------------------------------- import RelLib -import GrampsCfg +import types from gettext import gettext as _ #------------------------------------------------------------------------- @@ -247,32 +247,34 @@ class RelationshipCalculator: return 0 return 0 - def get_relationship(self,orig_person,other_person): + def get_relationship_distance(self,orig_person,other_person): """ - returns a string representping the relationshp between the two people, - along with a list of common ancestors (typically father,mother) + Returns a tuple (firstRel,secondRel,common): + + firstRel Number of generations from the orig_person to their + closest common ancestor + secondRel Number of generations from the other_person to their + closest common ancestor + common list of their common ancestors, the closest is the first + + is returned """ + + firstRel = -1 + secondRel = -1 + common = [] + firstMap = {} firstList = [] secondMap = {} secondList = [] - common = [] rank = 9999999 - if orig_person == None: - return ("undefined",[]) - - if orig_person == other_person: - return ('', []) - - if self.is_spouse(orig_person,other_person): - return ("spouse",[]) - try: self.apply_filter(orig_person,0,firstList,firstMap) self.apply_filter(other_person,0,secondList,secondMap) except RuntimeError,msg: - return (_("Relationship loop detected"),None) + return (firstRel,secondRel,_("Relationship loop detected")) for person_id in firstList: if person_id in secondList: @@ -283,17 +285,38 @@ class RelationshipCalculator: elif new_rank == rank: common.append(person_id) - firstRel = -1 - secondRel = -1 - if common: person_id = common[0] secondRel = firstMap[person_id] firstRel = secondMap[person_id] - if firstRel == -1: + return (firstRel,secondRel,common) + + def get_relationship(self,orig_person,other_person): + """ + returns a string representping the relationshp between the two people, + along with a list of common ancestors (typically father,mother) + """ + + if orig_person == None: + return ("undefined",[]) + + if orig_person == other_person: + return ('', []) + + if self.is_spouse(orig_person,other_person): + return ("spouse",[]) + + (firstRel,secondRel,common) = self.get_relationship_distance(orig_person,other_person) + + if type(common) == types.StringType or type(common) == types.UnicodeType: + return (common,[]) + elif common: + person_id = common[0] + else: return ("",[]) - elif firstRel == 0: + + if firstRel == 0: if secondRel == 0: return ('',common) elif other_person.get_gender() == RelLib.Person.male: @@ -327,42 +350,21 @@ class RelationshipCalculator: returns a string representing the relationshp between the two people, along with a list of common ancestors (typically father,mother) """ - firstMap = {} - firstList = [] - secondMap = {} - secondList = [] - common = [] - rank = 9999999 - if orig_person == None: return ("undefined",[]) if orig_person == other_person: return ('', []) - try: - self.apply_filter(orig_person,0,firstList,firstMap) - self.apply_filter(other_person,0,secondList,secondMap) - except RuntimeError,msg: - return (_("Relationship loop detected"),None) - - for person_id in firstList: - if person_id in secondList: - new_rank = firstMap[person_id] - if new_rank < rank: - rank = new_rank - common = [ person_id ] - elif new_rank == rank: - common.append(person_id) - - firstRel = -1 - secondRel = -1 - - if common: + (firstRel,secondRel,common) = self.get_relationship_distance(orig_person,other_person) + + if type(common) == types.StringType or type(common) == types.UnicodeType: + return (common,[]) + elif common: person_id = common[0] - secondRel = firstMap[person_id] - firstRel = secondMap[person_id] - + else: + return ("",[]) + if firstRel == 0: if secondRel == 0: return ('',common) diff --git a/src/plugins/rel_de.py b/src/plugins/rel_de.py index 5286bfbed..78c789942 100644 --- a/src/plugins/rel_de.py +++ b/src/plugins/rel_de.py @@ -34,6 +34,7 @@ import RelLib import Relationship +import types from gettext import gettext as _ #------------------------------------------------------------------------- @@ -341,50 +342,25 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): Special cases: relation strings "", "undefined" and "spouse". """ - firstMap = {} - firstList = [] - secondMap = {} - secondList = [] - common = [] - rank = 9999999 - if orig_person == None: return ("undefined",[]) - firstName = orig_person.get_primary_name().get_regular_name() - secondName = other_person.get_primary_name().get_regular_name() - if orig_person == other_person: return ('', []) + if self.is_spouse(orig_person,other_person): return ("spouse",[]) - try: - self.apply_filter(orig_person,0,firstList,firstMap) - self.apply_filter(other_person,0,secondList,secondMap) - except RuntimeError,msg: - return (_("Relationship loop detected"),None) - - for person_id in firstList: - if person_id in secondList: - new_rank = firstMap[person_id] - if new_rank < rank: - rank = new_rank - common = [ person_id ] - elif new_rank == rank: - common.append(person_id) - - firstRel = -1 - secondRel = -1 - - if common: + (firstRel,secondRel,common) = self.get_relationship_distance(orig_person,other_person) + + if type(common) == types.StringType or type(common) == types.UnicodeType: + return (common,[]) + elif common: person_id = common[0] - secondRel = firstMap[person_id] - firstRel = secondMap[person_id] - - if firstRel == -1: + else: return ("",[]) - elif firstRel == 0: + + if firstRel == 0: if secondRel == 0: return ('',common) elif other_person.get_gender() == RelLib.Person.male: @@ -417,57 +393,6 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): else: return (self.get_junior_female_cousin(secondRel-1,firstRel-1),common) - - def get_grandparents_string(self,orig_person,other_person): - """ - returns a string representing the relationshp between the two people, - along with a list of common ancestors (typically father,mother) - """ - firstMap = {} - firstList = [] - secondMap = {} - secondList = [] - common = [] - rank = 9999999 - - if orig_person == None: - return ("undefined",[]) - - if orig_person == other_person: - return ('', []) - - try: - self.apply_filter(orig_person,0,firstList,firstMap) - self.apply_filter(other_person,0,secondList,secondMap) - except RuntimeError,msg: - return (_("Relationship loop detected"),None) - - for person_id in firstList: - if person_id in secondList: - new_rank = firstMap[person_id] - if new_rank < rank: - rank = new_rank - common = [ person_id ] - elif new_rank == rank: - common.append(person_id) - - firstRel = -1 - secondRel = -1 - - if common: - person = common[0] - secondRel = firstMap[person_id] - firstRel = secondMap[person_id] - - if firstRel == 0: - if secondRel == 0: - return ('',common) - else: - return (self.get_parents(secondRel),common) - else: - return None - - #------------------------------------------------------------------------- # # Register this class with the Plugins system diff --git a/src/plugins/rel_hu.py b/src/plugins/rel_hu.py index 10a8d3424..798cf9b2a 100644 --- a/src/plugins/rel_hu.py +++ b/src/plugins/rel_hu.py @@ -2,7 +2,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2003 Donald N. Allingham +# Copyright (C) 2003-2004 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 @@ -19,6 +19,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# $Id$ + # # Written by Egyeki Gergely , 2004 # @@ -30,10 +32,10 @@ import RelLib import Date - -from Relationship import apply_filter, is_spouse +import Relationship from Plugins import register_relcalc - +import types +from gettext import gettext as _ #------------------------------------------------------------------------- # @@ -53,288 +55,282 @@ _level =\ # Specific relationship functions # #------------------------------------------------------------------------- +class RelationshipCalculator(Relationship.RelationshipCalculator): -def get_parents (level): - if level == 0: return "" - elif level == 1: return "szülei" - elif level == 2: return "nagyszülei" - elif level == 3: return "dédszülei" - elif level == 4: return "ükszülei" - else : return "%s szülei" % _level[level] + def __init__(self,db): + Relationship.RelationshipCalculator.__init__(self,db) + + + def get_parents (self,level): + if level == 0: return "" + elif level == 1: return "szülei" + elif level == 2: return "nagyszülei" + elif level == 3: return "dédszülei" + elif level == 4: return "ükszülei" + else : return "%s szülei" % _level[level] -def get_father (level): - if level == 0: return "" - elif level == 1: return "apja" - elif level == 2: return "nagyapja" - elif level == 3: return "dédapja" - elif level == 4: return "ükapja" - else : return "%s ükapja" % (_level[level]) + def get_father (self,level): + if level == 0: return "" + elif level == 1: return "apja" + elif level == 2: return "nagyapja" + elif level == 3: return "dédapja" + elif level == 4: return "ükapja" + else : return "%s ükapja" % (_level[level]) -def get_mother (level): - if level == 0: return "" - elif level == 1: return "anyja" - elif level == 2: return "nagyanyja" - elif level == 3: return "dédanyja" - elif level == 4: return "ükanyja" - else : return "%s ükanyja" % (_level[level]) + def get_mother (self,level): + if level == 0: return "" + elif level == 1: return "anyja" + elif level == 2: return "nagyanyja" + elif level == 3: return "dédanyja" + elif level == 4: return "ükanyja" + else : return "%s ükanyja" % (_level[level]) -def get_son (level): - if level == 0: return "" - elif level == 1: return "fia" - elif level == 2: return "unokája" - elif level == 3: return "dédunokája" - elif level == 4: return "ükunokája" - else : return "%s unokája" % (_level[level]) + def get_son (self,level): + if level == 0: return "" + elif level == 1: return "fia" + elif level == 2: return "unokája" + elif level == 3: return "dédunokája" + elif level == 4: return "ükunokája" + else : return "%s unokája" % (_level[level]) -def get_daughter (level): - if level == 0: return "" - elif level == 1: return "lánya" - else : return get_son(level) + def get_daughter (self,level): + if level == 0: return "" + elif level == 1: return "lánya" + else : return self.get_son(level) -def get_uncle (level): - if level == 0: return "" - elif level == 1: return "testvére" - elif level == 2: return "nagybátyja" - else : return "%s nagybátyja" % (_level[level]) + def get_uncle (self,level): + if level == 0: return "" + elif level == 1: return "testvére" + elif level == 2: return "nagybátyja" + else : return "%s nagybátyja" % (_level[level]) -def get_aunt (level): - if level == 0: return "" - elif level == 1: return "testvére" - elif level == 2: return "nagynénje" - else : return "%s nagynénje" % (_level[level]) + def get_aunt (self,level): + if level == 0: return "" + elif level == 1: return "testvére" + elif level == 2: return "nagynénje" + else : return "%s nagynénje" % (_level[level]) -def get_nephew (level): - if level == 0: return "" - elif level == 1: return "unokája" - else : return "%s unokája" % (_level[level]) + def get_nephew (self,level): + if level == 0: return "" + elif level == 1: return "unokája" + else : return "%s unokája" % (_level[level]) -def get_niece(level): - return get_nephew(level) + def get_niece(self,level): + return self.get_nephew(level) -def get_male_cousin (level): - if level == 0: return "" - elif level == 1: return "unokatestvére" - else : return "%s unokatestvére" % (_level[level]) + def get_male_cousin (self,level): + if level == 0: return "" + elif level == 1: return "unokatestvére" + else : return "%s unokatestvére" % (_level[level]) -def get_female_cousin (level): - return get_male_cousin(level) + def get_female_cousin (self,level): + return self.get_male_cousin(level) -#---------------------------------------------- -# -# brother and sister age differences -# -#---------------------------------------------- + #---------------------------------------------- + # + # brother and sister age differences + # + #---------------------------------------------- -def get_age_comp(orig_person,other_person): - # 0=nothing, -1=other is younger 1=other is older - orig_birth_event = orig_person.get_birth() - orig_birth_date = orig_birth_event.get_date_object() - other_birth_event = other_person.get_birth() - other_birth_date = other_birth_event.get_date_object() - if (orig_birth_date == "")or(other_birth_date == "") :return 0 - else :return Date.compare_dates(orig_birth_date,other_birth_date) + def get_age_comp(self,orig_person,other_person): + # 0=nothing, -1=other is younger 1=other is older + orig_birth_event = orig_person.get_birth() + orig_birth_date = orig_birth_event.get_date_object() + other_birth_event = other_person.get_birth() + other_birth_date = other_birth_event.get_date_object() + if (orig_birth_date == "")or(other_birth_date == "") :return 0 + else :return Date.compare_dates(orig_birth_date,other_birth_date) -def get_age_brother (level): - if level == 0 : return "testvére" - elif level == 1 : return "öccse" - else : return "bátyja" + def get_age_brother (self,level): + if level == 0 : return "testvére" + elif level == 1 : return "öccse" + else : return "bátyja" -def get_age_sister (level): - if level == 0 : return "testvére" - elif level == 1 : return "húga" - else : return "nővére" + def get_age_sister (self,level): + if level == 0 : return "testvére" + elif level == 1 : return "húga" + else : return "nővére" -#--------------------------------------------- -# -# en: father-in-law, mother-in-law, son-in-law, daughter-in-law -# hu: após, anyós, vő, meny -# -#--------------------------------------------- + #--------------------------------------------- + # + # en: father-in-law, mother-in-law, son-in-law, daughter-in-law + # hu: após, anyós, vő, meny + # + #--------------------------------------------- -def is_fathermother_in_law(orig,other): - for f in other.getFamilyList(): - if other == f.getFather(): sp = f.getMother() - elif other == f.getMother() : sp = f.getFather() - for g in orig.getFamilyList(): - if sp in g.getChildList(): return 1 - return 0 + def is_fathermother_in_law(self,orig,other): + for f in other.get_family_id_list(): + family = self.db.find_family_from_id(f) + sp_id = None + if family: + if other == family.get_father_id(): + sp_id = family.get_mother_id() + elif other == family.get_mother_id(): + sp_id = family.get_father_id() + for g in orig.get_family_id_list(): + family = self.db.find_family_from_id(g) + if family: + if sp_id in family.get_child_id_list(): + return 1 + return 0 -def get_fathermother_in_law_common(orig,other): - for f in other.getFamilyList(): - if other == f.getFather(): sp = f.getMother() - elif other == f.getMother() : sp = f.getFather() - for g in orig.getFamilyList(): - if sp in g.getChildList(): return [sp] - return [] + def get_fathermother_in_law_common(self,orig,other): + for f in other.get_family_id_list(): + family = self.db.find_family_from_id(f) + sp_id = None + if family: + if other == family.get_father_id(): + sp_id = family.get_mother_id() + elif other == family.get_mother_id(): + sp_id = family.get_father_idr() + for g in orig.get_family_id_list(): + family = self.db.find_family_from_id(g) + if family: + if sp_id in family.get_child_id_list(): + return [sp] + return [] -#------------------------------------------------------------------------ -# -# hu: sógor, sógornő -# en: brother-in-law, sister-in-law -# -#------------------------------------------------------------------------ + #------------------------------------------------------------------------ + # + # hu: sógor, sógornő + # en: brother-in-law, sister-in-law + # + #------------------------------------------------------------------------ -def is_brothersister_in_law(orig,other): - for f in orig.getFamilyList(): - if orig == f.getFather(): sp = f.getMother() - elif orig == f.getMother() : sp = f.getFather() - p = other.getMainParents() - if (p != None): - c= p.getChildList() - if (other in c)and(sp in c): return 1 - return 0 + def is_brothersister_in_law(self,orig,other): + for f in orig.get_family_id_list(): + family = self.db.find_family_from_id(f) + sp_id = None + if family: + if orig == family.get_father_id(): + sp_id = family.get_mother_id() + elif other == family.get_mother_id(): + sp_id = family.get_father_idr() -def get_brothersister_in_law_common(orig,other): - for f in orig.getFamilyList(): - if orig == f.getFather(): sp = f.getMother() - elif orig == f.getMother() : sp = f.getFather() - p = other.getMainParents() - if (p != None): - c= p.getChildList() - if (other in c)and(sp in c): return [sp] - return [] + p = other.get_main_parents_family_id() + family = self.db.find_family_from_id(p) + if family: + c = family.get_child_id_list() + if (other.get_id() in c) and (sp_id in c): + return 1 + return 0 -#------------------------------------------------------------------------- -# -# get_relationship -# -#------------------------------------------------------------------------- + def get_brothersister_in_law_common(self,orig,other): + for f in orig.get_family_id_list(): + family = self.db.find_family_from_id(f) + sp_id = None + if family: + if orig == family.get_father_id(): + sp_id = family.get_mother_id() + elif other == family.get_mother_id(): + sp_id = family.get_father_idr() -def get_relationship(orig_person,other_person): - """ - returns a string representing the relationshp between the two people, - along with a list of common ancestors (typically father,mother) - """ - firstMap = {} - firstList = [] - secondMap = {} - secondList = [] - common = [] - rank = 9999999 + p = other.get_main_parents_family_id() + family = self.db.find_family_from_id(p) + if family: + c = family.get_child_id_list() + if (other.get_id() in c) and (sp_id in c): + return [sp] + return [] + + #------------------------------------------------------------------------- + # + # get_relationship + # + #------------------------------------------------------------------------- + + def get_relationship(self,orig_person,other_person): + """ + returns a string representing the relationshp between the two people, + along with a list of common ancestors (typically father,mother) + """ + + if self.is_fathermother_in_law(other_person,orig_person): + if other_person.getGender() == RelLib.Person.male: + return ("apósa",self.get_fathermother_in_law_common(other_person,orig_person)) + elif other_person.getGender() == RelLib.Person.female: + return ("anyósa",self.get_fathermother_in_law_common(other_person,orig_person)) + elif other_person.getGender() == 2 : + return ("apósa vagy anyósa",self.get_fathermother_in_law_common(other_person,orig_person)) + + if self.is_fathermother_in_law(orig_person,other_person): + if orig_person.getGender() == RelLib.Person.male: + return ("veje",self.get_fathermother_in_law_common(orig_person,other_person)) + elif orig_person.getGender() == RelLib.Person.female: + return ("menye",self.get_fathermother_in_law_common(orig_person,other_person)) + elif orig_person.getGender() == 2 : + return ("veje vagy menye",self.get_fathermother_in_law_common(orig_person,other_person)) + + if self.is_brothersister_in_law(orig_person,other_person): + if other_person.getGender() == RelLib.Person.male: + return ("sógora",self.get_brothersister_in_law_common(orig_person,other_person)) + elif other_person.getGender() == RelLib.Person.female: + return ("sógornője",self.get_brothersister_in_law_common(orig_person,other_person)) + elif other_person.getGender() == 2 : + return ("sógora vagy sógornője",self.get_brothersister_in_law_common(orig_person,other_person)) - if orig_person == None: - return ("nem meghatározható",[]) - - if orig_person == other_person: - return ('', []) - - if is_spouse(orig_person,other_person): - return ("házastársa",[]) - - - if is_fathermother_in_law(other_person,orig_person): - if other_person.getGender() == RelLib.Person.male: - return ("apósa",get_fathermother_in_law_common(other_person,orig_person)) - elif other_person.getGender() == RelLib.Person.female: - return ("anyósa",get_fathermother_in_law_common(other_person,orig_person)) - elif other_person.getGender() == 2 : - return ("apósa vagy anyósa",get_fathermother_in_law_common(other_person,orig_person)) - - if is_fathermother_in_law(orig_person,other_person): - if orig_person.getGender() == RelLib.Person.male: - return ("veje",get_fathermother_in_law_common(orig_person,other_person)) - elif orig_person.getGender() == RelLib.Person.female: - return ("menye",get_fathermother_in_law_common(orig_person,other_person)) - elif orig_person.getGender() == 2 : - return ("veje vagy menye",get_fathermother_in_law_common(orig_person,other_person)) - - if is_brothersister_in_law(orig_person,other_person): - if other_person.getGender() == RelLib.Person.male: - return ("sógora",get_brothersister_in_law_common(orig_person,other_person)) - elif other_person.getGender() == RelLib.Person.female: - return ("sógornője",get_brothersister_in_law_common(orig_person,other_person)) - elif other_person.getGender() == 2 : - return ("sógora vagy sógornője",get_brothersister_in_law_common(orig_person,other_person)) - - - apply_filter(orig_person,0,firstList,firstMap) - apply_filter(other_person,0,secondList,secondMap) - - for person in firstList: - if person in secondList: - new_rank = firstMap[person.get_id()] - if new_rank < rank: - rank = new_rank - common = [ person ] - elif new_rank == rank: - common.append(person) - - firstRel = -1 - secondRel = -1 - - length = len(common) - - if length == 1: - person = common[0] - secondRel = firstMap[person.get_id()] - firstRel = secondMap[person.get_id()] - elif length == 2: - p1 = common[0] - secondRel = firstMap[p1.get_id()] - firstRel = secondMap[p1.get_id()] - elif length > 2: - person = common[0] - secondRel = firstMap[person.get_id()] - firstRel = secondMap[person.get_id()] - - - - if firstRel == -1: - return ("",[]) - - elif firstRel == 0: - if secondRel == 0: - return ('',common) - elif other_person.get_gender() == RelLib.Person.male: - return (get_father(secondRel),common) + (firstRel,secondRel,common) = self.get_relationship_distance(orig_person,other_person) + + if type(common) == types.StringType or type(common) == types.UnicodeType: + return (common,[]) + elif common: + person_id = common[0] else: - return (get_mother(secondRel),common) + return ("",[]) - elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.male: - return (get_son(firstRel),common) - else: - return (get_daughter(firstRel),common) + if firstRel == 0: + if secondRel == 0: + return ('',common) + elif other_person.get_gender() == RelLib.Person.male: + return (self.get_father(secondRel),common) + else: + return (self.get_mother(secondRel),common) - elif firstRel == 1: - if other_person.get_gender() == RelLib.Person.male: - if secondRel == 1: - return (get_age_brother(get_age_comp(orig_person,other_person)),common) - else :return (get_uncle(secondRel),common) - else: - if secondRel == 1: - return (get_age_sister(get_age_comp(orig_person,other_person)),common) - else :return (get_aunt(secondRel),common) + elif secondRel == 0: + if other_person.get_gender() == RelLib.Person.male: + return (self.get_son(firstRel),common) + else: + return (self.get_daughter(firstRel),common) - elif secondRel == 1: - if other_person.get_gender() == RelLib.Person.male: - return (get_nephew(firstRel-1),common) - else: - return (get_niece(firstRel-1),common) + elif firstRel == 1: + if other_person.get_gender() == RelLib.Person.male: + if secondRel == 1: + return (self.get_age_brother(self.get_age_comp(orig_person,other_person)),common) + else :return (self.get_uncle(secondRel),common) + else: + if secondRel == 1: + return (self.get_age_sister(self.get_age_comp(orig_person,other_person)),common) + else :return (self.get_aunt(secondRel),common) + + elif secondRel == 1: + if other_person.get_gender() == RelLib.Person.male: + return (self.get_nephew(firstRel-1),common) + else: + return (self.get_niece(firstRel-1),common) - else: - if other_person.get_gender() == RelLib.Person.male: - return (get_male_cousin(firstRel-1), common) else: - return (get_female_cousin(firstRel-1), common) + if other_person.get_gender() == RelLib.Person.male: + return (self.get_male_cousin(firstRel-1), common) + else: + return (self.get_female_cousin(firstRel-1), common) #------------------------------------------------------------------------- @@ -343,7 +339,7 @@ def get_relationship(orig_person,other_person): # #------------------------------------------------------------------------- -register_relcalc(get_relationship, +register_relcalc(RelationshipCalculator, ["hu", "HU", "hu_HU", "hu_HU.utf8", "hu_HU.UTF8"]) # Local variables: diff --git a/src/plugins/rel_ru.py b/src/plugins/rel_ru.py index 8b25f8a68..48110bc45 100644 --- a/src/plugins/rel_ru.py +++ b/src/plugins/rel_ru.py @@ -33,6 +33,7 @@ import RelLib import Relationship +import types from gettext import gettext as _ #------------------------------------------------------------------------- @@ -204,6 +205,8 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): return 0 return 0 + + def get_relationship(self,orig_person,other_person): """ Returns a string representing the relationshp between the two people, @@ -212,50 +215,25 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): Special cases: relation strings "", "undefined" and "spouse". """ - firstMap = {} - firstList = [] - secondMap = {} - secondList = [] - common = [] - rank = 9999999 - if orig_person == None: return ("undefined",[]) - firstName = orig_person.get_primary_name().get_regular_name() - secondName = other_person.get_primary_name().get_regular_name() - if orig_person == other_person: return ('', []) + if self.is_spouse(orig_person,other_person): return ("spouse",[]) - try: - self.apply_filter(orig_person,0,firstList,firstMap) - self.apply_filter(other_person,0,secondList,secondMap) - except RuntimeError,msg: - return (_("Relationship loop detected"),None) - - for person_id in firstList: - if person_id in secondList: - new_rank = firstMap[person_id] - if new_rank < rank: - rank = new_rank - common = [ person_id ] - elif new_rank == rank: - common.append(person_id) - - firstRel = -1 - secondRel = -1 - - if common: + (firstRel,secondRel,common) = self.get_relationship_distance(orig_person,other_person) + + if type(common) == types.StringType or type(common) == types.UnicodeType: + return (common,[]) + elif common: person_id = common[0] - secondRel = firstMap[person_id] - firstRel = secondMap[person_id] - - if firstRel == -1: + else: return ("",[]) - elif firstRel == 0: + + if firstRel == 0: if secondRel == 0: return ('',common) elif other_person.get_gender() == RelLib.Person.male: @@ -288,57 +266,6 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): else: return (self.get_junior_female_cousin(secondRel-1,firstRel-secondRel),common) - - def get_grandparents_string(self,orig_person,other_person): - """ - returns a string representing the relationshp between the two people, - along with a list of common ancestors (typically father,mother) - """ - firstMap = {} - firstList = [] - secondMap = {} - secondList = [] - common = [] - rank = 9999999 - - if orig_person == None: - return ("undefined",[]) - - if orig_person == other_person: - return ('', []) - - try: - self.apply_filter(orig_person,0,firstList,firstMap) - self.apply_filter(other_person,0,secondList,secondMap) - except RuntimeError,msg: - return (_("Relationship loop detected"),None) - - for person_id in firstList: - if person_id in secondList: - new_rank = firstMap[person_id] - if new_rank < rank: - rank = new_rank - common = [ person_id ] - elif new_rank == rank: - common.append(person_id) - - firstRel = -1 - secondRel = -1 - - if common: - person_id = common[0] - secondRel = firstMap[person_id] - firstRel = secondMap[person_id] - - if firstRel == 0: - if secondRel == 0: - return ('',common) - else: - return (self.get_parents(secondRel),common) - else: - return None - - #------------------------------------------------------------------------- # # Register this class with the Plugins system