diff -Nru grass-7.6.1/AUTHORS grass-7.8.0/AUTHORS --- grass-7.6.1/AUTHORS 2019-03-19 20:04:35.000000000 +0000 +++ grass-7.8.0/AUTHORS 2019-06-27 08:06:44.000000000 +0000 @@ -35,13 +35,13 @@ add "@" and "." as needed. A list of contributors with write access is available in -https://svn.osgeo.org/grass/grass/trunk/contributors.csv +https://github.com/OSGeo/grass/blob/master/contributors.csv A list of contributors without write access is available in -https://svn.osgeo.org/grass/grass/trunk/contributors_extra.csv +https://github.com/OSGeo/grass/blob/master/contributors_extra.csv A list of translators is available in -https://svn.osgeo.org/grass/grass/trunk/translators.csv +https://github.com/OSGeo/grass/blob/master/translators.csv Summary view: Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/ChangeLog_7.8.0.gz and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/ChangeLog_7.8.0.gz differ diff -Nru grass-7.6.1/config.guess grass-7.8.0/config.guess --- grass-7.6.1/config.guess 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/config.guess 2019-08-11 08:05:41.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2018 Free Software Foundation, Inc. +# Copyright 1992-2019 Free Software Foundation, Inc. -timestamp='2018-12-07' +timestamp='2019-07-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 1992-2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -262,6 +262,9 @@ *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; + *:OS108:*:*) + echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; @@ -275,8 +278,8 @@ echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -985,22 +988,50 @@ exit ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" - test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" @@ -1113,7 +1144,7 @@ *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then @@ -1297,38 +1328,39 @@ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build fi - if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; @@ -1433,6 +1465,143 @@ exit ;; esac +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in diff -Nru grass-7.6.1/config.sub grass-7.8.0/config.sub --- grass-7.6.1/config.sub 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/config.sub 2019-08-11 08:05:41.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2018 Free Software Foundation, Inc. +# Copyright 1992-2019 Free Software Foundation, Inc. -timestamp='2018-12-16' +timestamp='2019-06-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 1992-2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -111,6 +111,7 @@ esac # Split fields of configuration type +# shellcheck disable=SC2162 IFS="-" read field1 field2 field3 field4 <&6 echo "configure:1305: checking for $ac_word" >&5 -case "$SVN_VERSION" in +case "$GIT" in /*) - ac_cv_path_SVN_VERSION="$SVN_VERSION" # Let the user override the test with a path. + ac_cv_path_GIT="$GIT" # Let the user override the test with a path. ;; ?:/*) - ac_cv_path_SVN_VERSION="$SVN_VERSION" # Let the user override the test with a dos path. + ac_cv_path_GIT="$GIT" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" @@ -1316,27 +1316,25 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_path_SVN_VERSION="$ac_dir/$ac_word" + ac_cv_path_GIT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_SVN_VERSION" && ac_cv_path_SVN_VERSION="no" + test -z "$ac_cv_path_GIT" && ac_cv_path_GIT="no" ;; esac -SVN_VERSION="$ac_cv_path_SVN_VERSION" -if test -n "$SVN_VERSION"; then - echo "$ac_t""$SVN_VERSION" 1>&6 +GIT="$ac_cv_path_GIT" +if test -n "$GIT"; then + echo "$ac_t""$GIT" 1>&6 else echo "$ac_t""no" 1>&6 fi -if test "$SVN_VERSION" != "no" ; then - GRASS_VERSION_SVN=`$SVN_VERSION -c | cut -f2 -d:` - if test "$GRASS_VERSION_SVN" = "exported" -o "$GRASS_VERSION_SVN" = "Unversioned directory" ; then - GRASS_VERSION_SVN="exported" - else - GRASS_VERSION_SVN="r$GRASS_VERSION_SVN" +if test "$GIT" != "no" ; then + GRASS_VERSION_GIT=`$GIT rev-parse --short HEAD 2>/dev/null` + if test -z "$GRASS_VERSION_GIT"; then + GRASS_VERSION_GIT="exported" fi fi @@ -1362,7 +1360,7 @@ echo $ac_n "checking for MacOSX App""... $ac_c" 1>&6 -echo "configure:1366: checking for MacOSX App" >&5 +echo "configure:1364: checking for MacOSX App" >&5 case "$enable_macosx_app" in yes) MACOSX_APP=1 ;; no) MACOSX_APP= ;; @@ -1374,7 +1372,7 @@ # Check for MacOSX archs echo $ac_n "checking for MacOSX architectures""... $ac_c" 1>&6 -echo "configure:1378: checking for MacOSX architectures" >&5 +echo "configure:1376: checking for MacOSX architectures" >&5 MACOSX_ARCHS= @@ -1403,7 +1401,7 @@ # Check for MacOSX SDK echo $ac_n "checking for MacOSX SDK""... $ac_c" 1>&6 -echo "configure:1407: checking for MacOSX SDK" >&5 +echo "configure:1405: checking for MacOSX SDK" >&5 MACOSX_SDK= @@ -1413,7 +1411,7 @@ ac_safe=`echo "$with_macosx_sdk/SDKSettings.plist" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $with_macosx_sdk/SDKSettings.plist""... $ac_c" 1>&6 -echo "configure:1417: checking for $with_macosx_sdk/SDKSettings.plist" >&5 +echo "configure:1415: checking for $with_macosx_sdk/SDKSettings.plist" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; } @@ -1457,7 +1455,7 @@ echo $ac_n "checking how to build libraries""... $ac_c" 1>&6 -echo "configure:1461: checking how to build libraries" >&5 +echo "configure:1459: checking how to build libraries" >&5 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -1909,7 +1907,7 @@ withval="$with_zstd" : else - with_zstd=no + with_zstd=yes fi @@ -2390,7 +2388,7 @@ # Done checking fortran echo $ac_n "checking for additional include dirs""... $ac_c" 1>&6 -echo "configure:2394: checking for additional include dirs" >&5 +echo "configure:2392: checking for additional include dirs" >&5 case "$with_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to list --with-includes." 1>&2; exit 1; } @@ -2413,7 +2411,7 @@ # With libs option echo $ac_n "checking for additional library dirs""... $ac_c" 1>&6 -echo "configure:2417: checking for additional library dirs" >&5 +echo "configure:2415: checking for additional library dirs" >&5 case "$with_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory list to --with-libs." 1>&2; exit 1; } @@ -2447,7 +2445,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2451: checking for a BSD compatible install" >&5 +echo "configure:2449: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" @@ -2500,7 +2498,7 @@ # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2504: checking for $ac_word" >&5 +echo "configure:2502: checking for $ac_word" >&5 if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. @@ -2531,13 +2529,13 @@ *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:2535: checking for yywrap in -l$ac_lib" >&5 +echo "configure:2533: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2573,7 +2571,7 @@ # Extract the first word of "lex", so it can be a program name with args. set dummy lex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2577: checking for $ac_word" >&5 +echo "configure:2575: checking for $ac_word" >&5 case "$LEXPATH" in /*) @@ -2613,7 +2611,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2617: checking for $ac_word" >&5 +echo "configure:2615: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -2644,7 +2642,7 @@ # Extract the first word of "yacc", so it can be a program name with args. set dummy yacc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2648: checking for $ac_word" >&5 +echo "configure:2646: checking for $ac_word" >&5 case "$YACCPATH" in /*) @@ -2682,7 +2680,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2686: checking for $ac_word" >&5 +echo "configure:2684: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -2711,7 +2709,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2715: checking for $ac_word" >&5 +echo "configure:2713: checking for $ac_word" >&5 if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -2742,7 +2740,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2746: checking for $ac_word" >&5 +echo "configure:2744: checking for $ac_word" >&5 if test -n "$ENV"; then ac_cv_prog_ENV="$ENV" # Let the user override the test. @@ -2771,7 +2769,7 @@ # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2775: checking for $ac_word" >&5 +echo "configure:2773: checking for $ac_word" >&5 case "$PERL" in /*) @@ -2802,7 +2800,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2806: checking how to run the C preprocessor" >&5 +echo "configure:2804: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2815,13 +2813,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2832,13 +2830,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2849,13 +2847,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2879,10 +2877,10 @@ echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2883: checking for ANSI C header files" >&5 +echo "configure:2881: checking for ANSI C header files" >&5 cat > conftest.$ac_ext < #include @@ -2890,7 +2888,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2907,7 +2905,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2925,7 +2923,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2946,7 +2944,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2957,7 +2955,7 @@ exit (0); } EOF -if { (eval echo configure:2961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2984,15 +2982,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2988: checking for $ac_hdr" >&5 +echo "configure:2986: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3021,15 +3019,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3025: checking for $ac_hdr" >&5 +echo "configure:3023: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3058,15 +3056,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3062: checking for $ac_hdr" >&5 +echo "configure:3060: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3095,15 +3093,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3099: checking for $ac_hdr" >&5 +echo "configure:3097: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3132,15 +3130,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3136: checking for $ac_hdr" >&5 +echo "configure:3134: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3166,10 +3164,10 @@ done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3170: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3168: checking whether time.h and sys/time.h may both be included" >&5 cat > conftest.$ac_ext < #include @@ -3178,7 +3176,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3182: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3198,10 +3196,10 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3202: checking for off_t" >&5 +echo "configure:3200: checking for off_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3228,10 +3226,10 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3232: checking for uid_t in sys/types.h" >&5 +echo "configure:3230: checking for uid_t in sys/types.h" >&5 cat > conftest.$ac_ext < EOF @@ -3259,10 +3257,10 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3263: checking return type of signal handlers" >&5 +echo "configure:3261: checking return type of signal handlers" >&5 cat > conftest.$ac_ext < #include @@ -3279,7 +3277,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3297,10 +3295,10 @@ echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:3301: checking for Cygwin environment" >&5 +echo "configure:3299: checking for Cygwin environment" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -3329,10 +3327,10 @@ for ac_func in ftime gethostname gettimeofday lseek nice time uname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3333: checking for $ac_func" >&5 +echo "configure:3331: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3381,10 +3379,10 @@ for ac_func in seteuid setpriority setreuid setruid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3385: checking for $ac_func" >&5 +echo "configure:3383: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3433,10 +3431,10 @@ for ac_func in drand48 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3437: checking for $ac_func" >&5 +echo "configure:3435: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3485,10 +3483,10 @@ for ac_func in putenv setenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3489: checking for $ac_func" >&5 +echo "configure:3487: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3537,10 +3535,10 @@ for ac_func in nanosleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3541: checking for $ac_func" >&5 +echo "configure:3539: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3588,13 +3586,13 @@ if test "$cross_compiling" != "yes" ; then echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:3592: checking whether setpgrp takes no argument" >&5 +echo "configure:3590: checking whether setpgrp takes no argument" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -3642,16 +3640,16 @@ fi echo $ac_n "checking for long long int""... $ac_c" 1>&6 -echo "configure:3646: checking for long long int" >&5 +echo "configure:3644: checking for long long int" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -3671,16 +3669,16 @@ rm -f conftest* echo $ac_n "checking for int64_t""... $ac_c" 1>&6 -echo "configure:3675: checking for int64_t" >&5 +echo "configure:3673: checking for int64_t" >&5 cat > conftest.$ac_ext < int main() { int64_t x; ; return 0; } EOF -if { (eval echo configure:3684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -3700,7 +3698,7 @@ rm -f conftest* echo $ac_n "checking for W11""... $ac_c" 1>&6 -echo "configure:3704: checking for W11" >&5 +echo "configure:3702: checking for W11" >&5 case "$enable_w11" in yes|no) echo "$ac_t"""$enable_w11"" 1>&6 ;; *) { echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; } ;; @@ -3728,7 +3726,7 @@ # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:3732: checking for X" >&5 +echo "configure:3730: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -3788,12 +3786,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3862,14 +3860,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -3974,17 +3972,17 @@ case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:3978: checking whether -R must be followed by a space" >&5 +echo "configure:3976: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -4000,14 +3998,14 @@ else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -4039,13 +4037,13 @@ # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:4043: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:4041: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4077,13 +4075,13 @@ if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:4081: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:4079: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4122,10 +4120,10 @@ # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:4126: checking for gethostbyname" >&5 +echo "configure:4124: checking for gethostbyname" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -4168,13 +4166,13 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4172: checking for gethostbyname in -lnsl" >&5 +echo "configure:4170: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4214,10 +4212,10 @@ # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:4218: checking for connect" >&5 +echo "configure:4216: checking for connect" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -4260,13 +4258,13 @@ if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:4264: checking for connect in -lsocket" >&5 +echo "configure:4262: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4300,10 +4298,10 @@ # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:4304: checking for remove" >&5 +echo "configure:4302: checking for remove" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -4346,13 +4344,13 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:4350: checking for remove in -lposix" >&5 +echo "configure:4348: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4386,10 +4384,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:4390: checking for shmat" >&5 +echo "configure:4388: checking for shmat" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -4432,13 +4430,13 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:4436: checking for shmat in -lipc" >&5 +echo "configure:4434: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4481,13 +4479,13 @@ # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:4485: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:4483: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4538,12 +4536,12 @@ LIBS="" echo $ac_n "checking for library containing cuserid""... $ac_c" 1>&6 -echo "configure:4542: checking for library containing cuserid" >&5 +echo "configure:4540: checking for library containing cuserid" >&5 ac_func_search_save_LIBS="$LIBS" ac_cv_search_cuserid="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_cuserid="none required" else @@ -4565,7 +4563,7 @@ test "$ac_cv_search_cuserid" = "no" && for i in compat; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_cuserid="-l$i" break @@ -4602,10 +4600,10 @@ for ac_func in asprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4606: checking for $ac_func" >&5 +echo "configure:4604: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4655,10 +4653,10 @@ # Test if mathlib needs -lm flag or is included with libc echo $ac_n "checking for atan""... $ac_c" 1>&6 -echo "configure:4659: checking for atan" >&5 +echo "configure:4657: checking for atan" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_atan=yes" else @@ -4699,13 +4697,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for atan in -lm""... $ac_c" 1>&6 -echo "configure:4703: checking for atan in -lm" >&5 +echo "configure:4701: checking for atan in -lm" >&5 ac_lib_var=`echo m'_'atan | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4743,10 +4741,10 @@ echo $ac_n "checking for dlsym""... $ac_c" 1>&6 -echo "configure:4747: checking for dlsym" >&5 +echo "configure:4745: checking for dlsym" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlsym=yes" else @@ -4787,13 +4785,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlsym in -ldl""... $ac_c" 1>&6 -echo "configure:4791: checking for dlsym in -ldl" >&5 +echo "configure:4789: checking for dlsym in -ldl" >&5 ac_lib_var=`echo dl'_'dlsym | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4831,10 +4829,10 @@ echo $ac_n "checking for iconv""... $ac_c" 1>&6 -echo "configure:4835: checking for iconv" >&5 +echo "configure:4833: checking for iconv" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_iconv=yes" else @@ -4875,13 +4873,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6 -echo "configure:4879: checking for iconv in -liconv" >&5 +echo "configure:4877: checking for iconv in -liconv" >&5 ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-liconv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4911,13 +4909,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for iconv in -lgiconv""... $ac_c" 1>&6 -echo "configure:4915: checking for iconv in -lgiconv" >&5 +echo "configure:4913: checking for iconv in -lgiconv" >&5 ac_lib_var=`echo giconv'_'iconv | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lgiconv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4947,10 +4945,10 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for libiconv""... $ac_c" 1>&6 -echo "configure:4951: checking for libiconv" >&5 +echo "configure:4949: checking for libiconv" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_libiconv=yes" else @@ -4991,13 +4989,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for libiconv in -liconv""... $ac_c" 1>&6 -echo "configure:4995: checking for libiconv in -liconv" >&5 +echo "configure:4993: checking for libiconv in -liconv" >&5 ac_lib_var=`echo iconv'_'libiconv | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-liconv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5027,13 +5025,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for libiconv in -lgiconv""... $ac_c" 1>&6 -echo "configure:5031: checking for libiconv in -lgiconv" >&5 +echo "configure:5029: checking for libiconv in -lgiconv" >&5 ac_lib_var=`echo giconv'_'libiconv | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lgiconv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5081,10 +5079,10 @@ have_socket=1 echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:5085: checking for socket" >&5 +echo "configure:5083: checking for socket" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -5125,13 +5123,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:5129: checking for socket in -lsocket" >&5 +echo "configure:5127: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5190,7 +5188,7 @@ echo $ac_n "checking for location of zlib includes""... $ac_c" 1>&6 -echo "configure:5194: checking for location of zlib includes" >&5 +echo "configure:5192: checking for location of zlib includes" >&5 case "$with_zlib_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-zlib-includes." 1>&2; exit 1; } @@ -5216,15 +5214,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5220: checking for $ac_hdr" >&5 +echo "configure:5218: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5258,7 +5256,7 @@ echo $ac_n "checking for location of zlib library""... $ac_c" 1>&6 -echo "configure:5262: checking for location of zlib library" >&5 +echo "configure:5260: checking for location of zlib library" >&5 case "$with_zlib_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-zlib-libs." 1>&2; exit 1; } @@ -5283,13 +5281,13 @@ echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:5287: checking for deflate in -lz" >&5 +echo "configure:5285: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5346,7 +5344,7 @@ echo $ac_n "checking whether to use bzlib""... $ac_c" 1>&6 -echo "configure:5350: checking whether to use bzlib" >&5 +echo "configure:5348: checking whether to use bzlib" >&5 echo "$ac_t"""$with_bzlib"" 1>&6 case "$with_bzlib" in "no") USE_BZIP2= ;; @@ -5362,7 +5360,7 @@ echo $ac_n "checking for location of bzlib includes""... $ac_c" 1>&6 -echo "configure:5366: checking for location of bzlib includes" >&5 +echo "configure:5364: checking for location of bzlib includes" >&5 case "$with_bzlib_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-bzlib-includes." 1>&2; exit 1; } @@ -5388,15 +5386,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5392: checking for $ac_hdr" >&5 +echo "configure:5390: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5430,7 +5428,7 @@ echo $ac_n "checking for location of bzlib library""... $ac_c" 1>&6 -echo "configure:5434: checking for location of bzlib library" >&5 +echo "configure:5432: checking for location of bzlib library" >&5 case "$with_bzlib_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-bzlib-libs." 1>&2; exit 1; } @@ -5455,13 +5453,13 @@ echo $ac_n "checking for BZ2_bzBuffToBuffCompress in -lbz2""... $ac_c" 1>&6 -echo "configure:5459: checking for BZ2_bzBuffToBuffCompress in -lbz2" >&5 +echo "configure:5457: checking for BZ2_bzBuffToBuffCompress in -lbz2" >&5 ac_lib_var=`echo bz2'_'BZ2_bzBuffToBuffCompress | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lbz2 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5520,7 +5518,7 @@ echo $ac_n "checking whether to use zstd""... $ac_c" 1>&6 -echo "configure:5524: checking whether to use zstd" >&5 +echo "configure:5522: checking whether to use zstd" >&5 echo "$ac_t"""$with_zstd"" 1>&6 case "$with_zstd" in "no") USE_ZSTD= ;; @@ -5536,7 +5534,7 @@ echo $ac_n "checking for location of zstd includes""... $ac_c" 1>&6 -echo "configure:5540: checking for location of zstd includes" >&5 +echo "configure:5538: checking for location of zstd includes" >&5 case "$with_zstd_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-zstd-includes." 1>&2; exit 1; } @@ -5561,15 +5559,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5565: checking for $ac_hdr" >&5 +echo "configure:5563: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5573: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5603,7 +5601,7 @@ echo $ac_n "checking for location of zstd library""... $ac_c" 1>&6 -echo "configure:5607: checking for location of zstd library" >&5 +echo "configure:5605: checking for location of zstd library" >&5 case "$with_zstd_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-zstd-libs." 1>&2; exit 1; } @@ -5628,13 +5626,13 @@ echo $ac_n "checking for ZSTD_compress in -lzstd""... $ac_c" 1>&6 -echo "configure:5632: checking for ZSTD_compress in -lzstd" >&5 +echo "configure:5630: checking for ZSTD_compress in -lzstd" >&5 ac_lib_var=`echo zstd'_'ZSTD_compress | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lzstd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5696,7 +5694,7 @@ echo $ac_n "checking for location of External PROJ includes""... $ac_c" 1>&6 -echo "configure:5700: checking for location of External PROJ includes" >&5 +echo "configure:5698: checking for location of External PROJ includes" >&5 case "$with_proj_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-proj-includes." 1>&2; exit 1; } @@ -5723,15 +5721,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5727: checking for $ac_hdr" >&5 +echo "configure:5725: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5763,7 +5761,7 @@ if test $PROJ4API = 0 ; then echo $ac_n "checking External PROJ major version""... $ac_c" 1>&6 -echo "configure:5767: checking External PROJ major version" >&5 +echo "configure:5765: checking External PROJ major version" >&5 ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" if test "$cross_compiling" = yes; then @@ -5771,7 +5769,7 @@ echo "$ac_t""unknown (cross-compiling)" 1>&6 else cat > conftest.$ac_ext < @@ -5783,7 +5781,7 @@ } EOF -if { (eval echo configure:5787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then proj_ver_major=`cat conftestdata` echo "$ac_t""$proj_ver_major" 1>&6 @@ -5800,7 +5798,7 @@ echo $ac_n "checking External PROJ minor version""... $ac_c" 1>&6 -echo "configure:5804: checking External PROJ minor version" >&5 +echo "configure:5802: checking External PROJ minor version" >&5 ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" if test "$cross_compiling" = yes; then @@ -5808,7 +5806,7 @@ echo "$ac_t""unknown (cross-compiling)" 1>&6 else cat > conftest.$ac_ext < @@ -5820,7 +5818,7 @@ } EOF -if { (eval echo configure:5824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then proj_ver_minor=`cat conftestdata` echo "$ac_t""$proj_ver_minor" 1>&6 @@ -5837,7 +5835,7 @@ echo $ac_n "checking External PROJ patch version""... $ac_c" 1>&6 -echo "configure:5841: checking External PROJ patch version" >&5 +echo "configure:5839: checking External PROJ patch version" >&5 ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" if test "$cross_compiling" = yes; then @@ -5845,7 +5843,7 @@ echo "$ac_t""unknown (cross-compiling)" 1>&6 else cat > conftest.$ac_ext < @@ -5857,7 +5855,7 @@ } EOF -if { (eval echo configure:5861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then proj_ver_patch=`cat conftestdata` echo "$ac_t""$proj_ver_patch" 1>&6 @@ -5887,7 +5885,7 @@ echo $ac_n "checking for location of External PROJ library""... $ac_c" 1>&6 -echo "configure:5891: checking for location of External PROJ library" >&5 +echo "configure:5889: checking for location of External PROJ library" >&5 case "$with_proj_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-proj-libs." 1>&2; exit 1; } @@ -5911,13 +5909,13 @@ echo $ac_n "checking for proj_pj_info in -lproj""... $ac_c" 1>&6 -echo "configure:5915: checking for proj_pj_info in -lproj" >&5 +echo "configure:5913: checking for proj_pj_info in -lproj" >&5 ac_lib_var=`echo proj'_'proj_pj_info | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lproj $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5971,15 +5969,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5975: checking for $ac_hdr" >&5 +echo "configure:5973: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5983: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6015,7 +6013,7 @@ else echo $ac_n "checking External PROJ.4 version""... $ac_c" 1>&6 -echo "configure:6019: checking External PROJ.4 version" >&5 +echo "configure:6017: checking External PROJ.4 version" >&5 ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$PROJINC $CPPFLAGS" if test "$cross_compiling" = yes; then @@ -6023,7 +6021,7 @@ echo "$ac_t""unknown (cross-compiling)" 1>&6 else cat > conftest.$ac_ext < @@ -6035,7 +6033,7 @@ } EOF -if { (eval echo configure:6039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then proj_ver=`cat conftestdata` echo "$ac_t""$proj_ver" 1>&6 @@ -6060,7 +6058,7 @@ echo $ac_n "checking for location of External PROJ.4 library""... $ac_c" 1>&6 -echo "configure:6064: checking for location of External PROJ.4 library" >&5 +echo "configure:6062: checking for location of External PROJ.4 library" >&5 case "$with_proj_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-proj-libs." 1>&2; exit 1; } @@ -6084,13 +6082,13 @@ echo $ac_n "checking for pj_get_def in -lproj""... $ac_c" 1>&6 -echo "configure:6088: checking for pj_get_def in -lproj" >&5 +echo "configure:6086: checking for pj_get_def in -lproj" >&5 ac_lib_var=`echo proj'_'pj_get_def | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lproj $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6136,7 +6134,7 @@ echo $ac_n "checking for location of External PROJ data files""... $ac_c" 1>&6 -echo "configure:6140: checking for location of External PROJ data files" >&5 +echo "configure:6138: checking for location of External PROJ data files" >&5 case "$with_proj_share" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-proj-share." 1>&2; exit 1; } @@ -6160,14 +6158,14 @@ # LOC_CHECK_SHARE does not work when cross compiling if test "$cross_compiling" = "yes" ; then echo $ac_n "checking for epsg""... $ac_c" 1>&6 -echo "configure:6164: checking for epsg" >&5 +echo "configure:6162: checking for epsg" >&5 echo "$ac_t""unknown (cross-compiling)" 1>&6 else ac_safe=`echo "$PROJSHARE/epsg" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $PROJSHARE/epsg""... $ac_c" 1>&6 -echo "configure:6171: checking for $PROJSHARE/epsg" >&5 +echo "configure:6169: checking for $PROJSHARE/epsg" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; } @@ -6200,7 +6198,7 @@ echo $ac_n "checking whether to use regex""... $ac_c" 1>&6 -echo "configure:6204: checking whether to use regex" >&5 +echo "configure:6202: checking whether to use regex" >&5 echo "$ac_t"""$with_regex"" 1>&6 case "$with_regex" in "no") USE_REGEX= ;; @@ -6220,7 +6218,7 @@ echo $ac_n "checking for location of regex includes""... $ac_c" 1>&6 -echo "configure:6224: checking for location of regex includes" >&5 +echo "configure:6222: checking for location of regex includes" >&5 case "$with_regex_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-regex-includes." 1>&2; exit 1; } @@ -6246,15 +6244,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6250: checking for $ac_hdr" >&5 +echo "configure:6248: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6288,7 +6286,7 @@ echo $ac_n "checking for location of regex library""... $ac_c" 1>&6 -echo "configure:6292: checking for location of regex library" >&5 +echo "configure:6290: checking for location of regex library" >&5 case "$with_regex_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-regex-libs." 1>&2; exit 1; } @@ -6313,10 +6311,10 @@ LIBS=" $LIBS" LDFLAGS=" $LDFLAGS" echo $ac_n "checking for regcomp""... $ac_c" 1>&6 -echo "configure:6317: checking for regcomp" >&5 +echo "configure:6315: checking for regcomp" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_regcomp=yes" else @@ -6366,13 +6364,13 @@ echo $ac_n "checking for regcomp in -lregex""... $ac_c" 1>&6 -echo "configure:6370: checking for regcomp in -lregex" >&5 +echo "configure:6368: checking for regcomp in -lregex" >&5 ac_lib_var=`echo regex'_'regcomp | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lregex $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6433,7 +6431,7 @@ echo $ac_n "checking whether to use Readline""... $ac_c" 1>&6 -echo "configure:6437: checking whether to use Readline" >&5 +echo "configure:6435: checking whether to use Readline" >&5 echo "$ac_t"""$with_readline"" 1>&6 case "$with_readline" in "no") USE_READLINE= ;; @@ -6454,7 +6452,7 @@ echo $ac_n "checking for location of Readline includes""... $ac_c" 1>&6 -echo "configure:6458: checking for location of Readline includes" >&5 +echo "configure:6456: checking for location of Readline includes" >&5 case "$with_readline_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-readline-includes." 1>&2; exit 1; } @@ -6480,15 +6478,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6484: checking for $ac_hdr" >&5 +echo "configure:6482: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6524,15 +6522,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6528: checking for $ac_hdr" >&5 +echo "configure:6526: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6566,7 +6564,7 @@ echo $ac_n "checking for location of Readline library""... $ac_c" 1>&6 -echo "configure:6570: checking for location of Readline library" >&5 +echo "configure:6568: checking for location of Readline library" >&5 case "$with_readline_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-readline-libs." 1>&2; exit 1; } @@ -6591,13 +6589,13 @@ echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:6595: checking for readline in -lreadline" >&5 +echo "configure:6593: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6643,13 +6641,13 @@ echo $ac_n "checking for add_history in -lhistory""... $ac_c" 1>&6 -echo "configure:6647: checking for add_history in -lhistory" >&5 +echo "configure:6645: checking for add_history in -lhistory" >&5 ac_lib_var=`echo history'_'add_history | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lhistory $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6702,7 +6700,7 @@ # GDAL option echo $ac_n "checking whether to use GDAL""... $ac_c" 1>&6 -echo "configure:6706: checking whether to use GDAL" >&5 +echo "configure:6704: checking whether to use GDAL" >&5 GDAL_LIBS= GDAL_CFLAGS= @@ -6720,7 +6718,7 @@ # Extract the first word of "gdal-config", so it can be a program name with args. set dummy gdal-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6724: checking for $ac_word" >&5 +echo "configure:6722: checking for $ac_word" >&5 case "$GDAL_CONFIG" in /*) @@ -6775,14 +6773,14 @@ LIBS="$LIBS $GDAL_LIBS" CFLAGS="$CFLAGS $GDAL_CFLAGS" cat > conftest.$ac_ext < int main() { GDALOpen("foo", GA_ReadOnly); ; return 0; } EOF -if { (eval echo configure:6786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -6791,14 +6789,14 @@ LIBS="$LIBS $GDAL_DEP_LIBS" cat > conftest.$ac_ext < int main() { GDALOpen("foo", GA_ReadOnly); ; return 0; } EOF -if { (eval echo configure:6802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* GDAL_LIBS="$GDAL_LIBS $GDAL_DEP_LIBS" else @@ -6830,7 +6828,7 @@ # libLAS option echo $ac_n "checking whether to use libLAS""... $ac_c" 1>&6 -echo "configure:6834: checking whether to use libLAS" >&5 +echo "configure:6832: checking whether to use libLAS" >&5 LIBLAS_LIBS= LIBLAS_CFLAGS= @@ -6847,7 +6845,7 @@ # Extract the first word of "liblas-config", so it can be a program name with args. set dummy liblas-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6851: checking for $ac_word" >&5 +echo "configure:6849: checking for $ac_word" >&5 case "$LIBLAS_CONFIG" in /*) @@ -6900,15 +6898,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6904: checking for $ac_hdr" >&5 +echo "configure:6902: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6934,14 +6932,14 @@ done cat > conftest.$ac_ext < int main() { LASReader_Create("foo"); ; return 0; } EOF -if { (eval echo configure:6945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -6949,14 +6947,14 @@ rm -rf conftest* cat > conftest.$ac_ext < int main() { LASReader_Create("foo"); ; return 0; } EOF -if { (eval echo configure:6960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LAS_LIBS="$LAS_LIBS" else @@ -6989,7 +6987,7 @@ # PDAL option echo $ac_n "checking whether to use PDAL""... $ac_c" 1>&6 -echo "configure:6993: checking whether to use PDAL" >&5 +echo "configure:6991: checking whether to use PDAL" >&5 # new and currently used way to switch language to C++ # AC_LANG_PUSH(C++) @@ -7017,7 +7015,7 @@ # Extract the first word of "pdal-config", so it can be a program name with args. set dummy pdal-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7021: checking for $ac_word" >&5 +echo "configure:7019: checking for $ac_word" >&5 case "$PDAL_CONFIG" in /*) @@ -7067,14 +7065,14 @@ CFLAGS="$CFLAGS $PDAL_CFLAGS" CPPFLAGS="$CPPFLAGS $PDAL_CPPFLAGS $PDAL_INC" cat > conftest.$ac_ext < int main() { pdal::PointTable table; ; return 0; } EOF -if { (eval echo configure:7078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -7082,14 +7080,14 @@ rm -rf conftest* cat > conftest.$ac_ext < int main() { pdal::PointTable table; ; return 0; } EOF -if { (eval echo configure:7093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* PDAL_LIBS="$PDAL_LIBS" else @@ -7139,7 +7137,7 @@ # NetCDF option echo $ac_n "checking whether to use NetCDF""... $ac_c" 1>&6 -echo "configure:7143: checking whether to use NetCDF" >&5 +echo "configure:7141: checking whether to use NetCDF" >&5 NETCDF_LIBS= NETCDF_CFLAGS= @@ -7156,7 +7154,7 @@ # Extract the first word of "nc-config", so it can be a program name with args. set dummy nc-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7160: checking for $ac_word" >&5 +echo "configure:7158: checking for $ac_word" >&5 case "$NETCDF_CONFIG" in /*) @@ -7203,14 +7201,14 @@ LIBS="$LIBS $NETCDF_LIBS" CFLAGS="$CFLAGS $NETCDF_CFLAGS" cat > conftest.$ac_ext < int main() { nc_create("foo", NC_CLOBBER, NULL); ; return 0; } EOF -if { (eval echo configure:7214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -7218,14 +7216,14 @@ rm -rf conftest* cat > conftest.$ac_ext < int main() { nc_create("foo", NC_CLOBBER, NULL); ; return 0; } EOF -if { (eval echo configure:7229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* NETCDF_LIBS="$NETCDF_LIBS" else @@ -7256,7 +7254,7 @@ # GEOS option echo $ac_n "checking whether to use GEOS""... $ac_c" 1>&6 -echo "configure:7260: checking whether to use GEOS" >&5 +echo "configure:7258: checking whether to use GEOS" >&5 GEOS_LIBS= GEOS_CFLAGS= @@ -7274,7 +7272,7 @@ # Extract the first word of "geos-config", so it can be a program name with args. set dummy geos-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:7278: checking for $ac_word" >&5 +echo "configure:7276: checking for $ac_word" >&5 case "$GEOS_CONFIG" in /*) @@ -7322,15 +7320,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7326: checking for $ac_hdr" >&5 +echo "configure:7324: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7369,13 +7367,13 @@ echo $ac_n "checking for initGEOS in -lgeos_c""... $ac_c" 1>&6 -echo "configure:7373: checking for initGEOS in -lgeos_c" >&5 +echo "configure:7371: checking for initGEOS in -lgeos_c" >&5 ac_lib_var=`echo geos_c'_'initGEOS | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lgeos_c $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7430,7 +7428,7 @@ echo $ac_n "checking whether to use TIFF""... $ac_c" 1>&6 -echo "configure:7434: checking whether to use TIFF" >&5 +echo "configure:7432: checking whether to use TIFF" >&5 echo "$ac_t"""$with_tiff"" 1>&6 case "$with_tiff" in "no") USE_TIFF= ;; @@ -7450,7 +7448,7 @@ echo $ac_n "checking for location of TIFF includes""... $ac_c" 1>&6 -echo "configure:7454: checking for location of TIFF includes" >&5 +echo "configure:7452: checking for location of TIFF includes" >&5 case "$with_tiff_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-tiff-includes." 1>&2; exit 1; } @@ -7476,15 +7474,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7480: checking for $ac_hdr" >&5 +echo "configure:7478: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7518,7 +7516,7 @@ echo $ac_n "checking for location of TIFF library""... $ac_c" 1>&6 -echo "configure:7522: checking for location of TIFF library" >&5 +echo "configure:7520: checking for location of TIFF library" >&5 case "$with_tiff_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-tiff-libs." 1>&2; exit 1; } @@ -7549,13 +7547,13 @@ echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7553: checking for TIFFOpen in -ltiff" >&5 +echo "configure:7551: checking for TIFFOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ltiff $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7585,13 +7583,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7589: checking for TIFFOpen in -ltiff" >&5 +echo "configure:7587: checking for TIFFOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ltiff $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7621,13 +7619,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7625: checking for TIFFOpen in -ltiff" >&5 +echo "configure:7623: checking for TIFFOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ltiff $ZLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7657,13 +7655,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7661: checking for TIFFOpen in -ltiff" >&5 +echo "configure:7659: checking for TIFFOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ltiff $ZLIB $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7693,13 +7691,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7697: checking for TIFFOpen in -ltiff" >&5 +echo "configure:7695: checking for TIFFOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ltiff -ljpeg $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7729,13 +7727,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7733: checking for TIFFOpen in -ltiff" >&5 +echo "configure:7731: checking for TIFFOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ltiff -ljpeg $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7765,13 +7763,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7769: checking for TIFFOpen in -ltiff" >&5 +echo "configure:7767: checking for TIFFOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ltiff -ljpeg $ZLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7801,13 +7799,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:7805: checking for TIFFOpen in -ltiff" >&5 +echo "configure:7803: checking for TIFFOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ltiff -ljpeg $ZLIB $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7916,7 +7914,7 @@ echo $ac_n "checking whether to use PNG""... $ac_c" 1>&6 -echo "configure:7920: checking whether to use PNG" >&5 +echo "configure:7918: checking whether to use PNG" >&5 echo "$ac_t"""$with_png"" 1>&6 case "$with_png" in "no") USE_PNG= ;; @@ -7935,7 +7933,7 @@ echo $ac_n "checking for location of PNG includes""... $ac_c" 1>&6 -echo "configure:7939: checking for location of PNG includes" >&5 +echo "configure:7937: checking for location of PNG includes" >&5 case "$with_png_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-png-includes." 1>&2; exit 1; } @@ -7961,15 +7959,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7965: checking for $ac_hdr" >&5 +echo "configure:7963: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8003,7 +8001,7 @@ echo $ac_n "checking for location of PNG library""... $ac_c" 1>&6 -echo "configure:8007: checking for location of PNG library" >&5 +echo "configure:8005: checking for location of PNG library" >&5 case "$with_png_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-png-libs." 1>&2; exit 1; } @@ -8028,13 +8026,13 @@ echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:8032: checking for png_read_image in -lpng" >&5 +echo "configure:8030: checking for png_read_image in -lpng" >&5 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lpng $ZLIB $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8087,7 +8085,7 @@ echo $ac_n "checking whether to use PostgreSQL""... $ac_c" 1>&6 -echo "configure:8091: checking whether to use PostgreSQL" >&5 +echo "configure:8089: checking whether to use PostgreSQL" >&5 echo "$ac_t"""$with_postgres"" 1>&6 case "$with_postgres" in "no") USE_POSTGRES= ;; @@ -8114,7 +8112,7 @@ echo $ac_n "checking for location of PostgreSQL includes""... $ac_c" 1>&6 -echo "configure:8118: checking for location of PostgreSQL includes" >&5 +echo "configure:8116: checking for location of PostgreSQL includes" >&5 case "$with_postgres_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-postgres-includes." 1>&2; exit 1; } @@ -8140,15 +8138,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8144: checking for $ac_hdr" >&5 +echo "configure:8142: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8186,7 +8184,7 @@ echo $ac_n "checking for location of PostgreSQL library""... $ac_c" 1>&6 -echo "configure:8190: checking for location of PostgreSQL library" >&5 +echo "configure:8188: checking for location of PostgreSQL library" >&5 case "$with_postgres_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-postgres-libs." 1>&2; exit 1; } @@ -8215,13 +8213,13 @@ echo $ac_n "checking for PQsetdbLogin in -lpq""... $ac_c" 1>&6 -echo "configure:8219: checking for PQsetdbLogin in -lpq" >&5 +echo "configure:8217: checking for PQsetdbLogin in -lpq" >&5 ac_lib_var=`echo pq'_'PQsetdbLogin | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lpq $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8251,13 +8249,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for PQsetdbLogin in -lpq""... $ac_c" 1>&6 -echo "configure:8255: checking for PQsetdbLogin in -lpq" >&5 +echo "configure:8253: checking for PQsetdbLogin in -lpq" >&5 ac_lib_var=`echo pq'_'PQsetdbLogin | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lpq -lssl -lcrypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8287,13 +8285,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for PQsetdbLogin in -lpq""... $ac_c" 1>&6 -echo "configure:8291: checking for PQsetdbLogin in -lpq" >&5 +echo "configure:8289: checking for PQsetdbLogin in -lpq" >&5 ac_lib_var=`echo pq'_'PQsetdbLogin | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lpq -lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8323,13 +8321,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for PQsetdbLogin in -lpq""... $ac_c" 1>&6 -echo "configure:8327: checking for PQsetdbLogin in -lpq" >&5 +echo "configure:8325: checking for PQsetdbLogin in -lpq" >&5 ac_lib_var=`echo pq'_'PQsetdbLogin | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lpq -lcrypt -lssl -lcrypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8397,13 +8395,13 @@ ac_save_ldflags="$LDFLAGS" LDFLAGS="$LDFLAGS $PQLIBPATH" echo $ac_n "checking for PQcmdTuples in -lpq""... $ac_c" 1>&6 -echo "configure:8401: checking for PQcmdTuples in -lpq" >&5 +echo "configure:8399: checking for PQcmdTuples in -lpq" >&5 ac_lib_var=`echo pq'_'PQcmdTuples | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lpq $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8436,13 +8434,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for PQcmdTuples in -lpq""... $ac_c" 1>&6 -echo "configure:8440: checking for PQcmdTuples in -lpq" >&5 +echo "configure:8438: checking for PQcmdTuples in -lpq" >&5 ac_lib_var=`echo pq'_'PQcmdTuples | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lpq -lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8496,7 +8494,7 @@ echo $ac_n "checking whether to use MySQL""... $ac_c" 1>&6 -echo "configure:8500: checking whether to use MySQL" >&5 +echo "configure:8498: checking whether to use MySQL" >&5 echo "$ac_t"""$with_mysql"" 1>&6 case "$with_mysql" in "no") USE_MYSQL= ;; @@ -8516,7 +8514,7 @@ echo $ac_n "checking for location of MySQL includes""... $ac_c" 1>&6 -echo "configure:8520: checking for location of MySQL includes" >&5 +echo "configure:8518: checking for location of MySQL includes" >&5 case "$with_mysql_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-mysql-includes." 1>&2; exit 1; } @@ -8542,15 +8540,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8546: checking for $ac_hdr" >&5 +echo "configure:8544: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8587,7 +8585,7 @@ echo $ac_n "checking for location of MySQL library""... $ac_c" 1>&6 -echo "configure:8591: checking for location of MySQL library" >&5 +echo "configure:8589: checking for location of MySQL library" >&5 case "$with_mysql_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-mysql-libs." 1>&2; exit 1; } @@ -8618,13 +8616,13 @@ echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6 -echo "configure:8622: checking for mysql_query in -lmysqlclient" >&5 +echo "configure:8620: checking for mysql_query in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8654,13 +8652,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6 -echo "configure:8658: checking for mysql_query in -lmysqlclient" >&5 +echo "configure:8656: checking for mysql_query in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8690,13 +8688,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6 -echo "configure:8694: checking for mysql_query in -lmysqlclient" >&5 +echo "configure:8692: checking for mysql_query in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $SOCKLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8726,13 +8724,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6 -echo "configure:8730: checking for mysql_query in -lmysqlclient" >&5 +echo "configure:8728: checking for mysql_query in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $SOCKLIB $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8762,13 +8760,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6 -echo "configure:8766: checking for mysql_query in -lmysqlclient" >&5 +echo "configure:8764: checking for mysql_query in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $ZLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8798,13 +8796,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6 -echo "configure:8802: checking for mysql_query in -lmysqlclient" >&5 +echo "configure:8800: checking for mysql_query in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $ZLIB $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8834,13 +8832,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6 -echo "configure:8838: checking for mysql_query in -lmysqlclient" >&5 +echo "configure:8836: checking for mysql_query in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $ZLIB $SOCKLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8870,13 +8868,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6 -echo "configure:8874: checking for mysql_query in -lmysqlclient" >&5 +echo "configure:8872: checking for mysql_query in -lmysqlclient" >&5 ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lmysqlclient $ZLIB $SOCKLIB $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8977,7 +8975,7 @@ # Extract the first word of "mysql_config", so it can be a program name with args. set dummy mysql_config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:8981: checking for $ac_word" >&5 +echo "configure:8979: checking for $ac_word" >&5 case "$MYSQLD_CONFIG" in /*) @@ -9026,10 +9024,10 @@ LIBS="$MYSQLDLIB $LIBS" echo $ac_n "checking for mysql_server_init""... $ac_c" 1>&6 -echo "configure:9030: checking for mysql_server_init" >&5 +echo "configure:9028: checking for mysql_server_init" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_mysql_server_init=yes" else @@ -9107,7 +9105,7 @@ echo $ac_n "checking whether to use SQLite""... $ac_c" 1>&6 -echo "configure:9111: checking whether to use SQLite" >&5 +echo "configure:9109: checking whether to use SQLite" >&5 echo "$ac_t"""$with_sqlite"" 1>&6 case "$with_sqlite" in "no") USE_SQLITE= ;; @@ -9127,7 +9125,7 @@ echo $ac_n "checking for location of SQLite includes""... $ac_c" 1>&6 -echo "configure:9131: checking for location of SQLite includes" >&5 +echo "configure:9129: checking for location of SQLite includes" >&5 case "$with_sqlite_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-sqlite-includes." 1>&2; exit 1; } @@ -9153,15 +9151,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9157: checking for $ac_hdr" >&5 +echo "configure:9155: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9204,7 +9202,7 @@ echo $ac_n "checking for location of SQLite library""... $ac_c" 1>&6 -echo "configure:9208: checking for location of SQLite library" >&5 +echo "configure:9206: checking for location of SQLite library" >&5 case "$with_sqlite_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-sqlite-libs." 1>&2; exit 1; } @@ -9233,13 +9231,13 @@ echo $ac_n "checking for sqlite3_open in -lsqlite3""... $ac_c" 1>&6 -echo "configure:9237: checking for sqlite3_open in -lsqlite3" >&5 +echo "configure:9235: checking for sqlite3_open in -lsqlite3" >&5 ac_lib_var=`echo sqlite3'_'sqlite3_open | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lsqlite3 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9269,13 +9267,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sqlite3_open in -lsqlite3""... $ac_c" 1>&6 -echo "configure:9273: checking for sqlite3_open in -lsqlite3" >&5 +echo "configure:9271: checking for sqlite3_open in -lsqlite3" >&5 ac_lib_var=`echo sqlite3'_'sqlite3_open | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lsqlite3 $DLLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9305,13 +9303,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sqlite3_open in -lsqlite3""... $ac_c" 1>&6 -echo "configure:9309: checking for sqlite3_open in -lsqlite3" >&5 +echo "configure:9307: checking for sqlite3_open in -lsqlite3" >&5 ac_lib_var=`echo sqlite3'_'sqlite3_open | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lsqlite3 $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9341,13 +9339,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sqlite3_open in -lsqlite3""... $ac_c" 1>&6 -echo "configure:9345: checking for sqlite3_open in -lsqlite3" >&5 +echo "configure:9343: checking for sqlite3_open in -lsqlite3" >&5 ac_lib_var=`echo sqlite3'_'sqlite3_open | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lsqlite3 $MATHLIB $DLLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9433,7 +9431,7 @@ OPENGL_WINDOWS= echo $ac_n "checking whether to use OpenGL""... $ac_c" 1>&6 -echo "configure:9437: checking whether to use OpenGL" >&5 +echo "configure:9435: checking whether to use OpenGL" >&5 echo "$ac_t"""$with_opengl"" 1>&6 case "$with_opengl" in n|no) @@ -9467,7 +9465,7 @@ echo $ac_n "checking for location of OpenGL includes""... $ac_c" 1>&6 -echo "configure:9471: checking for location of OpenGL includes" >&5 +echo "configure:9469: checking for location of OpenGL includes" >&5 case "$with_opengl_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-opengl-includes." 1>&2; exit 1; } @@ -9493,15 +9491,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9497: checking for $ac_hdr" >&5 +echo "configure:9495: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9503: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9535,7 +9533,7 @@ echo $ac_n "checking for location of OpenGL library""... $ac_c" 1>&6 -echo "configure:9539: checking for location of OpenGL library" >&5 +echo "configure:9537: checking for location of OpenGL library" >&5 case "$with_opengl_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-opengl-libs." 1>&2; exit 1; } @@ -9564,13 +9562,13 @@ echo $ac_n "checking for glBegin in -lGL""... $ac_c" 1>&6 -echo "configure:9568: checking for glBegin in -lGL" >&5 +echo "configure:9566: checking for glBegin in -lGL" >&5 ac_lib_var=`echo GL'_'glBegin | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9600,13 +9598,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for glBegin in -lGL""... $ac_c" 1>&6 -echo "configure:9604: checking for glBegin in -lGL" >&5 +echo "configure:9602: checking for glBegin in -lGL" >&5 ac_lib_var=`echo GL'_'glBegin | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lXext $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9636,13 +9634,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for glBegin in -lGL""... $ac_c" 1>&6 -echo "configure:9640: checking for glBegin in -lGL" >&5 +echo "configure:9638: checking for glBegin in -lGL" >&5 ac_lib_var=`echo GL'_'glBegin | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9672,13 +9670,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for glBegin in -lGL""... $ac_c" 1>&6 -echo "configure:9676: checking for glBegin in -lGL" >&5 +echo "configure:9674: checking for glBegin in -lGL" >&5 ac_lib_var=`echo GL'_'glBegin | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lpthread -lXext $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9751,13 +9749,13 @@ echo $ac_n "checking for gluBeginCurve in -lGLU""... $ac_c" 1>&6 -echo "configure:9755: checking for gluBeginCurve in -lGLU" >&5 +echo "configure:9753: checking for gluBeginCurve in -lGLU" >&5 ac_lib_var=`echo GLU'_'gluBeginCurve | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lGLU $OPENGLLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9787,13 +9785,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for gluBeginCurve in -lGLU""... $ac_c" 1>&6 -echo "configure:9791: checking for gluBeginCurve in -lGLU" >&5 +echo "configure:9789: checking for gluBeginCurve in -lGLU" >&5 ac_lib_var=`echo GLU'_'gluBeginCurve | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lGLU $OPENGLLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lstdc++ $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9851,10 +9849,10 @@ LIBS=" $OPENGLLIB $LIBS" LDFLAGS=" $LDFLAGS" echo $ac_n "checking for glXCreatePbuffer""... $ac_c" 1>&6 -echo "configure:9855: checking for glXCreatePbuffer" >&5 +echo "configure:9853: checking for glXCreatePbuffer" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_glXCreatePbuffer=yes" else @@ -9914,10 +9912,10 @@ LIBS=" $OPENGLLIB $LIBS" LDFLAGS=" $LDFLAGS" echo $ac_n "checking for glXCreateGLXPixmap""... $ac_c" 1>&6 -echo "configure:9918: checking for glXCreateGLXPixmap" >&5 +echo "configure:9916: checking for glXCreateGLXPixmap" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_glXCreateGLXPixmap=yes" else @@ -9983,7 +9981,7 @@ echo $ac_n "checking for location of OpenGL framework""... $ac_c" 1>&6 -echo "configure:9987: checking for location of OpenGL framework" >&5 +echo "configure:9985: checking for location of OpenGL framework" >&5 case "$with_opengl_framework" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-opengl-framework." 1>&2; exit 1; } @@ -10007,15 +10005,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10011: checking for $ac_hdr" >&5 +echo "configure:10009: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10051,10 +10049,10 @@ LIBS="-framework OpenGL -framework AGL -framework ApplicationServices $LIBS" LDFLAGS="$OPENGLPATH $LDFLAGS" echo $ac_n "checking for glBegin""... $ac_c" 1>&6 -echo "configure:10055: checking for glBegin" >&5 +echo "configure:10053: checking for glBegin" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_glBegin=yes" else @@ -10114,10 +10112,10 @@ LIBS=" $OPENGLLIB $LIBS" LDFLAGS="$OPENGLPATH $LDFLAGS" echo $ac_n "checking for gluBeginCurve""... $ac_c" 1>&6 -echo "configure:10118: checking for gluBeginCurve" >&5 +echo "configure:10116: checking for gluBeginCurve" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gluBeginCurve=yes" else @@ -10188,7 +10186,7 @@ echo $ac_n "checking for location of OpenGL includes""... $ac_c" 1>&6 -echo "configure:10192: checking for location of OpenGL includes" >&5 +echo "configure:10190: checking for location of OpenGL includes" >&5 case "$with_opengl_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-opengl-includes." 1>&2; exit 1; } @@ -10214,15 +10212,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10218: checking for $ac_hdr" >&5 +echo "configure:10216: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10256,7 +10254,7 @@ echo $ac_n "checking for location of OpenGL library""... $ac_c" 1>&6 -echo "configure:10260: checking for location of OpenGL library" >&5 +echo "configure:10258: checking for location of OpenGL library" >&5 case "$with_opengl_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-opengl-libs." 1>&2; exit 1; } @@ -10281,18 +10279,18 @@ ac_save_ldflags="$LDFLAGS" ac_save_libs="$LIBS" echo $ac_n "checking for OpenGL library""... $ac_c" 1>&6 -echo "configure:10285: checking for OpenGL library" >&5 +echo "configure:10283: checking for OpenGL library" >&5 LDFLAGS="$OPENGL_LIB_PATH $LDFLAGS" LIBS="-lopengl32 " cat > conftest.$ac_ext < int main() { glEnd(); ; return 0; } EOF -if { (eval echo configure:10296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""found" 1>&6 @@ -10316,18 +10314,18 @@ ac_save_ldflags="$LDFLAGS" ac_save_libs="$LIBS" echo $ac_n "checking for GLU library""... $ac_c" 1>&6 -echo "configure:10320: checking for GLU library" >&5 +echo "configure:10318: checking for GLU library" >&5 LDFLAGS="$OPENGL_LIB_PATH $LDFLAGS" LIBS="-lglu32 $OPENGLLIB " cat > conftest.$ac_ext < int main() { gluNewQuadric(); ; return 0; } EOF -if { (eval echo configure:10331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""found" 1>&6 @@ -10376,7 +10374,7 @@ echo $ac_n "checking whether to use ODBC""... $ac_c" 1>&6 -echo "configure:10380: checking whether to use ODBC" >&5 +echo "configure:10378: checking whether to use ODBC" >&5 echo "$ac_t"""$with_odbc"" 1>&6 case "$with_odbc" in "no") USE_ODBC= ;; @@ -10395,7 +10393,7 @@ echo $ac_n "checking for location of ODBC includes""... $ac_c" 1>&6 -echo "configure:10399: checking for location of ODBC includes" >&5 +echo "configure:10397: checking for location of ODBC includes" >&5 case "$with_odbc_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-odbc-includes." 1>&2; exit 1; } @@ -10421,15 +10419,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10425: checking for $ac_hdr" >&5 +echo "configure:10423: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10463,7 +10461,7 @@ echo $ac_n "checking for location of ODBC library""... $ac_c" 1>&6 -echo "configure:10467: checking for location of ODBC library" >&5 +echo "configure:10465: checking for location of ODBC library" >&5 case "$with_odbc_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-odbc-libs." 1>&2; exit 1; } @@ -10488,13 +10486,13 @@ echo $ac_n "checking for SQLConnect in -lodbc""... $ac_c" 1>&6 -echo "configure:10492: checking for SQLConnect in -lodbc" >&5 +echo "configure:10490: checking for SQLConnect in -lodbc" >&5 ac_lib_var=`echo odbc'_'SQLConnect | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lodbc $ICONVLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10530,13 +10528,13 @@ echo $ac_n "checking for SQLConnect in -liodbc""... $ac_c" 1>&6 -echo "configure:10534: checking for SQLConnect in -liodbc" >&5 +echo "configure:10532: checking for SQLConnect in -liodbc" >&5 ac_lib_var=`echo iodbc'_'SQLConnect | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-liodbc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10572,11 +10570,11 @@ ac_save_ldflags="$LDFLAGS" ac_save_libs="$LIBS" echo $ac_n "checking for ODBC library""... $ac_c" 1>&6 -echo "configure:10576: checking for ODBC library" >&5 +echo "configure:10574: checking for ODBC library" >&5 LDFLAGS="$ODBCLIB $LDFLAGS" LIBS="-lodbc32 " cat > conftest.$ac_ext < #include @@ -10584,7 +10582,7 @@ SQLAllocEnv((SQLHENV *)0); ; return 0; } EOF -if { (eval echo configure:10588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""found" 1>&6 @@ -10633,7 +10631,7 @@ echo $ac_n "checking whether to use FFTW""... $ac_c" 1>&6 -echo "configure:10637: checking whether to use FFTW" >&5 +echo "configure:10635: checking whether to use FFTW" >&5 echo "$ac_t"""$with_fftw"" 1>&6 case "$with_fftw" in "no") USE_FFTW= ;; @@ -10652,7 +10650,7 @@ echo $ac_n "checking for location of FFTW includes""... $ac_c" 1>&6 -echo "configure:10656: checking for location of FFTW includes" >&5 +echo "configure:10654: checking for location of FFTW includes" >&5 case "$with_fftw_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-fftw-includes." 1>&2; exit 1; } @@ -10678,15 +10676,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10682: checking for $ac_hdr" >&5 +echo "configure:10680: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10690: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10714,15 +10712,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10718: checking for $ac_hdr" >&5 +echo "configure:10716: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10750,15 +10748,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10754: checking for $ac_hdr" >&5 +echo "configure:10752: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10804,7 +10802,7 @@ echo $ac_n "checking for location of FFTW library""... $ac_c" 1>&6 -echo "configure:10808: checking for location of FFTW library" >&5 +echo "configure:10806: checking for location of FFTW library" >&5 case "$with_fftw_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-fftw-libs." 1>&2; exit 1; } @@ -10829,13 +10827,13 @@ echo $ac_n "checking for fftw_execute in -lfftw3""... $ac_c" 1>&6 -echo "configure:10833: checking for fftw_execute in -lfftw3" >&5 +echo "configure:10831: checking for fftw_execute in -lfftw3" >&5 ac_lib_var=`echo fftw3'_'fftw_execute | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lfftw3 $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10871,13 +10869,13 @@ echo $ac_n "checking for fftwnd_one in -lfftw""... $ac_c" 1>&6 -echo "configure:10875: checking for fftwnd_one in -lfftw" >&5 +echo "configure:10873: checking for fftwnd_one in -lfftw" >&5 ac_lib_var=`echo fftw'_'fftwnd_one | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lfftw $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10913,13 +10911,13 @@ echo $ac_n "checking for fftwnd_one in -ldfftw""... $ac_c" 1>&6 -echo "configure:10917: checking for fftwnd_one in -ldfftw" >&5 +echo "configure:10915: checking for fftwnd_one in -ldfftw" >&5 ac_lib_var=`echo dfftw'_'fftwnd_one | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ldfftw $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10987,7 +10985,7 @@ echo $ac_n "checking whether to use BLAS""... $ac_c" 1>&6 -echo "configure:10991: checking whether to use BLAS" >&5 +echo "configure:10989: checking whether to use BLAS" >&5 echo "$ac_t"""$with_blas"" 1>&6 case "$with_blas" in "no") USE_BLAS= ;; @@ -11008,7 +11006,7 @@ echo $ac_n "checking for location of BLAS includes""... $ac_c" 1>&6 -echo "configure:11012: checking for location of BLAS includes" >&5 +echo "configure:11010: checking for location of BLAS includes" >&5 case "$with_blas_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-blas-includes." 1>&2; exit 1; } @@ -11028,7 +11026,7 @@ echo $ac_n "checking for location of BLAS library""... $ac_c" 1>&6 -echo "configure:11032: checking for location of BLAS library" >&5 +echo "configure:11030: checking for location of BLAS library" >&5 case "$with_blas_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-blas-libs." 1>&2; exit 1; } @@ -11054,15 +11052,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11058: checking for $ac_hdr" >&5 +echo "configure:11056: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11097,13 +11095,13 @@ echo $ac_n "checking for dnrm2_ in -lblas""... $ac_c" 1>&6 -echo "configure:11101: checking for dnrm2_ in -lblas" >&5 +echo "configure:11099: checking for dnrm2_ in -lblas" >&5 ac_lib_var=`echo blas'_'dnrm2_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lblas $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11133,13 +11131,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dnrm2_ in -lblas""... $ac_c" 1>&6 -echo "configure:11137: checking for dnrm2_ in -lblas" >&5 +echo "configure:11135: checking for dnrm2_ in -lblas" >&5 ac_lib_var=`echo blas'_'dnrm2_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lblas $MATHLIB -lg2c $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11194,13 +11192,13 @@ save_LDFLAGS="$LDFLAGS" LDFLAGS="$BLASLIB $LDFLAGS" echo $ac_n "checking for ATL_xerbla in -latlas""... $ac_c" 1>&6 -echo "configure:11198: checking for ATL_xerbla in -latlas" >&5 +echo "configure:11196: checking for ATL_xerbla in -latlas" >&5 ac_lib_var=`echo atlas'_'ATL_xerbla | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-latlas $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11226,13 +11224,13 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for sgemm_ in -lf77blas""... $ac_c" 1>&6 -echo "configure:11230: checking for sgemm_ in -lf77blas" >&5 +echo "configure:11228: checking for sgemm_ in -lf77blas" >&5 ac_lib_var=`echo f77blas'_'sgemm_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lf77blas -latlas $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11258,13 +11256,13 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for cblas_dgemm in -lcblas""... $ac_c" 1>&6 -echo "configure:11262: checking for cblas_dgemm in -lcblas" >&5 +echo "configure:11260: checking for cblas_dgemm in -lcblas" >&5 ac_lib_var=`echo cblas'_'cblas_dgemm | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lcblas -lf77blas -latlas $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11321,16 +11319,16 @@ save_LIBS="$LIBS" LIBS="$vlib_flags $LIBS" echo $ac_n "checking for sgemm in $vlib_flags""... $ac_c" 1>&6 -echo "configure:11325: checking for sgemm in $vlib_flags" >&5 +echo "configure:11323: checking for sgemm in $vlib_flags" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* blas_ok=yes; BLASLIB="$vlib_flags" else @@ -11348,13 +11346,13 @@ # BLAS in PhiPACK libraries? (requires generic BLAS, too) if test $blas_ok = no; then echo $ac_n "checking for sgemm_ in -lblas""... $ac_c" 1>&6 -echo "configure:11352: checking for sgemm_ in -lblas" >&5 +echo "configure:11350: checking for sgemm_ in -lblas" >&5 ac_lib_var=`echo blas'_'sgemm_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lblas $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11380,13 +11378,13 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for dgemm_ in -ldgemm""... $ac_c" 1>&6 -echo "configure:11384: checking for dgemm_ in -ldgemm" >&5 +echo "configure:11382: checking for dgemm_ in -ldgemm" >&5 ac_lib_var=`echo dgemm'_'dgemm_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-ldgemm -lblas $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11412,13 +11410,13 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for sgemm_ in -lsgemm""... $ac_c" 1>&6 -echo "configure:11416: checking for sgemm_ in -lsgemm" >&5 +echo "configure:11414: checking for sgemm_ in -lsgemm" >&5 ac_lib_var=`echo sgemm'_'sgemm_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lsgemm -lblas $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11463,13 +11461,13 @@ if test $blas_ok = no; then if test "x$GCC" != xyes; then # only works with Sun CC echo $ac_n "checking for acosp in -lsunmath""... $ac_c" 1>&6 -echo "configure:11467: checking for acosp in -lsunmath" >&5 +echo "configure:11465: checking for acosp in -lsunmath" >&5 ac_lib_var=`echo sunmath'_'acosp | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lsunmath $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11495,13 +11493,13 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for sgemm_ in -lsunperf""... $ac_c" 1>&6 -echo "configure:11499: checking for sgemm_ in -lsunperf" >&5 +echo "configure:11497: checking for sgemm_ in -lsunperf" >&5 ac_lib_var=`echo sunperf'_'sgemm_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lsunperf -lsunmath $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11542,13 +11540,13 @@ # Generic BLAS library if test $blas_ok = no; then echo $ac_n "checking for sgemm_ in -lblas""... $ac_c" 1>&6 -echo "configure:11546: checking for sgemm_ in -lblas" >&5 +echo "configure:11544: checking for sgemm_ in -lblas" >&5 ac_lib_var=`echo blas'_'sgemm_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lblas $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11598,7 +11596,7 @@ echo $ac_n "checking whether to use LAPACK""... $ac_c" 1>&6 -echo "configure:11602: checking whether to use LAPACK" >&5 +echo "configure:11600: checking whether to use LAPACK" >&5 echo "$ac_t"""$with_lapack"" 1>&6 case "$with_lapack" in "no") USE_LAPACK= ;; @@ -11623,7 +11621,7 @@ echo $ac_n "checking for location of LAPACK includes""... $ac_c" 1>&6 -echo "configure:11627: checking for location of LAPACK includes" >&5 +echo "configure:11625: checking for location of LAPACK includes" >&5 case "$with_lapack_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-lapack-includes." 1>&2; exit 1; } @@ -11643,7 +11641,7 @@ echo $ac_n "checking for location of LAPACK library""... $ac_c" 1>&6 -echo "configure:11647: checking for location of LAPACK library" >&5 +echo "configure:11645: checking for location of LAPACK library" >&5 case "$with_lapack_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-lapack-libs." 1>&2; exit 1; } @@ -11669,15 +11667,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11673: checking for $ac_hdr" >&5 +echo "configure:11671: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11709,10 +11707,10 @@ save_LIBS="$LIBS"; LIBS="$LIBS $BLASLIB $MATHLIB $FLIBS" save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LAPACKLIB $LDFLAGS" echo $ac_n "checking for dsegv_""... $ac_c" 1>&6 -echo "configure:11713: checking for dsegv_" >&5 +echo "configure:11711: checking for dsegv_" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dsegv_=yes" else @@ -11762,13 +11760,13 @@ save_libs="$LIBS"; LIBS="$BLASLIB $MATHLIB $LIBS" save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LAPACKLIB $LDFLAGS" echo $ac_n "checking for desgv_ in -llapack""... $ac_c" 1>&6 -echo "configure:11766: checking for desgv_ in -llapack" >&5 +echo "configure:11764: checking for desgv_ in -llapack" >&5 ac_lib_var=`echo lapack'_'desgv_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-llapack $FLIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11811,13 +11809,13 @@ echo $ac_n "checking for dgesv_ in -llapack""... $ac_c" 1>&6 -echo "configure:11815: checking for dgesv_ in -llapack" >&5 +echo "configure:11813: checking for dgesv_ in -llapack" >&5 ac_lib_var=`echo lapack'_'dgesv_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-llapack $BLASLIB $MATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11847,13 +11845,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dgesv_ in -llapack""... $ac_c" 1>&6 -echo "configure:11851: checking for dgesv_ in -llapack" >&5 +echo "configure:11849: checking for dgesv_ in -llapack" >&5 ac_lib_var=`echo lapack'_'dgesv_ | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-llapack $BLASLIB $MATHLIB -lg2c $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11920,7 +11918,7 @@ echo $ac_n "checking whether to use Cairo""... $ac_c" 1>&6 -echo "configure:11924: checking whether to use Cairo" >&5 +echo "configure:11922: checking whether to use Cairo" >&5 echo "$ac_t"""$with_cairo"" 1>&6 case "$with_cairo" in "no") USE_CAIRO= ;; @@ -11952,7 +11950,7 @@ echo $ac_n "checking for location of cairo includes""... $ac_c" 1>&6 -echo "configure:11956: checking for location of cairo includes" >&5 +echo "configure:11954: checking for location of cairo includes" >&5 case "$with_cairo_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-cairo-includes." 1>&2; exit 1; } @@ -11978,15 +11976,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11982: checking for $ac_hdr" >&5 +echo "configure:11980: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12022,7 +12020,7 @@ echo $ac_n "checking for location of cairo library""... $ac_c" 1>&6 -echo "configure:12026: checking for location of cairo library" >&5 +echo "configure:12024: checking for location of cairo library" >&5 case "$with_cairo_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-cairo-libs." 1>&2; exit 1; } @@ -12042,7 +12040,7 @@ echo $ac_n "checking for cairo linking flags""... $ac_c" 1>&6 -echo "configure:12046: checking for cairo linking flags" >&5 +echo "configure:12044: checking for cairo linking flags" >&5 case "$with_cairo_ldflags" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-cairo-ldflags." 1>&2; exit 1; } @@ -12058,10 +12056,10 @@ LIBS=" $CAIROLIB $LIBS" LDFLAGS=" $LDFLAGS" echo $ac_n "checking for cairo_create""... $ac_c" 1>&6 -echo "configure:12062: checking for cairo_create" >&5 +echo "configure:12060: checking for cairo_create" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_cairo_create=yes" else @@ -12118,10 +12116,10 @@ LIBS=" $CAIROLIB $LIBS" LDFLAGS=" $LDFLAGS" echo $ac_n "checking for cairo_xlib_surface_create_with_xrender_format""... $ac_c" 1>&6 -echo "configure:12122: checking for cairo_xlib_surface_create_with_xrender_format" >&5 +echo "configure:12120: checking for cairo_xlib_surface_create_with_xrender_format" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_cairo_xlib_surface_create_with_xrender_format=yes" else @@ -12177,10 +12175,10 @@ LIBS=" $CAIROLIB $LIBS" LDFLAGS=" $LDFLAGS" echo $ac_n "checking for cairo_xlib_surface_get_xrender_format""... $ac_c" 1>&6 -echo "configure:12181: checking for cairo_xlib_surface_get_xrender_format" >&5 +echo "configure:12179: checking for cairo_xlib_surface_get_xrender_format" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_cairo_xlib_surface_get_xrender_format=yes" else @@ -12245,7 +12243,7 @@ echo $ac_n "checking whether to use FreeType""... $ac_c" 1>&6 -echo "configure:12249: checking whether to use FreeType" >&5 +echo "configure:12247: checking whether to use FreeType" >&5 echo "$ac_t"""$with_freetype"" 1>&6 case "$with_freetype" in "no") USE_FREETYPE= ;; @@ -12264,7 +12262,7 @@ echo $ac_n "checking for location of FreeType includes""... $ac_c" 1>&6 -echo "configure:12268: checking for location of FreeType includes" >&5 +echo "configure:12266: checking for location of FreeType includes" >&5 case "$with_freetype_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-freetype-includes." 1>&2; exit 1; } @@ -12290,15 +12288,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12294: checking for $ac_hdr" >&5 +echo "configure:12292: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12332,7 +12330,7 @@ echo $ac_n "checking for location of FreeType library""... $ac_c" 1>&6 -echo "configure:12336: checking for location of FreeType library" >&5 +echo "configure:12334: checking for location of FreeType library" >&5 case "$with_freetype_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-freetype-libs." 1>&2; exit 1; } @@ -12357,13 +12355,13 @@ echo $ac_n "checking for FT_Init_FreeType in -lfreetype""... $ac_c" 1>&6 -echo "configure:12361: checking for FT_Init_FreeType in -lfreetype" >&5 +echo "configure:12359: checking for FT_Init_FreeType in -lfreetype" >&5 ac_lib_var=`echo freetype'_'FT_Init_FreeType | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lfreetype $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12415,7 +12413,7 @@ echo $ac_n "checking whether to use NLS""... $ac_c" 1>&6 -echo "configure:12419: checking whether to use NLS" >&5 +echo "configure:12417: checking whether to use NLS" >&5 echo "$ac_t"""$with_nls"" 1>&6 case "$with_nls" in "no") USE_NLS= ;; @@ -12435,10 +12433,10 @@ echo $ac_n "checking for gettext""... $ac_c" 1>&6 -echo "configure:12439: checking for gettext" >&5 +echo "configure:12437: checking for gettext" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gettext=yes" else @@ -12479,13 +12477,13 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:12483: checking for gettext in -lintl" >&5 +echo "configure:12481: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12531,7 +12529,7 @@ echo $ac_n "checking whether to use C++""... $ac_c" 1>&6 -echo "configure:12535: checking whether to use C++" >&5 +echo "configure:12533: checking whether to use C++" >&5 echo "$ac_t"""$with_cxx"" 1>&6 case "$with_cxx" in "no") USE_CXX= ;; @@ -12547,7 +12545,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:12551: checking for $ac_word" >&5 +echo "configure:12549: checking for $ac_word" >&5 if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -12576,7 +12574,7 @@ echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:12580: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:12578: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -12587,12 +12585,12 @@ cat > conftest.$ac_ext << EOF -#line 12591 "configure" +#line 12589 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:12596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -12618,19 +12616,19 @@ { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:12622: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:12620: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:12627: checking whether we are using GNU C++" >&5 +echo "configure:12625: checking whether we are using GNU C++" >&5 cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:12632: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -12648,7 +12646,7 @@ ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:12652: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:12650: checking whether ${CXX-g++} accepts -g" >&5 echo 'void f(){}' > conftest.cc if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then @@ -12686,7 +12684,7 @@ 'void exit (int);' do cat > conftest.$ac_ext < $ac_declaration @@ -12694,7 +12692,7 @@ exit (42); ; return 0; } EOF -if { (eval echo configure:12698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -12704,14 +12702,14 @@ fi rm -f conftest* cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* break else @@ -12740,7 +12738,7 @@ echo $ac_n "checking whether to use openDWG""... $ac_c" 1>&6 -echo "configure:12744: checking whether to use openDWG" >&5 +echo "configure:12742: checking whether to use openDWG" >&5 echo "$ac_t"""$with_opendwg"" 1>&6 case "$with_opendwg" in "no") USE_OPENDWG= ;; @@ -12760,7 +12758,7 @@ echo $ac_n "checking for location of openDGW includes""... $ac_c" 1>&6 -echo "configure:12764: checking for location of openDGW includes" >&5 +echo "configure:12762: checking for location of openDGW includes" >&5 case "$with_opendwg_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-opendwg-includes." 1>&2; exit 1; } @@ -12786,15 +12784,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12790: checking for $ac_hdr" >&5 +echo "configure:12788: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12796: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12828,7 +12826,7 @@ echo $ac_n "checking for location of openDWG library""... $ac_c" 1>&6 -echo "configure:12832: checking for location of openDWG library" >&5 +echo "configure:12830: checking for location of openDWG library" >&5 case "$with_opendwg_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-opendwg-libs." 1>&2; exit 1; } @@ -12869,7 +12867,7 @@ echo $ac_n "checking whether to use POSIX threads""... $ac_c" 1>&6 -echo "configure:12873: checking whether to use POSIX threads" >&5 +echo "configure:12871: checking whether to use POSIX threads" >&5 echo "$ac_t"""$with_pthread"" 1>&6 case "$with_pthread" in "no") USE_PTHREAD= ;; @@ -12889,7 +12887,7 @@ echo $ac_n "checking for location of POSIX threads includes""... $ac_c" 1>&6 -echo "configure:12893: checking for location of POSIX threads includes" >&5 +echo "configure:12891: checking for location of POSIX threads includes" >&5 case "$with_pthread_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-pthread-includes." 1>&2; exit 1; } @@ -12915,15 +12913,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12919: checking for $ac_hdr" >&5 +echo "configure:12917: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12957,7 +12955,7 @@ echo $ac_n "checking for location of POSIX threads library""... $ac_c" 1>&6 -echo "configure:12961: checking for location of POSIX threads library" >&5 +echo "configure:12959: checking for location of POSIX threads library" >&5 case "$with_pthread_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-pthread-libs." 1>&2; exit 1; } @@ -12982,10 +12980,10 @@ LIBS=" $LIBS" LDFLAGS=" $LDFLAGS" echo $ac_n "checking for pthread_create""... $ac_c" 1>&6 -echo "configure:12986: checking for pthread_create" >&5 +echo "configure:12984: checking for pthread_create" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_create=yes" else @@ -13035,13 +13033,13 @@ echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:13039: checking for pthread_create in -lpthread" >&5 +echo "configure:13037: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13102,7 +13100,7 @@ echo $ac_n "checking whether to use OpenMP""... $ac_c" 1>&6 -echo "configure:13106: checking whether to use OpenMP" >&5 +echo "configure:13104: checking whether to use OpenMP" >&5 echo "$ac_t"""$with_openmp"" 1>&6 case "$with_openmp" in "no") USE_OPENMP= ;; @@ -13123,7 +13121,7 @@ echo $ac_n "checking for location of OpenMP includes""... $ac_c" 1>&6 -echo "configure:13127: checking for location of OpenMP includes" >&5 +echo "configure:13125: checking for location of OpenMP includes" >&5 case "$with_openmp_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-openmp-includes." 1>&2; exit 1; } @@ -13149,15 +13147,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:13153: checking for $ac_hdr" >&5 +echo "configure:13151: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13195,7 +13193,7 @@ echo $ac_n "checking for location of OpenMP library""... $ac_c" 1>&6 -echo "configure:13199: checking for location of OpenMP library" >&5 +echo "configure:13197: checking for location of OpenMP library" >&5 case "$with_openmp_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-openmp-libs." 1>&2; exit 1; } @@ -13220,10 +13218,10 @@ LIBS=" $LIBS" LDFLAGS=" $LDFLAGS" echo $ac_n "checking for GOMP_parallel_start""... $ac_c" 1>&6 -echo "configure:13224: checking for GOMP_parallel_start" >&5 +echo "configure:13222: checking for GOMP_parallel_start" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_GOMP_parallel_start=yes" else @@ -13273,13 +13271,13 @@ echo $ac_n "checking for GOMP_parallel_start in -lgomp""... $ac_c" 1>&6 -echo "configure:13277: checking for GOMP_parallel_start in -lgomp" >&5 +echo "configure:13275: checking for GOMP_parallel_start in -lgomp" >&5 ac_lib_var=`echo gomp'_'GOMP_parallel_start | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lgomp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13363,7 +13361,7 @@ echo $ac_n "checking whether to use OpenCL""... $ac_c" 1>&6 -echo "configure:13367: checking whether to use OpenCL" >&5 +echo "configure:13365: checking whether to use OpenCL" >&5 echo "$ac_t"""$with_opencl"" 1>&6 case "$with_opencl" in "no") USE_OPENCL= ;; @@ -13383,7 +13381,7 @@ echo $ac_n "checking for location of OpenCL includes""... $ac_c" 1>&6 -echo "configure:13387: checking for location of OpenCL includes" >&5 +echo "configure:13385: checking for location of OpenCL includes" >&5 case "$with_opencl_includes" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-opencl-includes." 1>&2; exit 1; } @@ -13410,15 +13408,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:13414: checking for $ac_hdr" >&5 +echo "configure:13412: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13458,10 +13456,10 @@ LIBS="-framework OpenCL $LIBS" LDFLAGS=" $LDFLAGS" echo $ac_n "checking for clGetPlatformInfo""... $ac_c" 1>&6 -echo "configure:13462: checking for clGetPlatformInfo" >&5 +echo "configure:13460: checking for clGetPlatformInfo" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_clGetPlatformInfo=yes" else @@ -13523,15 +13521,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:13527: checking for $ac_hdr" >&5 +echo "configure:13525: checking for $ac_hdr" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13564,7 +13562,7 @@ # With OpenCL library directory echo $ac_n "checking for location of OpenCL library""... $ac_c" 1>&6 -echo "configure:13568: checking for location of OpenCL library" >&5 +echo "configure:13566: checking for location of OpenCL library" >&5 case "$with_opencl_libs" in y | ye | yes | n | no) { echo "configure: error: *** You must supply a directory to --with-opencl-libs." 1>&2; exit 1; } @@ -13588,13 +13586,13 @@ echo $ac_n "checking for clGetPlatformInfo in -lOpenCL""... $ac_c" 1>&6 -echo "configure:13592: checking for clGetPlatformInfo in -lOpenCL" >&5 +echo "configure:13590: checking for clGetPlatformInfo in -lOpenCL" >&5 ac_lib_var=`echo OpenCL'_'clGetPlatformInfo | sed 'y%./+-%__p_%'` ac_save_LIBS="$LIBS" LIBS="-lOpenCL $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13665,7 +13663,7 @@ fi echo $ac_n "checking for special C compiler options needed for large files""... $ac_c" 1>&6 -echo "configure:13669: checking for special C compiler options needed for large files" >&5 +echo "configure:13667: checking for special C compiler options needed for large files" >&5 ac_cv_sys_largefile_CC=no largefile_cc_opt="" @@ -13673,7 +13671,7 @@ # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat > conftest.$ac_ext < /* Check that off_t can represent 2**63 - 1 correctly. @@ -13689,7 +13687,7 @@ ; return 0; } EOF -if { (eval echo configure:13693: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -13698,7 +13696,7 @@ ac_save_CC="${CC-cc}" CC="$CC -n32" cat > conftest.$ac_ext < /* Check that off_t can represent 2**63 - 1 correctly. @@ -13714,7 +13712,7 @@ ; return 0; } EOF -if { (eval echo configure:13718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sys_largefile_CC=' -n32' else @@ -13741,11 +13739,11 @@ fi echo $ac_n "checking for _FILE_OFFSET_BITS value needed for large files""... $ac_c" 1>&6 -echo "configure:13745: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo "configure:13743: checking for _FILE_OFFSET_BITS value needed for large files" >&5 ac_cv_sys_file_offset_bits=no cat > conftest.$ac_ext < /* Check that off_t can represent 2**63 - 1 correctly. @@ -13761,14 +13759,14 @@ ; return 0; } EOF -if { (eval echo configure:13765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -13786,7 +13784,7 @@ ; return 0; } EOF -if { (eval echo configure:13790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sys_file_offset_bits=64 else @@ -13812,11 +13810,11 @@ fi echo $ac_n "checking for _LARGE_FILES value needed for large files""... $ac_c" 1>&6 -echo "configure:13816: checking for _LARGE_FILES value needed for large files" >&5 +echo "configure:13814: checking for _LARGE_FILES value needed for large files" >&5 ac_cv_sys_large_files=no cat > conftest.$ac_ext < /* Check that off_t can represent 2**63 - 1 correctly. @@ -13832,14 +13830,14 @@ ; return 0; } EOF -if { (eval echo configure:13836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -13857,7 +13855,7 @@ ; return 0; } EOF -if { (eval echo configure:13861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sys_large_files=1 else @@ -13883,25 +13881,25 @@ fi echo $ac_n "checking for _LARGEFILE_SOURCE value needed for large files""... $ac_c" 1>&6 -echo "configure:13887: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +echo "configure:13885: checking for _LARGEFILE_SOURCE value needed for large files" >&5 ac_cv_sys_largefile_source=no cat > conftest.$ac_ext < int main() { return !fseeko; ; return 0; } EOF -if { (eval echo configure:13898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -13910,7 +13908,7 @@ return !fseeko; ; return 0; } EOF -if { (eval echo configure:13914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sys_largefile_source=1 else @@ -13942,25 +13940,25 @@ ac_save_cflags=${CFLAGS} CFLAGS="$LFS_CFLAGS ${ac_save_cflags}" echo $ac_n "checking for _LARGEFILE_SOURCE value needed for large files""... $ac_c" 1>&6 -echo "configure:13946: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +echo "configure:13944: checking for _LARGEFILE_SOURCE value needed for large files" >&5 ac_cv_sys_largefile_source=no cat > conftest.$ac_ext < int main() { return !fseeko; ; return 0; } EOF -if { (eval echo configure:13957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -13969,7 +13967,7 @@ return !fseeko; ; return 0; } EOF -if { (eval echo configure:13973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sys_largefile_source=1 else @@ -13999,18 +13997,18 @@ # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. echo $ac_n "checking for fseeko""... $ac_c" 1>&6 -echo "configure:14003: checking for fseeko" >&5 +echo "configure:14001: checking for fseeko" >&5 ac_cv_func_fseeko=no cat > conftest.$ac_ext < int main() { return fseeko && fseeko (stdin, 0, 0); ; return 0; } EOF -if { (eval echo configure:14014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_fseeko=yes else @@ -14027,10 +14025,10 @@ fi echo $ac_n "checking if system supports Large Files at all""... $ac_c" 1>&6 -echo "configure:14031: checking if system supports Large Files at all" >&5 +echo "configure:14029: checking if system supports Large Files at all" >&5 cat > conftest.$ac_ext < #include @@ -14062,7 +14060,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:14066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_largefiles=yes else @@ -14201,14 +14199,14 @@ s%@ARCH@%$ARCH%g s%@GISBASE@%$GISBASE%g s%@GRASS_BIN@%$GRASS_BIN%g -s%@SVN_VERSION@%$SVN_VERSION%g +s%@GIT@%$GIT%g s%@GRASS_VERSION_FILE@%$GRASS_VERSION_FILE%g s%@GRASS_VERSION_MAJOR@%$GRASS_VERSION_MAJOR%g s%@GRASS_VERSION_MINOR@%$GRASS_VERSION_MINOR%g s%@GRASS_VERSION_RELEASE@%$GRASS_VERSION_RELEASE%g s%@GRASS_VERSION_NUMBER@%$GRASS_VERSION_NUMBER%g s%@GRASS_VERSION_DATE@%$GRASS_VERSION_DATE%g -s%@GRASS_VERSION_SVN@%$GRASS_VERSION_SVN%g +s%@GRASS_VERSION_GIT@%$GRASS_VERSION_GIT%g s%@NAME_VER@%$NAME_VER%g s%@LIB_VER@%$LIB_VER%g s%@MACOSX_APP@%$MACOSX_APP%g diff -Nru grass-7.6.1/configure.in grass-7.8.0/configure.in --- grass-7.6.1/configure.in 2019-03-19 20:04:33.000000000 +0000 +++ grass-7.8.0/configure.in 2019-06-11 07:26:20.000000000 +0000 @@ -126,14 +126,12 @@ LIB_VER=`echo ${GRASS_VERSION_NUMBER} | sed 's/^\([0-9.]*\).*$/\1/'` changequote([,]) -GRASS_VERSION_SVN="exported" -AC_PATH_PROG(SVN_VERSION, svnversion, no) -if test "$SVN_VERSION" != "no" ; then - GRASS_VERSION_SVN=`$SVN_VERSION -c | cut -f2 -d:` - if test "$GRASS_VERSION_SVN" = "exported" -o "$GRASS_VERSION_SVN" = "Unversioned directory" ; then - GRASS_VERSION_SVN="exported" - else - GRASS_VERSION_SVN="r$GRASS_VERSION_SVN" +GRASS_VERSION_GIT="exported" +AC_PATH_PROG(GIT, git, no) +if test "$GIT" != "no" ; then + GRASS_VERSION_GIT=`$GIT rev-parse --short HEAD 2>/dev/null` + if test -z "$GRASS_VERSION_GIT"; then + GRASS_VERSION_GIT="exported" fi fi @@ -143,7 +141,7 @@ AC_SUBST(GRASS_VERSION_RELEASE) AC_SUBST(GRASS_VERSION_NUMBER) AC_SUBST(GRASS_VERSION_DATE) -AC_SUBST(GRASS_VERSION_SVN) +AC_SUBST(GRASS_VERSION_GIT) AC_SUBST(NAME_VER) AC_SUBST(LIB_VER) @@ -268,7 +266,7 @@ LOC_ARG_WITH(openmp, OpenMP, no) LOC_ARG_WITH(opencl, OpenCL, no) LOC_ARG_WITH(bzlib, BZIP2, no) -LOC_ARG_WITH(zstd, Zstandard, no) +LOC_ARG_WITH(zstd, Zstandard) AC_ARG_WITH(gdal, [ --with-gdal[=path/gdal-config] diff -Nru grass-7.6.1/contributors.csv grass-7.8.0/contributors.csv --- grass-7.6.1/contributors.csv 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/contributors.csv 2019-06-03 20:34:20.000000000 +0000 @@ -1,6 +1,6 @@ cvs_id,name,email,country,osgeo_id,rfc2_agreed -,Ivan Shmakov,,Russia,1gray,yes --,Eric Patton,,Canada,epatton,yes +-,Eric Patton,,Canada,epatton,yes -,Laura Toma,,USA,ltoma,yes -,Markus Metz,,Germany,mmetz,yes -,Maris Nartiss,,Latvia,marisn,yes @@ -17,6 +17,7 @@ -,Margherita Di Leo,,Italy,madi,yes -,Veronica Andreo,,Argentina,veroandreo,yes -,Stefan Blumentrath,,Norway,sbl,yes +-,Ondřej Pešek,,Czech Republic,pesekon2,yes alex,Alex Shevlakov,,Russia,-,- andreas,Andreas Lange,,Germany,-,- benjamin,Benjamin Ducke,,Germany,benducke,yes diff -Nru grass-7.6.1/db/db.columns/db.columns.html grass-7.8.0/db/db.columns/db.columns.html --- grass-7.6.1/db/db.columns/db.columns.html 2019-03-19 19:58:18.000000000 +0000 +++ grass-7.8.0/db/db.columns/db.columns.html 2019-05-18 15:50:04.000000000 +0000 @@ -57,4 +57,4 @@ Radim Blazek, ITC-Irst, Trento, Italy -

Last changed: $Date: 2014-11-28 10:57:47 +0100 (Fri, 28 Nov 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/db/db.connect/db.connect.html grass-7.8.0/db/db.connect/db.connect.html --- grass-7.6.1/db/db.connect/db.connect.html 2019-03-19 19:58:18.000000000 +0000 +++ grass-7.8.0/db/db.connect/db.connect.html 2019-05-18 15:50:04.000000000 +0000 @@ -131,4 +131,4 @@ GRASS 7 improvements: Martin Landa, Markus Metz

-Last changed: $Date: 2016-09-11 09:28:22 +0200 (Sun, 11 Sep 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/db.copy/db.copy.html grass-7.8.0/db/db.copy/db.copy.html --- grass-7.6.1/db/db.copy/db.copy.html 2019-03-19 19:58:18.000000000 +0000 +++ grass-7.8.0/db/db.copy/db.copy.html 2019-05-18 15:50:04.000000000 +0000 @@ -79,4 +79,4 @@ Radim Blazek, ITC-irst, Trento, Italy -

Last changed: $Date: 2014-11-28 10:57:47 +0100 (Fri, 28 Nov 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/db/db.createdb/db.createdb.html grass-7.8.0/db/db.createdb/db.createdb.html --- grass-7.6.1/db/db.createdb/db.createdb.html 2019-03-19 19:58:18.000000000 +0000 +++ grass-7.8.0/db/db.createdb/db.createdb.html 2019-05-18 15:50:04.000000000 +0000 @@ -65,4 +65,4 @@ SQLite and PostgreSQL support by Martin Landa, Czech Technical University in Prague, Czech Republic

-Last changed: $Date: 2014-12-07 23:22:14 +0100 (Sun, 07 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/db.databases/db.databases.html grass-7.8.0/db/db.databases/db.databases.html --- grass-7.6.1/db/db.databases/db.databases.html 2019-03-19 19:58:36.000000000 +0000 +++ grass-7.8.0/db/db.databases/db.databases.html 2019-05-18 15:50:04.000000000 +0000 @@ -55,4 +55,4 @@ Updated for GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic

-Last changed: $Date: 2014-12-07 23:22:14 +0100 (Sun, 07 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/db.describe/db.describe.html grass-7.8.0/db/db.describe/db.describe.html --- grass-7.6.1/db/db.describe/db.describe.html 2019-03-19 19:58:36.000000000 +0000 +++ grass-7.8.0/db/db.describe/db.describe.html 2019-05-18 15:50:04.000000000 +0000 @@ -76,4 +76,4 @@ Radim Blazek, ITC-Irst, Trento, Italy -

Last changed: $Date: 2014-11-28 10:57:47 +0100 (Fri, 28 Nov 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/db/db.describe/testsuite/test_dbdescribe.py grass-7.8.0/db/db.describe/testsuite/test_dbdescribe.py --- grass-7.6.1/db/db.describe/testsuite/test_dbdescribe.py 2019-03-19 19:58:07.000000000 +0000 +++ grass-7.8.0/db/db.describe/testsuite/test_dbdescribe.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Nov 14 09:43:55 2017 diff -Nru grass-7.6.1/db/db.drivers/db.drivers.html grass-7.8.0/db/db.drivers/db.drivers.html --- grass-7.6.1/db/db.drivers/db.drivers.html 2019-03-19 19:58:07.000000000 +0000 +++ grass-7.8.0/db/db.drivers/db.drivers.html 2019-05-18 15:50:04.000000000 +0000 @@ -31,4 +31,4 @@ Radim Blazek, ITC-Irst, Trento, Italy -

Last changed: $Date: 2014-11-28 10:57:47 +0100 (Fri, 28 Nov 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/db/db.dropdb/db.dropdb.html grass-7.8.0/db/db.dropdb/db.dropdb.html --- grass-7.6.1/db/db.dropdb/db.dropdb.html 2019-03-19 19:58:36.000000000 +0000 +++ grass-7.8.0/db/db.dropdb/db.dropdb.html 2019-05-18 15:50:04.000000000 +0000 @@ -47,4 +47,4 @@ SQLite and PostgreSQL support by Martin Landa, Czech Technical University in Prague, Czech Republic

-Last changed: $Date: 2014-12-07 23:22:14 +0100 (Sun, 07 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/db.execute/db.execute.html grass-7.8.0/db/db.execute/db.execute.html --- grass-7.6.1/db/db.execute/db.execute.html 2019-03-19 19:58:36.000000000 +0000 +++ grass-7.8.0/db/db.execute/db.execute.html 2019-05-18 15:50:04.000000000 +0000 @@ -111,4 +111,4 @@ CERL

-Last changed: $Date: 2014-11-28 10:57:47 +0100 (Fri, 28 Nov 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/db.login/db.login.html grass-7.8.0/db/db.login/db.login.html --- grass-7.6.1/db/db.login/db.login.html 2019-03-19 19:58:18.000000000 +0000 +++ grass-7.8.0/db/db.login/db.login.html 2019-05-18 15:50:04.000000000 +0000 @@ -63,4 +63,4 @@ Support for hostname and port by Martin Landa, OSGeoREL, Czech Technical University in Prague, Czech Republic (GRASS 7.1)

-Last changed: $Date: 2015-10-01 23:06:38 +0200 (Thu, 01 Oct 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/db.select/db.select.html grass-7.8.0/db/db.select/db.select.html --- grass-7.6.1/db/db.select/db.select.html 2019-03-19 19:58:18.000000000 +0000 +++ grass-7.8.0/db/db.select/db.select.html 2019-05-18 15:50:04.000000000 +0000 @@ -103,4 +103,4 @@ Support for multiple statements by Martin Landa, Czech Technical University in Prague

-Last changed: $Date: 2017-08-11 12:14:08 +0200 (Fri, 11 Aug 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/db.tables/db.tables.html grass-7.8.0/db/db.tables/db.tables.html --- grass-7.6.1/db/db.tables/db.tables.html 2019-03-19 19:58:18.000000000 +0000 +++ grass-7.8.0/db/db.tables/db.tables.html 2019-05-18 15:50:04.000000000 +0000 @@ -42,4 +42,4 @@ Unknown -

Last changed: $Date: 2014-11-28 10:57:47 +0100 (Fri, 28 Nov 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/db/drivers/dbf/grass-dbf.html grass-7.8.0/db/drivers/dbf/grass-dbf.html --- grass-7.6.1/db/drivers/dbf/grass-dbf.html 2019-03-19 19:58:37.000000000 +0000 +++ grass-7.8.0/db/drivers/dbf/grass-dbf.html 2019-05-18 15:50:04.000000000 +0000 @@ -128,4 +128,4 @@

-Last changed: $Date: 2014-04-20 12:28:15 +0200 (Sun, 20 Apr 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/drivers/mysql/grass-mesql.html grass-7.8.0/db/drivers/mysql/grass-mesql.html --- grass-7.6.1/db/drivers/mysql/grass-mesql.html 2019-03-19 19:58:36.000000000 +0000 +++ grass-7.8.0/db/drivers/mysql/grass-mesql.html 2019-08-12 16:50:46.000000000 +0000 @@ -79,10 +79,10 @@ Radim Blazek

-Last changed: $Date: 2014-04-20 12:09:22 +0200 (Sun, 20 Apr 2014) $ +Last changed: $Date$


Main index - Database index - Topics index - Keywords Index - Full index

-

© 2003-2013 GRASS Development Team, GRASS GIS 7.0.svn Reference Manual

+

© 2003-2019 GRASS Development Team, GRASS GIS 7.8 Reference Manual

diff -Nru grass-7.6.1/db/drivers/mysql/grass-mysql.html grass-7.8.0/db/drivers/mysql/grass-mysql.html --- grass-7.6.1/db/drivers/mysql/grass-mysql.html 2019-03-19 19:58:36.000000000 +0000 +++ grass-7.8.0/db/drivers/mysql/grass-mysql.html 2019-05-18 15:50:04.000000000 +0000 @@ -116,4 +116,4 @@ Radim Blazek

-Last changed: $Date: 2014-04-20 12:28:15 +0200 (Sun, 20 Apr 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/drivers/odbc/grass-odbc.html grass-7.8.0/db/drivers/odbc/grass-odbc.html --- grass-7.6.1/db/drivers/odbc/grass-odbc.html 2019-03-19 19:58:36.000000000 +0000 +++ grass-7.8.0/db/drivers/odbc/grass-odbc.html 2019-05-18 15:50:04.000000000 +0000 @@ -166,4 +166,4 @@

-Last changed: $Date: 2014-04-20 12:28:15 +0200 (Sun, 20 Apr 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/drivers/ogr/grass-ogr.html grass-7.8.0/db/drivers/ogr/grass-ogr.html --- grass-7.6.1/db/drivers/ogr/grass-ogr.html 2019-03-19 19:58:36.000000000 +0000 +++ grass-7.8.0/db/drivers/ogr/grass-ogr.html 2019-05-18 15:50:04.000000000 +0000 @@ -15,4 +15,4 @@

-Last changed: $Date: 2014-04-20 12:28:15 +0200 (Sun, 20 Apr 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/drivers/postgres/grass-pg.html grass-7.8.0/db/drivers/postgres/grass-pg.html --- grass-7.6.1/db/drivers/postgres/grass-pg.html 2019-03-19 19:58:36.000000000 +0000 +++ grass-7.8.0/db/drivers/postgres/grass-pg.html 2019-05-18 15:50:04.000000000 +0000 @@ -149,4 +149,4 @@

-Last changed: $Date: 2018-07-13 11:36:07 +0200 (Fri, 13 Jul 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/drivers/postgres/index.c grass-7.8.0/db/drivers/postgres/index.c --- grass-7.6.1/db/drivers/postgres/index.c 2019-03-19 19:58:36.000000000 +0000 +++ grass-7.8.0/db/drivers/postgres/index.c 2019-06-03 20:34:20.000000000 +0000 @@ -34,6 +34,8 @@ db_append_string(&sql, " unique"); db_append_string(&sql, " index "); + if (PQserverVersion(pg_conn) >= 90500) + db_append_string(&sql, "if not exists "); db_append_string(&sql, db_get_index_name(index)); db_append_string(&sql, " on "); diff -Nru grass-7.6.1/db/drivers/sqlite/grass-sqlite.html grass-7.8.0/db/drivers/sqlite/grass-sqlite.html --- grass-7.6.1/db/drivers/sqlite/grass-sqlite.html 2019-03-19 19:58:18.000000000 +0000 +++ grass-7.8.0/db/drivers/sqlite/grass-sqlite.html 2019-05-18 15:50:04.000000000 +0000 @@ -78,4 +78,4 @@

-Last changed: $Date: 2016-11-14 00:05:32 +0100 (Mon, 14 Nov 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/db/drivers/sqlite/index.c grass-7.8.0/db/drivers/sqlite/index.c --- grass-7.6.1/db/drivers/sqlite/index.c 2019-03-19 19:58:18.000000000 +0000 +++ grass-7.8.0/db/drivers/sqlite/index.c 2019-06-03 20:34:20.000000000 +0000 @@ -47,7 +47,7 @@ db_append_string(&sql, " unique"); db_append_string(&sql, " index "); - db_append_string(&sql, " if not exists "); + db_append_string(&sql, "if not exists "); db_append_string(&sql, db_get_index_name(index)); db_append_string(&sql, " on "); diff -Nru grass-7.6.1/debian/changelog grass-7.8.0/debian/changelog --- grass-7.6.1/debian/changelog 2019-07-14 14:00:00.000000000 +0000 +++ grass-7.8.0/debian/changelog 2019-09-07 09:42:24.000000000 +0000 @@ -1,14 +1,78 @@ -grass (7.6.1-1~bionic2) bionic; urgency=medium - - * No change rebuild for GDAL 2.4.2 transition. +grass (7.8.0-1~bionic1) bionic; urgency=medium - -- Angelos Tzotsos Sun, 14 Jul 2019 16:00:00 +0200 + * Rebuild for bionic. + + -- Martin Landa Sat, 07 Sep 2019 11:42:24 +0200 + +grass (7.8.0-1) unstable; urgency=medium + + * New upstream release. + * Recommend both git & subversion for g.extension. + * Drop unused override for spelling-error-in-binary. + * Don't define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H, proj.h is used. + * Move from experimental to unstable. + + -- Bas Couwenberg Sat, 07 Sep 2019 09:31:16 +0200 + +grass (7.8.0~rc1-1~exp1~bionic1) bionic; urgency=medium + + * Rebuild for bionic. + + -- Martin Landa Fri, 30 Aug 2019 15:08:34 +0300 + +grass (7.8.0~rc1-1~exp1) experimental; urgency=medium + + * New upstream release candidate. + * Update PIE hardening conditional, trusty is EOL. + * Update watch file for GRASS 7.8 releases. + * Update uversion mangle for _ in version. + * Switch to Python 3. + * Update upstream metadata for move to GitHub. + * Update README filename in docs file. + * Add python3-six to (build) dependencies. + * Replace subversion Recommends with git for g.extension. + * Update copyright file, changes: + - Update copyright years for Supreet Singh + - Add Shubham Sharma & Marcus D. Hanwell to copyright holders + * Drop patches applied upstream, refresh remaining patches. + + -- Bas Couwenberg Wed, 14 Aug 2019 19:47:24 +0200 + +grass (7.6.1-4) unstable; urgency=medium + + * Update PIE hardening conditional, trusty is EOL. + * Drop unused override for spelling-error-in-binary. + * No change rebuild with PDAL 2.0.1. + + -- Bas Couwenberg Wed, 04 Sep 2019 19:16:06 +0200 + +grass (7.6.1-3) unstable; urgency=medium + + * No change rebuild for PDAL mini transition. + + -- Bas Couwenberg Mon, 15 Jul 2019 06:41:53 +0200 + +grass (7.6.1-2) unstable; urgency=medium + + * Bump Standards-Version to 4.4.0, no changes. + * Disable liblas support, will be removed from Debian. + * Add patch to fix spelling errors. + + -- Bas Couwenberg Sun, 14 Jul 2019 07:39:11 +0200 + +grass (7.6.1-1) unstable; urgency=medium + + * Update gbp.conf to use --source-only-changes by default. + * Add patch to fix spelling errors. + * Move from experimental to unstable. + + -- Bas Couwenberg Sun, 07 Jul 2019 13:30:03 +0200 grass (7.6.1-1~bionic1) bionic; urgency=medium * Rebuild for bionic. - -- Angelos Tzotsos Mon, 01 Apr 2019 14:00:00 +0200 + -- Martin Landa Thu, 21 Mar 2019 16:55:01 +0100 grass (7.6.1-1~exp1) experimental; urgency=medium @@ -34,6 +98,12 @@ -- Bas Couwenberg Sat, 09 Mar 2019 18:53:20 +0100 +grass (7.6.0-2) UNRELEASED; urgency=medium + + * Define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H for PROJ 6.0.0 compatibility. + + -- Bas Couwenberg Sun, 14 Apr 2019 07:34:30 +0200 + grass (7.6.0-1) unstable; urgency=medium * Drop unused lintian override. diff -Nru grass-7.6.1/debian/control grass-7.8.0/debian/control --- grass-7.6.1/debian/control 2019-03-21 15:53:49.000000000 +0000 +++ grass-7.8.0/debian/control 2019-09-07 09:41:28.000000000 +0000 @@ -23,7 +23,6 @@ libgeos-dev, libjpeg-dev, liblapack-dev, - liblas-c-dev (>= 1.8.0-8~), libmotif-dev | lesstif2-dev, default-libmysqlclient-dev, libncurses5-dev, @@ -44,18 +43,19 @@ # optipng, # proj-bin needed for nad2bin during config proj-bin, - python, - python-dev, - python-numpy, - python-pil, - python-ply, - python-wxgtk3.0, + python3, + python3-dev, + python3-numpy, + python3-pil, + python3-ply, + python3-six, + python3-wxgtk4.0, unixodbc-dev, zlib1g-dev -Standards-Version: 4.3.0 +Standards-Version: 4.4.0 Vcs-Browser: https://salsa.debian.org/debian-gis-team/grass Vcs-Git: https://salsa.debian.org/debian-gis-team/grass.git -b ubuntugis/bionic -Homepage: http://grass.osgeo.org/ +Homepage: https://grass.osgeo.org/ Package: grass Architecture: all @@ -79,7 +79,7 @@ Architecture: any Depends: grass-doc, ${shlibs:Depends}, - ${python:Depends}, + ${python3:Depends}, ${misc:Depends} Recommends: gdal-bin, # cs2cs used by m.proj, gdalinfo+gdal_translate used by a number of scripts @@ -98,8 +98,9 @@ # used by NVIZ, d.out.gpsdrive, r.out.mpeg netpbm, # used by v.kridge - python-rpy2, - python-termcolor + python3-rpy2, + python3-six, + python3-termcolor Breaks: grass (<< 6.4.2-1~) Provides: ${grass:Provides} Replaces: grass (<< 6.4.2-1~) @@ -117,17 +118,17 @@ Architecture: any Depends: grass-core, # pyGL needed for wxNviz - python-opengl, - python-wxgtk3.0, + python3-opengl, + python3-wxgtk4.0, xterm | x-terminal-emulator, - ${python:Depends}, + ${python3:Depends}, ${misc:Depends} Recommends: # gs needed for wxPsmap PDF export ghostscript, # PIL needed for wxPsmap preview - python-matplotlib, - python-pil + python3-matplotlib, + python3-pil Breaks: grass (<< 6.4.2-1~) Replaces: grass (<< 6.4.2-1~) Description: GRASS GIS graphical user interfaces @@ -181,11 +182,12 @@ libgdal-dev, libpq-dev, libproj-dev, - ${python:Depends}, + ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends} -# Subversion is needed by g.extension, a primary motivator for installing the grass-dev pkg -Recommends: subversion +# git is needed by g.extension, a primary motivator for installing the grass-dev pkg +Recommends: git, + subversion Suggests: grass-dev-doc, pkg-config Description: GRASS GIS development files diff -Nru grass-7.6.1/debian/copyright grass-7.8.0/debian/copyright --- grass-7.6.1/debian/copyright 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/copyright 2019-09-07 09:40:48.000000000 +0000 @@ -1,14 +1,15 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: GRASS GIS Upstream-Contact: GRASS Development Team -Source: http://grass.osgeo.org/ +Source: https://grass.osgeo.org/ Files: * Copyright: 1989-2019, GRASS Development Team 2003-2019, Markus Neteler + 2017-2018, Supreet Singh 2011-2018, Vaclav Petras 2014-2018, Tereza Fiedlerova - 2018, Supreet Singh + 2018, Shubham Sharma 1992-2017, Helena Mitasova 2003-2017, Glynn Clements 2011-2017, Markus Metz @@ -40,6 +41,7 @@ 2006-2009, Cedric Shoc 2009, Gabor Grothendieck 2007-2008, Martin Schroeder + 2008, Marcus D. Hanwell 2005-2006, Politecnico di Milano 2004-2005, GDF Hannover 2002-2003, University of Sannio (BN) - Italy diff -Nru grass-7.6.1/debian/gbp.conf grass-7.8.0/debian/gbp.conf --- grass-7.6.1/debian/gbp.conf 2019-03-21 15:53:49.000000000 +0000 +++ grass-7.8.0/debian/gbp.conf 2019-09-07 09:41:20.000000000 +0000 @@ -14,3 +14,6 @@ # Always use pristine-tar. pristine-tar = True + +[buildpackage] +pbuilder-options = --source-only-changes diff -Nru grass-7.6.1/debian/grass-core.dirs grass-7.8.0/debian/grass-core.dirs --- grass-7.6.1/debian/grass-core.dirs 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-core.dirs 2019-09-07 09:40:48.000000000 +0000 @@ -1,4 +1,4 @@ -usr/lib/grass76 +usr/lib/grass78 usr/bin usr/share/doc/grass-core usr/share/man diff -Nru grass-7.6.1/debian/grass-core.docs grass-7.8.0/debian/grass-core.docs --- grass-7.6.1/debian/grass-core.docs 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-core.docs 2019-09-07 09:40:48.000000000 +0000 @@ -1,4 +1,4 @@ -README +README.md AUTHORS CITING COPYING diff -Nru grass-7.6.1/debian/grass-core.install grass-7.8.0/debian/grass-core.install --- grass-7.6.1/debian/grass-core.install 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-core.install 2019-09-07 09:40:48.000000000 +0000 @@ -1,12 +1,12 @@ -usr/bin/grass76 -usr/bin/x-grass76 -usr/lib/grass76/bin -usr/lib/grass76/driver -usr/lib/grass76/etc -usr/lib/grass76/fonts -usr/lib/grass76/lib -usr/lib/grass76/locale -usr/lib/grass76/scripts +usr/bin/grass78 +usr/bin/x-grass78 +usr/lib/grass78/bin +usr/lib/grass78/driver +usr/lib/grass78/etc +usr/lib/grass78/fonts +usr/lib/grass78/lib +usr/lib/grass78/locale +usr/lib/grass78/scripts usr/share/applications usr/share/metainfo usr/share/icons/hicolor diff -Nru grass-7.6.1/debian/grass-core.links grass-7.8.0/debian/grass-core.links --- grass-7.6.1/debian/grass-core.links 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-core.links 2019-09-07 09:40:48.000000000 +0000 @@ -1,12 +1,12 @@ -usr/bin/grass76 usr/bin/grass -usr/bin/x-grass76 usr/bin/x-grass -usr/share/man/man1/grass76.1.gz usr/share/man/man1/grass.1.gz -usr/share/man/man1/grass76.1.gz usr/share/man/man1/x-grass.1.gz -usr/share/man/man1/grass76.1.gz usr/share/man/man1/x-grass76.1.gz -usr/share/doc/grass-core/AUTHORS usr/lib/grass76/AUTHORS -usr/share/doc/grass-core/CITING usr/lib/grass76/CITING -usr/share/doc/grass-core/COPYING usr/lib/grass76/COPYING -usr/share/doc/grass-core/contributors.csv usr/lib/grass76/contributors.csv -usr/share/doc/grass-core/contributors_extra.csv usr/lib/grass76/contributors_extra.csv -usr/share/doc/grass-core/translators.csv usr/lib/grass76/translators.csv -usr/share/common-licenses/GPL-2 usr/lib/grass76/GPL.TXT +usr/bin/grass78 usr/bin/grass +usr/bin/x-grass78 usr/bin/x-grass +usr/share/man/man1/grass78.1.gz usr/share/man/man1/grass.1.gz +usr/share/man/man1/grass78.1.gz usr/share/man/man1/x-grass.1.gz +usr/share/man/man1/grass78.1.gz usr/share/man/man1/x-grass78.1.gz +usr/share/doc/grass-core/AUTHORS usr/lib/grass78/AUTHORS +usr/share/doc/grass-core/CITING usr/lib/grass78/CITING +usr/share/doc/grass-core/COPYING usr/lib/grass78/COPYING +usr/share/doc/grass-core/contributors.csv usr/lib/grass78/contributors.csv +usr/share/doc/grass-core/contributors_extra.csv usr/lib/grass78/contributors_extra.csv +usr/share/doc/grass-core/translators.csv usr/lib/grass78/translators.csv +usr/share/common-licenses/GPL-2 usr/lib/grass78/GPL.TXT diff -Nru grass-7.6.1/debian/grass-core.lintian-overrides grass-7.8.0/debian/grass-core.lintian-overrides --- grass-7.6.1/debian/grass-core.lintian-overrides 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-core.lintian-overrides 2019-09-07 09:41:00.000000000 +0000 @@ -45,15 +45,9 @@ extra-license-file usr/lib/grass*/etc/license extra-license-file usr/share/doc/grass-core/COPYING -# Python 3 not supported yet -dependency-on-python-version-marked-for-end-of-life (Depends: python) - # Not a problem package-contains-documentation-outside-usr-share-doc usr/lib/grass*/etc/license -# False positive, part of NormalX, NormalY, NormalZ -spelling-error-in-binary usr/lib/grass*/bin/v.in.pdal NormalY Normally - # https://trac.osgeo.org/grass/ticket/3786 file-references-package-build-path diff -Nru grass-7.6.1/debian/grass-core.manpages grass-7.8.0/debian/grass-core.manpages --- grass-7.6.1/debian/grass-core.manpages 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-core.manpages 2019-09-07 09:40:48.000000000 +0000 @@ -1 +1 @@ -debian/grass76.1 +debian/grass78.1 diff -Nru grass-7.6.1/debian/grass-dev.dirs grass-7.8.0/debian/grass-dev.dirs --- grass-7.6.1/debian/grass-dev.dirs 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-dev.dirs 2019-09-07 09:40:48.000000000 +0000 @@ -1,4 +1,4 @@ -usr/lib/grass76/include -usr/lib/grass76/include/Make -usr/lib/grass76/tools +usr/lib/grass78/include +usr/lib/grass78/include/Make +usr/lib/grass78/tools usr/share/pkgconfig diff -Nru grass-7.6.1/debian/grass-dev.install grass-7.8.0/debian/grass-dev.install --- grass-7.6.1/debian/grass-dev.install 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-dev.install 2019-09-07 09:40:48.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib/grass76/include -usr/lib/grass76/tools +usr/lib/grass78/include +usr/lib/grass78/tools diff -Nru grass-7.6.1/debian/grass-dev.links grass-7.8.0/debian/grass-dev.links --- grass-7.6.1/debian/grass-dev.links 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-dev.links 2019-09-07 09:40:48.000000000 +0000 @@ -1 +1 @@ -usr/share/pkgconfig/grass76.pc usr/share/pkgconfig/grass.pc +usr/share/pkgconfig/grass78.pc usr/share/pkgconfig/grass.pc diff -Nru grass-7.6.1/debian/grass-dev.lintian-overrides grass-7.8.0/debian/grass-dev.lintian-overrides --- grass-7.6.1/debian/grass-dev.lintian-overrides 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-dev.lintian-overrides 2019-09-07 09:40:48.000000000 +0000 @@ -1,6 +1,3 @@ -# Python 3 not supported yet -dependency-on-python-version-marked-for-end-of-life (Depends: python) - # https://trac.osgeo.org/grass/ticket/3786 file-references-package-build-path * diff -Nru grass-7.6.1/debian/grass-doc.install grass-7.8.0/debian/grass-doc.install --- grass-7.6.1/debian/grass-doc.install 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-doc.install 2019-09-07 09:40:48.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib/grass76/docs/html usr/share/doc/grass-doc -usr/lib/grass76/docs/man/man1 usr/share/man +usr/lib/grass78/docs/html usr/share/doc/grass-doc +usr/lib/grass78/docs/man/man1 usr/share/man diff -Nru grass-7.6.1/debian/grass-doc.links grass-7.8.0/debian/grass-doc.links --- grass-7.6.1/debian/grass-doc.links 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-doc.links 2019-09-07 09:40:48.000000000 +0000 @@ -1,2 +1,2 @@ -usr/share/doc/grass-doc/html usr/lib/grass76/docs/html +usr/share/doc/grass-doc/html usr/lib/grass78/docs/html usr/share/javascript/jquery usr/share/doc/grass-doc/html/jquery diff -Nru grass-7.6.1/debian/grass-gui.dirs grass-7.8.0/debian/grass-gui.dirs --- grass-7.6.1/debian/grass-gui.dirs 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-gui.dirs 2019-09-07 09:40:48.000000000 +0000 @@ -1 +1 @@ -usr/share/grass76 +usr/share/grass78 diff -Nru grass-7.6.1/debian/grass-gui.install grass-7.8.0/debian/grass-gui.install --- grass-7.6.1/debian/grass-gui.install 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-gui.install 2019-09-07 09:40:48.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib/grass76/gui -usr/share/grass76/gui +usr/lib/grass78/gui +usr/share/grass78/gui diff -Nru grass-7.6.1/debian/grass-gui.links grass-7.8.0/debian/grass-gui.links --- grass-7.6.1/debian/grass-gui.links 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/grass-gui.links 2019-09-07 09:40:48.000000000 +0000 @@ -1,8 +1,8 @@ #!/bin/sh cat < -Donation: http://grass.osgeo.org/donations/ +Donation: https://grass.osgeo.org/donations/ Name: GRASS -Registration: https://www.osgeo.org/cgi-bin/ldap_create_user.py -Repository: https://svn.osgeo.org/grass/grass/ -Repository-Browse: http://trac.osgeo.org/grass/browser -Screenshots: http://grass.osgeo.org/screenshots/ +Registration: https://id.osgeo.org/ldap/create +Repository: https://github.com/OSGeo/grass.git +Repository-Browse: https://github.com/OSGeo/grass +Screenshots: https://grass.osgeo.org/screenshots/ diff -Nru grass-7.6.1/debian/watch grass-7.8.0/debian/watch --- grass-7.6.1/debian/watch 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/watch 2019-09-07 09:40:48.000000000 +0000 @@ -1,6 +1,6 @@ version=3 opts=\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/;s/RC/rc/,\ +uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/;s/RC/rc/;s/_/./g,\ dversionmangle=s/\+(debian|dfsg|ds|deb)\d*$// \ -https://grass.osgeo.org/grass76/source/ \ -grass-([\d\.]*(?:(?:RC|rc|pre|dev|beta|alpha)?\d*))\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) +https://grass.osgeo.org/grass78/source/ \ +grass-([\d\._]*(?:(?:RC|rc|pre|dev|beta|alpha)?\d*))\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) diff -Nru grass-7.6.1/debian/x-grass7 grass-7.8.0/debian/x-grass7 --- grass-7.6.1/debian/x-grass7 2019-03-21 15:12:05.000000000 +0000 +++ grass-7.8.0/debian/x-grass7 2019-09-07 09:40:48.000000000 +0000 @@ -5,13 +5,13 @@ if [ -n "$DISPLAY" ]; then if [ -n "$(tty)" ]; then - exec /usr/bin/grass76 "$@" + exec /usr/bin/grass78 "$@" else - exec x-terminal-emulator -e /bin/sh -c "/usr/bin/grass76 $@" + exec x-terminal-emulator -e /bin/sh -c "/usr/bin/grass78 $@" fi else if [ -n "$(tty)" ]; then - exec /usr/bin/grass76 "$@" + exec /usr/bin/grass78 "$@" fi fi diff -Nru grass-7.6.1/display/d.barscale/d.barscale.html grass-7.8.0/display/d.barscale/d.barscale.html --- grass-7.6.1/display/d.barscale/d.barscale.html 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/d.barscale/d.barscale.html 2019-05-18 15:50:04.000000000 +0000 @@ -32,4 +32,4 @@ Major rewrite for GRASS 7 by Hamish Bowman

-Last changed: $Date: 2013-09-18 15:49:10 +0200 (Wed, 18 Sep 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.barscale/main.c grass-7.8.0/display/d.barscale/main.c --- grass-7.6.1/display/d.barscale/main.c 2019-03-19 20:04:23.000000000 +0000 +++ grass-7.8.0/display/d.barscale/main.c 2019-07-31 13:11:34.000000000 +0000 @@ -45,7 +45,7 @@ struct GModule *module; struct Option *bg_color_opt, *fg_color_opt, *coords, *fsize, *barstyle, *text_placement, *length_opt, *segm_opt, *units_opt, *label_opt, - *width_scale_opt; + *width_scale_opt, *font, *path, *charset; struct Flag *feet, *no_text, *n_symbol; struct Cell_head W; double east, north; @@ -173,6 +173,13 @@ width_scale_opt->options = "0.5-100"; width_scale_opt->description = _("Scale factor to change bar width"); + font = G_define_option(); + font->key = "font"; + font->type = TYPE_STRING; + font->required = NO; + font->description = _("Font name"); + font->guisection = _("Text"); + fsize = G_define_option(); fsize->key = "fontsize"; fsize->type = TYPE_DOUBLE; @@ -182,7 +189,22 @@ fsize->description = _("Font size"); fsize->guisection = _("Text"); - G_option_exclusive(feet, units_opt, NULL); + path = G_define_standard_option(G_OPT_F_INPUT); + path->key = "path"; + path->required = NO; + path->description = _("Path to font file"); + path->gisprompt = "old,font,file"; + path->guisection = _("Font settings"); + + charset = G_define_option(); + charset->key = "charset"; + charset->type = TYPE_STRING; + charset->required = NO; + charset->description = + _("Text encoding (only applicable to TrueType fonts)"); + charset->guisection = _("Text"); + + G_option_exclusive(feet, units_opt, NULL); if (G_parser(argc, argv)) exit(EXIT_FAILURE); @@ -317,6 +339,13 @@ D_open_driver(); + if (font->answer) + D_font(font->answer); + else if (path->answer) + D_font(path->answer); + if (charset->answer) + D_encoding(charset->answer); + D_setup(0); draw_scale(east, north, length, segm, units, label, bar_style, text_position, width_scale, fontsize); diff -Nru grass-7.6.1/display/d.colorlist/d.colorlist.html grass-7.8.0/display/d.colorlist/d.colorlist.html --- grass-7.6.1/display/d.colorlist/d.colorlist.html 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/d.colorlist/d.colorlist.html 2019-05-18 15:50:04.000000000 +0000 @@ -12,4 +12,4 @@ Andreas Lange -

Last changed: $Date: 2014-11-01 00:17:14 +0100 (Sat, 01 Nov 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.colortable/d.colortable.html grass-7.8.0/display/d.colortable/d.colortable.html --- grass-7.6.1/display/d.colortable/d.colortable.html 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/d.colortable/d.colortable.html 2019-05-18 15:50:04.000000000 +0000 @@ -64,4 +64,4 @@ James Westervelt, U.S. Army Construction Engineering Research Laboratory

-Last changed: $Date: 2015-02-02 04:27:58 +0100 (Mon, 02 Feb 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.erase/d.erase.html grass-7.8.0/display/d.erase/d.erase.html --- grass-7.6.1/display/d.erase/d.erase.html 2019-03-19 20:04:17.000000000 +0000 +++ grass-7.8.0/display/d.erase/d.erase.html 2019-05-18 15:50:04.000000000 +0000 @@ -18,4 +18,4 @@ James Westervelt, U.S. Army Construction Engineering Research Laboratory -

Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.extract/d.extract.html grass-7.8.0/display/d.extract/d.extract.html --- grass-7.6.1/display/d.extract/d.extract.html 2019-03-19 20:04:25.000000000 +0000 +++ grass-7.8.0/display/d.extract/d.extract.html 2019-05-18 15:50:04.000000000 +0000 @@ -22,4 +22,4 @@ Radim Blazek, Markus Neteler -

Last changed: $Date: 2011-09-29 21:18:47 +0200 (Thu, 29 Sep 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.font/d.font.html grass-7.8.0/display/d.font/d.font.html --- grass-7.6.1/display/d.font/d.font.html 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/d.font/d.font.html 2019-05-18 15:50:04.000000000 +0000 @@ -70,4 +70,4 @@ Standards.

-Last changed: $Date: 2012-01-17 11:50:47 +0100 (Tue, 17 Jan 2012) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.fontlist/d.fontlist.html grass-7.8.0/display/d.fontlist/d.fontlist.html --- grass-7.6.1/display/d.fontlist/d.fontlist.html 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/d.fontlist/d.fontlist.html 2019-05-18 15:50:04.000000000 +0000 @@ -11,4 +11,4 @@ Glynn Clements -

Last changed: $Date: 2012-08-29 10:19:44 +0200 (Wed, 29 Aug 2012) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.geodesic/d.geodesic.html grass-7.8.0/display/d.geodesic/d.geodesic.html --- grass-7.6.1/display/d.geodesic/d.geodesic.html 2019-03-19 20:04:25.000000000 +0000 +++ grass-7.8.0/display/d.geodesic/d.geodesic.html 2019-05-18 15:50:04.000000000 +0000 @@ -54,4 +54,4 @@ Michael Shapiro, U.S. Army Construction Engineering Research Laboratory -

Last changed: $Date: 2016-12-17 13:21:05 +0100 (Sat, 17 Dec 2016) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.graph/d.graph.html grass-7.8.0/display/d.graph/d.graph.html --- grass-7.6.1/display/d.graph/d.graph.html 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/d.graph/d.graph.html 2019-05-18 15:50:04.000000000 +0000 @@ -230,4 +230,4 @@ James Westervelt, U.S. Army Construction Engineering Research Laboratory

-Last changed: $Date: 2013-04-10 23:20:23 +0200 (Wed, 10 Apr 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.grid/d.grid.html grass-7.8.0/display/d.grid/d.grid.html --- grass-7.6.1/display/d.grid/d.grid.html 2019-03-19 20:04:23.000000000 +0000 +++ grass-7.8.0/display/d.grid/d.grid.html 2019-05-18 15:50:04.000000000 +0000 @@ -86,4 +86,4 @@ Background color implemented as part of GSoC 2016 by Adam Laza, CTU in Prague

-Last changed: $Date: 2017-12-13 09:37:43 +0100 (Wed, 13 Dec 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.his/d.his.html grass-7.8.0/display/d.his/d.his.html --- grass-7.6.1/display/d.his/d.his.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/display/d.his/d.his.html 2019-05-18 15:50:04.000000000 +0000 @@ -130,4 +130,4 @@ James Westervelt, U.S. Army Construction Engineering Research Laboratory -

Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.histogram/d.histogram.html grass-7.8.0/display/d.histogram/d.histogram.html --- grass-7.6.1/display/d.histogram/d.histogram.html 2019-03-19 20:04:13.000000000 +0000 +++ grass-7.8.0/display/d.histogram/d.histogram.html 2019-05-18 15:50:04.000000000 +0000 @@ -65,4 +65,4 @@
10560 Arrowhead Drive
Fairfax, Virginia 22030 -

Last changed: $Date: 2017-12-19 23:14:05 +0100 (Tue, 19 Dec 2017) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.info/d.info.html grass-7.8.0/display/d.info/d.info.html --- grass-7.6.1/display/d.info/d.info.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/display/d.info/d.info.html 2019-05-18 15:50:04.000000000 +0000 @@ -36,4 +36,4 @@ Glynn Clements

-Last changed: $Date: 2012-01-20 20:01:55 +0100 (Fri, 20 Jan 2012) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/displaydrivers.html grass-7.8.0/display/displaydrivers.html --- grass-7.6.1/display/displaydrivers.html 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/displaydrivers.html 2019-08-06 19:42:45.000000000 +0000 @@ -27,7 +27,7 @@ Lets start with simple example of Python script called render.py:

-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import os
 import sys
diff -Nru grass-7.6.1/display/d.labels/d.labels.html grass-7.8.0/display/d.labels/d.labels.html
--- grass-7.6.1/display/d.labels/d.labels.html	2019-03-19 20:04:24.000000000 +0000
+++ grass-7.8.0/display/d.labels/d.labels.html	2019-05-18 15:50:04.000000000 +0000
@@ -38,4 +38,4 @@
 U.S. Army Construction Engineering 
 Research Laboratory
 
-

Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.legend/d.legend.html grass-7.8.0/display/d.legend/d.legend.html --- grass-7.6.1/display/d.legend/d.legend.html 2019-03-19 20:04:23.000000000 +0000 +++ grass-7.8.0/display/d.legend/d.legend.html 2019-05-18 15:50:04.000000000 +0000 @@ -159,4 +159,4 @@
Additional improvements from various authors

-Last changed: $Date: 2016-06-24 16:53:21 +0200 (Fri, 24 Jun 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.legend.vect/d.legend.vect.html grass-7.8.0/display/d.legend.vect/d.legend.vect.html --- grass-7.6.1/display/d.legend.vect/d.legend.vect.html 2019-03-19 20:04:16.000000000 +0000 +++ grass-7.8.0/display/d.legend.vect/d.legend.vect.html 2019-05-18 15:50:04.000000000 +0000 @@ -104,4 +104,4 @@ Mentors: Anna Petrasova, Vaclav Petras, Martin Landa

-Last changed: $Date: 2017-01-05 08:56:15 +0100 (Thu, 05 Jan 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.linegraph/d.linegraph.html grass-7.8.0/display/d.linegraph/d.linegraph.html --- grass-7.6.1/display/d.linegraph/d.linegraph.html 2019-03-19 20:04:22.000000000 +0000 +++ grass-7.8.0/display/d.linegraph/d.linegraph.html 2019-05-18 15:50:04.000000000 +0000 @@ -173,4 +173,4 @@

AUTHOR

Chris Rewerts, Agricultural Engineering, Purdue University -

Last changed: $Date: 2017-02-02 10:10:41 +0100 (Thu, 02 Feb 2017) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.mon/d.mon.html grass-7.8.0/display/d.mon/d.mon.html --- grass-7.6.1/display/d.mon/d.mon.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/display/d.mon/d.mon.html 2019-05-18 15:50:04.000000000 +0000 @@ -156,4 +156,4 @@ Martin Landa, OSGeoREL, Czech Technical University in Prague, Czech Republic

-Last changed: $Date: 2017-12-13 09:37:43 +0100 (Wed, 13 Dec 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.mon/main.c grass-7.8.0/display/d.mon/main.c --- grass-7.6.1/display/d.mon/main.c 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/display/d.mon/main.c 2019-08-11 09:05:20.000000000 +0000 @@ -18,9 +18,9 @@ d.mon delegates rendering to Python script [1] through GRASS_RENDER_COMMAND [2]. See also document [3]. - [1] https://trac.osgeo.org/grass/browser/grass/trunk/display/d.mon/render_cmd.py - [2] https://trac.osgeo.org/grass/browser/grass/trunk/lib/display/r_raster.c#L107 - [3] https://grass.osgeo.org/grass76/manuals/displaydrivers.html + [1] https://github.com/OSGeo/grass/tree/master/display/d.mon/render_cmd.py + [2] https://github.com/OSGeo/grass/tree/master/lib/display/r_raster.c#L107 + [3] https://grass.osgeo.org/grass78/manuals/displaydrivers.html */ diff -Nru grass-7.6.1/display/d.mon/render_cmd.py grass-7.8.0/display/d.mon/render_cmd.py --- grass-7.6.1/display/d.mon/render_cmd.py 2019-03-19 20:04:27.000000000 +0000 +++ grass-7.8.0/display/d.mon/render_cmd.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import sys import tempfile @@ -97,6 +97,27 @@ os.environ['GRASS_REGION'] = grass_region +# read any input from stdin and create a temporary file +def read_stdin(cmd): + opt = None + + if (cmd[0] == 'd.text' and not 'text' in cmd[1] and + (not 'input' in cmd[1] or cmd[1]['input'] == '-')): + if sys.stdin.isatty(): + sys.stderr.write("\nPlease enter text instructions. Enter EOF (ctrl-d) on last line to quit\n") + opt = 'input' + + if opt: + tmpfile = tempfile.NamedTemporaryFile(dir=path).name + '.txt' + fd = open(tmpfile, 'w') + while 1: + line = sys.stdin.readline() + if not line: + break + fd.write(line) + fd.close() + cmd[1][opt] = tmpfile + if __name__ == "__main__": cmd = gtask.cmdstring_to_tuple(sys.argv[1]) if not cmd[0] or cmd[0] == 'd.mon': @@ -115,6 +136,8 @@ mapfile = None adjust_region(width, height) + read_stdin(cmd) + render(cmd, mapfile) update_cmd_file(os.path.join(path, 'cmd'), cmd, mapfile) if cmd[0] == 'd.erase' and os.path.exists(legfile): diff -Nru grass-7.6.1/display/d.northarrow/d.northarrow.html grass-7.8.0/display/d.northarrow/d.northarrow.html --- grass-7.6.1/display/d.northarrow/d.northarrow.html 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/d.northarrow/d.northarrow.html 2019-05-18 15:50:04.000000000 +0000 @@ -43,4 +43,4 @@ Improvements as part of GSoC 2016 by Adam Laza, CTU in Prague

-Last changed: $Date: 2016-05-25 01:54:02 +0200 (Wed, 25 May 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.northarrow/main.c grass-7.8.0/display/d.northarrow/main.c --- grass-7.6.1/display/d.northarrow/main.c 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/d.northarrow/main.c 2019-06-03 20:34:20.000000000 +0000 @@ -32,7 +32,7 @@ { struct GModule *module; struct Option *bg_color_opt, *fg_color_opt, *coords, *n_arrow, *fsize, - *width_opt, *rotation_opt, *lbl_opt, *text_color_opt; + *width_opt, *rotation_opt, *lbl_opt, *text_color_opt, *font, *path, *charset; struct Flag *no_text, *rotate_text, *rads; double east, north; double rotation; @@ -120,8 +120,15 @@ width_opt->answer = "0"; width_opt->description = _("Line width"); + font = G_define_option(); + font->key = "font"; + font->type = TYPE_STRING; + font->required = NO; + font->description = _("Font name"); + font->guisection = _("Text"); + fsize = G_define_option(); - fsize->key = "fontsize"; + fsize->key = "fontsize"; /* size in d.text */ fsize->type = TYPE_DOUBLE; fsize->required = NO; fsize->answer = "14"; @@ -129,11 +136,26 @@ fsize->description = _("Font size"); fsize->guisection = _("Text"); + path = G_define_standard_option(G_OPT_F_INPUT); + path->key = "path"; + path->required = NO; + path->description = _("Path to font file"); + path->gisprompt = "old,font,file"; + path->guisection = _("Font settings"); + no_text = G_define_flag(); no_text->key = 't'; no_text->description = _("Draw the symbol without text"); no_text->guisection = _("Text"); + charset = G_define_option(); + charset->key = "charset"; + charset->type = TYPE_STRING; + charset->required = NO; + charset->description = + _("Text encoding (only applicable to TrueType fonts)"); + charset->guisection = _("Text"); + rotate_text = G_define_flag(); rotate_text->key = 'w'; rotate_text->description = _("Do not rotate text with symbol"); @@ -188,7 +210,6 @@ else text_color = 0; - line_width = atof(width_opt->answer); if (line_width < 0) line_width = 0; @@ -197,6 +218,13 @@ D_open_driver(); + if (font->answer) + D_font(font->answer); + else if (path->answer) + D_font(path->answer); + if (charset->answer) + D_encoding(charset->answer); + draw_n_arrow(east, north, rotation, lbl_opt->answer, rot_with_text, fontsize, n_arrow->answer, line_width); diff -Nru grass-7.6.1/display/d.path/d.path.html grass-7.8.0/display/d.path/d.path.html --- grass-7.6.1/display/d.path/d.path.html 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/d.path/d.path.html 2019-05-18 15:50:04.000000000 +0000 @@ -45,4 +45,4 @@ Radim Blazek, ITC-Irst, Trento, Italy -

Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.profile/d.profile.html grass-7.8.0/display/d.profile/d.profile.html --- grass-7.6.1/display/d.profile/d.profile.html 2019-03-19 20:04:17.000000000 +0000 +++ grass-7.8.0/display/d.profile/d.profile.html 2019-05-18 15:50:04.000000000 +0000 @@ -18,4 +18,4 @@ This program has been completely re-written for 7.0. It bears no relation to the interactive d.profile module in previous versions. -

Last changed: $Date: 2014-09-27 23:56:16 +0200 (Sat, 27 Sep 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.rast/d.rast.html grass-7.8.0/display/d.rast/d.rast.html --- grass-7.6.1/display/d.rast/d.rast.html 2019-03-19 20:04:24.000000000 +0000 +++ grass-7.8.0/display/d.rast/d.rast.html 2019-05-18 15:50:04.000000000 +0000 @@ -60,4 +60,4 @@ James Westervelt, U.S. Army Construction Engineering Research Laboratory

-Last changed: $Date: 2017-12-19 17:28:54 +0100 (Tue, 19 Dec 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.rast.arrow/d.rast.arrow.html grass-7.8.0/display/d.rast.arrow/d.rast.arrow.html --- grass-7.6.1/display/d.rast.arrow/d.rast.arrow.html 2019-03-19 20:04:22.000000000 +0000 +++ grass-7.8.0/display/d.rast.arrow/d.rast.arrow.html 2019-05-18 15:50:04.000000000 +0000 @@ -105,4 +105,4 @@ Align grids with raster cells and Drainage aspect type
Huidae Cho
-

Last changed: $Date: 2016-10-31 11:50:44 +0100 (Mon, 31 Oct 2016) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.rast.num/d.rast.num.html grass-7.8.0/display/d.rast.num/d.rast.num.html --- grass-7.6.1/display/d.rast.num/d.rast.num.html 2019-03-19 20:04:25.000000000 +0000 +++ grass-7.8.0/display/d.rast.num/d.rast.num.html 2019-05-18 15:50:04.000000000 +0000 @@ -57,4 +57,4 @@ and Chris Rewerts,
Agricultural Engineering, Purdue University -

Last changed: $Date: 2015-05-01 12:25:58 +0200 (Fri, 01 May 2015) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.rgb/d.rgb.html grass-7.8.0/display/d.rgb/d.rgb.html --- grass-7.6.1/display/d.rgb/d.rgb.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/display/d.rgb/d.rgb.html 2019-05-18 15:50:04.000000000 +0000 @@ -72,4 +72,4 @@ Glynn Clements

-Last changed: $Date: 2017-12-13 09:37:43 +0100 (Wed, 13 Dec 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.rhumbline/d.rhumbline.html grass-7.8.0/display/d.rhumbline/d.rhumbline.html --- grass-7.6.1/display/d.rhumbline/d.rhumbline.html 2019-03-19 20:04:25.000000000 +0000 +++ grass-7.8.0/display/d.rhumbline/d.rhumbline.html 2019-05-18 15:50:04.000000000 +0000 @@ -55,4 +55,4 @@ Michael Shapiro, U.S. Army Construction Engineering Research Laboratory -

Last changed: $Date: 2016-12-17 13:21:05 +0100 (Sat, 17 Dec 2016) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.text/d.text.html grass-7.8.0/display/d.text/d.text.html --- grass-7.6.1/display/d.text/d.text.html 2019-03-19 20:04:25.000000000 +0000 +++ grass-7.8.0/display/d.text/d.text.html 2019-05-18 15:50:04.000000000 +0000 @@ -119,4 +119,4 @@ Research Laboratory

Updates by Huidae Cho -

Last changed: $Date: 2018-01-10 23:06:27 +0100 (Wed, 10 Jan 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.title/d.title.html grass-7.8.0/display/d.title/d.title.html --- grass-7.6.1/display/d.title/d.title.html 2019-03-19 20:04:23.000000000 +0000 +++ grass-7.8.0/display/d.title/d.title.html 2019-05-18 15:50:04.000000000 +0000 @@ -57,4 +57,4 @@ U.S. Army Construction Engineering Research Laboratory -

Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.title/main.c grass-7.8.0/display/d.title/main.c --- grass-7.6.1/display/d.title/main.c 2019-03-19 20:04:23.000000000 +0000 +++ grass-7.8.0/display/d.title/main.c 2019-06-03 20:34:20.000000000 +0000 @@ -130,9 +130,8 @@ char inarg[GPATH_MAX]; fclose(fp); sprintf(inarg, "input=%s", tmpfile); + /* note this tmp file will remain so it can survive d.redraw */ G_spawn("d.text", "d.text", inarg, NULL); - unlink(tmpfile); - /* note a tmp file will remain, created by d.text so it can survive d.redraw */ } exit(EXIT_SUCCESS); diff -Nru grass-7.6.1/display/d.vect/d.vect.html grass-7.8.0/display/d.vect/d.vect.html --- grass-7.6.1/display/d.vect/d.vect.html 2019-03-19 20:04:22.000000000 +0000 +++ grass-7.8.0/display/d.vect/d.vect.html 2019-05-22 21:47:50.000000000 +0000 @@ -126,4 +126,4 @@ Support for color tables by Martin Landa, Czech Technical University in Prague (8/2011)
and many other GRASS developers -

Last changed: $Date: 2018-08-25 18:50:50 +0200 (Sat, 25 Aug 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.vect.chart/d.vect.chart.html grass-7.8.0/display/d.vect.chart/d.vect.chart.html --- grass-7.6.1/display/d.vect.chart/d.vect.chart.html 2019-03-19 20:04:17.000000000 +0000 +++ grass-7.8.0/display/d.vect.chart/d.vect.chart.html 2019-05-18 15:50:04.000000000 +0000 @@ -98,4 +98,4 @@ Radim Blazek, ITC-Irst, Trento, Italy -

Last changed: $Date: 2015-08-20 12:55:47 +0200 (Thu, 20 Aug 2015) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/display/d.vect.thematic/d.vect.thematic.html grass-7.8.0/display/d.vect.thematic/d.vect.thematic.html --- grass-7.6.1/display/d.vect.thematic/d.vect.thematic.html 2019-03-19 20:04:17.000000000 +0000 +++ grass-7.8.0/display/d.vect.thematic/d.vect.thematic.html 2019-05-18 15:50:04.000000000 +0000 @@ -109,4 +109,4 @@ Moritz Lennert

-Last changed: $Date: 2017-11-11 19:59:24 +0100 (Sat, 11 Nov 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/display/d.where/d.where.html grass-7.8.0/display/d.where/d.where.html --- grass-7.6.1/display/d.where/d.where.html 2019-03-19 20:04:25.000000000 +0000 +++ grass-7.8.0/display/d.where/d.where.html 2019-05-18 15:50:04.000000000 +0000 @@ -64,4 +64,4 @@ U.S. Army Construction Engineering Research Laboratory -

Last changed: $Date: 2014-12-12 00:12:46 +0100 (Fri, 12 Dec 2014) $ +

Last changed: $Date$ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/doc/grass7_arch.odg and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/doc/grass7_arch.odg differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/doc/grass7_arch.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/doc/grass7_arch.png differ diff -Nru grass-7.6.1/doc/grass_database.html grass-7.8.0/doc/grass_database.html --- grass-7.6.1/doc/grass_database.html 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/doc/grass_database.html 2019-08-11 09:05:20.000000000 +0000 @@ -222,7 +222,7 @@ in a given Mapset with only command line interface:

-grass76 --text ~/grassdata/mylocation/mymapset
+grass78 --text ~/grassdata/mylocation/mymapset
 
And the following will create the given Location with projection given @@ -230,7 +230,7 @@ (GUI or command line):
-grass76 -c EPSG:5514:3 ~/grassdata/mylocation
+grass78 -c EPSG:5514:3 ~/grassdata/mylocation
 
See grass command manual for more details. @@ -293,4 +293,4 @@

-Last changed: $Date: 2018-09-05 07:59:43 +0200 (Wed, 05 Sep 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/doc/gui/wxpython/example/dialogs.py grass-7.8.0/doc/gui/wxpython/example/dialogs.py --- grass-7.6.1/doc/gui/wxpython/example/dialogs.py 2019-03-19 20:04:51.000000000 +0000 +++ grass-7.8.0/doc/gui/wxpython/example/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -16,10 +16,15 @@ import wx +# i18n is taken care of in the grass library code. +# So we need to import it before any of the GUI code. +# NOTE: in this particular case, we don't really need the grass library; +# NOTE: we import it just for the side effects of gettext.install() +import grass + from core import globalvar from gui_core.dialogs import SimpleDialog from gui_core import gselect -from core.utils import _ class ExampleMapDialog(SimpleDialog): diff -Nru grass-7.6.1/doc/gui/wxpython/example/frame.py grass-7.8.0/doc/gui/wxpython/example/frame.py --- grass-7.6.1/doc/gui/wxpython/example/frame.py 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/doc/gui/wxpython/example/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -23,6 +23,10 @@ if __name__ == "__main__": sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython")) +# i18n is taken care of in the grass library code. +# So we need to import it before any of the GUI code. +from grass.script import core as gcore + from gui_core.mapdisp import SingleMapFrame from mapwin.buffered import BufferedMapWindow from mapwin.base import MapWindowProperties @@ -30,9 +34,6 @@ from core.render import Map from core.debug import Debug from core.gcmd import RunCommand, GError -from core.utils import _ - -from grass.script import core as gcore from toolbars import ExampleMapToolbar, ExampleMiscToolbar, ExampleMainToolbar from dialogs import ExampleMapDialog diff -Nru grass-7.6.1/doc/gui/wxpython/example/g.gui.example.html grass-7.8.0/doc/gui/wxpython/example/g.gui.example.html --- grass-7.6.1/doc/gui/wxpython/example/g.gui.example.html 2019-03-19 20:04:49.000000000 +0000 +++ grass-7.8.0/doc/gui/wxpython/example/g.gui.example.html 2019-05-18 15:50:04.000000000 +0000 @@ -72,5 +72,5 @@

-$Date: 2014-01-03 04:39:48 +0100 (Fri, 03 Jan 2014) $ +$Date$ diff -Nru grass-7.6.1/doc/gui/wxpython/example/g.gui.example.py grass-7.8.0/doc/gui/wxpython/example/g.gui.example.py --- grass-7.6.1/doc/gui/wxpython/example/g.gui.example.py 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/doc/gui/wxpython/example/g.gui.example.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: g.gui.iclass @@ -33,6 +33,9 @@ import sys import wx + +# i18n is taken care of in the grass library code. +# So we need to import it before any of the GUI code. import grass.script.core as gcore if __name__ == '__main__': @@ -42,7 +45,7 @@ from core.globalvar import CheckWxVersion from core.giface import StandaloneGrassInterface -from core.utils import _, GuiModuleMain +from core.utils import GuiModuleMain from core.settings import UserSettings from example.frame import ExampleMapFrame diff -Nru grass-7.6.1/doc/howto_release.md grass-7.8.0/doc/howto_release.md --- grass-7.6.1/doc/howto_release.md 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/doc/howto_release.md 2019-09-06 20:33:26.000000000 +0000 @@ -0,0 +1,330 @@ +# How to release GRASS GIS binaries and source code + +*Note: Some steps in this text are to be done by the development coordinator (currently Markus Neteler, PSC Chair) due to needed logins.* + +## HOWTO create a release + +### Preparations + +Check examples if still compiling + +```bash +( cd doc/raster/r.example/ ; make clean ; make ) +( cd doc/vector/v.example/ ; make clean ; make ) +``` + +### Fix typos in source code with + +```bash +tools/fix_typos.sh +``` + +### i18N: sync from Transifex +See https://www.transifex.com/grass-gis/grass7/dashboard/ + +Exception Latvian as Latvian is directly edited in git and then sync'ed from master .po files + +```bash +cd locale +sh ~/software/grass_addons_git/tools/transifex_merge.sh +make +make verify +# ... then fix .po files as needed. +# +# requires https://trac.osgeo.org/grass/ticket/3539 +## after that push fixes to transifex: +#cd locale/transifex/ +#tx --debug push -t +``` + +### Update of configure base files + +*Only allowed in RC cycle, not for final release!* + +Check that autoconf scripts are up-to-date: +```bash +rm -f config.guess config.sub +wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess +wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub +git diff config.guess config.sub +autoconf-2.13 +``` +Now check if configure still works. + +If yes, submit to git: +```bash +git add config.guess config.sub configure +git checkout -b config_sub_update_r78 +git commit -m"config.guess + config.sub: updated from http://git.savannah.gnu.org/cgit/config.git/plain/" config.guess config.sub configure +# test by running ./configure + +git push origin config_sub_update_r78 +# open PR and merge +``` + +### Cleanup leftover rubbish files + +```bash +rm -f locale/templates/*.pot +rm -f locale/po/messages.mo +rm -f demolocation/PERMANENT/.bash* +find . -name '*~' | xargs rm +find . -name '*.bak' | xargs rm +find . -name '*.swp' | xargs rm +find . -name '.#*' | xargs rm +find . -name '*.orig' | xargs rm +find . -name '*.rej' | xargs rm +find . -name '*.o' | xargs rm +find . -name '*.pyc' | xargs rm +find . -name 'OBJ.*' | xargs rm -r +rm -f gui/wxpython/menustrings.py gui/wxpython/build_ext.pyc gui/wxpython/xml/menudata.xml gui/wxpython/xml/module_tree_menudata.xml +chmod -R a+r * +``` + +Double check: +```bash +git status +``` + +### Create release branch (only if not yet existing) + +.. see section below at end of file. + +### Update VERSION file to release version number + +Directly edit in GH interface: + +https://github.com/OSGeo/grass/blob/releasebranch_7_8/include/VERSION + +Example: + +```bash +7 +8 +0RC1 +2019 +``` + +~~Update OSGeo4W setup.hint file~~ +~~no longer needed~~ +~~vim mswindows/osgeo4w/setup_x86.hint.tmpl~~ +~~vim mswindows/osgeo4w/setup_x86_64.hint.tmpl~~ + +### Create release tag + +See https://help.github.com/en/articles/creating-releases + +Preparation: + +### Changelog and tagging etc + +```bash +# create version env var for convenience: +MAJOR=`cat include/VERSION | head -1 | tail -1` +MINOR=`cat include/VERSION | head -2 | tail -1` +RELEASE=`cat include/VERSION | head -3 | tail -1` +VERSION=${MAJOR}_${MINOR}_${RELEASE} +echo $VERSION + +# Create Changelog file on release branch: +python tools/gitlog2changelog.py +mv ChangeLog ChangeLog_$VERSION +head ChangeLog_$VERSION +gzip ChangeLog_$VERSION + +TODAY=`date +"%Y%m%d"` +RELEASETAG=release_${TODAY}_grass_${MAJOR}_${MINOR}_${RELEASE} +echo $RELEASETAG +``` + +### Tag release (on GitHub) + +```bash +echo "$VERSION" +``` + +Done in GH interface: + +https://github.com/OSGeo/grass/releases/new + +### Packaging of source code tarball + +TODO: add checkout of code via release tag (?) + +```bash +# update from GH +# assumptions: +# - own fork as "origin" +# - remote repo as "upstream" + +git fetch --all --prune && git checkout releasebranch_7_8 && \ + git merge upstream/releasebranch_7_8 && git push origin releasebranch_7_8 + +# create source package (in the source directory): +echo grass-${VERSION} + +mkdir grass-${VERSION} +mv * grass-${VERSION}/ +# create the package: +tar cvfzh grass-${VERSION}.tar.gz --exclude-vcs grass-${VERSION}/* +# restore src code location: +mv ./grass-${VERSION}/* . +rmdir ./grass-${VERSION} +# Calculating MD5 sum: +md5sum grass-${VERSION}.tar.gz > grass-${VERSION}.md5sum +``` + +### Reset include/VERSION file to git version: + +Directly edit in GH interface: + +https://github.com/OSGeo/grass/blob/releasebranch_7_8/include/VERSION + +Example: + +```bash +7 +8 +0dev +2019 +``` + +### Upload source code tarball to OSGeo servers + +```bash +# Store the source tarball (twice) in (use scp -p FILES grass:): +SERVER1=grass.osgeo.org +SERVER1DIR=/var/www/grass/grass-cms/grass$MAJOR$MINOR/source/ +SERVER2=upload.osgeo.org +SERVER2DIR=/osgeo/download/grass/grass$MAJOR$MINOR/source/ +echo $SERVER1:$SERVER1DIR +echo $SERVER2:$SERVER2DIR + +# upload along with associated files: +scp -p grass-$VERSION.* AUTHORS COPYING ChangeLog_$VERSION.gz \ + INSTALL REQUIREMENTS.html SUBMITTING neteler@$SERVER1:$SERVER1DIR + +scp -p grass-$VERSION.* AUTHORS COPYING ChangeLog_$VERSION.gz \ + INSTALL REQUIREMENTS.html SUBMITTING neteler@$SERVER2:$SERVER2DIR + +# Only at full release! +# generate link to "latest" source code +ssh neteler@$SERVER1 "cd $SERVER1DIR ; rm -f grass-$MAJOR.$MINOR-latest.tar.gz" +ssh neteler@$SERVER1 "cd $SERVER1DIR ; ln -s grass-$VERSION.tar.gz grass-$MAJOR.$MINOR-latest.tar.gz" + +# update winGRASS related files: Update the winGRASS version +vim grass-addons/tools/wingrass-packager/grass_packager_release.bat +vim grass-addons/tools/wingrass-packager/grass_addons.sh +vim grass-addons/tools/wingrass-packager/grass_copy_wwwroot.sh +vim grass-addons/tools/wingrass-packager/cronjob.sh # major/minor release only + +# update addons - major/minor release only +vim grass-addons/tools/addons/grass-addons-publish.sh +vim grass-addons/tools/addons/grass-addons-build.sh +vim grass-addons/tools/addons/grass-addons.sh +``` + +Release is done. + +### Advertise new release + +#### Update CMS web site to show new version + +- News section +- https://grass.osgeo.org/download/software/ +- https://grass.osgeo.org/download/software/sources/ +- https://grass.osgeo.org/download/software/linux/ +- https://grass.osgeo.org/home/history/releases/ + +TODO: git tags +- https://grass.osgeo.org/development/svn/svn-tags/ (add tag): echo $RELEASETAG + +#### Write announcement and publish it +- store in trac: + - https://trac.osgeo.org/grass/wiki/Release/7.8.x-News + - https://trac.osgeo.org/grass/wiki/Grass7/NewFeatures78 <- add content of major changes only +- update version in https://grasswiki.osgeo.org/wiki/GRASS-Wiki +- ~~store in Web as announces/announce_grass$MAJOR$MINOR$RELEASE.html <- how? with protected PHP upload page?~~ (dropped since CMS) + +#### Only when new major release +- update cronjob 'cron_grass_HEAD_src_snapshot.sh' on grass.osgeo.org to next but one release tag for the differences +- wiki updates, only when new major release: + - {{cmd|xxxx}} macro: https://grasswiki.osgeo.org/wiki/Template:Cmd + - update last version on main page +- trac updates, only when new major release: + - Set "complete" flag in https://trac.osgeo.org/grass/milestone/7.8.x --> Edit Milestone + - also: Retarget associated open tickets to milestone 7.8.x + - Batch modify tickets, set to next milestone (update this query accordingly: two entries to change): + - https://trac.osgeo.org/grass/query?status=assigned&status=new&status=reopened&milestone=7.8.0&milestone=7.8.1&group=status&col=id&col=summary&col=owner&col=type&col=priority&col=component&col=version&order=priority + - Set max items to 1000, then select all shown tickets via Status: assigned/new/reopened sections + - Scroll down to "Batch modify": under the "Comment" section, add Field "Milestone" and set to next version + - then use "Change ticket" button, done. + - Only in case of new release branch being created: +- Add Wiki Macro definitions for manual pages G7X:modulename + - Edit: https://trac.osgeo.org/grass/wiki/InterMapTxt + +#### WinGRASS notes +- Update grass_packager_release.bat, eg. +``` + set MAJOR=7 + set MINOR=8 + set PATCH=0RC1 +``` +- Update addons (grass_addons.sh) rules, eg. +``` + compile $GIT_PATH/grass7 $GISBASE_PATH/grass780RC1 $ADDON_PATH/grass780RC1/addons +``` +- Modify grass_copy_wwwroot.sh accordingly, eg. +``` + copy_addon 781RC1 7.8.1RC1 +``` + +#### Launchpad notes: +- Create milestone and release: https://launchpad.net/grass/+series +- Upload tarball for created release +- Update daily recipe contents: https://code.launchpad.net/~grass/+recipe/grass-trunk + +#### Packaging notes: +- https://trac.osgeo.org/grass/wiki/BuildHints + - https://trac.osgeo.org/grass/wiki/DebianUbuntuPackaging + - https://trac.osgeo.org/grass/wiki/CompileOnWindows + +#### Marketing - tell others about release: +- Notify all packagers (MN has email list) +- If release candidate: + - + - +- If official release: + - publish related announcement press release at: +- Our GRASS web site: /announces/ + - Note: DON'T use relative links there +- Our main mailing lists: + - http://lists.osgeo.org/mailman/listinfo/grass-announce | + - http://lists.osgeo.org/mailman/listinfo/grass-dev | + - http://lists.osgeo.org/mailman/listinfo/grass-user | +- DebianGIS: - send only small note +- FreeGIS: +- Geowanking: +- OSGeo.org: + +Via Email: +- info@osgeo.org +- http://www.gis-news.de/ (franz-josef.behr@gismngt.de) +- http://spatialnews.geocomm.com/submitnews.html (not free any more, convince editor@geocomm.com) +- mfeilner@linuxnewmedia.de +- info@harzer.de +- editor-geo@geoconnexion.com + +Via Web: +- https://plus.google.com/u/0/communities/111147786674687562495 (G+ GRASS GIS community) +- http://linuxtoday.com/contribute.php3 +- https://joinup.ec.europa.eu/software/grassgis/home (submit news, MN) +- http://www.macnn.com/contact/newstips/1 +- http://www10.giscafe.com/submit_material/submit_options.php#Press (MN) --> Press releases +- http://www.directionsmag.com/pressreleases/ (News -> Submit Press Release) +- http://directory.fsf.org/wiki/GRASS_%28Geographic_Resources_Analysis_Support_System%29 +- https://www.linux-apps.com/p/1128004/edit/ (MN) +- https://news.eoportal.org/web/eoportal/share-your-news (MN) -> Share your news with the EO community +- https://www.heise.de/download/product/grass-gis-7105 (update, MN) +- See also: https://grass.osgeo.org/wiki/Contact_Databases +- ... anywhere else? Please add here. diff -Nru grass-7.6.1/doc/howto_release.txt grass-7.8.0/doc/howto_release.txt --- grass-7.6.1/doc/howto_release.txt 2019-03-19 20:04:48.000000000 +0000 +++ grass-7.8.0/doc/howto_release.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,328 +0,0 @@ -How to release GRASS GIS binaries and source code - -$Date: 2018-12-26 13:19:54 +0100 (Wed, 26 Dec 2018) $ - -Note: This text contains *some* rules only applicable to the - development coordinator (currently Markus Neteler, PSC Chair). - - -########################################### -Contents - (A) HOWTO create a release - (B) HOWTO create a branch - -########################################### -(A) HOWTO create a release - -0. Preparations - -#check if still compile; fix otherwise -( cd doc/raster/r.example/ ; make clean ; make ) -( cd doc/vector/v.example/ ; make clean ; make ) - -# fix typos in source code with -tools/fix_typos.sh - -# i18N: sync from Transifex (https://www.transifex.com/grass-gis/grass7/dashboard/) -# - except for Latvian; Latvian is directly edited in SVN and then sync'ed from trunk .po files -cd locale -sh ~/software/grass-addons/tools/transifex_merge.sh -make -make verify -# ... then fix .po files as needed. -# -# requires https://trac.osgeo.org/grass/ticket/3539 -## after that push fixes to transifex: -#cd locale/transifex/ -#tx --debug push -t - -#### end of i18N - - -1. Local work - -# done by release manager - -# Only allowed RC cycle, not final!: -# Check that autoconf scripts are up-to-date: - -rm -f config.guess config.sub -wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess -wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub -svn diff config.guess config.sub -autoconf-2.13 -# check and submit to SVN: -svn ci -m"config.guess + config.sub: updated from http://git.savannah.gnu.org/cgit/config.git/plain/" config.guess config.sub configure -# test by running ./configure - -# update from SVN -svn up - -# cleanup rubbish: -rm -f locale/templates/*.pot -rm -f locale/po/messages.mo -rm -f demolocation/PERMANENT/.bash* -find . -name '*~' | xargs rm -find . -name '*.bak' | xargs rm -find . -name '.#*' | xargs rm -find . -name '*.orig' | xargs rm -find . -name '*.rej' | xargs rm -find . -name '*.o' | xargs rm -find . -name '*.pyc' | xargs rm -find . -name 'OBJ.*' | xargs rm -r -rm -f gui/wxpython/menustrings.py gui/wxpython/build_ext.pyc gui/wxpython/xml/menudata.xml gui/wxpython/xml/module_tree_menudata.xml -chmod -R a+r * - -# double check -svn status --no-ignore -svn status - -# Create release branch (only if not yet existing) -# ... see below - -# Update VERSION file to release version: -vim include/VERSION - -#example: -7 -6 -1RC1 -2018 - -# cleanup -rm -f include/VERSION~ - -# Update OSGeo4W setup.hint file -### no longer needed -#vim mswindows/osgeo4w/setup_x86.hint.tmpl -#vim mswindows/osgeo4w/setup_x86_64.hint.tmpl - -#### Changelog and tagging etc - -# create version env var for convenience: -MAJOR=`cat include/VERSION | head -1 | tail -1` -MINOR=`cat include/VERSION | head -2 | tail -1` -RELEASE=`cat include/VERSION | head -3 | tail -1` -VERSION=${MAJOR}.${MINOR}.${RELEASE} -echo $VERSION - -svn ci -m"GRASS GIS $VERSION" include/VERSION -svn up - -# Create Changelog file on release branch: -# https://arthurdejong.org/svn2cl/ -svn2cl -mv ChangeLog ChangeLog_$VERSION -head ChangeLog_$VERSION -gzip ChangeLog_$VERSION - -# Tag release (http://trac.osgeo.org/grass/browser/grass/tags): -# see http://svnbook.red-bean.com/en/1.4/svn.branchmerge.tags.html - -TODAY=`date +"%Y%m%d"` -RELEASETAG=release_${TODAY}_grass_${MAJOR}_${MINOR}_${RELEASE} -echo $RELEASETAG - -URL=https://svn.osgeo.org/grass -svn copy $URL/grass/branches/releasebranch_7_6 \ - $URL/grass/tags/$RELEASETAG \ - -m "Tagging release grass_${MAJOR}_${MINOR}_${RELEASE}" - - -# create source package (in the source directory): -echo grass-${VERSION} - -mkdir grass-${VERSION} -mv * grass-${VERSION}/ -# create the package: -tar cvfzh grass-${VERSION}.tar.gz --exclude=.svn grass-${VERSION}/* -# restore src code location: -mv ./grass-${VERSION}/* . -rmdir ./grass-${VERSION} -# Calculating MD5 sum: -md5sum grass-${VERSION}.tar.gz > grass-${VERSION}.md5sum - -# reset include/VERSION file to SVN version: -vim include/VERSION - -#example -7 -6 -1svn -2018 - -rm -f include/VERSION~ -svn ci -m"back to SVN" include/VERSION - - -# Store the source tarball (twice) in (use scp -p FILES grass:): -SERVER1=grass.osgeo.org -SERVER1DIR=/var/www/grass/grass-cms/grass$MAJOR$MINOR/source/ -SERVER2=upload.osgeo.org -SERVER2DIR=/osgeo/download/grass/grass$MAJOR$MINOR/source/ -echo $SERVER1:$SERVER1DIR -echo $SERVER2:$SERVER2DIR - -# upload along with associated files: -scp -p grass-$VERSION.* AUTHORS COPYING ChangeLog_$VERSION.gz \ - INSTALL REQUIREMENTS.html SUBMITTING neteler@$SERVER1:$SERVER1DIR - -scp -p grass-$VERSION.* AUTHORS COPYING ChangeLog_$VERSION.gz \ - INSTALL REQUIREMENTS.html SUBMITTING neteler@$SERVER2:$SERVER2DIR - -# Only full release! -# generate link to "latest" source code -ssh neteler@$SERVER1 "cd $SERVER1DIR ; rm -f grass-$MAJOR.$MINOR-latest.tar.gz" -ssh neteler@$SERVER1 "cd $SERVER1DIR ; ln -s grass-$VERSION.tar.gz grass-$MAJOR.$MINOR-latest.tar.gz" - -# update winGRASS related files: Update the winGRASS version -vim grass-addons/tools/wingrass-packager/grass_packager_release.bat -vim grass-addons/tools/wingrass-packager/grass_addons.sh -vim grass-addons/tools/wingrass-packager/grass_copy_wwwroot.sh - -################### -# update web site to new version: CMS - - News section - - https://grass.osgeo.org/download/software/ - - https://grass.osgeo.org/download/software/sources/ - - https://grass.osgeo.org/download/software/linux/ - - https://grass.osgeo.org/home/history/releases/ - - https://grass.osgeo.org/development/svn/svn-tags/ (add tag): echo $RELEASETAG - -# write announcement - - store in trac: - https://trac.osgeo.org/grass/wiki/Release/7.6.x-News - https://trac.osgeo.org/grass/wiki/Grass7/NewFeatures76 <- add content of major changes only - - update version in https://grasswiki.osgeo.org/wiki/GRASS-Wiki - - store in Web as announces/announce_grass$MAJOR$MINOR$RELEASE.html <- how? with protected PHP upload page? (dropped since CMS) - -# only when new major release -# update cronjob 'cron_grass_HEAD_src_snapshot.sh' on grass.osgeo.org to next but one release tag for the differences - -# wiki updates, only when new major release: - - {{cmd|xxxx}} macro: https://grasswiki.osgeo.org/wiki/Template:Cmd - - update last version on main page - -# trac updates, only when new major release: - - Add new release to https://trac.osgeo.org/grass/admin/ticket/versions - - Set "complete" flag in https://trac.osgeo.org/grass/milestone/7.6.x --> Edit Milestone - - also: Retarget associated open tickets to milestone 7.6.x - - Batch modify tickets, set to next milestone (update this query accordingly: two entries to change) - https://trac.osgeo.org/grass/query?status=assigned&status=new&status=reopened&milestone=7.6.0&milestone=7.6.1&group=status&col=id&col=summary&col=owner&col=type&col=priority&col=component&col=version&order=priority - - Set max items to 1000, then select all shown tickets via Status: assigned/new/reopened sections - - Scroll down to "Batch modify": under the "Comment" section, add Field "Milestone" and set to next version - - then use "Change ticket" button, done. - - Only in case of new release branch being created: - - - Add Wiki Macro definitions for manual pages G7X:modulename - - Edit: https://trac.osgeo.org/grass/wiki/InterMapTxt - -# WinGRASS notes: - - - Update grass_packager_release.bat, eg. - - set MAJOR=7 - set MINOR=6 - set PATCH=1RC1 - - - Update addons (grass_addons.sh) rules, eg. - - compile $SVN_PATH/grass7 $GISBASE_PATH/grass760RC1 $ADDON_PATH/grass760RC1/addons - - - Modify grass_copy_wwwroot.sh accordingly, eg. - - copy_addon 761RC1 7.6.1RC1 - -# Launchpad notes: - - - Create milestone and release: https://launchpad.net/grass/+series - - - Upload tarball for created release - - - Update daily recipe contents: https://code.launchpad.net/~grass/+recipe/grass-trunk - -# Packaging notes: - https://trac.osgeo.org/grass/wiki/BuildHints - - https://trac.osgeo.org/grass/wiki/DebianUbuntuPackaging - - https://trac.osgeo.org/grass/wiki/CompileOnWindows - -############ -# Marketing - tell others about release: - -* Notify all packagers (MN has email list) - -* If release candidate: - - - - - -* If official release: - - publish related announcement press release at: - - Our GRASS web site: /announces/ - Note: DON'T use relative links there - - Our main mailing lists: - http://lists.osgeo.org/mailman/listinfo/grass-announce - - http://lists.osgeo.org/mailman/listinfo/grass-dev - - http://lists.osgeo.org/mailman/listinfo/grassuser - - - DebianGIS: - FreeGIS: - Geowanking: - OSGeo.org: - - Email: - info@osgeo.org - http://www.gis-news.de/ (franz-josef.behr@gismngt.de) - http://spatialnews.geocomm.com/submitnews.html (not free any more, convince editor@geocomm.com) - redazione@geoforus.it - mfeilner@linuxnewmedia.de - info@harzer.de - editor-geo@geoconnexion.com - - Web: - https://plus.google.com/u/0/communities/111147786674687562495 (G+ GRASS GIS community) - http://linuxtoday.com/contribute.php3 - https://joinup.ec.europa.eu/software/grassgis/home (submit news, MN) - http://www.macnn.com/contact/newstips/1 - http://www10.giscafe.com/submit_material/submit_options.php#Press (MN) --> Press releases - http://www.directionsmag.com/pressreleases/ (News -> Submit Press Release) - http://directory.fsf.org/wiki/GRASS_%28Geographic_Resources_Analysis_Support_System%29 - https://www.linux-apps.com/p/1128004/edit/ (MN) - https://news.eoportal.org/web/eoportal/share-your-news (MN) - -> Share your news with the EO community - https://www.heise.de/download/product/grass-gis-7105 (update, MN) - - See also: https://grass.osgeo.org/wiki/Contact_Databases - ... anywhere else? Please add here. - -########################################### -(B) HOWTO create a branch - -1. see SVN book: - http://svnbook.red-bean.com/en/1.1/ch04s07.html - - GRASS 7.6 release branch: - -# see below for real example -# BRANCH=releasebranch_7_6 -# URL=https://svn.osgeo.org/grass -# svn copy $URL/grass/trunk \ -# $URL/grass/branches/$BRANCH \ -# -m "Release branch for GRASS 7.6.x" - -Branch creation example: GRASS GIS 7.6 release branch creation - -svn copy https://svn.osgeo.org/grass/grass/trunk/ \ - https://svn.osgeo.org/grass/grass/branches/releasebranch_7_6 \ - -m "Release branch for GRASS GIS 7.6.x" - ----------- -Switching current local copy to above development branch: - (http://svnbook.red-bean.com/en/1.1/ch04s05.html) - - cd /path/to/your/local/copy/trunk - svn switch https://svn.osgeo.org/grass/grass/branches/releasebranch_7_6 . diff -Nru grass-7.6.1/doc/infrastructure.txt grass-7.8.0/doc/infrastructure.txt --- grass-7.6.1/doc/infrastructure.txt 2019-03-19 20:04:52.000000000 +0000 +++ grass-7.8.0/doc/infrastructure.txt 2019-07-01 20:28:47.000000000 +0000 @@ -1,17 +1,17 @@ How the GRASS Webserver and related infrastructure works written by M. Neteler -Last changed: $Date: 2018-01-29 12:18:48 +0100 (Mon, 29 Jan 2018) $ +Last changed: June 2019 Related Wiki documents: -* http://grass.osgeo.org/wiki/GRASS_Migration_to_OSGeo (historical document) +* https://grass.osgeo.org/wiki/GRASS_Migration_to_OSGeo (historical document) == GRASS Web server == Maintainer: M. Neteler -* http://grass.osgeo.org +* https://grass.osgeo.org ** Shared virtual OSGeo machine (osgeo6) hosted at Oregon State University Open Source Lab (server: osgeo6.osgeo.osuosl.org) ** OSGeo SAC page: http://wiki.osgeo.org/wiki/SAC_Service_Status @@ -20,21 +20,19 @@ ** Software: *** OS: Debian Wheezy *** Apache Server with PHP -** Further addresses: http://www.grass-gis.org -*** points through Apache rewrite engine to http://grass.osgeo.org * Backup: -** VERIFY 2010: grass.osgeo.org is backup'ed via rsync to XXXX: http://wiki.osgeo.org/wiki/SAC:Backups#download.osgeo.org +** VERIFY 2010: grass.osgeo.org is backup'ed by OSGeo SAC: http://wiki.osgeo.org/wiki/SAC:Backups ** Wiki backup, via rsync to http://josef.fsv.cvut.cz/WIKI/grass-osgeo/index.php/Main_Page * Web pages: -** CMSMS: http://grass.osgeo.org/home/imprint/ +** CMSMS: https://grass.osgeo.org/home/imprint/ ** mirrored from Wroclav university via httrack (tier-1), then offered as rsync mirror (tier-2) to other mirror sites ** RSS feed: offered by CMSMS * Weekly snapshots (generated Saturday morning California time): -** Source code tarball of SVN HEAD +** Source code tarball of git (GitHub) https://github.com/OSGeo/grass ** Linux binary snapshot is compiled *** GRASS is compiled with GDAL, PROJ, SQLite, MySQL, PostgreSQL, FFTW, C++ support *** binary tar.gz and manuals are moved into Web space @@ -42,12 +40,12 @@ * GRASS user manual HTML: ** generated during compilation of weekly Linux binary snapshot -* GRASS programmer's manual (http://grass.osgeo.org/programming7/) +* GRASS programmer's manual (https://grass.osgeo.org/programming7/) ** HTML: cronjob run Wednesday morning California time ** HTML: cronjob run Saturday morning California time ** disabled: PDF: cronjob run Saturday morning California time -* i18N translation statistics (http://grass.osgeo.org/development/translations/#statistics) +* i18N translation statistics (https://grass.osgeo.org/development/translations/#statistics) ** generated during compilation of Linux binary snapshot, stats of (cd locale; make) are extracted into text file ** text file parsed by PHP page and shown as table @@ -66,7 +64,7 @@ * Web statistics ** See URL at http://wiki.osgeo.org/wiki/Project_Stats -** OSGeo: awstats (http://grass.osgeo.org/stats/awstats.pl) +** OSGeo: awstats (https://grass.osgeo.org/stats/awstats.pl) *** configuration at: /etc/awstats/awstats.grass.osgeo.org.conf *** /etc/httpd/conf.d/sites/grass.osgeo.org.conf *** /etc/apache2/includes/grass.osgeo.org.inc @@ -84,7 +82,7 @@ Available lists: -* at OSGeo.org (http://lists.osgeo.org/mailman/listinfo): +* at OSGeo.org (https://lists.osgeo.org/mailman/listinfo): grass-abm Integration of GRASS with JAVA based agent based modeling (ABM) grass-announce GRASS announcements grass-commit Mailing list to distribute GRASS-CVS commits @@ -161,13 +159,16 @@ == GRASS Bugtracker == +Future bugtracker + * https://github.com/OSGeo/grass + Current bugtracker (Jan 2008 - today): * https://trac.osgeo.org/grass/report * Trac * posts new bugs and comments to grass-dev list * Settings: -tracsvn (OSGeo server) +tracsvn (OSGeo server) (Dec 2007 - 2019) /var/www/trac/env/grass/conf/trac.ini downloadable_paths = /grass-addons/grass7/*/*,/sandbox/*/* path = /var/www/grass/htdocs @@ -180,7 +181,6 @@ base_url = https://trac.osgeo.org/grass/ database = postgres://postgres@/trac_grass - Old bugtracker (Jan 2007 - Dec 2008): * http://wald.intevation.org/tracker/?group_id=21 * gforce, sponsored by Intevation GmbH, Germany @@ -213,13 +213,13 @@ and publishing their manual pages on publishing server, i.e. grass.osgeo.org. A new compilation is triggered everytime when a commit is done in the Addons-SVN. -Procedure of granting write access to Addons DVN repo: +Procedure of granting write access to Addons repo: * Request procedure: https://trac.osgeo.org/grass/wiki/HowToContribute#WriteaccesstotheGRASS-Addons-SVNrepository * Adding OSGeo-ID: https://www.osgeo.org/cgi-bin/auth/ldap_group.py?group=grass_addons * Adding contributor: https://trac.osgeo.org/grass/browser/grass-addons/contributors.csv (via SVN commit) * Confirm request in grass-psc and give instructions concerning code style etc (see archive for examples) -XML file for g.extension: http://grass.osgeo.org/addons/grass7/modules.xml +XML file for g.extension: https://grass.osgeo.org/addons/grass7/modules.xml - generated in grass-addons/tools/addons/grass-addons-publish.sh == GRASS Travis CI == @@ -227,8 +227,9 @@ Maintainer: Martin Landa * https://travis-ci.org/GRASS-GIS -* https://github.com/GRASS-GIS/grass-ci -* https://svn.osgeo.org/grass/grass-addons/tools/grass-ci/ +* https://github.com/OSGeo/grass +* OLD: https://github.com/GRASS-GIS/grass-ci +* https://github.com/OSGeo/grass-addons/tree/master/tools/grass-ci/ Travis CI control files: trunk/.travis/ @@ -237,7 +238,7 @@ linux.script.sh Maintenance script: -* https://svn.osgeo.org/grass/grass-addons/tools/grass-ci/grass-ci.sh +* https://github.com/OSGeo/grass-addons/tree/master/tools/grass-ci/grass-ci.sh The github update is run as a cronjob on server "geo102" (CTU, CZ). @@ -247,6 +248,16 @@ * https://scan.coverity.com/projects/grass?tab=overview + +== Transifex translation management == + +i18N gettext messages: + +* Dashboard: https://www.transifex.com/grass-gis/ +* URL to fetch files: +** https://www.transifex.com/grass-gis/grass7/content/ +** Use: "Auto update resources" button + == OLD: GRASS Quality Control == Maintainer: Prof. Giulio Antoniol diff -Nru grass-7.6.1/doc/python/m.distance.py grass-7.8.0/doc/python/m.distance.py --- grass-7.6.1/doc/python/m.distance.py 2019-03-19 20:04:51.000000000 +0000 +++ grass-7.8.0/doc/python/m.distance.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: m.distance diff -Nru grass-7.6.1/doc/python/raster_example_ctypes.py grass-7.8.0/doc/python/raster_example_ctypes.py --- grass-7.6.1/doc/python/raster_example_ctypes.py 2019-03-19 20:04:52.000000000 +0000 +++ grass-7.8.0/doc/python/raster_example_ctypes.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Sample Python script to access raster data using GRASS Ctypes @@ -64,7 +64,7 @@ # iterate through map rows print "Map data:" -for row_n in xrange(rows): +for row_n in range(rows): # read a row of raster data into memory, then print it Rast_get_row(in_fd, in_rast, row_n, data_type) print row_n, in_rast[0:cols] diff -Nru grass-7.6.1/doc/python/script/r.example.html grass-7.8.0/doc/python/script/r.example.html --- grass-7.6.1/doc/python/script/r.example.html 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/doc/python/script/r.example.html 2019-05-18 15:50:04.000000000 +0000 @@ -33,4 +33,4 @@ GRASS Development Team -

Last changed: $Date: 2018-11-13 17:36:22 +0100 (Tue, 13 Nov 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/doc/python/script/r.example.py grass-7.8.0/doc/python/script/r.example.py --- grass-7.6.1/doc/python/script/r.example.py 2019-03-19 20:04:51.000000000 +0000 +++ grass-7.8.0/doc/python/script/r.example.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #%module #% description: Selects values from raster above value of mean plus standard deviation diff -Nru grass-7.6.1/doc/python/vector_example_ctypes.py grass-7.8.0/doc/python/vector_example_ctypes.py --- grass-7.6.1/doc/python/vector_example_ctypes.py 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/doc/python/vector_example_ctypes.py 2019-08-06 19:42:45.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 """ Sample Python script to access vector data using GRASS Ctypes diff -Nru grass-7.6.1/doc/raster/r.example/r.example.html grass-7.8.0/doc/raster/r.example/r.example.html --- grass-7.6.1/doc/raster/r.example/r.example.html 2019-03-19 20:04:53.000000000 +0000 +++ grass-7.8.0/doc/raster/r.example/r.example.html 2019-05-18 15:50:04.000000000 +0000 @@ -35,4 +35,4 @@ GRASS Development Team -

Last changed: $Date: 2018-11-13 17:36:22 +0100 (Tue, 13 Nov 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/doc/vector/v.example/v.example.html grass-7.8.0/doc/vector/v.example/v.example.html --- grass-7.6.1/doc/vector/v.example/v.example.html 2019-03-19 20:04:51.000000000 +0000 +++ grass-7.8.0/doc/vector/v.example/v.example.html 2019-05-18 15:50:04.000000000 +0000 @@ -34,4 +34,4 @@ Radim Blazek, ITC-irst, Trento, Italy -

Last changed: $Date: 2018-11-13 17:36:22 +0100 (Tue, 13 Nov 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/docker/Dockerfile_alpine grass-7.8.0/docker/Dockerfile_alpine --- grass-7.6.1/docker/Dockerfile_alpine 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/docker/Dockerfile_alpine 2019-08-27 14:33:28.000000000 +0000 @@ -0,0 +1,244 @@ +FROM alpine:edge + +# Based on: +# https://github.com/mundialis/docker-grass-gis/blob/master/Dockerfile +LABEL authors="Pietro Zambelli" +LABEL maintainer="peter.zamb@gmail.com" + +# PACKAGES VERSIONS +ARG GRASS_VERSION=7.8 +ARG PYTHON_VERSION=3 +ARG PROJ_VERSION=5.2.0 +ARG PROJ_DATUMGRID_VERSION=1.8 + +# ================ +# CONFIG VARIABLES +# ================ + +# set configuration options +ENV GRASS_CONFIG="\ + --enable-largefile \ + --with-cxx \ + --with-proj --with-proj-share=/usr/share/proj \ + --with-gdal \ + --with-python \ + --with-geos \ + --with-sqlite \ + --with-bzlib \ + --with-zstd \ + --with-cairo --with-cairo-ldflags=-lfontconfig \ + --with-fftw \ + --with-postgres --with-postgres-includes='/usr/include/postgresql' \ + --without-freetype \ + --without-openmp \ + --without-opengl \ + --without-nls \ + --without-mysql \ + --without-odbc \ + --without-openmp \ + --without-ffmpeg \ + " + +# Set environmental variables for GRASS GIS compilation, without debug symbols +ENV MYCFLAGS="-O2 -std=gnu99 -m64" \ + MYLDFLAGS="-s -Wl,--no-undefined -lblas" \ + # CXX stuff: + LD_LIBRARY_PATH="/usr/local/lib" \ + LDFLAGS="$MYLDFLAGS" \ + CFLAGS="$MYCFLAGS" \ + CXXFLAGS="$MYCXXFLAGS" \ + NUMTHREADS=2 + + +# List of packages to be installed +ENV PACKAGES="\ + attr \ + bash \ + bison \ + bzip2 \ + cairo \ + fftw \ + flex \ + freetype \ + gdal \ + gettext \ + geos \ + gnutls \ + libbz2 \ + libjpeg-turbo \ + libpng \ + musl \ + musl-utils \ + ncurses \ + openjpeg \ + openblas \ + py3-numpy \ + py3-pillow \ + py3-six \ + postgresql \ + sqlite \ + sqlite-libs \ + tiff \ + zstd \ + zstd-libs \ + " \ + # These packages are required to compile GRASS GIS. + GRASS_BUILD_PACKAGES="\ + build-base \ + bzip2-dev \ + cairo-dev \ + fftw-dev \ + freetype-dev \ + g++ \ + gcc \ + gdal-dev \ + geos-dev \ + gnutls-dev \ + libc6-compat \ + libjpeg-turbo-dev \ + libpng-dev \ + make \ + openjpeg-dev \ + openblas-dev \ + postgresql-dev \ + python3-dev \ + py3-numpy-dev \ + sqlite-dev \ + tar \ + tiff-dev \ + unzip \ + vim \ + wget \ + zip \ + zstd-dev \ + " + +# ==================== +# INSTALL DEPENDENCIES +# ==================== + +WORKDIR /src + +ENV PYTHONBIN=python$PYTHON_VERSION + +RUN echo "Install Python";\ + apk add --no-cache $PYTHONBIN && \ + $PYTHONBIN -m ensurepip && \ + rm -r /usr/lib/python*/ensurepip && \ + pip$PYTHON_VERSION install --upgrade pip setuptools && \ + if [ ! -e /usr/bin/pip ]; then ln -s pip$PYTHON_VERSION /usr/bin/pip ; fi && \ + if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/$PYTHONBIN /usr/bin/python; fi && \ + rm -r /root/.cache + +# Add the packages +RUN echo "Install main packages";\ + apk update; \ + apk add --no-cache \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \ + $PACKAGES; \ + # Add packages just for the GRASS build process + apk add --no-cache \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \ + --virtual .build-deps $GRASS_BUILD_PACKAGES; \ + # echo LANG="en_US.UTF-8" > /etc/default/locale; + # + # install the latest projection library for GRASS GIS + # + echo "Install PROJ-$PROJ_VERSION";\ + echo " => Dowload proj-$PROJ_VERSION";\ + wget http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz && \ + tar xzvf proj-$PROJ_VERSION.tar.gz && \ + cd /src/proj-$PROJ_VERSION/ && \ + echo " => Dowload datumgrid-$PROJ_DATUMGRID_VERSION" &&\ + wget http://download.osgeo.org/proj/proj-datumgrid-$PROJ_DATUMGRID_VERSION.zip && \ + cd nad && \ + unzip ../proj-datumgrid-$PROJ_DATUMGRID_VERSION.zip && \ + cd .. && \ + echo " => configure" &&\ + ./configure --prefix=/usr/ && \ + echo " => compile" &&\ + make && \ + echo " => install" &&\ + make install && \ + ldconfig /etc/ld.so.conf.d; \ + # + # Checkout and install GRASS GIS + # + echo "Install GRASS GIS";\ + echo " => Dowload grass-$GRASS_VERSION";\ + wget https://grass.osgeo.org/grass`echo $GRASS_VERSION | tr -d .`/source/snapshot/grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz && \ + # unpack source code package and remove tarball archive: + mkdir /src/grass_build && \ + tar xfz grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz --strip=1 -C /src/grass_build && \ + rm -f grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz; \ + # + # Configure compile and install GRASS GIS + # + echo " => Configure and compile grass";\ + cd /src/grass_build && \ + /src/grass_build/configure $GRASS_CONFIG && \ + make -j $NUMTHREADS && \ + make install && \ + ldconfig /etc/ld.so.conf.d; \ + # + # enable simple grass command regardless of version number + # + ln -s `find /usr/local/bin -name "grass*"` /usr/local/bin/grass; \ + # + # Reduce the image size + # + rm -rf /src/*; \ + # remove build dependencies and any leftover apk cache + apk del --no-cache --purge .build-deps; \ + rm -rf /var/cache/apk/*; \ + rm -rf /root/.cache; \ + # Remove unnecessary grass files + rm -rf /usr/local/grass78/demolocation; \ + rm -rf /usr/local/grass78/docs; \ + rm -rf /usr/local/grass78/fonts; \ + rm -rf /usr/local/grass78/gui; \ + rm -rf /usr/local/grass78/share; + + +# Unset environmental variables to avoid later compilation issues +ENV INTEL="" \ + MYCFLAGS="" \ + MYLDFLAGS="" \ + MYCXXFLAGS="" \ + LD_LIBRARY_PATH="" \ + LDFLAGS="" \ + CFLAGS="" \ + CXXFLAGS="" \ + # set SHELL var to avoid /bin/sh fallback in interactive GRASS GIS sessions in docker + SHELL="/bin/bash" + + +# ===================== +# INSTALL GRASS-SESSION +# ===================== + +# install external Python API +RUN pip install grass-session + +# set GRASSBIN +ENV GRASSBIN="/usr/local/bin/grass" + +# ======== +# FINALIZE +# ======== + +# Data workdir +WORKDIR /grassdb +VOLUME /grassdb + +# GRASS GIS specific +# allow work with MAPSETs that are not owned by current user +ENV GRASS_SKIP_MAPSET_OWNER_CHECK=1 \ + LC_ALL="en_US.UTF-8" + +# debug +RUN $GRASSBIN --config svn_revision version + +CMD [$GRASSBIN, "--version"] diff -Nru grass-7.6.1/docker/Dockerfile_alpine_wxgui grass-7.8.0/docker/Dockerfile_alpine_wxgui --- grass-7.6.1/docker/Dockerfile_alpine_wxgui 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/docker/Dockerfile_alpine_wxgui 2019-08-27 14:33:28.000000000 +0000 @@ -0,0 +1,254 @@ +FROM alpine:edge + +# Based on: +# https://github.com/mundialis/docker-grass-gis/blob/master/Dockerfile +LABEL authors="Markus Neteler" +LABEL maintainer="neteler@osgeo.org" + +# PACKAGES VERSIONS +ARG GRASS_VERSION=7.8 +ARG PYTHON_VERSION=3 +ARG PROJ_VERSION=5.2.0 +ARG PROJ_DATUMGRID_VERSION=1.8 + +# ================ +# CONFIG VARIABLES +# ================ + +# set configuration options, with wxGUI +ENV GRASS_CONFIG="\ + --enable-largefile \ + --with-cxx \ + --with-proj --with-proj-share=/usr/share/proj \ + --with-gdal \ + --with-python \ + --with-geos \ + --with-sqlite \ + --with-bzlib \ + --with-zstd \ + --with-cairo --with-cairo-ldflags=-lfontconfig \ + --with-fftw \ + --with-wxwidgets \ + --with-postgres --with-postgres-includes='/usr/include/postgresql' \ + --without-freetype \ + --without-openmp \ + --without-opengl \ + --without-nls \ + --without-mysql \ + --without-odbc \ + --without-openmp \ + --without-ffmpeg \ + " + +# Set environmental variables for GRASS GIS compilation, without debug symbols +ENV MYCFLAGS="-O2 -std=gnu99 -m64" \ + MYLDFLAGS="-s -Wl,--no-undefined -lblas" \ + # CXX stuff: + LD_LIBRARY_PATH="/usr/local/lib" \ + LDFLAGS="$MYLDFLAGS" \ + CFLAGS="$MYCFLAGS" \ + CXXFLAGS="$MYCXXFLAGS" \ + NUMTHREADS=2 + + +# List of packages to be installed +ENV PACKAGES="\ + attr \ + bash \ + bison \ + bzip2 \ + cairo \ + fftw \ + flex \ + freetype \ + gdal \ + gettext \ + geos \ + gnutls \ + gtk+3.0 \ + libbz2 \ + libjpeg-turbo \ + libpng \ + musl \ + musl-utils \ + ncurses \ + openjpeg \ + openblas \ + py3-numpy \ + py3-pillow \ + py3-six \ + postgresql \ + sqlite \ + sqlite-libs \ + tiff \ + wxgtk-base \ + wxgtk \ + zstd \ + zstd-libs \ + " \ + # These packages are required to compile GRASS GIS. + GRASS_BUILD_PACKAGES="\ + build-base \ + bzip2-dev \ + cairo-dev \ + fftw-dev \ + freetype-dev \ + g++ \ + gcc \ + gdal-dev \ + geos-dev \ + gnutls-dev \ + gtk+3.0-dev \ + libc6-compat \ + libjpeg-turbo-dev \ + libpng-dev \ + make \ + openjpeg-dev \ + openblas-dev \ + postgresql-dev \ + python3-dev \ + py3-numpy-dev \ + sqlite-dev \ + tar \ + tiff-dev \ + unzip \ + vim \ + wget \ + wxgtk-base-dev \ + wxgtk-dev \ + zip \ + zstd-dev \ + " + +# ==================== +# INSTALL DEPENDENCIES +# ==================== + +WORKDIR /src + +ENV PYTHONBIN=python$PYTHON_VERSION + +RUN echo "Install Python";\ + apk add --no-cache $PYTHONBIN && \ + $PYTHONBIN -m ensurepip && \ + rm -r /usr/lib/python*/ensurepip && \ + pip$PYTHON_VERSION install --upgrade pip setuptools && \ + if [ ! -e /usr/bin/pip ]; then ln -s pip$PYTHON_VERSION /usr/bin/pip ; fi && \ + if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/$PYTHONBIN /usr/bin/python; fi && \ + rm -r /root/.cache + +# Add the packages +RUN echo "Install main packages";\ + apk update; \ + apk add --no-cache \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \ + $PACKAGES; \ + # Add packages just for the GRASS build process + apk add --no-cache \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \ + --virtual .build-deps $GRASS_BUILD_PACKAGES; \ + # echo LANG="en_US.UTF-8" > /etc/default/locale; + # + # compile wxPython, unfortunately there is no Alpine package (yet) - compilation is slow, though! + $PYTHONBIN -m pip install -U pathlib2 wxPython && \ + # + # install the latest projection library for GRASS GIS + # + echo "Install PROJ-$PROJ_VERSION";\ + echo " => Dowload proj-$PROJ_VERSION";\ + wget http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz && \ + tar xzvf proj-$PROJ_VERSION.tar.gz && \ + cd /src/proj-$PROJ_VERSION/ && \ + echo " => Dowload datumgrid-$PROJ_DATUMGRID_VERSION" &&\ + wget http://download.osgeo.org/proj/proj-datumgrid-$PROJ_DATUMGRID_VERSION.zip && \ + cd nad && \ + unzip ../proj-datumgrid-$PROJ_DATUMGRID_VERSION.zip && \ + cd .. && \ + echo " => configure" &&\ + ./configure --prefix=/usr/ && \ + echo " => compile" &&\ + make && \ + echo " => install" &&\ + make install && \ + ldconfig /etc/ld.so.conf.d; \ + # + # Checkout and install GRASS GIS + # + echo "Install GRASS GIS";\ + echo " => Dowload grass-$GRASS_VERSION";\ + wget https://grass.osgeo.org/grass`echo $GRASS_VERSION | tr -d .`/source/snapshot/grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz && \ + # unpack source code package and remove tarball archive: + mkdir /src/grass_build && \ + tar xfz grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz --strip=1 -C /src/grass_build && \ + rm -f grass-$GRASS_VERSION.git_src_snapshot_latest.tar.gz; \ + # + # Configure compile and install GRASS GIS + # + echo " => Configure and compile grass";\ + cd /src/grass_build && \ + /src/grass_build/configure $GRASS_CONFIG && \ + make -j $NUMTHREADS && \ + make install && \ + ldconfig /etc/ld.so.conf.d; \ + # + # enable simple grass command regardless of version number + # + ln -s `find /usr/local/bin -name "grass*"` /usr/local/bin/grass; \ + # + # Reduce the image size + # + rm -rf /src/*; \ + # remove build dependencies and any leftover apk cache + apk del --no-cache --purge .build-deps; \ + rm -rf /var/cache/apk/*; \ + rm -rf /root/.cache; \ + # Remove unnecessary grass files + rm -rf /usr/local/grass78/demolocation; \ + rm -rf /usr/local/grass78/docs; \ + rm -rf /usr/local/grass78/fonts; \ + rm -rf /usr/local/grass78/gui; \ + rm -rf /usr/local/grass78/share; + + +# Unset environmental variables to avoid later compilation issues +ENV INTEL="" \ + MYCFLAGS="" \ + MYLDFLAGS="" \ + MYCXXFLAGS="" \ + LD_LIBRARY_PATH="" \ + LDFLAGS="" \ + CFLAGS="" \ + CXXFLAGS="" \ + # set SHELL var to avoid /bin/sh fallback in interactive GRASS GIS sessions in docker + SHELL="/bin/bash" + + +# ===================== +# INSTALL GRASS-SESSION +# ===================== + +# install external Python API +RUN pip install grass-session + +# set GRASSBIN +ENV GRASSBIN="/usr/local/bin/grass" + +# ======== +# FINALIZE +# ======== + +# Data workdir +WORKDIR /grassdb +VOLUME /grassdb + +# GRASS GIS specific +# allow work with MAPSETs that are not owned by current user +ENV GRASS_SKIP_MAPSET_OWNER_CHECK=1 \ + LC_ALL="en_US.UTF-8" + +# debug +RUN $GRASSBIN --config svn_revision version + +CMD [$GRASSBIN, "--version"] diff -Nru grass-7.6.1/docker/README_alpine.md grass-7.8.0/docker/README_alpine.md --- grass-7.6.1/docker/README_alpine.md 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/docker/README_alpine.md 2019-08-11 09:05:20.000000000 +0000 @@ -0,0 +1,22 @@ +# Docker GRASS GIS (alpine linux) + +Dockerfile with an [Alpine Linux](https://www.alpinelinux.org/) image with [GRASS GIS](https://grass.osgeo.org/) and [grass-session](https://github.com/zarch/grass-session/). + +Download size of this image is only approximately 80 MB. + +Build the docker with: + +```bash +$ sudo docker build --build-arg GRASS_VERSION=7.8 \ + --build-arg PYTHON_VERSION=3 \ + --build-arg PROJ_VERSION=5.2.0 \ + --build-arg PROJ_DATUMGRID_VERSION=1.8 \ + . +``` + +View the images available using `sudo docker images` and open a bash terminal with: + +```bash +$ sudo docker run -i -t 15550df91610 /bin/bash +bash-5.0# +``` diff -Nru grass-7.6.1/Dockerfile grass-7.8.0/Dockerfile --- grass-7.6.1/Dockerfile 2019-03-19 20:05:30.000000000 +0000 +++ grass-7.8.0/Dockerfile 2019-08-11 09:05:20.000000000 +0000 @@ -24,8 +24,6 @@ libgsl0-dev \ libjpeg-dev \ liblapack-dev \ - liblas-dev \ - liblas-c-dev \ libncurses5-dev \ libnetcdf-dev \ libopenjp2-7 \ @@ -56,6 +54,7 @@ python-numpy \ python-pil \ python-ply \ + python-six \ sqlite3 \ subversion \ unixodbc-dev \ @@ -99,7 +98,6 @@ --with-freetype --with-freetype-includes="/usr/include/freetype2/" \ --with-fftw \ --with-netcdf \ - --with-liblas --with-liblas-config=/usr/bin/liblas-config \ --with-pdal \ --with-proj --with-proj-share=/usr/share/proj \ --with-geos=/usr/bin/geos-config \ diff -Nru grass-7.6.1/general/g.access/g.access.html grass-7.8.0/general/g.access/g.access.html --- grass-7.6.1/general/g.access/g.access.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/general/g.access/g.access.html 2019-05-18 15:50:04.000000000 +0000 @@ -44,4 +44,4 @@ Michael Shapiro, U.S. Army Construction Engineering Research Laboratory -

Last changed: $Date: 2017-06-02 10:23:51 +0200 (Fri, 02 Jun 2017) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/general/g.cairocomp/g.cairocomp.html grass-7.8.0/general/g.cairocomp/g.cairocomp.html --- grass-7.6.1/general/g.cairocomp/g.cairocomp.html 2019-03-19 20:04:27.000000000 +0000 +++ grass-7.8.0/general/g.cairocomp/g.cairocomp.html 2019-05-18 15:50:04.000000000 +0000 @@ -18,4 +18,4 @@ Glynn Clements

-Last changed: $Date: 2013-01-15 16:13:13 +0100 (Tue, 15 Jan 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.copy/g.copy.html grass-7.8.0/general/g.copy/g.copy.html --- grass-7.6.1/general/g.copy/g.copy.html 2019-03-19 20:04:27.000000000 +0000 +++ grass-7.8.0/general/g.copy/g.copy.html 2019-05-18 15:50:04.000000000 +0000 @@ -56,4 +56,4 @@ Research Laboratory

-Last changed: $Date: 2016-04-29 16:26:35 +0200 (Fri, 29 Apr 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.dirseps/g.dirseps.html grass-7.8.0/general/g.dirseps/g.dirseps.html --- grass-7.6.1/general/g.dirseps/g.dirseps.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/general/g.dirseps/g.dirseps.html 2019-05-18 15:50:04.000000000 +0000 @@ -8,4 +8,4 @@ Paul Kelly -

Last changed: $Date: 2011-09-29 21:18:47 +0200 (Thu, 29 Sep 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/general/g.filename/g.filename.html grass-7.8.0/general/g.filename/g.filename.html --- grass-7.6.1/general/g.filename/g.filename.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.filename/g.filename.html 2019-05-18 15:50:04.000000000 +0000 @@ -86,4 +86,4 @@ Michael Shapiro, U.S.Army Construction Engineering Research Laboratory -

Last changed: $Date: 2015-02-14 22:07:18 +0100 (Sat, 14 Feb 2015) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/general/g.findetc/g.findetc.html grass-7.8.0/general/g.findetc/g.findetc.html --- grass-7.6.1/general/g.findetc/g.findetc.html 2019-03-19 20:04:27.000000000 +0000 +++ grass-7.8.0/general/g.findetc/g.findetc.html 2019-05-18 15:50:04.000000000 +0000 @@ -23,4 +23,4 @@ William Kyngesburye -

Last changed: $Date: 2015-02-14 22:07:18 +0100 (Sat, 14 Feb 2015) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/general/g.findfile/g.findfile.html grass-7.8.0/general/g.findfile/g.findfile.html --- grass-7.6.1/general/g.findfile/g.findfile.html 2019-03-19 20:04:27.000000000 +0000 +++ grass-7.8.0/general/g.findfile/g.findfile.html 2019-08-11 09:05:20.000000000 +0000 @@ -75,7 +75,7 @@

PYTHON

-See Python +See Python Scripting Library for more info.

Note: The Python tab in the wxGUI can be used for entering the @@ -101,4 +101,4 @@ Michael Shapiro, U.S.Army Construction Engineering Research Laboratory -

Last changed: $Date: 2018-08-31 17:01:15 +0200 (Fri, 31 Aug 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/general/g.gisenv/g.gisenv.html grass-7.8.0/general/g.gisenv/g.gisenv.html --- grass-7.6.1/general/g.gisenv/g.gisenv.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/general/g.gisenv/g.gisenv.html 2019-05-18 15:50:04.000000000 +0000 @@ -195,4 +195,4 @@ U.S.Army Construction Engineering Research Laboratory

-Last changed: $Date: 2016-01-28 12:21:34 +0100 (Thu, 28 Jan 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.gui/g.gui.html grass-7.8.0/general/g.gui/g.gui.html --- grass-7.6.1/general/g.gui/g.gui.html 2019-03-19 20:04:30.000000000 +0000 +++ grass-7.8.0/general/g.gui/g.gui.html 2019-05-18 15:50:04.000000000 +0000 @@ -70,4 +70,4 @@ Hamish Bowman, Otago University, Dunedin, New Zealand (fine tuning)

-Last changed: $Date: 2014-04-21 13:55:01 +0200 (Mon, 21 Apr 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.list/g.list.html grass-7.8.0/general/g.list/g.list.html --- grass-7.6.1/general/g.list/g.list.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.list/g.list.html 2019-05-18 15:50:04.000000000 +0000 @@ -201,4 +201,4 @@ based on general/manage/cmd/list.c by Michael Shapiro

-Last changed: $Date: 2018-06-16 06:48:44 +0200 (Sat, 16 Jun 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.mapset/g.mapset.html grass-7.8.0/general/g.mapset/g.mapset.html --- grass-7.6.1/general/g.mapset/g.mapset.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.mapset/g.mapset.html 2019-05-18 15:50:04.000000000 +0000 @@ -68,4 +68,4 @@ Radim Blazek

-Last changed: $Date: 2017-12-30 12:13:03 +0100 (Sat, 30 Dec 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.mapsets/g.mapsets.html grass-7.8.0/general/g.mapsets/g.mapsets.html --- grass-7.6.1/general/g.mapsets/g.mapsets.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.mapsets/g.mapsets.html 2019-05-18 15:50:04.000000000 +0000 @@ -180,4 +180,4 @@ Updated to GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic

-Last changed: $Date: 2016-01-28 12:21:34 +0100 (Thu, 28 Jan 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.message/g.message.html grass-7.8.0/general/g.message/g.message.html --- grass-7.6.1/general/g.message/g.message.html 2019-03-19 20:04:30.000000000 +0000 +++ grass-7.8.0/general/g.message/g.message.html 2019-08-11 09:05:20.000000000 +0000 @@ -42,12 +42,12 @@ exclamation mark '!' character specifically (making single quoting of it necessary), it shouldn't be the case for the non-interactive instances of Bash. Nonetheless, to avoid context-based confusion later on -you are enouraged to single-quote messages that do not require +you are encouraged to single-quote messages that do not require $VARIABLE expansion.

Usage in Python scripts

-GRASS +GRASS Python Scripting Library defines special wrappers for g.message. @@ -149,4 +149,4 @@ Jachym Cepicky

-Last changed: $Date: 2018-08-31 17:01:15 +0200 (Fri, 31 Aug 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.mkfontcap/g.mkfontcap.html grass-7.8.0/general/g.mkfontcap/g.mkfontcap.html --- grass-7.6.1/general/g.mkfontcap/g.mkfontcap.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.mkfontcap/g.mkfontcap.html 2019-05-18 15:50:04.000000000 +0000 @@ -54,4 +54,4 @@ Paul Kelly

-Last changed: $Date: 2013-06-26 07:18:23 +0200 (Wed, 26 Jun 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.parser/g.parser.html grass-7.8.0/general/g.parser/g.parser.html --- grass-7.6.1/general/g.parser/g.parser.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.parser/g.parser.html 2019-08-06 19:42:45.000000000 +0000 @@ -255,6 +255,31 @@ v.in.db --interface-description

+

JSON

+ +The flag --json added to a GRASS command with parameters mandatorily +to be specified generates a module interface description in JSON. Example: + +
+v.in.db driver=sqlite database=mysqlite.db table=pointsfile x=x y=y z=z key=idcol out=dtmpoints --json
+{
+  "module": "v.in.db",
+  "id": "v.in.db_1804289383",
+  "inputs":[
+     {"param": "table", "value": "pointsfile"},
+     {"param": "driver", "value": "sqlite"},
+     {"param": "database", "value": "mysqlite.db"},
+     {"param": "x", "value": "x"},
+     {"param": "y", "value": "y"},
+     {"param": "z", "value": "z"},
+     {"param": "key", "value": "idcol"}
+   ],
+  "outputs":[
+     {"param": "output", "value": "dtmpoints"}
+   ]
+}
+
+

Web Processing Service (WPS)

The flag --wps-process-description added to a GRASS command @@ -336,7 +361,7 @@

Example code for Python

-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # g.parser demo script for python programming
 
@@ -530,7 +555,7 @@
 
 v.what.rast --script
 
-#!/usr/bin/env python
+#!/usr/bin/env python3
 ############################################################################
 #
 # MODULE:       v.what.rast_wrapper
@@ -656,4 +681,4 @@
 Glynn Clements
 
 

-Last changed: $Date: 2017-04-22 21:39:11 +0200 (Sat, 22 Apr 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.parser/standard_option.c grass-7.8.0/general/g.parser/standard_option.c --- grass-7.6.1/general/g.parser/standard_option.c 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/general/g.parser/standard_option.c 2019-06-03 20:34:20.000000000 +0000 @@ -70,6 +70,7 @@ "G_OPT_STRDS_INPUT", "G_OPT_STRDS_INPUTS", "G_OPT_STRDS_OUTPUT", + "G_OPT_STRDS_OUTPUTS", "G_OPT_STR3DS_INPUT", "G_OPT_STR3DS_INPUTS", "G_OPT_STR3DS_OUTPUT", diff -Nru grass-7.6.1/general/g.parser/test.py grass-7.8.0/general/g.parser/test.py --- grass-7.6.1/general/g.parser/test.py 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.parser/test.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # g.parser demo script for python programming diff -Nru grass-7.6.1/general/g.pnmcomp/g.pnmcomp.html grass-7.8.0/general/g.pnmcomp/g.pnmcomp.html --- grass-7.6.1/general/g.pnmcomp/g.pnmcomp.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.pnmcomp/g.pnmcomp.html 2019-05-18 15:50:04.000000000 +0000 @@ -43,4 +43,4 @@ Glynn Clements -

Last changed: $Date: 2013-01-15 16:12:43 +0100 (Tue, 15 Jan 2013) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/general/g.ppmtopng/g.ppmtopng.html grass-7.8.0/general/g.ppmtopng/g.ppmtopng.html --- grass-7.6.1/general/g.ppmtopng/g.ppmtopng.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/general/g.ppmtopng/g.ppmtopng.html 2019-05-18 15:50:04.000000000 +0000 @@ -8,4 +8,4 @@ Glynn Clements

-Last changed: $Date: 2013-01-15 17:46:35 +0100 (Tue, 15 Jan 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.proj/g.proj.html grass-7.8.0/general/g.proj/g.proj.html --- grass-7.6.1/general/g.proj/g.proj.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.proj/g.proj.html 2019-05-18 15:50:04.000000000 +0000 @@ -243,4 +243,4 @@ Paul Kelly -

Last changed: $Date: 2016-05-28 08:54:25 +0200 (Sat, 28 May 2016) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/general/g.proj/input.c grass-7.8.0/general/g.proj/input.c --- grass-7.6.1/general/g.proj/input.c 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/general/g.proj/input.c 2019-06-03 20:34:20.000000000 +0000 @@ -280,9 +280,21 @@ set_gdal_region(gdal_ds); hSRS = OSRNewSpatialReference(wktstring); } - else - G_fatal_error(_("Unable to read georeferenced file <%s> using " - "GDAL library"), geofile); + else { + int namelen; + + namelen = strlen(geofile); + if (namelen > 4 && G_strcasecmp(geofile + (namelen - 4), ".prj") == 0) { + G_warning(_("<%s> is not a GDAL dataset, trying to open it as ESRI WKT"), + geofile); + + return input_wkt(geofile); + } + else { + G_fatal_error(_("Unable to read georeferenced file <%s> using " + "GDAL library"), geofile); + } + } } if (cellhd.proj == PROJECTION_XY) diff -Nru grass-7.6.1/general/g.proj/list_codes.c grass-7.8.0/general/g.proj/list_codes.c --- grass-7.6.1/general/g.proj/list_codes.c 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/general/g.proj/list_codes.c 2019-06-03 20:34:20.000000000 +0000 @@ -0,0 +1,250 @@ +#include +#include +#include +#include +#include + +#ifdef HAVE_PROJ_H +#include +#if PROJ_VERSION_MAJOR >= 6 +#define USE_PROJDB +#endif +#else +#include +#endif + +char *get_authority_names(void) +{ + char *authnames; + +#ifdef USE_PROJDB + /* PROJ 6 */ + int i, len; + PROJ_STRING_LIST authlist = proj_get_authorities_from_database(NULL); + + len = 0; + for (i = 0; authlist[i]; i++) { + len += strlen(authlist[i]) + 1; + } + if (len > 0) { + authnames = G_malloc((len + 1) * sizeof(char)); /* \0 */ + *authnames = '\0'; + for (i = 0; authlist[i]; i++) { + if (i > 0) + strcat(authnames, ","); + strcat(authnames, authlist[i]); + } + } + else { + authnames = G_store(""); + } +#else + /* PROJ 4, 5 */ + /* there are various init files in share/proj/: + * EPSG,GL27,IGNF,ITRF2000,ITRF2008,ITRF2014,nad27,nad83,esri + * but they have different formats: bothering only with EPSG here */ + authnames = G_store("EPSG"); +#endif + + return authnames; +} + +void list_codes(char *authname) +{ +#ifdef USE_PROJDB + /* PROJ 6+ */ + int i, crs_cnt; + PROJ_CRS_INFO **proj_crs_info; + + crs_cnt = 0; + proj_crs_info = proj_get_crs_info_list_from_database(NULL, + authname, NULL, &crs_cnt); + if (crs_cnt < 1) + G_fatal_error(_("No codes found for authority %s"), + authname); + + for (i = 0; i < crs_cnt; i++) { + const char *proj_definition; + char emptystr; + PJ *pj; + + emptystr = '\0'; + pj = proj_create_from_database(NULL, + proj_crs_info[i]->auth_name, + proj_crs_info[i]->code, + PJ_CATEGORY_CRS, + 0, NULL); + proj_definition = proj_as_proj_string(NULL, pj, PJ_PROJ_5, NULL); + if (!proj_definition) { + /* what to do with a CRS without proj string ? */ + G_debug(1, "No proj string for %s:%s", + proj_crs_info[i]->auth_name, + proj_crs_info[i]->code); + proj_definition = &emptystr; + } + + if (proj_definition) { + fprintf(stdout, "%s|%s|%s\n", proj_crs_info[i]->code, + proj_crs_info[i]->name, + proj_definition); + } + + proj_destroy(pj); + } +#else + char pathname[GPATH_MAX]; + char code[GNAME_MAX], name[GNAME_MAX], proj_def[8192]; + FILE *fp; + char buf[4096]; + int line; + +#ifdef HAVE_PROJ_H + /* PROJ 5 */ + PJ_INIT_INFO init_info; + + if (G_strcasecmp(authname, "EPSG") == 0) + authname = "epsg"; + + init_info = proj_init_info(authname); + sprintf(pathname, "%s", init_info.filename); + + if (access(pathname, F_OK) != 0) + G_fatal_error(_("Unable to find init file %s"), authname); + +#else + /* PROJ 4 */ + /* can't use pj_find_file() from the old proj api + * because it does not exist in PROJ 4 */ + char *grass_proj_share; + + if (G_strcasecmp(authname, "EPSG") == 0) + authname = "epsg"; + + grass_proj_share = getenv("GRASS_PROJSHARE"); + if (!grass_proj_share) + G_fatal_error(_("Environment variable GRASS_PROJSHARE is not set")); + sprintf(pathname, "%s/%s", grass_proj_share, authname); + G_convert_dirseps_to_host(pathname); +#endif + + /* PROJ 4 / 5 */ + + /* the init files do not have a common structure, thus restrict to epsg + * see pj_init.c get_init_string() in PROJ 4 / 5 for a + * generic init file parser, however without descriptive name */ + if (strcmp(authname, "epsg") != 0) + G_fatal_error(_("Only epsg file is currently supported")); + + /* open the init file */ + fp = fopen(pathname, "r"); + if (!fp) { + G_fatal_error(_("Unable to open init file <%s>"), authname); + } + + code[0] = '\0'; + name[0] = '\0'; + proj_def[0] = '\0'; + /* print list of codes, names, definitions */ + for (line = 1; G_getl2(buf, sizeof(buf), fp); line++) { + int buflen, bufstart; + int i, j; + + G_strip(buf); + buflen = strlen(buf); + + if (*buf == '\0' || + (buflen >= 10 && strncmp(buf, "", 10) == 0)) { + name[0] = '\0'; + continue; + } + + /* name: could be text following '# ' */ + /* code: + * definition follows code until next '<' */ + + if (*buf == '#' && buflen > 2) { + sprintf(name, "%s", buf + 2); + continue; + } + + i = 0; + bufstart = 0; + while (i < buflen) { + + if (buf[i] == '<') { + /* end of section ? */ + if (code[0] != '\0') { + G_strip(proj_def); + /* the descriptive name may be hidden in proj_def as + * +title= + * e.g. IGNF */ + fprintf(stdout, "%s|%s|%s\n", code, name, proj_def); + code[0] = '\0'; + name[0] = '\0'; + proj_def[0] = '\0'; + } + + /* start of section ? */ + bufstart = i + 1; + j = bufstart; + while (j < buflen && buf[j] != '>') + j++; + + if (j < buflen) { + buf[j] = '\0'; + sprintf(code, "%s", buf + bufstart); + } + i = j + 1; + bufstart = i; + continue; + } + + if (buf[i] == '#') { + /* the remaining content of the line could be the name */ + bufstart = i + 1; + if (bufstart < buflen) { + sprintf(name, "%s", buf + bufstart); + G_strip(name); + } + i = buflen; + continue; + } + + if (code[0] != '\0') { + char stopchar; + int proj_len; + + /* inside a section definition */ + /* test for '<' or '#' later on in the line */ + j = bufstart; + while (j < buflen && buf[j] != '<' && buf[j] != '#') + j++; + if (j < buflen) { + stopchar = buf[j]; + buf[j] = '\0'; + proj_len = strlen(proj_def); + proj_def[proj_len] = ' '; + proj_def[proj_len + 1] = '\0'; + strcat(proj_def, buf + bufstart); + buf[j] = stopchar; + i = j; + bufstart = i; + } + else { + proj_len = strlen(proj_def); + proj_def[proj_len] = ' '; + proj_def[proj_len + 1] = '\0'; + strcat(proj_def, buf + bufstart); + i = buflen; + bufstart = i; + } + } + else + i++; + } + } + fclose(fp); +#endif +} + + diff -Nru grass-7.6.1/general/g.proj/local_proto.h grass-7.8.0/general/g.proj/local_proto.h --- grass-7.6.1/general/g.proj/local_proto.h 2019-03-19 20:04:27.000000000 +0000 +++ grass-7.8.0/general/g.proj/local_proto.h 2019-06-03 20:34:20.000000000 +0000 @@ -27,3 +27,7 @@ /* create.c */ void create_location(const char *); void modify_projinfo(); + +/* list_codes.c */ +char *get_authority_names(void); +void list_codes(char *); diff -Nru grass-7.6.1/general/g.proj/main.c grass-7.8.0/general/g.proj/main.c --- grass-7.6.1/general/g.proj/main.c 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.proj/main.c 2019-06-03 20:34:20.000000000 +0000 @@ -48,6 +48,7 @@ *ingeo, /* Input geo-referenced file readable by * GDAL or OGR */ #endif + *listcodes, /* list codes of given authority */ *datum, /* datum to add (or replace existing datum) */ *dtrans; /* index to datum transform option */ struct GModule *module; @@ -159,6 +160,14 @@ inepsg->description = _("EPSG projection code"); #endif + listcodes = G_define_option(); + listcodes->key = "list_codes"; + listcodes->type = TYPE_STRING; + listcodes->required = NO; + listcodes->options = get_authority_names(); + listcodes->guisection = _("Print"); + listcodes->description = _("List codes for given authority, e.g. EPSG, and exit"); + datum = G_define_option(); datum->key = "datum"; datum->type = TYPE_STRING; @@ -207,6 +216,12 @@ /* Initialisation & Validation */ + /* list codes for given authority */ + if (listcodes->answer) { + list_codes(listcodes->answer); + exit(EXIT_SUCCESS); + } + #ifdef HAVE_OGR /* -e implies -w */ if (esristyle->answer && !printwkt->answer) diff -Nru grass-7.6.1/general/g.proj/output.c grass-7.8.0/general/g.proj/output.c --- grass-7.6.1/general/g.proj/output.c 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/general/g.proj/output.c 2019-06-03 20:34:20.000000000 +0000 @@ -39,6 +39,8 @@ fprintf(stdout, "-PROJ_INFO-------------------------------------------------\n"); for (i = 0; i < projinfo->nitems; i++) { + if (strcmp(projinfo->key[i], "init") == 0) + continue; if (shell) fprintf(stdout, "%s=%s\n", projinfo->key[i], projinfo->value[i]); else diff -Nru grass-7.6.1/general/g.region/g.region.html grass-7.8.0/general/g.region/g.region.html --- grass-7.6.1/general/g.region/g.region.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.region/g.region.html 2019-05-18 15:50:04.000000000 +0000 @@ -471,4 +471,4 @@ U.S.Army Construction Engineering Research Laboratory -

Last changed: $Date: 2016-08-19 09:39:55 +0200 (Fri, 19 Aug 2016) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/general/g.remove/g.remove.html grass-7.8.0/general/g.remove/g.remove.html --- grass-7.6.1/general/g.remove/g.remove.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/general/g.remove/g.remove.html 2019-05-18 15:50:04.000000000 +0000 @@ -34,4 +34,4 @@ grass4u@gmail.com

-Last changed: $Date: 2014-12-19 21:06:05 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.rename/g.rename.html grass-7.8.0/general/g.rename/g.rename.html --- grass-7.6.1/general/g.rename/g.rename.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/general/g.rename/g.rename.html 2019-05-18 15:50:04.000000000 +0000 @@ -76,4 +76,4 @@ U.S.Army Construction Engineering Research Laboratory -

Last changed: $Date: 2015-01-08 19:37:47 +0100 (Thu, 08 Jan 2015) $

+

Last changed: $Date$

diff -Nru grass-7.6.1/general/g.setproj/g.setproj.html grass-7.8.0/general/g.setproj/g.setproj.html --- grass-7.6.1/general/g.setproj/g.setproj.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.setproj/g.setproj.html 2019-07-28 20:17:50.000000000 +0000 @@ -36,7 +36,7 @@

The user will be prompted for the projection name. Most projections are supported. The -PROJ.4 abbreviations for the names are +PROJ abbreviations for the names are used with two exceptions, viz. 'll', for latitude / longitude geographic co-ordinates, and 'stp', for the State Plane Co-ordinate system (used in the USA). @@ -85,7 +85,7 @@ Morten Hulden, morten at untamo.net - rewrote module and added 121 projections
Andreas Lange, andreas.lange at rhein-main.de - added prelimnary map datum support -

Last changed: $Date: 2012-03-30 13:56:21 +0200 (Fri, 30 Mar 2012) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/general/g.tempfile/g.tempfile.html grass-7.8.0/general/g.tempfile/g.tempfile.html --- grass-7.6.1/general/g.tempfile/g.tempfile.html 2019-03-19 20:04:26.000000000 +0000 +++ grass-7.8.0/general/g.tempfile/g.tempfile.html 2019-05-18 15:50:04.000000000 +0000 @@ -49,4 +49,4 @@ U.S. Army Construction Engineering Research Laboratory -

Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/general/g.version/g.version.html grass-7.8.0/general/g.version/g.version.html --- grass-7.6.1/general/g.version/g.version.html 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.version/g.version.html 2019-08-11 09:05:20.000000000 +0000 @@ -17,7 +17,7 @@

Version numbers of additional libraries -like PROJ.4, GDAL/OGR +like PROJ, GDAL/OGR or GEOS are printed by -e flag. @@ -38,7 +38,7 @@

 g.version 
 
-GRASS 7.5.svn (2017)
+GRASS 7.8.dev (2019)
 

GIS Library info

@@ -46,27 +46,27 @@
 g.version -r
 
-GRASS 7.5.svn (2017)
-libgis Revision: 70829 
-libgis Date: 2017-04-04 09:43:02 +0200 (Tue, 04 Apr 2017)
+GRASS 7.8.dev (2019)
+libgis Revision
+libgis Date
 

Full info in shell script style

 g.version -rge
 
-version=7.5.svn
-date=2017
-revision=r71702M
-build_date=2017-11-12
+version=7.8.dev
+date=2019
+revision=d4879d401
+build_date=2019-08-04
 build_platform=x86_64-pc-linux-gnu
 build_off_t_size=8
-libgis_revision=70829 
-libgis_date="2017-04-04 09:43:02 +0200 (Tue, 04 Apr 2017) "
-proj4=4.9.3
-gdal=2.1.3
-geos=3.6.1
-sqlite=3.20.1
+libgis_revision=00000
+libgis_date="?"
+proj4=5.2.0
+gdal=2.3.2
+geos=3.7.1
+sqlite=3.26.0
 

Citing GRASS GIS

@@ -86,4 +86,4 @@ Extended info by Martin Landa, Czech Technical University in Prague, Czech Republic

-Last changed: $Date: 2017-11-12 20:33:52 +0100 (Sun, 12 Nov 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/general/g.version/main.c grass-7.8.0/general/g.version/main.c --- grass-7.6.1/general/g.version/main.c 2019-03-19 20:04:29.000000000 +0000 +++ grass-7.8.0/general/g.version/main.c 2019-06-11 07:26:20.000000000 +0000 @@ -104,7 +104,7 @@ shell = G_define_flag(); shell->key = 'g'; - shell->description = _("Print info in shell script style (including SVN revision number)"); + shell->description = _("Print info in shell script style (including Git reference commit)"); shell->guisection = _("Shell"); if (G_parser(argc, argv)) @@ -113,7 +113,7 @@ if (shell->answer) { fprintf(stdout, "version=%s\n", GRASS_VERSION_NUMBER); fprintf(stdout, "date=%s\n", GRASS_VERSION_DATE); - fprintf(stdout, "revision=%s\n", GRASS_VERSION_SVN); + fprintf(stdout, "revision=%s\n", GRASS_VERSION_GIT); fprintf(stdout, "build_date=%d-%02d-%02d\n", YEAR, MONTH, DAY); fprintf(stdout, "build_platform=%s\n", ARCH); fprintf(stdout, "build_off_t_size=%lu\n", sizeof(off_t)); diff -Nru grass-7.6.1/general/g.version/Makefile grass-7.8.0/general/g.version/Makefile --- grass-7.6.1/general/g.version/Makefile 2019-03-19 20:04:30.000000000 +0000 +++ grass-7.8.0/general/g.version/Makefile 2019-06-11 07:26:20.000000000 +0000 @@ -8,7 +8,7 @@ EXTRA_CFLAGS = $(PROJINC) $(GDALCFLAGS) $(GEOSCFLAGS) $(SQLITEINCPATH) \ -DGRASS_VERSION_NUMBER=\"'$(GRASS_VERSION_NUMBER)'\" \ -DGRASS_VERSION_DATE=\"'$(GRASS_VERSION_DATE)'\" \ - -DGRASS_VERSION_SVN=\"'$(GRASS_VERSION_SVN)'\" \ + -DGRASS_VERSION_GIT=\"'$(GRASS_VERSION_GIT)'\" \ -DGRASS_VERSION_UPDATE_PKG=\"'$(GRASS_VERSION_UPDATE_PKG)'\" \ -DARCH=\"'$(ARCH)'\" diff -Nru grass-7.6.1/grasslib.dox grass-7.8.0/grasslib.dox --- grass-7.6.1/grasslib.dox 2019-03-19 20:04:47.000000000 +0000 +++ grass-7.8.0/grasslib.dox 2019-08-11 09:05:20.000000000 +0000 @@ -38,7 +38,7 @@ Note: Missing entries below still need to be documented in Doxygen format. \image html "grass7_arch.png" "GRASS 7 Architecture" @@ -51,7 +51,7 @@ - gis: \ref gislib - raster: \ref rasterlib - vector: \ref vectorlib - - Temporal GIS API: See https://grass.osgeo.org/grass76/manuals/libpython/temporal_framework.html + - Temporal GIS API: See https://grass.osgeo.org/grass78/manuals/libpython/temporal_framework.html \section libs Further libraries @@ -112,7 +112,7 @@ \subsection pythonlibs Python API - - python: See GRASS GIS Python library (https://grass.osgeo.org/grass76/manuals/libpython/) + - python: See GRASS GIS Python library (https://grass.osgeo.org/grass78/manuals/libpython/) \subsection projlibs Projection Libraries @@ -185,7 +185,7 @@ \image html "loc_struct.png" "Diagram of GRASS file structure" diff -Nru grass-7.6.1/gui/icons/grass.desktop grass-7.8.0/gui/icons/grass.desktop --- grass-7.6.1/gui/icons/grass.desktop 2019-03-19 19:57:01.000000000 +0000 +++ grass-7.8.0/gui/icons/grass.desktop 2019-08-11 09:05:20.000000000 +0000 @@ -47,8 +47,8 @@ GenericName[uk]=Геоінформаційна система GenericName[uz]=Geografik axborot tizimi Icon=grass -TryExec=/usr/bin/grass76 -Exec=grass76 +TryExec=/usr/bin/grass78 +Exec=grass78 Terminal=true Keywords=gis;spatial;geospatial;database;remote sensing;hydrology;vector;raster;visualization;maps;wms;wfs;ogc;osgeo; Categories=Education;Science;Geoscience;Geography; diff -Nru grass-7.6.1/gui/scripts/d.rast3d.py grass-7.8.0/gui/scripts/d.rast3d.py --- grass-7.6.1/gui/scripts/d.rast3d.py 2019-03-19 19:56:58.000000000 +0000 +++ grass-7.8.0/gui/scripts/d.rast3d.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # diff -Nru grass-7.6.1/gui/scripts/d.wms.py grass-7.8.0/gui/scripts/d.wms.py --- grass-7.6.1/gui/scripts/d.wms.py 2019-03-19 19:56:58.000000000 +0000 +++ grass-7.8.0/gui/scripts/d.wms.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # diff -Nru grass-7.6.1/gui/wxpython/animation/anim.py grass-7.8.0/gui/wxpython/animation/anim.py --- grass-7.6.1/gui/wxpython/animation/anim.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/anim.py 2019-06-03 20:34:20.000000000 +0000 @@ -15,8 +15,7 @@ """ import wx -from utils import Orientation, ReplayMode -from core.utils import _ +from .utils import Orientation, ReplayMode class Animation(wx.EvtHandler): diff -Nru grass-7.6.1/gui/wxpython/animation/controller.py grass-7.8.0/gui/wxpython/animation/controller.py --- grass-7.6.1/gui/wxpython/animation/controller.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/controller.py 2019-06-03 20:34:20.000000000 +0000 @@ -17,7 +17,6 @@ import wx from core.gcmd import GException, GError, GMessage -from core.utils import _ from grass.imaging import writeAvi, writeGif, writeIms, writeSwf from core.settings import UserSettings @@ -252,6 +251,7 @@ animationData=animData) dlg.CenterOnParent() if dlg.ShowModal() == wx.ID_CANCEL: + dlg.UnInit() dlg.Destroy() return dlg.Destroy() @@ -324,7 +324,6 @@ self._updateAnimations( activeIndices=indices, mapNamesDict=mapNamesDict) - wx.Yield() self._updateBitmapData() # if running: # self.PauseAnimation(False) diff -Nru grass-7.6.1/gui/wxpython/animation/data.py grass-7.8.0/gui/wxpython/animation/data.py --- grass-7.6.1/gui/wxpython/animation/data.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/data.py 2019-06-03 20:34:20.000000000 +0000 @@ -22,7 +22,6 @@ from grass.script.utils import parse_key_val from grass.script import core as gcore -from core.utils import _ from core.gcmd import GException from animation.nviztask import NvizTask from animation.utils import validateMapNames, getRegisteredMaps, \ diff -Nru grass-7.6.1/gui/wxpython/animation/dialogs.py grass-7.8.0/gui/wxpython/animation/dialogs.py --- grass-7.6.1/gui/wxpython/animation/dialogs.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/dialogs.py 2019-09-04 13:16:01.000000000 +0000 @@ -29,6 +29,10 @@ import wx.lib.filebrowsebutton as filebrowse import wx.lib.scrolledpanel as SP import wx.lib.colourselect as csel +try: + from wx.adv import HyperlinkCtrl +except ImportError: + from wx import HyperlinkCtrl from core.gcmd import GMessage, GError, GException from core import globalvar @@ -36,10 +40,10 @@ from gui_core.preferences import PreferencesBaseDialog from gui_core.forms import GUI from core.settings import UserSettings -from core.utils import _ from gui_core.gselect import Select from gui_core.widgets import FloatValidator -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, CheckBox, TextCtrl, Button, \ + BitmapButton, StaticText, StaticBox, Choice, RadioButton, EmptyImage from animation.utils import TemporalMode, getRegisteredMaps, getNameAndLayer, getCpuCount from animation.data import AnimationData, AnimLayer @@ -99,14 +103,14 @@ # # simple mode # - self.nontemporalBox = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=' %s ' % _("Simple mode")) + self.nontemporalBox = StaticBox(parent=self, id=wx.ID_ANY, + label=' %s ' % _("Simple mode")) box = wx.StaticBoxSizer(self.nontemporalBox, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=5, vgap=5) - labelDuration = wx.StaticText( + labelDuration = StaticText( self, id=wx.ID_ANY, label=_("Frame duration:")) - labelUnits = wx.StaticText(self, id=wx.ID_ANY, label=_("ms")) + labelUnits = StaticText(self, id=wx.ID_ANY, label=_("ms")) self.spinDuration = SpinCtrl( self, id=wx.ID_ANY, @@ -138,16 +142,16 @@ # # temporal mode # - self.temporalBox = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=' %s ' % _("Temporal mode")) + self.temporalBox = StaticBox(parent=self, id=wx.ID_ANY, + label=' %s ' % _("Temporal mode")) box = wx.StaticBoxSizer(self.temporalBox, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=5, vgap=5) - labelTimeUnit = wx.StaticText( + labelTimeUnit = StaticText( self, id=wx.ID_ANY, label=_("Time unit:")) - labelDuration = wx.StaticText( + labelDuration = StaticText( self, id=wx.ID_ANY, label=_("Duration of time unit:")) - labelUnits = wx.StaticText(self, id=wx.ID_ANY, label=_("ms")) + labelUnits = StaticText(self, id=wx.ID_ANY, label=_("ms")) self.spinDurationTemp = SpinCtrl( self, id=wx.ID_ANY, min=self.minimumDuration, max=10000, initial=self.defaultSpeed) @@ -183,9 +187,9 @@ flag=wx.EXPAND | wx.ALL, border=5) - self.btnOk = wx.Button(self, wx.ID_OK) - self.btnApply = wx.Button(self, wx.ID_APPLY) - self.btnCancel = wx.Button(self, wx.ID_CANCEL) + self.btnOk = Button(self, wx.ID_OK) + self.btnApply = Button(self, wx.ID_APPLY) + self.btnCancel = Button(self, wx.ID_CANCEL) self.btnOk.SetDefault() self.btnOk.Bind(wx.EVT_BUTTON, self.OnOk) @@ -352,8 +356,8 @@ border=3) # buttons - self.btnOk = wx.Button(self, wx.ID_OK) - self.btnCancel = wx.Button(self, wx.ID_CANCEL) + self.btnOk = Button(self, wx.ID_OK) + self.btnCancel = Button(self, wx.ID_CANCEL) self.btnOk.SetDefault() self.btnOk.Bind(wx.EVT_BUTTON, self.OnOk) # button sizer @@ -381,10 +385,10 @@ _("bottom right")]) self.windowChoice.SetSelection(self.animationData.windowIndex) - self.nameCtrl = wx.TextCtrl( + self.nameCtrl = TextCtrl( panel, id=wx.ID_ANY, value=self.animationData.name) - self.nDChoice = wx.Choice(panel, id=wx.ID_ANY) + self.nDChoice = Choice(panel, id=wx.ID_ANY) mode = self.animationData.viewMode index = 0 for i, (viewMode, viewModeName) in enumerate( @@ -394,19 +398,19 @@ index = i self.nDChoice.SetSelection(index) - self.nDChoice.SetToolTipString(_("Select 2D or 3D view")) + self.nDChoice.SetToolTip(_("Select 2D or 3D view")) self.nDChoice.Bind(wx.EVT_CHOICE, self.OnViewMode) gridSizer = wx.FlexGridSizer(cols=2, hgap=5, vgap=5) gridSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Name:")), flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add(self.nameCtrl, proportion=1, flag=wx.EXPAND) gridSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Window position:")), @@ -416,7 +420,7 @@ proportion=1, flag=wx.ALIGN_RIGHT) gridSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("View mode:")), @@ -432,7 +436,7 @@ label = _( "For 3D animation, please select only one space-time dataset\n" "or one series of map layers.") - self.warning3DLayers = wx.StaticText(panel, label=label) + self.warning3DLayers = StaticText(panel, label=label) self.warning3DLayers.SetForegroundColour( wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT)) mainSizer.Add( @@ -475,7 +479,7 @@ self.legend = wx.CheckBox(panel, label=_("Show raster legend")) self.legend.SetValue(bool(self.animationData.legendCmd)) - self.legendBtn = wx.Button(panel, label=_("Set options")) + self.legendBtn = Button(panel, label=_("Set options")) self.legend.Bind(wx.EVT_CHECKBOX, self.OnLegend) self.legendBtn.Bind(wx.EVT_BUTTON, self.OnLegendProperties) @@ -495,8 +499,8 @@ def _create3DPanel(self, parent): panel = wx.Panel(parent, id=wx.ID_ANY) - dataStBox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=' %s ' % _("3D view parameters")) + dataStBox = StaticBox(parent=panel, id=wx.ID_ANY, + label=' %s ' % _("3D view parameters")) dataBoxSizer = wx.StaticBoxSizer(dataStBox, wx.VERTICAL) # workspace file @@ -514,7 +518,7 @@ fileMask="GRASS Workspace File (*.gxw)|*.gxw") if self.animationData.workspaceFile: self.fileSelector.SetValue(self.animationData.workspaceFile) - self.paramLabel = wx.StaticText( + self.paramLabel = StaticText( panel, wx.ID_ANY, label=_("Parameter for animation:")) self.paramChoice = wx.Choice( panel, id=wx.ID_ANY, choices=self.animationData.nvizParameters) @@ -552,13 +556,13 @@ panel = wx.Panel(parent=parent) mainSizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=panel, label=" %s " % _("Animate region change (2D view only)")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) - gridSizer.Add(wx.StaticText(panel, label=_("Start region:")), + gridSizer.Add(StaticText(panel, label=_("Start region:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) self.stRegion = Select(parent=panel, type='region', size=(200, -1)) if self.animationData.startRegion: @@ -567,25 +571,25 @@ self.stRegion, pos=(0, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND) - self.endRegRadio = wx.RadioButton( + self.endRegRadio = RadioButton( panel, label=_("End region:"), style=wx.RB_GROUP) gridSizer.Add(self.endRegRadio, pos=(1, 0), flag=wx.EXPAND) self.endRegion = Select(parent=panel, type='region', size=(200, -1)) gridSizer.Add( self.endRegion, pos=(1, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND) - self.zoomRadio = wx.RadioButton(panel, label=_("Zoom value:")) - self.zoomRadio.SetToolTipString(_("N-S/E-W distances in map units used to " - "gradually reduce region.")) + self.zoomRadio = RadioButton(panel, label=_("Zoom value:")) + self.zoomRadio.SetToolTip(_("N-S/E-W distances in map units used to " + "gradually reduce region.")) gridSizer.Add(self.zoomRadio, pos=(2, 0), flag=wx.EXPAND) zoomSizer = wx.BoxSizer(wx.HORIZONTAL) - self.zoomNS = wx.TextCtrl(panel, validator=FloatValidator()) - self.zoomEW = wx.TextCtrl(panel, validator=FloatValidator()) - zoomSizer.Add(wx.StaticText(panel, label=_("N-S:")), proportion=0, + self.zoomNS = TextCtrl(panel, validator=FloatValidator()) + self.zoomEW = TextCtrl(panel, validator=FloatValidator()) + zoomSizer.Add(StaticText(panel, label=_("N-S:")), proportion=0, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT, border=3) zoomSizer.Add(self.zoomNS, proportion=1, flag=wx.LEFT, border=3) - zoomSizer.Add(wx.StaticText(panel, label=_("E-W:")), proportion=0, + zoomSizer.Add(StaticText(panel, label=_("E-W:")), proportion=0, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT, border=3) zoomSizer.Add(self.zoomEW, proportion=1, flag=wx.LEFT, border=3) gridSizer.Add( @@ -735,9 +739,13 @@ self.animationData.endRegion = None self.animationData.zoomRegionValue = None + def UnInit(self): + self.simpleLmgr.UnInit() + def OnOk(self, event): try: self._update() + self.UnInit() self.EndModal(wx.ID_OK) except (GException, ValueError, IOError) as e: GError( @@ -761,7 +769,7 @@ def _layout(self): mainSizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % @@ -776,11 +784,11 @@ style=wx.LB_SINGLE | wx.LB_NEEDED_SB) self.listbox.Bind(wx.EVT_LISTBOX_DCLICK, self.OnEdit) - self.addButton = wx.Button(self, id=wx.ID_ANY, label=_("Add")) + self.addButton = Button(self, id=wx.ID_ANY, label=_("Add")) self.addButton.Bind(wx.EVT_BUTTON, self.OnAdd) - self.editButton = wx.Button(self, id=wx.ID_ANY, label=_("Edit")) + self.editButton = Button(self, id=wx.ID_ANY, label=_("Edit")) self.editButton.Bind(wx.EVT_BUTTON, self.OnEdit) - self.removeButton = wx.Button(self, id=wx.ID_ANY, label=_("Remove")) + self.removeButton = Button(self, id=wx.ID_ANY, label=_("Remove")) self.removeButton.Bind(wx.EVT_BUTTON, self.OnRemove) self._updateListBox() @@ -802,8 +810,8 @@ flag=wx.EXPAND | wx.ALL, border=5) # buttons - self.btnOk = wx.Button(self, wx.ID_OK) - self.btnCancel = wx.Button(self, wx.ID_CANCEL) + self.btnOk = Button(self, wx.ID_OK) + self.btnCancel = Button(self, wx.ID_CANCEL) self.btnOk.SetDefault() self.btnOk.Bind(wx.EVT_BUTTON, self.OnOk) # button sizer @@ -847,6 +855,7 @@ dlg = InputDialog(parent=self, mode='add', animationData=animData) dlg.CenterOnParent() if dlg.ShowModal() == wx.ID_CANCEL: + dlg.UnInit() dlg.Destroy() return dlg.Destroy() @@ -863,6 +872,7 @@ dlg = InputDialog(parent=self, mode='edit', animationData=animData) dlg.CenterOnParent() if dlg.ShowModal() == wx.ID_CANCEL: + dlg.UnInit() dlg.Destroy() return dlg.Destroy() @@ -933,9 +943,9 @@ mainSizer.Add(notebook, proportion=0, flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=5) - self.btnExport = wx.Button(self, wx.ID_OK) + self.btnExport = Button(self, wx.ID_OK) self.btnExport.SetLabel(_("Export")) - self.btnCancel = wx.Button(self, wx.ID_CANCEL) + self.btnCancel = Button(self, wx.ID_CANCEL) self.btnExport.SetDefault() self.btnExport.Bind(wx.EVT_BUTTON, self.OnExport) @@ -993,7 +1003,7 @@ for buttonName, buttonLabel in zip(buttonNames, buttonLabels): if buttonName == 'time' and self.temporal == TemporalMode.NONTEMPORAL: continue - btn = wx.Button( + btn = Button( panel, id=wx.ID_ANY, name=buttonName, @@ -1012,7 +1022,7 @@ flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, border=0) i += 1 - removeButton = wx.Button(panel, id=wx.ID_ANY, label=_("Remove")) + removeButton = Button(panel, id=wx.ID_ANY, label=_("Remove")) removeButton.Bind(wx.EVT_BUTTON, self.OnRemove) gridBagSizer.Add( removeButton, @@ -1034,7 +1044,7 @@ else: label = _("Add image or text decoration by one of the buttons above.") - label = wx.StaticText(panel, id=wx.ID_ANY, label=label) + label = StaticText(panel, id=wx.ID_ANY, label=label) label.Wrap(400) self.informBox.Add( label, @@ -1050,18 +1060,18 @@ # font self.fontBox = wx.BoxSizer(wx.HORIZONTAL) self.fontBox.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Font settings:")), proportion=0, flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, border=5) - self.sampleLabel = wx.StaticText( + self.sampleLabel = StaticText( panel, id=wx.ID_ANY, label=_("Sample text")) self.fontBox.Add(self.sampleLabel, proportion=1, flag=wx.ALIGN_CENTER | wx.RIGHT | wx.LEFT, border=5) - fontButton = wx.Button(panel, id=wx.ID_ANY, label=_("Set font")) + fontButton = Button(panel, id=wx.ID_ANY, label=_("Set font")) fontButton.Bind(wx.EVT_BUTTON, self.OnFont) self.fontBox.Add( fontButton, @@ -1075,7 +1085,7 @@ # image self.imageBox = wx.BoxSizer(wx.HORIZONTAL) - filetype, ltype = GetImageHandlers(wx.EmptyImage(10, 10)) + filetype, ltype = GetImageHandlers(EmptyImage(10, 10)) self.browse = filebrowse.FileBrowseButton( parent=panel, id=wx.ID_ANY, fileMask=filetype, labelText=_("Image file:"), @@ -1092,14 +1102,14 @@ # text self.textBox = wx.BoxSizer(wx.HORIZONTAL) self.textBox.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Text:")), proportion=0, flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, border=5) - self.textCtrl = wx.TextCtrl(panel, id=wx.ID_ANY) + self.textCtrl = TextCtrl(panel, id=wx.ID_ANY) self.textCtrl.Bind(wx.EVT_TEXT, self.OnText) self.textBox.Add(self.textCtrl, proportion=1, flag=wx.EXPAND) self.hidevbox.Add(self.textBox, proportion=0, flag=wx.EXPAND) @@ -1114,7 +1124,7 @@ def _positionWidget(self, panel): grid = wx.GridBagSizer(vgap=5, hgap=5) - label = wx.StaticText( + label = StaticText( panel, id=wx.ID_ANY, label=_( "Placement as percentage of" " screen coordinates (X: 0, Y: 0 is top left):")) @@ -1137,9 +1147,9 @@ temp)) grid.Add(label, pos=(0, 0), span=(1, 4), flag=wx.EXPAND) - grid.Add(wx.StaticText(panel, id=wx.ID_ANY, label=_("X:")), pos=(1, 0), + grid.Add(StaticText(panel, id=wx.ID_ANY, label=_("X:")), pos=(1, 0), flag=wx.ALIGN_CENTER_VERTICAL) - grid.Add(wx.StaticText(panel, id=wx.ID_ANY, label=_("Y:")), pos=(1, 2), + grid.Add(StaticText(panel, id=wx.ID_ANY, label=_("Y:")), pos=(1, 2), flag=wx.ALIGN_CENTER_VERTICAL) grid.Add(self.spinX, pos=(1, 1)) grid.Add(self.spinY, pos=(1, 3)) @@ -1159,7 +1169,7 @@ lambda event: self.ChangeFormat( event.GetSelection())) hSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Export to:")), @@ -1186,11 +1196,11 @@ # panel for image sequence imSeqPanel = wx.Panel(parent=panel, id=wx.ID_ANY) - prefixLabel = wx.StaticText( + prefixLabel = StaticText( imSeqPanel, id=wx.ID_ANY, label=_("File prefix:")) - self.prefixCtrl = wx.TextCtrl( + self.prefixCtrl = TextCtrl( imSeqPanel, id=wx.ID_ANY, value=_("animation_")) - formatLabel = wx.StaticText( + formatLabel = StaticText( imSeqPanel, id=wx.ID_ANY, label=_("File format:")) imageTypes = ['PNG', 'JPEG', 'GIF', 'TIFF', 'PPM', 'BMP'] self.imSeqFormatChoice = wx.Choice(imSeqPanel, choices=imageTypes) @@ -1281,7 +1291,7 @@ warning = _( "Program 'ffmpeg' was not found.\nPlease install it first " "and make sure\nit's in the PATH variable.") - warningLabel = wx.StaticText(parent=aviPanel, label=warning) + warningLabel = StaticText(parent=aviPanel, label=warning) warningLabel.SetForegroundColour(wx.RED) self.aviBrowse = filebrowse.FileBrowseButton( parent=aviPanel, @@ -1292,16 +1302,16 @@ buttonText=_("Browse"), startDirectory=os.getcwd(), fileMode=wx.FD_SAVE) - encodingLabel = wx.StaticText( + encodingLabel = StaticText( parent=aviPanel, id=wx.ID_ANY, label=_("Video codec:")) - self.encodingText = wx.TextCtrl( + self.encodingText = TextCtrl( parent=aviPanel, id=wx.ID_ANY, value='mpeg4') - optionsLabel = wx.StaticText( + optionsLabel = StaticText( parent=aviPanel, label=_("Additional options:")) - self.optionsText = wx.TextCtrl(parent=aviPanel) - self.optionsText.SetToolTipString( + self.optionsText = TextCtrl(parent=aviPanel) + self.optionsText.SetToolTip( _( "Consider adding '-sameq' or '-qscale 1' " "if not satisfied with video quality. " @@ -1337,7 +1347,7 @@ fpsSizer = wx.BoxSizer(wx.HORIZONTAL) fps = 1000 / self.timeTick fpsSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Current frame rate: %.2f fps") % @@ -1358,7 +1368,7 @@ def ChangeFormat(self, index): for i, panel in enumerate(self.formatPanels): - self.formatPanelSizer.Show(item=panel, show=(i == index)) + self.formatPanelSizer.Show(window=panel, show=(i == index)) self.formatPanelSizer.Layout() def OnFont(self, event): @@ -1635,7 +1645,7 @@ else: bitmap = wx.ArtProvider.GetBitmap( id=wx.ART_MISSING_IMAGE, client=wx.ART_TOOLBAR) - self.addManyMapsButton = wx.BitmapButton(self, bitmap=bitmap) + self.addManyMapsButton = BitmapButton(self, bitmap=bitmap) self.addManyMapsButton.Bind(wx.EVT_BUTTON, self._onAddMaps) types = [('raster', _("Multiple raster maps")), @@ -1653,10 +1663,10 @@ for type_, text in types: self.tchoice.Append(text, clientData=type_) - self.editBtn = wx.Button(parent=self, label='Set properties') + self.editBtn = Button(parent=self, label='Set properties') - self.okBtn = wx.Button(parent=self, id=wx.ID_OK) - self.cancelBtn = wx.Button(parent=self, id=wx.ID_CANCEL) + self.okBtn = Button(parent=self, id=wx.ID_OK) + self.cancelBtn = Button(parent=self, id=wx.ID_CANCEL) self.okBtn.Bind(wx.EVT_BUTTON, self._onOK) self.editBtn.Bind(wx.EVT_BUTTON, self._onProperties) @@ -1682,7 +1692,7 @@ bodySizer = wx.BoxSizer(wx.VERTICAL) typeSizer = wx.BoxSizer(wx.HORIZONTAL) selectSizer = wx.BoxSizer(wx.HORIZONTAL) - typeSizer.Add(wx.StaticText(self, label=_("Input data type:")), + typeSizer.Add(StaticText(self, label=_("Input data type:")), flag=wx.ALIGN_CENTER_VERTICAL) typeSizer.AddStretchSpacer() typeSizer.Add(self.tchoice) @@ -1862,7 +1872,7 @@ row = 0 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, label=_("Background color:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, @@ -1883,7 +1893,7 @@ row += 1 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, label=_("Number of parallel processes:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, @@ -1912,7 +1922,7 @@ row += 1 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, label=_("Text foreground color:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, @@ -1933,7 +1943,7 @@ row += 1 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, label=_("Text background color:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, @@ -1975,7 +1985,7 @@ row = 0 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, label=_("Absolute time format:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, @@ -1987,7 +1997,7 @@ self.tempFormat.SetValue(self._initFormat) self.winId['animation:temporal:format'] = self.tempFormat.GetId() gridSizer.Add(self.tempFormat, pos=(row, 1), flag=wx.ALIGN_RIGHT) - self.infoTimeLabel = wx.StaticText(parent=panel) + self.infoTimeLabel = StaticText(parent=panel) self.tempFormat.Bind( wx.EVT_COMBOBOX, lambda evt: self._setTimeFormat( @@ -2006,7 +2016,7 @@ self._setTimeFormat(self.tempFormat.GetValue()) row += 1 - link = wx.HyperlinkCtrl( + link = HyperlinkCtrl( panel, id=wx.ID_ANY, label=_("Learn more about formatting options"), url="http://docs.python.org/2/library/datetime.html#" @@ -2021,9 +2031,9 @@ flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT) row += 2 - noDataCheck = wx.CheckBox( + noDataCheck = CheckBox( panel, label=_("Display instances with no data")) - noDataCheck.SetToolTipString( + noDataCheck.SetToolTip( _( "When animating instant-based data which have irregular timestamps " "you can display 'no data frame' (checked option) or " diff -Nru grass-7.6.1/gui/wxpython/animation/frame.py grass-7.8.0/gui/wxpython/animation/frame.py --- grass-7.6.1/gui/wxpython/animation/frame.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -22,13 +22,14 @@ import wx import wx.aui import tempfile +import six import grass.script as gcore import grass.temporal as tgis from core import globalvar from gui_core.widgets import IntegerValidator +from gui_core.wrap import StaticText, TextCtrl from core.gcmd import RunCommand -from core.utils import _ from animation.mapwindow import AnimationWindow from animation.provider import BitmapProvider, BitmapPool, \ @@ -136,7 +137,7 @@ Name('animPanel').CentrePane().CaptionVisible(False).PaneBorder(False). Floatable(False).BestSize((-1, -1)). CloseButton(False).DestroyOnClose(True).Layer(0)) - for name, slider in self.animationSliders.iteritems(): + for name, slider in six.iteritems(self.animationSliders): self._mgr.AddPane( slider, wx.aui.AuiPaneInfo().PaneBorder(False).Name( @@ -328,6 +329,7 @@ if self.controller.timer.IsRunning(): self.controller.timer.Stop() CleanUp(TMP_DIR)() + self._mgr.UnInit() self.Destroy() def __del__(self): @@ -383,11 +385,11 @@ def __init__(self, parent): wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY) - self.label1 = wx.StaticText(self, id=wx.ID_ANY) + self.label1 = StaticText(self, id=wx.ID_ANY) self.slider = wx.Slider(self, id=wx.ID_ANY, style=wx.SL_HORIZONTAL) - self.indexField = wx.TextCtrl(self, id=wx.ID_ANY, size=(40, -1), - style=wx.TE_PROCESS_ENTER | wx.TE_RIGHT, - validator=IntegerValidator()) + self.indexField = TextCtrl(self, id=wx.ID_ANY, size=(40, -1), + style=wx.TE_PROCESS_ENTER | wx.TE_RIGHT, + validator=IntegerValidator()) self.callbackSliderChanging = None self.callbackSliderChanged = None @@ -512,8 +514,8 @@ def __init__(self, parent): AnimationSliderBase.__init__(self, parent) self.timeLabels = [] - self.label2 = wx.StaticText(self, id=wx.ID_ANY) - self.label3 = wx.StaticText(self, id=wx.ID_ANY) + self.label2 = StaticText(self, id=wx.ID_ANY) + self.label3 = StaticText(self, id=wx.ID_ANY) self.label2Length = 0 self.temporalType = TemporalType.RELATIVE diff -Nru grass-7.6.1/gui/wxpython/animation/g.gui.animation.html grass-7.8.0/gui/wxpython/animation/g.gui.animation.html --- grass-7.6.1/gui/wxpython/animation/g.gui.animation.html 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/g.gui.animation.html 2019-05-18 15:50:04.000000000 +0000 @@ -101,4 +101,4 @@ Czech Technical University in Prague, Czech Republic

-$Date: 2017-08-21 18:59:22 +0200 (Mon, 21 Aug 2017) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/animation/g.gui.animation.py grass-7.8.0/gui/wxpython/animation/g.gui.animation.py --- grass-7.6.1/gui/wxpython/animation/g.gui.animation.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/g.gui.animation.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: Animation @@ -66,7 +66,6 @@ set_gui_path() from core.globalvar import CheckWxVersion - from core.utils import _ from core.giface import StandaloneGrassInterface from core.layerlist import LayerList from animation.frame import AnimationFrame, MAX_COUNT diff -Nru grass-7.6.1/gui/wxpython/animation/mapwindow.py grass-7.8.0/gui/wxpython/animation/mapwindow.py --- grass-7.6.1/gui/wxpython/animation/mapwindow.py 2019-03-19 19:57:12.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/mapwindow.py 2019-06-03 20:34:20.000000000 +0000 @@ -17,8 +17,8 @@ import wx from core.debug import Debug -from gui_core.wrap import PseudoDC, EmptyBitmap -from utils import ComputeScaledRect +from gui_core.wrap import PseudoDC, EmptyBitmap, Rect +from .utils import ComputeScaledRect class BufferedWindow(wx.Window): @@ -44,8 +44,8 @@ wx.Window.__init__(self, *args, **kwargs) Debug.msg(2, "BufferedWindow.__init__()") - wx.EVT_PAINT(self, self.OnPaint) - wx.EVT_SIZE(self, self.OnSize) + self.Bind(wx.EVT_PAINT, self.OnPaint) + self.Bind(wx.EVT_SIZE, self.OnSize) # OnSize called to make sure the buffer is initialized. # This might result in OnSize getting called twice on some # platforms at initialization, but little harm done. @@ -177,7 +177,7 @@ self._pdc.BeginDrawing() self._pdc.SetId(1) self._pdc.DrawBitmap(bmp=self._overlay, x=x, y=y) - self._pdc.SetIdBounds(1, wx.Rect(x, y, self._overlay.GetWidth(), + self._pdc.SetIdBounds(1, Rect(x, y, self._overlay.GetWidth(), self._overlay.GetHeight())) self._pdc.EndDrawing() diff -Nru grass-7.6.1/gui/wxpython/animation/nviztask.py grass-7.8.0/gui/wxpython/animation/nviztask.py --- grass-7.6.1/gui/wxpython/animation/nviztask.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/nviztask.py 2019-06-03 20:34:20.000000000 +0000 @@ -24,7 +24,7 @@ from core.workspace import ProcessWorkspaceFile from core.gcmd import RunCommand, GException -from core.utils import GetLayerNameFromCmd, _ +from core.utils import GetLayerNameFromCmd from grass.script import task as gtask from core.settings import UserSettings diff -Nru grass-7.6.1/gui/wxpython/animation/provider.py grass-7.8.0/gui/wxpython/animation/provider.py --- grass-7.6.1/gui/wxpython/animation/provider.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/provider.py 2019-09-04 13:16:01.000000000 +0000 @@ -29,9 +29,10 @@ from core.gcmd import RunCommand, GException from core.settings import UserSettings from core.debug import Debug -from core.utils import _, autoCropImageFromFile +from core.utils import autoCropImageFromFile from animation.utils import HashCmd, HashCmds, GetFileFromCmd, GetFileFromCmds +from gui_core.wrap import EmptyBitmap, BitmapFromImage import grass.script.core as gcore from grass.script.task import cmdlist_to_tuple @@ -307,7 +308,7 @@ cmdTuple[0], **cmdTuple[1]) if returncode == 0: - return wx.BitmapFromImage(autoCropImageFromFile(filename)) + return BitmapFromImage(autoCropImageFromFile(filename)) else: os.remove(filename) raise GException(messages) @@ -518,7 +519,7 @@ self._bitmapPool[ HashCmds( cmd_lists[i][0], - cmd_lists[i][1])] = wx.BitmapFromImage( + cmd_lists[i][1])] = BitmapFromImage( wx.Image(filename)) os.remove(filename) proc_count = 0 @@ -802,7 +803,7 @@ """ Debug.msg(4, "createNoDataBitmap: w={w}, h={h}, text={t}".format( w=imageWidth, h=imageHeight, t=text)) - bitmap = wx.EmptyBitmap(imageWidth, imageHeight) + bitmap = EmptyBitmap(imageWidth, imageHeight) dc = wx.MemoryDC() dc.SelectObject(bitmap) dc.Clear() diff -Nru grass-7.6.1/gui/wxpython/animation/temporal_manager.py grass-7.8.0/gui/wxpython/animation/temporal_manager.py --- grass-7.6.1/gui/wxpython/animation/temporal_manager.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/temporal_manager.py 2019-06-03 20:34:20.000000000 +0000 @@ -25,7 +25,6 @@ import grass.script as grass import grass.temporal as tgis from core.gcmd import GException -from core.utils import _ from core.settings import UserSettings from animation.utils import validateTimeseriesName, TemporalType diff -Nru grass-7.6.1/gui/wxpython/animation/toolbars.py grass-7.8.0/gui/wxpython/animation/toolbars.py --- grass-7.6.1/gui/wxpython/animation/toolbars.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,7 +20,6 @@ import wx from gui_core.toolbars import BaseToolbar, BaseIcons from icons.icon import MetaIcon -from core.utils import _ from gui_core.simplelmgr import SimpleLmgrToolbar from animation.anim import ReplayMode diff -Nru grass-7.6.1/gui/wxpython/animation/utils.py grass-7.8.0/gui/wxpython/animation/utils.py --- grass-7.6.1/gui/wxpython/animation/utils.py 2019-03-19 19:57:12.000000000 +0000 +++ grass-7.8.0/gui/wxpython/animation/utils.py 2019-09-04 13:16:01.000000000 +0000 @@ -20,6 +20,7 @@ import os import wx import hashlib +import six from multiprocessing import cpu_count try: from PIL import Image @@ -29,9 +30,10 @@ import grass.temporal as tgis import grass.script as grass +from grass.script.utils import encode +from gui_core.wrap import EmptyBitmap from core.gcmd import GException -from core.utils import _ class TemporalMode: @@ -97,7 +99,7 @@ raise GException(_("Map <%s> not found.") % name) else: found = False - for mapset, mapNames in mapDict.iteritems(): + for mapset, mapNames in six.iteritems(mapDict): if name in mapNames: found = True newNames.append(name + "@" + mapset) @@ -245,10 +247,10 @@ def RenderText(text, font, bgcolor, fgcolor): """Renderes text with given font to bitmap.""" - dc = wx.MemoryDC(wx.EmptyBitmap(20, 20)) + dc = wx.MemoryDC(EmptyBitmap(20, 20)) dc.SetFont(font) w, h = dc.GetTextExtent(text) - bmp = wx.EmptyBitmap(w + 2, h + 2) + bmp = EmptyBitmap(w + 2, h + 2) dc.SelectObject(bmp) dc.SetBackgroundMode(wx.SOLID) dc.SetTextBackground(wx.Colour(*bgcolor)) @@ -263,13 +265,8 @@ def WxImageToPil(image): """Converts wx.Image to PIL image""" pilImage = Image.new('RGB', (image.GetWidth(), image.GetHeight())) - getattr( - pilImage, - "frombytes", - getattr( - pilImage, - "fromstring"))( - image.GetData()) + getattr(pilImage, "frombytes", getattr(pilImage, "fromstring"))( + bytes(image.GetData())) return pilImage @@ -278,7 +275,7 @@ name = '_'.join(cmd) if region: name += str(sorted(region.items())) - return hashlib.sha1(name).hexdigest() + return hashlib.sha1(encode(name)).hexdigest() def HashCmds(cmds, region): @@ -286,7 +283,7 @@ name = ';'.join([item for sublist in cmds for item in sublist]) if region: name += str(sorted(region.items())) - return hashlib.sha1(name).hexdigest() + return hashlib.sha1(encode(name)).hexdigest() def GetFileFromCmd(dirname, cmd, region, extension='ppm'): @@ -338,7 +335,7 @@ else: cmdsForComposition.append([layer.cmd] * count) - return zip(*cmdsForComposition) + return list(zip(*cmdsForComposition)) def sampleCmdMatrixAndCreateNames(cmdMatrix, sampledSeries, regions): diff -Nru grass-7.6.1/gui/wxpython/core/gcmd.py grass-7.8.0/gui/wxpython/core/gcmd.py --- grass-7.6.1/gui/wxpython/core/gcmd.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/gcmd.py 2019-06-03 20:34:20.000000000 +0000 @@ -35,36 +35,26 @@ import traceback import locale import subprocess -if sys.platform == 'win32': +from threading import Thread +import wx + +is_mswindows = sys.platform == 'win32' +if is_mswindows: from win32file import ReadFile, WriteFile from win32pipe import PeekNamedPipe import msvcrt else: import select import fcntl -from threading import Thread -import wx +from core.debug import Debug +from core.globalvar import SCT_EXT from grass.script import core as grass +from grass.script.utils import decode, encode -from core import globalvar -from core.debug import Debug - -# cannot import from the core.utils module to avoid cross dependencies -try: - # intended to be used also outside this module - import gettext - _ = gettext.translation( - 'grasswxpy', - os.path.join( - os.getenv("GISBASE"), - 'locale')).ugettext -except IOError: - # using no translation silently - def null_gettext(string): - return string - _ = null_gettext +if sys.version_info.major == 2: + bytes = str def DecodeString(string): @@ -77,10 +67,9 @@ if not string: return string - if _enc: + if _enc and isinstance(string, bytes): Debug.msg(5, "DecodeString(): enc=%s" % _enc) return string.decode(_enc) - return string @@ -93,11 +82,9 @@ """ if not string: return string - if _enc: Debug.msg(5, "EncodeString(): enc=%s" % _enc) return string.encode(_enc) - return string @@ -174,8 +161,9 @@ """Subclass subprocess.Popen""" def __init__(self, args, **kwargs): - if subprocess.mswindows: - args = map(EncodeString, args) + if is_mswindows: + # encoding not needed for Python3 + # args = list(map(EncodeString, args)) # The Windows shell (cmd.exe) requires some special characters to # be escaped by preceding them with 3 carets (^^^). cmd.exe /? @@ -230,7 +218,7 @@ def kill(self): """Try to kill running process""" - if subprocess.mswindows: + if is_mswindows: import win32api handle = win32api.OpenProcess(1, 0, self.pid) return (0 != win32api.TerminateProcess(handle, 0)) @@ -245,13 +233,14 @@ if not self.stdin: return None + import pywintypes try: x = msvcrt.get_osfhandle(self.stdin.fileno()) (errCode, written) = WriteFile(x, input) except ValueError: return self._close('stdin') - except (subprocess.pywintypes.error, Exception) as why: - if why[0] in (109, errno.ESHUTDOWN): + except (pywintypes.error, Exception) as why: + if why.winerror in (109, errno.ESHUTDOWN): return self._close('stdin') raise @@ -262,6 +251,7 @@ if conn is None: return None + import pywintypes try: x = msvcrt.get_osfhandle(conn.fileno()) (read, nAvail, nMessage) = PeekNamedPipe(x, 0) @@ -271,8 +261,8 @@ (errCode, read) = ReadFile(x, nAvail, None) except ValueError: return self._close(which) - except (subprocess.pywintypes.error, Exception) as why: - if why[0] in (109, errno.ESHUTDOWN): + except (pywintypes.error, Exception) as why: + if why.winerror in (109, errno.ESHUTDOWN): return self._close(which) raise @@ -342,7 +332,7 @@ else: break elif r: - y.append(r) + y.append(decode(r)) else: time.sleep(max((x - time.time()) / tr, 0)) return ''.join(y) @@ -585,7 +575,7 @@ # changing from one chdir to get_real_command function args = self.cmd if sys.platform == 'win32': - if os.path.splitext(args[0])[1] == globalvar.SCT_EXT: + if os.path.splitext(args[0])[1] == SCT_EXT: args[0] = args[0][:-3] # using Python executable to run the module if it is a script # expecting at least module name at first position @@ -620,14 +610,14 @@ if self.stdout: # make module stdout/stderr non-blocking out_fileno = self.module.stdout.fileno() - if not subprocess.mswindows: + if not is_mswindows: flags = fcntl.fcntl(out_fileno, fcntl.F_GETFL) fcntl.fcntl(out_fileno, fcntl.F_SETFL, flags | os.O_NONBLOCK) if self.stderr: # make module stdout/stderr non-blocking out_fileno = self.module.stderr.fileno() - if not subprocess.mswindows: + if not is_mswindows: flags = fcntl.fcntl(out_fileno, fcntl.F_GETFL) fcntl.fcntl(out_fileno, fcntl.F_SETFL, flags | os.O_NONBLOCK) @@ -725,11 +715,11 @@ ps = grass.start_command(prog, flags, overwrite, quiet, verbose, **kwargs) if stdin: - ps.stdin.write(stdin) + ps.stdin.write(encode(stdin)) ps.stdin.close() ps.stdin = None - stdout, stderr = map(DecodeString, ps.communicate()) + stdout, stderr = list(map(DecodeString, ps.communicate())) if parent: # restore previous settings os.environ['GRASS_MESSAGE_FORMAT'] = messageFormat diff -Nru grass-7.6.1/gui/wxpython/core/gconsole.py grass-7.8.0/gui/wxpython/core/gconsole.py --- grass-7.6.1/gui/wxpython/core/gconsole.py 2019-03-19 19:57:50.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/gconsole.py 2019-06-03 20:34:20.000000000 +0000 @@ -27,7 +27,12 @@ import re import time import threading -import Queue + +if sys.version_info.major == 2: + import Queue +else: + import queue as Queue + import codecs import locale @@ -41,7 +46,6 @@ from core import globalvar from core.gcmd import CommandThread, GError, GException -from core.utils import _ from gui_core.forms import GUI from core.debug import Debug from core.settings import UserSettings @@ -397,8 +401,13 @@ else: enc = locale.getdefaultlocale()[1] if enc: - sys.stdout = codecs.getwriter(enc)(sys.__stdout__) - sys.stderr = codecs.getwriter(enc)(sys.__stderr__) + if sys.version_info.major == 2: + sys.stdout = codecs.getwriter(enc)(sys.__stdout__) + sys.stderr = codecs.getwriter(enc)(sys.__stderr__) + else: + # https://stackoverflow.com/questions/4374455/how-to-set-sys-stdout-encoding-in-python-3 + sys.stdout = codecs.getwriter(enc)(sys.__stdout__.detach()) + sys.stderr = codecs.getwriter(enc)(sys.__stderr__.detach()) else: sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__ diff -Nru grass-7.6.1/gui/wxpython/core/giface.py grass-7.8.0/gui/wxpython/core/giface.py --- grass-7.6.1/gui/wxpython/core/giface.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/giface.py 2019-06-03 20:34:20.000000000 +0000 @@ -16,7 +16,6 @@ """ import os -from core.utils import _ import grass.script as grass diff -Nru grass-7.6.1/gui/wxpython/core/globalvar.py grass-7.8.0/gui/wxpython/core/globalvar.py --- grass-7.6.1/gui/wxpython/core/globalvar.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/globalvar.py 2019-06-03 20:34:20.000000000 +0000 @@ -28,25 +28,12 @@ IMGDIR = os.path.join(GUIDIR, "images") SYMBDIR = os.path.join(IMGDIR, "symbols") -from core.debug import Debug - -# cannot import from the core.utils module to avoid cross dependencies -try: - # intended to be used also outside this module - import gettext - _ = gettext.translation( - 'grasswxpy', - os.path.join( - os.getenv("GISBASE"), - 'locale')).ugettext -except IOError: - # using no translation silently - def null_gettext(string): - return string - _ = null_gettext - +# i18n is taken care of in the grass library code. +# So we need to import it before any of the GUI code. from grass.script.core import get_commands +from core.debug import Debug + def CheckWxPhoenix(): if 'phoenix' in wx.version(): diff -Nru grass-7.6.1/gui/wxpython/core/gthread.py grass-7.8.0/gui/wxpython/core/gthread.py --- grass-7.6.1/gui/wxpython/core/gthread.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/gthread.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,7 +19,11 @@ import wx -import Queue +import sys +if sys.version_info.major == 2: + import Queue +else: + import queue as Queue from core.gconsole import EVT_CMD_DONE, wxCmdDone diff -Nru grass-7.6.1/gui/wxpython/core/menutree.py grass-7.8.0/gui/wxpython/core/menutree.py --- grass-7.6.1/gui/wxpython/core/menutree.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/menutree.py 2019-06-03 20:34:20.000000000 +0000 @@ -51,7 +51,6 @@ from core.toolboxes import getMessages as getToolboxMessages from core.toolboxes import clearMessages as clearToolboxMessages from core.gcmd import GError -from core.utils import _ if not os.getenv("GISBASE"): sys.exit("GRASS is not running. Exiting...") diff -Nru grass-7.6.1/gui/wxpython/core/render.py grass-7.8.0/gui/wxpython/core/render.py --- grass-7.6.1/gui/wxpython/core/render.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/render.py 2019-06-03 20:34:20.000000000 +0000 @@ -33,13 +33,12 @@ import wx from grass.script import core as grass -from grass.script.utils import try_remove +from grass.script.utils import try_remove, text_to_string from grass.script.task import cmdlist_to_tuple, cmdtuple_to_list from grass.pydispatch.signal import Signal from grass.exceptions import CalledModuleError from core import utils -from core.utils import _ from core.ws import RenderWMSMgr from core.gcmd import GException, GError, RunCommand, EncodeString from core.debug import Debug @@ -47,6 +46,22 @@ from core.gthread import gThread +def get_tempfile_name(suffix, create=False): + """Returns a name for a temporary file in system directory""" + # this picks TMPDIR which we have set for GRASS session + # which may mitigate problems (like not cleaning files) in case we + # go little beyond what is in the documentation in terms of opening + # closing and removing the tmp file + tmp = tempfile.NamedTemporaryFile(suffix=suffix, delete=False) + # we don't want it open, we just need the name + name = tmp.name + tmp.close() + if not create: + # remove empty file to have a clean state later + os.remove(name) + return name + + class Layer(object): """Virtual class which stores information about layers (map layers and overlays) of the map composition. @@ -81,12 +96,7 @@ else: tempfile_sfx = ".ppm" - mapfile = tempfile.NamedTemporaryFile( - suffix=tempfile_sfx, delete=False) - # we don't want it open, we just need the name - self.mapfile = mapfile.name - mapfile.close() - os.remove(self.mapfile) # remove empty file + self.mapfile = get_tempfile_name(suffix=tempfile_sfx) self.maskfile = self.mapfile.rsplit(".", 1)[0] + ".pgm" @@ -118,6 +128,7 @@ self.active, self.opacity, self.hidden)) def __del__(self): + self.Clean() Debug.msg(3, "Layer.__del__(): layer=%s, cmd='%s'" % (self.name, self.GetCmd(string=True))) @@ -144,7 +155,7 @@ (self.type, self.name, self.mapfile)) # prepare command for each layer - layertypes = utils.command2ltype.values() + ['overlay', 'command'] + layertypes = list(utils.command2ltype.values()) + ['overlay', 'command'] if self.type not in layertypes: raise GException( @@ -254,7 +265,7 @@ def SetType(self, ltype): """Set layer type""" - if ltype not in utils.command2ltype.values() + ['overlay', 'command']: + if ltype not in list(utils.command2ltype.values()) + ['overlay', 'command']: raise GException(_("Unsupported map layer type '%s'") % ltype) if not self.renderMgr: @@ -317,6 +328,14 @@ """Get render manager """ return self.renderMgr + def Clean(self): + if self.mapfile: + try_remove(self.mapfile) + self.mapfile = None + if self.maskfile: + try_remove(self.maskfile) + self.maskfile = None + class MapLayer(Layer): @@ -325,7 +344,7 @@ """ Layer.__init__(self, *args, **kwargs) if self.type in ('vector', 'thememap'): - self._legrow = grass.tempfile(create=True) + self._legrow = get_tempfile_name(suffix=".legrow", create=True) else: self._legrow = '' @@ -343,6 +362,12 @@ except IndexError: return self.name + def Clean(self): + Layer.Clean(self) + if self._legrow: + try_remove(self._legrow) + self._legrow = None + class Overlay(Layer): @@ -389,9 +414,11 @@ env_cmd.update(self._render_env) env_cmd['GRASS_RENDER_FILE'] = self.layer.mapfile if self.layer.GetType() in ('vector', 'thememap'): + if not self.layer._legrow: + self.layer._legrow = grass.tempfile(create=True) if os.path.isfile(self.layer._legrow): os.remove(self.layer._legrow) - env_cmd['GRASS_LEGEND_FILE'] = self.layer._legrow + env_cmd['GRASS_LEGEND_FILE'] = text_to_string(self.layer._legrow) cmd_render = copy.deepcopy(cmd) cmd_render[1]['quiet'] = True # be quiet @@ -464,7 +491,7 @@ "GRASS_RENDER_FILE_COMPRESSION": "0", "GRASS_RENDER_TRUECOLOR": "TRUE", "GRASS_RENDER_TRANSPARENT": "TRUE", - "GRASS_LEGEND_FILE": self.Map.legfile + "GRASS_LEGEND_FILE": text_to_string(self.Map.legfile) } self._init() @@ -633,8 +660,7 @@ if layer.GetType() not in ('vector', 'thememap'): continue - if os.path.isfile(layer._legrow) and layer._legrow[-1].isdigit() \ - and layer.hidden is False: + if os.path.isfile(layer._legrow) and not layer.hidden: with open(layer._legrow) as infile: line = infile.read() outfile.write(line) @@ -744,10 +770,8 @@ self.gisrc = gisrc # generated file for g.pnmcomp output for rendering the map - self.legfile = grass.tempfile(create=False) + '.leg' - self.tmpdir = os.path.dirname(self.legfile) - self.mapfile = grass.tempfile(create=False) + '.ppm' - + self.legfile = get_tempfile_name(suffix='.leg') + self.mapfile = get_tempfile_name(suffix='.ppm') # setting some initial env. variables if not self.GetWindow(): @@ -1154,7 +1178,7 @@ """ selected = [] - if isinstance(ltype, types.StringType): + if isinstance(ltype, str): one_type = True else: one_type = False @@ -1318,6 +1342,9 @@ if base == '' or tempbase == '': return None basefile = os.path.join(base, tempbase) + r'.*' + # this comes all the way from r28605, so leaving + # it as it is, although it does not really fit with the + # new system (but probably works well enough) for f in glob.glob(basefile): os.remove(f) @@ -1566,11 +1593,8 @@ def _clean(self, llist): for layer in llist: - if layer.maskfile: - try_remove(layer.maskfile) - if layer.mapfile: - try_remove(layer.mapfile) - llist.remove(layer) + layer.Clean() + del llist[:] def Clean(self): """Clean layer stack - go trough all layers and remove them @@ -1580,6 +1604,8 @@ """ self._clean(self.layers) self._clean(self.overlays) + try_remove(self.mapfile) + try_remove(self.legfile) def ReverseListOfLayers(self): """Reverse list of layers""" diff -Nru grass-7.6.1/gui/wxpython/core/settings.py grass-7.8.0/gui/wxpython/core/settings.py --- grass-7.6.1/gui/wxpython/core/settings.py 2019-03-19 19:57:50.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/settings.py 2019-06-03 20:34:20.000000000 +0000 @@ -27,7 +27,7 @@ from core import globalvar from core.gcmd import GException, GError -from core.utils import GetSettingsPath, PathJoin, rgb2str, _ +from core.utils import GetSettingsPath, PathJoin, rgb2str class Settings: @@ -858,9 +858,9 @@ """Define internal settings (based on user settings) """ self.internalSettings = {} - for group in self.userSettings.keys(): + for group in list(self.userSettings.keys()): self.internalSettings[group] = {} - for key in self.userSettings[group].keys(): + for key in list(self.userSettings[group].keys()): self.internalSettings[group][key] = {} # self.internalSettings['general']["mapsetPath"]['value'] = self.GetMapsetPath() @@ -1030,9 +1030,9 @@ try: file = open(self.filePath, "w") - for group in settings.keys(): - for key in settings[group].keys(): - subkeys = settings[group][key].keys() + for group in list(settings.keys()): + for key in list(settings[group].keys()): + subkeys = list(settings[group][key].keys()) file.write('%s%s%s%s' % (group, self.sep, key, self.sep)) for idx in range(len(subkeys)): value = settings[group][key][subkeys[idx]] @@ -1042,7 +1042,7 @@ '%s%s%s%s%s' % (os.linesep, group, self.sep, key, self.sep)) file.write('%s%s' % (subkeys[idx], self.sep)) - kvalues = settings[group][key][subkeys[idx]].keys() + kvalues = list(settings[group][key][subkeys[idx]].keys()) srange = range(len(kvalues)) for sidx in srange: svalue = self._parseValue( diff -Nru grass-7.6.1/gui/wxpython/core/toolboxes.py grass-7.8.0/gui/wxpython/core/toolboxes.py --- grass-7.6.1/gui/wxpython/core/toolboxes.py 2019-03-19 19:57:50.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/toolboxes.py 2019-06-03 20:34:20.000000000 +0000 @@ -34,7 +34,7 @@ import grass.script.task as gtask import grass.script.core as gcore -from grass.script.utils import try_remove +from grass.script.utils import try_remove, decode from grass.exceptions import ScriptError, CalledModuleError @@ -83,25 +83,6 @@ return userMainMenuFile -def _(string): - """Get translated version of a string""" - # is attribute initialized to actual value? - if _.translate is None: - try: - # if not get the translate function named _ - from core.utils import _ as actual_translate - # assign the imported function to translade attribute - _.translate = actual_translate - except ImportError: - # speak English if there is a problem with import of wx - def noop_traslate(string): - return string - _.translate = noop_traslate - return _.translate(string) - -# attribute translate of function _ -_.translate = None - # TODO: this should be part of some reader object _MESSAGES = [] @@ -480,7 +461,7 @@ >>> toolboxes = etree.fromstring('') >>> _expandUserToolboxesItem(tree, toolboxes) >>> etree.tostring(tree) - '' + b'' """ tboxes = toolboxes.findall('.//toolbox') @@ -505,7 +486,7 @@ >>> tree = etree.fromstring('') >>> _removeUserToolboxesItem(tree) >>> etree.tostring(tree) - '' + b'' """ for n in root.findall('./items/user-toolboxes-list'): items = root.find('./items') @@ -590,7 +571,7 @@ >>> items = etree.fromstring('g.regionGRASS region management') >>> _expandItems(tree, items, 'module-item') >>> etree.tostring(tree) - 'g.regionGRASS region management' + b'g.regionGRASS region management' """ for moduleItem in node.findall('.//' + itemTag): itemName = moduleItem.get('name') @@ -624,13 +605,13 @@ ... '') >>> _expandRuntimeModules(tree) >>> etree.tostring(tree) - 'g.regionManages the boundary definitions for the geographic region.general,settings,computational region,extent,resolution,level1' + b'g.regionManages the boundary definitions for the geographic region.general,settings,computational region,extent,resolution,level1' >>> tree = etree.fromstring('' ... '' ... '') >>> _expandRuntimeModules(tree) >>> etree.tostring(tree) - 'm.projConverts coordinates from one projection to another (cs2cs frontend).miscellaneous,projection,transformation' + b'm.projConverts coordinates from one projection to another (cs2cs frontend).miscellaneous,projection,transformation' """ hasErrors = False modules = node.findall('.//module-item') @@ -709,7 +690,7 @@ >>> _convertTag(tree, 'toolbox', 'menu') >>> _convertTag(tree, 'module-item', 'menuitem') >>> etree.tostring(tree) - '

' + b'' """ for n in node.findall('.//%s' % old): n.tag = new @@ -722,7 +703,7 @@ >>> _convertTagAndRemoveAttrib(tree, 'toolbox', 'menu') >>> _convertTagAndRemoveAttrib(tree, 'module-item', 'menuitem') >>> etree.tostring(tree) - '' + b'' """ for n in node.findall('.//%s' % old): n.tag = new @@ -735,7 +716,7 @@ >>> tree = etree.fromstring('g.region') >>> _convertTree(tree) >>> etree.tostring(tree) - 'g.region' + b'g.region' """ root.attrib = {} label = root.find('label') @@ -766,9 +747,9 @@ :return: XML as string """ xml = etree.tostring(root, encoding='UTF-8') - return xml.replace("\n", - "\n" - "\n") + return xml.replace(b"\n", + b"\n" + b"\n") def do_doctest_gettext_workaround(): @@ -897,7 +878,7 @@ tree = createTree(distributionRootFile=mainFile, userRootFile=None, userDefined=False) root = tree.getroot() - sys.stdout.write(_getXMLString(root)) + sys.stdout.write(decode(_getXMLString(root), encoding='UTF-8')) return 0 diff -Nru grass-7.6.1/gui/wxpython/core/treemodel.py grass-7.8.0/gui/wxpython/core/treemodel.py --- grass-7.6.1/gui/wxpython/core/treemodel.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/treemodel.py 2019-06-03 20:34:20.000000000 +0000 @@ -15,6 +15,7 @@ @author Anna Petrasova """ +import six class TreeModel(object): @@ -174,7 +175,7 @@ def nprint(self, text, indent=0): text.append(indent * ' ' + self.label) if self.data: - for key, value in self.data.iteritems(): + for key, value in six.iteritems(self.data): text.append( "%(indent)s* %(key)s : %(value)s" % {'indent': (indent + 2) * ' ', 'key': key, 'value': value}) diff -Nru grass-7.6.1/gui/wxpython/core/units.py grass-7.8.0/gui/wxpython/core/units.py --- grass-7.6.1/gui/wxpython/core/units.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/units.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,13 +21,13 @@ @author Martin Landa """ +import six import math if __name__ == '__main__': import os import sys -from core.utils import _ class BaseUnits: @@ -79,7 +79,7 @@ :return: index """ - for k, u in self._units[type].iteritems(): + for k, u in six.iteritems(self._units[type]): if u['key'] == key: return k return 0 diff -Nru grass-7.6.1/gui/wxpython/core/utils.py grass-7.8.0/gui/wxpython/core/utils.py --- grass-7.6.1/gui/wxpython/core/utils.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/utils.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,33 +20,24 @@ import shlex import re import inspect +import six from grass.script import core as grass from grass.script import task as gtask from grass.exceptions import OpenError -from core import globalvar from core.gcmd import RunCommand from core.debug import Debug +from core.globalvar import ETCDIR, wxPythonPhoenix -try: - # intended to be used also outside this module - import gettext - _ = gettext.translation( - 'grasswxpy', - os.path.join( - os.getenv("GISBASE"), - 'locale')).ugettext -except IOError: - # using no translation silently - def null_gettext(string): - return string - _ = null_gettext +def cmp(a, b): + """cmp function""" + return ((a > b) - (a < b)) def normalize_whitespace(text): """Remove redundant whitespace from a string""" - return string.join(string.split(text), ' ') + return (' ').join(text.split()) def split(s): @@ -254,7 +245,7 @@ catstr = '' try: - cats = map(int, cats) + cats = list(map(int, cats)) except: return catstr @@ -324,7 +315,7 @@ def ListSortLower(list): """Sort list items (not case-sensitive)""" - list.sort(cmp=lambda x, y: cmp(x.lower(), y.lower())) + list.sort(key=lambda x: x.lower()) def GetVectorNumberOfLayers(vector): @@ -518,44 +509,20 @@ return path -def ReadEpsgCodes(path): - """Read EPSG code from the file - - :param path: full path to the file with EPSG codes - - Raise OpenError on failure. +def ReadEpsgCodes(): + """Read EPSG codes with g.proj :return: dictionary of EPSG code """ epsgCodeDict = dict() - try: - try: - f = open(path, "r") - except IOError: - raise OpenError(_("failed to open '{0}'").format(path)) - - code = None - for line in f.readlines(): - line = line.strip() - if len(line) < 1 or line.startswith(''): - continue - if line[0] == '#': - descr = line[1:].strip() - elif line[0] == '<': - code, params = line.split(" ", 1) - try: - code = int(code.replace('<', '').replace('>', '')) - except ValueError as e: - raise OpenError('{0}'.format(e)) - - if code is not None: - epsgCodeDict[code] = (descr, params) - code = None - - f.close() - except Exception as e: - raise OpenError('{0}'.format(e)) + ret = RunCommand('g.proj', + read=True, + list_codes="EPSG") + + for line in ret.splitlines(): + code, descr, params = line.split("|") + epsgCodeDict[int(code)] = (descr, params) return epsgCodeDict @@ -731,7 +698,7 @@ else: formats['file'].append(name) - for items in formats.itervalues(): + for items in six.itervalues(formats): items.sort() return formats @@ -800,33 +767,35 @@ 'Northwood Classified Grid Format .grc/.tab': '', 'ARC Digitized Raster Graphics': 'arc', 'Magellan topo (.blx)': 'blx', - 'SAGA GIS Binary Grid (.sdat)': 'sdat' + 'SAGA GIS Binary Grid (.sdat)': 'sdat', + 'GeoPackage (.gpkg)': 'gpkg' } vectorFormatExtension = { 'ESRI Shapefile': 'shp', + 'GeoPackage': 'gpkg', 'UK .NTF': 'ntf', 'SDTS': 'ddf', - 'DGN': 'dgn', - 'VRT': 'vrt', - 'REC': 'rec', - 'BNA': 'bna', - 'CSV': 'csv', - 'GML': 'gml', - 'GPX': 'gpx', - 'KML': 'kml', - 'GMT': 'gmt', - 'PGeo': 'mdb', - 'XPlane': 'dat', - 'AVCBin': 'adf', - 'AVCE00': 'e00', - 'DXF': 'dxf', - 'Geoconcept': 'gxt', - 'GeoRSS': 'xml', - 'GPSTrackMaker': 'gtm', - 'VFK': 'vfk', - 'SVG': 'svg', + 'DGN': 'dgn', + 'VRT': 'vrt', + 'REC': 'rec', + 'BNA': 'bna', + 'CSV': 'csv', + 'GML': 'gml', + 'GPX': 'gpx', + 'KML': 'kml', + 'GMT': 'gmt', + 'PGeo': 'mdb', + 'XPlane': 'dat', + 'AVCBin': 'adf', + 'AVCE00': 'e00', + 'DXF': 'dxf', + 'Geoconcept': 'gxt', + 'GeoRSS': 'xml', + 'GPSTrackMaker': 'gtm', + 'VFK': 'vfk', + 'SVG': 'svg' } @@ -834,7 +803,7 @@ """Get full path to the settings directory """ try: - verFd = open(os.path.join(globalvar.ETCDIR, "VERSIONNUMBER")) + verFd = open(os.path.join(ETCDIR, "VERSIONNUMBER")) version = int(verFd.readlines()[0].split(' ')[0].split('.')[0]) except (IOError, ValueError, TypeError, IndexError) as e: sys.exit( @@ -917,7 +886,7 @@ else: expCmd = 'export' - for key, value in environ.iteritems(): + for key, value in six.iteritems(environ): fd.write('%s %s=%s\n' % (expCmd, key, value)) # write also skipped lines @@ -1091,7 +1060,7 @@ pilImageCopyRGBA, "tostring")) # Create layer and insert alpha values. - if globalvar.wxPythonPhoenix: + if wxPythonPhoenix: wxImage.SetAlpha(fn()[3::4]) else: wxImage.SetAlphaData(fn()[3::4]) diff -Nru grass-7.6.1/gui/wxpython/core/workspace.py grass-7.8.0/gui/wxpython/core/workspace.py --- grass-7.6.1/gui/wxpython/core/workspace.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/workspace.py 2019-08-31 21:37:30.000000000 +0000 @@ -19,8 +19,13 @@ import os import wx +import six +try: + from StringIO import StringIO +except ImportError: + from io import StringIO -from core.utils import normalize_whitespace, _ +from core.utils import normalize_whitespace from core.settings import UserSettings from core.gcmd import EncodeString, GetDefaultEncoding from nviz.main import NvizSettings @@ -28,6 +33,14 @@ from grass.script import core as gcore +def get_database_location_mapset(): + """Returns GRASS database, location, and mapset as a tuple""" + gisenv = gcore.gisenv() + return (gisenv['GISDBASE'], + gisenv['LOCATION_NAME'], + gisenv['MAPSET']) + + class ProcessWorkspaceFile: def __init__(self, tree): @@ -94,6 +107,9 @@ def __processFile(self): """Process workspace file""" + + self.__processSession() + # # layer manager # @@ -101,7 +117,7 @@ if node_lm is not None: posAttr = node_lm.get('dim', '') if posAttr: - posVal = map(int, posAttr.split(',')) + posVal = list(map(int, posAttr.split(','))) try: self.layerManager['pos'] = (posVal[0], posVal[1]) self.layerManager['size'] = (posVal[2], posVal[3]) @@ -121,7 +137,7 @@ # window position and size posAttr = display.get('dim', '') if posAttr: - posVal = map(int, posAttr.split(',')) + posVal = list(map(int, posAttr.split(','))) try: pos = (posVal[0], posVal[1]) size = (posVal[2], posVal[3]) @@ -176,6 +192,17 @@ # process nviz_state self.__processNvizState(display) + def __processSession(self): + session = self.root.find('session') + if session is None: + self.database = None + self.location = None + self.mapset = None + return + self.database = self.__filterValue(self.__getNodeText(session, 'database')) + self.location = self.__filterValue(self.__getNodeText(session, 'location')) + self.mapset = self.__filterValue(self.__getNodeText(session, 'mapset')) + def __processLayers(self, node, inGroup=-1): """Process layers/groups of selected display @@ -797,6 +824,8 @@ """Generic class for writing workspace file""" def __init__(self, lmgr, file): + self.outfile = file + file = StringIO() self.file = file self.lmgr = lmgr self.indent = 0 @@ -812,6 +841,19 @@ self.indent = + 4 + database, location, mapset = get_database_location_mapset() + + file.write('{indent}\n'.format(indent=' ' * self.indent)) + self.indent += 4 + file.write('{indent}{database}\n'.format( + indent=' ' * self.indent, database=database)) + file.write('{indent}{location}\n'.format( + indent=' ' * self.indent, location=location)) + file.write('{indent}{mapset}\n'.format( + indent=' ' * self.indent, mapset=mapset)) + self.indent -= 4 + file.write('{indent}\n'.format(indent=' ' * self.indent)) + # layer manager windowPos = self.lmgr.GetPosition() windowSize = self.lmgr.GetSize() @@ -856,7 +898,7 @@ 'extent="%f,%f,%f,%f,%f,%f" ' 'tbres="%f" ' # needed only for animation tool 'viewMode="%s" >\n' % (' ' * self.indent, - dispName.encode('utf8'), + dispName, int(mapdisp.mapWindowProperties.autoRender), mapdisp.statusbarManager.GetMode(), int(mapdisp.mapWindowProperties.showRegion), @@ -916,6 +958,9 @@ self.indent = - 4 file.write('%s\n' % (' ' * self.indent)) + self.outfile.write(EncodeString(file.getvalue())) + file.close() + def __filterValue(self, value): """Make value XML-valid""" value = value.replace('<', '<') @@ -942,13 +987,13 @@ string=True) self.file.write( '%s\n' % - (' ' * self.indent, type, EncodeString(cmd), checked)) + (' ' * self.indent, type, cmd, checked)) self.file.write('%s\n' % (' ' * self.indent)) elif type == 'group': name = mapTree.GetItemText(item) self.file.write( '%s\n' % - (' ' * self.indent, EncodeString(name), checked)) + (' ' * self.indent, name, checked)) self.indent += 4 subItem = mapTree.GetFirstChild(item)[0] self.__writeLayer(mapTree, subItem) @@ -965,7 +1010,7 @@ name = name.split('(', -1)[0].strip() self.file.write( '%s\n' % - (' ' * self.indent, type, EncodeString(name), checked, opacity)) + (' ' * self.indent, type, name, checked, opacity)) self.indent += 4 # selected ? @@ -976,7 +1021,7 @@ '%s\n' % (' ' * self.indent, cmd[0])) self.indent += 4 - for key, val in cmd[1].iteritems(): + for key, val in six.iteritems(cmd[1]): if key == 'flags': for f in val: self.file.write('%s\n' % @@ -990,7 +1035,7 @@ self.indent += 4 self.file.write( '%s%s\n' % - (' ' * self.indent, EncodeString(self.__filterValue(val)))) + (' ' * self.indent, self.__filterValue(val))) self.indent -= 4 self.file.write( '%s\n' % @@ -1003,7 +1048,7 @@ self.file.write('%s\n' % (' ' * self.indent)) if 'geomAttr' in vdigit: self.indent += 4 - for type, val in vdigit['geomAttr'].iteritems(): + for type, val in six.iteritems(vdigit['geomAttr']): units = '' if val['units'] != 'mu': units = ' units="%s"' % val['units'] @@ -1038,13 +1083,13 @@ self.indent += 4 self.file.write('%s\n' % (' ' * self.indent)) self.indent += 4 - for attrb in data.iterkeys(): + for attrb in six.iterkeys(data): if len(data[attrb]) < 1: # skip empty attributes continue if attrb == 'object': continue - for name in data[attrb].iterkeys(): + for name in six.iterkeys(data[attrb]): # surface attribute if attrb == 'attribute': if data[attrb][name]['map'] is None: @@ -1064,7 +1109,7 @@ if attrb == 'draw': self.file.write('%s<%s' % (' ' * self.indent, attrb)) if 'mode' in data[attrb]: - for tag, value in data[attrb]['mode']['desc'].iteritems(): + for tag, value in six.iteritems(data[attrb]['mode']['desc']): self.file.write(' %s="%s"' % (tag, value)) self.file.write('>\n') # @@ -1121,14 +1166,14 @@ self.indent += 4 self.file.write('%s\n' % (' ' * self.indent)) self.indent += 4 - for attrb in data.iterkeys(): + for attrb in six.iterkeys(data): if len(data[attrb]) < 1: # skip empty attributes continue if attrb == 'object': continue if attrb == 'attribute': - for name in data[attrb].iterkeys(): + for name in six.iterkeys(data[attrb]): # surface attribute if data[attrb][name]['map'] is None: continue @@ -1211,10 +1256,10 @@ if attrb == 'isosurface': for isosurface in data[attrb]: self.file.write('%s<%s>\n' % (' ' * self.indent, attrb)) - for name in isosurface.iterkeys(): + for name in six.iterkeys(isosurface): self.indent += 4 self.file.write('%s<%s>\n' % (' ' * self.indent, name)) - for att in isosurface[name].iterkeys(): + for att in six.iterkeys(isosurface[name]): if isosurface[name][att] is True: val = '1' elif isosurface[name][att] is False: @@ -1242,10 +1287,10 @@ if attrb == 'slice': for slice_ in data[attrb]: self.file.write('%s<%s>\n' % (' ' * self.indent, attrb)) - for name in slice_.iterkeys(): + for name in six.iterkeys(slice_): self.indent += 4 self.file.write('%s<%s>\n' % (' ' * self.indent, name)) - for att in slice_[name].iterkeys(): + for att in six.iterkeys(slice_[name]): if att in ('map', 'update'): continue val = slice_[name][att] @@ -1275,7 +1320,7 @@ :param data: Nviz layer properties """ self.indent += 4 - for attrb in data.iterkeys(): + for attrb in six.iterkeys(data): if len(data[attrb]) < 1: # skip empty attributes continue @@ -1292,7 +1337,7 @@ attrb, marker)) self.indent += 4 - for name in data[attrb].iterkeys(): + for name in six.iterkeys(data[attrb]): if name in ('object', 'marker'): continue if name == 'mode': @@ -1318,14 +1363,14 @@ self.file.write('%s\n' % ((' ' * self.indent, name))) elif name == 'thematic': self.file.write('%s<%s ' % (' ' * self.indent, name)) - for key in data[attrb][name].iterkeys(): + for key in six.iterkeys(data[attrb][name]): if key.startswith('use'): self.file.write( '%s="%s" ' % (key, int(data[attrb][name][key]))) self.file.write('>\n') self.indent += 4 - for key, value in data[attrb][name].iteritems(): + for key, value in six.iteritems(data[attrb][name]): if key.startswith('use'): continue if value is None: @@ -1573,7 +1618,7 @@ else: self.file.write('%s\n' % (' ' * self.indent, prm.split("=", 1)[0])) self.indent += 4 - self.file.write('%s%s\n' % (' ' * self.indent, EncodeString(prm.split("=", 1)[1]))) + self.file.write('%s%s\n' % (' ' * self.indent, prm.split("=", 1)[1])) self.indent -= 4 self.file.write('%s\n' % (' ' * self.indent)) self.indent -= 4 diff -Nru grass-7.6.1/gui/wxpython/core/ws.py grass-7.8.0/gui/wxpython/core/ws.py --- grass-7.6.1/gui/wxpython/core/ws.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/core/ws.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,6 +19,7 @@ import sys import copy import time +import six import wx from wx.lib.newevent import NewEvent @@ -30,7 +31,6 @@ from core import utils from core.debug import Debug from core.gthread import gThread -from core.utils import _ try: haveGdal = True @@ -213,7 +213,7 @@ """Create string for GRASS_REGION env variable from dict created by _getRegionDict. """ regionStr = '' - for k, v in region.iteritems(): + for k, v in six.iteritems(region): item = k + ': ' + str(v) if regionStr: regionStr += '; ' @@ -356,7 +356,7 @@ if sXsize < 1 or sYsize < 1: return - for sBandNnum, tBandNum in sTBands.iteritems(): + for sBandNnum, tBandNum in six.iteritems(sTBands): bandData = sDataset.GetRasterBand(sBandNnum).ReadRaster( sXoff, sYoff, sXsize, sYsize, tXsize, tYsize, gdal.GDT_Byte) self.tDataset.GetRasterBand(tBandNum).WriteRaster( diff -Nru grass-7.6.1/gui/wxpython/datacatalog/catalog.py grass-7.8.0/gui/wxpython/datacatalog/catalog.py --- grass-7.6.1/gui/wxpython/datacatalog/catalog.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/datacatalog/catalog.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,7 +20,6 @@ from core.gthread import gThread from core.debug import Debug from datacatalog.tree import DataCatalogTree -from core.utils import _ from datacatalog.toolbars import DataCatalogToolbar from grass.pydispatch.signal import Signal diff -Nru grass-7.6.1/gui/wxpython/datacatalog/dialogs.py grass-7.8.0/gui/wxpython/datacatalog/dialogs.py --- grass-7.6.1/gui/wxpython/datacatalog/dialogs.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/datacatalog/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,6 +20,7 @@ from gui_core.widgets import FloatValidator, IntegerValidator from core.giface import Notification from core.gcmd import RunCommand +from gui_core.wrap import Button, StaticText, TextCtrl from grass.script import parse_key_val, region_env @@ -61,26 +62,26 @@ def _widgets(self): if self.etype == 'raster': - self.resolution = wx.TextCtrl(self.panel, validator=FloatValidator()) + self.resolution = TextCtrl(self.panel, validator=FloatValidator()) self.resampling = wx.Choice(self.panel, size=(200, -1), choices=['nearest', 'bilinear', 'bicubic', 'lanczos', 'bilinear_f', 'bicubic_f', 'lanczos_f']) else: - self.vsplit = wx.TextCtrl(self.panel, validator=IntegerValidator()) + self.vsplit = TextCtrl(self.panel, validator=IntegerValidator()) self.vsplit.SetValue('10000') # # buttons # - self.btn_close = wx.Button(parent=self.panel, id=wx.ID_CLOSE) + self.btn_close = Button(parent=self.panel, id=wx.ID_CLOSE) self.SetEscapeId(self.btn_close.GetId()) # run - self.btn_run = wx.Button(parent=self.panel, id=wx.ID_OK, label=_("Reproject")) + self.btn_run = Button(parent=self.panel, id=wx.ID_OK, label=_("Reproject")) if self.etype == 'raster': - self.btn_run.SetToolTipString(_("Reproject raster")) + self.btn_run.SetToolTip(_("Reproject raster")) elif self.etype == 'vector': - self.btn_run.SetToolTipString(_("Reproject vector")) + self.btn_run.SetToolTip(_("Reproject vector")) self.btn_run.SetDefault() self.btn_run.Bind(wx.EVT_BUTTON, self.OnReproject) @@ -91,25 +92,25 @@ label = _("Map layer <{ml}> needs to be reprojected.\n" "Please review and modify reprojection parameters:").format(ml=self.iLayer) - dialogSizer.Add(wx.StaticText(self.panel, label=label), + dialogSizer.Add(StaticText(self.panel, label=label), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, border=10) if self.etype == 'raster': - optionsSizer.Add(wx.StaticText(self.panel, label=_("Estimated resolution:")), + optionsSizer.Add(StaticText(self.panel, label=_("Estimated resolution:")), pos=(0, 0), flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL) optionsSizer.Add(self.resolution, pos=(0, 1), flag=wx.EXPAND) - optionsSizer.Add(wx.StaticText(self.panel, label=_("Resampling method:")), + optionsSizer.Add(StaticText(self.panel, label=_("Resampling method:")), pos=(1, 0), flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL) optionsSizer.Add(self.resampling, pos=(1, 1), flag=wx.EXPAND) else: - optionsSizer.Add(wx.StaticText(self.panel, label=_("Maximum segment length:")), + optionsSizer.Add(StaticText(self.panel, label=_("Maximum segment length:")), pos=(1, 0), flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL) optionsSizer.Add(self.vsplit, pos=(1, 1), flag=wx.EXPAND) optionsSizer.AddGrowableCol(1) dialogSizer.Add(optionsSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) - helptext = wx.StaticText(self.panel, - label="For more reprojection options," - " please see {module}".format(module='r.proj' if self.etype == 'raster' - else 'v.proj')) + helptext = StaticText(self.panel, + label="For more reprojection options," + " please see {module}".format(module='r.proj' if self.etype == 'raster' + else 'v.proj')) dialogSizer.Add(helptext, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) # # buttons diff -Nru grass-7.6.1/gui/wxpython/datacatalog/frame.py grass-7.8.0/gui/wxpython/datacatalog/frame.py --- grass-7.6.1/gui/wxpython/datacatalog/frame.py 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/datacatalog/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,11 +21,11 @@ import wx -from core.utils import _ from core.globalvar import ICONDIR from core.gcmd import RunCommand, GMessage from datacatalog.tree import DataCatalogTree from datacatalog.toolbars import DataCatalogToolbar +from gui_core.wrap import Button class DataCatalogFrame(wx.Frame): @@ -62,8 +62,8 @@ mapset=mapset)) # buttons - self.btnClose = wx.Button(parent=self.panel, id=wx.ID_CLOSE) - self.btnClose.SetToolTipString(_("Close GRASS GIS Data Catalog")) + self.btnClose = Button(parent=self.panel, id=wx.ID_CLOSE) + self.btnClose.SetToolTip(_("Close GRASS GIS Data Catalog")) self.btnClose.SetDefault() # events diff -Nru grass-7.6.1/gui/wxpython/datacatalog/g.gui.datacatalog.html grass-7.8.0/gui/wxpython/datacatalog/g.gui.datacatalog.html --- grass-7.6.1/gui/wxpython/datacatalog/g.gui.datacatalog.html 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/datacatalog/g.gui.datacatalog.html 2019-05-18 15:50:04.000000000 +0000 @@ -56,4 +56,4 @@ Czech Republic

-$Date: 2017-11-22 22:31:25 +0100 (Wed, 22 Nov 2017) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/datacatalog/g.gui.datacatalog.py grass-7.8.0/gui/wxpython/datacatalog/g.gui.datacatalog.py --- grass-7.6.1/gui/wxpython/datacatalog/g.gui.datacatalog.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/datacatalog/g.gui.datacatalog.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: Data catalog diff -Nru grass-7.6.1/gui/wxpython/datacatalog/toolbars.py grass-7.8.0/gui/wxpython/datacatalog/toolbars.py --- grass-7.6.1/gui/wxpython/datacatalog/toolbars.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/datacatalog/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -16,8 +16,8 @@ import wx from gui_core.toolbars import BaseToolbar +from gui_core.wrap import StaticText, TextCtrl from icons.icon import MetaIcon -from core.utils import _ icons = { 'reloadTree': MetaIcon( @@ -46,12 +46,12 @@ self.InitToolbar(self._toolbarData()) self.filterId = wx.NewId() - self.filter = wx.TextCtrl(parent=self, id=self.filterId) + self.filter = TextCtrl(parent=self, id=self.filterId) self.filter.SetSize((120, self.filter.GetBestSize()[1])) self.filter.Bind(wx.EVT_TEXT, lambda event: self.parent.Filter( self.filter.GetValue())) - self.AddControl(wx.StaticText(self, label=_("Search:"))) + self.AddControl(StaticText(self, label=_("Search:"))) self.AddControl(self.filter) help = _("Type to search database by map type or name. " "Use prefix 'r:', 'v:' and 'r3:'" diff -Nru grass-7.6.1/gui/wxpython/datacatalog/tree.py grass-7.8.0/gui/wxpython/datacatalog/tree.py --- grass-7.6.1/gui/wxpython/datacatalog/tree.py 2019-03-19 19:57:29.000000000 +0000 +++ grass-7.8.0/gui/wxpython/datacatalog/tree.py 2019-07-28 20:17:50.000000000 +0000 @@ -255,8 +255,7 @@ def __init__( self, parent, model=None, style=wx.TR_HIDE_ROOT | wx.TR_EDIT_LABELS - | wx.TR_LINES_AT_ROOT | wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT | - wx.TR_SINGLE): + | wx.TR_LINES_AT_ROOT | wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_MULTIPLE): """Location Map Tree constructor.""" self._model = TreeModel(DataCatalogNode) self._orig_model = self._model @@ -422,53 +421,68 @@ def _initVariables(self): """Init variables.""" - self.selected_layer = None - self.selected_type = None - self.selected_mapset = None - self.selected_location = None + self.selected_layer = [] + self.selected_type = [] + self.selected_mapset = [] + self.selected_location = [] + self.mixed = False def GetControl(self): """Returns control itself.""" return self - def DefineItems(self, item): + def DefineItems(self, selected): """Set selected items.""" - self.selected_layer = None - self.selected_type = None - self.selected_mapset = None - self.selected_location = None - - type = item.data['type'] - if type in ('raster', 'raster_3d', 'vector'): - self.selected_layer = item - type = 'element' - item = item.parent - - if type == 'element': - self.selected_type = item - type = 'mapset' - item = item.parent - - if type == 'mapset': - self.selected_mapset = item - type = 'location' - item = item.parent - - if type == 'location': - self.selected_location = item + self._initVariables() + mixed = [] + for item in selected: + type = item.data['type'] + if type in ('raster', 'raster_3d', 'vector'): + self.selected_layer.append(item) + self.selected_type.append(item.parent) + self.selected_mapset.append(item.parent.parent) + self.selected_location.append(item.parent.parent.parent) + mixed.append('layer') + elif type == 'element': + self.selected_layer.append(None) + self.selected_type.append(item) + self.selected_mapset.append(item.parent) + self.selected_location.append(item.parent.parent) + mixed.append('element') + elif type == 'mapset': + self.selected_layer.append(None) + self.selected_type.append(None) + self.selected_mapset.append(item) + self.selected_location.append(item.parent) + mixed.append('mapset') + elif type == 'location': + self.selected_layer.append(None) + self.selected_type.append(None) + self.selected_mapset.append(None) + self.selected_location.append(item) + mixed.append('location') + self.mixed = False + if len(set(mixed)) > 1: + self.mixed = True def OnSelChanged(self, event): self.selected_layer = None def OnRightClick(self, node): """Display popup menu.""" - self.DefineItems(node) - if self.selected_layer: + self.DefineItems(self.GetSelected()) + if self.mixed: + self._popupMenuEmpty() + return + + if self.selected_layer[0]: self._popupMenuLayer() - elif self.selected_mapset and not self.selected_type: + elif self.selected_mapset[0] and not self.selected_type[0] and len(self.selected_mapset) == 1: self._popupMenuMapset() - elif self.selected_type: + elif self.selected_type[0] and len(self.selected_type) == 1: self._popupMenuElement() + else: + self._popupMenuEmpty() def OnDoubleClick(self, node): """Double click on item/node. @@ -477,8 +491,8 @@ expand/collapse node. """ if not isinstance(self._giface, StandaloneGrassInterface): - self.DefineItems(node) - if self.selected_layer: + self.DefineItems([node]) + if self.selected_layer[0] is not None: # display selected layer and return self.DisplayLayer() return @@ -576,42 +590,48 @@ def OnMoveMap(self, event): """Move layer or mapset (just save it temporarily, copying is done by paste)""" self.copy_mode = False - self.copy_layer = self.selected_layer - self.copy_type = self.selected_type - self.copy_mapset = self.selected_mapset - self.copy_location = self.selected_location - label = _("Map <{layer}> marked for moving.").format(layer=self.copy_layer.label) + self.copy_layer = self.selected_layer[:] + self.copy_type = self.selected_type[:] + self.copy_mapset = self.selected_mapset[:] + self.copy_location = self.selected_location[:] + if len(self.copy_layer) > 1: + label = _("{c} maps marked for moving.").format(c=len(self.selected_layer)) + else: + label = _("Map <{layer}> marked for moving.").format(layer=self.copy_layer[0].label) self.showNotification.emit(message=label) def OnCopyMap(self, event): """Copy layer or mapset (just save it temporarily, copying is done by paste)""" self.copy_mode = True - self.copy_layer = self.selected_layer - self.copy_type = self.selected_type - self.copy_mapset = self.selected_mapset - self.copy_location = self.selected_location - label = _("Map <{layer}> marked for copying.").format(layer=self.copy_layer.label) + self.copy_layer = self.selected_layer[:] + self.copy_type = self.selected_type[:] + self.copy_mapset = self.selected_mapset[:] + self.copy_location = self.selected_location[:] + if len(self.copy_layer) > 1: + label = _("{c} maps marked for copying.").format(c=len(self.selected_layer)) + else: + label = _("Map <{layer}> marked for copying.").format(layer=self.copy_layer[0].label) self.showNotification.emit(message=label) def OnRenameMap(self, event): """Rename layer with dialog""" - old_name = self.selected_layer.label + old_name = self.selected_layer[0].label gisrc, env = gscript.create_environment( gisenv()['GISDBASE'], - self.selected_location.label, mapset=self.selected_mapset.label) + self.selected_location[0].label, mapset=self.selected_mapset[0].label) new_name = self._getNewMapName( _('New name'), _('Rename map'), old_name, env=env, - mapset=self.selected_mapset.label, - element=self.selected_type.label) + mapset=self.selected_mapset[0].label, + element=self.selected_type[0].label) if new_name: self.Rename(old_name, new_name) def OnStartEditLabel(self, node, event): """Start label editing""" - self.DefineItems(node) + self.DefineItems([node]) Debug.msg(1, "Start label edit {name}".format(name=node.label)) label = _("Editing {name}").format(name=node.label) self.showNotification.emit(message=label) @@ -631,20 +651,20 @@ string = old + ',' + new gisrc, env = gscript.create_environment( gisenv()['GISDBASE'], - self.selected_location.label, self.selected_mapset.label) + self.selected_location[0].label, self.selected_mapset[0].label) label = _("Renaming map <{name}>...").format(name=string) self.showNotification.emit(message=label) - if self.selected_type.label == 'vector': + if self.selected_type[0].label == 'vector': renamed, cmd = self._runCommand('g.rename', vector=string, env=env) - elif self.selected_type.label == 'raster': + elif self.selected_type[0].label == 'raster': renamed, cmd = self._runCommand('g.rename', raster=string, env=env) else: renamed, cmd = self._runCommand( 'g.rename', raster3d=string, env=env) if renamed == 0: - self.selected_layer.label = new - self.selected_layer.data['name'] = new - self.RefreshNode(self.selected_layer) + self.selected_layer[0].label = new + self.selected_layer[0].data['name'] = new + self.RefreshNode(self.selected_layer[0]) self.showNotification.emit( message=_("{cmd} -- completed").format(cmd=cmd)) Debug.msg(1, "LAYER RENAMED TO: " + new) @@ -659,106 +679,110 @@ GMessage(_("No map selected for moving."), parent=self) return - gisrc, env = gscript.create_environment( - gisenv()['GISDBASE'], self.selected_location.label, mapset=self.selected_mapset.label) - gisrc2, env2 = gscript.create_environment( - gisenv()['GISDBASE'], self.copy_location.label, mapset=self.copy_mapset.label) - new_name = self.copy_layer.label - if self.selected_location == self.copy_location: - # within one mapset - if self.selected_mapset == self.copy_mapset: - # ignore when just moves map - if self.copy_mode is False: - return - new_name = self._getNewMapName(_('New name'), _('Select new name'), - self.copy_layer.label, env=env, - mapset=self.selected_mapset.label, - element=self.copy_type.label) - if not new_name: - return - # within one location, different mapsets - else: - if map_exists(new_name, element=self.copy_type.label, env=env, - mapset=self.selected_mapset.label): - new_name = self._getNewMapName(_('New name'), _('Select new name'), - self.copy_layer.label, env=env, - mapset=self.selected_mapset.label, - element=self.copy_type.label) + for i in range(len(self.copy_layer)): + gisrc, env = gscript.create_environment( + gisenv()['GISDBASE'], self.selected_location[0].label, mapset=self.selected_mapset[0].label) + gisrc2, env2 = gscript.create_environment( + gisenv()['GISDBASE'], self.copy_location[i].label, mapset=self.copy_mapset[i].label) + new_name = self.copy_layer[i].label + if self.selected_location[0] == self.copy_location[i]: + # within one mapset + if self.selected_mapset[0] == self.copy_mapset[i]: + # ignore when just moves map + if self.copy_mode is False: + return + new_name = self._getNewMapName(_('New name for <{n}>').format(n=self.copy_layer[i].label), + _('Select new name'), + self.copy_layer[i].label, env=env, + mapset=self.selected_mapset[0].label, + element=self.copy_type[i].label) if not new_name: return - - string = self.copy_layer.label + '@' + self.copy_mapset.label + ',' + new_name - pasted = 0 - if self.copy_mode: - label = _("Copying <{name}>...").format(name=string) - else: - label = _("Moving <{name}>...").format(name=string) - self.showNotification.emit(message=label) - if self.copy_type.label == 'vector': - pasted, cmd = self._runCommand('g.copy', vector=string, env=env) - node = 'vector' - elif self.copy_type.label == 'raster': - pasted, cmd = self._runCommand('g.copy', raster=string, env=env) - node = 'raster' - else: - pasted, cmd = self._runCommand('g.copy', raster_3d=string, env=env) - node = 'raster_3d' - if pasted == 0: - self.InsertLayer(name=new_name, mapset_node=self.selected_mapset, - element_name=node) - Debug.msg(1, "COPIED TO: " + new_name) + # within one location, different mapsets + else: + if map_exists(new_name, element=self.copy_type[i].label, env=env, + mapset=self.selected_mapset[0].label): + new_name = self._getNewMapName(_('New name for <{n}>').format(n=self.copy_layer[i].label), + _('Select new name'), + self.copy_layer[i].label, env=env, + mapset=self.selected_mapset[0].label, + element=self.copy_type[i].label) + if not new_name: + return + + string = self.copy_layer[i].label + '@' + self.copy_mapset[i].label + ',' + new_name + pasted = 0 if self.copy_mode: - self.showNotification.emit(message=_("g.copy completed").format(cmd=cmd)) + label = _("Copying <{name}>...").format(name=string) else: - self.showNotification.emit(message=_("g.copy completed").format(cmd=cmd)) - - # remove old - if not self.copy_mode: - self._removeMapAfterCopy(env2) - - gscript.try_remove(gisrc) - gscript.try_remove(gisrc2) - # expand selected mapset - self.ExpandNode(self.selected_mapset, recursive=True) - self._initVariablesCatalog() - else: - if self.copy_type.label == 'raster_3d': - GError(_("Reprojection is not implemented for 3D rasters"), parent=self) - return - if map_exists(new_name, element=self.copy_type.label, env=env, - mapset=self.selected_mapset.label): - new_name = self._getNewMapName(_('New name'), _('Select new name'), - self.copy_layer.label, env=env, - mapset=self.selected_mapset.label, - element=self.copy_type.label) - if not new_name: + label = _("Moving <{name}>...").format(name=string) + self.showNotification.emit(message=label) + if self.copy_type[i].label == 'vector': + pasted, cmd = self._runCommand('g.copy', vector=string, env=env) + node = 'vector' + elif self.copy_type[i].label == 'raster': + pasted, cmd = self._runCommand('g.copy', raster=string, env=env) + node = 'raster' + else: + pasted, cmd = self._runCommand('g.copy', raster_3d=string, env=env) + node = 'raster_3d' + if pasted == 0: + self.InsertLayer(name=new_name, mapset_node=self.selected_mapset[0], + element_name=node) + Debug.msg(1, "COPIED TO: " + new_name) + if self.copy_mode: + self.showNotification.emit(message=_("g.copy completed")) + else: + self.showNotification.emit(message=_("g.copy completed")) + + # remove old + if not self.copy_mode: + self._removeMapAfterCopy(self.copy_layer[i], self.copy_type[i], env2) + + gscript.try_remove(gisrc) + gscript.try_remove(gisrc2) + # expand selected mapset + else: + if self.copy_type[i].label == 'raster_3d': + GError(_("Reprojection is not implemented for 3D rasters"), parent=self) return - gisdbase = gisenv()['GISDBASE'] - callback = lambda: self._onDoneReprojection(iEnv=env2, iGisrc=gisrc2, oGisrc=gisrc) - dlg = CatalogReprojectionDialog(self, self._giface, gisdbase, self.copy_location.label, - self.copy_mapset.label, self.copy_layer.label, env2, - gisdbase, self.selected_location.label, self.selected_mapset.label, - new_name, self.copy_type.label, env, callback) - dlg.ShowModal() - - def _onDoneReprojection(self, iEnv, iGisrc, oGisrc): - self.InsertLayer(name=self.copy_layer.label, mapset_node=self.selected_mapset, - element_name=self.copy_type.label) - if not self.copy_mode: - self._removeMapAfterCopy(iEnv) + if map_exists(new_name, element=self.copy_type[i].label, env=env, + mapset=self.selected_mapset[0].label): + new_name = self._getNewMapName(_('New name'), _('Select new name'), + self.copy_layer[i].label, env=env, + mapset=self.selected_mapset[0].label, + element=self.copy_type[i].label) + if not new_name: + continue + gisdbase = gisenv()['GISDBASE'] + callback = lambda gisrc2=gisrc2, gisrc=gisrc, cLayer=self.copy_layer[i], \ + cType=self.copy_type[i], cMode=self.copy_mode, name=new_name: \ + self._onDoneReprojection(env2, gisrc2, gisrc, cLayer, cType, cMode, name) + dlg = CatalogReprojectionDialog(self, self._giface, gisdbase, self.copy_location[i].label, + self.copy_mapset[i].label, self.copy_layer[i].label, env2, + gisdbase, self.selected_location[0].label, self.selected_mapset[0].label, + new_name, self.copy_type[i].label, env, callback) + dlg.ShowModal() + self.ExpandNode(self.selected_mapset[0], recursive=True) + self._initVariablesCatalog() + + def _onDoneReprojection(self, iEnv, iGisrc, oGisrc, cLayer, cType, cMode, name): + self.InsertLayer(name=name, mapset_node=self.selected_mapset[0], + element_name=cType.label) + if not cMode: + self._removeMapAfterCopy(cLayer, cType, iEnv) gscript.try_remove(iGisrc) gscript.try_remove(oGisrc) - self.ExpandNode(self.selected_mapset, recursive=True) - self._initVariablesCatalog() + self.ExpandNode(self.selected_mapset[0], recursive=True) - def _removeMapAfterCopy(self, env): - removed, cmd = self._runCommand('g.remove', type=self.copy_type.label, - name=self.copy_layer.label, flags='f', env=env) + def _removeMapAfterCopy(self, cLayer, cType, env): + removed, cmd = self._runCommand('g.remove', type=cType.label, + name=cLayer.label, flags='f', env=env) if removed == 0: - self._model.RemoveNode(self.copy_layer) - self.RefreshNode(self.copy_type, recursive=True) - Debug.msg(1, "LAYER " + self.copy_layer.label + " DELETED") - self.showNotification.emit(message=_("g.remove completed").format(cmd=cmd)) + self._model.RemoveNode(cLayer) + self.RefreshNode(cType, recursive=True) + Debug.msg(1, "LAYER " + cLayer.label + " DELETED") + self.showNotification.emit(message=_("g.remove completed")) def InsertLayer(self, name, mapset_node, element_name): """Insert layer into model and refresh tree""" @@ -779,73 +803,67 @@ def OnDeleteMap(self, event): """Delete layer or mapset""" - name = self.selected_layer.label - gisrc, env = gscript.create_environment( - gisenv()['GISDBASE'], - self.selected_location.label, self.selected_mapset.label) - if self._confirmDialog( - question=_( - "Do you really want to delete map <{m}> of type <{etype}> from mapset " - "<{mapset}> in location <{loc}>?").format( - m=name, mapset=self.selected_mapset.label, - etype=self.selected_type.label, - loc=self.selected_location.label), - title=_('Delete map')) == wx.ID_YES: - label = _("Deleting {name}...").format(name=name) + names = [self.selected_layer[i].label + '@' + self.selected_mapset[i].label + for i in range(len(self.selected_layer))] + if len(names) < 10: + question = _("Do you really want to delete map(s) <{m}>?").format(m=', '.join(names)) + else: + question = _("Do you really want to delete {n} maps?").format(n=len(names)) + if self._confirmDialog(question, title=_('Delete map')) == wx.ID_YES: + label = _("Deleting {name}...").format(name=names) self.showNotification.emit(message=label) - - removed, cmd = self._runCommand( - 'g.remove', flags='f', type=self.selected_type.label, name=name, env=env) - if removed == 0: - self._model.RemoveNode(self.selected_layer) - self.RefreshNode(self.selected_type, recursive=True) - Debug.msg(1, "LAYER " + name + " DELETED") - self.showNotification.emit( - message=_("g.remove completed").format(cmd=cmd)) - - # remove map layer from layer tree if exists - if not isinstance(self._giface, StandaloneGrassInterface): - name = self.selected_layer.label + '@' + self.selected_mapset.label - layers = self._giface.GetLayerList().GetLayersByName(name) - for layer in layers: - self._giface.GetLayerList().DeleteLayer(layer) - - gscript.try_remove(gisrc) + for i in range(len(self.selected_layer)): + gisrc, env = gscript.create_environment( + gisenv()['GISDBASE'], + self.selected_location[i].label, self.selected_mapset[i].label) + removed, cmd = self._runCommand( + 'g.remove', flags='f', type=self.selected_type[i].label, + name=self.selected_layer[i].label, env=env) + if removed == 0: + self._model.RemoveNode(self.selected_layer[i]) + self.RefreshNode(self.selected_type[i], recursive=True) + Debug.msg(1, "LAYER " + self.selected_layer[i].label + " DELETED") + + # remove map layer from layer tree if exists + if not isinstance(self._giface, StandaloneGrassInterface): + name = self.selected_layer[i].label + '@' + self.selected_mapset[i].label + layers = self._giface.GetLayerList().GetLayersByName(name) + for layer in layers: + self._giface.GetLayerList().DeleteLayer(layer) + + gscript.try_remove(gisrc) + self.UnselectAll() + self.showNotification.emit(message=_("g.remove completed")) def OnDisplayLayer(self, event): """Display layer in current graphics view""" self.DisplayLayer() - + def DisplayLayer(self): """Display selected layer in current graphics view""" - layerName = [] - if self.selected_location.label == gisenv( - )['LOCATION_NAME'] and self.selected_mapset: - string = self.selected_layer.label + '@' + self.selected_mapset.label - layerName.append(string) - label = _("Displaying {name}...").format(name=string) - self.showNotification.emit(message=label) - self._giface.lmgr.AddMaps( - layerName, self.selected_type.label, True) + all_names = [] + names = {'raster': [], 'vector': [], 'raster3d': []} + for i in range(len(self.selected_layer)): + name = self.selected_layer[i].label + '@' + self.selected_mapset[i].label + names[self.selected_type[i].label].append(name) + all_names.append(name) + #if self.selected_location[0].label == gisenv()['LOCATION_NAME'] and self.selected_mapset[0]: + for ltype in names: + if names[ltype]: + self._giface.lmgr.AddMaps(list(reversed(names[ltype])), ltype, True) + + if len(self._giface.GetLayerList()) == 1: + # zoom to map if there is only one map layer + self._giface.GetMapWindow().ZoomToMap() - if len(self._giface.GetLayerList()) == 1: - # zoom to map if there is only one map layer - self._giface.GetMapWindow().ZoomToMap() + Debug.msg(1, "Displayed layer(s): " + str(all_names)) - label = "d." + self.selected_type.label[:4] + " --q map=" + string + \ - _(" -- completed. Go to Layers tab for further operations.") - self.showNotification.emit(message=label) - Debug.msg(1, "LAYER " + self.selected_layer.label + " DISPLAYED") - else: - GError( - _("Failed to display layer: not in current mapset or invalid layer"), - parent=self) def OnBeginDrag(self, node, event): """Just copy necessary data""" - self.DefineItems(node) + self.DefineItems(self.GetSelected()) if self.selected_layer and not (self._restricted and gisenv()[ - 'LOCATION_NAME'] != self.selected_location.label): + 'LOCATION_NAME'] != self.selected_location[0].label): event.Allow() self.OnCopyMap(event) Debug.msg(1, "DRAG") @@ -856,8 +874,8 @@ """Copy layer into target""" self.copy_mode = wx.GetMouseState().ControlDown() if node: - self.DefineItems(node) - if self._restricted and gisenv()['MAPSET'] != self.selected_mapset.label: + self.DefineItems([node]) + if self._restricted and gisenv()['MAPSET'] != self.selected_mapset[0].label: GMessage(_("To move or copy maps to other mapsets, unlock editing of other mapsets"), parent=self) event.Veto() @@ -869,37 +887,41 @@ def OnSwitchLocationMapset(self, event): genv = gisenv() - if self.selected_location.label == genv['LOCATION_NAME']: - self.changeMapset.emit(mapset=self.selected_mapset.label) + if self.selected_location[0].label == genv['LOCATION_NAME']: + self.changeMapset.emit(mapset=self.selected_mapset[0].label) else: - self.changeLocation.emit(mapset=self.selected_mapset.label, location=self.selected_location.label) + self.changeLocation.emit(mapset=self.selected_mapset[0].label, location=self.selected_location[0].label) self.ExpandCurrentMapset() def OnMetadata(self, event): """Show metadata of any raster/vector/3draster""" def done(event): - gscript.try_remove(gisrc) + gscript.try_remove(event.userData) - if self.selected_type.label == 'raster': - cmd = ['r.info'] - elif self.selected_type.label == 'vector': - cmd = ['v.info'] - elif self.selected_type.label == 'raster_3d': - cmd = ['r3.info'] - cmd.append('map=%s@%s' % (self.selected_layer.label, self.selected_mapset.label)) - - gisrc, env = gscript.create_environment( - gisenv()['GISDBASE'], - self.selected_location.label, self.selected_mapset.label) - # print output to command log area - # temp gisrc file must be deleted onDone - self._giface.RunCmd(cmd, env=env, onDone=done) + for i in range(len(self.selected_layer)): + if self.selected_type[i].label == 'raster': + cmd = ['r.info'] + elif self.selected_type[i].label == 'vector': + cmd = ['v.info'] + elif self.selected_type[i].label == 'raster_3d': + cmd = ['r3.info'] + cmd.append('map=%s@%s' % (self.selected_layer[i].label, self.selected_mapset[i].label)) + + gisrc, env = gscript.create_environment( + gisenv()['GISDBASE'], + self.selected_location[i].label, self.selected_mapset[i].label) + # print output to command log area + # temp gisrc file must be deleted onDone + self._giface.RunCmd(cmd, env=env, onDone=done, userData=gisrc) def OnCopyName(self, event): """Copy layer name to clipboard""" if wx.TheClipboard.Open(): do = wx.TextDataObject() - do.SetText('%s@%s' % (self.selected_layer.label, self.selected_mapset.label)) + text = [] + for i in range(len(self.selected_layer)): + text.append('%s@%s' % (self.selected_layer[i].label, self.selected_mapset[i].label)) + do.SetText(','.join(text)) wx.TheClipboard.SetData(do) wx.TheClipboard.Close() @@ -947,11 +969,18 @@ def _isCurrent(self, genv): if self._restricted: - currentMapset = currentLocation = False - if self.selected_location.label == genv['LOCATION_NAME']: - currentLocation = True - if self.selected_mapset.label == genv['MAPSET']: - currentMapset = True + currentMapset = currentLocation = True + for i in range(len(self.selected_location)): + if self.selected_location[i].label != genv['LOCATION_NAME']: + currentLocation = False + currentMapset = False + break + if currentMapset: + for i in range(len(self.selected_mapset)): + if self.selected_mapset[i].label != genv['MAPSET']: + currentMapset = False + break + return currentLocation, currentMapset else: return True, True @@ -990,15 +1019,18 @@ item = wx.MenuItem(menu, wx.NewId(), _("&Rename")) menu.AppendItem(item) self.Bind(wx.EVT_MENU, self.OnRenameMap, item) - item.Enable(currentMapset) + item.Enable(currentMapset and len(self.selected_layer) == 1) menu.AppendSeparator() - if not isinstance(self._giface, StandaloneGrassInterface) and \ - self.selected_location.label == genv['LOCATION_NAME']: - item = wx.MenuItem(menu, wx.NewId(), _("&Display layer")) - menu.AppendItem(item) - self.Bind(wx.EVT_MENU, self.OnDisplayLayer, item) + if not isinstance(self._giface, StandaloneGrassInterface): + if all([each.label == genv['LOCATION_NAME'] for each in self.selected_location]): + if len(self.selected_layer) > 1: + item = wx.MenuItem(menu, wx.NewId(), _("&Display layers")) + else: + item = wx.MenuItem(menu, wx.NewId(), _("&Display layer")) + menu.AppendItem(item) + self.Bind(wx.EVT_MENU, self.OnDisplayLayer, item) item = wx.MenuItem(menu, wx.NewId(), _("Show &metadata")) menu.AppendItem(item) @@ -1009,7 +1041,7 @@ def _popupMenuMapset(self): """Create popup menu for mapsets""" - menu = wx.Menu() + menu = Menu() genv = gisenv() currentLocation, currentMapset = self._isCurrent(genv) @@ -1022,15 +1054,15 @@ item = wx.MenuItem(menu, wx.NewId(), _("&Switch mapset")) menu.AppendItem(item) self.Bind(wx.EVT_MENU, self.OnSwitchLocationMapset, item) - if (self.selected_location.label == genv['LOCATION_NAME'] - and self.selected_mapset.label == genv['MAPSET']): + if (self.selected_location[0].label == genv['LOCATION_NAME'] + and self.selected_mapset[0].label == genv['MAPSET']): item.Enable(False) self.PopupMenu(menu) menu.Destroy() def _popupMenuElement(self): """Create popup menu for elements""" - menu = wx.Menu() + menu = Menu() item = wx.MenuItem(menu, wx.NewId(), _("&Paste")) menu.AppendItem(item) self.Bind(wx.EVT_MENU, self.OnPasteMap, item) @@ -1041,3 +1073,12 @@ self.PopupMenu(menu) menu.Destroy() + + def _popupMenuEmpty(self): + """Create empty popup when multiple different types of items are selected""" + menu = Menu() + item = wx.MenuItem(menu, wx.NewId(), _("No available options")) + menu.AppendItem(item) + item.Enable(False) + self.PopupMenu(menu) + menu.Destroy() diff -Nru grass-7.6.1/gui/wxpython/dbmgr/base.py grass-7.8.0/gui/wxpython/dbmgr/base.py --- grass-7.6.1/gui/wxpython/dbmgr/base.py 2019-03-19 19:58:03.000000000 +0000 +++ grass-7.8.0/gui/wxpython/dbmgr/base.py 2019-06-03 20:34:20.000000000 +0000 @@ -36,6 +36,7 @@ import copy import types import math +import functools from core import globalvar import wx @@ -51,16 +52,22 @@ import wx.lib.scrolledpanel as scrolled import grass.script as grass +from grass.script.utils import decode from dbmgr.sqlbuilder import SQLBuilderSelect, SQLBuilderUpdate from core.gcmd import RunCommand, GException, GError, GMessage, GWarning -from core.utils import ListOfCatsToRange, _ +from core.utils import ListOfCatsToRange from gui_core.dialogs import CreateNewVector from dbmgr.vinfo import VectorDBInfo, GetUnicodeValue, CreateDbInfoDesc from core.debug import Debug from dbmgr.dialogs import ModifyTableRecord, AddColumnDialog from core.settings import UserSettings -from gui_core.wrap import SpinCtrl, Button, TextCtrl, ListCtrl, CheckBox +from gui_core.wrap import SpinCtrl, Button, TextCtrl, ListCtrl, CheckBox, \ + StaticText, StaticBox, Menu +from core.utils import cmp + +if sys.version_info.major >= 3: + unicode = str class Log: @@ -77,7 +84,7 @@ self.parent.SetStatusText(text_string.strip()) -class VirtualAttributeList(wx.ListCtrl, +class VirtualAttributeList(ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSorterMixin): """Support virtual list class for Attribute Table Manager (browse page) @@ -98,7 +105,7 @@ self.sqlFilter = {} - wx.ListCtrl.__init__(self, parent=parent, id=wx.ID_ANY, + ListCtrl.__init__(self, parent=parent, id=wx.ID_ANY, style=wx.LC_REPORT | wx.LC_HRULES | wx.LC_VRULES | wx.LC_VIRTUAL | wx.LC_SORT_ASCENDING) @@ -268,7 +275,7 @@ # but we need strip to get rid of the ending newline # which on windows leaves \r in a last empty attribute table cell # and causes error - record = outFile.readline().strip().replace('\n', '') + record = decode(outFile.readline().strip()).replace('\n', '') if not record: break @@ -332,7 +339,7 @@ cat = i + 1 for value in record: - if self.columns[columns[j]]['ctype'] != types.StringType: + if self.columns[columns[j]]['ctype'] != str: try: # casting disabled (2009/03) # self.itemDataMap[i].append(self.columns[columns[j]]['ctype'](value)) @@ -431,7 +438,7 @@ """Column heading right mouse button -> pop-up menu""" self._col = event.GetColumn() - popupMenu = wx.Menu() + popupMenu = Menu() if not hasattr(self, "popupID"): self.popupId = {'sortAsc': wx.NewId(), @@ -452,7 +459,7 @@ popupMenu.Append(self.popupId['sortAsc'], text=_("Sort ascending")) popupMenu.Append(self.popupId['sortDesc'], text=_("Sort descending")) popupMenu.AppendSeparator() - subMenu = wx.Menu() + subMenu = Menu() popupMenu.AppendMenu(self.popupId['calculate'], _( "Calculate (only numeric columns)"), subMenu) popupMenu.Append( @@ -641,13 +648,13 @@ """Sort items""" wx.BeginBusyCursor() items = list(self.itemDataMap.keys()) - items.sort(self.Sorter) + items.sort(key=functools.cmp_to_key(self.Sorter)) self.itemIndexMap = items # redraw the list self.Refresh() wx.EndBusyCursor() - + def Sorter(self, key1, key2): colName = self.GetColumn(self._col).GetText() ascending = self._colSortFlag[self._col] @@ -661,8 +668,8 @@ item2 = self.itemDataMap[key2][self._col] if isinstance( - item1, types.StringType) or isinstance( - item2, types.StringTypes): + item1, str) or isinstance( + item2, unicode): cmpVal = locale.strcoll(GetUnicodeValue(item1), GetUnicodeValue(item2)) else: cmpVal = cmp(item1, item2) @@ -681,6 +688,9 @@ """Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py""" return (self.sm_dn, self.sm_up) + def OnGetItemImage(self, item): + return -1 + def IsEmpty(self): """Check if list if empty""" if self.columns: @@ -1119,7 +1129,7 @@ # controls that are placed IN the wx.StaticBox, or it will freeze # on the Mac - listBox = wx.StaticBox( + listBox = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Attribute data - right-click to edit/manage records")) listSizer = wx.StaticBoxSizer(listBox, wx.VERTICAL) @@ -1151,8 +1161,8 @@ sqlQueryPanel = wx.Panel(parent=panel, id=wx.ID_ANY) # attribute data - sqlBox = wx.StaticBox(parent=sqlQueryPanel, id=wx.ID_ANY, - label=" %s " % _("SQL Query")) + sqlBox = StaticBox(parent=sqlQueryPanel, id=wx.ID_ANY, + label=" %s " % _("SQL Query")) sqlSizer = wx.StaticBoxSizer(sqlBox, wx.VERTICAL) @@ -1215,7 +1225,7 @@ _("Example: %s") % "MULTILANE = 'no' AND OBJECTID < 10") - sqlLabel = wx.StaticText( + sqlLabel = StaticText( parent=simpleSqlPanel, id=wx.ID_ANY, label="SELECT * FROM %s WHERE " % @@ -1225,7 +1235,7 @@ sqlNtb.AddPage(page=advancedSqlPanel, text=_('Builder')) - btnSqlBuilder = wx.Button( + btnSqlBuilder = Button( parent=advancedSqlPanel, id=wx.ID_ANY, label=_("SQL Builder")) @@ -1404,7 +1414,7 @@ tlist = self.FindWindowById(self.layerPage[self.selLayer]['data']) # generate popup-menu - menu = wx.Menu() + menu = Menu() menu.Append(self.popupDataID1, _("Edit selected record")) selected = tlist.GetFirstSelected() if not self.dbMgrData[ @@ -1778,7 +1788,7 @@ else: fn = tlist.GetItems - cats = map(int, fn()) + cats = list(map(int, fn())) digitToolbar = None if 'vdigit' in self.mapdisplay.toolbars: @@ -1980,7 +1990,7 @@ if digitToolbar and digitToolbar.GetLayer() and digitToolbar.GetLayer( ).GetName() == self.dbMgrData['vectName']: display = self.mapdisplay.GetMapWindow().GetDisplay() - display.SetSelected(map(int, cats), layer=self.selLayer) + display.SetSelected(list(map(int, cats)), layer=self.selLayer) self.mapdisplay.MapWindow.UpdateMap( render=True, renderVector=True) @@ -2274,8 +2284,8 @@ # # dbInfo # - dbBox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Database connection")) + dbBox = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Database connection")) dbSizer = wx.StaticBoxSizer(dbBox, wx.VERTICAL) dbSizer.Add( CreateDbInfoDesc( @@ -2290,7 +2300,7 @@ # table description # table = self.dbMgrData['mapDBInfo'].layers[layer]['table'] - tableBox = wx.StaticBox( + tableBox = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2305,17 +2315,17 @@ self.layerPage[layer]['tableData'] = tlist.GetId() # manage columns (add) - addBox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Add column")) + addBox = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Add column")) addSizer = wx.StaticBoxSizer(addBox, wx.HORIZONTAL) - column = wx.TextCtrl(parent=panel, id=wx.ID_ANY, value='', - size=(150, -1), style=wx.TE_PROCESS_ENTER) + column = TextCtrl(parent=panel, id=wx.ID_ANY, value='', + size=(150, -1), style=wx.TE_PROCESS_ENTER) column.Bind(wx.EVT_TEXT, self.OnTableAddColumnName) column.Bind(wx.EVT_TEXT_ENTER, self.OnTableItemAdd) self.layerPage[layer]['addColName'] = column.GetId() addSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Column")), @@ -2334,7 +2344,7 @@ ctype.Bind(wx.EVT_CHOICE, self.OnTableChangeType) self.layerPage[layer]['addColType'] = ctype.GetId() addSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Type")), @@ -2350,7 +2360,7 @@ length.Enable(False) self.layerPage[layer]['addColLength'] = length.GetId() addSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Length")), @@ -2360,7 +2370,7 @@ flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5) - btnAddCol = wx.Button(parent=panel, id=wx.ID_ANY, label=_("Add")) + btnAddCol = Button(parent=panel, id=wx.ID_ANY, label=_("Add")) btnAddCol.Bind(wx.EVT_BUTTON, self.OnTableItemAdd) btnAddCol.Enable(False) self.layerPage[layer]['addColButton'] = btnAddCol.GetId() @@ -2368,8 +2378,8 @@ border=3) # manage columns (rename) - renameBox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Rename column")) + renameBox = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Rename column")) renameSizer = wx.StaticBoxSizer(renameBox, wx.HORIZONTAL) columnFrom = wx.ComboBox( @@ -2379,7 +2389,7 @@ columnFrom.SetSelection(0) self.layerPage[layer]['renameCol'] = columnFrom.GetId() renameSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Column")), @@ -2389,13 +2399,13 @@ flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5) - columnTo = wx.TextCtrl(parent=panel, id=wx.ID_ANY, value='', - size=(150, -1), style=wx.TE_PROCESS_ENTER) + columnTo = TextCtrl(parent=panel, id=wx.ID_ANY, value='', + size=(150, -1), style=wx.TE_PROCESS_ENTER) columnTo.Bind(wx.EVT_TEXT, self.OnTableRenameColumnName) columnTo.Bind(wx.EVT_TEXT_ENTER, self.OnTableItemChange) self.layerPage[layer]['renameColTo'] = columnTo.GetId() renameSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("To")), @@ -2405,7 +2415,7 @@ flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5) - btnRenameCol = wx.Button( + btnRenameCol = Button( parent=panel, id=wx.ID_ANY, label=_("&Rename")) @@ -2580,7 +2590,7 @@ self.Bind(wx.EVT_MENU, self.OnTableReload, id=self.popupTableID3) # generate popup-menu - menu = wx.Menu() + menu = Menu() menu.Append(self.popupTableID1, _("Drop selected column")) if self.FindWindowById(self.layerPage[self.selLayer][ 'tableData']).GetFirstSelected() == -1: @@ -2766,8 +2776,8 @@ panelList = wx.Panel(parent=splitterWin, id=wx.ID_ANY) panelListSizer = wx.BoxSizer(wx.VERTICAL) - layerBox = wx.StaticBox(parent=panelList, id=wx.ID_ANY, - label=" %s " % _("List of layers")) + layerBox = StaticBox(parent=panelList, id=wx.ID_ANY, + label=" %s " % _("List of layers")) layerSizer = wx.StaticBoxSizer(layerBox, wx.VERTICAL) self.layerList = self._createLayerDesc(panelList) @@ -2838,7 +2848,7 @@ self.layerList.Update(self.dbMgrData['mapDBInfo'].layers) self.layerList.Populate(update=True) # update selected widgets - listOfLayers = map(str, self.dbMgrData['mapDBInfo'].layers.keys()) + listOfLayers = list(map(str, self.dbMgrData['mapDBInfo'].layers.keys())) # delete layer page self.manageLayerBook.deleteLayer.SetItems(listOfLayers) if len(listOfLayers) > 0: @@ -3063,38 +3073,38 @@ # layer description - layerBox = wx.StaticBox(parent=self.addPanel, id=wx.ID_ANY, - label=" %s " % (_("Layer description"))) + layerBox = StaticBox(parent=self.addPanel, id=wx.ID_ANY, + label=" %s " % (_("Layer description"))) layerSizer = wx.StaticBoxSizer(layerBox, wx.VERTICAL) # # list of layer widgets (label, value) # self.addLayerWidgets = {'layer': - (wx.StaticText(parent=self.addPanel, id=wx.ID_ANY, - label='%s:' % _("Layer")), + (StaticText(parent=self.addPanel, id=wx.ID_ANY, + label='%s:' % _("Layer")), SpinCtrl(parent=self.addPanel, id=wx.ID_ANY, size=(65, -1), initial=maxLayer + 1, min=1, max=1e6)), 'driver': - (wx.StaticText(parent=self.addPanel, id=wx.ID_ANY, - label='%s:' % _("Driver")), + (StaticText(parent=self.addPanel, id=wx.ID_ANY, + label='%s:' % _("Driver")), wx.Choice(parent=self.addPanel, id=wx.ID_ANY, size=(200, -1), choices=self.listOfDrivers)), 'database': - (wx.StaticText(parent=self.addPanel, id=wx.ID_ANY, - label='%s:' % _("Database")), - wx.TextCtrl(parent=self.addPanel, id=wx.ID_ANY, - value='', - style=wx.TE_PROCESS_ENTER)), + (StaticText(parent=self.addPanel, id=wx.ID_ANY, + label='%s:' % _("Database")), + TextCtrl(parent=self.addPanel, id=wx.ID_ANY, + value='', + style=wx.TE_PROCESS_ENTER)), 'table': - (wx.StaticText(parent=self.addPanel, id=wx.ID_ANY, - label='%s:' % _("Table")), + (StaticText(parent=self.addPanel, id=wx.ID_ANY, + label='%s:' % _("Table")), wx.Choice(parent=self.addPanel, id=wx.ID_ANY, size=(200, -1), choices=self.defaultTables)), 'key': - (wx.StaticText(parent=self.addPanel, id=wx.ID_ANY, - label='%s:' % _("Key column")), + (StaticText(parent=self.addPanel, id=wx.ID_ANY, + label='%s:' % _("Key column")), wx.Choice(parent=self.addPanel, id=wx.ID_ANY, size=(200, -1), choices=self.defaultColumns)), 'addCat': @@ -3124,38 +3134,38 @@ _("You need to add categories " "by v.category module.")) # table description - tableBox = wx.StaticBox(parent=self.addPanel, id=wx.ID_ANY, - label=" %s " % (_("Table description"))) + tableBox = StaticBox(parent=self.addPanel, id=wx.ID_ANY, + label=" %s " % (_("Table description"))) tableSizer = wx.StaticBoxSizer(tableBox, wx.VERTICAL) # # list of table widgets # keyCol = UserSettings.Get(group='atm', key='keycolumn', subkey='value') - self.tableWidgets = {'table': (wx.StaticText(parent=self.addPanel, id=wx.ID_ANY, - label='%s:' % _("Table name")), - wx.TextCtrl(parent=self.addPanel, id=wx.ID_ANY, - value='', - style=wx.TE_PROCESS_ENTER)), - 'key': (wx.StaticText(parent=self.addPanel, id=wx.ID_ANY, - label='%s:' % _("Key column")), - wx.TextCtrl(parent=self.addPanel, id=wx.ID_ANY, - value=keyCol, - style=wx.TE_PROCESS_ENTER))} + self.tableWidgets = {'table': (StaticText(parent=self.addPanel, id=wx.ID_ANY, + label='%s:' % _("Table name")), + TextCtrl(parent=self.addPanel, id=wx.ID_ANY, + value='', + style=wx.TE_PROCESS_ENTER)), + 'key': (StaticText(parent=self.addPanel, id=wx.ID_ANY, + label='%s:' % _("Key column")), + TextCtrl(parent=self.addPanel, id=wx.ID_ANY, + value=keyCol, + style=wx.TE_PROCESS_ENTER))} # events self.tableWidgets['table'][1].Bind( wx.EVT_TEXT_ENTER, self.OnCreateTable) self.tableWidgets['key'][1].Bind(wx.EVT_TEXT_ENTER, self.OnCreateTable) - btnTable = wx.Button(self.addPanel, wx.ID_ANY, _("&Create table"), + btnTable = Button(self.addPanel, wx.ID_ANY, _("&Create table"), size=(125, -1)) btnTable.Bind(wx.EVT_BUTTON, self.OnCreateTable) - btnLayer = wx.Button(self.addPanel, wx.ID_ANY, _("&Add layer"), + btnLayer = Button(self.addPanel, wx.ID_ANY, _("&Add layer"), size=(125, -1)) btnLayer.Bind(wx.EVT_BUTTON, self.OnAddLayer) - btnDefault = wx.Button(self.addPanel, wx.ID_ANY, _("&Set default"), + btnDefault = Button(self.addPanel, wx.ID_ANY, _("&Set default"), size=(125, -1)) btnDefault.Bind(wx.EVT_BUTTON, self.OnSetDefault) @@ -3261,13 +3271,13 @@ self.deletePanel = wx.Panel(parent=self, id=wx.ID_ANY) self.AddPage(page=self.deletePanel, text=_("Remove layer")) - label = wx.StaticText(parent=self.deletePanel, id=wx.ID_ANY, - label='%s:' % _("Layer to remove")) + label = StaticText(parent=self.deletePanel, id=wx.ID_ANY, + label='%s:' % _("Layer to remove")) self.deleteLayer = wx.ComboBox( parent=self.deletePanel, id=wx.ID_ANY, size=(100, -1), style=wx.CB_SIMPLE | wx.CB_READONLY, - choices=map(str, self.mapDBInfo.layers.keys())) + choices=list(map(str, self.mapDBInfo.layers.keys()))) self.deleteLayer.SetSelection(0) self.deleteLayer.Bind(wx.EVT_COMBOBOX, self.OnChangeLayer) @@ -3287,7 +3297,7 @@ self.deleteLayer.Enable(False) self.deleteTable.Enable(False) - btnDelete = wx.Button( + btnDelete = Button( self.deletePanel, wx.ID_DELETE, _("&Remove layer"), size=(125, -1)) btnDelete.Bind(wx.EVT_BUTTON, self.OnDeleteLayer) @@ -3337,34 +3347,34 @@ # list of layer widgets (label, value) # self.modifyLayerWidgets = {'layer': - (wx.StaticText(parent=self.modifyPanel, id=wx.ID_ANY, - label='%s:' % _("Layer")), + (StaticText(parent=self.modifyPanel, id=wx.ID_ANY, + label='%s:' % _("Layer")), wx.ComboBox(parent=self.modifyPanel, id=wx.ID_ANY, size=(100, -1), style=wx.CB_SIMPLE | wx.CB_READONLY, - choices=map(str, - self.mapDBInfo.layers.keys()))), + choices=list(map(str, + self.mapDBInfo.layers.keys())))), 'driver': - (wx.StaticText(parent=self.modifyPanel, id=wx.ID_ANY, - label='%s:' % _("Driver")), + (StaticText(parent=self.modifyPanel, id=wx.ID_ANY, + label='%s:' % _("Driver")), wx.Choice(parent=self.modifyPanel, id=wx.ID_ANY, size=(200, -1), choices=self.listOfDrivers)), 'database': - (wx.StaticText(parent=self.modifyPanel, id=wx.ID_ANY, - label='%s:' % _("Database")), - wx.TextCtrl(parent=self.modifyPanel, id=wx.ID_ANY, - value='', size=(350, -1), - style=wx.TE_PROCESS_ENTER)), + (StaticText(parent=self.modifyPanel, id=wx.ID_ANY, + label='%s:' % _("Database")), + TextCtrl(parent=self.modifyPanel, id=wx.ID_ANY, + value='', size=(350, -1), + style=wx.TE_PROCESS_ENTER)), 'table': - (wx.StaticText(parent=self.modifyPanel, id=wx.ID_ANY, - label='%s:' % _("Table")), + (StaticText(parent=self.modifyPanel, id=wx.ID_ANY, + label='%s:' % _("Table")), wx.Choice(parent=self.modifyPanel, id=wx.ID_ANY, size=(200, -1), choices=self.defaultTables)), 'key': - (wx.StaticText(parent=self.modifyPanel, id=wx.ID_ANY, - label='%s:' % _("Key column")), + (StaticText(parent=self.modifyPanel, id=wx.ID_ANY, + label='%s:' % _("Key column")), wx.Choice(parent=self.modifyPanel, id=wx.ID_ANY, size=(200, -1), choices=self.defaultColumns))} @@ -3406,7 +3416,7 @@ # self.modifyLayerWidgets['database'][1].Bind(wx.EVT_TEXT_ENTER, self.OnDatabaseChanged) # self.modifyLayerWidgets['table'][1].Bind(wx.EVT_CHOICE, self.OnTableChanged) - btnModify = wx.Button( + btnModify = Button( self.modifyPanel, wx.ID_DELETE, _("&Modify layer"), size=(125, -1)) btnModify.Bind(wx.EVT_BUTTON, self.OnModifyLayer) @@ -3782,7 +3792,7 @@ self.sp = scrolled.ScrolledPanel(parent=self.panel, id=wx.ID_ANY, size=( 250, 150), style=wx.TAB_TRAVERSAL | wx.SUNKEN_BORDER, name="Statistics") - self.text = wx.TextCtrl( + self.text = TextCtrl( parent=self.sp, id=wx.ID_ANY, style=wx.TE_MULTILINE | wx.TE_READONLY) @@ -3792,7 +3802,7 @@ self.btnClipboard = Button(parent=self.panel, id=wx.ID_COPY) self.btnClipboard.SetToolTip( _("Copy statistics the clipboard (Ctrl+C)")) - self.btnCancel = wx.Button(parent=self.panel, id=wx.ID_CLOSE) + self.btnCancel = Button(parent=self.panel, id=wx.ID_CLOSE) self.btnCancel.SetDefault() # bindings @@ -3915,7 +3925,7 @@ GWarning(parent=self.parent, message=_("Unable to calculte standard deviation.")) varSum = 0 - for var in dataVar.splitlines(): + for var in decode(dataVar).splitlines(): varSum += float(var) stddev = math.sqrt(varSum / count) diff -Nru grass-7.6.1/gui/wxpython/dbmgr/dialogs.py grass-7.8.0/gui/wxpython/dbmgr/dialogs.py --- grass-7.6.1/gui/wxpython/dbmgr/dialogs.py 2019-03-19 19:57:46.000000000 +0000 +++ grass-7.8.0/gui/wxpython/dbmgr/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,9 +19,9 @@ import os import types +import six from core import globalvar -from core.utils import _ import wx import wx.lib.scrolledpanel as scrolled @@ -30,7 +30,8 @@ from core.settings import UserSettings from dbmgr.vinfo import VectorDBInfo, GetUnicodeValue from gui_core.widgets import IntegerValidator, FloatValidator -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \ + TextCtrl class DisplayAttributesDialog(wx.Dialog): @@ -110,10 +111,10 @@ self.fidMulti = wx.Choice(parent=self, id=wx.ID_ANY, size=(150, -1)) self.fidMulti.Bind(wx.EVT_CHOICE, self.OnFeature) - self.fidText = wx.StaticText(parent=self, id=wx.ID_ANY) + self.fidText = StaticText(parent=self, id=wx.ID_ANY) - self.noFoundMsg = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("No attributes found")) + self.noFoundMsg = StaticText(parent=self, id=wx.ID_ANY, + label=_("No attributes found")) self.UpdateDialog(query=query, cats=cats) @@ -126,9 +127,9 @@ self.SetTitle(_("Display attributes")) # buttons - btnCancel = wx.Button(self, wx.ID_CANCEL) - btnReset = wx.Button(self, wx.ID_UNDO, _("&Reload")) - btnSubmit = wx.Button(self, wx.ID_OK, _("&Submit")) + btnCancel = Button(self, wx.ID_CANCEL) + btnReset = Button(self, wx.ID_UNDO, _("&Reload")) + btnSubmit = Button(self, wx.ID_OK, _("&Submit")) if self.action == 'display': btnSubmit.Enable(False) @@ -145,8 +146,8 @@ mainSizer.Add(self.notebook, proportion=1, flag=wx.EXPAND | wx.ALL, border=5) fidSizer = wx.BoxSizer(wx.HORIZONTAL) - fidSizer.Add(wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Feature id:")), + fidSizer.Add(StaticText(parent=self, id=wx.ID_ANY, + label=_("Feature id:")), proportion=0, border=5, flag=wx.ALIGN_CENTER_VERTICAL) fidSizer.Add(self.fidMulti, proportion=0, @@ -438,7 +439,7 @@ if fid > 0: self.fid = fid elif len(self.cats.keys()) > 0: - self.fid = self.cats.keys()[0] + self.fid = list(self.cats.keys())[0] else: self.fid = -1 @@ -529,18 +530,18 @@ ctype = columns[name]['ctype'] if columns[name]['values'][idx] is not None: - if columns[name]['ctype'] != types.StringType: + if not isinstance(columns[name]['ctype'], six.string_types): value = str(columns[name]['values'][idx]) else: value = columns[name]['values'][idx] else: value = '' - colName = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=name) - colType = wx.StaticText(parent=panel, id=wx.ID_ANY, - label="[%s]:" % vtype) - colValue = wx.TextCtrl( + colName = StaticText(parent=panel, id=wx.ID_ANY, + label=name) + colType = StaticText(parent=panel, id=wx.ID_ANY, + label="[%s]:" % vtype) + colValue = TextCtrl( parent=panel, id=wx.ID_ANY, value=value) colValue.SetName(name) if ctype == int: @@ -591,7 +592,7 @@ table = self.mapDBInfo.GetTable(layer) columns = self.mapDBInfo.GetTableDesc(table) - for key, col in columns.iteritems(): + for key, col in six.iteritems(columns): if key == column: col['values'] = [col['ctype'](value), ] break @@ -614,15 +615,15 @@ self.keyId = keyEditable[0] - box = wx.StaticBox(parent=self, id=wx.ID_ANY) + box = StaticBox(parent=self, id=wx.ID_ANY) box.Hide() self.dataPanel = scrolled.ScrolledPanel(parent=self, id=wx.ID_ANY, style=wx.TAB_TRAVERSAL) self.dataPanel.SetupScrolling(scroll_x=False) # buttons - self.btnCancel = wx.Button(self, wx.ID_CANCEL) - self.btnSubmit = wx.Button(self, wx.ID_OK, _("&Submit")) + self.btnCancel = Button(self, wx.ID_CANCEL) + self.btnSubmit = Button(self, wx.ID_OK, _("&Submit")) self.btnSubmit.SetDefault() # data area @@ -647,8 +648,8 @@ parent=self.dataPanel, id=wx.ID_ANY, value=value, min=-1e9, max=1e9, size=(250, -1)) else: - valueWin = wx.TextCtrl(parent=self.dataPanel, id=wx.ID_ANY, - value=value, size=(250, -1)) + valueWin = TextCtrl(parent=self.dataPanel, id=wx.ID_ANY, + value=value, size=(250, -1)) if ctype == int: valueWin.SetValidator(IntegerValidator()) elif ctype == float: @@ -657,10 +658,10 @@ wx.CallAfter(valueWin.SetFocus) winFocus = True - label = wx.StaticText(parent=self.dataPanel, id=wx.ID_ANY, - label=column) - ctype = wx.StaticText(parent=self.dataPanel, id=wx.ID_ANY, - label="[%s]:" % ctypeStr.lower()) + label = StaticText(parent=self.dataPanel, id=wx.ID_ANY, + label=column) + ctype = StaticText(parent=self.dataPanel, id=wx.ID_ANY, + label="[%s]:" % ctypeStr.lower()) self.widgets.append( (label.GetId(), ctype.GetId(), valueWin.GetId())) @@ -752,7 +753,7 @@ self.CenterOnParent() self.data = {} - self.data['addColName'] = wx.TextCtrl( + self.data['addColName'] = TextCtrl( parent=self, id=wx.ID_ANY, value='', size=( 150, -1), style=wx.TE_PROCESS_ENTER) @@ -770,8 +771,8 @@ self.data['addColLength'].Enable(False) # buttons - self.btnCancel = wx.Button(self, wx.ID_CANCEL) - self.btnOk = wx.Button(self, wx.ID_OK) + self.btnCancel = Button(self, wx.ID_CANCEL) + self.btnOk = Button(self, wx.ID_OK) self.btnOk.SetDefault() self._layout() @@ -782,7 +783,7 @@ addSizer = wx.BoxSizer(wx.HORIZONTAL) addSizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_("Column")), @@ -793,7 +794,7 @@ border=5) addSizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_("Type")), @@ -804,7 +805,7 @@ border=5) addSizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_("Length")), diff -Nru grass-7.6.1/gui/wxpython/dbmgr/g.gui.dbmgr.html grass-7.8.0/gui/wxpython/dbmgr/g.gui.dbmgr.html --- grass-7.6.1/gui/wxpython/dbmgr/g.gui.dbmgr.html 2019-03-19 19:58:03.000000000 +0000 +++ grass-7.8.0/gui/wxpython/dbmgr/g.gui.dbmgr.html 2019-05-18 15:50:04.000000000 +0000 @@ -81,4 +81,4 @@ Jachym Cepicky

-$Date: 2017-11-11 19:59:24 +0100 (Sat, 11 Nov 2017) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/dbmgr/g.gui.dbmgr.py grass-7.8.0/gui/wxpython/dbmgr/g.gui.dbmgr.py --- grass-7.6.1/gui/wxpython/dbmgr/g.gui.dbmgr.py 2019-03-19 19:57:46.000000000 +0000 +++ grass-7.8.0/gui/wxpython/dbmgr/g.gui.dbmgr.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: g.gui.dbmgr @@ -39,7 +39,6 @@ from grass.script.setup import set_gui_path set_gui_path() - from core.utils import _ from dbmgr.manager import AttributeManager mapName = gscript.find_file(options['map'], element='vector')['fullname'] diff -Nru grass-7.6.1/gui/wxpython/dbmgr/manager.py grass-7.8.0/gui/wxpython/dbmgr/manager.py --- grass-7.6.1/gui/wxpython/dbmgr/manager.py 2019-03-19 19:57:46.000000000 +0000 +++ grass-7.8.0/gui/wxpython/dbmgr/manager.py 2019-06-03 20:34:20.000000000 +0000 @@ -40,7 +40,6 @@ from core.gcmd import GMessage from core.debug import Debug -from core.utils import _ from dbmgr.base import DbMgrBase from gui_core.widgets import GNotebook from gui_core.wrap import Button diff -Nru grass-7.6.1/gui/wxpython/dbmgr/sqlbuilder.py grass-7.8.0/gui/wxpython/dbmgr/sqlbuilder.py --- grass-7.6.1/gui/wxpython/dbmgr/sqlbuilder.py 2019-03-19 19:57:46.000000000 +0000 +++ grass-7.8.0/gui/wxpython/dbmgr/sqlbuilder.py 2019-06-03 20:34:20.000000000 +0000 @@ -28,15 +28,16 @@ import os import sys +import six from core import globalvar -from core.utils import _ import wx from grass.pydispatch.signal import Signal from core.gcmd import RunCommand, GError, GMessage from dbmgr.vinfo import CreateDbInfoDesc, VectorDBInfo, GetUnicodeValue +from gui_core.wrap import Button, TextCtrl, StaticText, StaticBox import grass.script as grass @@ -95,8 +96,8 @@ # dbInfo if showDbInfo: - databasebox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _("Database connection")) + databasebox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _("Database connection")) databaseboxsizer = wx.StaticBoxSizer(databasebox, wx.VERTICAL) databaseboxsizer.Add( CreateDbInfoDesc( @@ -111,11 +112,11 @@ # text areas # # sql box - sqlbox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _("Query")) + sqlbox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _("Query")) sqlboxsizer = wx.StaticBoxSizer(sqlbox, wx.VERTICAL) - self.text_sql = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY, + self.text_sql = TextCtrl(parent=self.panel, id=wx.ID_ANY, value='', size=(-1, 50), style=wx.TE_MULTILINE) @@ -127,13 +128,12 @@ # # buttons # - self.btn_clear = wx.Button(parent=self.panel, id=wx.ID_CLEAR) - self.btn_clear.SetToolTipString(_("Set SQL statement to default")) - self.btn_apply = wx.Button(parent=self.panel, id=wx.ID_APPLY) - self.btn_apply.SetToolTipString( - _("Apply SQL statement")) - self.btn_close = wx.Button(parent=self.panel, id=wx.ID_CLOSE) - self.btn_close.SetToolTipString(_("Close the dialog")) + self.btn_clear = Button(parent=self.panel, id=wx.ID_CLEAR) + self.btn_clear.SetToolTip(_("Set SQL statement to default")) + self.btn_apply = Button(parent=self.panel, id=wx.ID_APPLY) + self.btn_apply.SetToolTip(_("Apply SQL statement")) + self.btn_close = Button(parent=self.panel, id=wx.ID_CLOSE) + self.btn_close.SetToolTip(_("Close the dialog")) self.btn_logic = {'is': ['=', ], 'isnot': ['!=', ], @@ -149,8 +149,8 @@ 'prc': ['%', ]} self.btn_logicpanel = wx.Panel(parent=self.panel, id=wx.ID_ANY) - for key, value in self.btn_logic.iteritems(): - btn = wx.Button(parent=self.btn_logicpanel, id=wx.ID_ANY, + for key, value in six.iteritems(self.btn_logic): + btn = Button(parent=self.btn_logicpanel, id=wx.ID_ANY, label=value[0]) self.btn_logic[key].append(btn.GetId()) @@ -219,8 +219,8 @@ # self.hsizer = wx.BoxSizer(wx.HORIZONTAL) - columnsbox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _("Columns")) + columnsbox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _("Columns")) columnsizer = wx.StaticBoxSizer(columnsbox, wx.VERTICAL) self.list_columns = wx.ListBox( parent=self.panel, @@ -248,8 +248,8 @@ # self.list_values.SetMinSize((-1,100)) self.valuespanel = wx.Panel(parent=self.panel, id=wx.ID_ANY) - valuesbox = wx.StaticBox(parent=self.valuespanel, id=wx.ID_ANY, - label=" %s " % _("Values")) + valuesbox = StaticBox(parent=self.valuespanel, id=wx.ID_ANY, + label=" %s " % _("Values")) valuesizer = wx.StaticBoxSizer(valuesbox, wx.VERTICAL) self.list_values = wx.ListBox(parent=self.valuespanel, id=wx.ID_ANY, choices=self.colvalues, @@ -258,14 +258,14 @@ flag=wx.EXPAND) self.valuespanel.SetSizer(valuesizer) - self.btn_unique = wx.Button(parent=self.valuespanel, id=wx.ID_ANY, + self.btn_unique = Button(parent=self.valuespanel, id=wx.ID_ANY, label=_("Get all values")) self.btn_unique.Enable(False) - self.btn_uniquesample = wx.Button( + self.btn_uniquesample = Button( parent=self.valuespanel, id=wx.ID_ANY, label=_("Get sample")) - self.btn_uniquesample.SetToolTipString( + self.btn_uniquesample.SetToolTip( _("Get first 256 unique values as sample")) self.btn_uniquesample.Enable(False) @@ -280,12 +280,12 @@ # go to gotosizer = wx.BoxSizer(wx.HORIZONTAL) - self.goto = wx.TextCtrl( + self.goto = TextCtrl( parent=self.valuespanel, id=wx.ID_ANY, style=wx.TE_PROCESS_ENTER) - gotosizer.Add(wx.StaticText(parent=self.valuespanel, id=wx.ID_ANY, - label=_("Go to:")), proportion=0, + gotosizer.Add(StaticText(parent=self.valuespanel, id=wx.ID_ANY, + label=_("Go to:")), proportion=0, flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, border=5) gotosizer.Add(self.goto, proportion=1, flag=wx.EXPAND) @@ -339,7 +339,7 @@ self.btn_unique.Bind(wx.EVT_BUTTON, self.OnUniqueValues) self.btn_uniquesample.Bind(wx.EVT_BUTTON, self.OnSampleValues) - for key, value in self.btn_logic.iteritems(): + for key, value in six.iteritems(self.btn_logic): self.FindWindowById(value[1]).Bind(wx.EVT_BUTTON, self.OnAddMark) self.btn_close.Bind(wx.EVT_BUTTON, self.OnClose) @@ -454,7 +454,7 @@ self.btn_arithmeticpanel.IsShown(): btns = self.btn_arithmetic - for key, value in btns.iteritems(): + for key, value in six.iteritems(btns): if event.GetId() == value[1]: mark = value[0] break @@ -494,13 +494,13 @@ SQLBuilder._doLayout(self, modeChoices) self.text_sql.SetValue("SELECT * FROM %s" % self.tablename) - self.text_sql.SetToolTipString( + self.text_sql.SetToolTip( _("Example: %s") % "SELECT * FROM roadsmajor WHERE MULTILANE = 'no' OR OBJECTID < 10") - self.btn_verify = wx.Button(parent=self.panel, id=wx.ID_ANY, + self.btn_verify = Button(parent=self.panel, id=wx.ID_ANY, label=_("Verify")) - self.btn_verify.SetToolTipString(_("Verify SQL statement")) + self.btn_verify.SetToolTip(_("Verify SQL statement")) self.buttonsizer.Insert(1, self.btn_verify) @@ -659,8 +659,8 @@ self.btn_arithmeticpanel = wx.Panel(parent=self.panel, id=wx.ID_ANY) - for key, value in self.btn_arithmetic.iteritems(): - btn = wx.Button(parent=self.btn_arithmeticpanel, id=wx.ID_ANY, + for key, value in six.iteritems(self.btn_arithmetic): + btn = Button(parent=self.btn_arithmeticpanel, id=wx.ID_ANY, label=value[0]) self.btn_arithmetic[key].append(btn.GetId()) @@ -700,8 +700,8 @@ self.funcpanel = wx.Panel(parent=self.panel, id=wx.ID_ANY) self._initSqlFunctions() - funcsbox = wx.StaticBox(parent=self.funcpanel, id=wx.ID_ANY, - label=" %s " % _("Functions")) + funcsbox = StaticBox(parent=self.funcpanel, id=wx.ID_ANY, + label=" %s " % _("Functions")) funcsizer = wx.StaticBoxSizer(funcsbox, wx.VERTICAL) self.list_func = wx.ListBox(parent=self.funcpanel, id=wx.ID_ANY, choices=self.sqlFuncs['sqlite'].keys(), @@ -716,7 +716,7 @@ proportion=1, flag=wx.EXPAND) self.list_func.Bind(wx.EVT_LISTBOX, self.OnAddFunc) - for key, value in self.btn_arithmetic.iteritems(): + for key, value in six.iteritems(self.btn_arithmetic): self.FindWindowById(value[1]).Bind(wx.EVT_BUTTON, self.OnAddMark) self.mode.SetSelection(0) self.OnMode(None) diff -Nru grass-7.6.1/gui/wxpython/dbmgr/vinfo.py grass-7.8.0/gui/wxpython/dbmgr/vinfo.py --- grass-7.6.1/gui/wxpython/dbmgr/vinfo.py 2019-03-19 19:57:46.000000000 +0000 +++ grass-7.8.0/gui/wxpython/dbmgr/vinfo.py 2019-06-03 20:34:20.000000000 +0000 @@ -16,15 +16,19 @@ import os import types +import sys +import six import wx from gui_core.gselect import VectorDBInfo as VectorDBInfoBase +from gui_core.wrap import StaticText from core.gcmd import RunCommand, GError from core.settings import UserSettings -from core.utils import _ import grass.script as grass +if sys.version_info.major >= 3: + unicode = str def GetUnicodeValue(value): """Get unicode value @@ -33,7 +37,7 @@ :return: unicode value """ - if isinstance(value, types.UnicodeType): + if isinstance(value, unicode): return value enc = UserSettings.Get(group='atm', key='encoding', subkey='value') @@ -50,31 +54,31 @@ infoFlexSizer = wx.FlexGridSizer(cols=2, hgap=1, vgap=1) infoFlexSizer.AddGrowableCol(1) - infoFlexSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label="Driver:")) + infoFlexSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label="Driver:")) infoFlexSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=mapDBInfo.layers[layer]['driver'])) - infoFlexSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label="Database:")) + infoFlexSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label="Database:")) infoFlexSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=mapDBInfo.layers[layer]['database'])) - infoFlexSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label="Table:")) + infoFlexSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label="Table:")) infoFlexSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=mapDBInfo.layers[layer]['table'])) - infoFlexSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label="Key:")) - infoFlexSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=mapDBInfo.layers[layer]['key'])) + infoFlexSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label="Key:")) + infoFlexSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=mapDBInfo.layers[layer]['key'])) return infoFlexSizer @@ -93,7 +97,7 @@ except KeyError: return [] - for name, desc in self.tables[table].iteritems(): + for name, desc in six.iteritems(self.tables[table]): names[desc['index']] = name return names @@ -131,7 +135,7 @@ continue table = record['Table'] - for key, value in record['Attributes'].iteritems(): + for key, value in six.iteritems(record['Attributes']): if len(value) < 1: value = None else: @@ -141,7 +145,7 @@ value = GetUnicodeValue(value) self.tables[table][key]['values'].append(value) - for key, value in record.iteritems(): + for key, value in six.iteritems(record): if key == 'Attributes': continue if key in ret: diff -Nru grass-7.6.1/gui/wxpython/docs/wxGUI.components.html grass-7.8.0/gui/wxpython/docs/wxGUI.components.html --- grass-7.6.1/gui/wxpython/docs/wxGUI.components.html 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/docs/wxGUI.components.html 2019-05-18 15:50:04.000000000 +0000 @@ -35,4 +35,4 @@

-$Date: 2017-11-23 04:09:36 +0100 (Thu, 23 Nov 2017) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/docs/wxGUI.html grass-7.8.0/gui/wxpython/docs/wxGUI.html --- grass-7.6.1/gui/wxpython/docs/wxGUI.html 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/docs/wxGUI.html 2019-08-11 09:05:20.000000000 +0000 @@ -687,7 +687,7 @@ specifying the --gui switch:

-grass76 --gui
+grass78 --gui
 
@@ -730,4 +730,4 @@ Icons created by Robert Szczepanek, Poland (Git repository)

-$Date: 2018-09-05 07:59:43 +0200 (Wed, 05 Sep 2018) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/docs/wxGUI.iscatt.html grass-7.8.0/gui/wxpython/docs/wxGUI.iscatt.html --- grass-7.6.1/gui/wxpython/docs/wxGUI.iscatt.html 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/docs/wxGUI.iscatt.html 2019-05-18 15:50:04.000000000 +0000 @@ -86,4 +86,4 @@ Summer of Code 2013 (mentor: Martin Landa)

-$Date: 2018-10-14 21:39:26 +0200 (Sun, 14 Oct 2018) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/docs/wxGUI.modules.html grass-7.8.0/gui/wxpython/docs/wxGUI.modules.html --- grass-7.6.1/gui/wxpython/docs/wxGUI.modules.html 2019-03-19 19:57:43.000000000 +0000 +++ grass-7.8.0/gui/wxpython/docs/wxGUI.modules.html 2019-05-18 15:50:04.000000000 +0000 @@ -188,4 +188,4 @@

-$Date: 2016-04-09 18:43:25 +0200 (Sat, 09 Apr 2016) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/docs/wxGUI.nviz.html grass-7.8.0/gui/wxpython/docs/wxGUI.nviz.html --- grass-7.6.1/gui/wxpython/docs/wxGUI.nviz.html 2019-03-19 19:57:59.000000000 +0000 +++ grass-7.8.0/gui/wxpython/docs/wxGUI.nviz.html 2019-05-18 15:50:04.000000000 +0000 @@ -445,4 +445,4 @@

-$Date: 2018-10-14 21:39:26 +0200 (Sun, 14 Oct 2018) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/docs/wxGUI.rdigit.html grass-7.8.0/gui/wxpython/docs/wxGUI.rdigit.html --- grass-7.6.1/gui/wxpython/docs/wxGUI.rdigit.html 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/docs/wxGUI.rdigit.html 2019-05-18 15:50:04.000000000 +0000 @@ -81,4 +81,4 @@ Anna Petrasova, NCSU GeoForALL Laboratory

-$Date: 2018-10-14 21:39:26 +0200 (Sun, 14 Oct 2018) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/docs/wxGUI.toolboxes.html grass-7.8.0/gui/wxpython/docs/wxGUI.toolboxes.html --- grass-7.6.1/gui/wxpython/docs/wxGUI.toolboxes.html 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/docs/wxGUI.toolboxes.html 2019-05-18 15:50:04.000000000 +0000 @@ -208,4 +208,4 @@

-$Date: 2016-03-08 09:06:33 +0100 (Tue, 08 Mar 2016) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/docs/wxGUI.vnet.html grass-7.8.0/gui/wxpython/docs/wxGUI.vnet.html --- grass-7.6.1/gui/wxpython/docs/wxGUI.vnet.html 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/docs/wxGUI.vnet.html 2019-05-18 15:50:04.000000000 +0000 @@ -108,4 +108,4 @@ Summer of Code 2012 (mentor: Martin Landa)

-$Date: 2018-10-14 21:39:26 +0200 (Sun, 14 Oct 2018) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/gcp/g.gui.gcp.html grass-7.8.0/gui/wxpython/gcp/g.gui.gcp.html --- grass-7.6.1/gui/wxpython/gcp/g.gui.gcp.html 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gcp/g.gui.gcp.html 2019-05-18 15:50:04.000000000 +0000 @@ -315,4 +315,4 @@ Martin Landa, Czech Technical University in Prague, Czech Republic

-$Date: 2016-09-19 11:37:30 +0200 (Mon, 19 Sep 2016) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/gcp/g.gui.gcp.py grass-7.8.0/gui/wxpython/gcp/g.gui.gcp.py --- grass-7.6.1/gui/wxpython/gcp/g.gui.gcp.py 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gcp/g.gui.gcp.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/gui/wxpython/gcp/manager.py grass-7.8.0/gui/wxpython/gcp/manager.py --- grass-7.6.1/gui/wxpython/gcp/manager.py 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gcp/manager.py 2019-08-31 21:37:30.000000000 +0000 @@ -32,6 +32,7 @@ import sys import shutil import time +import six from copy import copy import wx @@ -40,23 +41,25 @@ from core import globalvar if globalvar.wxPythonPhoenix: - from wx.adv import Wizard as wiz + from wx import adv as wiz + from wx.adv import Wizard else: - import wx.wizard as wiz + from wx import wizard as wiz + from wx.wizard import Wizard import grass.script as grass from core import utils from core.render import Map -from core.utils import _ from gui_core.gselect import Select, LocationSelect, MapsetSelect from gui_core.dialogs import GroupDialog from core.gcmd import RunCommand, GMessage, GError, GWarning, EncodeString from core.settings import UserSettings from gcp.mapdisplay import MapFrame from core.giface import Notification -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \ + CheckListBox, TextCtrl, Menu from location_wizard.wizard import TitledPage as TitledPage @@ -371,7 +374,7 @@ # location self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select source location:')), @@ -392,7 +395,7 @@ # mapset self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select source mapset:')), @@ -505,7 +508,7 @@ # # group self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select/create group:')), @@ -522,7 +525,7 @@ # create group self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Create group if none exists')), @@ -532,11 +535,11 @@ 2, 1)) btnSizer = wx.BoxSizer(wx.HORIZONTAL) - self.btn_mkgroup = wx.Button( + self.btn_mkgroup = Button( parent=self, id=wx.ID_ANY, label=_("Create/edit group...")) - self.btn_vgroup = wx.Button( + self.btn_vgroup = Button( parent=self, id=wx.ID_ANY, label=_("Add vector map to group...")) @@ -556,7 +559,7 @@ # extension self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Extension for output maps:')), @@ -565,7 +568,7 @@ pos=( 3, 1)) - self.ext_txt = wx.TextCtrl( + self.ext_txt = TextCtrl( parent=self, id=wx.ID_ANY, value="", size=( 350, -1)) self.ext_txt.SetValue(self.extension) @@ -714,7 +717,7 @@ # layout # self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select source map to display:')), @@ -740,7 +743,7 @@ 2)) self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select target raster map to display:')), @@ -763,7 +766,7 @@ 2)) self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select target vector map to display:')), @@ -1261,7 +1264,7 @@ "ucolor": "unused"} wpx = UserSettings.Get(group='gcpman', key='symbol', subkey='width') - for k, v in colours.iteritems(): + for k, v in six.iteritems(colours): col = UserSettings.Get(group='gcpman', key='symbol', subkey=k) self.pointsToDrawSrc.GetPen(v).SetColour(wx.Colour( col[0], col[1], col[2], 255)) # TODO GetPen neni to spatne? @@ -1462,7 +1465,7 @@ if line[0] == '#' or line == '': continue line = line.replace('\n', '').strip() - coords = map(float, line.split()) + coords = list(map(float, line.split())) if coords[4] == 1: check = True self.GCPcount += 1 @@ -2062,7 +2065,7 @@ """Popup Zoom menu """ point = wx.GetMousePosition() - zoommenu = wx.Menu() + zoommenu = Menu() # Add items to the menu zoomsource = wx.MenuItem(zoommenu, wx.ID_ANY, _( @@ -2389,17 +2392,17 @@ # # buttons # - self.btnCancel = wx.Button(parent=self, + self.btnCancel = Button(parent=self, id=wx.ID_CANCEL) - self.btnOK = wx.Button(parent=self, + self.btnOK = Button(parent=self, id=wx.ID_OK) self.btnOK.SetDefault() # # list of vector maps # - self.listMap = wx.CheckListBox(parent=self, id=wx.ID_ANY, - choices=vectlist) + self.listMap = CheckListBox(parent=self, id=wx.ID_ANY, + choices=vectlist) if os.path.isfile(self.vgrpfile): f = open(self.vgrpfile) @@ -2425,7 +2428,7 @@ box = wx.BoxSizer(wx.HORIZONTAL) box.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select vector map(s) to add to group:')), @@ -2494,7 +2497,7 @@ sizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s %s " % (_("Ground Control Point No."), str(gcpno))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) @@ -2502,10 +2505,10 @@ # source coordinates gridSizer = wx.GridBagSizer(vgap=5, hgap=5) - self.xcoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.ycoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.ecoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.ncoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.xcoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.ycoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.ecoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.ncoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) # swap source N, target E tmp_coord = data[1] @@ -2519,8 +2522,8 @@ (_("target E:"), self.ecoord), (_("source N:"), self.ycoord), (_("target N:"), self.ncoord)): - label = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=label) + label = StaticText(parent=panel, id=wx.ID_ANY, + label=label) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, col)) @@ -2547,8 +2550,8 @@ # # buttons # - self.btnCancel = wx.Button(panel, wx.ID_CANCEL) - self.btnOk = wx.Button(panel, wx.ID_OK) + self.btnCancel = Button(panel, wx.ID_CANCEL) + self.btnOk = Button(panel, wx.ID_OK) self.btnOk.SetDefault() btnSizer = wx.StdDialogButtonSizer() @@ -2617,19 +2620,19 @@ self.__CreateRectificationPage(notebook) # buttons - btnSave = wx.Button(self, wx.ID_SAVE) - btnApply = wx.Button(self, wx.ID_APPLY) - btnClose = wx.Button(self, wx.ID_CLOSE) + btnSave = Button(self, wx.ID_SAVE) + btnApply = Button(self, wx.ID_APPLY) + btnClose = Button(self, wx.ID_CLOSE) btnApply.SetDefault() # bindings btnApply.Bind(wx.EVT_BUTTON, self.OnApply) - btnApply.SetToolTipString(_("Apply changes for the current session")) + btnApply.SetToolTip(_("Apply changes for the current session")) btnSave.Bind(wx.EVT_BUTTON, self.OnSave) - btnSave.SetToolTipString( + btnSave.SetToolTip( _("Apply and save changes to user settings file (default for next sessions)")) btnClose.Bind(wx.EVT_BUTTON, self.OnClose) - btnClose.SetToolTipString(_("Close dialog")) + btnClose.SetToolTip(_("Close dialog")) # sizers btnSizer = wx.BoxSizer(wx.HORIZONTAL) @@ -2675,7 +2678,7 @@ 0)) # RMS forward error threshold - rmslabel = wx.StaticText( + rmslabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Highlight RMS error > M + SD * factor:")) rmslabel.SetToolTip( @@ -2692,8 +2695,8 @@ 0)) sdfactor = UserSettings.Get( group='gcpman', key='rms', subkey='sdfactor') - self.rmsWin = wx.TextCtrl(parent=panel, id=wx.ID_ANY, - size=(70, -1), style=wx.TE_NOHIDESEL) + self.rmsWin = TextCtrl(parent=panel, id=wx.ID_ANY, + size=(70, -1), style=wx.TE_NOHIDESEL) self.rmsWin.SetValue("%s" % str(sdfactor)) if (self.parent.highest_only == True): self.rmsWin.Disable() @@ -2703,8 +2706,8 @@ rmsgridSizer.AddGrowableCol(1) sizer.Add(rmsgridSizer, flag=wx.EXPAND | wx.ALL, border=5) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Symbol settings")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Symbol settings")) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) @@ -2712,7 +2715,7 @@ # general symbol color # row = 0 - label = wx.StaticText(parent=panel, id=wx.ID_ANY, label=_("Color:")) + label = StaticText(parent=panel, id=wx.ID_ANY, label=_("Color:")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) col = UserSettings.Get(group='gcpman', key='symbol', subkey='color') colWin = csel.ColourSelect(parent=panel, id=wx.ID_ANY, @@ -2729,7 +2732,7 @@ # symbol color for high forward RMS error # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Color for high RMS error:")) @@ -2749,7 +2752,7 @@ # symbol color for selected GCP # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Color for selected GCP:")) @@ -2769,7 +2772,7 @@ # symbol color for unused GCP # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Color for unused GCPs:")) @@ -2802,7 +2805,7 @@ # symbol size # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Symbol size:")) @@ -2824,7 +2827,7 @@ # symbol width # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Line width:")) @@ -2876,7 +2879,7 @@ self.tgtvectselection.GetElementList() sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select source map to display:')), @@ -2890,7 +2893,7 @@ border=5) self.srcselection.SetValue(src_map) sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select target raster map to display:')), @@ -2904,7 +2907,7 @@ border=5) self.tgtrastselection.SetValue(tgt_map['raster']) sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select target vector map to display:')), @@ -2955,7 +2958,7 @@ # interpolation method gridSizer = wx.GridBagSizer(vgap=5, hgap=5) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select interpolation method:')), @@ -2981,14 +2984,14 @@ # extension sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Extension for output maps:')), proportion=0, flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5) - self.ext_txt = wx.TextCtrl( + self.ext_txt = TextCtrl( parent=panel, id=wx.ID_ANY, value="", size=( 350, -1)) self.ext_txt.SetValue(self.parent.extension) diff -Nru grass-7.6.1/gui/wxpython/gcp/mapdisplay.py grass-7.8.0/gui/wxpython/gcp/mapdisplay.py --- grass-7.6.1/gui/wxpython/gcp/mapdisplay.py 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gcp/mapdisplay.py 2019-06-03 20:34:20.000000000 +0000 @@ -27,9 +27,9 @@ from gcp.toolbars import GCPDisplayToolbar, GCPManToolbar from mapdisp.gprint import PrintOptions from core.gcmd import GMessage -from core.utils import _ from gui_core.dialogs import GetImageHandlers, ImageSizeDialog from gui_core.mapdisp import SingleMapFrame +from gui_core.wrap import Menu from core.settings import UserSettings from mapwin.buffered import BufferedMapWindow from mapwin.base import MapWindowProperties @@ -421,7 +421,7 @@ Print options and output menu for map display """ point = wx.GetMousePosition() - printmenu = wx.Menu() + printmenu = Menu() # Add items to the menu setup = wx.MenuItem(printmenu, wx.ID_ANY, _('Page setup')) printmenu.AppendItem(setup) @@ -467,7 +467,7 @@ """Popup Zoom menu """ point = wx.GetMousePosition() - zoommenu = wx.Menu() + zoommenu = Menu() # Add items to the menu zoomwind = wx.MenuItem(zoommenu, wx.ID_ANY, _( diff -Nru grass-7.6.1/gui/wxpython/gcp/statusbar.py grass-7.8.0/gui/wxpython/gcp/statusbar.py --- grass-7.6.1/gui/wxpython/gcp/statusbar.py 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gcp/statusbar.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,7 +20,6 @@ import wx from core.gcmd import GMessage -from core.utils import _ from mapdisp.statusbar import SbItem, SbTextItem from gui_core.wrap import SpinCtrl diff -Nru grass-7.6.1/gui/wxpython/gcp/toolbars.py grass-7.8.0/gui/wxpython/gcp/toolbars.py --- grass-7.6.1/gui/wxpython/gcp/toolbars.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gcp/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,7 +21,6 @@ import wx from core import globalvar -from core.utils import _ from gui_core.toolbars import BaseToolbar, BaseIcons from icons.icon import MetaIcon diff -Nru grass-7.6.1/gui/wxpython/gis_set_error.py grass-7.8.0/gui/wxpython/gis_set_error.py --- grass-7.6.1/gui/wxpython/gis_set_error.py 2019-03-19 19:57:47.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gis_set_error.py 2019-06-03 20:34:20.000000000 +0000 @@ -14,6 +14,12 @@ import os import sys +# i18n is taken care of in the grass library code. +# So we need to import it before any of the GUI code. +# NOTE: in this particular case, we don't really need the grass library; +# NOTE: we import it just for the side effects of gettext.install() +import grass + from core import globalvar import wx diff -Nru grass-7.6.1/gui/wxpython/gis_set.py grass-7.8.0/gui/wxpython/gis_set.py --- grass-7.6.1/gui/wxpython/gis_set.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gis_set.py 2019-06-03 20:34:20.000000000 +0000 @@ -27,13 +27,14 @@ import codecs import getpass +# i18n is taken care of in the grass library code. +# So we need to import it before any of the GUI code. +from grass.script import core as grass + from core import globalvar -from core.utils import _ import wx import wx.lib.mixins.listctrl as listmix -from grass.script import core as grass - from core.gcmd import GMessage, GError, DecodeString, RunCommand from core.utils import GetListOfLocations, GetListOfMapsets from startup.utils import ( @@ -44,8 +45,8 @@ from location_wizard.dialogs import RegionDef from gui_core.dialogs import TextEntryDialog from gui_core.widgets import GenericValidator, StaticWrapText -from gui_core.wrap import Button -from gui_core.wrap import ListCtrl +from gui_core.wrap import Button, ListCtrl, StaticText, StaticBox, \ + TextCtrl sys.stderr = codecs.getwriter('utf8')(sys.stderr) @@ -110,17 +111,17 @@ # get version & revision grassVersion, grassRevisionStr = sgui.GetVersion() - self.gisdbase_box = wx.StaticBox( + self.gisdbase_box = StaticBox( parent=self.panel, id=wx.ID_ANY, label=" %s " % _("1. Select GRASS GIS database directory")) - self.location_box = wx.StaticBox( + self.location_box = StaticBox( parent=self.panel, id=wx.ID_ANY, label=" %s " % _("2. Select GRASS Location")) - self.mapset_box = wx.StaticBox( + self.mapset_box = StaticBox( parent=self.panel, id=wx.ID_ANY, label=" %s " % _("3. Select GRASS Mapset")) - self.lmessage = wx.StaticText(parent=self.panel) + self.lmessage = StaticText(parent=self.panel) # It is not clear if all wx versions supports color, so try-except. # The color itself may not be correct for all platforms/system settings # but in http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.SystemSettings.html @@ -134,7 +135,7 @@ self.location_panel = wx.Panel(parent=self.panel) self.mapset_panel = wx.Panel(parent=self.panel) - self.ldbase = wx.StaticText( + self.ldbase = StaticText( parent=self.gisdbase_panel, id=wx.ID_ANY, label=_("GRASS GIS database directory contains Locations.")) @@ -204,7 +205,7 @@ self.delete_mapset_button.SetToolTip(_("Delete selected mapset")) # textinputs - self.tgisdbase = wx.TextCtrl( + self.tgisdbase = TextCtrl( parent=self.gisdbase_panel, id=wx.ID_ANY, value="", size=( 300, -1), style=wx.TE_PROCESS_ENTER) diff -Nru grass-7.6.1/gui/wxpython/gmodeler/dialogs.py grass-7.8.0/gui/wxpython/gmodeler/dialogs.py --- grass-7.6.1/gui/wxpython/gmodeler/dialogs.py 2019-03-19 19:58:07.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gmodeler/dialogs.py 2019-09-06 19:29:57.000000000 +0000 @@ -25,13 +25,13 @@ import os import sys +import six import wx import wx.lib.mixins.listctrl as listmix from core import globalvar from core import utils -from core.utils import _ from gui_core.widgets import SearchModuleWidget, SimpleValidator from core.gcmd import GError, EncodeString from gui_core.dialogs import SimpleDialog, MapLayersDialogForModeler @@ -39,6 +39,8 @@ from gui_core.gselect import Select, ElementSelect from gmodeler.model import * from lmgr.menudata import LayerManagerMenuData +from gui_core.wrap import Button, StaticText, StaticBox, TextCtrl, \ + Menu, ListCtrl from grass.script import task as gtask @@ -99,7 +101,7 @@ """Do layout""" if self.etype: self.dataSizer.Add( - wx.StaticText( + StaticText( parent=self.panel, id=wx.ID_ANY, label=_("Type of element:")), @@ -108,8 +110,8 @@ border=1) self.dataSizer.Add(self.typeSelect, proportion=0, flag=wx.ALL, border=1) - self.dataSizer.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Name of element:")), + self.dataSizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Name of element:")), proportion=0, flag=wx.ALL, border=1) self.dataSizer.Add(self.element, proportion=0, flag=wx.EXPAND | wx.ALL, border=1) @@ -188,10 +190,10 @@ self._command = None self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.cmdBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _("Command")) - self.labelBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _("Label and comment")) + self.cmdBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _("Command")) + self.labelBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _("Label and comment")) # menu data for search widget and prompt menuModel = LayerManagerMenuData() @@ -208,14 +210,14 @@ lambda name: self.cmd_prompt.SetTextAndFocus(name + ' ')) wx.CallAfter(self.cmd_prompt.SetFocus) - self.label = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY) - self.comment = wx.TextCtrl( + self.label = TextCtrl(parent=self.panel, id=wx.ID_ANY) + self.comment = TextCtrl( parent=self.panel, id=wx.ID_ANY, style=wx.TE_MULTILINE) - self.btnCancel = wx.Button(self.panel, wx.ID_CANCEL) - self.btnOk = wx.Button(self.panel, wx.ID_OK) + self.btnCancel = Button(self.panel, wx.ID_CANCEL) + self.btnOk = Button(self.panel, wx.ID_OK) self.btnOk.SetDefault() self.Bind(wx.EVT_BUTTON, self.OnOk, self.btnOk) @@ -231,12 +233,12 @@ flag=wx.EXPAND) labelSizer = wx.StaticBoxSizer(self.labelBox, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=5, vgap=5) - gridSizer.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Label:")), + gridSizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Label:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) gridSizer.Add(self.label, pos=(0, 1), flag=wx.EXPAND) - gridSizer.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Comment:")), + gridSizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Comment:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(1, 0)) gridSizer.Add(self.comment, pos=(1, 1), flag=wx.EXPAND) gridSizer.AddGrowableRow(1) @@ -353,18 +355,18 @@ self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.fromBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _("From")) - self.toBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _("To")) + self.fromBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _("From")) + self.toBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _("To")) self.option = wx.ComboBox(parent=self.panel, id=wx.ID_ANY, style=wx.CB_READONLY, choices=options) self.option.Bind(wx.EVT_COMBOBOX, self.OnOption) - self.btnCancel = wx.Button(self.panel, wx.ID_CANCEL) - self.btnOk = wx.Button(self.panel, wx.ID_OK) + self.btnCancel = Button(self.panel, wx.ID_CANCEL) + self.btnOk = Button(self.panel, wx.ID_OK) self.btnOk.Enable(False) self._layout() @@ -397,20 +399,20 @@ def _layoutShape(self, shape, sizer): if isinstance(shape, ModelData): - sizer.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Data: %s") % shape.GetLog()), + sizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Data: %s") % shape.GetLog()), proportion=1, flag=wx.EXPAND | wx.ALL, border=5) elif isinstance(shape, ModelAction): gridSizer = wx.GridBagSizer(hgap=5, vgap=5) - gridSizer.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Command:")), + gridSizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Command:")), pos=(0, 0)) - gridSizer.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=shape.GetLabel()), + gridSizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=shape.GetLabel()), pos=(0, 1)) - gridSizer.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Option:")), + gridSizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Option:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(1, 0)) gridSizer.Add(self.option, @@ -483,10 +485,10 @@ self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.condBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _("Condition")) - self.condText = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY, - value=shape.GetLabel()) + self.condBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _("Condition")) + self.condText = TextCtrl(parent=self.panel, id=wx.ID_ANY, + value=shape.GetLabel()) self.itemList = ItemCheckListCtrl(parent=self.panel, columns=[_("Label"), @@ -496,8 +498,8 @@ self.itemList.Populate(self.parent.GetModel().GetItems()) - self.btnCancel = wx.Button(parent=self.panel, id=wx.ID_CANCEL) - self.btnOk = wx.Button(parent=self.panel, id=wx.ID_OK) + self.btnCancel = Button(parent=self.panel, id=wx.ID_CANCEL) + self.btnOk = Button(parent=self.panel, id=wx.ID_OK) self.btnOk.SetDefault() def _layout(self): @@ -517,12 +519,12 @@ ModelItemDialog.__init__(self, parent, shape, title, style=style, **kwargs) - self.listBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _("List of items in loop")) + self.listBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _("List of items in loop")) - self.btnSeries = wx.Button(parent=self.panel, id=wx.ID_ANY, + self.btnSeries = Button(parent=self.panel, id=wx.ID_ANY, label=_("Series")) - self.btnSeries.SetToolTipString( + self.btnSeries.SetToolTip( _("Define map series as condition for the loop")) self.btnSeries.Bind(wx.EVT_BUTTON, self.OnSeries) @@ -575,7 +577,7 @@ cond = dialog.GetDSeries() if not cond: - cond = 'map in %s' % map(lambda x: str(x), dialog.GetMapLayers()) + cond = 'map in {}'.format(list(map(str, dialog.GetMapLayers()))) self.condText.SetValue(cond) @@ -591,13 +593,13 @@ ModelItemDialog.__init__(self, parent, shape, title, style=style, **kwargs) - self.listBoxIf = wx.StaticBox( + self.listBoxIf = StaticBox( parent=self.panel, id=wx.ID_ANY, label=" %s " % _("List of items in 'if' block")) self.itemListIf = self.itemList self.itemListIf.SetName('IfBlockList') - self.listBoxElse = wx.StaticBox( + self.listBoxElse = StaticBox( parent=self.panel, id=wx.ID_ANY, label=" %s " % _("List of items in 'else' block")) self.itemListElse = ItemCheckListCtrl(parent=self.panel, @@ -669,7 +671,7 @@ 'else': self.itemListElse.GetItems()} -class ModelListCtrl(wx.ListCtrl, +class ModelListCtrl(ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.TextEditMixin): @@ -684,7 +686,7 @@ self.frame = frame self.columnNotEditable = columnsNotEditable - wx.ListCtrl.__init__(self, parent, id=id, style=style, **kwargs) + ListCtrl.__init__(self, parent, id=id, style=style, **kwargs) listmix.ListCtrlAutoWidthMixin.__init__(self) listmix.TextEditMixin.__init__(self) @@ -743,7 +745,7 @@ """Populate the list""" self.itemDataMap = dict() i = 0 - for name, values in data.iteritems(): + for name, values in six.iteritems(data): self.itemDataMap[i] = [name, values['type'], values.get('value', ''), values.get('description', '')] @@ -752,7 +754,7 @@ self.itemCount = len(self.itemDataMap.keys()) self.DeleteAllItems() i = 0 - for name, vtype, value, desc in self.itemDataMap.itervalues(): + for name, vtype, value, desc in six.itervalues(self.itemDataMap): index = self.InsertStringItem(i, name) self.SetStringItem(index, 0, name) self.SetStringItem(index, 1, vtype) @@ -767,7 +769,7 @@ :return: None on success :return: error string """ - for iname, ivtype, ivalue, idesc in self.itemDataMap.itervalues(): + for iname, ivtype, ivalue, idesc in six.itervalues(self.itemDataMap): if iname == name: return _("Variable <%s> already exists in the model. " "Adding variable failed.") % name @@ -840,7 +842,7 @@ self.Bind(wx.EVT_MENU, self.OnReload, id=self.popupID3) # generate popup-menu - menu = wx.Menu() + menu = Menu() menu.Append(self.popupID1, _("Delete selected")) menu.Append(self.popupID2, _("Delete all")) if self.GetFirstSelected() == -1: @@ -937,7 +939,7 @@ self.DeleteAllItems() i = 0 if len(self.columns) == 2: - for name, desc in self.itemDataMap.itervalues(): + for name, desc in six.itervalues(self.itemDataMap): index = self.InsertStringItem(i, str(i)) self.SetStringItem(index, 0, name) self.SetStringItem(index, 1, desc) @@ -946,7 +948,7 @@ self.CheckItem(index, True) i += 1 else: - for name, inloop, param, desc in self.itemDataMap.itervalues(): + for name, inloop, param, desc in six.itervalues(self.itemDataMap): index = self.InsertStringItem(i, str(i)) self.SetStringItem(index, 0, name) self.SetStringItem(index, 1, inloop) @@ -1009,7 +1011,7 @@ self.Bind(wx.EVT_MENU, self.OnReload, id=self.popupID['reload']) # generate popup-menu - menu = wx.Menu() + menu = Menu() menu.Append(self.popupID['remove'], _("Delete selected")) if self.GetFirstSelected() == -1: menu.Enable(self.popupID['remove'], False) diff -Nru grass-7.6.1/gui/wxpython/gmodeler/frame.py grass-7.8.0/gui/wxpython/gmodeler/frame.py --- grass-7.6.1/gui/wxpython/gmodeler/frame.py 2019-03-19 19:57:59.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gmodeler/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -17,6 +17,7 @@ (>=v2). Read the file COPYING that comes with GRASS for details. @author Martin Landa +@author Python parameterization Ondrej Pesek """ import os @@ -27,6 +28,7 @@ import copy import re import random +import six import wx from wx.lib import ogl @@ -40,18 +42,18 @@ import wx.lib.flatnotebook as FN from wx.lib.newevent import NewEvent -from core.utils import _ from gui_core.widgets import GNotebook from core.gconsole import GConsole, \ EVT_CMD_RUN, EVT_CMD_DONE, EVT_CMD_PREPARE from gui_core.goutput import GConsoleWindow from core.debug import Debug from core.gcmd import GMessage, GException, GWarning, GError, RunCommand -from gui_core.dialogs import GetImageHandlers, TextEntryDialog +from gui_core.dialogs import GetImageHandlers +from gui_core.dialogs import TextEntryDialog as CustomTextEntryDialog from gui_core.ghelp import ShowAboutDialog from gui_core.preferences import PreferencesBaseDialog from core.settings import UserSettings -from gui_core.menu import Menu +from gui_core.menu import Menu as Menubar from gmodeler.menudata import ModelerMenuData from gui_core.forms import GUI from gmodeler.preferences import PreferencesDialog, PropertiesDialog @@ -61,6 +63,9 @@ from gmodeler.giface import GraphicalModelerGrassInterface from gmodeler.model import * from gmodeler.dialogs import * +from gui_core.wrap import Button, StaticText, StaticBox, TextCtrl, \ + Menu, StockCursor, EmptyBitmap +from gui_core.wrap import TextEntryDialog as wxTextEntryDialog wxModelDone, EVT_MODEL_DONE = NewEvent() @@ -85,12 +90,13 @@ self.searchDialog = None # module search dialog self.baseTitle = title self.modelFile = None # loaded model + self.start_time = None self.modelChanged = False self.randomness = 40 # random layout self.cursors = { - "default": wx.StockCursor(wx.CURSOR_ARROW), - "cross": wx.StockCursor(wx.CURSOR_CROSS), + "default": StockCursor(wx.CURSOR_ARROW), + "cross": StockCursor(wx.CURSOR_CROSS), } wx.Frame.__init__(self, parent=parent, id=id, title=title, **kwargs) @@ -102,7 +108,7 @@ 'grass.ico'), wx.BITMAP_TYPE_ICO)) - self.menubar = Menu( + self.menubar = Menubar( parent=self, model=ModelerMenuData().GetModel( separators=True)) @@ -316,7 +322,7 @@ action = self.GetModel().GetItems()[event.pid] if hasattr(action, "task"): action.Update(running=True) - if event.pid == self._gconsole.cmdThread.GetId() - 1: + if event.pid == self._gconsole.cmdThread.GetId() - 1 and self.start_time: self.goutput.WriteCmdLog('({}) {} ({})'.format( str(time.ctime()), _("Model computation finished"), time_elapsed(self.start_time)), notification=event.notification) @@ -380,7 +386,7 @@ dlg.Init(properties) if dlg.ShowModal() == wx.ID_OK: self.ModelChanged() - for key, value in dlg.GetValues().iteritems(): + for key, value in six.iteritems(dlg.GetValues()): properties[key] = value for action in self.model.GetItems(objType=ModelAction): action.GetTask().set_flag('overwrite', properties['overwrite']) @@ -698,7 +704,7 @@ ymaxImg = ymax size = wx.Size(int(xmaxImg - xminImg) + 50, int(ymaxImg - yminImg) + 50) - bitmap = wx.EmptyBitmap(width=size.width, height=size.height) + bitmap = EmptyBitmap(width=size.width, height=size.height) filetype, ltype = GetImageHandlers(wx.ImageFromBitmap(bitmap)) @@ -726,10 +732,8 @@ dc.SetBackground(wx.WHITE_BRUSH) dc.SetBackgroundMode(wx.SOLID) - dc.BeginDrawing() self.canvas.GetDiagram().Clear(dc) self.canvas.GetDiagram().Redraw(dc) - dc.EndDrawing() bitmap.SaveFile(path, fileType) self.SetStatusText(_("Model exported to <%s>") % path) @@ -879,7 +883,7 @@ def OnAddComment(self, event): """Add comment to the model""" - dlg = TextEntryDialog( + dlg = CustomTextEntryDialog( parent=self, message=_("Comment:"), caption=_("Add comment"), @@ -1120,7 +1124,7 @@ :return: False on failure """ self.ModelChanged(False) - tmpfile = tempfile.TemporaryFile(mode='w+b') + tmpfile = tempfile.TemporaryFile(mode='w+') try: WriteModelFile(fd=tmpfile, model=self.model) except Exception: @@ -1495,7 +1499,7 @@ shape = self.GetShape() self._onSelectShape(shape) - popupMenu = wx.Menu() + popupMenu = Menu() popupMenu.Append(self.popupID['remove'], text=_('Remove')) self.frame.Bind(wx.EVT_MENU, self.OnRemove, id=self.popupID['remove']) if isinstance(shape, ModelAction) or isinstance(shape, ModelLoop): @@ -1606,11 +1610,11 @@ def OnSetLabel(self, event): shape = self.GetShape() - dlg = wx.TextEntryDialog( + dlg = wxTextEntryDialog( parent=self.frame, message=_("Label:"), caption=_("Set label"), - defaultValue=shape.GetLabel()) + value=shape.GetLabel()) if dlg.ShowModal() == wx.ID_OK: label = dlg.GetValue() shape.SetLabel(label) @@ -1621,7 +1625,7 @@ def OnSetComment(self, event): shape = self.GetShape() - dlg = TextEntryDialog( + dlg = CustomTextEntryDialog( parent=self.frame, message=_("Comment:"), caption=_("Set comment"), defaultValue=shape.GetComment(), @@ -1721,7 +1725,7 @@ wx.Panel.__init__(self, parent=parent, id=id, **kwargs) - self.listBox = wx.StaticBox( + self.listBox = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % _("List of variables - right-click to delete")) @@ -1735,9 +1739,9 @@ frame=self.parent) # add new category - self.addBox = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Add new variable")) - self.name = wx.TextCtrl(parent=self, id=wx.ID_ANY) + self.addBox = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Add new variable")) + self.name = TextCtrl(parent=self, id=wx.ID_ANY) wx.CallAfter(self.name.SetFocus) self.type = wx.Choice(parent=self, id=wx.ID_ANY, choices=[_("integer"), @@ -1750,12 +1754,12 @@ _("file"), _("dir")]) self.type.SetSelection(2) # string - self.value = wx.TextCtrl(parent=self, id=wx.ID_ANY) - self.desc = wx.TextCtrl(parent=self, id=wx.ID_ANY) + self.value = TextCtrl(parent=self, id=wx.ID_ANY) + self.desc = TextCtrl(parent=self, id=wx.ID_ANY) # buttons - self.btnAdd = wx.Button(parent=self, id=wx.ID_ADD) - self.btnAdd.SetToolTipString(_("Add new variable to the model")) + self.btnAdd = Button(parent=self, id=wx.ID_ADD) + self.btnAdd.SetToolTip(_("Add new variable to the model")) self.btnAdd.Enable(False) # bindings @@ -1774,28 +1778,28 @@ addSizer = wx.StaticBoxSizer(self.addBox, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=5, vgap=5) - gridSizer.Add(wx.StaticText(parent=self, id=wx.ID_ANY, - label="%s:" % _("Name")), + gridSizer.Add(StaticText(parent=self, id=wx.ID_ANY, + label="%s:" % _("Name")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) gridSizer.Add(self.name, pos=(0, 1), flag=wx.EXPAND) - gridSizer.Add(wx.StaticText(parent=self, id=wx.ID_ANY, - label="%s:" % _("Data type")), + gridSizer.Add(StaticText(parent=self, id=wx.ID_ANY, + label="%s:" % _("Data type")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 2)) gridSizer.Add(self.type, pos=(0, 3)) - gridSizer.Add(wx.StaticText(parent=self, id=wx.ID_ANY, - label="%s:" % _("Default value")), + gridSizer.Add(StaticText(parent=self, id=wx.ID_ANY, + label="%s:" % _("Default value")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(1, 0)) gridSizer.Add(self.value, pos=(1, 1), span=(1, 3), flag=wx.EXPAND) - gridSizer.Add(wx.StaticText(parent=self, id=wx.ID_ANY, - label="%s:" % _("Description")), + gridSizer.Add(StaticText(parent=self, id=wx.ID_ANY, + label="%s:" % _("Description")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(2, 0)) gridSizer.Add(self.desc, @@ -1845,7 +1849,7 @@ def UpdateModelVariables(self): """Update model variables""" variables = dict() - for values in self.list.GetData().itervalues(): + for values in six.itervalues(self.list.GetData()): name = values[0] variables[name] = {'type': str(values[1])} if values[2]: @@ -1876,7 +1880,7 @@ wx.Panel.__init__(self, parent=parent, id=id, **kwargs) - self.listBox = wx.StaticBox( + self.listBox = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % _("List of items - right-click to delete")) @@ -1893,9 +1897,9 @@ 3], frame=self.parent) - self.btnMoveUp = wx.Button(parent=self, id=wx.ID_UP) - self.btnMoveDown = wx.Button(parent=self, id=wx.ID_DOWN) - self.btnRefresh = wx.Button(parent=self, id=wx.ID_REFRESH) + self.btnMoveUp = Button(parent=self, id=wx.ID_UP) + self.btnMoveDown = Button(parent=self, id=wx.ID_DOWN) + self.btnRefresh = Button(parent=self, id=wx.ID_REFRESH) self.btnMoveUp.Bind(wx.EVT_BUTTON, self.OnMoveItemsUp) self.btnMoveDown.Bind(wx.EVT_BUTTON, self.OnMoveItemsDown) @@ -1976,18 +1980,18 @@ self.filename = None # temp file to run - self.bodyBox = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Python script")) + self.bodyBox = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Python script")) self.body = PyStc(parent=self, statusbar=self.parent.GetStatusBar()) - self.btnRun = wx.Button(parent=self, id=wx.ID_ANY, label=_("&Run")) - self.btnRun.SetToolTipString(_("Run python script")) + self.btnRun = Button(parent=self, id=wx.ID_ANY, label=_("&Run")) + self.btnRun.SetToolTip(_("Run python script")) self.Bind(wx.EVT_BUTTON, self.OnRun, self.btnRun) - self.btnSaveAs = wx.Button(parent=self, id=wx.ID_SAVEAS) - self.btnSaveAs.SetToolTipString(_("Save python script to file")) + self.btnSaveAs = Button(parent=self, id=wx.ID_SAVEAS) + self.btnSaveAs.SetToolTip(_("Save python script to file")) self.Bind(wx.EVT_BUTTON, self.OnSaveAs, self.btnSaveAs) - self.btnRefresh = wx.Button(parent=self, id=wx.ID_REFRESH) - self.btnRefresh.SetToolTipString(_("Refresh python script based on the model.\n" + self.btnRefresh = Button(parent=self, id=wx.ID_REFRESH) + self.btnRefresh.SetToolTip(_("Refresh python script based on the model.\n" "It will discards all local changes.")) self.Bind(wx.EVT_BUTTON, self.OnRefresh, self.btnRefresh) @@ -2033,9 +2037,17 @@ mode = stat.S_IMODE(os.lstat(self.filename)[stat.ST_MODE]) os.chmod(self.filename, mode | stat.S_IXUSR) - self.parent._gconsole.RunCmd( - [fd.name], - skipInterface=True, onDone=self.OnDone) + for item in self.parent.GetModel().GetItems(): + if len(item.GetParameterizedParams()['params']) + len( + item.GetParameterizedParams()['flags']) > 0: + self.parent._gconsole.RunCmd( + [fd.name, '--ui'], + skipInterface=False, onDone=self.OnDone) + break + else: + self.parent._gconsole.RunCmd( + [fd.name], + skipInterface=True, onDone=self.OnDone) event.Skip() @@ -2124,7 +2136,7 @@ if ret == wx.ID_NO: return False - fd = tempfile.TemporaryFile() + fd = tempfile.TemporaryFile(mode='r+') WritePythonFile(fd, self.parent.GetModel()) fd.seek(0) self.body.SetText(fd.read()) diff -Nru grass-7.6.1/gui/wxpython/gmodeler/g.gui.gmodeler.html grass-7.8.0/gui/wxpython/gmodeler/g.gui.gmodeler.html --- grass-7.6.1/gui/wxpython/gmodeler/g.gui.gmodeler.html 2019-03-19 19:57:50.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gmodeler/g.gui.gmodeler.html 2019-06-27 08:06:44.000000000 +0000 @@ -151,8 +151,8 @@ In this example the zipcodes_wake vector data and the elev_state_500m raster data from the North Carolina -sample dataset (original raster and -vector +sample dataset (original raster and +vector data) are used to calculate average elevation for every zone. The important part of the process is the Graphical Modeler, namely its possibilities of process automation. @@ -358,7 +358,7 @@

Defining loops

-In the example below the MODIS MOD13Q1 +In the example below the MODIS MOD13Q1 (NDVI) satellite data products are used in a loop. The original data are stored as coded integer values that need to be multiplied by the value 0.0001 to represent real ndvi values. Moreover, GRASS GIS @@ -431,12 +431,12 @@

See also selected user models available from this -SVN repository. +git repository.

See also -the wiki page -(especially various video +the wiki page +(especially various video tutorials).

AUTHORS

@@ -445,4 +445,4 @@ Various manual improvements by Ludmila Furkevicova, Slovak University of Technology in Bratislava, Slovak Republic

-$Date: 2017-11-11 19:59:24 +0100 (Sat, 11 Nov 2017) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/gmodeler/g.gui.gmodeler.py grass-7.8.0/gui/wxpython/gmodeler/g.gui.gmodeler.py --- grass-7.6.1/gui/wxpython/gmodeler/g.gui.gmodeler.py 2019-03-19 19:58:07.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gmodeler/g.gui.gmodeler.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: g.gui.gmodeler diff -Nru grass-7.6.1/gui/wxpython/gmodeler/model.py grass-7.8.0/gui/wxpython/gmodeler/model.py --- grass-7.6.1/gui/wxpython/gmodeler/model.py 2019-03-19 19:57:59.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gmodeler/model.py 2019-08-31 21:37:30.000000000 +0000 @@ -24,6 +24,7 @@ (>=v2). Read the file COPYING that comes with GRASS for details. @author Martin Landa +@author Python parameterization Ondrej Pesek """ import os @@ -32,6 +33,7 @@ import re import mimetypes import time +import six try: import xml.etree.ElementTree as etree except ImportError: @@ -44,11 +46,11 @@ from core import globalvar from core import utils -from core.utils import _ from core.gcmd import GMessage, GException, GError, RunCommand, EncodeString, GWarning, GetDefaultEncoding from core.settings import UserSettings from gui_core.forms import GUI, CmdPanel from gui_core.widgets import GNotebook +from gui_core.wrap import Button from gmodeler.giface import GraphicalModelerGrassInterface from grass.script import core as grass @@ -119,7 +121,7 @@ def ReorderItems(self, idxList): items = list() - for oldIdx, newIdx in idxList.iteritems(): + for oldIdx, newIdx in six.iteritems(idxList): item = self.items.pop(oldIdx) items.append(item) self.items.insert(newIdx, item) @@ -655,7 +657,7 @@ return err = list() - for key, item in params.iteritems(): + for key, item in six.iteritems(params): for p in item['params']: if p.get('value', '') == '': err.append( @@ -752,7 +754,7 @@ # discard values if params: - for item in params.itervalues(): + for item in six.itervalues(params): for p in item['params']: p['value'] = '' @@ -821,7 +823,7 @@ result["variables"] = {'flags': list(), 'params': params, 'idx': idx} - for name, values in self.variables.iteritems(): + for name, values in six.iteritems(self.variables): gtype = values.get('type', 'string') if gtype in ('raster', 'vector', 'mapset', 'file', 'region', 'dir'): @@ -2016,7 +2018,7 @@ pos = size = None posAttr = node.get('pos', None) if posAttr: - posVal = map(int, posAttr.split(',')) + posVal = list(map(int, posAttr.split(','))) try: pos = (posVal[0], posVal[1]) except: @@ -2024,7 +2026,7 @@ sizeAttr = node.get('size', None) if sizeAttr: - sizeVal = map(int, sizeAttr.split(',')) + sizeVal = list(map(int, sizeAttr.split(','))) try: size = (sizeVal[0], sizeVal[1]) except: @@ -2278,7 +2280,7 @@ return self.fd.write('%s\n' % (' ' * self.indent)) self.indent += 4 - for name, values in self.variables.iteritems(): + for name, values in six.iteritems(self.variables): self.fd.write( '%s\n' % (' ' * self.indent, EncodeString(name), values['type'])) @@ -2331,7 +2333,7 @@ self.indent += 4 if not action.IsEnabled(): self.fd.write('%s\n' % (' ' * self.indent)) - for key, val in action.GetParams().iteritems(): + for key, val in six.iteritems(action.GetParams()): if key == 'flags': for f in val: if f.get('value', False) or f.get('parameterized', False): @@ -2540,54 +2542,82 @@ # header self.fd.write( - r"""#!/usr/bin/env python + r"""#!/usr/bin/env python3 # -#%s +#{header_begin} # -# MODULE: %s +# MODULE: {module_name} # -# AUTHOR(S): %s +# AUTHOR(S): {author} # -# PURPOSE: %s +# PURPOSE: {purpose} # -# DATE: %s +# DATE: {date} # -#%s -""" % - ('#' * - 77, - EncodeString( - properties['name']), - EncodeString( - properties['author']), - EncodeString( - '\n# '.join( - properties['description'].splitlines())), - time.asctime(), - '#' * - 77)) +#{header_end} +""".format(header_begin='#' * 77, + module_name=EncodeString(properties['name']), + author=EncodeString(properties['author']), + purpose=EncodeString( + '\n# '.join(properties['description'].splitlines())), + date=time.asctime(), + header_end='#' * 77)) # UI self.fd.write( r""" -#%%module -#%% description: %s -#%%end -""" % (EncodeString(' '.join(properties['description'].splitlines())))) - - variables = self.model.GetVariables() - for key, data in variables.iteritems(): - otype = self._getStandardizedOption(data['type']) - self.fd.write( - r""" -#%%option %s -#%% key: %s -#%% description: %s -#%% required: yes -""" % (otype, key, data['description'])) - if 'value' in data: - self.fd.write("#%% answer: %s\n" % data['value']) - self.fd.write("#% end\n") +#%module +#% description: {description} +#%end +""".format(description=EncodeString( + ' '.join(properties['description'].splitlines())))) + + modelItems = self.model.GetItems() + for item in modelItems: + for flag in item.GetParameterizedParams()['flags']: + if flag['label']: + desc = flag['label'] + else: + desc = flag['description'] + self.fd.write( + r"""#%option +#% key: {flag_name} +#% description: {description} +#% required: yes +#% type: string +#% options: True, False +#% guisection: Flags +""".format(flag_name=self._getParamName(flag['name'], item), + description=desc)) + if flag['value']: + self.fd.write("#% answer: {}\n".format(flag['value'])) + else: + self.fd.write("#% answer: False\n") + self.fd.write("#%end\n") + + for param in item.GetParameterizedParams()['params']: + if param['label']: + desc = param['label'] + else: + desc = param['description'] + self.fd.write( + r"""#%option +#% key: {param_name} +#% description: {description} +#% required: yes +""".format(param_name=self._getParamName(param['name'], item), + description=desc)) + if param['type'] != 'float': + self.fd.write('#% type: {}\n'.format(param['type'])) + else: + self.fd.write('#% type: double\n') + if param['key_desc']: + self.fd.write("#% key_desc: ") + self.fd.write(', '.join(param['key_desc'])) + self.fd.write("\n") + if param['value']: + self.fd.write("#% answer: {}\n".format(param['value'])) + self.fd.write("#%end\n") # import modules self.fd.write( @@ -2623,24 +2653,45 @@ if not rast and not vect and not rast3d: self.fd.write(' pass\n') - self.fd.write("\ndef main():\n") + self.fd.write("\ndef main(options, flags):\n") for item in self.model.GetItems(): - self._writePythonItem(item, variables=self.model.GetVariables()) + self._writePythonItem(item, + variables=item.GetParameterizedParams()) + + self.fd.write(" return 0\n") - self.fd.write("\n return 0\n") + for item in modelItems: + if item.GetParameterizedParams()['flags']: + self.fd.write(r""" +def getParameterizedFlags(paramFlags, itemFlags): + fl = '' +""") + + self.fd.write(""" for i in [key for key, value in paramFlags.iteritems() if value == 'True']: + if i in itemFlags: + fl += i[-1] + + return fl +""") + break self.fd.write( r""" if __name__ == "__main__": options, flags = parser() atexit.register(cleanup) - sys.exit(main()) """) + if properties.get('overwrite'): + self.fd.write(' os.environ["GRASS_OVERWRITE"] = "1"\n') + + self.fd.write(' sys.exit(main())\n') + def _writePythonItem(self, item, ignoreBlock=True, variables={}): """Write model object to Python file""" if isinstance(item, ModelAction): - if ignoreBlock and item.GetBlockId(): # ignore items in loops of conditions + if ignoreBlock and item.GetBlockId(): + # ignore items in loops of conditions return self._writePythonAction(item, variables=variables) elif isinstance(item, ModelLoop) or isinstance(item, ModelCondition): @@ -2666,9 +2717,8 @@ 1:- 1])) cond += "grass.read_command(" - cond += self._getPythonActionCmd(task, - len(cond), - variables=[condVar]) + ".splitlines()" + cond += self._getPythonActionCmd( + task, len(cond), variables=[condVar]) + ".splitlines()" else: cond += condText self.fd.write('%s:\n' % cond) @@ -2704,19 +2754,26 @@ self.fd.write( strcmd + self._getPythonActionCmd( + item, task, len(strcmd), variables) + '\n') - def _getPythonActionCmd(self, task, cmdIndent, variables={}): + def _getPythonActionCmd(self, item, task, cmdIndent, variables={}): opts = task.get_options() ret = '' flags = '' params = list() + itemParameterizedFlags = list() + parameterizedParams = [v['name'] for v in variables['params']] + parameterizedFlags = [v['name'] for v in variables['flags']] for f in opts['flags']: + if f.get('name') in parameterizedFlags and len(f.get('name')) == 1: + itemParameterizedFlags.append( + '"{}"'.format(self._getParamName(f.get('name'), item))) if f.get('value', False): name = f.get('name', '') if len(name) > 1: @@ -2724,27 +2781,38 @@ else: flags += name + itemParameterizedFlags = ', '.join(itemParameterizedFlags) + for p in opts['params']: name = p.get('name', None) value = p.get('value', None) - if name and value: + + if (name and value) or (name in parameterizedParams): ptype = p.get('type', 'string') foundVar = False - for var in sorted(variables, key=len, reverse=True): - data = variables[var] - if '%' + var in value: - value = self._substituteVariable(value, var, data) - foundVar = True + if name in parameterizedParams: + foundVar = True + value = 'options["{}"]'.format(self._getParamName(name, + item)) if foundVar or ptype != 'string': - params.append("%s = %s" % (name, value)) + params.append("{}={}".format(name, value)) else: - params.append('%s = "%s"' % (name, value)) + params.append('{}="{}"'.format(name, value)) ret += '"%s"' % task.get_name() if flags: - ret += ",\n%sflags = '%s'" % (' ' * cmdIndent, flags) + ret += ",\n{indent}flags='{fl}'".format(indent=' ' * cmdIndent, + fl=flags) + if itemParameterizedFlags: + ret += ' + getParameterizedFlags(options, [{}])'.format( + itemParameterizedFlags) + elif itemParameterizedFlags: + ret += ',\n{}flags=getParameterizedFlags(options, [{}])'.format( + ' ' * cmdIndent, + itemParameterizedFlags) + if len(params) > 0: ret += ",\n" for opt in params[:-1]: @@ -2794,6 +2862,11 @@ return result.strip('+') + def _getParamName(self, parameter_name, item): + return '{module_name}{module_id}_{param_name}'.format( + module_name=re.sub('[^a-zA-Z]+', '', item.GetLabel()), + module_id=item.GetId(), + param_name=parameter_name) class ModelParamDialog(wx.Dialog): @@ -2830,8 +2903,8 @@ if not rast and not vect and not rast3d: self.interData.Hide() - self.btnCancel = wx.Button(parent=self, id=wx.ID_CANCEL) - self.btnRun = wx.Button(parent=self, id=wx.ID_OK, + self.btnCancel = Button(parent=self, id=wx.ID_CANCEL) + self.btnRun = Button(parent=self, id=wx.ID_OK, label=_("&Run")) self.btnRun.SetDefault() @@ -2870,7 +2943,7 @@ def _createPages(self): """Create for each parameterized module its own page""" nameOrdered = [''] * len(self.params.keys()) - for name, params in self.params.iteritems(): + for name, params in six.iteritems(self.params): nameOrdered[params['idx']] = name for name in nameOrdered: params = self.params[name] diff -Nru grass-7.6.1/gui/wxpython/gmodeler/preferences.py grass-7.8.0/gui/wxpython/gmodeler/preferences.py --- grass-7.6.1/gui/wxpython/gmodeler/preferences.py 2019-03-19 19:57:59.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gmodeler/preferences.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,8 +21,8 @@ from core import globalvar from gui_core.preferences import PreferencesBaseDialog from core.settings import UserSettings -from core.utils import _ -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, StaticText, \ + StaticBox, TextCtrl class PreferencesDialog(PreferencesBaseDialog): @@ -55,15 +55,15 @@ # colors border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Item properties")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Item properties")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Disabled:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Disabled:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -103,15 +103,15 @@ # colors border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Color")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Color")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Valid:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Valid:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -128,8 +128,8 @@ pos=(row, 1)) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Invalid:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Invalid:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -146,8 +146,8 @@ pos=(row, 1)) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Running:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Running:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -173,15 +173,15 @@ wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=3) # size - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Shape size")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Shape size")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Width:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Width:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -206,8 +206,8 @@ pos=(row, 1)) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Height:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Height:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -251,15 +251,15 @@ # colors border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Type")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Type")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Raster:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Raster:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -276,8 +276,8 @@ pos=(row, 1)) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("3D raster:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("3D raster:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -294,8 +294,8 @@ pos=(row, 1)) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Vector:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Vector:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -312,8 +312,8 @@ pos=(row, 1)) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Table:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Table:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -339,15 +339,15 @@ wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=3) # size - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Shape size")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Shape size")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Width:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Width:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -372,8 +372,8 @@ pos=(row, 1)) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Height:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Height:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -417,15 +417,15 @@ # colors border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Color")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Color")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Valid:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Valid:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -451,15 +451,15 @@ wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=3) # size - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Shape size")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Shape size")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Width:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Width:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -484,8 +484,8 @@ pos=(row, 1)) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Height:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Height:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -529,15 +529,15 @@ # colors border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Color")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Color")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Valid:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Valid:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -567,15 +567,15 @@ wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=3) # size - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Shape size")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Shape size")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Width:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Width:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -600,8 +600,8 @@ pos=(row, 1)) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Height:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Height:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -664,18 +664,18 @@ wx.Dialog.__init__(self, parent, id, title, size=size, style=style) - self.metaBox = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Metadata")) - self.cmdBox = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Commands")) - - self.name = wx.TextCtrl(parent=self, id=wx.ID_ANY, - size=(300, 25)) - self.desc = wx.TextCtrl(parent=self, id=wx.ID_ANY, - style=wx.TE_MULTILINE, - size=(300, 50)) - self.author = wx.TextCtrl(parent=self, id=wx.ID_ANY, - size=(300, 25)) + self.metaBox = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Metadata")) + self.cmdBox = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Commands")) + + self.name = TextCtrl(parent=self, id=wx.ID_ANY, + size=(300, 25)) + self.desc = TextCtrl(parent=self, id=wx.ID_ANY, + style=wx.TE_MULTILINE, + size=(300, 50)) + self.author = TextCtrl(parent=self, id=wx.ID_ANY, + size=(300, 25)) # commands self.overwrite = wx.CheckBox(parent=self, id=wx.ID_ANY, label=_( @@ -687,13 +687,13 @@ subkey='enabled')) # buttons - self.btnOk = wx.Button(self, wx.ID_OK) - self.btnCancel = wx.Button(self, wx.ID_CANCEL) + self.btnOk = Button(self, wx.ID_OK) + self.btnCancel = Button(self, wx.ID_CANCEL) self.btnOk.SetDefault() - self.btnOk.SetToolTipString(_("Apply properties")) + self.btnOk.SetToolTip(_("Apply properties")) self.btnOk.SetDefault() - self.btnCancel.SetToolTipString(_("Close dialog and ignore changes")) + self.btnCancel.SetToolTip(_("Close dialog and ignore changes")) self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) @@ -702,8 +702,8 @@ def _layout(self): metaSizer = wx.StaticBoxSizer(self.metaBox, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) - gridSizer.Add(wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Name:")), + gridSizer.Add(StaticText(parent=self, id=wx.ID_ANY, + label=_("Name:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) @@ -711,8 +711,8 @@ flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, pos=(0, 1)) - gridSizer.Add(wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Description:")), + gridSizer.Add(StaticText(parent=self, id=wx.ID_ANY, + label=_("Description:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(1, 0)) @@ -720,8 +720,8 @@ flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, pos=(1, 1)) - gridSizer.Add(wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Author(s):")), + gridSizer.Add(StaticText(parent=self, id=wx.ID_ANY, + label=_("Author(s):")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(2, 0)) diff -Nru grass-7.6.1/gui/wxpython/gmodeler/toolbars.py grass-7.8.0/gui/wxpython/gmodeler/toolbars.py --- grass-7.6.1/gui/wxpython/gmodeler/toolbars.py 2019-03-19 19:58:07.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gmodeler/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,7 +20,6 @@ import wx from core import globalvar -from core.utils import _ from gui_core.toolbars import BaseToolbar, BaseIcons from icons.icon import MetaIcon diff -Nru grass-7.6.1/gui/wxpython/gui_core/dialogs.py grass-7.8.0/gui/wxpython/gui_core/dialogs.py --- grass-7.6.1/gui/wxpython/gui_core/dialogs.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -31,9 +31,15 @@ import os import sys import re +import six import wx +try: + from wx.adv import HyperlinkCtrl +except ImportError: + from wx import HyperlinkCtrl + from grass.script import core as grass from grass.script.utils import natural_sort, try_remove @@ -44,10 +50,10 @@ from gui_core.gselect import LocationSelect, MapsetSelect, Select, \ OgrTypeSelect, SubGroupSelect from gui_core.widgets import SingleSymbolPanel, GListCtrl, SimpleValidator, MapValidator -from core.utils import _ from core.settings import UserSettings from core.debug import Debug -from gui_core.wrap import SpinCtrl, TextCtrl +from gui_core.wrap import SpinCtrl, TextCtrl, Button, CheckListBox, \ + StaticText, StaticBox, Menu class SimpleDialog(wx.Dialog): @@ -64,8 +70,8 @@ self.SetExtraStyle(wx.WS_EX_VALIDATE_RECURSIVELY) self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.btnCancel = wx.Button(parent=self.panel, id=wx.ID_CANCEL) - self.btnOK = wx.Button(parent=self.panel, id=wx.ID_OK) + self.btnCancel = Button(parent=self.panel, id=wx.ID_CANCEL) + self.btnOK = Button(parent=self.panel, id=wx.ID_OK) self.btnOK.SetDefault() self.__layout() @@ -127,7 +133,7 @@ def _layout(self): """Do layout""" self.dataSizer.Add( - wx.StaticText( + StaticText( parent=self.panel, id=wx.ID_ANY, label=_("Name of GRASS location:")), @@ -138,7 +144,7 @@ flag=wx.EXPAND | wx.ALL, border=1) self.dataSizer.Add( - wx.StaticText( + StaticText( parent=self.panel, id=wx.ID_ANY, label=_("Name of mapset:")), @@ -197,8 +203,8 @@ def _layout(self): """Do layout""" - self.dataSizer.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Name of mapset:")), + self.dataSizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Name of mapset:")), proportion=0, flag=wx.ALL, border=1) self.dataSizer.Add(self.element, proportion=0, flag=wx.EXPAND | wx.ALL, border=1) @@ -236,8 +242,8 @@ def _layout(self): """Do layout""" - self.dataSizer.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Name of vector map:")), + self.dataSizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Name of vector map:")), proportion=0, flag=wx.ALL, border=1) self.dataSizer.Add(self.element, proportion=0, flag=wx.EXPAND | wx.ALL, border=1) @@ -292,8 +298,8 @@ if showType: self.keycol = None else: - self.keycol = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY, - size=globalvar.DIALOG_SPIN_SIZE) + self.keycol = TextCtrl(parent=self.panel, id=wx.ID_ANY, + size=globalvar.DIALOG_SPIN_SIZE) self.keycol.SetValue( UserSettings.Get( group='atm', @@ -327,7 +333,7 @@ def _layout(self): """Do layout""" self.dataSizer.Add( - wx.StaticText( + StaticText( parent=self.panel, id=wx.ID_ANY, label=_("Name for new vector map:")), @@ -347,7 +353,7 @@ if self.keycol: keySizer = wx.BoxSizer(wx.HORIZONTAL) keySizer.Add( - wx.StaticText( + StaticText( parent=self.panel, label=_("Key column:")), proportion=0, @@ -552,7 +558,7 @@ sizer = wx.BoxSizer(wx.VERTICAL) box = wx.BoxSizer(wx.HORIZONTAL) - label = wx.StaticText(parent=self, id=wx.ID_ANY) + label = StaticText(parent=self, id=wx.ID_ANY) box.Add( label, proportion=0, @@ -593,11 +599,11 @@ btnsizer = wx.StdDialogButtonSizer() - btn = wx.Button(parent=self, id=wx.ID_OK) + btn = Button(parent=self, id=wx.ID_OK) btn.SetDefault() btnsizer.AddButton(btn) - btn = wx.Button(parent=self, id=wx.ID_CANCEL) + btn = Button(parent=self, id=wx.ID_CANCEL) btnsizer.AddButton(btn) btnsizer.Realize() @@ -662,14 +668,14 @@ self.bodySizer = self._createDialogBody() # buttons - btnOk = wx.Button(parent=self, id=wx.ID_OK) - btnApply = wx.Button(parent=self, id=wx.ID_APPLY) - btnClose = wx.Button(parent=self, id=wx.ID_CANCEL) + btnOk = Button(parent=self, id=wx.ID_OK) + btnApply = Button(parent=self, id=wx.ID_APPLY) + btnClose = Button(parent=self, id=wx.ID_CANCEL) - btnOk.SetToolTipString( + btnOk.SetToolTip( _("Apply changes to selected group and close dialog")) - btnApply.SetToolTipString(_("Apply changes to selected group")) - btnClose.SetToolTipString(_("Close dialog, changes are not applied")) + btnApply.SetToolTip(_("Apply changes to selected group")) + btnClose.SetToolTip(_("Close dialog, changes are not applied")) # btnOk.SetDefault() @@ -716,8 +722,8 @@ " and '$' for the end.") # group selection - bodySizer.Add(wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Select existing group or " + bodySizer.Add(StaticText(parent=self, id=wx.ID_ANY, + label=_("Select existing group or " "enter name of new group:")), flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP, border=10) self.groupSelect = Select(parent=self, type='group', @@ -737,7 +743,7 @@ subg_sizer = wx.BoxSizer(wx.VERTICAL) subg_sizer.Add( - wx.StaticText( + StaticText( parent=self.subg_panel, id=wx.ID_ANY, label=_( @@ -773,7 +779,7 @@ pos=(0, 1)) gListSizer.Add( - wx.StaticText( + StaticText( parent=self.gListPanel, label=_("Pattern:")), flag=wx.ALIGN_CENTER_VERTICAL, @@ -781,17 +787,17 @@ 1, 0)) - self.gfilter = wx.TextCtrl(parent=self.gListPanel, id=wx.ID_ANY, + self.gfilter = TextCtrl(parent=self.gListPanel, id=wx.ID_ANY, value="", size=(250, -1)) - self.gfilter.SetToolTipString(filter_tooltip) + self.gfilter.SetToolTip(filter_tooltip) gListSizer.Add(self.gfilter, flag=wx.EXPAND, pos=(1, 1)) gListSizer.Add( - wx.StaticText( + StaticText( parent=self.gListPanel, label=_("List of maps:")), flag=wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM, @@ -807,13 +813,13 @@ style=wx.LB_MULTIPLE | wx.LB_NEEDED_SB) sizer.Add(self.gLayerBox, proportion=1, flag=wx.EXPAND) - self.addLayer = wx.Button(self.gListPanel, id=wx.ID_ADD) - self.addLayer.SetToolTipString( + self.addLayer = Button(self.gListPanel, id=wx.ID_ADD) + self.addLayer.SetToolTip( _("Select map layers and add them to the list.")) buttonSizer.Add(self.addLayer, flag=wx.BOTTOM, border=10) - self.removeLayer = wx.Button(self.gListPanel, id=wx.ID_REMOVE) - self.removeLayer.SetToolTipString( + self.removeLayer = Button(self.gListPanel, id=wx.ID_REMOVE) + self.removeLayer.SetToolTip( _("Remove selected layer(s) from list.")) buttonSizer.Add(self.removeLayer) sizer.Add(buttonSizer, flag=wx.LEFT, border=5) @@ -841,7 +847,7 @@ pos=(0, 1)) subgListSizer.Add( - wx.StaticText( + StaticText( parent=self.subgListPanel, label=_("Pattern:")), flag=wx.ALIGN_CENTER_VERTICAL, @@ -849,17 +855,17 @@ 1, 0)) - self.subgfilter = wx.TextCtrl(parent=self.subgListPanel, id=wx.ID_ANY, + self.subgfilter = TextCtrl(parent=self.subgListPanel, id=wx.ID_ANY, value="", size=(250, -1)) - self.subgfilter.SetToolTipString(filter_tooltip) + self.subgfilter.SetToolTip(filter_tooltip) subgListSizer.Add(self.subgfilter, flag=wx.EXPAND, pos=(1, 1)) subgListSizer.Add( - wx.StaticText( + StaticText( parent=self.subgListPanel, label=_("List of maps:")), flag=wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM, @@ -868,9 +874,9 @@ 2, 0)) - self.subgListBox = wx.CheckListBox( + self.subgListBox = CheckListBox( parent=self.subgListPanel, id=wx.ID_ANY, size=(250, 100)) - self.subgListBox.SetToolTipString( + self.subgListBox.SetToolTip( _("Check maps from group to be included into subgroup.")) subgListSizer.Add(self.subgListBox, flag=wx.EXPAND, pos=(2, 1)) @@ -880,7 +886,7 @@ self.subgListPanel.SetSizer(subgListSizer) bodySizer.Add(self.subgListPanel, proportion=1, flag=wx.EXPAND) - self.infoLabel = wx.StaticText(parent=self, id=wx.ID_ANY) + self.infoLabel = StaticText(parent=self, id=wx.ID_ANY) bodySizer.Add( self.infoLabel, flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.BOTTOM, @@ -1061,7 +1067,7 @@ """Get layers""" if self.edit_subg: layers = [] - for maps, sel in self.subgmaps.iteritems(): + for maps, sel in six.iteritems(self.subgmaps): if sel: layers.append(maps) else: @@ -1106,7 +1112,7 @@ self.subgListBox.Set(maps) for i, m in enumerate(maps): - if m in self.subgmaps.iterkeys() and self.subgmaps[m]: + if m in six.iterkeys(self.subgmaps) and self.subgmaps[m]: self.subgListBox.Check(i) self._checkSubGSellAll() @@ -1397,8 +1403,8 @@ self._modelerDSeries() # buttons - btnCancel = wx.Button(parent=self, id=wx.ID_CANCEL) - btnOk = wx.Button(parent=self, id=wx.ID_OK) + btnCancel = Button(parent=self, id=wx.ID_CANCEL) + btnOk = Button(parent=self, id=wx.ID_OK) btnOk.SetDefault() # sizers & do layout @@ -1460,7 +1466,7 @@ bodySizer = wx.GridBagSizer(vgap=3, hgap=3) # layer type - bodySizer.Add(wx.StaticText(parent=self, label=_("Map type:")), + bodySizer.Add(StaticText(parent=self, label=_("Map type:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) @@ -1482,7 +1488,7 @@ pos=(0, 2)) # mapset filter - bodySizer.Add(wx.StaticText(parent=self, label=_("Mapset:")), + bodySizer.Add(StaticText(parent=self, label=_("Mapset:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(1, 0)) @@ -1492,7 +1498,7 @@ pos=(1, 1), span=(1, 2)) # map name filter - bodySizer.Add(wx.StaticText(parent=self, label=_("Pattern:")), + bodySizer.Add(StaticText(parent=self, label=_("Pattern:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(2, 0)) @@ -1514,16 +1520,16 @@ # layer list bodySizer.Add( - wx.StaticText( + StaticText( parent=self, label=_("List of maps:")), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_TOP, pos=( 3, 0)) - self.layers = wx.CheckListBox(parent=self, id=wx.ID_ANY, - size=(250, 100), - choices=[]) + self.layers = CheckListBox(parent=self, id=wx.ID_ANY, + size=(250, 100), + choices=[]) bodySizer.Add(self.layers, flag=wx.EXPAND, pos=(3, 1), span=(1, 2)) @@ -1574,7 +1580,7 @@ self.Bind(wx.EVT_MENU, self.OnDeselectAll, id=self.popupDataID3) # generate popup-menu - menu = wx.Menu() + menu = Menu() menu.Append(self.popupDataID1, _("Select all")) menu.Append(self.popupDataID2, _("Invert selection")) menu.Append(self.popupDataID3, _("Deselect all")) @@ -1676,7 +1682,7 @@ self, parent=parent, title=title, **kwargs) def _addApplyButton(self): - btnApply = wx.Button(parent=self, id=wx.ID_APPLY) + btnApply = Button(parent=self, id=wx.ID_APPLY) self.btnSizer.AddButton(btnApply) btnApply.Bind(wx.EVT_BUTTON, self.OnApply) @@ -1776,11 +1782,11 @@ box.Add(self.value, flag=wx.ALIGN_CENTRE, pos=(0, 0), span=(1, 2)) - box.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("transparent")), + box.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("transparent")), pos=(1, 0)) - box.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("opaque")), + box.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("opaque")), flag=wx.ALIGN_RIGHT, pos=(1, 1)) @@ -1795,14 +1801,14 @@ # buttons btnsizer = wx.StdDialogButtonSizer() - btnOK = wx.Button(parent=panel, id=wx.ID_OK) + btnOK = Button(parent=panel, id=wx.ID_OK) btnOK.SetDefault() btnsizer.AddButton(btnOK) - btnCancel = wx.Button(parent=panel, id=wx.ID_CANCEL) + btnCancel = Button(parent=panel, id=wx.ID_CANCEL) btnsizer.AddButton(btnCancel) - btnApply = wx.Button(parent=panel, id=wx.ID_APPLY) + btnApply = Button(parent=panel, id=wx.ID_APPLY) btnApply.Bind(wx.EVT_BUTTON, self.OnApply) btnsizer.AddButton(btnApply) btnsizer.Realize() @@ -1895,8 +1901,8 @@ self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.box = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=' % s' % _("Image size")) + self.box = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=' % s' % _("Image size")) size = self.parent.GetWindow().GetClientSize() self.width = SpinCtrl(parent=self.panel, id=wx.ID_ANY, @@ -1918,9 +1924,9 @@ "1600x1200", "1920x1440"]) - self.btnOK = wx.Button(parent=self.panel, id=wx.ID_OK) + self.btnOK = Button(parent=self.panel, id=wx.ID_OK) self.btnOK.SetDefault() - self.btnCancel = wx.Button(parent=self.panel, id=wx.ID_CANCEL) + self.btnCancel = Button(parent=self.panel, id=wx.ID_CANCEL) self.template.Bind(wx.EVT_CHOICE, self.OnTemplate) @@ -1934,16 +1940,16 @@ # body box = wx.StaticBoxSizer(self.box, wx.HORIZONTAL) fbox = wx.FlexGridSizer(cols=2, vgap=5, hgap=5) - fbox.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Width:")), + fbox.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Width:")), flag=wx.ALIGN_CENTER_VERTICAL) fbox.Add(self.width) - fbox.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Height:")), + fbox.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Height:")), flag=wx.ALIGN_CENTER_VERTICAL) fbox.Add(self.height) - fbox.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Template:")), + fbox.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Template:")), flag=wx.ALIGN_CENTER_VERTICAL) fbox.Add(self.template) @@ -1998,13 +2004,13 @@ wx.BITMAP_TYPE_ICO)) self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.sqlBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=_(" SQL statement ")) - self.sql = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY, - style=wx.TE_MULTILINE) + self.sqlBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=_(" SQL statement ")) + self.sql = TextCtrl(parent=self.panel, id=wx.ID_ANY, + style=wx.TE_MULTILINE) - self.btnApply = wx.Button(parent=self.panel, id=wx.ID_APPLY) - self.btnCancel = wx.Button(parent=self.panel, id=wx.ID_CANCEL) + self.btnApply = Button(parent=self.panel, id=wx.ID_APPLY) + self.btnCancel = Button(parent=self.panel, id=wx.ID_CANCEL) self.Bind(wx.EVT_BUTTON, self.OnCloseWindow, self.btnCancel) self._layout() @@ -2079,7 +2085,7 @@ self.folderChoice.Bind(wx.EVT_CHOICE, self.OnFolderSelect) fgSizer.Add( - wx.StaticText( + StaticText( mainPanel, id=wx.ID_ANY, label=_("Symbol directory:")), @@ -2089,9 +2095,9 @@ fgSizer.Add(self.folderChoice, proportion=0, flag=wx.ALIGN_CENTER, border=0) - self.infoLabel = wx.StaticText(mainPanel, id=wx.ID_ANY) + self.infoLabel = StaticText(mainPanel, id=wx.ID_ANY) fgSizer.Add( - wx.StaticText( + StaticText( mainPanel, id=wx.ID_ANY, label=_("Symbol name:")), @@ -2105,8 +2111,8 @@ vSizer.Add(panel, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) mainSizer.Add(vSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=5) - self.btnCancel = wx.Button(parent=mainPanel, id=wx.ID_CANCEL) - self.btnOK = wx.Button(parent=mainPanel, id=wx.ID_OK) + self.btnCancel = Button(parent=mainPanel, id=wx.ID_CANCEL) + self.btnOK = Button(parent=mainPanel, id=wx.ID_OK) self.btnOK.SetDefault() self.btnOK.Enable(False) @@ -2249,10 +2255,10 @@ vbox = wx.BoxSizer(wx.VERTICAL) - stline = wx.StaticText(self, id=wx.ID_ANY, label=message) + stline = StaticText(self, id=wx.ID_ANY, label=message) vbox.Add(stline, proportion=0, flag=wx.EXPAND | wx.ALL, border=10) - self._textCtrl = wx.TextCtrl( + self._textCtrl = TextCtrl( self, id=wx.ID_ANY, value=defaultValue, @@ -2299,14 +2305,14 @@ sizer = wx.BoxSizer(wx.VERTICAL) - label = wx.StaticText(self, label=message) + label = StaticText(self, label=message) sizer.Add( label, proportion=0, flag=wx.ALIGN_CENTRE | wx.ALL, border=10) hyperlinkLabel = hyperlinkLabel if hyperlinkLabel else hyperlink - hyperlinkCtrl = wx.HyperlinkCtrl( + hyperlinkCtrl = HyperlinkCtrl( self, id=wx.ID_ANY, label=hyperlinkLabel, url=hyperlink, style=wx.HL_ALIGN_LEFT | wx.HL_CONTEXTMENU) sizer.Add( @@ -2343,15 +2349,15 @@ wx.ART_QUESTION, client=wx.ART_MESSAGE_BOX)) - self.informLabel = wx.StaticText( + self.informLabel = StaticText( parent=self.panel, id=wx.ID_ANY, label=_( "Do you want to quit GRASS including shell " "prompt or just close the GUI?")) - self.btnCancel = wx.Button(parent=self.panel, id=wx.ID_CANCEL) - self.btnClose = wx.Button(parent=self.panel, id=wx.ID_NO, + self.btnCancel = Button(parent=self.panel, id=wx.ID_CANCEL) + self.btnClose = Button(parent=self.panel, id=wx.ID_NO, label=_("Close GUI")) self.btnClose.SetFocus() - self.btnQuit = wx.Button(parent=self.panel, id=wx.ID_YES, + self.btnQuit = Button(parent=self.panel, id=wx.ID_YES, label=_("Quit GRASS GIS")) self.btnQuit.SetForegroundColour(wx.Colour(35, 142, 35)) @@ -2412,7 +2418,7 @@ self.fontdict, fontdict_reverse, self.fontlist = self.GetFonts() border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2421,8 +2427,8 @@ gridSizer = wx.GridBagSizer(hgap=5, vgap=5) - label = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Select font:")) + label = StaticText(parent=panel, id=wx.ID_ANY, + label=_("Select font:")) gridSizer.Add(label, flag=wx.ALIGN_TOP, pos=(0, 0)) @@ -2452,14 +2458,14 @@ self.encoding = self.settings.Get(group='display', key='font', subkey='encoding') - label = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Character encoding:")) + label = StaticText(parent=panel, id=wx.ID_ANY, + label=_("Character encoding:")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(3, 0)) - self.textentry = wx.TextCtrl(parent=panel, id=wx.ID_ANY, - value=self.encoding) + self.textentry = TextCtrl(parent=panel, id=wx.ID_ANY, + value=self.encoding) gridSizer.Add(self.textentry, flag=wx.EXPAND, pos=(4, 0)) @@ -2470,8 +2476,8 @@ key='outputfont', subkey='type') self.fontsize = self.settings.Get(group='appearance', key='outputfont', subkey='size') - label = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Font size:")) + label = StaticText(parent=panel, id=wx.ID_ANY, + label=_("Font size:")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(3, 0)) @@ -2506,11 +2512,11 @@ btnsizer = wx.StdDialogButtonSizer() - btn = wx.Button(parent=panel, id=wx.ID_OK) + btn = Button(parent=panel, id=wx.ID_OK) btn.SetDefault() btnsizer.AddButton(btn) - btn = wx.Button(parent=panel, id=wx.ID_CANCEL) + btn = Button(parent=panel, id=wx.ID_CANCEL) btnsizer.AddButton(btn) btnsizer.Realize() diff -Nru grass-7.6.1/gui/wxpython/gui_core/forms.py grass-7.8.0/gui/wxpython/gui_core/forms.py --- grass-7.6.1/gui/wxpython/gui_core/forms.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/forms.py 2019-06-03 20:34:20.000000000 +0000 @@ -49,12 +49,18 @@ from __future__ import print_function import sys -import string import textwrap import os import copy import locale -import Queue +import six + +if sys.version_info.major == 2: + import Queue +else: + import queue as Queue + unicode = str + import re import codecs @@ -95,12 +101,12 @@ from gui_core import gselect from core import gcmd from core import utils -from core.utils import _ from core.settings import UserSettings from gui_core.widgets import FloatValidator, GNotebook, FormNotebook, FormListbook from core.giface import Notification from gui_core.widgets import LayersList -from gui_core.wrap import BitmapFromImage, Button, StaticText, StaticBox, SpinCtrl +from gui_core.wrap import BitmapFromImage, Button, StaticText, StaticBox, SpinCtrl, \ + CheckBox, BitmapButton, TextCtrl from core.debug import Debug wxUpdateDialog, EVT_DIALOG_UPDATE = NewEvent() @@ -120,20 +126,18 @@ """ if width > 0: return escape_ampersand( - string.strip( - os.linesep.join( - textwrap.wrap( - utils.normalize_whitespace(someString), - width)), - ".,;:")) + os.linesep.join( + textwrap.wrap( + utils.normalize_whitespace(someString), + width)).strip(".,;:")) else: - return escape_ampersand(string.strip( - utils.normalize_whitespace(someString), ".,;:")) + return escape_ampersand( + utils.normalize_whitespace(someString).strip(".,;:")) def escape_ampersand(text): """Escapes ampersands with additional ampersand for GUI""" - return string.replace(text, "&", "&&") + return text.replace("&", "&&") class UpdateThread(Thread): @@ -691,7 +695,7 @@ if self.get_dcmd is None and hasNew: # close dialog when command is terminated - self.closebox = wx.CheckBox( + self.closebox = CheckBox( parent=self.panel, label=_('Close dialog on finish'), style=wx.NO_BORDER) @@ -700,7 +704,7 @@ group='cmd', key='closeDlg', subkey='enabled')) - self.closebox.SetToolTipString( + self.closebox.SetToolTip( _( "Close dialog when command is successfully finished. " "Change this settings in Preferences dialog ('Command' tab).")) @@ -1046,13 +1050,13 @@ title_sizer = wx.BoxSizer(wx.HORIZONTAL) rtitle_txt = StaticText(parent=which_panel, label='(' + f['name'] + ')') - chk = wx.CheckBox( + chk = CheckBox( parent=which_panel, label=title, style=wx.NO_BORDER) self.label_id.append(chk.GetId()) if tooltip: - chk.SetToolTipString(tooltip) + chk.SetToolTip(tooltip) chk.SetValue(f.get('value', False)) title_sizer.Add(chk, proportion=1, flag=wx.EXPAND) @@ -1164,8 +1168,8 @@ p['value'] = p.get('default', '') if (len(p.get('values', [])) > 0): - valuelist = map(str, p.get('values', [])) - valuelist_desc = map(unicode, p.get('values_desc', [])) + valuelist = list(map(str, p.get('values', []))) + valuelist_desc = list(map(unicode, p.get('values_desc', []))) required_text = "*" if p.get('required', False) else "" if p.get('multiple', False) and \ p.get('gisprompt', False) == False and \ @@ -1225,8 +1229,8 @@ # for multiple integers use textctrl instead of # spinsctrl try: - minValue, maxValue = map( - int, valuelist[0].rsplit('-', 1)) + minValue, maxValue = list(map( + int, valuelist[0].rsplit('-', 1))) except ValueError: minValue = -1e6 maxValue = 1e6 @@ -1238,7 +1242,7 @@ max=maxValue) style = wx.BOTTOM | wx.LEFT else: - txt2 = wx.TextCtrl( + txt2 = TextCtrl( parent=which_panel, value=p.get( 'default', '')) style = wx.EXPAND | wx.BOTTOM | wx.LEFT @@ -1266,7 +1270,7 @@ os.path.join( globalvar.SYMBDIR, value) + '.png') - bb = wx.BitmapButton( + bb = BitmapButton( parent=which_panel, id=wx.ID_ANY, bitmap=bitmap) iconLabel = StaticText( parent=which_panel, id=wx.ID_ANY) @@ -1315,7 +1319,7 @@ if p.get('multiple', False) or \ p.get('type', 'string') == 'string' or \ len(p.get('key_desc', [])) > 1: - win = wx.TextCtrl( + win = TextCtrl( parent=which_panel, value=p.get( 'default', '')) @@ -1363,7 +1367,7 @@ which_sizer.Add(win, proportion=0, flag=style, border=5) else: # float - win = wx.TextCtrl( + win = TextCtrl( parent=which_panel, value=p.get( 'default', ''), validator=FloatValidator()) style = wx.EXPAND | wx.BOTTOM | wx.LEFT | wx.RIGHT @@ -1555,10 +1559,10 @@ os.path.join( globalvar.ICONDIR, iconTheme, 'map-info.png')) - bb = wx.BitmapButton( + bb = BitmapButton( parent=which_panel, bitmap=bitmap) bb.Bind(wx.EVT_BUTTON, self.OnTimelineTool) - bb.SetToolTipString( + bb.SetToolTip( _("Show graphical representation of temporal extent of dataset(s) .")) p['wxId'].append(bb.GetId()) @@ -1630,7 +1634,7 @@ 'mapset', 'dbase'): if p.get('multiple', 'no') == 'yes': - win = wx.TextCtrl( + win = TextCtrl( parent=which_panel, value=p.get( 'default', ''), size=globalvar.DIALOG_TEXTCTRL_SIZE) win.Bind(wx.EVT_TEXT, self.OnSetValue) @@ -1679,7 +1683,7 @@ wx.EVT_COMBOBOX, self.OnUpdateSelection) win.Bind(wx.EVT_COMBOBOX, self.OnSetValue) else: - win = wx.TextCtrl( + win = TextCtrl( parent=which_panel, value=p.get( 'default', ''), size=globalvar.DIALOG_TEXTCTRL_SIZE) @@ -1757,7 +1761,7 @@ # and either a "transparent" checkbox or None p['wxId'] = [None] * 3 if p.get('multiple', False): - txt = wx.TextCtrl(parent=which_panel, id=wx.ID_ANY) + txt = TextCtrl(parent=which_panel, id=wx.ID_ANY) this_sizer.Add( txt, proportion=1, @@ -1846,9 +1850,9 @@ 'element', '') == 'file' and UserSettings.Get( group='cmd', key='interactiveInput', subkey='enabled'): # widget for interactive input - ifbb = wx.TextCtrl(parent=which_panel, id=wx.ID_ANY, - style=wx.TE_MULTILINE, - size=(-1, 75)) + ifbb = TextCtrl(parent=which_panel, id=wx.ID_ANY, + style=wx.TE_MULTILINE, + size=(-1, 75)) if p.get('value', '') and os.path.isfile(p['value']): ifbb.Clear() enc = locale.getdefaultlocale()[1] @@ -1949,7 +1953,7 @@ # normal text field else: - win = wx.TextCtrl(parent=which_panel) + win = TextCtrl(parent=which_panel) p['wxId'] = [win.GetId()] win.Bind(wx.EVT_TEXT, self.OnSetValue) @@ -1974,7 +1978,7 @@ self.parent.dialogClosing.connect(win.OnClose) # normal text field else: - win = wx.TextCtrl(parent=which_panel) + win = TextCtrl(parent=which_panel) value = self._getValue(p) win.SetValue(value) p['wxId'] = [win.GetId()] @@ -2242,7 +2246,7 @@ tabsizer[section].Fit(tab[section]) tab[section].Layout() minsecsizes = tabsizer[section].GetSize() - maxsizes = map(lambda x: max(maxsizes[x], minsecsizes[x]), (0, 1)) + maxsizes = list(map(lambda x: max(maxsizes[x], minsecsizes[x]), (0, 1))) # TODO: be less arbitrary with these 600 self.panelMinHeight = 100 @@ -2489,7 +2493,7 @@ self.OnUpdateSelection(event) def OnUpdateDialog(self, event): - for fn, kwargs in event.data.iteritems(): + for fn, kwargs in six.iteritems(event.data): fn(**kwargs) self.parent.updateValuesHook() @@ -2559,7 +2563,7 @@ colorchooser = wx.FindWindowById(p['wxId'][0]) new_color = colorchooser.GetValue()[:] new_label = utils.rgb2str.get( - new_color, ':'.join(map(str, new_color))) + new_color, ':'.join(list(map(str, new_color)))) textCtrl = wx.FindWindowById(p['wxId'][1]) val = textCtrl.GetValue() sep = ',' @@ -2576,7 +2580,7 @@ # This is weird: new_color is a 4-tuple and new_color[:] is a 3-tuple # under wx2.8.1 new_label = utils.rgb2str.get( - new_color, ':'.join(map(str, new_color))) + new_color, ':'.join(list(map(str, new_color)))) colorchooser.SetLabel(new_label) colorchooser.SetColour(new_color) colorchooser.Refresh() @@ -3110,7 +3114,7 @@ "gisprompt": False, "multiple": "yes", # values must be an array of strings - "values": utils.str2rgb.keys() + map(str, utils.str2rgb.values()), + "values": utils.str2rgb.keys() + list(map(str, utils.str2rgb.values())), "key_desc": ["value"], "values_desc": [] }, { diff -Nru grass-7.6.1/gui/wxpython/gui_core/ghelp.py grass-7.8.0/gui/wxpython/gui_core/ghelp.py --- grass-7.6.1/gui/wxpython/gui_core/ghelp.py 2019-03-19 19:57:32.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/ghelp.py 2019-06-03 20:34:20.000000000 +0000 @@ -23,6 +23,12 @@ import re import textwrap import sys +import six + +if sys.version_info.major == 2: + _unichr = unichr +else: + _unichr = chr import wx from wx.html import HtmlWindow @@ -39,9 +45,9 @@ set_gui_path() from core import globalvar -from core.utils import _ from core.gcmd import GError, DecodeString from gui_core.widgets import FormNotebook, ScrolledPanel +from gui_core.wrap import Button, StaticText, TextCtrl from core.debug import Debug @@ -86,7 +92,7 @@ wx.CallAfter(self.aboutNotebook.Refresh) # buttons - self.btnClose = wx.Button(parent=self.panel, id=wx.ID_CLOSE) + self.btnClose = Button(parent=self.panel, id=wx.ID_CLOSE) self.btnClose.Bind(wx.EVT_BUTTON, self.OnCloseWindow) self._doLayout() @@ -131,20 +137,20 @@ infoLabel = 'GRASS GIS %s' % vInfo.get('version', _('unknown version')) if 'x86_64' in vInfo.get('build_platform', ''): infoLabel += ' (64bit)' - info = wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label=infoLabel + os.linesep) + info = StaticText(parent=infoTxt, id=wx.ID_ANY, + label=infoLabel + os.linesep) info.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) info.SetForegroundColour(wx.Colour(35, 142, 35)) infoSizer.Add(info, proportion=0, flag=wx.BOTTOM | wx.ALIGN_CENTER, border=1) - team = wx.StaticText(parent=infoTxt, label=_grassDevTeam(1999) + '\n') + team = StaticText(parent=infoTxt, label=_grassDevTeam(1999) + '\n') infoSizer.Add(team, proportion=0, flag=wx.BOTTOM | wx.ALIGN_CENTER, border=1) row = 0 - infoGridSizer.Add(wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label=_('Official GRASS site:')), + infoGridSizer.Add(StaticText(parent=infoTxt, id=wx.ID_ANY, + label=_('Official GRASS site:')), pos=(row, 0), flag=wx.ALIGN_RIGHT) @@ -154,24 +160,24 @@ flag=wx.ALIGN_LEFT) row += 2 - infoGridSizer.Add(wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label='%s:' % _('Code Revision')), + infoGridSizer.Add(StaticText(parent=infoTxt, id=wx.ID_ANY, + label='%s:' % _('Code Revision')), pos=(row, 0), flag=wx.ALIGN_RIGHT) - infoGridSizer.Add(wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label=vInfo.get('revision', '?')), + infoGridSizer.Add(StaticText(parent=infoTxt, id=wx.ID_ANY, + label=vInfo.get('revision', '?')), pos=(row, 1), flag=wx.ALIGN_LEFT) row += 1 - infoGridSizer.Add(wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label='%s:' % _('Build Date')), + infoGridSizer.Add(StaticText(parent=infoTxt, id=wx.ID_ANY, + label='%s:' % _('Build Date')), pos=(row, 0), flag=wx.ALIGN_RIGHT) infoGridSizer.Add( - wx.StaticText( + StaticText( parent=infoTxt, id=wx.ID_ANY, label=vInfo.get( 'build_date', '?')), pos=( row, 1), flag=wx.ALIGN_LEFT) @@ -190,24 +196,24 @@ # flag = wx.ALIGN_LEFT) row += 2 - infoGridSizer.Add(wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label='Python:'), + infoGridSizer.Add(StaticText(parent=infoTxt, id=wx.ID_ANY, + label='Python:'), pos=(row, 0), flag=wx.ALIGN_RIGHT) - infoGridSizer.Add(wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label=platform.python_version()), + infoGridSizer.Add(StaticText(parent=infoTxt, id=wx.ID_ANY, + label=platform.python_version()), pos=(row, 1), flag=wx.ALIGN_LEFT) row += 1 - infoGridSizer.Add(wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label='wxPython:'), + infoGridSizer.Add(StaticText(parent=infoTxt, id=wx.ID_ANY, + label='wxPython:'), pos=(row, 0), flag=wx.ALIGN_RIGHT) - infoGridSizer.Add(wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label=wx.__version__), + infoGridSizer.Add(StaticText(parent=infoTxt, id=wx.ID_ANY, + label=wx.__version__), pos=(row, 1), flag=wx.ALIGN_LEFT) @@ -219,8 +225,8 @@ flag=wx.EXPAND | wx.ALIGN_CENTER | wx.ALIGN_CENTER_VERTICAL) row += 2 - infoGridSizer.Add(wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label="%s:" % _('Language')), + infoGridSizer.Add(StaticText(parent=infoTxt, id=wx.ID_ANY, + label="%s:" % _('Language')), pos=(row, 0), flag=wx.ALIGN_RIGHT) self.langUsed = grass.gisenv().get('LANG', None) @@ -231,8 +237,8 @@ self.langUsed = _('unknown') else: self.langUsed = u'%s.%s' % (loc[0], loc[1]) - infoGridSizer.Add(wx.StaticText(parent=infoTxt, id=wx.ID_ANY, - label=self.langUsed), + infoGridSizer.Add(StaticText(parent=infoTxt, id=wx.ID_ANY, + label=self.langUsed), pos=(row, 1), flag=wx.ALIGN_LEFT) @@ -253,7 +259,7 @@ # put text into a scrolling panel copyrightwin = ScrolledPanel(self.aboutNotebook) - copyrighttxt = wx.TextCtrl( + copyrighttxt = TextCtrl( copyrightwin, id=wx.ID_ANY, value=copytext, style=wx.TE_MULTILINE | wx.TE_READONLY) copyrightwin.SetAutoLayout(True) @@ -277,7 +283,7 @@ license = _('%s file missing') % 'GPL.TXT' # put text into a scrolling panel licensewin = ScrolledPanel(self.aboutNotebook) - licensetxt = wx.TextCtrl( + licensetxt = TextCtrl( licensewin, id=wx.ID_ANY, value=license, style=wx.TE_MULTILINE | wx.TE_READONLY) licensewin.SetAutoLayout(True) @@ -303,7 +309,7 @@ # put text into a scrolling panel window = ScrolledPanel(self.aboutNotebook) - stat_text = wx.TextCtrl( + stat_text = TextCtrl( window, id=wx.ID_ANY, value=text, style=wx.TE_MULTILINE | wx.TE_READONLY) window.SetAutoLayout(True) @@ -321,13 +327,12 @@ # credits authfile = os.path.join(os.getenv("GISBASE"), "AUTHORS") if os.path.exists(authfile): - authorsFile = open(authfile, 'r') - authors = unicode(''.join(authorsFile.readlines()), "utf-8") - authorsFile.close() + with codecs.open(authfile, encoding='utf-8', mode='r') as authorsFile: + authors = ''.join(authorsFile.readlines()) else: authors = _('%s file missing') % 'AUTHORS' authorwin = ScrolledPanel(self.aboutNotebook) - authortxt = wx.TextCtrl( + authortxt = TextCtrl( authorwin, id=wx.ID_ANY, value=authors, style=wx.TE_MULTILINE | wx.TE_READONLY) authorwin.SetAutoLayout(True) @@ -385,7 +390,7 @@ contribwin.sizer = wx.BoxSizer(wx.VERTICAL) if not contribs: - contribtxt = wx.StaticText( + contribtxt = StaticText( contribwin, id=wx.ID_ANY, label=_('%s file missing') % @@ -399,8 +404,8 @@ items = (_('Name'), _('E-mail'), _('Country'), _('OSGeo_ID')) contribBox = wx.FlexGridSizer(cols=len(items), vgap=5, hgap=5) for item in items: - text = wx.StaticText(parent=contribwin, id=wx.ID_ANY, - label=item) + text = StaticText(parent=contribwin, id=wx.ID_ANY, + label=item) text.SetFont( wx.Font( 10, @@ -413,7 +418,7 @@ for vals in sorted(contribs, key=lambda x: x[0]): for item in vals: contribBox.Add( - wx.StaticText( + StaticText( parent=contribwin, id=wx.ID_ANY, label=item)) @@ -429,7 +434,7 @@ """Translators info""" translatorsfile = os.path.join(os.getenv("GISBASE"), "translators.csv") if os.path.exists(translatorsfile): - translatorsFile = open(translatorsfile, 'r') + translatorsFile = codecs.open(translatorsfile, encoding='utf-8', mode='r') translators = dict() errLines = list() for line in translatorsFile.readlines()[1:]: @@ -459,7 +464,7 @@ translatorswin.sizer = wx.BoxSizer(wx.VERTICAL) if not translators: - translatorstxt = wx.StaticText( + translatorstxt = StaticText( translatorswin, id=wx.ID_ANY, label=_('%s file missing') % @@ -469,39 +474,37 @@ else: translatorsBox = wx.FlexGridSizer(cols=4, vgap=5, hgap=5) languages = sorted(translators.keys()) - tname = wx.StaticText(parent=translatorswin, id=wx.ID_ANY, - label=_('Name')) + tname = StaticText(parent=translatorswin, id=wx.ID_ANY, + label=_('Name')) tname.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) translatorsBox.Add(tname) - temail = wx.StaticText(parent=translatorswin, id=wx.ID_ANY, - label=_('E-mail')) + temail = StaticText(parent=translatorswin, id=wx.ID_ANY, + label=_('E-mail')) temail.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) translatorsBox.Add(temail) - tlang = wx.StaticText(parent=translatorswin, id=wx.ID_ANY, - label=_('Language')) + tlang = StaticText(parent=translatorswin, id=wx.ID_ANY, + label=_('Language')) tlang.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) translatorsBox.Add(tlang) - tnat = wx.StaticText(parent=translatorswin, id=wx.ID_ANY, - label=_('Nation')) + tnat = StaticText(parent=translatorswin, id=wx.ID_ANY, + label=_('Nation')) tnat.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) translatorsBox.Add(tnat) for lang in languages: for translator in translators[lang]: name, email = translator translatorsBox.Add( - wx.StaticText( + StaticText( parent=translatorswin, id=wx.ID_ANY, - label=unicode( - name, - "utf-8"))) + label=name)) translatorsBox.Add( - wx.StaticText( + StaticText( parent=translatorswin, id=wx.ID_ANY, label=email)) translatorsBox.Add( - wx.StaticText( + StaticText( parent=translatorswin, id=wx.ID_ANY, label=lang)) @@ -514,7 +517,7 @@ translatorsBox.Add(flagBitmap) else: translatorsBox.Add( - wx.StaticText( + StaticText( parent=translatorswin, id=wx.ID_ANY, label=lang)) @@ -547,35 +550,35 @@ def _langBox(self, par, k, v): """Return box""" langBox = wx.FlexGridSizer(cols=4, vgap=5, hgap=5) - tkey = wx.StaticText(parent=par, id=wx.ID_ANY, - label=k.upper()) + tkey = StaticText(parent=par, id=wx.ID_ANY, + label=k.upper()) langBox.Add(tkey) try: - tgood = wx.StaticText(parent=par, id=wx.ID_ANY, - label=_("%d translated" % v['good'])) + tgood = StaticText(parent=par, id=wx.ID_ANY, + label=_("%d translated" % v['good'])) tgood.SetForegroundColour(wx.Colour(35, 142, 35)) langBox.Add(tgood) except: - tgood = wx.StaticText(parent=par, id=wx.ID_ANY, - label="") + tgood = StaticText(parent=par, id=wx.ID_ANY, + label="") langBox.Add(tgood) try: - tfuzzy = wx.StaticText(parent=par, id=wx.ID_ANY, - label=_(" %d fuzzy" % v['fuzzy'])) + tfuzzy = StaticText(parent=par, id=wx.ID_ANY, + label=_(" %d fuzzy" % v['fuzzy'])) tfuzzy.SetForegroundColour(wx.Colour(255, 142, 0)) langBox.Add(tfuzzy) except: - tfuzzy = wx.StaticText(parent=par, id=wx.ID_ANY, - label="") + tfuzzy = StaticText(parent=par, id=wx.ID_ANY, + label="") langBox.Add(tfuzzy) try: - tbad = wx.StaticText(parent=par, id=wx.ID_ANY, - label=_(" %d untranslated" % v['bad'])) + tbad = StaticText(parent=par, id=wx.ID_ANY, + label=_(" %d untranslated" % v['bad'])) tbad.SetForegroundColour(wx.Colour(255, 0, 0)) langBox.Add(tbad) except: - tbad = wx.StaticText(parent=par, id=wx.ID_ANY, - label="") + tbad = StaticText(parent=par, id=wx.ID_ANY, + label="") langBox.Add(tbad) return langBox @@ -593,7 +596,7 @@ # else: # panel.Collapse(True) pageSizer = wx.BoxSizer(wx.VERTICAL) - for k, v in js.iteritems(): + for k, v in six.iteritems(js): if k != 'total' and k != 'name': box = self._langBox(win, k, v) pageSizer.Add(box, proportion=1, @@ -626,8 +629,8 @@ if not jsStats: Debug.msg(5, _("File <%s> not found") % fname) statsSizer = wx.BoxSizer(wx.VERTICAL) - statstext = wx.StaticText(self.statswin, id=wx.ID_ANY, - label=_('%s file missing') % fname) + statstext = StaticText(self.statswin, id=wx.ID_ANY, + label=_('%s file missing') % fname) statsSizer.Add(statstext, proportion=1, flag=wx.EXPAND | wx.ALL, border=3) else: @@ -753,7 +756,7 @@ try: contents = [] skip = False - for l in file(htmlFile, "rb").readlines(): + for l in open(htmlFile, "rb").readlines(): if "DESCRIPTION" in l: skip = False if not skip: @@ -796,10 +799,10 @@ self.content = HelpWindow(self, command, text, skipDescription) - self.btnNext = wx.Button(parent=self, id=wx.ID_ANY, + self.btnNext = Button(parent=self, id=wx.ID_ANY, label=_("&Next")) self.btnNext.Enable(False) - self.btnPrev = wx.Button(parent=self, id=wx.ID_ANY, + self.btnPrev = Button(parent=self, id=wx.ID_ANY, label=_("&Previous")) self.btnPrev.Enable(False) @@ -924,7 +927,7 @@ end = date.today().year return '%(c)s %(start)s-%(end)s by the GRASS Development Team' % { - 'c': unichr(169), 'start': start, 'end': end} + 'c': _unichr(169), 'start': start, 'end': end} def main(): diff -Nru grass-7.6.1/gui/wxpython/gui_core/goutput.py grass-7.8.0/gui/wxpython/gui_core/goutput.py --- grass-7.6.1/gui/wxpython/gui_core/goutput.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/goutput.py 2019-06-03 20:34:20.000000000 +0000 @@ -37,9 +37,9 @@ EVT_CMD_OUTPUT, EVT_CMD_PROGRESS, EVT_CMD_RUN, EVT_CMD_DONE, \ Notification from gui_core.prompt import GPromptSTC -from gui_core.wrap import Button, ToggleButton +from gui_core.wrap import Button, ToggleButton, StaticText, \ + StaticBox from core.settings import UserSettings -from core.utils import _ from gui_core.widgets import SearchModuleWidget @@ -145,14 +145,14 @@ if self._gcstyle & GC_PROMPT: cmdLabel = _("Command prompt") - self.outputBox = wx.StaticBox( + self.outputBox = StaticBox( parent=self.panelOutput, id=wx.ID_ANY, label=" %s " % _("Output window")) - self.cmdBox = wx.StaticBox(parent=self.panelOutput, id=wx.ID_ANY, - label=" %s " % cmdLabel) + self.cmdBox = StaticBox(parent=self.panelOutput, id=wx.ID_ANY, + label=" %s " % cmdLabel) # buttons self.btnOutputClear = Button( @@ -203,7 +203,7 @@ promptSizer.Add(self.cmdPrompt, proportion=1, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=3) - helpText = wx.StaticText( + helpText = StaticText( self.panelPrompt, id=wx.ID_ANY, label="Press Tab to display command help, Ctrl+Space to autocomplete") helpText.SetForegroundColour( @@ -629,7 +629,7 @@ group='appearance', key='outputfont', subkey='size') - if typesize is None or typesize <= 0: + if typesize is None or int(typesize) <= 0: typesize = 10 typesize = float(typesize) diff -Nru grass-7.6.1/gui/wxpython/gui_core/gselect.py grass-7.8.0/gui/wxpython/gui_core/gselect.py --- grass-7.6.1/gui/wxpython/gui_core/gselect.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/gselect.py 2019-06-03 20:34:20.000000000 +0000 @@ -47,6 +47,7 @@ import sys import glob import copy +import six import wx @@ -66,12 +67,6 @@ import grass.script as grass from grass.script import task as gtask from grass.exceptions import CalledModuleError -try: - from grass.pygrass import messages -except ImportError as e: - print(_("Unable to import pyGRASS: %s\n" - "Some functionality will be not accessible") % e, - file=sys.stderr) from gui_core.widgets import ManageSettingsWidget, CoordinatesValidator @@ -79,11 +74,12 @@ from core.utils import GetListOfLocations, GetListOfMapsets, \ GetFormats, rasterFormatExtension, vectorFormatExtension from core.utils import GetSettingsPath, GetValidLayerName, ListSortLower -from core.utils import GetVectorNumberOfLayers, _ +from core.utils import GetVectorNumberOfLayers from core.settings import UserSettings from core.debug import Debug from gui_core.vselect import VectorSelectBase -from gui_core.wrap import TreeCtrl +from gui_core.wrap import TreeCtrl, Button, StaticText, StaticBox, \ + TextCtrl, Panel from grass.pydispatch.signal import Signal @@ -514,7 +510,7 @@ renamed_elements.append(elementdict[elem]) if element in ('stds', 'strds', 'str3ds', 'stvds'): - if self.tgis_error is False: + if not self.tgis_error: import grass.temporal as tgis filesdict = tgis.tlist_grouped( elementdict[element], element == 'stds') @@ -526,7 +522,7 @@ # add extra items first if self.extraItems: - for group, items in self.extraItems.iteritems(): + for group, items in six.iteritems(self.extraItems): node = self.AddItem(group, node=True) self.seltree.SetItemTextColour(node, wx.Colour(50, 50, 200)) for item in items: @@ -761,11 +757,19 @@ if self.type in ('stds', 'strds', 'str3ds', 'stvds'): # Initiate the temporal framework. Catch database error # and set the error flag for the stds listing. - import grass.temporal as tgis try: - tgis.init(True) - except messages.FatalError as e: - sys.stderr.write("Temporal GIS error:\n%s" % e) + import grass.temporal as tgis + from grass.pygrass import messages + try: + tgis.init(True) + except messages.FatalError as e: + sys.stderr.write(_("Temporal GIS error:\n%s") % e) + self.tgis_error = True + except ImportError as e: + # PyGRASS (ctypes) is the likely cause + sys.stderr.write(_( + "Unable to import pyGRASS: %s\n" + "Some functionality will be not accessible") % e) self.tgis_error = True if 'mapsets' in kargs: self.mapsets = kargs['mapsets'] @@ -804,7 +808,7 @@ def _CheckDBConnection(self): """Check DB connection""" - nuldev = file(os.devnull, 'w+') + nuldev = open(os.devnull, 'w+') # if map is not defined (happens with vnet initialization) or it # doesn't exist try: @@ -989,7 +993,7 @@ self.SetStringSelection(value) -class DatabaseSelect(wx.TextCtrl): +class DatabaseSelect(TextCtrl): """Creates combo box for selecting database driver. """ @@ -1124,16 +1128,16 @@ columnchoices = dbInfo.GetTableDesc(table) keyColumn = dbInfo.GetKeyColumn(layer) self.columns = len(columnchoices.keys()) * [''] - for key, val in columnchoices.iteritems(): + for key, val in six.iteritems(columnchoices): self.columns[val['index']] = key if excludeKey: # exclude key column self.columns.remove(keyColumn) if excludeCols: # exclude key column - for key in columnchoices.iterkeys(): + for key in six.iterkeys(columnchoices): if key in excludeCols: self.columns.remove(key) if type: # only selected column types - for key, value in columnchoices.iteritems(): + for key, value in six.iteritems(columnchoices): if value['type'] not in type: try: self.columns.remove(key) @@ -1398,7 +1402,7 @@ self.reloadDataRequired = Signal('GdalSelect.reloadDataRequired') - self.inputBox = wx.StaticBox(parent=self) + self.inputBox = StaticBox(parent=self) if dest: self.inputBox.SetLabel(" %s " % _("Output settings")) else: @@ -1502,7 +1506,7 @@ fileMask=fileMask) browse.GetChildren()[1].SetName('GdalSelectDataSource') self.fileWidgets['browse'] = browse - self.fileWidgets['options'] = wx.TextCtrl(parent=self.filePanel) + self.fileWidgets['options'] = TextCtrl(parent=self.filePanel) # directory self.dirPanel = wx.Panel(parent=self) @@ -1527,11 +1531,11 @@ self.dirWidgets['format'].GetStringSelection())) formatSelect.Bind(wx.EVT_CHOICE, self.OnUpdate) - self.dirWidgets['extensionLabel'] = wx.StaticText( + self.dirWidgets['extensionLabel'] = StaticText( parent=self.dirPanel, label=_("Extension:")) - self.dirWidgets['extension'] = wx.TextCtrl(parent=self.dirPanel) + self.dirWidgets['extension'] = TextCtrl(parent=self.dirPanel) self.dirWidgets['extension'].Bind(wx.EVT_TEXT, self.ExtensionChanged) - self.dirWidgets['options'] = wx.TextCtrl(parent=self.dirPanel) + self.dirWidgets['options'] = TextCtrl(parent=self.dirPanel) if self.ogr: shapefile = 'ESRI Shapefile' if shapefile in fileFormats: @@ -1568,12 +1572,12 @@ self.dbWidgets['choice'] = wx.Choice( parent=self.dbPanel, name='GdalSelectDataSource') self.dbWidgets['choice'].Bind(wx.EVT_CHOICE, self.OnUpdate) - self.dbWidgets['text'] = wx.TextCtrl( + self.dbWidgets['text'] = TextCtrl( parent=self.dbPanel, name='GdalSelectDataSource') self.dbWidgets['text'].Bind(wx.EVT_TEXT, self.OnUpdate) - self.dbWidgets['textLabel1'] = wx.StaticText( + self.dbWidgets['textLabel1'] = StaticText( parent=self.dbPanel, label=_("Name:")) - self.dbWidgets['textLabel2'] = wx.StaticText( + self.dbWidgets['textLabel2'] = StaticText( parent=self.dbPanel, label=_("Name:")) self.dbWidgets['featType'] = wx.RadioBox( parent=self.dbPanel, @@ -1599,7 +1603,7 @@ startDirectory=os.getcwd(), changeCallback=self.OnUpdate) self.dbWidgets['dirbrowse'] = browse - self.dbWidgets['options'] = wx.TextCtrl(parent=self.dbPanel) + self.dbWidgets['options'] = TextCtrl(parent=self.dbPanel) # protocol self.protocolPanel = wx.Panel(parent=self) @@ -1609,9 +1613,9 @@ choices=protocolFormats) self.protocolWidgets['format'] = protocolChoice - self.protocolWidgets['text'] = wx.TextCtrl(parent=self.protocolPanel) + self.protocolWidgets['text'] = TextCtrl(parent=self.protocolPanel) self.protocolWidgets['text'].Bind(wx.EVT_TEXT, self.OnUpdate) - self.protocolWidgets['options'] = wx.TextCtrl( + self.protocolWidgets['options'] = TextCtrl( parent=self.protocolPanel) # native @@ -1647,7 +1651,7 @@ dsn = v break optList = list() - for k, v in data.iteritems(): + for k, v in six.iteritems(data): if k in ('format', 'conninfo', 'topology'): continue optList.append('%s=%s' % (k, v)) @@ -1692,8 +1696,8 @@ sizer.Add(paddingSizer, flag=wx.EXPAND, pos=(0, 0), span=(1, 2)) sizer.AddGrowableCol(0) if self.dest: - sizer.Add(wx.StaticText(parent=self.filePanel, - label=_("Creation options:")), + sizer.Add(StaticText(parent=self.filePanel, + label=_("Creation options:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(1, 0)) sizer.Add(self.fileWidgets['options'], @@ -1706,8 +1710,8 @@ # directory sizer = wx.GridBagSizer(vgap=3, hgap=10) - sizer.Add(wx.StaticText(parent=self.dirPanel, - label=_("Format:")), + sizer.Add(StaticText(parent=self.dirPanel, + label=_("Format:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) sizer.Add(self.dirWidgets['format'], @@ -1723,14 +1727,14 @@ flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, pos=(1, 0), span=(1, 4)) if self.dest: - sizer.Add(wx.StaticText(parent=self.dirPanel, - label=_("Creation options:")), + sizer.Add(StaticText(parent=self.dirPanel, + label=_("Creation options:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(2, 0)) sizer.Add(self.dirWidgets['options'], flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, pos=(2, 1)) - helpBtn = wx.Button(parent=self.dirPanel, id=wx.ID_HELP) + helpBtn = Button(parent=self.dirPanel, id=wx.ID_HELP) helpBtn.Bind(wx.EVT_BUTTON, self.OnHelp) sizer.Add(helpBtn, flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, @@ -1745,8 +1749,8 @@ # database sizer = wx.GridBagSizer(vgap=1, hgap=5) - sizer.Add(wx.StaticText(parent=self.dbPanel, - label=_("Format:")), + sizer.Add(StaticText(parent=self.dbPanel, + label=_("Format:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) sizer.Add(self.dbWidgets['format'], @@ -1774,8 +1778,8 @@ sizer.Add(self.dbWidgets['featType'], pos=(0, 2), flag=wx.EXPAND) - sizer.Add(wx.StaticText(parent=self.dbPanel, - label=_("Creation options:")), + sizer.Add(StaticText(parent=self.dbPanel, + label=_("Creation options:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(5, 0)) sizer.Add(self.dbWidgets['options'], @@ -1783,7 +1787,7 @@ pos=(5, 1), span=(1, 2)) # help button - helpBtn = wx.Button(parent=self.dbPanel, id=wx.ID_HELP) + helpBtn = Button(parent=self.dbPanel, id=wx.ID_HELP) helpBtn.Bind(wx.EVT_BUTTON, self.OnHelp) sizer.Add(helpBtn, pos=(5, 3)) @@ -1797,23 +1801,23 @@ # protocol sizer = wx.GridBagSizer(vgap=3, hgap=3) - sizer.Add(wx.StaticText(parent=self.protocolPanel, - label=_("Format:")), + sizer.Add(StaticText(parent=self.protocolPanel, + label=_("Format:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) sizer.Add(self.protocolWidgets['format'], flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 1)) - sizer.Add(wx.StaticText(parent=self.protocolPanel, - label=_("Protocol:")), + sizer.Add(StaticText(parent=self.protocolPanel, + label=_("Protocol:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(1, 0)) sizer.Add(self.protocolWidgets['text'], flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, pos=(1, 1)) if self.dest: - sizer.Add(wx.StaticText(parent=self.protocolPanel, - label=_("Creation options:")), + sizer.Add(StaticText(parent=self.protocolPanel, + label=_("Creation options:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(2, 0)) sizer.Add(self.protocolWidgets['options'], @@ -1827,8 +1831,8 @@ # native sizer = wx.BoxSizer(wx.VERTICAL) - sizer.Add(wx.StaticText(parent=self.nativePanel, - label=_("No settings available")), + sizer.Add(StaticText(parent=self.nativePanel, + label=_("No settings available")), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL | wx.EXPAND, border=5) self.nativePanel.SetSizer(sizer) @@ -2337,9 +2341,9 @@ def _layout(self): """Do layout""" sizer = wx.BoxSizer(wx.HORIZONTAL) - sizer.Add(wx.StaticText(parent=self, - id=wx.ID_ANY, - label=_("Feature type:")), + sizer.Add(StaticText(parent=self, + id=wx.ID_ANY, + label=_("Feature type:")), proportion=1, flag=wx.ALIGN_CENTER_VERTICAL, border=5) @@ -2364,7 +2368,7 @@ return 'boundary' -class CoordinatesSelect(wx.Panel): +class CoordinatesSelect(Panel): def __init__(self, parent, giface, multiple=False, **kwargs): """Widget to get coordinates from map window by mouse click @@ -2380,9 +2384,9 @@ super(CoordinatesSelect, self).__init__(parent=parent, id=wx.ID_ANY) - self.coordsField = wx.TextCtrl(parent=self, id=wx.ID_ANY, - size=globalvar.DIALOG_TEXTCTRL_SIZE, - validator=CoordinatesValidator()) + self.coordsField = TextCtrl(parent=self, id=wx.ID_ANY, + size=globalvar.DIALOG_TEXTCTRL_SIZE, + validator=CoordinatesValidator()) icon = wx.Bitmap( os.path.join( @@ -2452,7 +2456,7 @@ coords = self._getCoords() if coords is not None: - for i in range(len(coords) / 2): + for i in range(len(coords) // 2): i = i * 2 self.pointsToDraw.AddItem( coords=(coords[i], coords[i + 1])) @@ -2522,8 +2526,8 @@ self.mapdisp = self.giface.GetMapDisplay() - self.catsField = wx.TextCtrl(parent=self, id=wx.ID_ANY, - size=globalvar.DIALOG_TEXTCTRL_SIZE) + self.catsField = TextCtrl(parent=self, id=wx.ID_ANY, + size=globalvar.DIALOG_TEXTCTRL_SIZE) icon = wx.Bitmap( os.path.join( @@ -2713,8 +2717,8 @@ self.parent = parent self.vector_map = None - self.sqlField = wx.TextCtrl(parent=self, id=wx.ID_ANY, - size=globalvar.DIALOG_TEXTCTRL_SIZE) + self.sqlField = TextCtrl(parent=self, id=wx.ID_ANY, + size=globalvar.DIALOG_TEXTCTRL_SIZE) self.GetChildren()[0].SetName("SqlWhereSelect") icon = wx.Bitmap( os.path.join( diff -Nru grass-7.6.1/gui/wxpython/gui_core/mapdisp.py grass-7.8.0/gui/wxpython/gui_core/mapdisp.py --- grass-7.6.1/gui/wxpython/gui_core/mapdisp.py 2019-03-19 19:57:16.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/mapdisp.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,12 +21,12 @@ import os import sys +import six import wx from core import globalvar from core.debug import Debug -from core.utils import _ from gui_core.toolbars import ToolSwitcher from grass.script import core as grass @@ -333,7 +333,7 @@ def StatusbarEnableLongHelp(self, enable=True): """Enable/disable toolbars long help""" - for toolbar in self.toolbars.itervalues(): + for toolbar in six.itervalues(self.toolbars): toolbar.EnableLongHelp(enable) def IsStandalone(self): diff -Nru grass-7.6.1/gui/wxpython/gui_core/menu.py grass-7.8.0/gui/wxpython/gui_core/menu.py --- grass-7.6.1/gui/wxpython/gui_core/menu.py 2019-03-19 19:57:16.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/menu.py 2019-06-03 20:34:20.000000000 +0000 @@ -24,10 +24,9 @@ from core import globalvar from core import utils from core.gcmd import EncodeString -from core.utils import _ from gui_core.widgets import SearchModuleWidget from gui_core.treeview import CTreeView -from gui_core.wrap import Button +from gui_core.wrap import Button, StaticText from gui_core.wrap import Menu as MenuWidget from icons.icon import MetaIcon @@ -149,7 +148,7 @@ # tree self._tree = CTreeView(model=model, parent=self) - self._tree.SetToolTipString( + self._tree.SetToolTip( _("Double-click or Ctrl-Enter to run selected module")) # self._dataBox = wx.StaticBox(parent = self, id = wx.ID_ANY, @@ -163,7 +162,7 @@ lambda result: self._tree.Select(result)) self._search.showNotification.connect(self.showNotification) - self._helpText = wx.StaticText( + self._helpText = StaticText( parent=self, id=wx.ID_ANY, label="Press Enter for next match, Ctrl+Enter to run command") self._helpText.SetForegroundColour( diff -Nru grass-7.6.1/gui/wxpython/gui_core/preferences.py grass-7.8.0/gui/wxpython/gui_core/preferences.py --- grass-7.6.1/gui/wxpython/gui_core/preferences.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/preferences.py 2019-09-06 19:29:57.000000000 +0000 @@ -45,7 +45,7 @@ from core import globalvar from core.gcmd import RunCommand, GError -from core.utils import ListOfMapsets, GetColorTables, ReadEpsgCodes, _ +from core.utils import ListOfMapsets, GetColorTables, ReadEpsgCodes from core.settings import UserSettings from core.globalvar import wxPythonPhoenix from gui_core.dialogs import SymbolDialog, DefaultFontDialog @@ -277,7 +277,7 @@ # # Layer Manager settings # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -380,7 +380,7 @@ # # workspace # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -449,7 +449,7 @@ # # region # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -493,7 +493,7 @@ border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -513,12 +513,12 @@ border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=3) row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Font for command output:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Font for command output:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) - outfontButton = wx.Button(parent=panel, id=wx.ID_ANY, + outfontButton = Button(parent=panel, id=wx.ID_ANY, label=_("Set font")) gridSizer.Add(outfontButton, flag=wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, @@ -528,7 +528,7 @@ # # languages # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -545,7 +545,7 @@ row = 0 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Choose language (requires to save and GRASS restart):")), @@ -578,7 +578,7 @@ # # appearence # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -591,8 +591,8 @@ # element list # row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Element list:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Element list:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -619,7 +619,7 @@ # row += 1 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Menu style (requires to save and GUI restart):")), @@ -654,7 +654,7 @@ row += 1 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Height of map selection popup window (in pixels):")), @@ -694,7 +694,7 @@ # row += 1 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Icon theme (requires GUI restart):")), @@ -723,8 +723,8 @@ # command dialog style # row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Module dialog style:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Module dialog style:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -774,7 +774,7 @@ border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -788,7 +788,7 @@ # row = 0 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Default font for GRASS displays:")), @@ -796,7 +796,7 @@ pos=( row, 0)) - fontButton = wx.Button(parent=panel, id=wx.ID_ANY, + fontButton = Button(parent=panel, id=wx.ID_ANY, label=_("Set font")) gridSizer.Add(fontButton, flag=wx.ALIGN_RIGHT | @@ -814,7 +814,7 @@ # # display settings # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -827,8 +827,8 @@ # display driver # row = 0 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Display driver:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Display driver:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -853,8 +853,8 @@ # Statusbar mode # row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Statusbar mode:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Statusbar mode:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -881,8 +881,8 @@ # Background color # row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Background color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Background color:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -986,8 +986,8 @@ # mouse wheel zoom # row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Mouse wheel action:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Mouse wheel action:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -1010,7 +1010,7 @@ pos=(row, 1)) row += 1 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Mouse scrolling direction:")), @@ -1052,7 +1052,7 @@ # see initialization of nviz GLWindow if globalvar.CheckWxVersion(version=[2, 8, 11]) and \ sys.platform not in ('win32', 'darwin'): - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Advanced display settings")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) @@ -1060,7 +1060,7 @@ gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("3D view depth buffer (possible values are 16, 24, 32):")), @@ -1072,7 +1072,7 @@ group='display', key='nvizDepthBuffer', subkey='value') - textCtrl = wx.TextCtrl( + textCtrl = TextCtrl( parent=panel, id=wx.ID_ANY, value=str(value), @@ -1114,7 +1114,7 @@ notebook.AddPage(page=panel, text=_("Modules")) border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -1185,8 +1185,8 @@ row += 1 # verbosity - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Verbosity level:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Verbosity level:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) @@ -1228,7 +1228,7 @@ # # raster settings # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -1299,7 +1299,7 @@ # # vector settings # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -1308,8 +1308,8 @@ gridSizer = wx.FlexGridSizer(cols=7, hgap=10, vgap=3) - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Display:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Display:")), flag=wx.ALIGN_CENTER_VERTICAL) for type in ('point', 'line', 'centroid', 'boundary', @@ -1333,8 +1333,8 @@ gridSizer = wx.GridBagSizer(hgap=3, vgap=3) # feature color - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Feature color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Feature color:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) featureColor = csel.ColourSelect( parent=panel, @@ -1373,8 +1373,8 @@ # area fill color row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Area fill color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Area fill color:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, col)) fillColor = csel.ColourSelect( parent=panel, @@ -1405,8 +1405,8 @@ # line row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Line width:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Line width:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, col)) hlWidth = SpinCtrl( parent=panel, id=wx.ID_ANY, size=(50, -1), @@ -1437,8 +1437,8 @@ # symbol row = 0 col = 4 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Symbol size:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Symbol size:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, col)) ptSize = SpinCtrl( parent=panel, id=wx.ID_ANY, size=(50, -1), @@ -1449,13 +1449,13 @@ gridSizer.Add(ptSize, pos=(row, col + 2), flag=wx.ALIGN_RIGHT) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Symbol:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Symbol:")), flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, col)) symbolPath = self.settings.Get( group='vectorLayer', key='point', subkey='symbol') - symbolLabel = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=symbolPath, name='GetLabel') + symbolLabel = StaticText(parent=panel, id=wx.ID_ANY, + label=symbolPath, name='GetLabel') symbolLabel.SetMinSize((150, -1)) self.winId['vectorLayer:point:symbol'] = symbolLabel.GetId() gridSizer.Add( @@ -1469,7 +1469,7 @@ os.path.join( globalvar.SYMBDIR, symbolPath) + '.png') - bb = wx.BitmapButton( + bb = BitmapButton( parent=panel, id=wx.ID_ANY, bitmap=bitmap, @@ -1502,7 +1502,7 @@ # # highlighting # - highlightBox = wx.StaticBox( + highlightBox = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Highlight selected features")) highlightSizer = wx.StaticBoxSizer(highlightBox, wx.VERTICAL) @@ -1511,7 +1511,7 @@ flexSizer.AddGrowableCol(0) # color - label = wx.StaticText(parent=panel, id=wx.ID_ANY, label=_("Color:")) + label = StaticText(parent=panel, id=wx.ID_ANY, label=_("Color:")) hlColor = csel.ColourSelect( parent=panel, id=wx.ID_ANY, @@ -1530,7 +1530,7 @@ flag=wx.ALIGN_RIGHT | wx.FIXED_MINSIZE) # width - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Line width (in pixels):")) @@ -1572,13 +1572,13 @@ # # data browser related settings # - dataBrowserBox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Data browser")) + dataBrowserBox = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Data browser")) dataBrowserSizer = wx.StaticBoxSizer(dataBrowserBox, wx.VERTICAL) flexSizer = wx.FlexGridSizer(cols=2, hgap=5, vgap=5) flexSizer.AddGrowableCol(0) - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Left mouse double click:")) @@ -1605,9 +1605,9 @@ flag=wx.ALIGN_RIGHT | wx.FIXED_MINSIZE) # encoding - label = wx.StaticText(parent=panel, id=wx.ID_ANY, label=_( + label = StaticText(parent=panel, id=wx.ID_ANY, label=_( "Encoding (e.g. utf-8, ascii, iso8859-1, koi8-r):")) - encoding = wx.TextCtrl( + encoding = TextCtrl( parent=panel, id=wx.ID_ANY, value=self.settings.Get( group='atm', key='encoding', subkey='value'), name="GetValue", size=( 200, -1)) @@ -1644,17 +1644,17 @@ # # create table # - createTableBox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Create table")) + createTableBox = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Create table")) createTableSizer = wx.StaticBoxSizer(createTableBox, wx.VERTICAL) flexSizer = wx.FlexGridSizer(cols=2, hgap=5, vgap=5) flexSizer.AddGrowableCol(0) - label = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Key column:")) - keyColumn = wx.TextCtrl(parent=panel, id=wx.ID_ANY, - size=(250, -1)) + label = StaticText(parent=panel, id=wx.ID_ANY, + label=_("Key column:")) + keyColumn = TextCtrl(parent=panel, id=wx.ID_ANY, + size=(250, -1)) keyColumn.SetValue( self.settings.Get( group='atm', @@ -1693,7 +1693,7 @@ # # projections statusbar settings # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Projection statusbar settings")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) @@ -1702,7 +1702,7 @@ # note for users expecting on-the-fly data reprojection row = 0 - note0 = wx.StaticText( + note0 = StaticText( parent=panel, id=wx.ID_ANY, label=_( "\nNote: This only controls the coordinates " "displayed in the lower-left of the Map " @@ -1718,8 +1718,8 @@ # epsg row += 1 - label = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("EPSG code:")) + label = StaticText(parent=panel, id=wx.ID_ANY, + label=_("EPSG code:")) epsgCode = wx.ComboBox(parent=panel, id=wx.ID_ANY, name="GetValue", size=(150, -1)) @@ -1736,9 +1736,9 @@ # proj row += 1 - label = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Proj.4 string (required):")) - projString = wx.TextCtrl( + label = StaticText(parent=panel, id=wx.ID_ANY, + label=_("Proj.4 string (required):")) + projString = TextCtrl( parent=panel, id=wx.ID_ANY, value=self.settings.Get( group='projection', key='statusbar', subkey='proj4'), name="GetValue", size=( 400, -1)) @@ -1753,9 +1753,9 @@ # epsg file row += 1 - label = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("EPSG file:")) - projFile = wx.TextCtrl( + label = StaticText(parent=panel, id=wx.ID_ANY, + label=_("EPSG file:")) + projFile = TextCtrl( parent=panel, id=wx.ID_ANY, value=self.settings.Get( group='projection', key='statusbar', subkey='projFile'), name="GetValue", size=(400, -1)) @@ -1769,7 +1769,7 @@ # note + button row += 1 - note = wx.StaticText( + note = StaticText( parent=panel, id=wx.ID_ANY, label=_( "Load EPSG codes (be patient), enter EPSG code or " "insert Proj.4 string directly.")) @@ -1778,7 +1778,7 @@ pos=(row, 0)) row += 1 - epsgLoad = wx.Button(parent=panel, id=wx.ID_ANY, + epsgLoad = Button(parent=panel, id=wx.ID_ANY, label=_("&Load EPSG codes")) gridSizer.Add(epsgLoad, flag=wx.ALIGN_RIGHT, @@ -1795,7 +1795,7 @@ # # format # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -1827,8 +1827,8 @@ gridSizer.Add(ll, pos=(row, 0)) - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Precision:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Precision:")), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.LEFT, border=20, pos=(row, 1)) @@ -1901,7 +1901,7 @@ self.winId['projection:statusbar:epsg']) wx.BeginBusyCursor() try: - self.epsgCodeDict = ReadEpsgCodes(path) + self.epsgCodeDict = ReadEpsgCodes() except OpenError as e: wx.EndBusyCursor() epsgCombo.SetItems([]) @@ -2116,7 +2116,7 @@ # active sizer = wx.BoxSizer(wx.VERTICAL) - label = wx.StaticText( + label = StaticText( parent=self, id=wx.ID_ANY, label=_( "Check a mapset to make it accessible, uncheck it to hide it.\n" " Notes:\n" @@ -2147,11 +2147,11 @@ flag=wx.EXPAND | wx.ALIGN_CENTRE | wx.ALL, border=5) btnsizer = wx.StdDialogButtonSizer() - okbtn = wx.Button(self, wx.ID_OK) + okbtn = Button(self, wx.ID_OK) okbtn.SetDefault() btnsizer.AddButton(okbtn) - cancelbtn = wx.Button(self, wx.ID_CANCEL) + cancelbtn = Button(self, wx.ID_CANCEL) btnsizer.AddButton(cancelbtn) btnsizer.Realize() @@ -2205,10 +2205,7 @@ for mapset in self.parent.all_mapsets_ordered: # unclear why this is needed, # wrap.ListrCtrl should do the job but it doesn't in this case - if wxPythonPhoenix: - index = self.InsertItem(self.GetItemCount(), mapset) - else: - index = self.InsertStringItem(self.GetItemCount(), mapset) + index = self.InsertStringItem(self.GetItemCount(), mapset) mapsetPath = os.path.join(locationPath, mapset) stat_info = os.stat(mapsetPath) diff -Nru grass-7.6.1/gui/wxpython/gui_core/prompt.py grass-7.8.0/gui/wxpython/gui_core/prompt.py --- grass-7.6.1/gui/wxpython/gui_core/prompt.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/prompt.py 2019-06-03 20:34:20.000000000 +0000 @@ -33,7 +33,6 @@ from core import globalvar from core import utils from core.gcmd import EncodeString, DecodeString -from core.utils import _ class GPrompt(object): @@ -116,7 +115,7 @@ cmd = utils.split(str(cmdString)) except UnicodeError: cmd = utils.split(EncodeString((cmdString))) - cmd = map(DecodeString, cmd) + cmd = list(map(DecodeString, cmd)) self.promptRunCmd.emit(cmd=cmd) diff -Nru grass-7.6.1/gui/wxpython/gui_core/pyedit.py grass-7.8.0/gui/wxpython/gui_core/pyedit.py --- grass-7.6.1/gui/wxpython/gui_core/pyedit.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/pyedit.py 2019-08-06 18:48:31.000000000 +0000 @@ -13,7 +13,10 @@ import sys import os import stat -from StringIO import StringIO +try: + from StringIO import StringIO +except ImportError: + from io import StringIO import time import wx @@ -26,7 +29,6 @@ from grass.script.setup import set_gui_path set_gui_path() -from core.utils import _ from core.gcmd import EncodeString, GError from gui_core.pystc import PyStc from core import globalvar @@ -46,7 +48,7 @@ def script_template(): """The most simple script which runs and gives something""" - return r"""#!/usr/bin/env python + return r"""#!/usr/bin/env python3 import grass.script as gscript @@ -73,7 +75,7 @@ output = StringIO() # header output.write( - r"""#!/usr/bin/env python + r"""#!/usr/bin/env python3 # #%s # @@ -142,7 +144,7 @@ def script_example(): """Example of a simple script""" - return r"""#!/usr/bin/env python + return r"""#!/usr/bin/env python3 import grass.script as gscript @@ -163,7 +165,7 @@ def module_example(): """Example of a GRASS module""" - return r"""#!/usr/bin/env python + return r"""#!/usr/bin/env python3 #%module #% description: Adds the values of two rasters (A + B) @@ -206,7 +208,7 @@ def module_error_handling_example(): """Example of a GRASS module""" - return r"""#!/usr/bin/env python + return r"""#!/usr/bin/env python3 #%module #% description: Selects values from raster above value of mean plus standard deviation diff -Nru grass-7.6.1/gui/wxpython/gui_core/pystc.py grass-7.8.0/gui/wxpython/gui_core/pystc.py --- grass-7.6.1/gui/wxpython/gui_core/pystc.py 2019-03-19 19:57:12.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/pystc.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,7 +19,6 @@ import wx from wx import stc -from core.utils import _ class PyStc(stc.StyledTextCtrl): diff -Nru grass-7.6.1/gui/wxpython/gui_core/query.py grass-7.8.0/gui/wxpython/gui_core/query.py --- grass-7.6.1/gui/wxpython/gui_core/query.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/query.py 2019-06-03 20:34:20.000000000 +0000 @@ -15,10 +15,11 @@ """ import os import wx +import six -from core.utils import _ from core.gcmd import DecodeString from gui_core.treeview import TreeListView +from gui_core.wrap import Button, StaticText, Menu from core.treemodel import TreeModel, DictNode from grass.pydispatch.signal import Signal @@ -39,7 +40,7 @@ self.panel = wx.Panel(self, id=wx.ID_ANY) self.mainSizer = wx.BoxSizer(wx.VERTICAL) - helpText = wx.StaticText(self.panel, wx.ID_ANY, label=_( + helpText = StaticText(self.panel, wx.ID_ANY, label=_( "Right click to copy selected values to clipboard.")) helpText.SetForegroundColour( wx.SystemSettings.GetColour( @@ -63,9 +64,9 @@ flag=wx.EXPAND | wx.ALL, border=5) - close = wx.Button(self.panel, id=wx.ID_CLOSE) + close = Button(self.panel, id=wx.ID_CLOSE) close.Bind(wx.EVT_BUTTON, lambda event: self.Close()) - copy = wx.Button( + copy = Button( self.panel, id=wx.ID_ANY, label=_("Copy all to clipboard")) @@ -121,7 +122,7 @@ if not nodes: return - menu = wx.Menu() + menu = Menu() texts = [] if len(nodes) > 1: values = [] @@ -209,7 +210,6 @@ def QueryTreeBuilder(data, column): """Builds tree model from query results. - Convert to unicode. :param data: query results as a dictionary :param column: column name @@ -217,17 +217,13 @@ :return: tree model """ def addNode(parent, data, model): - for k, v in data.iteritems(): - if isinstance(v, str): - k = DecodeString(k) + for k, v in six.iteritems(data): if isinstance(v, dict): node = model.AppendNode(parent=parent, label=k) addNode(parent=node, data=v, model=model) else: - if not isinstance(v, basestring): + if not isinstance(v, six.string_types): v = str(v) - elif isinstance(v, str): - v = DecodeString(v) node = model.AppendNode(parent=parent, label=k, data={column: v}) diff -Nru grass-7.6.1/gui/wxpython/gui_core/simplelmgr.py grass-7.8.0/gui/wxpython/gui_core/simplelmgr.py --- grass-7.6.1/gui/wxpython/gui_core/simplelmgr.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/simplelmgr.py 2019-06-03 20:34:20.000000000 +0000 @@ -31,10 +31,10 @@ from icons.icon import MetaIcon from gui_core.forms import GUI from gui_core.dialogs import SetOpacityDialog +from gui_core.wrap import CheckListBox, Menu from core.utils import GetLayerNameFromCmd from core.gcmd import GError from core.layerlist import LayerList -from core.utils import _ SIMPLE_LMGR_RASTER = 1 SIMPLE_LMGR_VECTOR = 2 @@ -59,7 +59,7 @@ self._style = lmgrStyle self._layerList = layerList - self._checkList = wx.CheckListBox(self, style=wx.LB_EXTENDED) + self._checkList = CheckListBox(self, style=wx.LB_EXTENDED) if not toolbarCls: toolbarCls = SimpleLmgrToolbar self._toolbar = toolbarCls(self, lmgrStyle=self._style) @@ -130,6 +130,10 @@ for i, layer in enumerate(self._layerList): layer.Select(i in selected) + def UnInit(self): + """Needs to be called before destroying this window""" + self._auimgr.UnInit() + def OnContextMenu(self, event): """Show context menu. @@ -139,7 +143,7 @@ event.Skip() return - menu = wx.Menu() + menu = Menu() llist = [layer.name for layer in self._layerList] texts = [','.join(llist), ','.join(reversed(llist))] labels = [_("Copy map names to clipboard (top to bottom)"), diff -Nru grass-7.6.1/gui/wxpython/gui_core/toolbars.py grass-7.8.0/gui/wxpython/gui_core/toolbars.py --- grass-7.6.1/gui/wxpython/gui_core/toolbars.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -23,11 +23,10 @@ from core import globalvar from core.debug import Debug -from core.utils import _ from icons.icon import MetaIcon from collections import defaultdict from core.globalvar import IMGDIR -from gui_core.wrap import ToolBar, Menu +from gui_core.wrap import ToolBar, Menu, BitmapButton from grass.pydispatch.signal import Signal @@ -268,9 +267,9 @@ else: bitmap = wx.ArtProvider.GetBitmap( id=wx.ART_MISSING_IMAGE, client=wx.ART_TOOLBAR) - button = wx.BitmapButton(parent=self, id=wx.ID_ANY, size=( + button = BitmapButton(parent=self, id=wx.ID_ANY, size=( (-1, self.GetToolSize()[1])), bitmap=bitmap, style=wx.NO_BORDER) - button.SetToolTipString(tooltip) + button.SetToolTip(tooltip) return button diff -Nru grass-7.6.1/gui/wxpython/gui_core/treeview.py grass-7.8.0/gui/wxpython/gui_core/treeview.py --- grass-7.6.1/gui/wxpython/gui_core/treeview.py 2019-03-19 19:57:32.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/treeview.py 2019-06-03 20:34:20.000000000 +0000 @@ -39,7 +39,7 @@ set_gui_path() from core.treemodel import TreeModel, DictNode -from core.utils import _ +from gui_core.wrap import CustomTreeCtrl from grass.pydispatch.signal import Signal @@ -183,7 +183,7 @@ self.RefreshItems() -class CTreeView(AbstractTreeViewMixin, CT.CustomTreeCtrl): +class CTreeView(AbstractTreeViewMixin, CustomTreeCtrl): """Tree view class inheriting from wx.TreeCtrl""" def __init__(self, model, parent, **kw): diff -Nru grass-7.6.1/gui/wxpython/gui_core/vselect.py grass-7.8.0/gui/wxpython/gui_core/vselect.py --- grass-7.6.1/gui/wxpython/gui_core/vselect.py 2019-03-19 19:57:32.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/vselect.py 2019-09-06 19:29:57.000000000 +0000 @@ -25,20 +25,20 @@ import wx import wx.lib.mixins.listctrl as listmix -from core.utils import _ from core.gcmd import GMessage, GError, GWarning from core.gcmd import RunCommand +from gui_core.wrap import Button, ListCtrl import grass.script as grass from grass.pydispatch.signal import Signal -class VectorSelectList(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin): +class VectorSelectList(ListCtrl, listmix.ListCtrlAutoWidthMixin): """Widget for managing vector features selected from map display """ def __init__(self, parent): - wx.ListCtrl.__init__( + ListCtrl.__init__( self, parent=parent, id=wx.ID_ANY, @@ -132,7 +132,7 @@ self._dialog = VectorSelectDialog(parent=self.parent) self._dialog.Bind(wx.EVT_CLOSE, self.OnCloseDialog) if createButton: - createMap = wx.Button( + createMap = Button( self._dialog, wx.ID_ANY, _("Create a new map")) createMap.Bind(wx.EVT_BUTTON, self.OnExportMap) self._dialog.AddWidget(createMap, proportion=0.1) @@ -244,7 +244,9 @@ self.updateLayer.emit() if len(self.selectedFeatures) > 0: self.painter.SetLayer(self.selectedFeatures[0]['Layer']) - self.painter.SetMap(self.selectedFeatures[0]['Map']) + self.painter.SetMap( + self.selectedFeatures[0]['Map'] + '@' + self.selectedFeatures[0]['Mapset'] + ) tmp = list() for i in self.selectedFeatures: tmp.append(i['Category']) diff -Nru grass-7.6.1/gui/wxpython/gui_core/widgets.py grass-7.8.0/gui/wxpython/gui_core/widgets.py --- grass-7.6.1/gui/wxpython/gui_core/widgets.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/widgets.py 2019-09-06 19:29:57.000000000 +0000 @@ -48,6 +48,7 @@ import sys import string import re +import six from bisect import bisect from datetime import datetime from core.globalvar import wxPythonPhoenix @@ -86,7 +87,6 @@ from grass.pydispatch.signal import Signal from core import globalvar -from core.utils import _ from core.gcmd import GMessage, GError from core.debug import Debug from gui_core.wrap import Button, SearchCtrl, StaticText, StaticBox, \ @@ -390,14 +390,14 @@ pass -class NumTextCtrl(wx.TextCtrl): +class NumTextCtrl(TextCtrl): """Class derived from wx.TextCtrl for numerical values only""" def __init__(self, parent, **kwargs): ## self.precision = kwargs.pop('prec') - wx.TextCtrl.__init__(self, parent=parent, - validator=NTCValidator(flag='DIGIT_ONLY'), - **kwargs) + TextCtrl.__init__(self, parent=parent, + validator=NTCValidator(flag='DIGIT_ONLY'), + **kwargs) def SetValue(self, value): super(NumTextCtrl, self).SetValue(str(value)) @@ -478,7 +478,7 @@ :param label: displayed label """ size = (15, 15) - buffer = wx.EmptyBitmap(*size) + buffer = EmptyBitmap(*size) BitmapTextButton.__init__(self, parent=parent, label=" " + label, bitmap=buffer, **kwargs) @@ -965,7 +965,7 @@ self.Bind(wx.EVT_MENU, self.OnSelectNone, id=self.popupDataID2) # generate popup-menu - menu = wx.Menu() + menu = Menu() menu.Append(self.popupDataID1, _("Select all")) menu.Append(self.popupDataID2, _("Deselect all")) @@ -1034,10 +1034,7 @@ idx = 0 for item in data: - if wxPythonPhoenix: - index = self.InsertItem(idx, str(item[0])) - else: - index = self.InsertStringItem(idx, str(item[0])) + index = self.InsertStringItem(idx, str(item[0])) for i in range(1, self.GetColumnCount()): self.SetStringItem(index, i, item[i]) idx += 1 @@ -1076,7 +1073,7 @@ # label = " %s " % _("Find module - (press Enter for next match)")) if sys.platform == 'win32': - self._search = wx.TextCtrl( + self._search = TextCtrl( parent=self, id=wx.ID_ANY, size=(-1, 25), style=wx.TE_PROCESS_ENTER) else: @@ -1230,8 +1227,8 @@ wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY) - self.settingsBox = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Profiles")) + self.settingsBox = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Profiles")) self.settingsChoice = wx.Choice(parent=self, id=wx.ID_ANY) self.settingsChoice.Bind(wx.EVT_CHOICE, self.OnSettingsChanged) @@ -1261,7 +1258,7 @@ self.settingsSizer = wx.StaticBoxSizer(self.settingsBox, wx.HORIZONTAL) self.settingsSizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_("Load:")), @@ -1380,7 +1377,7 @@ try: fd = open(self.settingsFile, 'w') fd.write('format_version=2.0\n') - for key, values in self._settings.iteritems(): + for key, values in six.iteritems(self._settings): first = True for v in values: # escaping characters @@ -1546,7 +1543,7 @@ # painting the control, but there is no valid item selected yet return - r = wx.Rect(*rect) # make a copy + r = Rect(*rect) # make a copy r.Deflate(3, 5) # for painting the items in the popup diff -Nru grass-7.6.1/gui/wxpython/gui_core/wrap.py grass-7.8.0/gui/wxpython/gui_core/wrap.py --- grass-7.6.1/gui/wxpython/gui_core/wrap.py 2019-03-19 19:57:32.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/wrap.py 2019-08-11 07:34:26.000000000 +0000 @@ -17,6 +17,7 @@ import wx import wx.lib.buttons as buttons +import wx.lib.colourselect as csel try: import wx.lib.agw.customtreectrl as CT except ImportError: @@ -74,6 +75,19 @@ wx.Window.SetToolTipString(self, tip) +class Panel(wx.Panel): + """Wrapper around wx.Panel to have more control + over the widget on different platforms/wxpython versions""" + def __init__(self, *args, **kwargs): + wx.Panel.__init__(self, *args, **kwargs) + + def SetToolTip(self, tip): + if wxPythonPhoenix: + wx.Panel.SetToolTip(self, tipString=tip) + else: + wx.Panel.SetToolTipString(self, tip) + + class SpinCtrl(wx.SpinCtrl): """Wrapper around wx.SpinCtrl to have more control over the widget on different platforms""" @@ -413,3 +427,29 @@ wx.Choice.SetToolTip(self, tipString=tip) else: wx.Choice.SetToolTipString(self, tip) + + +class TextEntryDialog(wx.TextEntryDialog): + """Wrapper around wx.TextEntryDialog to have more control + over the widget on different platforms/wxpython versions""" + def __init__(self, parent, message, caption="Please enter text", value="", + style=wx.OK | wx.CANCEL | wx.CENTRE, pos=wx.DefaultPosition): + if wxPythonPhoenix: + super(TextEntryDialog, self).__init__(parent=parent, message=message, caption=caption, + value=value, style=style, pos=pos) + else: + super(TextEntryDialog, self).__init__(parent=parent, message=message, caption=caption, + defaultValue=value, style=style, pos=pos) + + +class ColourSelect(csel.ColourSelect): + """Wrapper around wx.lib.colourselect.ColourSelect to have more control + over the widget on different platforms/wxpython versions""" + def __init__(self, *args, **kwargs): + csel.ColourSelect.__init__(self, *args, **kwargs) + + def SetToolTip(self, tip): + if wxPythonPhoenix: + csel.ColourSelect.SetToolTip(self, tipString=tip) + else: + csel.ColourSelect.SetToolTipString(self, tip) diff -Nru grass-7.6.1/gui/wxpython/gui_core/wxlibplot.py grass-7.8.0/gui/wxpython/gui_core/wxlibplot.py --- grass-7.6.1/gui/wxpython/gui_core/wxlibplot.py 2019-03-19 19:57:32.000000000 +0000 +++ grass-7.8.0/gui/wxpython/gui_core/wxlibplot.py 2019-08-31 21:37:30.000000000 +0000 @@ -120,6 +120,8 @@ # Needs NumPy import numpy as np +from gui_core.wrap import Menu, EmptyBitmap + from core.globalvar import CheckWxVersion if CheckWxVersion([3, 0, 0]): from wx import PENSTYLE_SOLID @@ -1207,7 +1209,7 @@ else: # on Linux, we need to correct the font size by a certain factor if wx.GCDC is used, # to make text the same size as if wx.GCDC weren't used - screenppi = map(float, wx.ScreenDC().GetPPI()) + screenppi = list(map(float, wx.ScreenDC().GetPPI())) ppi = dc.GetPPI() self._fontScale = (screenppi[ 0] / ppi[0] * self._pointSize[0] + screenppi[1] / ppi[1] * self._pointSize[1]) / 2.0 @@ -1538,7 +1540,7 @@ # Make new offscreen bitmap: this bitmap will always have the # current drawing in it, so it can be used to save the image to # a file, or whatever. - self._Buffer = wx.EmptyBitmap(Size.width, Size.height) + self._Buffer = EmptyBitmap(Size.width, Size.height) self._setSize() if not self._isWindowCreated: @@ -1606,7 +1608,7 @@ width = self._Buffer.GetWidth() height = self._Buffer.GetHeight() if sys.platform != "darwin": - tmp_Buffer = wx.EmptyBitmap(width, height) + tmp_Buffer = EmptyBitmap(width, height) dcs = wx.MemoryDC() dcs.SelectObject(tmp_Buffer) dcs.Clear() @@ -2234,7 +2236,7 @@ # Now Create the menu bar and items self.mainmenu = wx.MenuBar() - menu = wx.Menu() + menu = Menu() menu.Append(200, 'Page Setup...', 'Setup the printer page') self.Bind(wx.EVT_MENU, self.OnFilePageSetup, id=200) @@ -2251,7 +2253,7 @@ self.Bind(wx.EVT_MENU, self.OnFileExit, id=205) self.mainmenu.Append(menu, '&File') - menu = wx.Menu() + menu = Menu() menu.Append(206, 'Draw1', 'Draw plots1') self.Bind(wx.EVT_MENU, self.OnPlotDraw1, id=206) menu.Append(207, 'Draw2', 'Draw plots2') @@ -2324,7 +2326,7 @@ self.mainmenu.Append(menu, '&Plot') - menu = wx.Menu() + menu = Menu() menu.Append(300, '&About', 'About this thing...') self.Bind(wx.EVT_MENU, self.OnHelpAbout, id=300) self.mainmenu.Append(menu, '&Help') diff -Nru grass-7.6.1/gui/wxpython/iclass/dialogs.py grass-7.8.0/gui/wxpython/iclass/dialogs.py --- grass-7.6.1/gui/wxpython/iclass/dialogs.py 2019-03-19 19:57:32.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iclass/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -26,13 +26,14 @@ import wx.lib.scrolledpanel as scrolled from core import globalvar -from core.utils import _ from core.settings import UserSettings from core.gcmd import GError, RunCommand, GMessage from gui_core.dialogs import SimpleDialog, GroupDialog from gui_core import gselect from gui_core.widgets import SimpleValidator from iclass.statistics import Statistics, BandStatistics +from gui_core.wrap import CheckBox, Button, StaticText, \ + StaticBox, TextCtrl, Menu import grass.script as grass @@ -74,7 +75,7 @@ if subgroup: self.subGroupSelect.SetValue(subgroup) - self.editGroup = wx.Button(parent=self.panel, id=wx.ID_ANY, + self.editGroup = Button(parent=self.panel, id=wx.ID_ANY, label=_("Create/edit group...")) self.editGroup.Bind(wx.EVT_BUTTON, self.OnEditGroup) @@ -88,8 +89,8 @@ def _layout(self): """Do layout""" - self.dataSizer.Add(wx.StaticText(self.panel, id=wx.ID_ANY, - label=_("Name of imagery group:")), + self.dataSizer.Add(StaticText(self.panel, id=wx.ID_ANY, + label=_("Name of imagery group:")), proportion=0, flag=wx.EXPAND | wx.BOTTOM | wx.LEFT | wx.RIGHT, border=5) @@ -101,7 +102,7 @@ # flag = wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, border = 5) self.dataSizer.Add( - wx.StaticText( + StaticText( self.panel, id=wx.ID_ANY, label=_("Name of imagery subgroup:")), @@ -257,8 +258,8 @@ label = _("Name of raster map:") elif self.elementType == 'vector': label = _("Name of vector map:") - self.dataSizer.Add(wx.StaticText(self.panel, id=wx.ID_ANY, - label=label), + self.dataSizer.Add(StaticText(self.panel, id=wx.ID_ANY, + label=label), proportion=0, flag=wx.EXPAND | wx.ALL, border=5) self.dataSizer.Add(self.element, proportion=0, flag=wx.EXPAND | wx.ALL, border=5) @@ -291,14 +292,14 @@ panel = wx.Panel(parent=self, id=wx.ID_ANY) mainSizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(panel, id=wx.ID_ANY, - label=" %s " % _("Classes")) + box = StaticBox(panel, id=wx.ID_ANY, + label=" %s " % _("Classes")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=5, vgap=5) self.catList = CategoryListCtrl(panel, mapwindow=parent, stats_data=parent.stats_data) - addButton = wx.Button(panel, id=wx.ID_ADD) - deleteButton = wx.Button(panel, id=wx.ID_DELETE) + addButton = Button(panel, id=wx.ID_ADD) + deleteButton = Button(panel, id=wx.ID_DELETE) gridSizer.Add( self.catList, pos=( @@ -321,7 +322,7 @@ border=5) btnSizer = wx.BoxSizer(wx.HORIZONTAL) - closeButton = wx.Button(panel, id=wx.ID_CLOSE) + closeButton = Button(panel, id=wx.ID_CLOSE) btnSizer.Add(wx.Size(-1, -1), proportion=1, flag=wx.EXPAND) btnSizer.Add(closeButton, proportion=0, flag=wx.ALIGN_RIGHT) mainSizer.Add( @@ -539,7 +540,7 @@ id=self.popupZoomtoAreas) # generate popup-menu - menu = wx.Menu() + menu = Menu() menu.Append( self.popupZoomtoAreas, _("Zoom to training areas of selected class")) @@ -631,8 +632,8 @@ 'sig') self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.btnCancel = wx.Button(parent=self.panel, id=wx.ID_CANCEL) - self.btnOK = wx.Button(parent=self.panel, id=wx.ID_OK) + self.btnCancel = Button(parent=self.panel, id=wx.ID_CANCEL) + self.btnOK = Button(parent=self.panel, id=wx.ID_OK) self.btnOK.SetDefault() self.btnOK.Enable(False) @@ -662,28 +663,28 @@ dataSizer = wx.BoxSizer(wx.VERTICAL) dataSizer.Add( - wx.StaticText( + StaticText( parent=self.panel, id=wx.ID_ANY, label=_("Enter name of signature file:")), proportion=0, flag=wx.ALL, border=3) - self.fileNameCtrl = wx.TextCtrl( + self.fileNameCtrl = TextCtrl( parent=self.panel, id=wx.ID_ANY, size=(400, -1)) if self.fileName: self.fileNameCtrl.SetValue(self.fileName) dataSizer.Add(self.fileNameCtrl, proportion=0, flag=wx.ALL | wx.EXPAND, border=3) - dataSizer.Add(wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Signature file path:")), + dataSizer.Add(StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Signature file path:")), proportion=0, flag=wx.ALL, border=3) self.pathPanel = scrolled.ScrolledPanel(self.panel, size=(-1, 40)) pathSizer = wx.BoxSizer() - self.filePathText = wx.StaticText(parent=self.pathPanel, id=wx.ID_ANY, - label=self.baseFilePath) + self.filePathText = StaticText(parent=self.pathPanel, id=wx.ID_ANY, + label=self.baseFilePath) pathSizer.Add( self.filePathText, proportion=1, @@ -741,8 +742,8 @@ self.vectorName = vectorName self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.btnCancel = wx.Button(parent=self.panel, id=wx.ID_CANCEL) - self.btnOK = wx.Button(parent=self.panel, id=wx.ID_OK) + self.btnCancel = Button(parent=self.panel, id=wx.ID_CANCEL) + self.btnOK = Button(parent=self.panel, id=wx.ID_OK) self.btnOK.SetDefault() self.btnOK.Enable(False) self.btnOK.Bind(wx.EVT_BUTTON, self.OnOK) @@ -771,7 +772,7 @@ dataSizer = wx.BoxSizer(wx.VERTICAL) dataSizer.Add( - wx.StaticText( + StaticText( parent=self.panel, id=wx.ID_ANY, label=_("Enter name of new vector map:")), @@ -786,10 +787,10 @@ self.vectorNameCtrl.SetValue(self.vectorName) dataSizer.Add(self.vectorNameCtrl, proportion=0, flag=wx.ALL | wx.EXPAND, border=3) - self.withTableCtrl = wx.CheckBox(parent=self.panel, id=wx.ID_ANY, + self.withTableCtrl = CheckBox(parent=self.panel, id=wx.ID_ANY, label=_("Export attribute table")) self.withTableCtrl.SetValue(True) - self.withTableCtrl.SetToolTipString( + self.withTableCtrl.SetToolTip( _("Export attribute table containing" " computed statistical data")) dataSizer.Add(self.withTableCtrl, diff -Nru grass-7.6.1/gui/wxpython/iclass/digit.py grass-7.8.0/gui/wxpython/iclass/digit.py --- grass-7.6.1/gui/wxpython/iclass/digit.py 2019-03-19 19:57:44.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iclass/digit.py 2019-06-03 20:34:20.000000000 +0000 @@ -22,7 +22,6 @@ from vdigit.wxdigit import IVDigit from vdigit.wxdisplay import DisplayDriver, TYPE_AREA from core.gcmd import GWarning -from core.utils import _ try: from grass.lib.gis import G_verbose, G_set_verbose from grass.lib.vector import * diff -Nru grass-7.6.1/gui/wxpython/iclass/frame.py grass-7.8.0/gui/wxpython/iclass/frame.py --- grass-7.6.1/gui/wxpython/iclass/frame.py 2019-03-19 19:57:44.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iclass/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,10 +19,10 @@ import os import sys +import six import copy import tempfile import types -from core.utils import _ from core import globalvar import wx @@ -47,6 +47,7 @@ from core.render import Map, MapLayer from core.gcmd import RunCommand, GMessage, GError, GWarning from gui_core.dialogs import SetOpacityDialog +from gui_core.wrap import Menu from mapwin.base import MapWindowProperties from dbmgr.vinfo import VectorDBInfo import grass.script as grass @@ -223,7 +224,7 @@ self.GetFirstWindow().GetDigit().CloseMap() self.plotPanel.CloseWindow() self._cleanup() - + self._mgr.UnInit() self.Destroy() def _cleanup(self): @@ -477,7 +478,7 @@ def OnZoomMenu(self, event): """Popup Zoom menu """ - zoommenu = wx.Menu() + zoommenu = Menu() # Add items to the menu i = 0 @@ -1462,7 +1463,7 @@ def GetAlias(self, name): """Returns alias for layer""" - name = [k for k, v in self.layerName.iteritems() if v == name] + name = [k for k, v in six.iteritems(self.layerName) if v == name] if name: return name[0] return None diff -Nru grass-7.6.1/gui/wxpython/iclass/g.gui.iclass.html grass-7.8.0/gui/wxpython/iclass/g.gui.iclass.html --- grass-7.6.1/gui/wxpython/iclass/g.gui.iclass.html 2019-03-19 19:57:44.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iclass/g.gui.iclass.html 2019-05-18 15:50:04.000000000 +0000 @@ -95,4 +95,4 @@ Czech Technical University in Prague, Czech Republic

-$Date: 2018-10-14 21:39:26 +0200 (Sun, 14 Oct 2018) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/iclass/g.gui.iclass.py grass-7.8.0/gui/wxpython/iclass/g.gui.iclass.py --- grass-7.6.1/gui/wxpython/iclass/g.gui.iclass.py 2019-03-19 19:57:32.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iclass/g.gui.iclass.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: g.gui.iclass @@ -65,7 +65,6 @@ from core.settings import UserSettings from core.globalvar import CheckWxVersion from core.giface import StandaloneGrassInterface - from core.utils import _ from iclass.frame import IClassMapFrame group_name = subgroup_name = map_name = trainingmap_name = None diff -Nru grass-7.6.1/gui/wxpython/iclass/plots.py grass-7.8.0/gui/wxpython/iclass/plots.py --- grass-7.6.1/gui/wxpython/iclass/plots.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iclass/plots.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,7 +19,6 @@ import gui_core.wxlibplot as plot import wx.lib.scrolledpanel as scrolled -from core.utils import _ from core.gcmd import GError diff -Nru grass-7.6.1/gui/wxpython/iclass/statistics.py grass-7.8.0/gui/wxpython/iclass/statistics.py --- grass-7.6.1/gui/wxpython/iclass/statistics.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iclass/statistics.py 2019-06-03 20:34:20.000000000 +0000 @@ -18,10 +18,10 @@ """ import os +import six from ctypes import * import grass.script as grass -from core.utils import _ try: from grass.lib.imagery import * @@ -176,7 +176,7 @@ def SetStatistics(self, stats): - for st, val in stats.iteritems(): + for st, val in six.iteritems(stats): setattr(self, st, val) self.statisticsSet.emit(stats=stats) diff -Nru grass-7.6.1/gui/wxpython/iclass/toolbars.py grass-7.8.0/gui/wxpython/iclass/toolbars.py --- grass-7.6.1/gui/wxpython/iclass/toolbars.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iclass/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -22,11 +22,11 @@ import wx -from core.utils import _ from gui_core.toolbars import BaseToolbar, BaseIcons from icons.icon import MetaIcon from iclass.dialogs import IClassMapDialog, ContrastColor from gui_core.forms import GUI +from gui_core.wrap import StaticText import grass.script as grass @@ -154,7 +154,7 @@ self.choice.Bind(wx.EVT_CHOICE, self.OnSelectCategory) # stupid workaround to insert small space between controls - self.InsertControl(4, wx.StaticText(self, id=wx.ID_ANY, label=' ')) + self.InsertControl(4, StaticText(self, id=wx.ID_ANY, label=' ')) self.combo = wx.ComboBox(self, id=wx.ID_ANY, size=(130, -1), style=wx.TE_PROCESS_ENTER) diff -Nru grass-7.6.1/gui/wxpython/icons/icon.py grass-7.8.0/gui/wxpython/icons/icon.py --- grass-7.6.1/gui/wxpython/icons/icon.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/icons/icon.py 2019-06-03 20:34:20.000000000 +0000 @@ -18,16 +18,17 @@ import os import sys import copy +import six import wx from core.settings import UserSettings -from core.utils import _ # default icon set -import grass_icons -iconSetDefault = grass_icons.iconSet -iconPathDefault = grass_icons.iconPath +from .grass_icons import iconSet as g_iconSet +from .grass_icons import iconPath as g_iconPath +iconSetDefault = g_iconSet +iconPathDefault = g_iconPath iconTheme = UserSettings.Get( group='appearance', @@ -46,7 +47,7 @@ if iconPath and not os.path.exists(iconPath): raise OSError - for key, img in iconSet.iteritems(): + for key, img in six.iteritems(iconSet): if key not in iconSet or \ iconSet[key] is None: # add key iconSet[key] = img diff -Nru grass-7.6.1/gui/wxpython/image2target/g.gui.image2target.html grass-7.8.0/gui/wxpython/image2target/g.gui.image2target.html --- grass-7.6.1/gui/wxpython/image2target/g.gui.image2target.html 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/image2target/g.gui.image2target.html 2019-05-18 15:50:04.000000000 +0000 @@ -315,4 +315,4 @@ Martin Landa, Czech Technical University in Prague, Czech Republic

-$Date: 2017-11-03 18:21:39 +0100 (Fri, 03 Nov 2017) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/image2target/g.gui.image2target.py grass-7.8.0/gui/wxpython/image2target/g.gui.image2target.py --- grass-7.6.1/gui/wxpython/image2target/g.gui.image2target.py 2019-03-19 19:57:38.000000000 +0000 +++ grass-7.8.0/gui/wxpython/image2target/g.gui.image2target.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/gui/wxpython/image2target/ii2t_gis_set.py grass-7.8.0/gui/wxpython/image2target/ii2t_gis_set.py --- grass-7.6.1/gui/wxpython/image2target/ii2t_gis_set.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/image2target/ii2t_gis_set.py 2019-08-12 16:50:46.000000000 +0000 @@ -29,7 +29,6 @@ import getpass from core import globalvar -from core.utils import _ import wx import wx.lib.mixins.listctrl as listmix @@ -40,8 +39,8 @@ from location_wizard.dialogs import RegionDef from gui_core.dialogs import TextEntryDialog from gui_core.widgets import GenericValidator, StaticWrapText -from gui_core.wrap import Button -from gui_core.wrap import ListCtrl +from gui_core.wrap import Button, ListCtrl, StaticText, \ + StaticBox, TextCtrl sys.stderr = codecs.getwriter('utf8')(sys.stderr) @@ -109,7 +108,7 @@ versionFile.close() try: grassVersion, grassRevision = versionLine.split(' ', 1) - if grassVersion.endswith('svn'): + if grassVersion.endswith('dev'): grassRevisionStr = ' (%s)' % grassRevision else: grassRevisionStr = '' @@ -117,17 +116,17 @@ grassVersion = versionLine grassRevisionStr = '' - self.gisdbase_box = wx.StaticBox( + self.gisdbase_box = StaticBox( parent=self.panel, id=wx.ID_ANY, label=" %s " % _("1. Select GRASS GIS database directory")) - self.location_box = wx.StaticBox( + self.location_box = StaticBox( parent=self.panel, id=wx.ID_ANY, label=" %s " % _("2. Select GRASS Location")) - self.mapset_box = wx.StaticBox( + self.mapset_box = StaticBox( parent=self.panel, id=wx.ID_ANY, label=" %s " % _("3. Select GRASS Mapset")) - self.lmessage = wx.StaticText(parent=self.panel) + self.lmessage = StaticText(parent=self.panel) # It is not clear if all wx versions supports color, so try-except. # The color itself may not be correct for all platforms/system settings # but in http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.SystemSettings.html @@ -141,7 +140,7 @@ self.location_panel = wx.Panel(parent=self.panel) self.mapset_panel = wx.Panel(parent=self.panel) - self.ldbase = wx.StaticText( + self.ldbase = StaticText( parent=self.gisdbase_panel, id=wx.ID_ANY, label=_("GRASS GIS database directory contains Locations.")) @@ -207,7 +206,7 @@ self.delete_mapset_button.SetToolTip(_("Delete selected mapset")) # textinputs - self.tgisdbase = wx.TextCtrl( + self.tgisdbase = TextCtrl( parent=self.gisdbase_panel, id=wx.ID_ANY, value="", size=( 300, -1), style=wx.TE_PROCESS_ENTER) diff -Nru grass-7.6.1/gui/wxpython/image2target/ii2t_manager.py grass-7.8.0/gui/wxpython/image2target/ii2t_manager.py --- grass-7.6.1/gui/wxpython/image2target/ii2t_manager.py 2019-03-19 19:57:38.000000000 +0000 +++ grass-7.8.0/gui/wxpython/image2target/ii2t_manager.py 2019-08-31 21:37:30.000000000 +0000 @@ -35,6 +35,7 @@ import os import sys +import six import shutil import time from copy import copy @@ -54,14 +55,14 @@ from core import utils from core.render import Map -from core.utils import _ from gui_core.gselect import Select, LocationSelect, MapsetSelect from gui_core.dialogs import GroupDialog from core.gcmd import RunCommand, GMessage, GError, GWarning, EncodeString from core.settings import UserSettings from gcp.mapdisplay import MapFrame from core.giface import Notification -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \ + CheckListBox, TextCtrl, Menu from location_wizard.wizard import TitledPage as TitledPage @@ -400,7 +401,7 @@ # location self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select source location:')), @@ -421,7 +422,7 @@ # mapset self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select source mapset:')), @@ -534,7 +535,7 @@ # # group self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select group:')), @@ -551,7 +552,7 @@ # create group self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Create group if none exists')), @@ -561,11 +562,11 @@ 2, 1)) btnSizer = wx.BoxSizer(wx.HORIZONTAL) - self.btn_mkgroup = wx.Button( + self.btn_mkgroup = Button( parent=self, id=wx.ID_ANY, label=_("Create/edit group...")) - self.btn_vgroup = wx.Button( + self.btn_vgroup = Button( parent=self, id=wx.ID_ANY, label=_("Add vector map to group...")) @@ -585,7 +586,7 @@ # extension self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Extension for output maps:')), @@ -594,7 +595,7 @@ pos=( 3, 1)) - self.ext_txt = wx.TextCtrl( + self.ext_txt = TextCtrl( parent=self, id=wx.ID_ANY, value="", size=( 350, -1)) self.ext_txt.SetValue(self.extension) @@ -737,7 +738,7 @@ # layout # self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select source map to display:')), @@ -763,7 +764,7 @@ 2)) self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select target raster map to display:')), @@ -786,7 +787,7 @@ 2)) self.sizer.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select target vector map to display:')), @@ -1293,7 +1294,7 @@ "ucolor": "unused"} wpx = UserSettings.Get(group='gcpman', key='symbol', subkey='width') - for k, v in colours.iteritems(): + for k, v in six.iteritems(colours): col = UserSettings.Get(group='gcpman', key='symbol', subkey=k) self.pointsToDrawSrc.GetPen(v).SetColour(wx.Colour( col[0], col[1], col[2], 255)) # TODO GetPen neni to spatne? @@ -1526,7 +1527,7 @@ if line[0] == '#' or line == '': continue line = line.replace('\n', '').strip() - coords = map(float, line.split()) + coords = list(map(float, line.split())) if coords[6] == 1: check = True self.GCPcount += 1 @@ -2126,7 +2127,7 @@ """Popup Zoom menu """ point = wx.GetMousePosition() - zoommenu = wx.Menu() + zoommenu = Menu() # Add items to the menu zoomsource = wx.MenuItem(zoommenu, wx.ID_ANY, _( @@ -2461,17 +2462,17 @@ # # buttons # - self.btnCancel = wx.Button(parent=self, - id=wx.ID_CANCEL) - self.btnOK = wx.Button(parent=self, - id=wx.ID_OK) + self.btnCancel = Button(parent=self, + id=wx.ID_CANCEL) + self.btnOK = Button(parent=self, + id=wx.ID_OK) self.btnOK.SetDefault() # # list of vector maps # - self.listMap = wx.CheckListBox(parent=self, id=wx.ID_ANY, - choices=vectlist) + self.listMap = CheckListBox(parent=self, id=wx.ID_ANY, + choices=vectlist) if os.path.isfile(self.vgrpfile): f = open(self.vgrpfile) @@ -2497,7 +2498,7 @@ box = wx.BoxSizer(wx.HORIZONTAL) box.Add( - wx.StaticText( + StaticText( parent=self, id=wx.ID_ANY, label=_('Select vector map(s) to add to group:')), @@ -2561,19 +2562,19 @@ sizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s %s " % (_("Ground Control Point No."), str(gcpno))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) # source coordinates gridSizer = wx.GridBagSizer(vgap=5, hgap=5) - self.xcoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.ycoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.zcoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.ecoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.ncoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.hcoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.xcoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.ycoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.zcoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.ecoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.ncoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.hcoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) # swap source N, target E tmp_coord = data[1] @@ -2589,8 +2590,8 @@ (_("target N:"), self.ncoord), (_("source Z:"), self.zcoord), (_("target Z:"), self.hcoord)): - label = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=label) + label = StaticText(parent=panel, id=wx.ID_ANY, + label=label) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, col)) @@ -2617,8 +2618,8 @@ # # buttons # - self.btnCancel = wx.Button(panel, wx.ID_CANCEL) - self.btnOk = wx.Button(panel, wx.ID_OK) + self.btnCancel = Button(panel, wx.ID_CANCEL) + self.btnOk = Button(panel, wx.ID_OK) self.btnOk.SetDefault() btnSizer = wx.StdDialogButtonSizer() @@ -2691,19 +2692,19 @@ self.__CreateRectificationPage(notebook) # buttons - btnSave = wx.Button(self, wx.ID_SAVE) - btnApply = wx.Button(self, wx.ID_APPLY) - btnClose = wx.Button(self, wx.ID_CLOSE) + btnSave = Button(self, wx.ID_SAVE) + btnApply = Button(self, wx.ID_APPLY) + btnClose = Button(self, wx.ID_CLOSE) btnApply.SetDefault() # bindings btnApply.Bind(wx.EVT_BUTTON, self.OnApply) - btnApply.SetToolTipString(_("Apply changes for the current session")) + btnApply.SetToolTip(_("Apply changes for the current session")) btnSave.Bind(wx.EVT_BUTTON, self.OnSave) - btnSave.SetToolTipString( + btnSave.SetToolTip( _("Apply and save changes to user settings file (default for next sessions)")) btnClose.Bind(wx.EVT_BUTTON, self.OnClose) - btnClose.SetToolTipString(_("Close dialog")) + btnClose.SetToolTip(_("Close dialog")) # sizers btnSizer = wx.BoxSizer(wx.HORIZONTAL) @@ -2749,7 +2750,7 @@ 0)) # RMS forward error threshold - rmslabel = wx.StaticText( + rmslabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Highlight RMS error > M + SD * factor:")) rmslabel.SetToolTip( @@ -2766,8 +2767,8 @@ 0)) sdfactor = UserSettings.Get( group='gcpman', key='rms', subkey='sdfactor') - self.rmsWin = wx.TextCtrl(parent=panel, id=wx.ID_ANY, - size=(70, -1), style=wx.TE_NOHIDESEL) + self.rmsWin = TextCtrl(parent=panel, id=wx.ID_ANY, + size=(70, -1), style=wx.TE_NOHIDESEL) self.rmsWin.SetValue("%s" % str(sdfactor)) if (self.parent.highest_only == True): self.rmsWin.Disable() @@ -2777,8 +2778,8 @@ rmsgridSizer.AddGrowableCol(1) sizer.Add(rmsgridSizer, flag=wx.EXPAND | wx.ALL, border=5) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Symbol settings")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Symbol settings")) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) @@ -2786,7 +2787,7 @@ # general symbol color # row = 0 - label = wx.StaticText(parent=panel, id=wx.ID_ANY, label=_("Color:")) + label = StaticText(parent=panel, id=wx.ID_ANY, label=_("Color:")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) col = UserSettings.Get(group='gcpman', key='symbol', subkey='color') colWin = csel.ColourSelect(parent=panel, id=wx.ID_ANY, @@ -2803,7 +2804,7 @@ # symbol color for high forward RMS error # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Color for high RMS error:")) @@ -2823,7 +2824,7 @@ # symbol color for selected GCP # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Color for selected GCP:")) @@ -2843,7 +2844,7 @@ # symbol color for unused GCP # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Color for unused GCPs:")) @@ -2876,7 +2877,7 @@ # symbol size # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Symbol size:")) @@ -2898,7 +2899,7 @@ # symbol width # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Line width:")) @@ -2950,7 +2951,7 @@ self.tgtvectselection.GetElementList() sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select source map to display:')), @@ -2964,7 +2965,7 @@ border=5) self.srcselection.SetValue(src_map) sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select target raster map to display:')), @@ -2978,7 +2979,7 @@ border=5) self.tgtrastselection.SetValue(tgt_map['raster']) sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select target vector map to display:')), @@ -3029,7 +3030,7 @@ # interpolation method gridSizer = wx.GridBagSizer(vgap=5, hgap=5) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select interpolation method:')), @@ -3055,14 +3056,14 @@ # extension sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Extension for output maps:')), proportion=0, flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5) - self.ext_txt = wx.TextCtrl( + self.ext_txt = TextCtrl( parent=panel, id=wx.ID_ANY, value="", size=( 350, -1)) self.ext_txt.SetValue(self.parent.extension) diff -Nru grass-7.6.1/gui/wxpython/image2target/ii2t_mapdisplay.py grass-7.8.0/gui/wxpython/image2target/ii2t_mapdisplay.py --- grass-7.6.1/gui/wxpython/image2target/ii2t_mapdisplay.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/image2target/ii2t_mapdisplay.py 2019-06-03 20:34:20.000000000 +0000 @@ -27,9 +27,9 @@ from gcp.toolbars import GCPDisplayToolbar, GCPManToolbar from mapdisp.gprint import PrintOptions from core.gcmd import GMessage -from core.utils import _ from gui_core.dialogs import GetImageHandlers, ImageSizeDialog from gui_core.mapdisp import SingleMapFrame +from gui_core.wrap import Menu from core.settings import UserSettings from mapwin.buffered import BufferedMapWindow from mapwin.base import MapWindowProperties @@ -421,7 +421,7 @@ Print options and output menu for map display """ point = wx.GetMousePosition() - printmenu = wx.Menu() + printmenu = Menu() # Add items to the menu setup = wx.MenuItem(printmenu, wx.ID_ANY, _('Page setup')) printmenu.AppendItem(setup) @@ -467,7 +467,7 @@ """Popup Zoom menu """ point = wx.GetMousePosition() - zoommenu = wx.Menu() + zoommenu = Menu() # Add items to the menu zoomwind = wx.MenuItem(zoommenu, wx.ID_ANY, _( diff -Nru grass-7.6.1/gui/wxpython/image2target/ii2t_menustrings.py grass-7.8.0/gui/wxpython/image2target/ii2t_menustrings.py --- grass-7.6.1/gui/wxpython/image2target/ii2t_menustrings.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/image2target/ii2t_menustrings.py 2019-08-12 16:50:46.000000000 +0000 @@ -250,7 +250,7 @@ _('Converts coordinates from one projection to another (cs2cs frontend).'), _('Addons extensions'), _('Install extension from addons'), - _('Installs new extension from GRASS AddOns SVN repository.'), + _('Installs new extension from GRASS AddOns repository.'), _('Manage installed extension'), _('Updates or removes installed GRASS AddOns extension(s).'), _('Preferences'), diff -Nru grass-7.6.1/gui/wxpython/image2target/ii2t_statusbar.py grass-7.8.0/gui/wxpython/image2target/ii2t_statusbar.py --- grass-7.6.1/gui/wxpython/image2target/ii2t_statusbar.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/image2target/ii2t_statusbar.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,7 +20,6 @@ import wx from core.gcmd import GMessage -from core.utils import _ from mapdisp.statusbar import SbItem, SbTextItem from gui_core.wrap import SpinCtrl diff -Nru grass-7.6.1/gui/wxpython/image2target/ii2t_toolbars.py grass-7.8.0/gui/wxpython/image2target/ii2t_toolbars.py --- grass-7.6.1/gui/wxpython/image2target/ii2t_toolbars.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/image2target/ii2t_toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,7 +21,6 @@ import wx from core import globalvar -from core.utils import _ from gui_core.toolbars import BaseToolbar, BaseIcons from icons.icon import MetaIcon diff -Nru grass-7.6.1/gui/wxpython/iscatt/controllers.py grass-7.8.0/gui/wxpython/iscatt/controllers.py --- grass-7.6.1/gui/wxpython/iscatt/controllers.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iscatt/controllers.py 2019-06-03 20:34:20.000000000 +0000 @@ -23,6 +23,7 @@ import sys from copy import deepcopy import wx +import six from core.gcmd import GException, GError, GMessage, RunCommand, GWarning @@ -366,7 +367,7 @@ def SetPlotsMode(self, mode): self.plot_mode = mode - for scatt in self.plots.itervalues(): + for scatt in six.itervalues(self.plots): if scatt['scatt']: scatt['scatt'].SetMode(mode) @@ -374,7 +375,7 @@ def ActivateSelectionPolygonMode(self, activate): self.pol_sel_mode[0] = activate - for scatt in self.plots.itervalues(): + for scatt in six.itervalues(self.plots): if not scatt['scatt']: continue scatt['scatt'].SetSelectionPolygonMode(activate) @@ -387,7 +388,7 @@ def ProcessSelectionPolygons(self, process_mode): scatts_polygons = {} - for scatt_id, scatt in self.plots.iteritems(): + for scatt_id, scatt in six.iteritems(self.plots): if not scatt['scatt']: continue coords = scatt['scatt'].GetCoords() @@ -419,7 +420,7 @@ if not sel_cat_id: return - for scatt in self.plots.itervalues(): + for scatt in six.itervalues(self.plots): if scatt['scatt']: scatt['scatt'].SetEmpty() @@ -544,7 +545,7 @@ else: ellipses_dt = {} - for c in scatt_dt.iterkeys(): + for c in six.iterkeys(scatt_dt): try: self.cat_ids.remove(c) scatt_dt[c]['render'] = True @@ -700,7 +701,7 @@ render = False update_cat_rast = [] - for k, v in attrs_dict.iteritems(): + for k, v in six.iteritems(attrs_dict): if not render and k in ['color', 'opacity', 'show', 'nstd']: render = True if k in ['color', 'name']: @@ -975,7 +976,7 @@ def RenderCatRast(self, cat_id): - if not cat_id in self.added_cats_rasts.iterkeys(): + if not cat_id in six.iterkeys(self.added_cats_rasts): cat_rast = self.scatt_mgr.core.GetCatRast(cat_id) cat_name = self.cats_mgr.GetCategoryAttrs(cat_id)['name'] diff -Nru grass-7.6.1/gui/wxpython/iscatt/core_c.py grass-7.8.0/gui/wxpython/iscatt/core_c.py --- grass-7.6.1/gui/wxpython/iscatt/core_c.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iscatt/core_c.py 2019-06-03 20:34:20.000000000 +0000 @@ -12,6 +12,7 @@ """ import sys +import six import numpy as np from multiprocessing import Process, Queue @@ -107,13 +108,13 @@ def _memmapToFileNames(data): - for k, v in data.iteritems(): + for k, v in six.iteritems(data): if 'np_vals' in v: data[k]['np_vals'] = v['np_vals'].filename() def _fileNamesToMemmap(data): - for k, v in data.iteritems(): + for k, v in six.iteritems(data): if 'np_vals' in v: data[k]['np_vals'] = np.memmap(filename=v['np_vals']) @@ -186,7 +187,7 @@ 'nsres': 'ns_res', 'ewres': 'ew_res'} - for k, v in region.iteritems(): + for k, v in six.iteritems(region): if k in ["rows", "cols", "cells", "zone"]: # zone added in r65224 v = int(v) else: @@ -221,11 +222,11 @@ refs = [] cats_rasts_core = [] - for cat_id, scatt_ids in cats.iteritems(): + for cat_id, scatt_ids in six.iteritems(cats): cat_c_id = I_sc_add_cat(pointer(sccats)) cats_rasts_core.append(cats_rasts[cat_id]) - for scatt_id, dt in scatt_ids.iteritems(): + for scatt_id, dt in six.iteritems(scatt_ids): # if key is missing condition is always True (full scatter plor is # computed) vals = dt['np_vals'] diff -Nru grass-7.6.1/gui/wxpython/iscatt/dialogs.py grass-7.8.0/gui/wxpython/iscatt/dialogs.py --- grass-7.6.1/gui/wxpython/iscatt/dialogs.py 2019-03-19 19:57:38.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iscatt/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,6 +19,7 @@ """ import os import sys +import six import wx from iscatt.iscatt_core import idBandsToidScatt @@ -31,7 +32,8 @@ from core.gcmd import GMessage from core.settings import UserSettings from gui_core.dialogs import SimpleDialog -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, StaticText, \ + StaticBox, TextCtrl class AddScattPlotDialog(wx.Dialog): @@ -55,14 +57,14 @@ self.labels = {} self.params = {} - self.band_1_label = wx.StaticText( + self.band_1_label = StaticText( parent=self, id=wx.ID_ANY, label=_("x axis:")) self.band_1_ch = wx.ComboBox(parent=self, id=wx.ID_ANY, choices=self.bands, style=wx.CB_READONLY, size=(350, 30)) - self.band_2_label = wx.StaticText( + self.band_2_label = StaticText( parent=self, id=wx.ID_ANY, label=_("y axis:")) self.band_2_ch = wx.ComboBox(parent=self, id=wx.ID_ANY, @@ -73,11 +75,11 @@ style=wx.LB_MULTIPLE | wx.LB_NEEDED_SB) # buttons - self.btn_add = wx.Button(parent=self, id=wx.ID_ADD) - self.btn_remove = wx.Button(parent=self, id=wx.ID_REMOVE) + self.btn_add = Button(parent=self, id=wx.ID_ADD) + self.btn_remove = Button(parent=self, id=wx.ID_REMOVE) - self.btn_close = wx.Button(parent=self, id=wx.ID_CANCEL) - self.btn_ok = wx.Button(parent=self, id=wx.ID_OK) + self.btn_close = Button(parent=self, id=wx.ID_CANCEL) + self.btn_ok = Button(parent=self, id=wx.ID_OK) self._layout() @@ -100,7 +102,7 @@ flag=wx.TOP | wx.ALIGN_RIGHT, border=5) - box = wx.StaticBox( + box = StaticBox( self, id=wx.ID_ANY, label=" %s " % _("Bands of scatter plots to be added (x y):")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) @@ -245,8 +247,8 @@ self.rasterName = rasterName self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.btnCancel = wx.Button(parent=self.panel, id=wx.ID_CANCEL) - self.btnOK = wx.Button(parent=self.panel, id=wx.ID_OK) + self.btnCancel = Button(parent=self.panel, id=wx.ID_CANCEL) + self.btnOK = Button(parent=self.panel, id=wx.ID_OK) self.btnOK.SetDefault() self.btnOK.Enable(False) self.btnOK.Bind(wx.EVT_BUTTON, self.OnOK) @@ -275,7 +277,7 @@ dataSizer = wx.BoxSizer(wx.VERTICAL) dataSizer.Add( - wx.StaticText( + StaticText( parent=self.panel, id=wx.ID_ANY, label=_("Enter name of new vector map:")), @@ -360,8 +362,8 @@ "selection", _("Color of selection polygon vertex:")], "sel_area": [ "selection", _("Selected area color:")]} - for settKey, sett in self.colorsSetts.iteritems(): - settsLabels[settKey] = wx.StaticText( + for settKey, sett in six.iteritems(self.colorsSetts): + settsLabels[settKey] = StaticText( parent=self, id=wx.ID_ANY, label=sett[1]) col = UserSettings.Get(group='scatt', key=sett[0], subkey=settKey) self.settings[settKey] = csel.ColourSelect( @@ -373,8 +375,8 @@ "sel_area_opacty": ["selection", _("Selected area opacity:")] } - for settKey, sett in self.sizeSetts.iteritems(): - settsLabels[settKey] = wx.StaticText( + for settKey, sett in six.iteritems(self.sizeSetts): + settsLabels[settKey] = StaticText( parent=self, id=wx.ID_ANY, label=sett[1]) self.settings[settKey] = SpinCtrl( parent=self, id=wx.ID_ANY, min=0, max=100) @@ -386,20 +388,20 @@ self.settings[settKey].SetValue(size) # buttons - self.btnSave = wx.Button(self, wx.ID_SAVE) - self.btnApply = wx.Button(self, wx.ID_APPLY) - self.btnClose = wx.Button(self, wx.ID_CLOSE) + self.btnSave = Button(self, wx.ID_SAVE) + self.btnApply = Button(self, wx.ID_APPLY) + self.btnClose = Button(self, wx.ID_CLOSE) self.btnApply.SetDefault() # bindings self.btnApply.Bind(wx.EVT_BUTTON, self.OnApply) - self.btnApply.SetToolTipString( + self.btnApply.SetToolTip( _("Apply changes for the current session")) self.btnSave.Bind(wx.EVT_BUTTON, self.OnSave) - self.btnSave.SetToolTipString( + self.btnSave.SetToolTip( _("Apply and save changes to user settings file (default for next sessions)")) self.btnClose.Bind(wx.EVT_BUTTON, self.OnClose) - self.btnClose.SetToolTipString(_("Close dialog")) + self.btnClose.SetToolTip(_("Close dialog")) # Layout @@ -408,8 +410,8 @@ sizer = wx.BoxSizer(wx.VERTICAL) - sel_pol_box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Selection style:")) + sel_pol_box = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Selection style:")) selPolBoxSizer = wx.StaticBoxSizer(sel_pol_box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=1, hgap=1) @@ -435,8 +437,8 @@ gridSizer.AddGrowableCol(1) selPolBoxSizer.Add(gridSizer, flag=wx.EXPAND) - ell_box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Ellipses settings:")) + ell_box = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Ellipses settings:")) ellPolBoxSizer = wx.StaticBoxSizer(ell_box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=1, hgap=1) @@ -480,7 +482,7 @@ def UpdateSettings(self): chanaged_setts = [] - for settKey, sett in self.colorsSetts.iteritems(): + for settKey, sett in six.iteritems(self.colorsSetts): col = tuple(self.settings[settKey].GetColour()) col_s = UserSettings.Get( group='scatt', key=sett[0], subkey=settKey) @@ -491,7 +493,7 @@ value=col) chanaged_setts.append([settKey, sett[0]]) - for settKey, sett in self.sizeSetts.iteritems(): + for settKey, sett in six.iteritems(self.sizeSetts): val = self.settings[settKey].GetValue() val_s = UserSettings.Get( group='scatt', key=sett[0], subkey=settKey) @@ -562,7 +564,7 @@ def __init__(self, parent, old_name, title=("Change class name")): SimpleDialog.__init__(self, parent, title) - self.name = wx.TextCtrl(self.panel, id=wx.ID_ANY) + self.name = TextCtrl(self.panel, id=wx.ID_ANY) self.name.SetValue(old_name) self.dataSizer.Add(self.name, proportion=0, diff -Nru grass-7.6.1/gui/wxpython/iscatt/frame.py grass-7.8.0/gui/wxpython/iscatt/frame.py --- grass-7.6.1/gui/wxpython/iscatt/frame.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iscatt/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -22,6 +22,7 @@ import os import sys +import six import wx import wx.lib.scrolledpanel as scrolled @@ -32,6 +33,7 @@ from gui_core.gselect import Select from gui_core.dialogs import SetOpacityDialog +from gui_core.wrap import StaticBox, Menu from iscatt.controllers import ScattsManager from iscatt.toolbars import MainToolbar, EditingToolbar, CategoryToolbar from iscatt.iscatt_core import idScattToidBands @@ -139,8 +141,8 @@ self.catsPanel.SetMinSize((-1, 100)) self.catsPanel.SetInitialSize((-1, 150)) - box_capt = wx.StaticBox(parent=self.catsPanel, id=wx.ID_ANY, - label=' %s ' % _("Classes"),) + box_capt = StaticBox(parent=self.catsPanel, id=wx.ID_ANY, + label=' %s ' % _("Classes"),) catsSizer = wx.StaticBoxSizer(box_capt, wx.VERTICAL) self.toolbars['categoryToolbar'] = self._createCategoryToolbar( @@ -260,7 +262,7 @@ self.scatt_mgr.cursorPlotMove.connect(self.CursorPlotMove) def SetBusy(self, busy): - for scatt in self.scatts.itervalues(): + for scatt in six.itervalues(self.scatts): scatt.UpdateCur(busy) def CursorPlotMove(self, x, y, scatt_id): @@ -569,7 +571,7 @@ cat_id = cats[cat_idx] showed = self.cats_mgr.GetCategoryAttrs(cat_id)['show'] - menu = wx.Menu() + menu = Menu() item_id = wx.NewId() menu.Append(item_id, text=_("Rename class")) diff -Nru grass-7.6.1/gui/wxpython/iscatt/iscatt_core.py grass-7.8.0/gui/wxpython/iscatt/iscatt_core.py --- grass-7.6.1/gui/wxpython/iscatt/iscatt_core.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iscatt/iscatt_core.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,6 +19,7 @@ """ import os import sys +import six import time @@ -114,7 +115,7 @@ arr = self.scatt_conds_dt.GetValuesArr(cat_id, scatt_id) - for k, v in bbox.iteritems(): + for k, v in six.iteritems(bbox): bbox[k] = self._validExtend(v) arr[bbox['btm_y']: bbox['up_y'], bbox['btm_x']: bbox['up_x']] = value @@ -159,7 +160,7 @@ if cat_id not in self.scatts_dt.GetCategories(): raise GException(_("Select category for editing.")) - for scatt_id, coords in scatts_pols.iteritems(): + for scatt_id, coords in six.iteritems(scatts_pols): if self.scatt_conds_dt.AddScattPlot(cat_id, scatt_id) < 0: return False @@ -471,7 +472,7 @@ if cat_id not in self.cats.keys(): return False - for scatt in self.cats[cat_id].itervalues(): + for scatt in six.itervalues(self.cats[cat_id]): grass.try_remove(scatt['np_vals']) del scatt['np_vals'] @@ -552,7 +553,7 @@ def GetData(self, requested_dt): cats = {} - for cat_id, scatt_ids in requested_dt.iteritems(): + for cat_id, scatt_ids in six.iteritems(requested_dt): if cat_id not in cats: cats[cat_id] = {} for scatt_id in scatt_ids: @@ -567,7 +568,7 @@ def SetData(self, cats): - for cat_id, scatt_ids in cats.iteritems(): + for cat_id, scatt_ids in six.iteritems(cats): for scatt_id in scatt_ids: # if key is missing condition is always True (full scatter plor # is computed) @@ -577,7 +578,7 @@ def GetScatt(self, scatt_id, cats_ids=None): scatts = {} - for cat_id in self.cats.iterkeys(): + for cat_id in six.iterkeys(self.cats): if cats_ids and cat_id not in cats_ids: continue if scatt_id not in self.cats[cat_id]: @@ -644,7 +645,7 @@ return False self.scatts_ids.append(scatt_id) - for cat_id in self.cats.iterkeys(): + for cat_id in six.iterkeys(self.cats): ScattPlotsCondsData.AddScattPlot(self, cat_id, scatt_id) self.cats[cat_id][scatt_id]['ellipse'] = None @@ -657,7 +658,7 @@ self.scatts_ids.remove(scatt_id) - for cat_id in self.cats.iterkeys(): + for cat_id in six.iterkeys(self.cats): ScattPlotsCondsData.DeleteScattPlot(self, cat_id, scatt_id) return True @@ -667,7 +668,7 @@ return False scatts = {} - for cat_id in self.cats.iterkeys(): + for cat_id in six.iterkeys(self.cats): if cat_id == 0: continue nstd = styles[cat_id]['nstd'] @@ -740,9 +741,9 @@ def CleanUp(self): ScattPlotsCondsData.CleanUp(self) - for tmp in self.cats_rasts_conds.itervalues(): + for tmp in six.itervalues(self.cats_rasts_conds): grass.try_remove(tmp) - for tmp in self.cats_rasts.itervalues(): + for tmp in six.itervalues(self.cats_rasts): RunCommand("g.remove", flags='f', type='raster', name=tmp, getErrorMsg=True) @@ -762,7 +763,7 @@ max_cat_id = max(self.cats_rasts_conds.keys()) cats_rasts_conds = [''] * (max_cat_id + 1) - for i_cat_id, i_rast in self.cats_rasts_conds.iteritems(): + for i_cat_id, i_rast in six.iteritems(self.cats_rasts_conds): cats_rasts_conds[i_cat_id] = i_rast return cats_rasts_conds @@ -771,7 +772,7 @@ max_cat_id = max(self.cats_rasts.keys()) cats_rasts = [''] * (max_cat_id + 1) - for i_cat_id, i_rast in self.cats_rasts.iteritems(): + for i_cat_id, i_rast in six.iteritems(self.cats_rasts): cats_rasts[i_cat_id] = i_rast return cats_rasts diff -Nru grass-7.6.1/gui/wxpython/iscatt/plots.py grass-7.8.0/gui/wxpython/iscatt/plots.py --- grass-7.6.1/gui/wxpython/iscatt/plots.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/iscatt/plots.py 2019-06-03 20:34:20.000000000 +0000 @@ -16,6 +16,7 @@ @author Stepan Turek (mentor: Martin Landa) """ import wx +import six import numpy as np from math import ceil from multiprocessing import Process, Queue @@ -24,6 +25,7 @@ from iscatt.core_c import MergeArrays, ApplyColormap from iscatt.dialogs import ManageBusyCursorMixin from core.settings import UserSettings +from gui_core.wrap import Menu try: import matplotlib @@ -550,7 +552,7 @@ def _rendDtMemmapsToFiles(rend_dt): - for k, v in rend_dt.iteritems(): + for k, v in six.iteritems(rend_dt): if 'dt' in v: rend_dt[k]['sh'] = v['dt'].shape rend_dt[k]['dt'] = v['dt'].filename @@ -558,7 +560,7 @@ def _rendDtFilesToMemmaps(rend_dt): - for k, v in rend_dt.iteritems(): + for k, v in six.iteritems(rend_dt): if 'dt' in v: rend_dt[k]['dt'] = np.memmap(filename=v['dt'], shape=v['sh']) del rend_dt[k]['sh'] @@ -613,7 +615,7 @@ return if event.button == 3: - menu = wx.Menu() + menu = Menu() menu_items = [["zoom_to_extend", _("Zoom to scatter plot extend"), lambda event: self.plot.ZoomToExtend()]] @@ -834,7 +836,7 @@ coords.append(tup) self.pol.xy = coords - self.line.set_data(zip(*self.pol.xy)) + self.line.set_data(list(zip(*self.pol.xy))) self.Redraw() @@ -854,7 +856,7 @@ list(self.pol.xy[:i + 1]) + [(event.xdata, event.ydata)] + list(self.pol.xy[i + 1:])) - self.line.set_data(zip(*self.pol.xy)) + self.line.set_data(list(zip(*self.pol.xy))) break self.Redraw() @@ -872,7 +874,7 @@ list(self.pol.xy[1:]) + [(event.xdata, event.ydata)]) - self.line.set_data(zip(*self.pol.xy)) + self.line.set_data(list(zip(*self.pol.xy))) self.Redraw() @@ -901,7 +903,7 @@ elif self.moving_ver_idx == len(self.pol.xy) - 1: self.pol.xy[0] = x, y - self.line.set_data(zip(*self.pol.xy)) + self.line.set_data(list(zip(*self.pol.xy))) self.canvas.restore_region(self.background) diff -Nru grass-7.6.1/gui/wxpython/lmgr/frame.py grass-7.8.0/gui/wxpython/lmgr/frame.py --- grass-7.6.1/gui/wxpython/lmgr/frame.py 2019-03-19 19:57:59.000000000 +0000 +++ grass-7.8.0/gui/wxpython/lmgr/frame.py 2019-08-12 16:50:46.000000000 +0000 @@ -42,10 +42,11 @@ sys.path.append(os.path.join(globalvar.ETCDIR, "python")) from grass.script import core as grass +from grass.script.utils import decode from core.gcmd import RunCommand, GError, GMessage, EncodeString from core.settings import UserSettings, GetDisplayVectSettings -from core.utils import SetAddOnPath, GetLayerNameFromCmd, command2ltype, _ +from core.utils import SetAddOnPath, GetLayerNameFromCmd, command2ltype from gui_core.preferences import MapsetAccess, PreferencesDialog from lmgr.layertree import LayerTree, LMIcons from lmgr.menudata import LayerManagerMenuData, LayerManagerModuleTree @@ -64,7 +65,7 @@ from lmgr.giface import LayerManagerGrassInterface from datacatalog.catalog import DataCatalog from gui_core.forms import GUI -from gui_core.wrap import Menu +from gui_core.wrap import Menu, TextEntryDialog class GMFrame(wx.Frame): @@ -1116,7 +1117,7 @@ # renamed (it just uses the numbers) dispId = 1 for display in self.GetMapDisplay(onlyCurrent=False): - display.SetTitleWithName(dispId) # TODO: signal ? + display.SetTitleWithName(str(dispId)) # TODO: signal ? dispId += 1 def OnChangeCWD(self, event=None, cmd=None): @@ -1228,9 +1229,10 @@ osgeo4w = '' self._gconsole.WriteCmdLog(_("System Info")) - # platform from UTF-8 conversion was added because of the Fedora 19 release + # platform decoding was added because of the Fedora 19 release # which has the name "Schrödinger’s cat" (umlaut and special ' character) # which appears in the platform.platform() string + platform_ = decode(platform.platform()) self._gconsole.WriteLog("%s: %s\n" "%s: %s\n" "%s: %s\n" @@ -1243,7 +1245,7 @@ "Python: %s\n" "wxPython: %s\n" "%s: %s%s\n" % (_("GRASS version"), vInfo.get('version', _('unknown version')), - _("GRASS SVN revision"), vInfo.get( + _("Code revision"), vInfo.get( 'revision', '?'), _("Build date"), vInfo.get( 'build_date', '?'), @@ -1260,7 +1262,7 @@ 'sqlite', '?'), platform.python_version(), wx.__version__, - _("Platform"), platform.platform().decode('utf8', 'replace'), osgeo4w), + _("Platform"), platform_, osgeo4w), notification=Notification.MAKE_VISIBLE) self._gconsole.WriteCmdLog(' ') @@ -1377,6 +1379,41 @@ self.workspaceFile = filename self._setTitle() + def _tryToSwitchMapsetFromWorkspaceFile(self, gxwXml): + returncode, errors = RunCommand('g.mapset', + dbase=gxwXml.database, + location=gxwXml.location, + mapset=gxwXml.mapset, + getErrorMsg=True, + ) + if returncode != 0: + # TODO: use the function from grass.py + reason = _("Most likely the database, location or mapset" + " does not exist") + details = errors + message = _("Unable to change to location and mapset" + " specified in the workspace.\n" + "Reason: {reason}\nDetails: {details}\n\n" + "Do you want to proceed with opening" + " the workspace anyway?" + ).format(**locals()) + dlg = wx.MessageDialog( + parent=self, message=message, caption=_( + "Proceed with opening of the workspace?"), + style=wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION) + dlg.CenterOnParent() + if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]: + return False + else: + # TODO: copy from ChangeLocation function + GMessage( + parent=self, + message=_("Current location is <%(loc)s>.\n" + "Current mapset is <%(mapset)s>.") % + {'loc': gxwXml.location, + 'mapset': gxwXml.mapset}) + return True + def LoadWorkspaceFile(self, filename): """Load layer tree definition stored in GRASS Workspace XML file (gxw) @@ -1395,8 +1432,13 @@ "Reading workspace file <%s> failed.\n" "Invalid file, unable to parse XML document.") % filename) - return + return False + + if gxwXml.database and gxwXml.location and gxwXml.mapset: + if not self._tryToSwitchMapsetFromWorkspaceFile(gxwXml): + return False + # the really busy part starts here (mapset change is fast) busy = wx.BusyInfo(_("Please wait, loading workspace..."), parent=self) wx.Yield() @@ -1665,7 +1707,7 @@ return False try: - mfile = open(filename, "w") + mfile = open(filename, "wb") tmpfile.seek(0) for line in tmpfile.readlines(): mfile.write(line) @@ -1715,10 +1757,10 @@ def OnRenameDisplay(self, event): """Change Map Display name""" name = self.notebookLayers.GetPageText(self.currentPageNum) - dlg = wx.TextEntryDialog( + dlg = TextEntryDialog( self, message=_("Enter new name:"), caption=_("Rename Map Display"), - defaultValue=name) + value=name) if dlg.ShowModal() == wx.ID_OK: name = dlg.GetValue() self.notebookLayers.SetPageText( @@ -1755,7 +1797,7 @@ dlg.Show() def OnInstallExtension(self, event): - """Install extension from GRASS Addons SVN repository""" + """Install extension from GRASS Addons repository""" from modules.extensions import InstallExtensionWindow win = InstallExtensionWindow( self, giface=self._giface, size=(650, 550)) diff -Nru grass-7.6.1/gui/wxpython/lmgr/giface.py grass-7.8.0/gui/wxpython/lmgr/giface.py --- grass-7.6.1/gui/wxpython/lmgr/giface.py 2019-03-19 19:58:07.000000000 +0000 +++ grass-7.8.0/gui/wxpython/lmgr/giface.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,6 +21,7 @@ from grass.pydispatch.signal import Signal from core.giface import Notification +from core.utils import GetLayerNameFromCmd class Layer(object): @@ -123,6 +124,22 @@ "Select or unselect layer" self._tree.SelectItem(layer._layer, select) + def ChangeLayer(self, layer, **kwargs): + "Change layer (cmd, ltype, opacity)" + if 'cmd' in kwargs: + layer._pydata[0]['cmd'] = kwargs['cmd'] + layerName, found = GetLayerNameFromCmd(kwargs['cmd'], fullyQualified=True) + if found: + layer._pydata[0]['label'] = layerName + if 'ltype' in kwargs: + layer._pydata[0]['type'] = kwargs['ltype'] + if 'opacity' in kwargs: + layer._pydata[0]['maplayer'].SetOpacity(kwargs['opacity']) + + self._tree.ChangeLayer(layer._layer) + self._tree.SetItemIcon(layer._layer) + self._tree.SetItemText(layer._layer, self._tree._getLayerName(layer._layer)) + def IsLayerChecked(self, layer): """Returns True if layer is checked, False otherwise""" return self._tree.IsItemChecked(layer._layer) diff -Nru grass-7.6.1/gui/wxpython/lmgr/layertree.py grass-7.8.0/gui/wxpython/lmgr/layertree.py --- grass-7.6.1/gui/wxpython/lmgr/layertree.py 2019-03-19 19:58:01.000000000 +0000 +++ grass-7.8.0/gui/wxpython/lmgr/layertree.py 2019-06-03 20:34:20.000000000 +0000 @@ -38,7 +38,7 @@ from mapdisp.frame import MapFrame from core.render import Map from wxplot.histogram import HistogramPlotFrame -from core.utils import GetLayerNameFromCmd, ltype2command, _ +from core.utils import GetLayerNameFromCmd, ltype2command from wxplot.profile import ProfileFrame from core.debug import Debug from core.settings import UserSettings, GetDisplayVectSettings @@ -47,7 +47,7 @@ from icons.icon import MetaIcon from web_services.dialogs import SaveWMSLayerDialog from gui_core.widgets import MapValidator -from gui_core.wrap import Menu, GenBitmapButton +from gui_core.wrap import Menu, GenBitmapButton, TextCtrl from lmgr.giface import LayerManagerGrassInterfaceForMapDisplay from core.giface import Notification @@ -204,7 +204,7 @@ # here (with initial auto-generated names) we use just the # number, not the whole name for simplicity - self.mapdisplay.SetTitleWithName(self.displayIndex + 1) + self.mapdisplay.SetTitleWithName(str(self.displayIndex + 1)) # show new display if showMapDisplay is True: @@ -2132,7 +2132,7 @@ layer=self.GetLayerInfo( item, key='maplayer'), - type=type, + ltype=type, command=cmdlist, name=layerName, active=chk, @@ -2255,6 +2255,6 @@ height = 25 if sys.platform in ('win32', 'darwin'): height = 40 - ctrl = wx.TextCtrl(self, id=wx.ID_ANY, value='', pos=wx.DefaultPosition, size=( + ctrl = TextCtrl(self, id=wx.ID_ANY, value='', pos=wx.DefaultPosition, size=( self.GetSize()[0] - 100, height), style=wx.TE_PROCESS_ENTER | wx.TE_DONTWRAP) return ctrl diff -Nru grass-7.6.1/gui/wxpython/lmgr/menudata.py grass-7.8.0/gui/wxpython/lmgr/menudata.py --- grass-7.6.1/gui/wxpython/lmgr/menudata.py 2019-03-19 19:57:59.000000000 +0000 +++ grass-7.8.0/gui/wxpython/lmgr/menudata.py 2019-07-28 20:17:50.000000000 +0000 @@ -21,7 +21,6 @@ from core.toolboxes import getMenudataFile, getMessages, clearMessages from core.globalvar import WXGUIDIR from core.gcmd import GError -from core.utils import _ class LayerManagerMenuData(MenuTreeModelBuilder): @@ -68,7 +67,7 @@ self, filename, expandAddons=expandAddons, message_handler=message_handler) except (ValueError, AttributeError, TypeError): - error_handler(_("Unable to parse user toolboxes XML files. " - "Default module tree will be loaded.")) + message_handler(_("Unable to parse user toolboxes XML files. " + "Default module tree will be loaded.")) MenuTreeModelBuilder.__init__( self, fallback, message_handler=message_handler) diff -Nru grass-7.6.1/gui/wxpython/lmgr/pyshell.py grass-7.8.0/gui/wxpython/lmgr/pyshell.py --- grass-7.6.1/gui/wxpython/lmgr/pyshell.py 2019-03-19 19:58:01.000000000 +0000 +++ grass-7.8.0/gui/wxpython/lmgr/pyshell.py 2019-06-03 20:34:20.000000000 +0000 @@ -29,7 +29,6 @@ import grass.script as grass from grass.script.utils import try_remove -from core.utils import _ from gui_core.wrap import Button diff -Nru grass-7.6.1/gui/wxpython/lmgr/toolbars.py grass-7.8.0/gui/wxpython/lmgr/toolbars.py --- grass-7.6.1/gui/wxpython/lmgr/toolbars.py 2019-03-19 19:58:07.000000000 +0000 +++ grass-7.8.0/gui/wxpython/lmgr/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -25,7 +25,6 @@ from core.gcmd import RunCommand from gui_core.toolbars import BaseToolbar, BaseIcons from icons.icon import MetaIcon -from core.utils import _ class LMWorkspaceToolbar(BaseToolbar): diff -Nru grass-7.6.1/gui/wxpython/location_wizard/base.py grass-7.8.0/gui/wxpython/location_wizard/base.py --- grass-7.6.1/gui/wxpython/location_wizard/base.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/location_wizard/base.py 2019-06-03 20:34:20.000000000 +0000 @@ -17,6 +17,7 @@ """ import wx +from gui_core.wrap import StaticText, TextCtrl, Button, CheckBox class BaseClass(wx.Object): @@ -30,10 +31,10 @@ """Make aligned label""" if not parent: parent = self - label = wx.StaticText(parent=parent, id=wx.ID_ANY, label=text, + label = StaticText(parent=parent, id=wx.ID_ANY, label=text, style=style) if tooltip: - label.SetToolTipString(tooltip) + label.SetToolTip(tooltip) return label def MakeTextCtrl(self, text='', size=(100, -1), @@ -41,10 +42,10 @@ """Generic text control""" if not parent: parent = self - textCtrl = wx.TextCtrl(parent=parent, id=wx.ID_ANY, value=text, + textCtrl = TextCtrl(parent=parent, id=wx.ID_ANY, value=text, size=size, style=style) if tooltip: - textCtrl.SetToolTipString(tooltip) + textCtrl.SetToolTip(tooltip) return textCtrl def MakeButton(self, text, id=wx.ID_ANY, size=(-1, -1), @@ -52,10 +53,10 @@ """Generic button""" if not parent: parent = self - button = wx.Button(parent=parent, id=id, label=text, + button = Button(parent=parent, id=id, label=text, size=size) if tooltip: - button.SetToolTipString(tooltip) + button.SetToolTip(tooltip) return button def MakeCheckBox(self, text, id=wx.ID_ANY, size=(-1, -1), @@ -63,8 +64,8 @@ """Generic checkbox""" if not parent: parent = self - chbox = wx.CheckBox(parent=parent, id=id, label=text, + chbox = CheckBox(parent=parent, id=id, label=text, size=size) if tooltip: - chbox.SetToolTipString(tooltip) + chbox.SetToolTip(tooltip) return chbox diff -Nru grass-7.6.1/gui/wxpython/location_wizard/dialogs.py grass-7.8.0/gui/wxpython/location_wizard/dialogs.py --- grass-7.6.1/gui/wxpython/location_wizard/dialogs.py 2019-03-19 19:57:29.000000000 +0000 +++ grass-7.8.0/gui/wxpython/location_wizard/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -24,8 +24,9 @@ from core import globalvar from core.gcmd import RunCommand -from core.utils import _ from location_wizard.base import BaseClass +from gui_core.wrap import Button, StaticText, StaticBox, \ + TextCtrl from grass.script import core as grass @@ -108,7 +109,7 @@ self.bset = self.MakeButton( text=_("&Set region"), id=wx.ID_OK, parent=panel) - self.bcancel = wx.Button(panel, id=wx.ID_CANCEL) + self.bcancel = Button(panel, id=wx.ID_CANCEL) self.bset.SetDefault() # @@ -247,13 +248,13 @@ gridSizer = wx.GridBagSizer(vgap=0, hgap=0) # inputs - self.ttop = wx.TextCtrl(parent=pane, id=wx.ID_ANY, value=str(self.top), - size=(150, -1)) - self.tbottom = wx.TextCtrl( + self.ttop = TextCtrl(parent=pane, id=wx.ID_ANY, value=str(self.top), + size=(150, -1)) + self.tbottom = TextCtrl( parent=pane, id=wx.ID_ANY, value=str( self.bottom), size=( 150, -1)) - self.ttbres = wx.TextCtrl( + self.ttbres = TextCtrl( parent=pane, id=wx.ID_ANY, value=str( self.tbres), size=( 150, -1)) @@ -263,17 +264,17 @@ # size = (150, -1)) # labels - self.ldepth = wx.StaticText( + self.ldepth = StaticText( parent=pane, label=_("Depth: %d") % self.depth) - self.lcells3 = wx.StaticText( + self.lcells3 = StaticText( parent=pane, label=_("3D Cells: %d") % self.cells3) # top - gridSizer.Add(wx.StaticText(parent=pane, label=_("Top")), + gridSizer.Add(StaticText(parent=pane, label=_("Top")), flag=wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT | wx.TOP, border=5, pos=(0, 1)) @@ -281,7 +282,7 @@ flag=wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, border=5, pos=(1, 1)) # bottom - gridSizer.Add(wx.StaticText(parent=pane, label=_("Bottom")), + gridSizer.Add(StaticText(parent=pane, label=_("Bottom")), flag=wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT | wx.TOP, border=5, pos=(0, 2)) @@ -290,7 +291,7 @@ wx.ALL, border=5, pos=(1, 2)) # tbres gridSizer.Add( - wx.StaticText( + StaticText( parent=pane, label=_("T-B resolution")), flag=wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT | wx.TOP, @@ -607,7 +608,7 @@ # # dialog body # - bodyBox = wx.StaticBox( + bodyBox = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Select from list of datum transformations")) bodySizer = wx.StaticBoxSizer(bodyBox) @@ -655,11 +656,11 @@ # btnsizer = wx.StdDialogButtonSizer() - btn = wx.Button(parent=panel, id=wx.ID_OK) + btn = Button(parent=panel, id=wx.ID_OK) btn.SetDefault() btnsizer.AddButton(btn) - btn = wx.Button(parent=panel, id=wx.ID_CANCEL) + btn = Button(parent=panel, id=wx.ID_CANCEL) btnsizer.AddButton(btn) btnsizer.Realize() diff -Nru grass-7.6.1/gui/wxpython/location_wizard/wizard.py grass-7.8.0/gui/wxpython/location_wizard/wizard.py --- grass-7.6.1/gui/wxpython/location_wizard/wizard.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/location_wizard/wizard.py 2019-06-03 20:34:20.000000000 +0000 @@ -35,6 +35,7 @@ import os import sys import locale +import six import wx import wx.lib.mixins.listctrl as listmix @@ -50,10 +51,11 @@ import wx.lib.scrolledpanel as scrolled from core import utils -from core.utils import _ +from core.utils import cmp from core.gcmd import RunCommand, GError, GMessage, GWarning from gui_core.widgets import GenericValidator -from gui_core.wrap import SpinCtrl, SearchCtrl +from gui_core.wrap import SpinCtrl, SearchCtrl, StaticText, \ + TextCtrl, Button, CheckBox, StaticBox from location_wizard.base import BaseClass from location_wizard.dialogs import SelectTransformDialog @@ -80,7 +82,7 @@ self.page = WizardPageSimple.__init__(self, parent) # page title - self.title = wx.StaticText(parent=self, id=wx.ID_ANY, label=title) + self.title = StaticText(parent=self, id=wx.ID_ANY, label=title) self.title.SetFont(wx.Font(13, wx.SWISS, wx.NORMAL, wx.BOLD)) # main sizers self.pagesizer = wx.BoxSizer(wx.VERTICAL) @@ -108,10 +110,10 @@ """Make aligned label""" if not parent: parent = self - label = wx.StaticText(parent=parent, id=wx.ID_ANY, label=text, + label = StaticText(parent=parent, id=wx.ID_ANY, label=text, style=style) if tooltip: - label.SetToolTipString(tooltip) + label.SetToolTip(tooltip) return label def MakeTextCtrl(self, text='', size=(100, -1), @@ -119,10 +121,10 @@ """Generic text control""" if not parent: parent = self - textCtrl = wx.TextCtrl(parent=parent, id=wx.ID_ANY, value=text, + textCtrl = TextCtrl(parent=parent, id=wx.ID_ANY, value=text, size=size, style=style) if tooltip: - textCtrl.SetToolTipString(tooltip) + textCtrl.SetToolTip(tooltip) return textCtrl def MakeButton(self, text, id=wx.ID_ANY, size=(-1, -1), @@ -130,10 +132,10 @@ """Generic button""" if not parent: parent = self - button = wx.Button(parent=parent, id=id, label=text, + button = Button(parent=parent, id=id, label=text, size=size) if tooltip: - button.SetToolTipString(tooltip) + button.SetToolTip(tooltip) return button def MakeCheckBox(self, text, id=wx.ID_ANY, size=(-1, -1), @@ -141,10 +143,10 @@ """Generic checkbox""" if not parent: parent = self - chbox = wx.CheckBox(parent=parent, id=id, label=text, + chbox = CheckBox(parent=parent, id=id, label=text, size=size) if tooltip: - chbox.SetToolTipString(tooltip) + chbox.SetToolTip(tooltip) return chbox @@ -349,7 +351,7 @@ # layout self.sizer.SetVGap(10) - self.sizer.Add(wx.StaticText(parent=self, label=_("Simple methods:")), + self.sizer.Add(StaticText(parent=self, label=_("Simple methods:")), flag=wx.ALIGN_LEFT, pos=(1, 1)) self.sizer.Add(self.radioEpsg, flag=wx.ALIGN_LEFT, pos=(2, 1)) @@ -361,7 +363,7 @@ flag=wx.ALIGN_LEFT, pos=(4, 1)) self.sizer.Add(self.radioXy, flag=wx.ALIGN_LEFT, pos=(5, 1)) - self.sizer.Add(wx.StaticText(parent=self, label=_("Advanced methods:")), + self.sizer.Add(StaticText(parent=self, label=_("Advanced methods:")), flag=wx.ALIGN_LEFT, pos=(6, 1)) self.sizer.Add(self.radioSrs, flag=wx.ALIGN_LEFT, pos=(7, 1)) @@ -565,7 +567,7 @@ def OnItemSelected(self, event): """Projection selected""" - index = event.m_itemIndex + index = event.GetIndex() # set values self.proj = self.projlist.GetItem(index, 0).GetText().lower() @@ -651,7 +653,7 @@ self.sourceData = data try: - data.sort() + data = sorted(data) self.DeleteAllItems() row = 0 for value in data: @@ -699,6 +701,9 @@ s = str(self.itemDataMap[index][col]) return s + def OnGetItemImage(self, item): + return -1 + def OnGetItemAttr(self, item): """Get item attributes""" index = self.itemIndexMap[item] @@ -710,7 +715,11 @@ def SortItems(self, sorter=cmp): """Sort items""" items = list(self.itemDataMap.keys()) - items.sort(self.Sorter) + if sys.version_info[0] >= 3: + # not sure what Sorter is needed for + items.sort() + else: + items.sort(self.Sorter) self.itemIndexMap = items # redraw the list @@ -788,7 +797,7 @@ self.p4projparams = '' self.projdesc = '' - radioSBox = wx.StaticBox( + radioSBox = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % _("Select datum or ellipsoid (next page)")) radioSBSizer = wx.StaticBoxSizer(radioSBox) @@ -849,7 +858,7 @@ """Go to next page""" if event.GetDirection(): self.p4projparams = '' - for id, param in self.pparam.iteritems(): + for id, param in six.iteritems(self.pparam): if param['type'] == 'bool': if param['value'] == False: continue @@ -875,7 +884,7 @@ self.projdesc = self.parent.projections[self.parent.projpage.proj][0] if self.prjParamSizer is None: # entering page for the first time - self.paramSBox = wx.StaticBox( + self.paramSBox = StaticBox( parent=self, id=wx.ID_ANY, label=_(" Enter parameters for %s projection ") % @@ -922,7 +931,7 @@ else: param['value'] = paramgrp[2] - label = wx.StaticText( + label = StaticText( parent=self.panel, id=wx.ID_ANY, label=param['desc'], @@ -941,9 +950,9 @@ win.Bind(wx.EVT_SPINCTRL, self.OnParamEntry) win.Bind(wx.EVT_TEXT, self.OnParamEntry) else: - win = wx.TextCtrl(parent=self.panel, id=id, - value=param['value'], - size=(100, -1)) + win = TextCtrl(parent=self.panel, id=id, + value=param['value'], + size=(100, -1)) win.Bind(wx.EVT_TEXT, self.OnParamEntry) if paramgrp[1] == 'noask': win.Enable(False) @@ -1146,7 +1155,7 @@ def OnDatumSelected(self, event): """Datum selected""" - index = event.m_itemIndex + index = event.GetIndex() item = event.GetItem() self.datum = self.datumlist.GetItem(index, 0).GetText() @@ -1306,7 +1315,7 @@ def OnItemSelected(self, event): """Ellipsoid selected""" - index = event.m_itemIndex + index = event.GetIndex() item = event.GetItem() self.ellipse = self.ellipselist.GetItem(index, 0).GetText() @@ -1677,7 +1686,7 @@ def OnItemSelected(self, event): """EPSG code selected from the list""" - index = event.m_itemIndex + index = event.GetIndex() item = event.GetItem() self.epsgcode = int(self.epsglist.GetItem(index, 0).GetText()) @@ -1689,7 +1698,7 @@ def OnBrowseCodes(self, event, search=None): """Browse EPSG codes""" try: - self.epsgCodeDict = utils.ReadEpsgCodes(self.tfile.GetValue()) + self.epsgCodeDict = utils.ReadEpsgCodes() except OpenError as e: GError( parent=self, @@ -1699,7 +1708,7 @@ return data = list() - for code, val in self.epsgCodeDict.iteritems(): + for code, val in six.iteritems(self.epsgCodeDict): if code is not None: data.append((code, val[0], val[1])) @@ -1922,7 +1931,7 @@ def OnItemSelected(self, event): """IAU code selected from the list""" - index = event.m_itemIndex + index = event.GetIndex() item = event.GetItem() self.epsgcode = int(self.epsglist.GetItem(index, 0).GetText()) @@ -1936,7 +1945,7 @@ def OnBrowseCodes(self, event, search=None): """Browse IAU codes""" try: - self.epsgCodeDict = utils.ReadEpsgCodes(self.tfile.GetValue()) + self.epsgCodeDict = utils.ReadEpsgCodes() except OpenError as e: GError( parent=self, @@ -1946,7 +1955,7 @@ return data = list() - for code, val in self.epsgCodeDict.iteritems(): + for code, val in six.iteritems(self.epsgCodeDict): if code is not None: data.append((code, val[0], val[1])) diff -Nru grass-7.6.1/gui/wxpython/mapdisp/frame.py grass-7.8.0/gui/wxpython/mapdisp/frame.py --- grass-7.6.1/gui/wxpython/mapdisp/frame.py 2019-03-19 19:57:49.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapdisp/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -33,7 +33,7 @@ from mapdisp.toolbars import MapToolbar, NvizIcons from mapdisp.gprint import PrintOptions from core.gcmd import GError, GMessage, RunCommand -from core.utils import ListOfCatsToRange, GetLayerNameFromCmd, _ +from core.utils import ListOfCatsToRange, GetLayerNameFromCmd from gui_core.dialogs import GetImageHandlers, ImageSizeDialog from core.debug import Debug from core.settings import UserSettings @@ -48,6 +48,7 @@ from gui_core.forms import GUI from core.giface import Notification from gui_core.vselect import VectorSelectBase, VectorSelectHighlighter +from gui_core.wrap import Menu from mapdisp import statusbar as sb import grass.script as grass @@ -256,7 +257,7 @@ """ gisenv = grass.gisenv() title = _("GRASS GIS Map Display: %(name)s - %(loc)s/%(mapset)s") % { - 'name': str(name), + 'name': name, 'loc': gisenv["LOCATION_NAME"], 'mapset': gisenv["MAPSET"]} @@ -806,7 +807,7 @@ """ Print options and output menu for map display """ - printmenu = wx.Menu() + printmenu = Menu() # Add items to the menu setup = wx.MenuItem(printmenu, wx.ID_ANY, _('Page setup')) printmenu.AppendItem(setup) @@ -998,7 +999,9 @@ """Highlight category from query.""" if len(vectQuery) > 0: self._highlighter_layer.SetLayer(vectQuery[0]['Layer']) - self._highlighter_layer.SetMap(vectQuery[0]['Map']) + self._highlighter_layer.SetMap( + vectQuery[0]['Map'] + '@' + vectQuery[0]['Mapset'] + ) tmp = list() for i in vectQuery: tmp.append(i['Category']) @@ -1060,17 +1063,14 @@ pattern = [ "d.vect", - "map=%s" % - name, - "color=%s" % - colorStr, - "fill_color=%s" % - colorStr, - "width=%d" % - UserSettings.Get( + "map=%s" % name, + "color=%s" % colorStr, + "fill_color=%s" % colorStr, + "width=%d" % UserSettings.Get( group='atm', key='highlight', - subkey='width')] + subkey='width') + ] if icon != '': pattern.append('icon=%s' % icon) if size > 0: @@ -1383,7 +1383,7 @@ def OnZoomMenu(self, event): """Popup Zoom menu """ - zoommenu = wx.Menu() + zoommenu = Menu() for label, handler in ( (_('Zoom to default region'), diff -Nru grass-7.6.1/gui/wxpython/mapdisp/gprint.py grass-7.8.0/gui/wxpython/mapdisp/gprint.py --- grass-7.6.1/gui/wxpython/mapdisp/gprint.py 2019-03-19 19:57:47.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapdisp/gprint.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,7 +19,6 @@ import wx from core.gcmd import GMessage -from core.utils import _ class MapPrint(wx.Printout): diff -Nru grass-7.6.1/gui/wxpython/mapdisp/main.py grass-7.8.0/gui/wxpython/mapdisp/main.py --- grass-7.6.1/gui/wxpython/mapdisp/main.py 2019-03-19 19:58:05.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapdisp/main.py 2019-09-06 09:20:12.000000000 +0000 @@ -30,6 +30,7 @@ import os import sys +import six import time import shutil import fileinput @@ -44,7 +45,6 @@ from core.giface import StandaloneGrassInterface from core.gcmd import RunCommand from core.render import Map, MapLayer, Overlay, RenderMapMgr -from core.utils import _ from mapdisp.frame import MapFrame from core.debug import Debug from core.settings import UserSettings @@ -350,7 +350,7 @@ def __iter__(self): return self - def next(self): + def __next__(self): items = self._map.GetListOfLayers() try: result = items[self._index] @@ -359,6 +359,9 @@ self._index += 1 return result + def next(self): + return self.__next__() + def GetSelectedLayers(self, checkedOnly=True): # hidden and selected vs checked and selected items = self._map.GetListOfLayers() @@ -560,10 +563,12 @@ def OnExit(self): if __name__ == "__main__": # stop the timer - # self.timer.Stop() + if self.timer.IsRunning: + self.timer.Stop() # terminate thread - for f in monFile.itervalues(): + for f in six.itervalues(monFile): try_remove(f) + return True def watcher(self): """Redraw, if new layer appears (check's timestamp of diff -Nru grass-7.6.1/gui/wxpython/mapdisp/statusbar.py grass-7.8.0/gui/wxpython/mapdisp/statusbar.py --- grass-7.6.1/gui/wxpython/mapdisp/statusbar.py 2019-03-19 19:57:46.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapdisp/statusbar.py 2019-06-03 20:34:20.000000000 +0000 @@ -37,17 +37,18 @@ from core import utils from core.gcmd import GMessage, RunCommand from core.settings import UserSettings -from core.utils import _ +from gui_core.wrap import StaticText, TextCtrl from grass.script import core as grass from grass.pydispatch.signal import Signal -class SbException: +class SbException(Exception): """Exception class used in SbManager and SbItems""" def __init__(self, message): +# Exception.__init__(self, message) self.message = message def __str__(self): @@ -676,9 +677,9 @@ self.name = 'goto' self.label = _("Go to") - self.widget = wx.TextCtrl(parent=self.statusbar, id=wx.ID_ANY, - value="", style=wx.TE_PROCESS_ENTER, - size=(300, -1)) + self.widget = TextCtrl(parent=self.statusbar, id=wx.ID_ANY, + value="", style=wx.TE_PROCESS_ENTER, + size=(300, -1)) self.widget.Hide() @@ -867,7 +868,7 @@ SbItem.__init__(self, mapframe, statusbar, position) self.name = 'mask' - self.widget = wx.StaticText( + self.widget = StaticText( parent=self.statusbar, id=wx.ID_ANY, label=_('MASK')) diff -Nru grass-7.6.1/gui/wxpython/mapdisp/test_mapdisp.py grass-7.8.0/gui/wxpython/mapdisp/test_mapdisp.py --- grass-7.6.1/gui/wxpython/mapdisp/test_mapdisp.py 2019-03-19 19:58:05.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapdisp/test_mapdisp.py 2019-08-11 09:05:20.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -58,7 +58,6 @@ from grass.script.setup import set_gui_path set_gui_path() -from core.utils import _ from core.settings import UserSettings from core.globalvar import CheckWxVersion from core.giface import StandaloneGrassInterface @@ -67,6 +66,7 @@ from core.render import Map from rlisetup.sampling_frame import RLiSetupMapPanel from mapdisp.main import LayerList +from gui_core.wrap import StaticText class MapdispGrassInterface(StandaloneGrassInterface): @@ -102,7 +102,7 @@ self._cf = wx.Frame(parent=parent, title=title) self._cp = wx.Panel(parent=self._cf, id=wx.ID_ANY) self._cs = wx.BoxSizer(wx.VERTICAL) - self._cl = wx.StaticText( + self._cl = StaticText( parent=self._cp, id=wx.ID_ANY, label="No text set yet") diff -Nru grass-7.6.1/gui/wxpython/mapdisp/toolbars.py grass-7.8.0/gui/wxpython/mapdisp/toolbars.py --- grass-7.6.1/gui/wxpython/mapdisp/toolbars.py 2019-03-19 19:57:47.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapdisp/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -22,7 +22,6 @@ from nviz.main import haveNviz from vdigit.main import haveVDigit from icons.icon import MetaIcon -from core.utils import _ MapIcons = { 'query': MetaIcon(img='info', diff -Nru grass-7.6.1/gui/wxpython/mapswipe/dialogs.py grass-7.8.0/gui/wxpython/mapswipe/dialogs.py --- grass-7.6.1/gui/wxpython/mapswipe/dialogs.py 2019-03-19 19:57:16.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapswipe/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,14 +20,13 @@ import wx.lib.colourselect as csel from core import globalvar -from core.utils import _ from gui_core import gselect from gui_core.widgets import SimpleValidator from gui_core.preferences import PreferencesBaseDialog from core.gcmd import GMessage from core.layerlist import LayerList from core.settings import UserSettings -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox from gui_core.simplelmgr import SimpleLayerManager, SIMPLE_LMGR_RASTER, \ SIMPLE_LMGR_VECTOR, SIMPLE_LMGR_RGB, SIMPLE_LMGR_TB_LEFT, SIMPLE_LMGR_TB_RIGHT @@ -60,10 +59,10 @@ self._firstPanel = self._createSimplePanel() self._secondPanel = self._createAdvancedPanel() - self.btnSwitch = wx.Button(self) - self.btnCancel = wx.Button(self, id=wx.ID_CANCEL) - self.btnApply = wx.Button(self, id=wx.ID_APPLY) - self.btnOK = wx.Button(self, id=wx.ID_OK) + self.btnSwitch = Button(self) + self.btnCancel = Button(self, id=wx.ID_CANCEL) + self.btnApply = Button(self, id=wx.ID_APPLY) + self.btnOK = Button(self, id=wx.ID_OK) self.btnOK.SetDefault() self.btnSwitch.Bind(wx.EVT_BUTTON, self.OnSwitchMode) @@ -81,6 +80,10 @@ self._layout() + def UnInit(self): + self._firstLmgr.UnInit() + self._secondLmgr.UnInit() + def _layout(self): """Do layout""" mainSizer = wx.BoxSizer(wx.VERTICAL) @@ -125,7 +128,7 @@ validator=SimpleValidator( callback=self.ValidatorCallback)) sizer.Add( - wx.StaticText( + StaticText( panel, label=_("Name of top/left raster map:")), proportion=0, @@ -134,7 +137,7 @@ sizer.Add(self._firstRaster, proportion=0, flag=wx.EXPAND | wx.ALL, border=1) sizer.Add( - wx.StaticText( + StaticText( panel, label=_("Name of bottom/right raster map:")), proportion=0, @@ -269,13 +272,13 @@ notebook.AddPage(page=panel, text=_("Mirror mode")) border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, label=" %s " % _("Mirrored cursor")) + box = StaticBox(parent=panel, label=" %s " % _("Mirrored cursor")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) row = 0 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, label=_("Color:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, @@ -296,7 +299,7 @@ row += 1 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, label=_("Shape:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, @@ -322,7 +325,7 @@ row += 1 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, label=_("Line width:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, @@ -345,7 +348,7 @@ row += 1 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, label=_("Size:")), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, diff -Nru grass-7.6.1/gui/wxpython/mapswipe/frame.py grass-7.8.0/gui/wxpython/mapswipe/frame.py --- grass-7.6.1/gui/wxpython/mapswipe/frame.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapswipe/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -29,7 +29,6 @@ from mapdisp import statusbar as sb from core.debug import Debug from core.gcmd import GError, GMessage -from core.utils import _ from core.layerlist import LayerListToRendererConverter from gui_core.query import QueryDialog, PrepareQueryResults @@ -766,6 +765,8 @@ def OnCloseWindow(self, event): self.GetFirstMap().Clean() self.GetSecondMap().Clean() + self._mgr.UnInit() + self._inputDialog.UnInit() self.Destroy() diff -Nru grass-7.6.1/gui/wxpython/mapswipe/g.gui.mapswipe.py grass-7.8.0/gui/wxpython/mapswipe/g.gui.mapswipe.py --- grass-7.6.1/gui/wxpython/mapswipe/g.gui.mapswipe.py 2019-03-19 19:57:12.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapswipe/g.gui.mapswipe.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: Map Swipe @@ -59,7 +59,6 @@ from core.settings import UserSettings from core.globalvar import CheckWxVersion from core.giface import StandaloneGrassInterface - from core.utils import _ from mapswipe.frame import SwipeMapFrame driver = UserSettings.Get(group='display', key='driver', subkey='type') diff -Nru grass-7.6.1/gui/wxpython/mapswipe/mapwindow.py grass-7.8.0/gui/wxpython/mapswipe/mapwindow.py --- grass-7.6.1/gui/wxpython/mapswipe/mapwindow.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapswipe/mapwindow.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,9 +20,9 @@ import wx from core.debug import Debug -from core.utils import _ from core.settings import UserSettings from mapwin.buffered import BufferedMapWindow +from gui_core.wrap import Rect EVT_MY_MOUSE_EVENTS = wx.NewEventType() @@ -52,8 +52,8 @@ def _bindMouseEvents(self): """Binds wx mouse events and custom mouse events""" - wx.EVT_MOUSE_EVENTS(self, self._mouseActions) - wx.EVT_MOTION(self, self._mouseMotion) + self.Bind(wx.EVT_MOUSE_EVENTS, self._mouseActions) + self.Bind(wx.EVT_MOTION, self._mouseMotion) self.Bind(EVT_MOTION, self.OnMotion) self.Bind(EVT_MOUSE_EVENTS, self.MouseActions) self.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu) @@ -174,7 +174,7 @@ def SetRasterNameText(self, name, textId): """Sets text label with map name.""" - self.textdict[textId] = {'bbox': wx.Rect(), 'coords': [10, 10], + self.textdict[textId] = {'bbox': Rect(), 'coords': [10, 10], 'font': self.GetFont(), 'color': wx.BLACK, 'background': wx.LIGHT_GREY, 'rotation': 0, 'text': name, diff -Nru grass-7.6.1/gui/wxpython/mapswipe/toolbars.py grass-7.8.0/gui/wxpython/mapswipe/toolbars.py --- grass-7.6.1/gui/wxpython/mapswipe/toolbars.py 2019-03-19 19:57:12.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapswipe/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,8 +19,8 @@ import wx from gui_core.toolbars import BaseToolbar, BaseIcons +from gui_core.wrap import Menu from icons.icon import MetaIcon -from core.utils import _ swipeIcons = { @@ -148,7 +148,7 @@ def OnToolMenu(self, event): """Menu for additional tools""" - toolMenu = wx.Menu() + toolMenu = Menu() for label, itype, handler, desc in ( (_("Switch orientation"), diff -Nru grass-7.6.1/gui/wxpython/mapwin/analysis.py grass-7.8.0/gui/wxpython/mapwin/analysis.py --- grass-7.6.1/gui/wxpython/mapwin/analysis.py 2019-03-19 19:57:47.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapwin/analysis.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,7 +21,6 @@ import math import wx -from core.utils import _ import core.units as units from core.gcmd import RunCommand from core.giface import Notification diff -Nru grass-7.6.1/gui/wxpython/mapwin/base.py grass-7.8.0/gui/wxpython/mapwin/base.py --- grass-7.6.1/gui/wxpython/mapwin/base.py 2019-03-19 19:58:04.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapwin/base.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,10 +20,10 @@ """ import wx +import six from core.settings import UserSettings from core.gcmd import GError -from core.utils import _ from gui_core.wrap import StockCursor from grass.script import core as grass @@ -185,7 +185,7 @@ """Binds helper functions, which calls all handlers registered to events with the events """ - for ev, handlers in self.handlersContainer.iteritems(): + for ev, handlers in six.iteritems(self.handlersContainer): self.Bind(ev, self.EventTypeHandler(handlers)) def EventTypeHandler(self, evHandlers): @@ -255,7 +255,7 @@ """ self.mouseHandlerRegistered.emit() # inserts handler into list - for containerEv, handlers in self.handlersContainer.iteritems(): + for containerEv, handlers in six.iteritems(self.handlersContainer): if event == containerEv: handlers.append(handler) @@ -276,7 +276,7 @@ Before each handler is unregistered it is called with string value "unregistered" of event parameter. """ - for containerEv, handlers in self.handlersContainer.iteritems(): + for containerEv, handlers in six.iteritems(self.handlersContainer): for handler in handlers: try: handler("unregistered") @@ -304,7 +304,7 @@ :return: False if event cannot be unbind """ # removes handler from list - for containerEv, handlers in self.handlersContainer.iteritems(): + for containerEv, handlers in six.iteritems(self.handlersContainer): if event != containerEv: continue try: diff -Nru grass-7.6.1/gui/wxpython/mapwin/buffered.py grass-7.8.0/gui/wxpython/mapwin/buffered.py --- grass-7.6.1/gui/wxpython/mapwin/buffered.py 2019-03-19 19:58:04.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapwin/buffered.py 2019-06-03 20:34:20.000000000 +0000 @@ -37,12 +37,13 @@ import grass.script as grass from gui_core.dialogs import SavedRegion -from gui_core.wrap import DragImage, PseudoDC, EmptyBitmap, BitmapFromImage, Window +from gui_core.wrap import DragImage, PseudoDC, EmptyBitmap, BitmapFromImage, \ + Window, Menu, Rect from core.gcmd import RunCommand, GException, GError, GMessage from core.debug import Debug from core.settings import UserSettings from mapwin.base import MapWindowBase -from core.utils import GetGEventAttribsForHandler, _ +from core.utils import GetGEventAttribsForHandler import core.utils as utils from mapwin.graphics import GraphicsSet from core.gthread import gThread @@ -243,7 +244,7 @@ return # generate popup-menu - menu = wx.Menu() + menu = Menu() if not hasattr(self, "popupCopyCoordinates"): self.popupCopyCoordinates = wx.NewId() @@ -275,7 +276,7 @@ pos = self.ScreenToClient(event.GetPosition()) idlist = self.pdc.FindObjects(pos[0], pos[1], self.hitradius) - if self.overlays and idlist and [i for i in idlist if i in self.overlays.keys()]: # legend, scale bar, north arrow, dtext + if self.overlays and idlist and [i for i in idlist if i in list(self.overlays.keys())]: # legend, scale bar, north arrow, dtext menu.AppendSeparator() removeId = wx.NewId() self.Bind(wx.EVT_MENU, @@ -349,7 +350,7 @@ bitmap, coords[0], coords[1], True) # draw the composite map - pdc.SetIdBounds(drawid, wx.Rect(coords[0], coords[1], w, h)) + pdc.SetIdBounds(drawid, Rect(coords[0], coords[1], w, h)) elif pdctype == 'box': # draw a box on top of the map if pen: @@ -363,7 +364,7 @@ y1 = min(coords[1], coords[3]) rwidth = x2 - x1 rheight = y2 - y1 - rect = wx.Rect(x1, y1, rwidth, rheight) + rect = Rect(x1, y1, rwidth, rheight) pdc.DrawRectangleRect(rect) pdc.SetIdBounds(drawid, rect) @@ -376,7 +377,7 @@ coords[0], coords[1]), wx.Point( coords[2], coords[3])) pdc.SetIdBounds( - drawid, wx.Rect( + drawid, Rect( coords[0], coords[1], coords[2], @@ -426,7 +427,7 @@ x2 = max(xlist) y1 = min(ylist) y2 = max(ylist) - pdc.SetIdBounds(drawid, wx.Rect(x1, y1, x2, y2)) + pdc.SetIdBounds(drawid, Rect(x1, y1, x2, y2)) elif pdctype == 'polygon': if pen: @@ -439,7 +440,7 @@ y = min(coords, key=lambda x: x[1])[1] w = max(coords, key=lambda x: x[0])[0] - x h = max(coords, key=lambda x: x[1])[1] - y - pdc.SetIdBounds(drawid, wx.Rect(x, y, w, h)) + pdc.SetIdBounds(drawid, Rect(x, y, w, h)) elif pdctype == 'circle': # draw circle if pen: @@ -454,7 +455,7 @@ coords[3]) - radius, radius=radius) pdc.SetIdBounds( - drawid, wx.Rect( + drawid, Rect( coords[0], coords[1], coords[2], @@ -468,7 +469,7 @@ coords[1] - 5, coords[0] + 5, coords[1] + 5) - pdc.SetIdBounds(drawid, wx.Rect(coordsBound)) + pdc.SetIdBounds(drawid, Rect(coordsBound)) elif pdctype == 'text': # draw text on top of map if not img['active']: @@ -516,7 +517,7 @@ rotation = 0.0 coords = textinfo['coords'] - bbox = wx.Rect(coords[0], coords[1], 0, 0) + bbox = Rect(coords[0], coords[1], 0, 0) relCoords = (0, 0) Debug.msg(4, "BufferedWindow.TextBounds(): text=%s, rotation=%f" % (textinfo['text'], rotation)) @@ -612,7 +613,7 @@ # store buffered image # self.bufferLast = wx.BitmapFromImage(self.buffer.ConvertToImage()) self.bufferLast = dc.GetAsBitmap( - wx.Rect(0, 0, self.Map.width, self.Map.height)) + Rect(0, 0, self.Map.width, self.Map.height)) self.pdc.DrawBitmap(self.bufferLast, 0, 0, False) self.pdc.DrawToDC(dc) @@ -715,7 +716,7 @@ renderMgr = self.Map.GetRenderMgr() renderMgr.renderDone.disconnect(self._saveToFileDone) - ibuffer = wx.EmptyBitmap( + ibuffer = EmptyBitmap( max(1, self.Map.width), max(1, self.Map.height)) @@ -739,7 +740,7 @@ pdctype=self.overlays[id].pdcType, coords=coords) # redraw text labels - for id in self.textdict.keys(): + for id in list(self.textdict.keys()): textinfo = self.textdict[id] oldCoords = textinfo['coords'] textinfo['coords'] = ratio[0] * textinfo['coords'][0],\ @@ -783,7 +784,7 @@ overlay.mapfile): img = utils.autoCropImageFromFile(overlay.mapfile) - for key in self.imagedict.keys(): + for key in list(self.imagedict.keys()): if self.imagedict[key]['id'] == overlay.id: del self.imagedict[key] @@ -807,7 +808,7 @@ else: img = None - for key in self.imagedict.keys(): + for key in list(self.imagedict.keys()): if self.imagedict[key]['id'] == imgId: del self.imagedict[key] @@ -967,7 +968,7 @@ pdctype=self.overlays[id].pdcType, coords=self.overlays[id].coords) - for id in self.textdict.keys(): + for id in list(self.textdict.keys()): self.Draw(self.pdc, img=self.textdict[id], drawid=id, pdctype='text', coords=[10, 10, 10, 10]) @@ -1066,7 +1067,7 @@ r = self.pdc.GetIdBounds(id) if isinstance(r, list): - r = wx.Rect(r[0], r[1], r[2], r[3]) + r = Rect(r[0], r[1], r[2], r[3]) if id in self.textdict: # text dragging rtop = (r[0], r[1] - r[3], r[2], r[3]) r = r.Union(rtop) @@ -1077,7 +1078,7 @@ r2 = self.pdc.GetIdBounds(id) if isinstance(r2, list): - r2 = wx.Rect(r[0], r[1], r[2], r[3]) + r2 = Rect(r[0], r[1], r[2], r[3]) if id in self.textdict: # text self.textdict[id]['bbox'] = r2 self.textdict[id]['coords'][0] += dx @@ -1111,7 +1112,7 @@ end[0], end[1]] r = pdc.GetIdBounds(boxid) if isinstance(r, list): - r = wx.Rect(r[0], r[1], r[2], r[3]) + r = Rect(r[0], r[1], r[2], r[3]) r.Inflate(4, 4) try: pdc.ClearId(boxid) @@ -1129,7 +1130,7 @@ x2 = max(begin[0], end[0]) y1 = min(begin[1], end[1]) y2 = max(begin[1], end[1]) - r = wx.Rect(x1, y1, x2 - x1, y2 - y1) + r = Rect(x1, y1, x2 - x1, y2 - y1) r.Inflate(4, 4) try: pdc.ClearId(self.lineid) @@ -1557,7 +1558,7 @@ self._onLeftUp(event) elif (self.mouse['use'] == 'pointer' and - self.dragid >= 0): + self.dragid and int(self.dragid) >= 0): # end drag of overlay decoration if self.overlays and self.dragid in self.overlays: @@ -1689,7 +1690,7 @@ pos = event.GetPosition() idlist = self.pdc.FindObjects(pos[0], pos[1], self.hitradius) - if self.overlays and idlist and [i for i in idlist if i in self.overlays.keys()]: # legend, scale bar, north arrow, dtext + if self.overlays and idlist and [i for i in idlist if i in list(self.overlays.keys())]: # legend, scale bar, north arrow, dtext self.SetToolTip("Double click in Pointer mode to set object" " properties,\nright click to remove") else: diff -Nru grass-7.6.1/gui/wxpython/mapwin/decorations.py grass-7.8.0/gui/wxpython/mapwin/decorations.py --- grass-7.6.1/gui/wxpython/mapwin/decorations.py 2019-03-19 19:57:46.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapwin/decorations.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,7 +19,6 @@ """ import os -from core.utils import _ import wx diff -Nru grass-7.6.1/gui/wxpython/mapwin/graphics.py grass-7.8.0/gui/wxpython/mapwin/graphics.py --- grass-7.6.1/gui/wxpython/mapwin/graphics.py 2019-03-19 19:57:47.000000000 +0000 +++ grass-7.8.0/gui/wxpython/mapwin/graphics.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,7 +20,6 @@ import wx -from core.utils import _ class GraphicsSet: diff -Nru grass-7.6.1/gui/wxpython/modules/colorrules.py grass-7.8.0/gui/wxpython/modules/colorrules.py --- grass-7.6.1/gui/wxpython/modules/colorrules.py 2019-03-19 19:57:32.000000000 +0000 +++ grass-7.8.0/gui/wxpython/modules/colorrules.py 2019-06-03 20:34:20.000000000 +0000 @@ -26,6 +26,7 @@ import shutil import copy import tempfile +import six import wx import wx.lib.colourselect as csel @@ -37,7 +38,6 @@ from core import globalvar from core import utils -from core.utils import _ from core.gcmd import GMessage, RunCommand, GError from gui_core.gselect import Select, LayerSelect, ColumnSelect, VectorDBInfo from core.render import Map @@ -45,7 +45,8 @@ from core.debug import Debug as Debug from core.settings import UserSettings from gui_core.widgets import ColorTablesComboBox -from gui_core.wrap import SpinCtrl, PseudoDC +from gui_core.wrap import SpinCtrl, PseudoDC, TextCtrl, Button, StaticText, \ + StaticBox, EmptyBitmap class RulesPanel: @@ -79,12 +80,12 @@ self.checkAll = wx.CheckBox(parent, id=wx.ID_ANY, label=_("Check all")) self.checkAll.SetValue(True) # clear button - self.clearAll = wx.Button(parent, id=wx.ID_ANY, label=_("Clear all")) + self.clearAll = Button(parent, id=wx.ID_ANY, label=_("Clear all")) # determines how many rules should be added self.numRules = SpinCtrl(parent, id=wx.ID_ANY, min=1, max=1e6, initial=1) # add rules - self.btnAdd = wx.Button(parent, id=wx.ID_ADD) + self.btnAdd = Button(parent, id=wx.ID_ADD) self.btnAdd.Bind(wx.EVT_BUTTON, self.OnAddRules) self.checkAll.Bind(wx.EVT_CHECKBOX, self.OnCheckAll) @@ -133,11 +134,11 @@ enable.SetName('enable') enable.Bind(wx.EVT_CHECKBOX, self.OnRuleEnable) # value - txt_ctrl = wx.TextCtrl(parent=self.mainPanel, id=1000 + num, + txt_ctrl = TextCtrl(parent=self.mainPanel, id=1000 + num, size=(80, -1), style=wx.TE_NOHIDESEL) if self.mapType == 'vector': - txt_ctrl.SetToolTipString(_("Enter vector attribute values")) + txt_ctrl.SetToolTip(_("Enter vector attribute values")) txt_ctrl.Bind(wx.EVT_TEXT, self.OnRuleValue) txt_ctrl.SetName('source') if self.attributeType == 'color': @@ -413,8 +414,8 @@ maplabel = _('Select raster map:') else: maplabel = _('Select vector map:') - inputBox = wx.StaticBox(parent, id=wx.ID_ANY, - label=" %s " % maplabel) + inputBox = StaticBox(parent, id=wx.ID_ANY, + label=" %s " % maplabel) inputSizer = wx.StaticBoxSizer(inputBox, wx.VERTICAL) self.selectionInput = Select(parent=parent, id=wx.ID_ANY, @@ -430,7 +431,7 @@ def _createFileSelection(self, parent): """Create file (open/save rules) selection part of dialog""" - inputBox = wx.StaticBox( + inputBox = StaticBox( parent, id=wx.ID_ANY, label=" %s " % _("Import or export color table:")) inputSizer = wx.StaticBoxSizer(inputBox, wx.HORIZONTAL) @@ -459,7 +460,7 @@ size=globalvar.DIALOG_COMBOBOX_SIZE, choices=utils.GetColorTables(), name="colorTableChoice") - self.btnSet = wx.Button( + self.btnSet = Button( parent=parent, id=wx.ID_ANY, label=_("&Set"), @@ -470,12 +471,12 @@ # layout gridSizer = wx.GridBagSizer(hgap=2, vgap=2) - gridSizer.Add(wx.StaticText(parent, label=_("Load color table:")), + gridSizer.Add(StaticText(parent, label=_("Load color table:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add(colorTable, pos=(0, 1)) gridSizer.Add(self.btnSet, pos=(0, 2), flag=wx.ALIGN_RIGHT) gridSizer.Add( - wx.StaticText( + StaticText( parent, label=_('Load color table from file:')), pos=( 1, 0), flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( @@ -483,7 +484,7 @@ 1, 1), span=( 1, 2), flag=wx.EXPAND) gridSizer.Add( - wx.StaticText( + StaticText( parent, label=_('Save color table to file:')), pos=( 2, 0), flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( @@ -511,12 +512,12 @@ def _createButtons(self, parent): """Create buttons for leaving dialog""" - self.btnHelp = wx.Button(parent, id=wx.ID_HELP) - self.btnCancel = wx.Button(parent, id=wx.ID_CANCEL) - self.btnApply = wx.Button(parent, id=wx.ID_APPLY) - self.btnOK = wx.Button(parent, id=wx.ID_OK) - self.btnDefault = wx.Button(parent, id=wx.ID_ANY, - label=_("Reload default table")) + self.btnHelp = Button(parent, id=wx.ID_HELP) + self.btnCancel = Button(parent, id=wx.ID_CANCEL) + self.btnApply = Button(parent, id=wx.ID_APPLY) + self.btnOK = Button(parent, id=wx.ID_OK) + self.btnDefault = Button(parent, id=wx.ID_ANY, + label=_("Reload default table")) self.btnOK.SetDefault() self.btnOK.Enable(False) @@ -545,7 +546,7 @@ row = 0 # label with range - self.cr_label = wx.StaticText(parent, id=wx.ID_ANY) + self.cr_label = StaticText(parent, id=wx.ID_ANY) bodySizer.Add(self.cr_label, pos=(row, 0), span=(1, 3), flag=wx.ALL, border=5) @@ -578,12 +579,12 @@ bodySizer.Add(self.rulesPanel.clearAll, pos=(row, 1)) # preview button - self.btnPreview = wx.Button(parent, id=wx.ID_ANY, + self.btnPreview = Button(parent, id=wx.ID_ANY, label=_("Preview")) bodySizer.Add(self.btnPreview, pos=(row, 2), flag=wx.ALIGN_RIGHT) self.btnPreview.Enable(False) - self.btnPreview.SetToolTipString( + self.btnPreview.SetToolTip( _("Show preview of map " "(current Map Display extent is used).")) row += 1 @@ -682,7 +683,7 @@ return rulestxt = '' - for rule in self.rulesPanel.ruleslines.itervalues(): + for rule in six.itervalues(self.rulesPanel.ruleslines): if 'value' not in rule: continue rulestxt += rule['value'] + ' ' + rule['color'] + '\n' @@ -793,7 +794,7 @@ """ rulestxt = '' - for rule in self.rulesPanel.ruleslines.itervalues(): + for rule in six.itervalues(self.rulesPanel.ruleslines): if 'value' not in rule: # skip empty rules continue @@ -1105,12 +1106,12 @@ def _createVectorAttrb(self, parent): """Create part of dialog with layer/column selection""" - inputBox = wx.StaticBox(parent=parent, id=wx.ID_ANY, - label=" %s " % _("Select vector columns")) - cb_vl_label = wx.StaticText(parent, id=wx.ID_ANY, - label=_('Layer:')) - cb_vc_label = wx.StaticText(parent, id=wx.ID_ANY, - label=_('Attribute column:')) + inputBox = StaticBox(parent=parent, id=wx.ID_ANY, + label=" %s " % _("Select vector columns")) + cb_vl_label = StaticText(parent, id=wx.ID_ANY, + label=_('Layer:')) + cb_vc_label = StaticText(parent, id=wx.ID_ANY, + label=_('Attribute column:')) if self.attributeType == 'color': labels = [_("Load color from column:"), _("Save color to column:")] @@ -1125,19 +1126,19 @@ label=_("Use color column instead of color table:")) self.useColumn.Bind(wx.EVT_CHECKBOX, self.OnCheckColumn) - fromColumnLabel = wx.StaticText(parent, id=wx.ID_ANY, - label=labels[0]) - toColumnLabel = wx.StaticText(parent, id=wx.ID_ANY, - label=labels[1]) + fromColumnLabel = StaticText(parent, id=wx.ID_ANY, + label=labels[0]) + toColumnLabel = StaticText(parent, id=wx.ID_ANY, + label=labels[1]) - self.rgb_range_label = wx.StaticText(parent, id=wx.ID_ANY) + self.rgb_range_label = StaticText(parent, id=wx.ID_ANY) self.layerSelect = LayerSelect(parent) self.sourceColumn = ColumnSelect(parent) self.fromColumn = ColumnSelect(parent) self.toColumn = ColumnSelect(parent) - self.addColumn = wx.Button(parent, id=wx.ID_ANY, + self.addColumn = Button(parent, id=wx.ID_ANY, label=_('Add column')) - self.addColumn.SetToolTipString( + self.addColumn.SetToolTip( _("Add GRASSRGB column to current attribute table.")) # layout @@ -1808,7 +1809,7 @@ """ rulestxt = '' - for rule in self.rulesPanel.ruleslines.itervalues(): + for rule in six.itervalues(self.rulesPanel.ruleslines): if 'value' not in rule: # skip empty rules break @@ -1991,7 +1992,7 @@ def OnPaint(self, event): """Draw pseudo DC to buffer""" - self._Buffer = wx.EmptyBitmap(self.Map.width, self.Map.height) + self._Buffer = EmptyBitmap(self.Map.width, self.Map.height) dc = wx.BufferedPaintDC(self, self._Buffer) # use PrepareDC to set position correctly @@ -2019,7 +2020,7 @@ # Make new off screen bitmap: this bitmap will always have the # current drawing in it, so it can be used to save the image to # a file, or whatever. - self._Buffer = wx.EmptyBitmap(self.Map.width, self.Map.height) + self._Buffer = EmptyBitmap(self.Map.width, self.Map.height) # get the image to be rendered self.img = self.GetImage() diff -Nru grass-7.6.1/gui/wxpython/modules/extensions.py grass-7.8.0/gui/wxpython/modules/extensions.py --- grass-7.6.1/gui/wxpython/modules/extensions.py 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/modules/extensions.py 2019-08-12 16:50:46.000000000 +0000 @@ -27,12 +27,13 @@ from core import globalvar from core.gcmd import GError, RunCommand, GException, GMessage -from core.utils import SetAddOnPath, _ +from core.utils import SetAddOnPath from core.gthread import gThread from core.menutree import TreeModel, ModuleNode from gui_core.widgets import GListCtrl, SearchModuleWidget from gui_core.treeview import CTreeView from core.toolboxes import toolboxesOutdated +from gui_core.wrap import Button, StaticBox, TextCtrl, Menu class InstallExtensionWindow(wx.Frame): @@ -53,14 +54,14 @@ self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - # self.repoBox = wx.StaticBox( + # self.repoBox = StaticBox( # parent=self.panel, id=wx.ID_ANY, label=" %s " % # _("Repository (leave empty to use the official one)")) - self.treeBox = wx.StaticBox( + self.treeBox = StaticBox( parent=self.panel, id=wx.ID_ANY, label=" %s " % _("List of extensions - double-click to install")) - # self.repo = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY) + # self.repo = TextCtrl(parent=self.panel, id=wx.ID_ANY) # modelBuilder loads data into tree model self.modelBuilder = ExtensionTreeModelBuilder() @@ -81,8 +82,8 @@ # load data in different thread self.thread = gThread() - self.optionBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _("Options")) + self.optionBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _("Options")) task = gtask.parse_interface('g.extension') ignoreFlags = ['l', 'c', 'g', 'a', 'f', 't', 'help', 'quiet'] if sys.platform == 'win32': @@ -109,18 +110,18 @@ self.statusbar = self.CreateStatusBar(number=1) - # self.btnFetch = wx.Button(parent=self.panel, id=wx.ID_ANY, - # label=_("&Fetch")) - # self.btnFetch.SetToolTipString(_("Fetch list of available modules " - # "from GRASS Addons SVN repository")) - self.btnClose = wx.Button(parent=self.panel, id=wx.ID_CLOSE) - self.btnInstall = wx.Button(parent=self.panel, id=wx.ID_ANY, - label=_("&Install")) - self.btnInstall.SetToolTipString( + # self.btnFetch = Button(parent=self.panel, id=wx.ID_ANY, + # label=_("&Fetch")) + # self.btnFetch.SetToolTip(_("Fetch list of available modules " + # "from GRASS Addons repository")) + self.btnClose = Button(parent=self.panel, id=wx.ID_CLOSE) + self.btnInstall = Button(parent=self.panel, id=wx.ID_ANY, + label=_("&Install")) + self.btnInstall.SetToolTip( _("Install selected add-ons GRASS module")) self.btnInstall.Enable(False) - self.btnHelp = wx.Button(parent=self.panel, id=wx.ID_HELP) - self.btnHelp.SetToolTipString(_("Show g.extension manual page")) + self.btnHelp = Button(parent=self.panel, id=wx.ID_HELP) + self.btnHelp.SetToolTip(_("Show g.extension manual page")) self.btnClose.Bind(wx.EVT_BUTTON, lambda evt: self.Close()) # self.btnFetch.Bind(wx.EVT_BUTTON, self.OnFetch) @@ -208,7 +209,7 @@ """Fetch list of available extensions""" wx.BeginBusyCursor() self.SetStatusText( - _("Fetching list of modules from GRASS-Addons SVN (be patient)..."), 0) + _("Fetching list of modules from GRASS-Addons (be patient)..."), 0) try: self.thread.Run( callable=self.modelBuilder.Load, @@ -234,7 +235,7 @@ data = node.data if data and 'command' in data: - self.popupMenu = wx.Menu() + self.popupMenu = Menu() self.popupMenu.Append(self.popupID['install'], text=_("Install")) self.Bind(wx.EVT_MENU, self.OnInstall, id=self.popupID['install']) self.popupMenu.AppendSeparator() @@ -401,27 +402,27 @@ self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.extBox = wx.StaticBox( + self.extBox = StaticBox( parent=self.panel, id=wx.ID_ANY, label=" %s " % _("List of installed extensions")) self.extList = CheckListExtension(parent=self.panel) # buttons - self.btnUninstall = wx.Button( + self.btnUninstall = Button( parent=self.panel, id=wx.ID_REMOVE, label=_("Uninstall")) - self.btnUninstall.SetToolTipString( + self.btnUninstall.SetToolTip( _("Uninstall selected Addons extensions")) - self.btnUpdate = wx.Button( + self.btnUpdate = Button( parent=self.panel, id=wx.ID_REFRESH, label=_("Reinstall")) - self.btnUpdate.SetToolTipString( + self.btnUpdate.SetToolTip( _("Reinstall selected Addons extensions")) - self.btnClose = wx.Button(parent=self.panel, id=wx.ID_CLOSE) + self.btnClose = Button(parent=self.panel, id=wx.ID_CLOSE) self.btnUninstall.Bind(wx.EVT_BUTTON, self.OnUninstall) self.btnUpdate.Bind(wx.EVT_BUTTON, self.OnUpdate) diff -Nru grass-7.6.1/gui/wxpython/modules/histogram.py grass-7.8.0/gui/wxpython/modules/histogram.py --- grass-7.6.1/gui/wxpython/modules/histogram.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/modules/histogram.py 2019-06-03 20:34:20.000000000 +0000 @@ -26,13 +26,13 @@ from core.render import Map from gui_core.forms import GUI from mapdisp.gprint import PrintOptions -from core.utils import GetLayerNameFromCmd, _ +from core.utils import GetLayerNameFromCmd from gui_core.dialogs import GetImageHandlers, ImageSizeDialog from gui_core.preferences import DefaultFontDialog from core.debug import Debug from core.gcmd import GError from gui_core.toolbars import BaseToolbar, BaseIcons -from gui_core.wrap import PseudoDC +from gui_core.wrap import PseudoDC, Menu, EmptyBitmap class BufferedWindow(wx.Window): @@ -80,7 +80,7 @@ self.pdc = PseudoDC() # will store an off screen empty bitmap for saving to file - self._buffer = wx.EmptyBitmap( + self._buffer = EmptyBitmap( max(1, self.Map.width), max(1, self.Map.height)) @@ -160,7 +160,7 @@ # Make new off screen bitmap: this bitmap will always have the # current drawing in it, so it can be used to save the image to # a file, or whatever. - self._buffer = wx.EmptyBitmap(self.Map.width, self.Map.height) + self._buffer = EmptyBitmap(self.Map.width, self.Map.height) # get the image to be rendered self.img = self.GetImage() @@ -193,7 +193,7 @@ wx.Yield() self.Map.ChangeMapSize((width, height)) - ibuffer = wx.EmptyBitmap(max(1, width), max(1, height)) + ibuffer = EmptyBitmap(max(1, width), max(1, height)) self.Map.Render(force=True, windres=True) img = self.GetImage() self.Draw(self.pdc, img, drawid=99) @@ -496,7 +496,7 @@ """Print options and output menu """ point = wx.GetMousePosition() - printmenu = wx.Menu() + printmenu = Menu() # Add items to the menu setup = wx.MenuItem(printmenu, id=wx.ID_ANY, text=_('Page setup')) printmenu.AppendItem(setup) diff -Nru grass-7.6.1/gui/wxpython/modules/import_export.py grass-7.8.0/gui/wxpython/modules/import_export.py --- grass-7.6.1/gui/wxpython/modules/import_export.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/modules/import_export.py 2019-06-03 20:34:20.000000000 +0000 @@ -40,8 +40,8 @@ from gui_core.forms import CmdPanel from gui_core.gselect import OgrTypeSelect, GdalSelect, SubGroupSelect from gui_core.widgets import LayersList, GListCtrl, GNotebook -from gui_core.wrap import Button -from core.utils import GetValidLayerName, _ +from gui_core.wrap import Button, StaticText, StaticBox +from core.utils import GetValidLayerName from core.settings import UserSettings, GetDisplayVectSettings @@ -64,7 +64,7 @@ self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.layerBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY) + self.layerBox = StaticBox(parent=self.panel, id=wx.ID_ANY) if self.importType == 'gdal': label = _("List of raster layers") elif self.importType == 'ogr': @@ -869,7 +869,7 @@ columns = [_('Layer id'), _('Name for output GRASS map')] - self.layerBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY) + self.layerBox = StaticBox(parent=self.panel, id=wx.ID_ANY) self.layerSizer = wx.StaticBoxSizer(self.layerBox, wx.HORIZONTAL) self.list = GListCtrl(parent=self.panel) @@ -884,7 +884,7 @@ self.list.LoadData(data) - self.labelText = wx.StaticText(parent=self.panel, id=wx.ID_ANY, label=_( + self.labelText = StaticText(parent=self.panel, id=wx.ID_ANY, label=_( "Projection of following layers do not match with projection of current location. ")) label = _("Layers to be reprojected") @@ -895,7 +895,7 @@ # buttons # # cancel - self.btn_close = wx.Button(parent=self.panel, id=wx.ID_CANCEL) + self.btn_close = Button(parent=self.panel, id=wx.ID_CANCEL) # run self.btn_run = Button( diff -Nru grass-7.6.1/gui/wxpython/modules/mapsets_picker.py grass-7.8.0/gui/wxpython/modules/mapsets_picker.py --- grass-7.6.1/gui/wxpython/modules/mapsets_picker.py 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/modules/mapsets_picker.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import wx @@ -6,7 +6,6 @@ set_gui_path() from core.gcmd import RunCommand -from core.utils import _ from gui_core.preferences import MapsetAccess diff -Nru grass-7.6.1/gui/wxpython/modules/mcalc_builder.py grass-7.8.0/gui/wxpython/modules/mcalc_builder.py --- grass-7.6.1/gui/wxpython/modules/mcalc_builder.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/modules/mcalc_builder.py 2019-06-03 20:34:20.000000000 +0000 @@ -25,11 +25,11 @@ from core import globalvar from core.gcmd import GError, RunCommand from core.giface import StandaloneGrassInterface -from core.utils import _ from gui_core.gselect import Select from gui_core.forms import GUI from gui_core.widgets import IntegerValidator -from gui_core.wrap import Button, TextCtrl +from gui_core.wrap import Button, TextCtrl, StaticText, \ + StaticBox from core.settings import UserSettings @@ -138,14 +138,14 @@ # from selection self.lastMapName = '' - self.operatorBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _('Operators')) - self.outputBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _('Output')) - self.operandBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _('Operands')) - self.expressBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=" %s " % _('Expression')) + self.operatorBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _('Operators')) + self.outputBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _('Output')) + self.operandBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _('Operands')) + self.expressBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=" %s " % _('Expression')) # # Buttons @@ -244,14 +244,14 @@ # # Text area # - self.text_mcalc = wx.TextCtrl( + self.text_mcalc = TextCtrl( parent=self.panel, id=wx.ID_ANY, size=(-1, 75), style=wx.TE_MULTILINE) wx.CallAfter(self.text_mcalc.SetFocus) # # Map and function insertion text and ComboBoxes - self.newmaplabel = wx.StaticText(parent=self.panel, id=wx.ID_ANY) + self.newmaplabel = StaticText(parent=self.panel, id=wx.ID_ANY) if self.rast3d: self.newmaplabel.SetLabel( _('Name for new 3D raster map to create')) @@ -263,7 +263,7 @@ parent=self.panel, id=wx.ID_ANY, size=( 250, -1), type=element, multiple=False, fullyQualified=False) - self.mapsellabel = wx.StaticText(parent=self.panel, id=wx.ID_ANY) + self.mapsellabel = StaticText(parent=self.panel, id=wx.ID_ANY) if self.rast3d: self.mapsellabel.SetLabel(_('Insert existing 3D raster map')) else: @@ -271,8 +271,8 @@ self.mapselect = Select( parent=self.panel, id=wx.ID_ANY, size=( 250, -1), type=element, multiple=False) - self.functlabel = wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_('Insert mapcalc function')) + self.functlabel = StaticText(parent=self.panel, id=wx.ID_ANY, + label=_('Insert mapcalc function')) self.function = wx.ComboBox( parent=self.panel, id=wx.ID_ANY, size=(250, -1), choices=sorted(self.funct_dict.keys()), @@ -290,7 +290,7 @@ self.randomSeed = wx.CheckBox( parent=self.panel, label=_("Generate random seed for rand()")) - self.randomSeedStaticText = wx.StaticText( + self.randomSeedStaticText = StaticText( parent=self.panel, label=_("Seed:")) self.randomSeedText = TextCtrl(parent=self.panel, size=(100, -1), validator=IntegerValidator()) diff -Nru grass-7.6.1/gui/wxpython/modules/vclean.py grass-7.8.0/gui/wxpython/modules/vclean.py --- grass-7.6.1/gui/wxpython/modules/vclean.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/modules/vclean.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,10 +21,11 @@ from core.gcmd import RunCommand, GError from core import globalvar -from core.utils import _ from gui_core.gselect import Select from core.settings import UserSettings from grass.script import core as grass +from gui_core.wrap import Button, StaticText, StaticBox, \ + TextCtrl class VectorCleaningFrame(wx.Frame): @@ -122,18 +123,18 @@ self.ctlabel = _('Choose cleaning tools and set thresholds') # top controls - self.inmaplabel = wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_('Select input vector map:')) + self.inmaplabel = StaticText(parent=self.panel, id=wx.ID_ANY, + label=_('Select input vector map:')) self.selectionInput = Select(parent=self.panel, id=wx.ID_ANY, size=globalvar.DIALOG_GSELECT_SIZE, type='vector') self.ftype_check = {} - ftypeBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label=_(' Feature type: ')) + ftypeBox = StaticBox(parent=self.panel, id=wx.ID_ANY, + label=_(' Feature type: ')) self.ftypeSizer = wx.StaticBoxSizer(ftypeBox, wx.HORIZONTAL) - self.outmaplabel = wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_('Select output vector map:')) + self.outmaplabel = StaticText(parent=self.panel, id=wx.ID_ANY, + label=_('Select output vector map:')) self.selectionOutput = Select(parent=self.panel, id=wx.ID_ANY, size=globalvar.DIALOG_GSELECT_SIZE, mapsets=[grass.gisenv()['MAPSET'], ], @@ -150,32 +151,32 @@ subkey='enabled')) # cleaning tools - self.ct_label = wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=self.ctlabel) + self.ct_label = StaticText(parent=self.panel, id=wx.ID_ANY, + label=self.ctlabel) self.ct_panel = self._toolsPanel() # buttons to manage cleaning tools - self.btn_add = wx.Button(parent=self.panel, id=wx.ID_ADD) - self.btn_remove = wx.Button(parent=self.panel, id=wx.ID_REMOVE) - self.btn_moveup = wx.Button(parent=self.panel, id=wx.ID_UP) - self.btn_movedown = wx.Button(parent=self.panel, id=wx.ID_DOWN) + self.btn_add = Button(parent=self.panel, id=wx.ID_ADD) + self.btn_remove = Button(parent=self.panel, id=wx.ID_REMOVE) + self.btn_moveup = Button(parent=self.panel, id=wx.ID_UP) + self.btn_movedown = Button(parent=self.panel, id=wx.ID_DOWN) # add one tool as default self.AddTool() self.selected = -1 # Buttons - self.btn_close = wx.Button(parent=self.panel, id=wx.ID_CLOSE) - self.btn_run = wx.Button( + self.btn_close = Button(parent=self.panel, id=wx.ID_CLOSE) + self.btn_run = Button( parent=self.panel, id=wx.ID_ANY, label=_("&Run")) self.btn_run.SetDefault() - self.btn_clipboard = wx.Button(parent=self.panel, id=wx.ID_COPY) - self.btn_clipboard.SetToolTipString( + self.btn_clipboard = Button(parent=self.panel, id=wx.ID_COPY) + self.btn_clipboard.SetToolTip( _("Copy the current command string to the clipboard (Ctrl+C)")) - self.btn_help = wx.Button(parent=self.panel, id=wx.ID_HELP) + self.btn_help = Button(parent=self.panel, id=wx.ID_HELP) # bindings self.btn_close.Bind(wx.EVT_BUTTON, self.OnClose) @@ -361,7 +362,7 @@ wx.CB_READONLY | wx.TE_PROCESS_ENTER) self.Bind(wx.EVT_COMBOBOX, self.OnSetTool, tool_cbox) # threshold - txt_ctrl = wx.TextCtrl( + txt_ctrl = TextCtrl( parent=self.ct_panel, id=2000 + num, value='0.00', size=(100, -1), style=wx.TE_NOHIDESEL) self.Bind(wx.EVT_TEXT, self.OnThreshValue, txt_ctrl) diff -Nru grass-7.6.1/gui/wxpython/nviz/animation.py grass-7.8.0/gui/wxpython/nviz/animation.py --- grass-7.6.1/gui/wxpython/nviz/animation.py 2019-03-19 19:57:12.000000000 +0000 +++ grass-7.8.0/gui/wxpython/nviz/animation.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,7 +20,6 @@ import wx from grass.pydispatch.signal import Signal -from core.utils import _ class Animation: diff -Nru grass-7.6.1/gui/wxpython/nviz/main.py grass-7.8.0/gui/wxpython/nviz/main.py --- grass-7.6.1/gui/wxpython/nviz/main.py 2019-03-19 19:57:12.000000000 +0000 +++ grass-7.8.0/gui/wxpython/nviz/main.py 2019-06-03 20:34:20.000000000 +0000 @@ -24,7 +24,7 @@ from nviz import mapwindow from nviz import tools from nviz import workspace - import wxnviz + from nviz import wxnviz haveNviz = True except (ImportError, NameError) as err: haveNviz = False diff -Nru grass-7.6.1/gui/wxpython/nviz/mapwindow.py grass-7.8.0/gui/wxpython/nviz/mapwindow.py --- grass-7.6.1/gui/wxpython/nviz/mapwindow.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/nviz/mapwindow.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,10 +20,10 @@ import os import sys +import six import time import copy import math -import types from threading import Thread @@ -43,7 +43,7 @@ from nviz.animation import Animation from nviz import wxnviz from core.globalvar import CheckWxVersion -from core.utils import str2rgb, _ +from core.utils import str2rgb from core.giface import Notification wxUpdateProperties, EVT_UPDATE_PROP = NewEvent() @@ -237,7 +237,7 @@ wx.CallLater(3000, self._warningDepthBuffer) # cplanes cannot be initialized now - wx.CallAfter(self.InitCPlanes) + wx.CallLater(1000, self.InitCPlanes) def _warningDepthBuffer(self): if not self.initView: @@ -483,7 +483,7 @@ and then to textures so that they can be rendered by OpenGL. Updates self.imagelist""" # update images (legend and text) - for oid, overlay in self.overlays.iteritems(): + for oid, overlay in six.iteritems(self.overlays): if not overlay.IsShown() or overlay.name in ('barscale', 'northarrow'): continue if oid not in [t.GetId() for t in self.imagelist]: # new @@ -1484,11 +1484,11 @@ if sec1 == 'position': data[sec][sec1]['update'] = None continue - if isinstance(data[sec][sec1], types.DictType): + if isinstance(data[sec][sec1], dict): for sec2 in data[sec][sec1].keys(): if sec2 not in ('all', 'init', 'id'): data[sec][sec1][sec2]['update'] = None - elif isinstance(data[sec][sec1], types.ListType): + elif isinstance(data[sec][sec1], list): for i in range(len(data[sec][sec1])): for sec2 in data[sec][sec1][i].keys(): data[sec][sec1][i][sec2]['update'] = None @@ -1931,7 +1931,7 @@ elif attrb == 'transp': self._display.UnsetSurfaceTransp(id) else: - if isinstance(value, types.StringType): + if isinstance(value, str): if len(value) == 0: # ignore empty values (TODO: warning) continue if map and not grass.find_file(value, element='cell')[ @@ -2047,7 +2047,7 @@ elif attrb == 'transp': self._display.UnsetIsosurfaceTransp(id, isosurfId) else: - if isinstance(value, types.StringType): + if isinstance(value, str): if len(value) == 0: # ignore empty values (TODO: warning) continue if map and not grass.find_file(value, element='grid3')[ diff -Nru grass-7.6.1/gui/wxpython/nviz/preferences.py grass-7.8.0/gui/wxpython/nviz/preferences.py --- grass-7.6.1/gui/wxpython/nviz/preferences.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/nviz/preferences.py 2019-06-03 20:34:20.000000000 +0000 @@ -24,9 +24,9 @@ from core import globalvar from core.settings import UserSettings -from core.utils import _ from gui_core.preferences import PreferencesBaseDialog -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, CheckBox, StaticText, \ + StaticBox class NvizPreferencesDialog(PreferencesBaseDialog): @@ -58,7 +58,7 @@ self.SetMinSize(self.GetBestSize()) self.SetSize(self.size) - self.btnDefault.SetToolTipString( + self.btnDefault.SetToolTip( _("Revert settings to default, changes are not applied")) def _createViewPage(self, notebook): @@ -70,8 +70,8 @@ pageSizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("View"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("View"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) row = 0 @@ -82,11 +82,11 @@ key='view', subkey='persp', settings_type='internal') - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Perspective:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Perspective:")), pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("value:")), pos=( row, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -99,7 +99,7 @@ flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("step:")), pos=( row, 3), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -114,11 +114,11 @@ # position posvals = UserSettings.Get(group='nviz', key='view', subkey='position') - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Position:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Position:")), pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("x:")), pos=( row, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -131,7 +131,7 @@ flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label="y:"), pos=( row, 3), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -153,11 +153,11 @@ key='view', subkey='twist', settings_type='internal') - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Twist:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Twist:")), pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("value:")), pos=( row, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -172,11 +172,11 @@ # z-exag zvals = UserSettings.Get(group='nviz', key='view', subkey='z-exag') - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Z-exag:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Z-exag:")), pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("value:")), pos=( row, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -194,14 +194,14 @@ flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM, border=3) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Image Appearance"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Image Appearance"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) # background color - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Background color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Background color:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) color = csel.ColourSelect( @@ -237,14 +237,14 @@ text=" %s " % _("Fly-through")) pageSizer = wx.BoxSizer(wx.VERTICAL) # fly throuhg mode - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Fly-through mode"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Fly-through mode"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) # move exag - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Move exag:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Move exag:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) moveExag = SpinCtrl( @@ -256,8 +256,8 @@ gridSizer.Add(moveExag, pos=(0, 1)) # turn exag - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Turn exag:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Turn exag:")), pos=(1, 0), flag=wx.ALIGN_CENTER_VERTICAL) turnExag = SpinCtrl( @@ -288,19 +288,19 @@ pageSizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Light"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Light"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) # position posvals = UserSettings.Get( group='nviz', key='light', subkey='position') - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Position:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Position:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("x:")), pos=( 0, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -313,7 +313,7 @@ flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label="y:"), pos=( 0, 3), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -326,7 +326,7 @@ flag=wx.ALIGN_CENTER_VERTICAL) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("z:")), pos=( 0, 5), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -341,8 +341,8 @@ # brightness brightval = UserSettings.Get( group='nviz', key='light', subkey='bright') - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Brightness:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Brightness:")), pos=(1, 0), flag=wx.ALIGN_CENTER_VERTICAL) bright = SpinCtrl(parent=panel, id=wx.ID_ANY, size=(65, -1), @@ -355,8 +355,8 @@ # ambient ambval = UserSettings.Get(group='nviz', key='light', subkey='ambient') - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Ambient:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Ambient:")), pos=(2, 0), flag=wx.ALIGN_CENTER_VERTICAL) amb = SpinCtrl(parent=panel, id=wx.ID_ANY, size=(65, -1), @@ -368,8 +368,8 @@ flag=wx.ALIGN_CENTER_VERTICAL) # light color - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Color:")), pos=(3, 0), flag=wx.ALIGN_CENTER_VERTICAL) color = csel.ColourSelect( @@ -401,14 +401,14 @@ # draw - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Draw"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Draw"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) # mode gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Mode:")), @@ -429,7 +429,7 @@ # fine gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Fine mode:")), @@ -441,7 +441,7 @@ group='nviz', key='surface', subkey=[ 'draw', 'res-fine']) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("resolution:")), @@ -460,7 +460,7 @@ # coarse gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Coarse mode:")), @@ -472,7 +472,7 @@ group='nviz', key='surface', subkey=[ 'draw', 'res-coarse']) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("resolution:")), @@ -490,7 +490,7 @@ pos=(2, 2)) # style gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("style:")), @@ -511,7 +511,7 @@ pos=(3, 2)) # wire color gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("wire color:")), @@ -548,15 +548,15 @@ pageSizer = wx.BoxSizer(wx.VERTICAL) # vector lines - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Vector lines"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Vector lines"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) row = 0 # icon size - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Width:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Width:")), pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL) iwidth = SpinCtrl(parent=panel, id=wx.ID_ANY, size=(65, -1), @@ -570,8 +570,8 @@ flag=wx.ALIGN_CENTER_VERTICAL) # icon color - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Color:")), pos=(row, 4), flag=wx.ALIGN_CENTER_VERTICAL) icolor = csel.ColourSelect(panel, id=wx.ID_ANY, size=globalvar.DIALOG_COLOR_SIZE) @@ -588,23 +588,23 @@ border=5) # vector points - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Vector points"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Vector points"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=5) row = 0 # icon size - autosize = wx.CheckBox(parent=panel, label=_("Automatic size")) - autosize.SetToolTipString(_("Icon size is set automatically based on landscape dimensions.")) + autosize = CheckBox(parent=panel, label=_("Automatic size")) + autosize.SetToolTip(_("Icon size is set automatically based on landscape dimensions.")) gridSizer.Add(autosize, pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL) self.winId['nviz:vector:points:autosize'] = autosize.GetId() autosize.SetValue(UserSettings.Get(group='nviz', key='vector', subkey=['points', 'autosize'])) row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Size:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Size:")), pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL) isize = SpinCtrl(parent=panel, id=wx.ID_ANY, size=(65, -1), @@ -619,8 +619,8 @@ # icon symbol row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Marker:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Marker:")), pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL) isym = wx.Choice( parent=panel, id=wx.ID_ANY, size=(100, -1), @@ -636,8 +636,8 @@ # icon color row += 1 - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Color:")), pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL) icolor = csel.ColourSelect(panel, id=wx.ID_ANY, size=globalvar.DIALOG_COLOR_SIZE) diff -Nru grass-7.6.1/gui/wxpython/nviz/tools.py grass-7.8.0/gui/wxpython/nviz/tools.py --- grass-7.6.1/gui/wxpython/nviz/tools.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/nviz/tools.py 2019-08-11 07:34:26.000000000 +0000 @@ -22,7 +22,7 @@ import os import sys import copy -import types +import six import wx import wx.lib.colourselect as csel @@ -46,14 +46,14 @@ import grass.script as grass from core import globalvar -from core.utils import _ from gui_core.gselect import VectorDBInfo from core.gcmd import GMessage, RunCommand from modules.colorrules import ThematicVectorTable from core.settings import UserSettings from gui_core.widgets import ScrolledPanel, NumTextCtrl, FloatSlider, SymbolButton from gui_core.gselect import Select -from gui_core.wrap import SpinCtrl, PseudoDC +from gui_core.wrap import Window, SpinCtrl, PseudoDC, ToggleButton, Button, \ + TextCtrl, ToggleButton, StaticText, StaticBox, CheckListBox, ColourSelect from core.debug import Debug try: from nviz.mapwindow import wxUpdateProperties, wxUpdateView,\ @@ -248,8 +248,8 @@ 'notebook': self.GetId()} pageSizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Control View"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Control View"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=10) @@ -288,7 +288,7 @@ self.OnViewChangedText)) gridSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Perspective:")), pos=( 1, 0), flag=wx.ALIGN_CENTER) gridSizer.Add( @@ -312,7 +312,7 @@ self.OnViewChanged, self.OnViewChangedText)) gridSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Tilt:")), pos=( 1, 1), flag=wx.ALIGN_CENTER) gridSizer.Add( @@ -362,7 +362,7 @@ heightSizer = wx.GridBagSizer(vgap=3, hgap=3) heightSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Height:")), pos=( 0, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, span=( 1, 2)) @@ -381,7 +381,7 @@ 1, 1)) heightSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Z-exag:")), @@ -408,37 +408,37 @@ # view setup + reset viewSizer = wx.BoxSizer(wx.HORIZONTAL) - viewSizer.Add(wx.StaticText(panel, id=wx.ID_ANY, - label=_("Look:")), + viewSizer.Add(StaticText(panel, id=wx.ID_ANY, + label=_("Look:")), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=5) - here = wx.ToggleButton(panel, id=wx.ID_ANY, label=_("here")) + here = ToggleButton(panel, id=wx.ID_ANY, label=_("here")) here.Bind(wx.EVT_TOGGLEBUTTON, self.OnLookAt) here.SetName('here') - here.SetToolTipString(_("Allows you to select a point on the surface " - "that becomes the new center of view. " - "Click on the button and then on the surface.")) + here.SetToolTip(_("Allows you to select a point on the surface " + "that becomes the new center of view. " + "Click on the button and then on the surface.")) viewSizer.Add(here, flag=wx.TOP | wx.BOTTOM | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=5) - center = wx.Button(panel, id=wx.ID_ANY, label=_("center")) + center = Button(panel, id=wx.ID_ANY, label=_("center")) center.Bind(wx.EVT_BUTTON, self.OnLookAt) center.SetName('center') - center.SetToolTipString( + center.SetToolTip( _("Resets the view to the original default center of view")) viewSizer.Add(center, flag=wx.TOP | wx.BOTTOM | wx.ALIGN_CENTER_VERTICAL, border=5) - top = wx.Button(panel, id=wx.ID_ANY, label=_("top")) + top = Button(panel, id=wx.ID_ANY, label=_("top")) top.Bind(wx.EVT_BUTTON, self.OnLookAt) top.SetName('top') - top.SetToolTipString( + top.SetToolTip( _("Sets the viewer directly over the scene's center position. This top view orients approximately north south.")) viewSizer.Add(top, flag=wx.TOP | wx.BOTTOM | wx.ALIGN_CENTER_VERTICAL, border=5) - reset = wx.Button(panel, id=wx.ID_ANY, label=_("reset")) - reset.SetToolTipString(_("Reset to default view")) + reset = Button(panel, id=wx.ID_ANY, label=_("reset")) + reset.SetToolTip(_("Reset to default view")) reset.Bind(wx.EVT_BUTTON, self.OnResetView) viewSizer.Add(reset, proportion=0, flag=wx.TOP | wx.BOTTOM | wx.RIGHT | wx.ALIGN_RIGHT, @@ -454,15 +454,15 @@ flag=wx.EXPAND | wx.ALL, border=3) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Image Appearance"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Image Appearance"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) # background color self.win['view']['background'] = {} - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Background color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Background color:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) color = csel.ColourSelect( @@ -498,14 +498,14 @@ 'notebook': self.GetId()} pageSizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Animation"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Animation"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) hSizer = wx.BoxSizer(wx.HORIZONTAL) self.win['anim'] = {} # animation help text - help = wx.StaticText( + help = StaticText( parent=panel, id=wx.ID_ANY, label=_( "Press 'Record' button and start changing the view. " "It is recommended to use fly-through mode " @@ -538,14 +538,14 @@ frameSlider = self.FindWindowById( self.win['anim']['frameIndex']['slider']) frameText = self.FindWindowById(self.win['anim']['frameIndex']['text']) - infoLabel = wx.StaticText( + infoLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Total number of frames :")) - info = wx.StaticText(parent=panel, id=wx.ID_ANY) + info = StaticText(parent=panel, id=wx.ID_ANY) self.win['anim']['info'] = info.GetId() - fpsLabel = wx.StaticText( + fpsLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Frame rate (FPS):")) @@ -555,7 +555,7 @@ group='nviz', key='animation', subkey='fps'), min=1, max=50) self.win['anim']['fps'] = fps.GetId() - fps.SetToolTipString( + fps.SetToolTip( _("Frames are recorded with given frequency (FPS). ")) record.Bind(wx.EVT_BUTTON, self.OnRecord) @@ -611,8 +611,8 @@ # save animation self.win['anim']['save'] = {} self.win['anim']['save']['image'] = {} - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Save image sequence"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Save image sequence"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) vSizer = wx.BoxSizer(wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=10) @@ -626,24 +626,24 @@ buttonText=_('Browse'), startDirectory=pwd) dir.SetValue(pwd) - prefixLabel = wx.StaticText( + prefixLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("File prefix:")) - prefixCtrl = wx.TextCtrl( + prefixCtrl = TextCtrl( parent=panel, id=wx.ID_ANY, size=(100, -1), value=UserSettings.Get( group='nviz', key='animation', subkey='prefix')) - prefixCtrl.SetToolTipString( + prefixCtrl.SetToolTip( _("Generated files names will look like this: prefix_1.ppm, prefix_2.ppm, ...")) - fileTypeLabel = wx.StaticText( + fileTypeLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("File format:")) fileTypeCtrl = wx.Choice( parent=panel, id=wx.ID_ANY, choices=[ "TIF", "PPM"]) - save = wx.Button(parent=panel, id=wx.ID_ANY, - label="Save") + save = Button(parent=panel, id=wx.ID_ANY, + label="Save") self.win['anim']['save']['image']['dir'] = dir.GetId() self.win['anim']['save']['image']['prefix'] = prefixCtrl.GetId() @@ -823,14 +823,14 @@ self.win['surface'] = {} # selection - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Raster map"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Raster map"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) rmaps = Select(parent=panel, type='raster', onPopup=self.GselectOnPopup) rmaps.GetChildren()[0].Bind(wx.EVT_TEXT, self.OnSetRaster) self.win['surface']['map'] = rmaps.GetId() - desc = wx.StaticText(parent=panel, id=wx.ID_ANY) + desc = StaticText(parent=panel, id=wx.ID_ANY) self.win['surface']['desc'] = desc.GetId() boxSizer.Add(rmaps, proportion=0, flag=wx.ALL, @@ -846,14 +846,14 @@ # draw # self.win['surface']['draw'] = {} - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Draw"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Draw"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) # mode - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Mode:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Mode:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) mode = wx.Choice(parent=panel, id=wx.ID_ANY, size=(-1, -1), choices=[_("coarse"), @@ -867,7 +867,7 @@ # shading gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Shading:")), pos=( 0, 3), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) shade = wx.Choice(parent=panel, id=wx.ID_ANY, size=(-1, -1), @@ -880,8 +880,8 @@ pos=(0, 4)) # set to all - all = wx.Button(panel, id=wx.ID_ANY, label=_("Set to all")) - all.SetToolTipString(_("Use draw settings for all loaded surfaces")) + all = Button(panel, id=wx.ID_ANY, label=_("Set to all")) + all.SetToolTip(_("Use draw settings for all loaded surfaces")) all.Bind(wx.EVT_BUTTON, self.OnSurfaceModeAll) gridSizer.Add( all, @@ -892,11 +892,11 @@ self.win['surface']['all'] = all.GetId() # resolution coarse - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Coarse mode:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Coarse mode:")), pos=(2, 0), flag=wx.ALIGN_CENTER_VERTICAL) - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("resolution:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("resolution:")), pos=(2, 1), flag=wx.ALIGN_CENTER_VERTICAL) resC = SpinCtrl(parent=panel, id=wx.ID_ANY, size=(65, -1), initial=6, @@ -910,8 +910,8 @@ flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) # Coarse style - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("style:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("style:")), pos=(3, 1), flag=wx.ALIGN_CENTER_VERTICAL) style = wx.Choice(parent=panel, id=wx.ID_ANY, size=(100, -1), choices=[_("wire"), @@ -923,11 +923,11 @@ pos=(3, 2)) # color - color = csel.ColourSelect(panel, id=wx.ID_ANY, - size=globalvar.DIALOG_COLOR_SIZE) + color = ColourSelect(panel, id=wx.ID_ANY, + size=globalvar.DIALOG_COLOR_SIZE) color.SetName("colour") color.Bind(csel.EVT_COLOURSELECT, self.OnSurfaceWireColor) - color.SetToolTipString(_("Change wire color")) + color.SetToolTip(_("Change wire color")) self.win['surface']['draw']['wire-color'] = color.GetId() gridSizer.Add( color, @@ -937,12 +937,12 @@ 3)) # resolution fine - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Fine mode:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Fine mode:")), pos=(1, 0), flag=wx.ALIGN_CENTER_VERTICAL) - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("resolution:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("resolution:")), pos=(1, 1), flag=wx.ALIGN_CENTER_VERTICAL) resF = SpinCtrl(parent=panel, id=wx.ID_ANY, size=(65, -1), initial=3, @@ -965,8 +965,8 @@ # # surface attributes # - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Surface attributes"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Surface attributes"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) @@ -978,8 +978,8 @@ ('transp', _("Transparency")), ('shine', _("Shininess"))): self.win['surface'][code] = {} - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=attrb + ':'), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=attrb + ':'), pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL) use = wx.Choice(parent=panel, id=wx.ID_ANY, size=(100, -1), choices=[_("map")]) @@ -1046,8 +1046,8 @@ # position # self.win['surface']['position'] = {} - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Position"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Position"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) @@ -1069,8 +1069,8 @@ "Y", "Z"]) - reset = wx.Button(panel, id=wx.ID_ANY, label=_("Reset")) - reset.SetToolTipString(_("Reset to default position")) + reset = Button(panel, id=wx.ID_ANY, label=_("Reset")) + reset.SetToolTip(_("Reset to default position")) reset.Bind(wx.EVT_BUTTON, self.OnResetSurfacePosition) self.win['surface']['position']['reset'] = reset.GetId() @@ -1142,14 +1142,14 @@ self.win['cplane'] = {} pageSizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Cutting planes"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Cutting planes"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) horSizer = wx.BoxSizer(wx.HORIZONTAL) # planes - horSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Active cutting plane:")), + horSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Active cutting plane:")), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5) choice = wx.Choice(parent=panel, id=wx.ID_ANY, choices=[]) self.win['cplane']['planes'] = choice.GetId() @@ -1158,8 +1158,8 @@ # shading horSizer.Add(wx.Size(-1, -1), proportion=1) - horSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Shading:")), + horSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Shading:")), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5) choices = [_("clear"), _("top color"), @@ -1176,8 +1176,8 @@ # cutting plane horizontal x position self.win['cplane']['position'] = {} - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Horizontal X:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Horizontal X:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) tooltip = _("Sets the X coordinate of the current cutting plane") self._createControl(panel, @@ -1206,8 +1206,8 @@ 0, 2), flag=wx.ALIGN_CENTER) # cutting plane horizontal y position - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Horizontal Y:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Horizontal Y:")), pos=(1, 0), flag=wx.ALIGN_CENTER_VERTICAL) tooltip = _("Sets the Y coordinate of the current cutting plane") self._createControl(panel, @@ -1237,8 +1237,8 @@ # cutting plane rotation self.win['cplane']['rotation'] = {} - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Rotation:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Rotation:")), pos=(2, 0), flag=wx.ALIGN_CENTER_VERTICAL) tooltip = _("Rotates the current cutting plane about vertical axis") self._createControl( @@ -1259,8 +1259,8 @@ 2, 2), flag=wx.ALIGN_CENTER) # cutting plane tilt - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Tilt:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Tilt:")), pos=(3, 0), flag=wx.ALIGN_CENTER_VERTICAL) tooltip = _("Rotates the current cutting plane about horizontal axis") self._createControl( @@ -1281,8 +1281,8 @@ 3, 2), flag=wx.ALIGN_CENTER) # cutting pland height - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Height:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Height:")), pos=(4, 0), flag=wx.ALIGN_CENTER_VERTICAL) tooltip = _( "Sets the Z coordinate of the current cutting plane (only meaningful when tilt is not 0)") @@ -1319,7 +1319,7 @@ horSizer = wx.BoxSizer(wx.HORIZONTAL) horSizer.Add(wx.Size(-1, -1), proportion=1, flag=wx.ALL, border=5) # reset - reset = wx.Button(parent=panel, id=wx.ID_ANY, label=_("Reset")) + reset = Button(parent=panel, id=wx.ID_ANY, label=_("Reset")) self.win['cplane']['reset'] = reset.GetId() reset.Bind(wx.EVT_BUTTON, self.OnCPlaneReset) horSizer.Add(reset, flag=wx.ALL, border=5) @@ -1341,8 +1341,8 @@ pageSizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Constant surface"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Constant surface"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) horsizer = wx.BoxSizer(wx.HORIZONTAL) @@ -1357,11 +1357,11 @@ flag=wx.EXPAND | wx.RIGHT, border=20) - addNew = wx.Button(panel, id=wx.ID_ANY, label=_("New")) + addNew = Button(panel, id=wx.ID_ANY, label=_("New")) addNew.Bind(wx.EVT_BUTTON, self.OnNewConstant) self.win['constant']['new'] = addNew.GetId() - delete = wx.Button(panel, id=wx.ID_ANY, label=_("Delete")) + delete = Button(panel, id=wx.ID_ANY, label=_("Delete")) delete.Bind(wx.EVT_BUTTON, self.OnDeleteConstant) self.win['constant']['delete'] = delete.GetId() @@ -1381,8 +1381,8 @@ gridSizer = wx.GridBagSizer(hgap=5, vgap=5) # fine resolution - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Fine resolution:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Fine resolution:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) resF = SpinCtrl(parent=panel, id=wx.ID_ANY, size=(65, -1), initial=3, @@ -1395,8 +1395,8 @@ resF, pos=(0, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) # value - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Value:")), pos=(1, 0), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Value:")), pos=(1, 0), flag=wx.ALIGN_CENTER_VERTICAL) value = SpinCtrl(panel, id=wx.ID_ANY, @@ -1407,8 +1407,8 @@ gridSizer.Add(value, pos=(1, 1)) # transparency - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Transparency:")), pos=(2, 0), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Transparency:")), pos=(2, 0), flag=wx.ALIGN_CENTER_VERTICAL) transp = SpinCtrl(panel, id=wx.ID_ANY, @@ -1419,8 +1419,8 @@ gridSizer.Add(transp, pos=(2, 1)) # color - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Color:")), pos=(3, 0), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Color:")), pos=(3, 0), flag=wx.ALIGN_CENTER_VERTICAL) color = csel.ColourSelect(panel, id=wx.ID_ANY, colour=(0, 0, 0), @@ -1449,14 +1449,14 @@ self.win['vector'] = {} # selection - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Vector map"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Vector map"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) vmaps = Select(parent=panel, type='vector', onPopup=self.GselectOnPopup) vmaps.GetChildren()[0].Bind(wx.EVT_TEXT, self.OnSetVector) self.win['vector']['map'] = vmaps.GetId() - desc = wx.StaticText(parent=panel, id=wx.ID_ANY) + desc = StaticText(parent=panel, id=wx.ID_ANY) self.win['vector']['desc'] = desc.GetId() boxSizer.Add(vmaps, proportion=0, flag=wx.ALL, @@ -1483,17 +1483,17 @@ pageSizer.Add(showLines, proportion=0, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=5) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Vector lines"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Vector lines"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) # width - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Line:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Line:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("width:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("width:")), pos=(0, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -1508,8 +1508,8 @@ flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT) # color - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("color:")), pos=(0, 3), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -1543,7 +1543,7 @@ hSizer = wx.BoxSizer(wx.HORIZONTAL) hSizer.Add(checkThematicColor, flag=wx.ALIGN_CENTER_VERTICAL, border=5) - setThematic = wx.Button(parent=panel, id=wx.ID_ANY, + setThematic = Button(parent=panel, id=wx.ID_ANY, label=_("Set options...")) self.win['vector']['lines']['thematic'][ 'buttoncolor'] = setThematic.GetId() @@ -1556,7 +1556,7 @@ hSizer = wx.BoxSizer(wx.HORIZONTAL) hSizer.Add(checkThematicWidth, flag=wx.ALIGN_CENTER_VERTICAL, border=5) - setThematic = wx.Button(parent=panel, id=wx.ID_ANY, + setThematic = Button(parent=panel, id=wx.ID_ANY, label=_("Set options...")) self.win['vector']['lines']['thematic'][ 'buttonwidth'] = setThematic.GetId() @@ -1570,8 +1570,8 @@ pos=(1, 1), span=(1, 5)) # display - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Display")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Display")), pos=(2, 0), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT) @@ -1585,12 +1585,12 @@ wx.ALIGN_LEFT | wx.EXPAND, pos=(2, 1), span=(1, 4)) # height - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Height above surface:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Height above surface:")), pos=(3, 5), flag=wx.ALIGN_BOTTOM | wx.EXPAND) - surface = wx.CheckListBox(parent=panel, id=wx.ID_ANY, size=(-1, 60), - choices=[], style=wx.LB_NEEDED_SB) + surface = CheckListBox(parent=panel, id=wx.ID_ANY, size=(-1, 60), + choices=[], style=wx.LB_NEEDED_SB) surface.Bind(wx.EVT_CHECKLISTBOX, self.OnVectorSurface) self.win['vector']['lines']['surface'] = surface.GetId() @@ -1645,18 +1645,18 @@ pageSizer.Add(showPoints, proportion=0, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=5) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Vector points"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Vector points"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) vertSizer = wx.BoxSizer(wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) # icon size - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Icon:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Icon:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("size:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("size:")), pos=(0, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) @@ -1680,8 +1680,8 @@ flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT) # icon color - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("color:")), pos=(0, 3), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) icolor = csel.ColourSelect(panel, id=wx.ID_ANY, @@ -1713,7 +1713,7 @@ # flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT) # icon symbol gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("symbol:")), pos=( 0, 5), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT) isym = wx.Choice( @@ -1752,7 +1752,7 @@ span=( 1, 5)) - setThematic = wx.Button(parent=panel, id=wx.ID_ANY, + setThematic = Button(parent=panel, id=wx.ID_ANY, label=_("Set options...")) self.win['vector']['points']['thematic'][ 'buttoncolor'] = setThematic.GetId() @@ -1769,7 +1769,7 @@ span=( 1, 5)) - setThematic = wx.Button(parent=panel, id=wx.ID_ANY, + setThematic = Button(parent=panel, id=wx.ID_ANY, label=_("Set options...")) self.win['vector']['points']['thematic'][ 'buttonsize'] = setThematic.GetId() @@ -1784,7 +1784,7 @@ # high gridSizer = wx.GridBagSizer(vgap=5, hgap=5) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, label=_("Display")), pos=( 0, 0), flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT) display = wx.Choice(parent=panel) @@ -1792,12 +1792,12 @@ display.Bind(wx.EVT_CHOICE, self.OnVectorPointsMode) gridSizer.Add(display, pos=(0, 1), flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND) - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Height above surface:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Height above surface:")), pos=(1, 2), flag=wx.ALIGN_CENTER_VERTICAL) - surface = wx.CheckListBox(parent=panel, id=wx.ID_ANY, size=(-1, 60), - choices=[], style=wx.LB_NEEDED_SB) + surface = CheckListBox(parent=panel, id=wx.ID_ANY, size=(-1, 60), + choices=[], style=wx.LB_NEEDED_SB) surface.Bind(wx.EVT_CHECKLISTBOX, self.OnVectorSurface) self.win['vector']['points']['surface'] = surface.GetId() gridSizer.Add(surface, @@ -1862,14 +1862,14 @@ self.win['volume'] = {} # selection - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("3D raster map"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("3D raster map"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) rmaps = Select(parent=panel, type='raster_3d', onPopup=self.GselectOnPopup) rmaps.GetChildren()[0].Bind(wx.EVT_TEXT, self.OnSetRaster3D) self.win['volume']['map'] = rmaps.GetId() - desc = wx.StaticText(parent=panel, id=wx.ID_ANY) + desc = StaticText(parent=panel, id=wx.ID_ANY) self.win['volume']['desc'] = desc.GetId() boxSizer.Add(rmaps, proportion=0, flag=wx.ALL, @@ -1885,15 +1885,15 @@ # draw # self.win['volume']['draw'] = {} - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Draw"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Draw"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) # gridSizer.AddGrowableCol(4) # mode - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Mode:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Mode:")), pos=(0, 0), flag=wx.ALIGN_CENTER_VERTICAL) mode = wx.Choice(parent=panel, id=wx.ID_ANY, size=(-1, -1), choices=[_("isosurfaces"), @@ -1906,8 +1906,8 @@ pos=(0, 1)) # shading - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Shading:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Shading:")), pos=(0, 2), flag=wx.ALIGN_CENTER_VERTICAL) shade = wx.Choice(parent=panel, id=wx.ID_ANY, size=(100, -1), choices=[_("flat"), @@ -1919,8 +1919,8 @@ pos=(0, 3)) # resolution (mode) - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Resolution:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Resolution:")), pos=(0, 4), flag=wx.ALIGN_CENTER_VERTICAL) resol = SpinCtrl(parent=panel, id=wx.ID_ANY, size=(65, -1), initial=1, @@ -1949,15 +1949,15 @@ # # manage isosurfaces # - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("List of isosurfaces"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("List of isosurfaces"))) box.SetName('listStaticBox') boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) # list - isolevel = wx.CheckListBox(parent=panel, id=wx.ID_ANY, - size=(300, 150)) + isolevel = CheckListBox(parent=panel, id=wx.ID_ANY, + size=(300, 150)) self.Bind(wx.EVT_CHECKLISTBOX, self.OnVolumeCheck, isolevel) self.Bind(wx.EVT_LISTBOX, self.OnVolumeSelect, isolevel) @@ -1966,24 +1966,24 @@ gridSizer.Add(isolevel, pos=(0, 0), span=(4, 1)) # buttons (add, delete, move up, move down) - btnAdd = wx.Button(parent=panel, id=wx.ID_ADD) + btnAdd = Button(parent=panel, id=wx.ID_ADD) self.win['volume']['btnAdd'] = btnAdd.GetId() btnAdd.Bind(wx.EVT_BUTTON, self.OnVolumeAdd) gridSizer.Add(btnAdd, pos=(0, 1)) - btnDelete = wx.Button(parent=panel, id=wx.ID_DELETE) + btnDelete = Button(parent=panel, id=wx.ID_DELETE) self.win['volume']['btnDelete'] = btnDelete.GetId() btnDelete.Bind(wx.EVT_BUTTON, self.OnVolumeDelete) btnDelete.Enable(False) gridSizer.Add(btnDelete, pos=(1, 1)) - btnMoveUp = wx.Button(parent=panel, id=wx.ID_UP) + btnMoveUp = Button(parent=panel, id=wx.ID_UP) self.win['volume']['btnMoveUp'] = btnMoveUp.GetId() btnMoveUp.Bind(wx.EVT_BUTTON, self.OnVolumeMoveUp) btnMoveUp.Enable(False) gridSizer.Add(btnMoveUp, pos=(2, 1)) - btnMoveDown = wx.Button(parent=panel, id=wx.ID_DOWN) + btnMoveDown = Button(parent=panel, id=wx.ID_DOWN) self.win['volume']['btnMoveDown'] = btnMoveDown.GetId() btnMoveDown.Bind(wx.EVT_BUTTON, self.OnVolumeMoveDown) btnMoveDown.Enable(False) @@ -2017,8 +2017,8 @@ # position # self.win['volume']['position'] = {} - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Position"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Position"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) @@ -2038,8 +2038,8 @@ "Y", "Z"]) - reset = wx.Button(panel, id=wx.ID_ANY, label=_("Reset")) - reset.SetToolTipString(_("Reset to default position")) + reset = Button(panel, id=wx.ID_ANY, label=_("Reset")) + reset.SetToolTip(_("Reset to default position")) reset.Bind(wx.EVT_BUTTON, self.OnResetVolumePosition) self.win['volume']['position']['reset'] = reset.GetId() @@ -2096,8 +2096,8 @@ # flag = wx.ALL, border = 3) # position - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Light source position"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Light source position"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) @@ -2122,7 +2122,7 @@ heightSizer = wx.GridBagSizer(vgap=3, hgap=3) heightSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Height:")), pos=( 0, 0), flag=wx.ALIGN_LEFT, span=( 1, 2)) @@ -2144,13 +2144,13 @@ border=3) # position - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Light color and intensity"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Light color and intensity"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) gridSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Color:")), pos=( 0, 0), flag=wx.ALIGN_CENTER_VERTICAL) color = csel.ColourSelect( @@ -2162,7 +2162,7 @@ gridSizer.Add(color, pos=(0, 2)) gridSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Brightness:")), pos=( 1, 0), flag=wx.ALIGN_CENTER_VERTICAL) tooltip = _("Adjusts the brightness of the light") @@ -2179,7 +2179,7 @@ self.win['light']['bright']['text']), pos=( 1, 2), flag=wx.ALIGN_CENTER) gridSizer.Add( - wx.StaticText( + StaticText( panel, id=wx.ID_ANY, label=_("Ambient:")), pos=( 2, 0), flag=wx.ALIGN_CENTER_VERTICAL) tooltip = _("Adjusts the ambient light") @@ -2232,8 +2232,8 @@ pageSizer = wx.BoxSizer(wx.VERTICAL) # selection - rbox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Surface"))) + rbox = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Surface"))) rboxSizer = wx.StaticBoxSizer(rbox, wx.VERTICAL) rmaps = Select(parent=panel, type='raster', onPopup=self.GselectOnPopup) @@ -2246,8 +2246,8 @@ flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM, border=3) - ebox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Edges with fringe"))) + ebox = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Edges with fringe"))) eboxSizer = wx.StaticBoxSizer(ebox, wx.HORIZONTAL) for edge in [(_("N && W"), "nw"), (_("N && E"), "ne"), @@ -2268,14 +2268,14 @@ flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM, border=3) - sbox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Settings"))) + sbox = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Settings"))) sboxSizer = wx.StaticBoxSizer(sbox, wx.HORIZONTAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) # elevation gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Elevation of fringe from bottom:")), pos=(0, 0), @@ -2292,8 +2292,8 @@ gridSizer.Add(spin, pos=(0, 1)) # color - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Color:")), pos=(1, 0), flag=wx.ALIGN_CENTER_VERTICAL) color = csel.ColourSelect(parent=panel, id=wx.ID_ANY, @@ -2328,13 +2328,13 @@ # north arrow self.win['decoration']['arrow'] = {} - nabox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("North Arrow"))) + nabox = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("North Arrow"))) naboxSizer = wx.StaticBoxSizer(nabox, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=5, vgap=5) # size - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Arrow length (in map units):")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Arrow length (in map units):")), pos=(0, 0), span=(1, 2), flag=wx.ALIGN_CENTER_VERTICAL) sizeCtrl = NumTextCtrl( parent=panel, id=wx.ID_ANY, size=( @@ -2345,8 +2345,8 @@ sizeCtrl.Bind(wx.EVT_KILL_FOCUS, self.OnDecorationProp) # color - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Arrow color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Arrow color:")), pos=(1, 0), span=(1, 2), flag=wx.ALIGN_CENTER_VERTICAL) color = csel.ColourSelect(parent=panel, id=wx.ID_ANY, size=globalvar.DIALOG_COLOR_SIZE) @@ -2355,7 +2355,7 @@ color.Bind(csel.EVT_COLOURSELECT, self.OnDecorationProp) # control - toggle = wx.ToggleButton( + toggle = ToggleButton( parent=panel, id=wx.ID_ANY, label=_("Place arrow")) @@ -2364,7 +2364,7 @@ self.win['decoration']['arrow']['place'] = toggle.GetId() toggle.SetName('placeArrow') - delete = wx.Button(parent=panel, id=wx.ID_ANY, label=_("Delete")) + delete = Button(parent=panel, id=wx.ID_ANY, label=_("Delete")) self.win['decoration']['arrow']['delete'] = delete.GetId() gridSizer.Add(delete, pos=(2, 1)) delete.Bind(wx.EVT_BUTTON, self.OnArrowDelete) @@ -2377,13 +2377,13 @@ # scale bars self.win['decoration']['scalebar'] = {} - nabox = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Scale bar"))) + nabox = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Scale bar"))) naboxSizer = wx.StaticBoxSizer(nabox, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=5, vgap=5) # size - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Scale bar length (in map units):")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Scale bar length (in map units):")), pos=(0, 0), span=(1, 2), flag=wx.ALIGN_CENTER_VERTICAL) sizeCtrl = NumTextCtrl( parent=panel, id=wx.ID_ANY, size=( @@ -2394,8 +2394,8 @@ sizeCtrl.Bind(wx.EVT_KILL_FOCUS, self.OnDecorationProp) # color - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Scale bar color:")), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Scale bar color:")), pos=(1, 0), span=(1, 2), flag=wx.ALIGN_CENTER_VERTICAL) color = csel.ColourSelect(parent=panel, id=wx.ID_ANY, size=globalvar.DIALOG_COLOR_SIZE) @@ -2404,7 +2404,7 @@ color.Bind(csel.EVT_COLOURSELECT, self.OnDecorationProp) # control - toggle = wx.ToggleButton( + toggle = ToggleButton( parent=panel, id=wx.ID_ANY, label=_("Place new scale bar")) @@ -2416,7 +2416,7 @@ scalebarChoice = wx.Choice(parent=panel, id=wx.ID_ANY, choices=[]) self.win['decoration']['scalebar']['choice'] = scalebarChoice.GetId() gridSizer.Add(scalebarChoice, pos=(3, 0), flag=wx.EXPAND) - delete = wx.Button(parent=panel, id=wx.ID_ANY, label=_("Delete")) + delete = Button(parent=panel, id=wx.ID_ANY, label=_("Delete")) self.win['decoration']['scalebar']['delete'] = delete.GetId() gridSizer.Add(delete, pos=(3, 1)) delete.Bind(wx.EVT_BUTTON, self.OnScalebarDelete) @@ -2727,7 +2727,7 @@ return name = _("constant#") + str(layerIdx + 1) data = self.mapWindow.constants[layerIdx] - for attr, value in data['constant'].iteritems(): + for attr, value in six.iteritems(data['constant']): if attr == 'color': value = self._getColorFromString(value) if attr in ('color', 'value', 'resolution', 'transp'): @@ -2781,7 +2781,7 @@ if not winName: return data[winName] = self.FindWindowById(event.GetId()).GetValue() - for w in win[winName].itervalues(): + for w in six.itervalues(win[winName]): self.FindWindowById(w).SetValue(data[winName]) event.Skip() @@ -2796,8 +2796,8 @@ vSizer = wx.BoxSizer(wx.HORIZONTAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Isosurface attributes"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Isosurface attributes"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=3, hgap=3) @@ -2823,7 +2823,7 @@ if code == 'topo': colspan = 2 gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=attrb + ':'), @@ -2928,14 +2928,14 @@ vSizer = wx.BoxSizer(wx.HORIZONTAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % (_("Slice attributes"))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % (_("Slice attributes"))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) hSizer = wx.BoxSizer() self.win['volume']['slice'] = {} hSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Slice parallel to axis:")), @@ -2954,21 +2954,21 @@ # text labels for i in range(2): - label = wx.StaticText(parent=panel, id=wx.ID_ANY) + label = StaticText(parent=panel, id=wx.ID_ANY) label.SetName('label_edge_' + str(i)) gridSizer.Add(label, pos=(0, i + 1), flag=wx.ALIGN_CENTER) for i in range(2, 4): - label = wx.StaticText(parent=panel, id=wx.ID_ANY) + label = StaticText(parent=panel, id=wx.ID_ANY) label.SetName('label_edge_' + str(i)) gridSizer.Add(label, pos=(3, i - 1), flag=wx.ALIGN_CENTER) for i in range(2): - label = wx.StaticText(parent=panel, id=wx.ID_ANY) + label = StaticText(parent=panel, id=wx.ID_ANY) label.SetName('label_coord_' + str(i)) gridSizer.Add(label, pos=(i + 1, 0), flag=wx.ALIGN_CENTER_VERTICAL) - label = wx.StaticText(parent=panel, id=wx.ID_ANY) + label = StaticText(parent=panel, id=wx.ID_ANY) label.SetName('label_coord_2') gridSizer.Add(label, pos=(4, 0), flag=wx.ALIGN_CENTER_VERTICAL) @@ -3027,8 +3027,8 @@ # transparency, reset hSizer = wx.BoxSizer() - hSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=_("Transparency:")), proportion=0, + hSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=_("Transparency:")), proportion=0, flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP, border=7) spin = SpinCtrl(parent=panel, id=wx.ID_ANY, size=(65, -1), min=0, max=100, initial=0) @@ -3039,7 +3039,7 @@ hSizer.Add(wx.Size(-1, -1), proportion=1, flag=wx.EXPAND) - reset = wx.Button(parent=panel, id=wx.ID_ANY, label=_("Reset")) + reset = Button(parent=panel, id=wx.ID_ANY, label=_("Reset")) reset.Bind(wx.EVT_BUTTON, self.OnSliceReset) self.win['volume']['slice']['reset'] = reset.GetId() hSizer.Add(reset, proportion=0, @@ -3087,7 +3087,7 @@ text.SetName('text') if tooltip: - text.SetToolTipString(tooltip) + text.SetToolTip(tooltip) if bind[2]: text.Bind(wx.EVT_TEXT_ENTER, bind[2]) text.Bind(wx.EVT_KILL_FOCUS, bind[2]) @@ -3096,14 +3096,14 @@ def _createCompass(self, panel, sizer, type): """Create 'compass' widget for light and view page""" - w = wx.Button(panel, id=wx.ID_ANY, label=_("W")) - n = wx.Button(panel, id=wx.ID_ANY, label=_("N")) - s = wx.Button(panel, id=wx.ID_ANY, label=_("S")) - e = wx.Button(panel, id=wx.ID_ANY, label=_("E")) - nw = wx.Button(panel, id=wx.ID_ANY, label=_("NW")) - ne = wx.Button(panel, id=wx.ID_ANY, label=_("NE")) - se = wx.Button(panel, id=wx.ID_ANY, label=_("SE")) - sw = wx.Button(panel, id=wx.ID_ANY, label=_("SW")) + w = Button(panel, id=wx.ID_ANY, label=_("W")) + n = Button(panel, id=wx.ID_ANY, label=_("N")) + s = Button(panel, id=wx.ID_ANY, label=_("S")) + e = Button(panel, id=wx.ID_ANY, label=_("E")) + nw = Button(panel, id=wx.ID_ANY, label=_("NW")) + ne = Button(panel, id=wx.ID_ANY, label=_("NE")) + se = Button(panel, id=wx.ID_ANY, label=_("SE")) + sw = Button(panel, id=wx.ID_ANY, label=_("SW")) padding = 15 if sys.platform == 'darwin': padding = 20 @@ -3123,9 +3123,9 @@ sizer.Add(w, pos=(1, 0), flag=wx.ALIGN_CENTER) def __GetWindowName(self, data, id): - for name in data.iterkeys(): + for name in six.iterkeys(data): if isinstance(data[name], type({})): - for win in data[name].itervalues(): + for win in six.itervalues(data[name]): if win == id: return name else: @@ -3141,7 +3141,7 @@ 'persp', 'twist', 'z-exag'): - for win in self.win['view'][control].itervalues(): + for win in six.itervalues(self.win['view'][control]): try: if control == 'height': value = int(self.mapWindow.iview[control]['value']) @@ -3182,7 +3182,7 @@ value = self.FindWindowById(event.GetId()).GetValue() self.mapWindow.light['position']['z'] = value - for win in self.win['light'][winName].itervalues(): + for win in six.itervalues(self.win['light'][winName]): self.FindWindowById(win).SetValue(value) self.PostLightEvent() @@ -3305,7 +3305,7 @@ view[winName]['value'] = convert(value) - for win in self.win['view'][winName].itervalues(): + for win in six.itervalues(self.win['view'][winName]): self.FindWindowById(win).SetValue(value) self.mapWindow.iview['dir']['use'] = False @@ -3367,7 +3367,7 @@ def OnResetSurfacePosition(self, event): """Reset position of surface""" - for win in self.win['surface']['position'].itervalues(): + for win in six.itervalues(self.win['surface']['position']): if win == self.win['surface']['position']['axis']: self.FindWindowById(win).SetSelection(2) # Z elif win == self.win['surface']['position']['reset']: @@ -3499,25 +3499,25 @@ def EnablePage(self, name, enabled=True): """Enable/disable all widgets on page""" - for key, item in self.win[name].iteritems(): + for key, item in six.iteritems(self.win[name]): if key in ('map', 'surface', 'new', 'planes'): continue - if isinstance(item, types.DictType): - for skey, sitem in self.win[name][key].iteritems(): - if isinstance(sitem, types.DictType): - for ssitem in self.win[name][key][skey].itervalues(): - if not isinstance(ssitem, types.BooleanType) and \ - isinstance(ssitem, types.IntType): + if isinstance(item, dict): + for skey, sitem in six.iteritems(self.win[name][key]): + if isinstance(sitem, dict): + for ssitem in six.itervalues(self.win[name][key][skey]): + if not isinstance(ssitem, bool) and \ + isinstance(ssitem, int): self.FindWindowById(ssitem).Enable(enabled) else: # type(bool) != types.IntType but # isinstance(bool) == types.IntType - if not isinstance(sitem, types.BooleanType) and \ - isinstance(sitem, types.IntType): + if not isinstance(sitem, bool) and \ + isinstance(sitem, int): self.FindWindowById(sitem).Enable(enabled) else: - if not isinstance(item, types.BooleanType) and \ - isinstance(item, types.IntType): + if not isinstance(item, bool) and \ + isinstance(item, int): self.FindWindowById(item).Enable(enabled) def SetMapObjUseMap(self, nvizType, attrb, map=None): @@ -3818,7 +3818,7 @@ slider = self.FindWindowById(self.win['surface'][winName]['slider']) self.AdjustSliderRange(slider=slider, value=value) - for win in self.win['surface']['position'].itervalues(): + for win in six.itervalues(self.win['surface']['position']): if win in (self.win['surface']['position']['axis'], self.win['surface']['position']['reset']): continue @@ -4047,7 +4047,7 @@ self.win['vector'][vtype]['height']['slider']) self.AdjustSliderRange(slider=slider, value=value) - for win in self.win['vector'][vtype]['height'].itervalues(): + for win in six.itervalues(self.win['vector'][vtype]['height']): self.FindWindowById(win).SetValue(value) data = self.GetLayerData('vector') @@ -4683,7 +4683,7 @@ slider = self.FindWindowById(self.win['volume'][winName]['slider']) self.AdjustSliderRange(slider=slider, value=value) - for win in self.win['volume']['position'].itervalues(): + for win in six.itervalues(self.win['volume']['position']): if win in (self.win['volume']['position']['axis'], self.win['volume']['position']['reset']): continue @@ -4748,7 +4748,7 @@ def OnResetVolumePosition(self, event): """Reset position of volume""" - for win in self.win['volume']['position'].itervalues(): + for win in six.itervalues(self.win['volume']['position']): if win == self.win['volume']['position']['axis']: self.FindWindowById(win).SetSelection(2) # Z elif win == self.win['volume']['position']['reset']: @@ -4896,8 +4896,8 @@ except: # TODO disabled page planeIndex = -1 - if event.GetId() in (self.win['cplane']['rotation']['rot'].values() + - self.win['cplane']['rotation']['tilt'].values()): + if event.GetId() in (list(self.win['cplane']['rotation']['rot'].values()) + + list(self.win['cplane']['rotation']['tilt'].values())): action = 'rotation' else: action = 'position' @@ -5215,7 +5215,7 @@ """Update animation page""" # wrap help text according to tool window help = self.FindWindowById(self.win['anim']['help']) - width = help.GetGrandParent().GetSizeTuple()[0] + width = help.GetGrandParent().GetSize()[0] help.Wrap(width - 15) anim = self.mapWindow.GetAnimation() if anim.Exists(): @@ -5279,7 +5279,7 @@ self.FindWindowById( self.win['surface']['color']['map']).SetValue(value) else: # constant - color = map(int, value.split(':')) + color = list(map(int, value.split(':'))) self.FindWindowById( self.win['surface']['color']['const']).SetColour(color) self.SetMapObjUseMap( @@ -5315,7 +5315,7 @@ # # draw # - for control, drawData in data['draw'].iteritems(): + for control, drawData in six.iteritems(data['draw']): if control == 'all': # skip 'all' property continue if control == 'resolution': @@ -5360,7 +5360,7 @@ if name == "selection": win.SetSelection(value) elif name == "colour": - color = map(int, value.split(':')) + color = list(map(int, value.split(':'))) win.SetColour(color) else: win.SetValue(value) @@ -5432,7 +5432,7 @@ width.SetValue(data['lines']['width']['value']) color = self.FindWindowById(self.win['vector']['lines']['color']) - color.SetValue(map(int, data['lines']['color']['value'].split(':'))) + color.SetValue(list(map(int, data['lines']['color']['value'].split(':')))) for vtype in ('lines', 'points'): if vtype == 'lines': @@ -5488,7 +5488,7 @@ if name == 'selection': win.SetSelection(data['points'][prop]['value']) elif name == 'color': - color = map(int, data['points'][prop]['value'].split(':')) + color = list(map(int, data['points'][prop]['value'].split(':'))) win.SetValue(color) else: win.SetValue(data['points'][prop]['value']) @@ -5516,7 +5516,7 @@ self.FindWindowById(self.win['volume']['map']).SetValue(layer.name) # draw - for control, idata in data['draw'].iteritems(): + for control, idata in six.iteritems(data['draw']): if control == 'all': # skip 'all' property continue @@ -5614,7 +5614,7 @@ self.FindWindowById( self.win['volume'][attrb]['map']).SetValue(value) else: # constant - color = map(int, value.split(':')) + color = list(map(int, value.split(':'))) self.FindWindowById( self.win['volume'][attrb]['const']).SetColour(color) else: @@ -5718,7 +5718,7 @@ win.SetSelection(self.page[name]['id']) -class PositionWindow(wx.Window): +class PositionWindow(Window): """Abstract position control window, see subclasses ViewPostionWindow and LightPositionWindow""" @@ -5727,7 +5727,7 @@ self.mapWindow = mapwindow self.quick = True - wx.Window.__init__(self, parent, id, **kwargs) + Window.__init__(self, parent, id, **kwargs) self.SetBackgroundColour("WHITE") @@ -5804,7 +5804,7 @@ def __init__(self, parent, mapwindow, id=wx.ID_ANY, **kwargs): PositionWindow.__init__(self, parent, mapwindow, id, **kwargs) - self.SetToolTipString( + self.SetToolTip( _("Adjusts the distance and direction of the image viewpoint")) self.data = self.mapWindow.view self.PostDraw() @@ -5840,8 +5840,8 @@ def __init__(self, parent, mapwindow, id=wx.ID_ANY, **kwargs): PositionWindow.__init__(self, parent, mapwindow, id, **kwargs) - self.SetToolTipString(_("Adjusts the light direction. " - "Click and drag the puck to change the light direction.")) + self.SetToolTip(_("Adjusts the light direction. " + "Click and drag the puck to change the light direction.")) self.data = self.mapWindow.light self.quick = False diff -Nru grass-7.6.1/gui/wxpython/nviz/workspace.py grass-7.8.0/gui/wxpython/nviz/workspace.py --- grass-7.6.1/gui/wxpython/nviz/workspace.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/nviz/workspace.py 2019-06-03 20:34:20.000000000 +0000 @@ -15,9 +15,9 @@ """ import copy +import six from core.settings import UserSettings -from core.utils import _ try: from nviz import wxnviz @@ -33,8 +33,8 @@ def SetConstantDefaultProp(self): """Set default constant data properties""" data = dict() - for key, value in UserSettings.Get( - group='nviz', key='constant').iteritems(): + for key, value in six.iteritems(UserSettings.Get(group='nviz', + key='constant')): data[key] = value color = str(data['color'][0]) + ':' + str(data['color'] [1]) + ':' + str(data['color'][2]) @@ -54,8 +54,9 @@ # for attrb in ('shine', ): data['attribute'][attrb] = {} - for key, value in UserSettings.Get(group='nviz', key='surface', - subkey=attrb).iteritems(): + for key, value in six.iteritems(UserSettings.Get(group='nviz', + key='surface', + subkey=attrb)): data['attribute'][attrb][key] = value data['attribute'][attrb]['update'] = None @@ -63,8 +64,9 @@ # draw # data['draw']['all'] = False # apply only for current surface - for control, value in UserSettings.Get(group='nviz', key='surface', - subkey='draw').iteritems(): + for control, value in six.iteritems(UserSettings.Get(group='nviz', + key='surface', + subkey='draw')): if control[:3] == 'res': if 'resolution' not in data['draw']: data['draw']['resolution'] = {} @@ -115,8 +117,9 @@ # # draw # - for control, value in UserSettings.Get( - group='nviz', key='volume', subkey='draw').iteritems(): + for control, value in six.iteritems(UserSettings.Get(group='nviz', + key='volume', + subkey='draw')): if control == 'shading': sel = UserSettings.Get( group='nviz', key='volume', subkey=[ @@ -157,8 +160,9 @@ # for attrb in ('shine', ): data['attribute'][attrb] = {} - for key, value in UserSettings.Get(group='nviz', key='volume', - subkey=attrb).iteritems(): + for key, value in six.iteritems(UserSettings.Get(group='nviz', + key='volume', + subkey=attrb)): data['attribute'][attrb][key] = value return data @@ -172,8 +176,9 @@ if attr == 'inout': data[attr]['value'] = 0 continue - for key, value in UserSettings.Get(group='nviz', key='volume', - subkey=attr).iteritems(): + for key, value in six.iteritems(UserSettings.Get(group='nviz', + key='volume', + subkey=attr)): data[attr][key] = value return data diff -Nru grass-7.6.1/gui/wxpython/nviz/wxnviz.py grass-7.8.0/gui/wxpython/nviz/wxnviz.py --- grass-7.6.1/gui/wxpython/nviz/wxnviz.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/nviz/wxnviz.py 2019-06-03 20:34:20.000000000 +0000 @@ -44,6 +44,10 @@ from ctypes import * try: + WindowsError +except NameError: + WindowsError = OSError +try: from grass.lib.gis import * from grass.lib.raster3d import * from grass.lib.vector import * @@ -54,8 +58,8 @@ print("wxnviz.py: {}".format(e), file=sys.stderr) from core.debug import Debug -from core.utils import _, autoCropImageFromFile -from core.gcmd import EncodeString +from core.utils import autoCropImageFromFile +from core.gcmd import EncodeString, DecodeString from core.globalvar import wxPythonPhoenix from gui_core.wrap import Rect import grass.script as grass @@ -68,6 +72,8 @@ """Redirect stderr""" global log if log: + if sys.version_info.major >= 3: + msg = DecodeString(msg.data) log.write(msg) else: print(msg) @@ -830,7 +836,7 @@ else: nsurfs = c_int() surf_list = GS_get_surf_list(byref(nsurfs)) - for i in xrange(nsurfs.value): + for i in range(nsurfs.value): id = surf_list[i] GS_set_wire_color(id, color) diff -Nru grass-7.6.1/gui/wxpython/photo2image/g.gui.photo2image.html grass-7.8.0/gui/wxpython/photo2image/g.gui.photo2image.html --- grass-7.6.1/gui/wxpython/photo2image/g.gui.photo2image.html 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/photo2image/g.gui.photo2image.html 2019-05-18 15:50:04.000000000 +0000 @@ -66,4 +66,4 @@ Martin Landa, Czech Technical University in Prague, Czech Republic

-$Date: 2018-01-10 18:01:59 +0100 (Wed, 10 Jan 2018) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/photo2image/g.gui.photo2image.py grass-7.8.0/gui/wxpython/photo2image/g.gui.photo2image.py --- grass-7.6.1/gui/wxpython/photo2image/g.gui.photo2image.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/photo2image/g.gui.photo2image.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/gui/wxpython/photo2image/ip2i_manager.py grass-7.8.0/gui/wxpython/photo2image/ip2i_manager.py --- grass-7.6.1/gui/wxpython/photo2image/ip2i_manager.py 2019-03-19 19:57:38.000000000 +0000 +++ grass-7.8.0/gui/wxpython/photo2image/ip2i_manager.py 2019-08-31 21:37:30.000000000 +0000 @@ -28,6 +28,7 @@ import os import sys +import six import shutil import time from copy import copy @@ -46,14 +47,14 @@ from core import utils from core.render import Map -from core.utils import _ from gui_core.gselect import Select, LocationSelect, MapsetSelect from gui_core.dialogs import GroupDialog from core.gcmd import RunCommand, GMessage, GError, GWarning, EncodeString from core.settings import UserSettings from photo2image.ip2i_mapdisplay import MapFrame from core.giface import Notification -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \ + TextCtrl, Menu from location_wizard.wizard import TitledPage as TitledPage @@ -685,7 +686,7 @@ "ucolor": "unused"} wpx = UserSettings.Get(group='gcpman', key='symbol', subkey='width') - for k, v in colours.iteritems(): + for k, v in six.iteritems(colours): col = UserSettings.Get(group='gcpman', key='symbol', subkey=k) self.pointsToDrawSrc.GetPen(v).SetColour(wx.Colour( col[0], col[1], col[2], 255)) # TODO GetPen neni to spatne? @@ -887,7 +888,7 @@ if line[0] == '#' or line == '': continue line = line.replace('\n', '').strip() - coords = map(float, line.split()) + coords = list(map(float, line.split())) if coords[4] == 1: check = True self.GCPcount += 1 @@ -1451,7 +1452,7 @@ """Popup Zoom menu """ point = wx.GetMousePosition() - zoommenu = wx.Menu() + zoommenu = Menu() # Add items to the menu zoomsource = wx.MenuItem(zoommenu, wx.ID_ANY, _( @@ -1743,7 +1744,7 @@ sizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s %s " % (_("Ground Control Point No."), str(gcpno))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) @@ -1751,10 +1752,10 @@ # source coordinates gridSizer = wx.GridBagSizer(vgap=5, hgap=5) - self.xcoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.ycoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.ecoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) - self.ncoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.xcoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.ycoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.ecoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) + self.ncoord = TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1)) # swap source N, target E tmp_coord = data[1] @@ -1768,8 +1769,8 @@ (_("target X:"), self.ecoord), (_("source Y:"), self.ycoord), (_("target Y:"), self.ncoord)): - label = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=label) + label = StaticText(parent=panel, id=wx.ID_ANY, + label=label) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, col)) @@ -1796,8 +1797,8 @@ # # buttons # - self.btnCancel = wx.Button(panel, wx.ID_CANCEL) - self.btnOk = wx.Button(panel, wx.ID_OK) + self.btnCancel = Button(panel, wx.ID_CANCEL) + self.btnOk = Button(panel, wx.ID_OK) self.btnOk.SetDefault() btnSizer = wx.StdDialogButtonSizer() @@ -1865,19 +1866,19 @@ self.__CreateRectificationPage(notebook) # buttons - btnSave = wx.Button(self, wx.ID_SAVE) - btnApply = wx.Button(self, wx.ID_APPLY) - btnClose = wx.Button(self, wx.ID_CLOSE) + btnSave = Button(self, wx.ID_SAVE) + btnApply = Button(self, wx.ID_APPLY) + btnClose = Button(self, wx.ID_CLOSE) btnApply.SetDefault() # bindings btnApply.Bind(wx.EVT_BUTTON, self.OnApply) - btnApply.SetToolTipString(_("Apply changes for the current session")) + btnApply.SetToolTip(_("Apply changes for the current session")) btnSave.Bind(wx.EVT_BUTTON, self.OnSave) - btnSave.SetToolTipString( + btnSave.SetToolTip( _("Apply and save changes to user settings file (default for next sessions)")) btnClose.Bind(wx.EVT_BUTTON, self.OnClose) - btnClose.SetToolTipString(_("Close dialog")) + btnClose.SetToolTip(_("Close dialog")) # sizers btnSizer = wx.BoxSizer(wx.HORIZONTAL) @@ -1923,7 +1924,7 @@ 0)) # RMS forward error threshold - rmslabel = wx.StaticText( + rmslabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Highlight RMS error > M + SD * factor:")) rmslabel.SetToolTip( @@ -1940,8 +1941,8 @@ 0)) sdfactor = UserSettings.Get( group='gcpman', key='rms', subkey='sdfactor') - self.rmsWin = wx.TextCtrl(parent=panel, id=wx.ID_ANY, - size=(70, -1), style=wx.TE_NOHIDESEL) + self.rmsWin = TextCtrl(parent=panel, id=wx.ID_ANY, + size=(70, -1), style=wx.TE_NOHIDESEL) self.rmsWin.SetValue("%s" % str(sdfactor)) if (self.parent.highest_only == True): self.rmsWin.Disable() @@ -1951,8 +1952,8 @@ rmsgridSizer.AddGrowableCol(1) sizer.Add(rmsgridSizer, flag=wx.EXPAND | wx.ALL, border=5) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Symbol settings")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Symbol settings")) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) @@ -1960,7 +1961,7 @@ # general symbol color # row = 0 - label = wx.StaticText(parent=panel, id=wx.ID_ANY, label=_("Color:")) + label = StaticText(parent=panel, id=wx.ID_ANY, label=_("Color:")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) col = UserSettings.Get(group='gcpman', key='symbol', subkey='color') colWin = csel.ColourSelect(parent=panel, id=wx.ID_ANY, @@ -1977,7 +1978,7 @@ # symbol color for high forward RMS error # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Color for high RMS error:")) @@ -1997,7 +1998,7 @@ # symbol color for selected GCP # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Color for selected GCP:")) @@ -2017,7 +2018,7 @@ # symbol color for unused GCP # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Color for unused GCPs:")) @@ -2050,7 +2051,7 @@ # symbol size # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Symbol size:")) @@ -2072,7 +2073,7 @@ # symbol width # row += 1 - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_("Line width:")) @@ -2118,7 +2119,7 @@ self.tgtrastselection.GetElementList() sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select source map to display:')), @@ -2132,7 +2133,7 @@ border=5) self.srcselection.SetValue(src_map) sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select target raster map to display:')), @@ -2182,7 +2183,7 @@ # interpolation method gridSizer = wx.GridBagSizer(vgap=5, hgap=5) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Select interpolation method:')), @@ -2208,14 +2209,14 @@ # extension sizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_('Extension for output maps:')), proportion=0, flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5) - self.ext_txt = wx.TextCtrl( + self.ext_txt = TextCtrl( parent=panel, id=wx.ID_ANY, value="", size=( 350, -1)) self.ext_txt.SetValue(self.parent.extension) diff -Nru grass-7.6.1/gui/wxpython/photo2image/ip2i_mapdisplay.py grass-7.8.0/gui/wxpython/photo2image/ip2i_mapdisplay.py --- grass-7.6.1/gui/wxpython/photo2image/ip2i_mapdisplay.py 2019-03-19 19:57:38.000000000 +0000 +++ grass-7.8.0/gui/wxpython/photo2image/ip2i_mapdisplay.py 2019-06-03 20:34:20.000000000 +0000 @@ -27,9 +27,9 @@ from gcp.toolbars import GCPDisplayToolbar, GCPManToolbar from mapdisp.gprint import PrintOptions from core.gcmd import GMessage -from core.utils import _ from gui_core.dialogs import GetImageHandlers, ImageSizeDialog from gui_core.mapdisp import SingleMapFrame +from gui_core.wrap import Menu from core.settings import UserSettings from mapwin.buffered import BufferedMapWindow from mapwin.base import MapWindowProperties @@ -420,7 +420,7 @@ Print options and output menu for map display """ point = wx.GetMousePosition() - printmenu = wx.Menu() + printmenu = Menu() # Add items to the menu setup = wx.MenuItem(printmenu, wx.ID_ANY, _('Page setup')) printmenu.AppendItem(setup) @@ -466,7 +466,7 @@ """Popup Zoom menu """ point = wx.GetMousePosition() - zoommenu = wx.Menu() + zoommenu = Menu() # Add items to the menu zoomwind = wx.MenuItem(zoommenu, wx.ID_ANY, _( diff -Nru grass-7.6.1/gui/wxpython/photo2image/ip2i_statusbar.py grass-7.8.0/gui/wxpython/photo2image/ip2i_statusbar.py --- grass-7.6.1/gui/wxpython/photo2image/ip2i_statusbar.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/photo2image/ip2i_statusbar.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,7 +20,6 @@ import wx from core.gcmd import GMessage -from core.utils import _ from mapdisp.statusbar import SbItem, SbTextItem from gui_core.wrap import SpinCtrl diff -Nru grass-7.6.1/gui/wxpython/photo2image/ip2i_toolbars.py grass-7.8.0/gui/wxpython/photo2image/ip2i_toolbars.py --- grass-7.6.1/gui/wxpython/photo2image/ip2i_toolbars.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/photo2image/ip2i_toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,7 +21,6 @@ import wx from core import globalvar -from core.utils import _ from gui_core.toolbars import BaseToolbar, BaseIcons from icons.icon import MetaIcon diff -Nru grass-7.6.1/gui/wxpython/psmap/dialogs.py grass-7.8.0/gui/wxpython/psmap/dialogs.py --- grass-7.6.1/gui/wxpython/psmap/dialogs.py 2019-03-19 19:57:46.000000000 +0000 +++ grass-7.8.0/gui/wxpython/psmap/dialogs.py 2019-09-06 19:29:57.000000000 +0000 @@ -67,12 +67,13 @@ import grass.script as grass -from core.utils import _, PilImageToWxImage +from core.utils import PilImageToWxImage from dbmgr.vinfo import VectorDBInfo from gui_core.gselect import Select from core.gcmd import RunCommand, GError, GMessage from gui_core.dialogs import SymbolDialog -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, TextCtrl, BitmapButton, \ + StaticText, StaticBox, Rect, EmptyBitmap, TextEntryDialog, ListCtrl from psmap.utils import * from psmap.instructions import * @@ -150,7 +151,7 @@ # painting the control, but there is no valid item selected yet return - r = wx.Rect(*rect) # make a copy + r = Rect(*rect) # make a copy r.Deflate(3, 5) penStyle = wx.SOLID @@ -200,11 +201,11 @@ return -1 # default - will be measured from text width -class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin, ListCtrlAutoWidthMixin): +class CheckListCtrl(ListCtrl, CheckListCtrlMixin, ListCtrlAutoWidthMixin): """List control for managing order and labels of vector maps in legend""" def __init__(self, parent): - wx.ListCtrl.__init__( + ListCtrl.__init__( self, parent, id=wx.ID_ANY, style=wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.BORDER_SUNKEN | wx.LC_VRULES | wx.LC_HRULES) CheckListCtrlMixin.__init__(self) @@ -229,7 +230,7 @@ def AddUnits(self, parent, dialogDict): parent.units = dict() - parent.units['unitsLabel'] = wx.StaticText( + parent.units['unitsLabel'] = StaticText( parent, id=wx.ID_ANY, label=_("Units:")) choices = self.unitConv.getPageUnitsNames() parent.units['unitsCtrl'] = wx.Choice( @@ -240,17 +241,17 @@ def AddPosition(self, parent, dialogDict): if not hasattr(parent, "position"): parent.position = dict() - parent.position['comment'] = wx.StaticText(parent, id=wx.ID_ANY, label=_( + parent.position['comment'] = StaticText(parent, id=wx.ID_ANY, label=_( "Position of the top left corner\nfrom the top left edge of the paper")) - parent.position['xLabel'] = wx.StaticText( + parent.position['xLabel'] = StaticText( parent, id=wx.ID_ANY, label=_("X:")) - parent.position['yLabel'] = wx.StaticText( + parent.position['yLabel'] = StaticText( parent, id=wx.ID_ANY, label=_("Y:")) - parent.position['xCtrl'] = wx.TextCtrl( + parent.position['xCtrl'] = TextCtrl( parent, id=wx.ID_ANY, value=str( dialogDict['where'][0]), validator=TCValidator( flag='DIGIT_ONLY')) - parent.position['yCtrl'] = wx.TextCtrl( + parent.position['yCtrl'] = TextCtrl( parent, id=wx.ID_ANY, value=str( dialogDict['where'][1]), validator=TCValidator( flag='DIGIT_ONLY')) @@ -269,7 +270,7 @@ def AddExtendedPosition(self, panel, gridBagSizer, dialogDict): """Add widgets for setting position relative to paper and to map""" panel.position = dict() - positionLabel = wx.StaticText( + positionLabel = StaticText( panel, id=wx.ID_ANY, label=_("Position is given:")) panel.position['toPaper'] = wx.RadioButton( panel, id=wx.ID_ANY, label=_("relative to paper"), style=wx.RB_GROUP) @@ -298,7 +299,7 @@ border=0) # first box - paper coordinates - box1 = wx.StaticBox(parent=panel, id=wx.ID_ANY, label="") + box1 = StaticBox(parent=panel, id=wx.ID_ANY, label="") sizerP = wx.StaticBoxSizer(box1, wx.VERTICAL) self.gridBagSizerP = wx.GridBagSizer(hgap=5, vgap=5) @@ -340,14 +341,14 @@ 1, 1), flag=wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, border=0) # second box - map coordinates - box2 = wx.StaticBox(parent=panel, id=wx.ID_ANY, label="") + box2 = StaticBox(parent=panel, id=wx.ID_ANY, label="") sizerM = wx.StaticBoxSizer(box2, wx.VERTICAL) self.gridBagSizerM = wx.GridBagSizer(hgap=5, vgap=5) - eastingLabel = wx.StaticText(panel, id=wx.ID_ANY, label="E:") - northingLabel = wx.StaticText(panel, id=wx.ID_ANY, label="N:") - panel.position['eCtrl'] = wx.TextCtrl(panel, id=wx.ID_ANY, value="") - panel.position['nCtrl'] = wx.TextCtrl(panel, id=wx.ID_ANY, value="") + eastingLabel = StaticText(panel, id=wx.ID_ANY, label="E:") + northingLabel = StaticText(panel, id=wx.ID_ANY, label="N:") + panel.position['eCtrl'] = TextCtrl(panel, id=wx.ID_ANY, value="") + panel.position['nCtrl'] = TextCtrl(panel, id=wx.ID_ANY, value="") east, north = PaperMapCoordinates( mapInstr=self.instruction[self.mapId], x=dialogDict['where'][0], @@ -394,9 +395,9 @@ # parent.font['colorCtrl'].SetColour(convertRGB(dialogDict['color'])) - parent.font['fontLabel'] = wx.StaticText( + parent.font['fontLabel'] = StaticText( parent, id=wx.ID_ANY, label=_("Font:")) - parent.font['fontSizeLabel'] = wx.StaticText( + parent.font['fontSizeLabel'] = StaticText( parent, id=wx.ID_ANY, label=_("Font size:")) fontChoices = [ 'Times-Roman', @@ -422,7 +423,7 @@ parent.font['fontSizeCtrl'].SetValue(dialogDict['fontsize']) if color: - parent.font['colorLabel'] = wx.StaticText( + parent.font['colorLabel'] = StaticText( parent, id=wx.ID_ANY, label=_("Choose color:")) parent.font['colorCtrl'] = wx.ColourPickerCtrl( parent, id=wx.ID_ANY) @@ -464,21 +465,21 @@ def _layout(self, panel): # buttons - btnCancel = wx.Button(self, wx.ID_CANCEL) - btnOK = wx.Button(self, wx.ID_OK) + btnCancel = Button(self, wx.ID_CANCEL) + btnOK = Button(self, wx.ID_OK) btnOK.SetDefault() if self.apply: - btnApply = wx.Button(self, wx.ID_APPLY) + btnApply = Button(self, wx.ID_APPLY) # bindigs btnOK.Bind(wx.EVT_BUTTON, self.OnOK) - btnOK.SetToolTipString(_("Close dialog and apply changes")) + btnOK.SetToolTip(_("Close dialog and apply changes")) #btnCancel.Bind(wx.EVT_BUTTON, self.OnCancel) - btnCancel.SetToolTipString(_("Close dialog and ignore changes")) + btnCancel.SetToolTip(_("Close dialog and ignore changes")) btnCancel.Bind(wx.EVT_BUTTON, self.OnCancel) if self.apply: btnApply.Bind(wx.EVT_BUTTON, self.OnApply) - btnApply.SetToolTipString(_("Apply changes")) + btnApply.SetToolTip(_("Apply changes")) # sizers btnSizer = wx.StdDialogButtonSizer() @@ -603,13 +604,13 @@ size = (110, -1) # sizers mainSizer = wx.BoxSizer(wx.VERTICAL) - pageBox = wx.StaticBox( + pageBox = StaticBox( self, id=wx.ID_ANY, label=" %s " % _("Page size")) pageSizer = wx.StaticBoxSizer(pageBox, wx.VERTICAL) - marginBox = wx.StaticBox( + marginBox = StaticBox( self, id=wx.ID_ANY, label=" %s " % _("Margins")) marginSizer = wx.StaticBoxSizer(marginBox, wx.VERTICAL) @@ -624,7 +625,7 @@ self.hBoxDict = {} for i, item in enumerate(self.cat[:3]): hBox = wx.BoxSizer(wx.HORIZONTAL) - stText = wx.StaticText( + stText = StaticText( self, id=wx.ID_ANY, label=self.catsLabels[item] + ':') choice = wx.Choice( self, @@ -644,9 +645,9 @@ #staticText + TextCtrl for item in self.cat[3:]: hBox = wx.BoxSizer(wx.HORIZONTAL) - label = wx.StaticText( + label = StaticText( self, id=wx.ID_ANY, label=self.catsLabels[item] + ':') - textctrl = wx.TextCtrl(self, id=wx.ID_ANY, size=size, value='') + textctrl = TextCtrl(self, id=wx.ID_ANY, size=size, value='') hBox.Add( label, proportion=1, @@ -666,10 +667,10 @@ 0, wx.GROW | wx.RIGHT | wx.LEFT, 5) # OK button btnSizer = wx.StdDialogButtonSizer() - self.btnOk = wx.Button(self, wx.ID_OK) + self.btnOk = Button(self, wx.ID_OK) self.btnOk.SetDefault() btnSizer.AddButton(self.btnOk) - btn = wx.Button(self, wx.ID_CANCEL) + btn = Button(self, wx.ID_CANCEL) btnSizer.AddButton(btn) btnSizer.Realize() @@ -882,7 +883,7 @@ """Do layout""" border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % @@ -891,7 +892,7 @@ gridBagSizer = wx.GridBagSizer(hgap=5, vgap=5) # scale options - frameText = wx.StaticText( + frameText = StaticText( self, id=wx.ID_ANY, label=_("Map frame options:")) scaleChoices = [_("fit frame to match selected map"), _("fit frame to match saved region"), @@ -911,7 +912,7 @@ border=0) # map and region selection - self.staticBox = wx.StaticBox( + self.staticBox = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % _("Map selection")) sizerM = wx.StaticBoxSizer(self.staticBox, wx.HORIZONTAL) @@ -932,7 +933,7 @@ dc.GetTextExtent( self.mapOrRegionText[0])[0], dc.GetTextExtent( self.mapOrRegionText[1])[0]) - self.mapText = wx.StaticText( + self.mapText = StaticText( self, id=wx.ID_ANY, label=self.mapOrRegionText[0], size=(width, -1)) self.select = Select( @@ -979,7 +980,7 @@ border=0) # map scale and center - boxC = wx.StaticBox( + boxC = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % @@ -987,18 +988,18 @@ sizerC = wx.StaticBoxSizer(boxC, wx.HORIZONTAL) self.centerSizer = wx.FlexGridSizer(rows=2, cols=5, hgap=5, vgap=5) - centerText = wx.StaticText(self, id=wx.ID_ANY, label=_("Center:")) - self.eastingText = wx.StaticText(self, id=wx.ID_ANY, label=_("E:")) - self.northingText = wx.StaticText(self, id=wx.ID_ANY, label=_("N:")) - self.eastingTextCtrl = wx.TextCtrl( + centerText = StaticText(self, id=wx.ID_ANY, label=_("Center:")) + self.eastingText = StaticText(self, id=wx.ID_ANY, label=_("E:")) + self.northingText = StaticText(self, id=wx.ID_ANY, label=_("N:")) + self.eastingTextCtrl = TextCtrl( self, id=wx.ID_ANY, style=wx.TE_RIGHT, validator=TCValidator(flag='DIGIT_ONLY')) - self.northingTextCtrl = wx.TextCtrl( + self.northingTextCtrl = TextCtrl( self, id=wx.ID_ANY, style=wx.TE_RIGHT, validator=TCValidator(flag='DIGIT_ONLY')) - scaleText = wx.StaticText(self, id=wx.ID_ANY, label=_("Scale:")) - scalePrefixText = wx.StaticText(self, id=wx.ID_ANY, label=_("1 :")) - self.scaleTextCtrl = wx.TextCtrl( + scaleText = StaticText(self, id=wx.ID_ANY, label=_("Scale:")) + scalePrefixText = StaticText(self, id=wx.ID_ANY, label=_("1 :")) + self.scaleTextCtrl = TextCtrl( self, id=wx.ID_ANY, value="", style=wx.TE_RIGHT, validator=TCValidator('DIGIT_ONLY')) @@ -1060,7 +1061,7 @@ # resolution flexSizer = wx.FlexGridSizer(rows=1, cols=2, hgap=5, vgap=5) - resolutionText = wx.StaticText( + resolutionText = StaticText( self, id=wx.ID_ANY, label=_("Map max resolution (dpi):")) self.resolutionSpin = SpinCtrl( self, id=wx.ID_ANY, min=1, max=1000, initial=300) @@ -1094,7 +1095,7 @@ # border # GTC Line around legend or map frame - box = wx.StaticBox( + box = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % @@ -1110,9 +1111,9 @@ else: self.borderCheck.SetValue(False) - self.borderColorText = wx.StaticText( + self.borderColorText = StaticText( self, id=wx.ID_ANY, label=_("border color:")) - self.borderWidthText = wx.StaticText( + self.borderWidthText = StaticText( self, id=wx.ID_ANY, label=_("border width (pts):")) self.borderColourPicker = wx.ColourPickerCtrl(self, id=wx.ID_ANY) self.borderWidthCtrl = SpinCtrl( @@ -1560,7 +1561,7 @@ # choose raster map - box = wx.StaticBox( + box = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % @@ -1706,7 +1707,7 @@ # choose vector map - box = wx.StaticBox( + box = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % @@ -1714,7 +1715,7 @@ sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridBagSizer = wx.GridBagSizer(hgap=5, vgap=5) - text = wx.StaticText(self, id=wx.ID_ANY, label=_("Map:")) + text = StaticText(self, id=wx.ID_ANY, label=_("Map:")) self.select = Select(self, id=wx.ID_ANY, # size = globalvar.DIALOG_GSELECT_SIZE, type='vector', multiple=False, updateOnPopup=True, onPopup=None) @@ -1729,7 +1730,7 @@ majorDimension=3, style=wx.RA_SPECIFY_COLS) - self.AddVector = wx.Button(self, id=wx.ID_ANY, label=_("Add")) + self.AddVector = Button(self, id=wx.ID_ANY, label=_("Add")) gridBagSizer.Add( text, pos=(0, 0), @@ -1754,7 +1755,7 @@ # manage vector layers - box = wx.StaticBox( + box = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % @@ -1762,15 +1763,15 @@ sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridBagSizer = wx.GridBagSizer(hgap=5, vgap=5) - text = wx.StaticText(self, id=wx.ID_ANY, label=_( + text = StaticText(self, id=wx.ID_ANY, label=_( "The topmost vector map overlaps the others")) self.listbox = wx.ListBox( self, id=wx.ID_ANY, choices=[], style=wx.LB_SINGLE | wx.LB_NEEDED_SB) - self.btnUp = wx.Button(self, id=wx.ID_ANY, label=_("Up")) - self.btnDown = wx.Button(self, id=wx.ID_ANY, label=_("Down")) - self.btnDel = wx.Button(self, id=wx.ID_ANY, label=_("Delete")) - self.btnProp = wx.Button(self, id=wx.ID_ANY, label=_("Properties...")) + self.btnUp = Button(self, id=wx.ID_ANY, label=_("Up")) + self.btnDown = Button(self, id=wx.ID_ANY, label=_("Down")) + self.btnDel = Button(self, id=wx.ID_ANY, label=_("Delete")) + self.btnProp = Button(self, id=wx.ID_ANY, label=_("Properties...")) self.updateListBox(selected=0) @@ -2171,7 +2172,7 @@ # data type self.checkType1 = self.checkType2 = None if self.type in ('lines', 'points'): - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2215,7 +2216,7 @@ border=5) # layer selection - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2223,11 +2224,11 @@ sizer = wx.StaticBoxSizer(box, wx.HORIZONTAL) self.gridBagSizerL = wx.GridBagSizer(hgap=5, vgap=5) - self.warning = wx.StaticText(panel, id=wx.ID_ANY, label="") + self.warning = StaticText(panel, id=wx.ID_ANY, label="") if not self.connection: - self.warning = wx.StaticText(panel, id=wx.ID_ANY, label=_( + self.warning = StaticText(panel, id=wx.ID_ANY, label=_( "Database connection is not defined in DB file.")) - text = wx.StaticText(panel, id=wx.ID_ANY, label=_("Select layer:")) + text = StaticText(panel, id=wx.ID_ANY, label=_("Select layer:")) self.layerChoice = wx.Choice( panel, id=wx.ID_ANY, choices=map( str, self.layers), size=self.spinCtrlSize) @@ -2242,7 +2243,7 @@ self.radioWhere = wx.RadioButton( panel, id=wx.ID_ANY, label="SELECT * FROM %s WHERE" % table, style=wx.RB_GROUP) - self.textCtrlWhere = wx.TextCtrl(panel, id=wx.ID_ANY, value="") + self.textCtrlWhere = TextCtrl(panel, id=wx.ID_ANY, value="") if self.connection: cols = self.mapDBInfo.GetColumns( @@ -2254,8 +2255,8 @@ self.radioCats = wx.RadioButton( panel, id=wx.ID_ANY, label="Choose categories ") - self.textCtrlCats = wx.TextCtrl(panel, id=wx.ID_ANY, value="") - self.textCtrlCats.SetToolTipString( + self.textCtrlCats = TextCtrl(panel, id=wx.ID_ANY, value="") + self.textCtrlCats.SetToolTip( _("list of categories (e.g. 1,3,5-7)")) if 'cats' in self.vPropertiesDict: @@ -2305,7 +2306,7 @@ border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) # mask - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2337,7 +2338,7 @@ border = wx.BoxSizer(wx.VERTICAL) #colors - outline - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2349,7 +2350,7 @@ panel, id=wx.ID_ANY, label=_("draw outline")) self.outlineCheck.SetValue(self.vPropertiesDict['color'] != 'none') - widthText = wx.StaticText(panel, id=wx.ID_ANY, label=_("Width (pts):")) + widthText = StaticText(panel, id=wx.ID_ANY, label=_("Width (pts):")) if fs: self.widthSpin = fs.FloatSpin( panel, @@ -2374,7 +2375,7 @@ else: self.widthSpin.SetValue(1) - colorText = wx.StaticText(panel, id=wx.ID_ANY, label=_("Color:")) + colorText = StaticText(panel, id=wx.ID_ANY, label=_("Color:")) self.colorPicker = wx.ColourPickerCtrl(panel, id=wx.ID_ANY) if self.vPropertiesDict['color'] != 'none': self.colorPicker.SetColour( @@ -2409,7 +2410,7 @@ self.Bind(wx.EVT_CHECKBOX, self.OnOutline, self.outlineCheck) #colors - fill - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2493,7 +2494,7 @@ border = wx.BoxSizer(wx.VERTICAL) #colors - outline - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2512,7 +2513,7 @@ self.outlineCheck.SetToolTipString( _("No effect for fill color from table column")) - widthText = wx.StaticText(panel, id=wx.ID_ANY, label=_("Width (pts):")) + widthText = StaticText(panel, id=wx.ID_ANY, label=_("Width (pts):")) if fs: self.outWidthSpin = fs.FloatSpin( @@ -2535,7 +2536,7 @@ else: self.outWidthSpin.SetValue(1) - colorText = wx.StaticText(panel, id=wx.ID_ANY, label=_("Color:")) + colorText = StaticText(panel, id=wx.ID_ANY, label=_("Color:")) self.colorPicker = wx.ColourPickerCtrl(panel, id=wx.ID_ANY) if self.vPropertiesDict['hcolor'] != 'none': self.colorPicker.SetColour( @@ -2570,7 +2571,7 @@ self.Bind(wx.EVT_CHECKBOX, self.OnOutline, self.outlineCheck) #colors - fill - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2578,7 +2579,7 @@ sizer = wx.StaticBoxSizer(box, wx.HORIZONTAL) self.gridBagSizerF = wx.GridBagSizer(hgap=5, vgap=2) - fillText = wx.StaticText( + fillText = StaticText( panel, id=wx.ID_ANY, label=_("Color of lines:")) self.colorPickerRadio = wx.RadioButton( @@ -2651,7 +2652,7 @@ border = wx.BoxSizer(wx.VERTICAL) # symbology - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2664,14 +2665,14 @@ style=wx.RB_GROUP) self.symbolRadio.SetValue(bool(self.vPropertiesDict['symbol'])) - self.symbolName = wx.StaticText(panel, id=wx.ID_ANY) + self.symbolName = StaticText(panel, id=wx.ID_ANY) self.symbolName.SetLabel(self.vPropertiesDict['symbol']) bitmap = wx.Bitmap( os.path.join( globalvar.SYMBDIR, self.vPropertiesDict['symbol']) + '.png') - self.symbolButton = wx.BitmapButton(panel, id=wx.ID_ANY, bitmap=bitmap) + self.symbolButton = BitmapButton(panel, id=wx.ID_ANY, bitmap=bitmap) self.epsRadio = wx.RadioButton( panel, id=wx.ID_ANY, label=_("eps file:")) @@ -2725,7 +2726,7 @@ # size - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2741,7 +2742,7 @@ self.sizecolumnRadio = wx.RadioButton( panel, id=wx.ID_ANY, label=_("size from map table column:")) self.sizeColChoice = self.getColsChoice(panel) - self.scaleText = wx.StaticText(panel, id=wx.ID_ANY, label=_("scale:")) + self.scaleText = StaticText(panel, id=wx.ID_ANY, label=_("scale:")) self.scaleSpin = SpinCtrl( panel, id=wx.ID_ANY, min=1, max=25, initial=1) @@ -2802,7 +2803,7 @@ self.Bind(wx.EVT_RADIOBUTTON, self.OnSize, self.sizecolumnRadio) # rotation - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2883,7 +2884,7 @@ border = wx.BoxSizer(wx.VERTICAL) # width - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2891,7 +2892,7 @@ sizer = wx.StaticBoxSizer(box, wx.HORIZONTAL) gridBagSizer = wx.GridBagSizer(hgap=5, vgap=5) - widthText = wx.StaticText( + widthText = StaticText( panel, id=wx.ID_ANY, label=_("Set width (pts):")) if fs: self.widthSpin = fs.FloatSpin( @@ -2937,7 +2938,7 @@ border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) # style - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -2945,7 +2946,7 @@ sizer = wx.StaticBoxSizer(box, wx.HORIZONTAL) gridBagSizer = wx.GridBagSizer(hgap=5, vgap=5) - styleText = wx.StaticText( + styleText = StaticText( panel, id=wx.ID_ANY, label=_("Choose line style:")) penStyles = ["solid", "dashed", "dotted", "dashdotted"] self.styleCombo = PenStyleComboBox( @@ -2958,7 +2959,7 @@ ## "The first block of repeated zeros or ones represents 'draw', "\ ## "the second block represents 'blank'. An even number of blocks "\ # "will repeat the pattern, an odd number of blocks will alternate the pattern.")) - linecapText = wx.StaticText( + linecapText = StaticText( panel, id=wx.ID_ANY, label=_("Choose linecap:")) self.linecapChoice = wx.Choice( panel, id=wx.ID_ANY, choices=[ @@ -3008,7 +3009,7 @@ border = wx.BoxSizer(wx.VERTICAL) # pattern - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -3026,11 +3027,11 @@ startDirectory=self.patternPath, initialValue='', fileMask="Encapsulated PostScript (*.eps)|*.eps|All files (*.*)|*.*", fileMode=wx.FD_OPEN) - self.patWidthText = wx.StaticText( + self.patWidthText = StaticText( panel, id=wx.ID_ANY, label=_("pattern line width (pts):")) self.patWidthSpin = SpinCtrl( panel, id=wx.ID_ANY, min=1, max=25, initial=1) - self.patScaleText = wx.StaticText( + self.patScaleText = StaticText( panel, id=wx.ID_ANY, label=_("pattern scale factor:")) self.patScaleSpin = SpinCtrl( panel, id=wx.ID_ANY, min=1, max=25, initial=1) @@ -3406,7 +3407,7 @@ border=5) # choose raster - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -3424,7 +3425,7 @@ rasterType = getRasterType(map=self.currRaster) - self.rasterCurrent = wx.StaticText( + self.rasterCurrent = StaticText( panel, id=wx.ID_ANY, label=_("%(rast)s: type %(type)s") % {'rast': self.currRaster, 'type': rasterType}) self.rasterSelect = Select( @@ -3470,7 +3471,7 @@ # type of legend - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -3505,7 +3506,7 @@ mainSizer=border) # advanced settings - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -3538,20 +3539,20 @@ self.minim, self.maxim = 0, 0 self.range = wx.CheckBox(panel, id=wx.ID_ANY, label=_("range")) self.range.SetValue(self.rLegendDict['range']) - self.minText = wx.StaticText( + self.minText = StaticText( panel, id=wx.ID_ANY, label="min (%s)" % self.minim) - self.maxText = wx.StaticText( + self.maxText = StaticText( panel, id=wx.ID_ANY, label="max (%s)" % self.maxim) - self.min = wx.TextCtrl( + self.min = TextCtrl( panel, id=wx.ID_ANY, value=str( self.rLegendDict['min'])) - self.max = wx.TextCtrl( + self.max = TextCtrl( panel, id=wx.ID_ANY, value=str( self.rLegendDict['max'])) @@ -3630,7 +3631,7 @@ border=5) # vector maps, their order, labels - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -3638,7 +3639,7 @@ sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridBagSizer = wx.GridBagSizer(hgap=5, vgap=5) - vectorText = wx.StaticText(panel, id=wx.ID_ANY, label=_( + vectorText = StaticText(panel, id=wx.ID_ANY, label=_( "Choose vector maps and their order in legend")) self.vectorListCtrl = CheckListCtrl(panel) @@ -3665,9 +3666,9 @@ self.vectorListCtrl.SetColumnWidth(0, wx.LIST_AUTOSIZE) self.vectorListCtrl.SetColumnWidth(1, wx.LIST_AUTOSIZE) - self.btnUp = wx.Button(panel, id=wx.ID_ANY, label=_("Up")) - self.btnDown = wx.Button(panel, id=wx.ID_ANY, label=_("Down")) - self.btnLabel = wx.Button(panel, id=wx.ID_ANY, label=_("Edit label")) + self.btnUp = Button(panel, id=wx.ID_ANY, label=_("Up")) + self.btnDown = Button(panel, id=wx.ID_ANY, label=_("Down")) + self.btnLabel = Button(panel, id=wx.ID_ANY, label=_("Edit label")) gridBagSizer.Add( vectorText, pos=( @@ -3704,7 +3705,7 @@ # border # GTC Line around legend or map frame - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -3767,7 +3768,7 @@ border = mainSizer # size and position - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -3793,13 +3794,13 @@ border=0) hBox = wx.BoxSizer(wx.HORIZONTAL) - posBox = wx.StaticBox( + posBox = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Position")) posSizer = wx.StaticBoxSizer(posBox, wx.VERTICAL) - sizeBox = wx.StaticBox( + sizeBox = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -3830,24 +3831,24 @@ border=5) # size - width = wx.StaticText(panel, id=wx.ID_ANY, label=_("Width:")) + width = StaticText(panel, id=wx.ID_ANY, label=_("Width:")) if legendDict['width']: w = self.unitConv.convert( value=float(legendDict['width']), fromUnit='inch', toUnit=legendDict['unit']) else: w = '' - panel.widthCtrl = wx.TextCtrl( + panel.widthCtrl = TextCtrl( panel, id=wx.ID_ANY, value=str(w), validator=TCValidator("DIGIT_ONLY")) - panel.widthCtrl.SetToolTipString( + panel.widthCtrl.SetToolTip( _("Leave the edit field empty, to use default values.")) if legendType == 'raster': ## panel.defaultSize = wx.CheckBox(panel, id = wx.ID_ANY, label = _("Use default size")) # panel.defaultSize.SetValue(legendDict['defaultSize']) - panel.heightOrColumnsLabel = wx.StaticText( + panel.heightOrColumnsLabel = StaticText( panel, id=wx.ID_ANY, label=_("Height:")) if legendDict['height']: h = self.unitConv.convert( @@ -3855,7 +3856,7 @@ fromUnit='inch', toUnit=legendDict['unit']) else: h = '' - panel.heightOrColumnsCtrl = wx.TextCtrl( + panel.heightOrColumnsCtrl = TextCtrl( panel, id=wx.ID_ANY, value=str(h), validator=TCValidator("DIGIT_ONLY")) @@ -3880,14 +3881,14 @@ border=5) if legendType == 'vector': - panel.widthCtrl.SetToolTipString( + panel.widthCtrl.SetToolTip( _("Width of the color symbol (for lines)\nin front of the legend text")) # columns minVect, maxVect = 0, 0 if self.vectorId: minVect = 1 maxVect = min(10, len(self.instruction[self.vectorId]['list'])) - cols = wx.StaticText(panel, id=wx.ID_ANY, label=_("Columns:")) + cols = StaticText(panel, id=wx.ID_ANY, label=_("Columns:")) panel.colsCtrl = SpinCtrl( panel, id=wx.ID_ANY, @@ -3898,9 +3899,9 @@ # span panel.spanRadio = wx.CheckBox( panel, id=wx.ID_ANY, label=_("column span:")) - panel.spanTextCtrl = wx.TextCtrl(panel, id=wx.ID_ANY, value='') - panel.spanTextCtrl.SetToolTipString(_("Column separation distance between the left edges\n" - "of two columns in a multicolumn legend")) + panel.spanTextCtrl = TextCtrl(panel, id=wx.ID_ANY, value='') + panel.spanTextCtrl.SetToolTip(_("Column separation distance between the left edges\n" + "of two columns in a multicolumn legend")) if legendDict['span']: panel.spanRadio.SetValue(True) s = self.unitConv.convert( @@ -3942,7 +3943,7 @@ border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) # font - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -4074,7 +4075,7 @@ toUnit=self.rLegendDict['unit']) else: h = '' - self.panelRaster.heightOrColumnsCtrl = wx.TextCtrl( + self.panelRaster.heightOrColumnsCtrl = TextCtrl( self.panelRaster, id=wx.ID_ANY, value=str(h), validator=TCValidator("DIGIT_ONLY")) self.panelRaster.heightOrColumnsCtrl.Enable(enabledSize) @@ -4144,11 +4145,11 @@ if self.vectorListCtrl.GetFirstSelected() != -1: idx = self.vectorListCtrl.GetFirstSelected() default = self.vectorListCtrl.GetItem(idx, 1).GetText() - dlg = wx.TextEntryDialog( + dlg = TextEntryDialog( self, message=_("Edit legend label:"), caption=_("Edit label"), - defaultValue=default, + value=default, style=wx.OK | wx.CANCEL | wx.CENTRE) if dlg.ShowModal() == wx.ID_OK: new = dlg.GetValue() @@ -4513,7 +4514,7 @@ border = wx.BoxSizer(wx.VERTICAL) # position - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -4549,7 +4550,7 @@ border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) # font - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -4584,7 +4585,7 @@ border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) # colors - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -4791,7 +4792,7 @@ # # position # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -4847,7 +4848,7 @@ # # size # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -4855,17 +4856,17 @@ sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridBagSizer = wx.GridBagSizer(hgap=5, vgap=5) - lengthText = wx.StaticText(panel, id=wx.ID_ANY, label=_("Length:")) - heightText = wx.StaticText(panel, id=wx.ID_ANY, label=_("Height:")) + lengthText = StaticText(panel, id=wx.ID_ANY, label=_("Length:")) + heightText = StaticText(panel, id=wx.ID_ANY, label=_("Height:")) - self.lengthTextCtrl = wx.TextCtrl( + self.lengthTextCtrl = TextCtrl( panel, id=wx.ID_ANY, validator=TCValidator('DIGIT_ONLY')) - self.lengthTextCtrl.SetToolTipString( + self.lengthTextCtrl.SetToolTip( _("Scalebar length is given in map units")) - self.heightTextCtrl = wx.TextCtrl( + self.heightTextCtrl = TextCtrl( panel, id=wx.ID_ANY, validator=TCValidator('DIGIT_ONLY')) - self.heightTextCtrl.SetToolTipString( + self.heightTextCtrl.SetToolTip( _("Scalebar height is real height on paper")) choices = [_('default')] + self.unitConv.getMapUnitsNames() @@ -4937,7 +4938,7 @@ # # style # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -4945,7 +4946,7 @@ sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridBagSizer = wx.GridBagSizer(hgap=5, vgap=5) - sbTypeText = wx.StaticText(panel, id=wx.ID_ANY, label=_("Type:")) + sbTypeText = StaticText(panel, id=wx.ID_ANY, label=_("Type:")) self.sbCombo = BitmapComboBox(panel, style=wx.CB_READONLY) # only temporary, images must be moved away imagePath = os.path.join( @@ -4953,7 +4954,7 @@ globalvar.IMGDIR, "scalebar-simple.png") for item, path in zip(['fancy', 'simple'], imagePath): if not os.path.exists(path): - bitmap = wx.EmptyBitmap(0, 0) + bitmap = EmptyBitmap(0, 0) else: bitmap = wx.Bitmap(path) self.sbCombo.Append(item='', bitmap=bitmap, clientData=item[0]) @@ -4963,21 +4964,21 @@ elif self.scalebarDict['scalebar'] == 's': self.sbCombo.SetSelection(1) - sbSegmentsText = wx.StaticText( + sbSegmentsText = StaticText( panel, id=wx.ID_ANY, label=_("Number of segments:")) self.sbSegmentsCtrl = SpinCtrl( panel, id=wx.ID_ANY, min=1, max=30, initial=4) self.sbSegmentsCtrl.SetValue(self.scalebarDict['segment']) - sbLabelsText1 = wx.StaticText( + sbLabelsText1 = StaticText( panel, id=wx.ID_ANY, label=_("Label every ")) - sbLabelsText2 = wx.StaticText(panel, id=wx.ID_ANY, label=_("segments")) + sbLabelsText2 = StaticText(panel, id=wx.ID_ANY, label=_("segments")) self.sbLabelsCtrl = SpinCtrl( panel, id=wx.ID_ANY, min=1, max=30, initial=1) self.sbLabelsCtrl.SetValue(self.scalebarDict['numbers']) # font - fontsizeText = wx.StaticText( + fontsizeText = StaticText( panel, id=wx.ID_ANY, label=_("Font size:")) self.fontsizeCtrl = SpinCtrl( panel, id=wx.ID_ANY, min=4, max=30, initial=10) @@ -5189,14 +5190,14 @@ border = wx.BoxSizer(wx.VERTICAL) # text entry - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Text")) sizer = wx.StaticBoxSizer(box, wx.HORIZONTAL) - textLabel = wx.StaticText(panel, id=wx.ID_ANY, label=_("Enter text:")) + textLabel = StaticText(panel, id=wx.ID_ANY, label=_("Enter text:")) self.textCtrl = ExpandoTextCtrl( panel, id=wx.ID_ANY, value=self.textDict['text']) @@ -5213,7 +5214,7 @@ border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) # font - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -5263,7 +5264,7 @@ border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) # text effects - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -5283,7 +5284,7 @@ panel, id=wx.ID_ANY) self.effect['highlightWidth'] = SpinCtrl( panel, id=wx.ID_ANY, size=self.spinCtrlSize, min=0, max=5, initial=1) - self.effect['highlightWidthLabel'] = wx.StaticText( + self.effect['highlightWidthLabel'] = StaticText( panel, id=wx.ID_ANY, label=_("Width (pts):")) self.effect['borderCtrl'] = wx.CheckBox( @@ -5291,7 +5292,7 @@ self.effect['borderColor'] = wx.ColourPickerCtrl(panel, id=wx.ID_ANY) self.effect['borderWidth'] = SpinCtrl( panel, id=wx.ID_ANY, size=self.spinCtrlSize, min=1, max=25, initial=1) - self.effect['borderWidthLabel'] = wx.StaticText( + self.effect['borderWidthLabel'] = StaticText( panel, id=wx.ID_ANY, label=_("Width (pts):")) # set values @@ -5380,7 +5381,7 @@ border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -5392,16 +5393,16 @@ self.AddExtendedPosition(panel, gridBagSizer, self.textDict) # offset - box3 = wx.StaticBox( + box3 = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Offset")) sizerO = wx.StaticBoxSizer(box3, wx.VERTICAL) gridBagSizerO = wx.GridBagSizer(hgap=5, vgap=5) - self.xoffLabel = wx.StaticText( + self.xoffLabel = StaticText( panel, id=wx.ID_ANY, label=_("horizontal (pts):")) - self.yoffLabel = wx.StaticText( + self.yoffLabel = StaticText( panel, id=wx.ID_ANY, label=_("vertical (pts):")) self.xoffCtrl = SpinCtrl( panel, id=wx.ID_ANY, size=(50, -1), @@ -5437,7 +5438,7 @@ flag=wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, border=0) # reference point - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -5491,7 +5492,7 @@ border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) # rotation - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -5777,7 +5778,7 @@ # # choose image # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -5826,7 +5827,7 @@ proportion=0, flag=wx.EXPAND | wx.BOTTOM, border=5) - panel.image['sizeInfo'] = wx.StaticText(parent=panel, id=wx.ID_ANY) + panel.image['sizeInfo'] = StaticText(parent=panel, id=wx.ID_ANY) vSizer.Add( panel.image['sizeInfo'], proportion=0, @@ -5836,7 +5837,7 @@ hSizer.Add(vSizer, proportion=0, flag=wx.EXPAND, border=0) sizer.Add(hSizer, proportion=1, flag=wx.EXPAND | wx.ALL, border=3) - epsInfo = wx.StaticText(parent=panel, id=wx.ID_ANY, + epsInfo = StaticText(parent=panel, id=wx.ID_ANY, label=_("Note: only EPS format supported")) sizer.Add( epsInfo, @@ -5849,7 +5850,7 @@ # # rotation # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -5858,7 +5859,7 @@ gridSizer = wx.GridBagSizer(hgap=5, vgap=5) - scaleLabel = wx.StaticText( + scaleLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Scale:")) if fs: panel.image['scale'] = fs.FloatSpin( @@ -5867,7 +5868,7 @@ panel.image['scale'].SetFormat("%f") panel.image['scale'].SetDigits(1) else: - panel.image['scale'] = wx.TextCtrl( + panel.image['scale'] = TextCtrl( panel, id=wx.ID_ANY, size=self.spinCtrlSize, validator=TCValidator(flag='DIGIT_ONLY')) @@ -5891,7 +5892,7 @@ pos=(0, 1), flag=wx.ALIGN_CENTER_VERTICAL) - rotLabel = wx.StaticText( + rotLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Rotation angle (deg):")) @@ -5949,7 +5950,7 @@ # # set position # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -6084,7 +6085,7 @@ def DrawWarningText(self, warning): """Draw text on preview window""" - buffer = wx.EmptyBitmap(*self.previewSize) + buffer = EmptyBitmap(*self.previewSize) dc = wx.MemoryDC() dc.SelectObject(buffer) dc.SetBrush(wx.Brush(wx.Colour(250, 250, 250))) @@ -6100,7 +6101,7 @@ """Draw bitmap, center it if smaller than preview size""" if bitmap.GetWidth() <= self.previewSize[ 0] and bitmap.GetHeight() <= self.previewSize[1]: - buffer = wx.EmptyBitmap(*self.previewSize) + buffer = EmptyBitmap(*self.previewSize) dc = wx.MemoryDC() dc.SelectObject(buffer) dc.SetBrush(dc.GetBrush()) @@ -6124,7 +6125,7 @@ def ClearPreview(self): """Clear preview window""" - buffer = wx.EmptyBitmap(*self.previewSize) + buffer = EmptyBitmap(*self.previewSize) dc = wx.MemoryDC() dc.SelectObject(buffer) dc.SetBrush(wx.WHITE_BRUSH) @@ -6256,8 +6257,8 @@ return os.path.join(gisbase, 'etc', 'paint', 'decorations') def _addConvergence(self, panel, gridBagSizer): - convergence = wx.Button(parent=panel, id=wx.ID_ANY, - label=_("Compute convergence")) + convergence = Button(parent=panel, id=wx.ID_ANY, + label=_("Compute convergence")) gridBagSizer.Add(convergence, pos=(1, 2), flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND) convergence.Bind(wx.EVT_BUTTON, self.OnConvergence) @@ -6324,7 +6325,7 @@ # # choose image # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -6334,23 +6335,23 @@ gridSizer = wx.GridBagSizer(hgap=5, vgap=5) gridSizer.Add( - wx.StaticText( + StaticText( parent=panel, id=wx.ID_ANY, label=_("Select symbol:")), pos=( 0, 0), flag=wx.ALIGN_CENTER_VERTICAL) - self.symbolLabel = wx.StaticText(parent=panel, id=wx.ID_ANY, - label=self.pointDict['symbol']) + self.symbolLabel = StaticText(parent=panel, id=wx.ID_ANY, + label=self.pointDict['symbol']) gridSizer.Add(self.symbolLabel, pos=(0, 1), flag=wx.ALIGN_CENTER_VERTICAL) bitmap = wx.Bitmap(os.path.join(globalvar.SYMBDIR, self.pointDict['symbol']) + '.png') - self.symbolButton = wx.BitmapButton(panel, id=wx.ID_ANY, bitmap=bitmap) + self.symbolButton = BitmapButton(panel, id=wx.ID_ANY, bitmap=bitmap) self.symbolButton.Bind(wx.EVT_BUTTON, self.OnSymbolSelection) gridSizer.Add( self.symbolButton, pos=(0, 2), flag=wx.ALIGN_CENTER_VERTICAL) - self.noteLabel = wx.StaticText( + self.noteLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_( "Note: Selected symbol is not displayed\n" "in draft mode (only in preview mode)")) @@ -6373,7 +6374,7 @@ # # outline - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -6382,7 +6383,7 @@ gridSizer = wx.GridBagSizer(hgap=5, vgap=5) - outlineLabel = wx.StaticText( + outlineLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Outline color:")) @@ -6409,7 +6410,7 @@ self.outlineTranspCtrl, pos=( 0, 2), flag=wx.ALIGN_CENTER_VERTICAL) - fillLabel = wx.StaticText( + fillLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Fill color:")) @@ -6447,7 +6448,7 @@ # # size - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -6456,7 +6457,7 @@ gridSizer = wx.GridBagSizer(hgap=5, vgap=5) - sizeLabel = wx.StaticText( + sizeLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Size (pt):")) @@ -6473,7 +6474,7 @@ 0, 1), flag=wx.ALIGN_CENTER_VERTICAL) # rotation - rotLabel = wx.StaticText( + rotLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Rotation angle (deg):")) @@ -6533,7 +6534,7 @@ # # set position # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -6733,7 +6734,7 @@ border = wx.BoxSizer(wx.VERTICAL) # color - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -6741,7 +6742,7 @@ sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=5, vgap=5) - outlineLabel = wx.StaticText( + outlineLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Outline color:")) @@ -6773,7 +6774,7 @@ # fill color only in rectangle if self.objectType == ('rectangle',): - fillLabel = wx.StaticText( + fillLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Fill color:")) self.fillColorCtrl = wx.ColourPickerCtrl(panel, id=wx.ID_ANY) self.fillTranspCtrl = wx.CheckBox( @@ -6802,14 +6803,14 @@ gridSizer = wx.GridBagSizer(hgap=5, vgap=5) # width - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Line style")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) - widthLabel = wx.StaticText( + widthLabel = StaticText( parent=panel, id=wx.ID_ANY, label=_("Line width:")) @@ -6925,7 +6926,7 @@ border = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Vector label files created beforehand by v.label module")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) @@ -6942,11 +6943,11 @@ proportion=1, flag=wx.EXPAND | wx.ALL, border=5) - helpText = wx.StaticText( + helpText = StaticText( panel, id=wx.ID_ANY, label=_("You can select multiple label files.")) helpText.SetForegroundColour( - wx.SystemSettings_GetColour( + wx.SystemSettings.GetColour( wx.SYS_COLOUR_GRAYTEXT)) sizer.Add( helpText, diff -Nru grass-7.6.1/gui/wxpython/psmap/frame.py grass-7.8.0/gui/wxpython/psmap/frame.py --- grass-7.6.1/gui/wxpython/psmap/frame.py 2019-03-19 19:57:33.000000000 +0000 +++ grass-7.8.0/gui/wxpython/psmap/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -17,7 +17,10 @@ import os import sys -import Queue +if sys.version_info.major == 2: + import Queue +else: + import queue as Queue from math import sin, cos, pi, sqrt import wx @@ -35,7 +38,7 @@ from psmap.toolbars import PsMapToolbar from core.gcmd import RunCommand, GError, GMessage from core.settings import UserSettings -from core.utils import _, PilImageToWxImage +from core.utils import PilImageToWxImage from gui_core.forms import GUI from gui_core.dialogs import HyperlinkDialog from gui_core.ghelp import ShowAboutDialog diff -Nru grass-7.6.1/gui/wxpython/psmap/g.gui.psmap.html grass-7.8.0/gui/wxpython/psmap/g.gui.psmap.html --- grass-7.6.1/gui/wxpython/psmap/g.gui.psmap.html 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/psmap/g.gui.psmap.html 2019-05-18 15:50:04.000000000 +0000 @@ -218,4 +218,4 @@ Republic (bachelor's final project 2011, mentor: Martin Landa)

-$Date: 2018-10-18 21:05:15 +0200 (Thu, 18 Oct 2018) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/psmap/g.gui.psmap.py grass-7.8.0/gui/wxpython/psmap/g.gui.psmap.py --- grass-7.6.1/gui/wxpython/psmap/g.gui.psmap.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/psmap/g.gui.psmap.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: g.gui.psmap diff -Nru grass-7.6.1/gui/wxpython/psmap/instructions.py grass-7.8.0/gui/wxpython/psmap/instructions.py --- grass-7.6.1/gui/wxpython/psmap/instructions.py 2019-03-19 19:57:33.000000000 +0000 +++ grass-7.8.0/gui/wxpython/psmap/instructions.py 2019-08-31 21:37:30.000000000 +0000 @@ -34,6 +34,7 @@ import os import string +import six from math import ceil from time import strftime, localtime @@ -42,7 +43,7 @@ from grass.script.task import cmdlist_to_tuple from core.gcmd import RunCommand, GError, GMessage, GWarning -from core.utils import GetCmdString, _ +from core.utils import GetCmdString from dbmgr.vinfo import VectorDBInfo from psmap.utils import * @@ -762,8 +763,8 @@ # e.g. paper a3 try: instr['Format'] = pformat - for key, value in availableFormats[ - pformat].iteritems(): + for key, value in six.iteritems(availableFormats[ + pformat]): instr[key] = float(value) break except KeyError: @@ -1441,7 +1442,7 @@ else: instr['scalebar'] = 'f' elif line.startswith('where'): - instr['where'] = map(float, line.split()[1:3]) + instr['where'] = list(map(float, line.split()[1:3])) elif line.startswith('length'): instr['length'] = float(line.split()[1]) elif line.startswith('units'): @@ -1549,7 +1550,7 @@ for line in text: try: if line.startswith('where'): - instr['where'] = map(float, line.split()[1:3]) + instr['where'] = list(map(float, line.split()[1:3])) elif line.startswith('font '): instr['font'] = line.split()[1] elif line.startswith('fontsize'): @@ -1715,7 +1716,7 @@ for line in text: try: if line.startswith('where'): - instr['where'] = map(float, line.split()[1:3]) + instr['where'] = list(map(float, line.split()[1:3])) elif line.startswith('font '): instr['font'] = line.split()[1] elif line.startswith('fontsize'): diff -Nru grass-7.6.1/gui/wxpython/psmap/toolbars.py grass-7.8.0/gui/wxpython/psmap/toolbars.py --- grass-7.6.1/gui/wxpython/psmap/toolbars.py 2019-03-19 19:57:46.000000000 +0000 +++ grass-7.8.0/gui/wxpython/psmap/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,7 +19,6 @@ import wx from core import globalvar -from core.utils import _ from gui_core.toolbars import BaseToolbar, BaseIcons from icons.icon import MetaIcon diff -Nru grass-7.6.1/gui/wxpython/psmap/utils.py grass-7.8.0/gui/wxpython/psmap/utils.py --- grass-7.6.1/gui/wxpython/psmap/utils.py 2019-03-19 19:57:32.000000000 +0000 +++ grass-7.8.0/gui/wxpython/psmap/utils.py 2019-06-03 20:34:20.000000000 +0000 @@ -28,7 +28,6 @@ import grass.script as grass from core.gcmd import RunCommand -from core.utils import _ class Rect2D(wx.Rect2D): @@ -385,14 +384,13 @@ if not portrait: orient = 'r' try: - bb = map( - float, - grass.read_command( - 'ps.map', - flags='b' + - orient, - quiet=True, - input=filename).strip().split('=')[1].split(',')) + bb = list(map(float, + grass.read_command( + 'ps.map', + flags='b' + + orient, + quiet=True, + input=filename).strip().split('=')[1].split(','))) except (grass.ScriptError, IndexError): GError(message=_("Unable to run `ps.map -b`")) return None diff -Nru grass-7.6.1/gui/wxpython/rdigit/dialogs.py grass-7.8.0/gui/wxpython/rdigit/dialogs.py --- grass-7.6.1/gui/wxpython/rdigit/dialogs.py 2019-03-19 19:57:47.000000000 +0000 +++ grass-7.8.0/gui/wxpython/rdigit/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -16,8 +16,8 @@ import wx -from core.utils import _ from gui_core.gselect import Select +from gui_core.wrap import Button, StaticText from core.gcmd import GWarning import grass.script.core as gcore @@ -42,24 +42,24 @@ self._typeChoice.SetSelection(0) self._mapSelect.SetFocus() - btnCancel = wx.Button(parent=self, id=wx.ID_CANCEL) - btnOK = wx.Button(parent=self, id=wx.ID_OK) + btnCancel = Button(parent=self, id=wx.ID_CANCEL) + btnOK = Button(parent=self, id=wx.ID_OK) btnOK.SetDefault() btnOK.Bind(wx.EVT_BUTTON, self.OnOK) # do layout mainSizer = wx.BoxSizer(wx.VERTICAL) sizer = wx.GridBagSizer(hgap=10, vgap=10) - sizer.Add(wx.StaticText(self, label=_("Name for new raster map:")), + sizer.Add(StaticText(self, label=_("Name for new raster map:")), pos=(0, 0), span=(1, 2), flag=wx.ALIGN_CENTER_VERTICAL) sizer.Add(self._mapSelect, pos=(1, 0), span=(1, 2)) sizer.Add( - wx.StaticText( + StaticText( self, label=_("Optionally select background raster map:")), pos=( 2, 0), span=( 1, 2), flag=wx.ALIGN_CENTER_VERTICAL) sizer.Add(self._backgroundSelect, pos=(3, 0), span=(1, 2)) - sizer.Add(wx.StaticText(self, label=_("New raster map type:")), + sizer.Add(StaticText(self, label=_("New raster map type:")), pos=(4, 0), flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL) sizer.Add(self._typeChoice, pos=(4, 1), flag=wx.EXPAND) diff -Nru grass-7.6.1/gui/wxpython/rdigit/toolbars.py grass-7.8.0/gui/wxpython/rdigit/toolbars.py --- grass-7.6.1/gui/wxpython/rdigit/toolbars.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/rdigit/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -16,11 +16,11 @@ import wx -from core.utils import _ from gui_core.toolbars import BaseToolbar from icons.icon import MetaIcon from gui_core.widgets import FloatValidator import wx.lib.colourselect as csel +from gui_core.wrap import TextCtrl, StaticText rdigitIcons = {'area': MetaIcon(img='polygon-create', @@ -82,22 +82,22 @@ lambda evt: self._cellValueChanged()) self._valueCombo.SetSelection(0) self._cellValueChanged() - labelValue = wx.StaticText(self, label=" %s" % _("Cell value:")) + labelValue = StaticText(self, label=" %s" % _("Cell value:")) self.InsertControl(6, labelValue) self.InsertControl(7, self._valueCombo) self._widthValueId = wx.NewId() # validator does not work with combobox, SetBackgroundColor is not # working - self._widthValue = wx.TextCtrl( + self._widthValue = TextCtrl( self, id=self._widthValueId, value='0', size=( 80, -1), validator=FloatValidator()) self._widthValue.Bind(wx.EVT_TEXT, lambda evt: self._widthValueChanged()) self._widthValueChanged() - self._widthValue.SetToolTipString( + self._widthValue.SetToolTip( _("Width of currently digitized line or diameter of a digitized point in map units.")) - labelWidth = wx.StaticText(self, label=" %s" % _("Width:")) + labelWidth = StaticText(self, label=" %s" % _("Width:")) self.InsertControl(8, labelWidth) self.InsertControl(9, self._widthValue) diff -Nru grass-7.6.1/gui/wxpython/README grass-7.8.0/gui/wxpython/README --- grass-7.6.1/gui/wxpython/README 2019-03-19 19:57:33.000000000 +0000 +++ grass-7.8.0/gui/wxpython/README 2019-08-11 09:05:20.000000000 +0000 @@ -1,12 +1,12 @@ GRASS GIS - wxPython Graphical User Interface (wxGUI) ===================================================== -$Date: 2018-09-05 07:59:43 +0200 (Wed, 05 Sep 2018) $ +$Date$ 1 - REQUIREMENTS GRASS GIS >= 6.4 - Python >= 2.4 (Python 3 not supported) + Python >= 2.4 Python ElementTree (only for Python 2.4) wxPython >= 2.8.10.1 NumPy >= 1.0.4 @@ -18,7 +18,7 @@ If you want to launch wxPython GUI automatically, start GRASS with `--gui` parameter -$ grass76 --gui +$ grass78 --gui 3 - STARTUP FROM GRASS TERMINAL diff -Nru grass-7.6.1/gui/wxpython/rlisetup/frame.py grass-7.8.0/gui/wxpython/rlisetup/frame.py --- grass-7.6.1/gui/wxpython/rlisetup/frame.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/rlisetup/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -9,12 +9,12 @@ import os from core import globalvar, gcmd -from core.utils import _ from grass.script.utils import try_remove from rlisetup.functions import retRLiPath from rlisetup.wizard import RLIWizard import locale import codecs +from gui_core.wrap import Button, StaticBox, TextCtrl class ViewFrame(wx.Frame): @@ -32,20 +32,20 @@ self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO)) self.panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.confilesBox = wx.StaticBox( + self.confilesBox = StaticBox( parent=self.panel, id=wx.ID_ANY, label=_( "View and modify the " "configuration file '{name}'".format( name=self.confile))) - self.textCtrl = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY, - style=wx.TE_MULTILINE, size=(-1, 75)) + self.textCtrl = TextCtrl(parent=self.panel, id=wx.ID_ANY, + style=wx.TE_MULTILINE, size=(-1, 75)) self.textCtrl.Bind(wx.EVT_TEXT, self.OnFileText) f = open(self.pathfile) self.textCtrl.SetValue(''.join(f.readlines())) f.close() # BUTTONS #definition - self.btn_close = wx.Button(parent=self, id=wx.ID_EXIT) - self.btn_ok = wx.Button(parent=self, id=wx.ID_SAVE) + self.btn_close = Button(parent=self, id=wx.ID_EXIT) + self.btn_ok = Button(parent=self, id=wx.ID_SAVE) self.btn_close.Bind(wx.EVT_BUTTON, self.OnClose) self.btn_ok.Bind(wx.EVT_BUTTON, self.OnOk) self._layout() @@ -127,27 +127,27 @@ wx.BITMAP_TYPE_ICO)) self.panel = wx.Panel(parent=self, id=wx.ID_ANY) # box for select configuration file - self.confilesBox = wx.StaticBox( + self.confilesBox = StaticBox( parent=self.panel, id=wx.ID_ANY, label=_('Available sampling area configuration files')) self.listfileBox = wx.ListBox(parent=self.panel, id=wx.ID_ANY, choices=self.listfiles) # BUTTONS #definition - self.btn_close = wx.Button(parent=self, id=wx.ID_CLOSE) - self.btn_help = wx.Button(parent=self, id=wx.ID_HELP) - self.btn_remove = wx.Button(parent=self, id=wx.ID_ANY, + self.btn_close = Button(parent=self, id=wx.ID_CLOSE) + self.btn_help = Button(parent=self, id=wx.ID_HELP) + self.btn_remove = Button(parent=self, id=wx.ID_ANY, label=_("Remove")) - self.btn_remove.SetToolTipString(_('Remove a configuration file')) - self.btn_new = wx.Button(parent=self, id=wx.ID_ANY, + self.btn_remove.SetToolTip(_('Remove a configuration file')) + self.btn_new = Button(parent=self, id=wx.ID_ANY, label=_("Create")) - self.btn_new.SetToolTipString(_('Create a new configuration file')) - self.btn_rename = wx.Button(parent=self, id=wx.ID_ANY, + self.btn_new.SetToolTip(_('Create a new configuration file')) + self.btn_rename = Button(parent=self, id=wx.ID_ANY, label=_("Rename")) - self.btn_rename.SetToolTipString(_('Rename a configuration file')) - self.btn_view = wx.Button(parent=self, id=wx.ID_ANY, + self.btn_rename.SetToolTip(_('Rename a configuration file')) + self.btn_view = Button(parent=self, id=wx.ID_ANY, label=_("View/Edit")) - self.btn_view.SetToolTipString(_('View and edit a configuration file')) + self.btn_view.SetToolTip(_('View and edit a configuration file')) # set action for button self.btn_close.Bind(wx.EVT_BUTTON, self.OnClose) self.btn_help.Bind(wx.EVT_BUTTON, self.OnHelp) diff -Nru grass-7.6.1/gui/wxpython/rlisetup/g.gui.rlisetup.html grass-7.8.0/gui/wxpython/rlisetup/g.gui.rlisetup.html --- grass-7.6.1/gui/wxpython/rlisetup/g.gui.rlisetup.html 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/rlisetup/g.gui.rlisetup.html 2019-05-18 15:50:04.000000000 +0000 @@ -351,4 +351,4 @@ Rewritten from r.li.setup by Claudio Porta and Lucio Davide Spano

-$Date: 2016-01-28 12:21:34 +0100 (Thu, 28 Jan 2016) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/rlisetup/g.gui.rlisetup.py grass-7.8.0/gui/wxpython/rlisetup/g.gui.rlisetup.py --- grass-7.6.1/gui/wxpython/rlisetup/g.gui.rlisetup.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/rlisetup/g.gui.rlisetup.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: g.gui.rlisetup diff -Nru grass-7.6.1/gui/wxpython/rlisetup/sampling_frame.py grass-7.8.0/gui/wxpython/rlisetup/sampling_frame.py --- grass-7.6.1/gui/wxpython/rlisetup/sampling_frame.py 2019-03-19 19:57:04.000000000 +0000 +++ grass-7.8.0/gui/wxpython/rlisetup/sampling_frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -36,7 +36,6 @@ except ImportError: pass -from core.utils import _ from core.giface import StandaloneGrassInterface from mapwin.base import MapWindowProperties from mapwin.buffered import BufferedMapWindow @@ -47,7 +46,7 @@ from grass.pydispatch.signal import Signal from grass.pydispatch.errors import DispatcherKeyError -from functions import SamplingType, checkMapExists +from .functions import SamplingType, checkMapExists class Circle: diff -Nru grass-7.6.1/gui/wxpython/rlisetup/wizard.py grass-7.8.0/gui/wxpython/rlisetup/wizard.py --- grass-7.6.1/gui/wxpython/rlisetup/wizard.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/rlisetup/wizard.py 2019-06-03 20:34:20.000000000 +0000 @@ -33,7 +33,7 @@ import wx.lib.scrolledpanel as scrolled from gui_core import gselect -from core.utils import _ +from gui_core.wrap import Button, StaticText, TextCtrl from location_wizard.wizard import TitledPage as TitledPage from rlisetup.functions import checkValue, retRLiPath from rlisetup.sampling_frame import RLiSetupMapPanel @@ -493,12 +493,12 @@ self.parent = parent # name of output configuration file - self.newconflabel = wx.StaticText( + self.newconflabel = StaticText( parent=self, id=wx.ID_ANY, label=_('Name for new configuration file to create')) - self.newconftxt = wx.TextCtrl(parent=self, id=wx.ID_ANY, - size=(250, -1)) + self.newconftxt = TextCtrl(parent=self, id=wx.ID_ANY, + size=(250, -1)) wx.CallAfter(self.newconftxt.SetFocus) self.sizer.Add(self.newconflabel, border=5, pos=(0, 0), @@ -506,7 +506,7 @@ self.sizer.Add(self.newconftxt, border=5, pos=(0, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # raster - self.mapsellabel = wx.StaticText( + self.mapsellabel = StaticText( parent=self, id=wx.ID_ANY, label=_('Raster map to use to select areas')) self.mapselect = gselect.Select(parent=self, id=wx.ID_ANY, @@ -517,7 +517,7 @@ self.sizer.Add(self.mapselect, border=5, pos=(1, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # vector - self.vectsellabel = wx.StaticText( + self.vectsellabel = StaticText( parent=self, id=wx.ID_ANY, label=_('Vector map to use to select areas')) self.vectselect = gselect.Select(parent=self, id=wx.ID_ANY, @@ -528,7 +528,7 @@ self.sizer.Add(self.vectselect, border=5, pos=(2, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # vector layer - self.vectlaylabel = wx.StaticText( + self.vectlaylabel = StaticText( parent=self, id=wx.ID_ANY, label=_('Vector map layer to use to select areas')) self.vectlayer = wx.ComboBox(parent=self, id=wx.ID_ANY, @@ -554,7 +554,7 @@ self.sizer.Add(self.sampling_reg, flag=wx.ALIGN_CENTER | wx.ALL | wx.EXPAND, border=5, pos=(5, 0), span=(1, 2)) - self.infoError = wx.StaticText(self, label='') + self.infoError = StaticText(self, label='') self.infoError.SetForegroundColour(wx.RED) self.sizer.Add(self.infoError, flag=wx.ALIGN_CENTER | wx.ALL | wx.EXPAND, border=5, @@ -713,12 +713,12 @@ self.row_up = '0' # column up/left - self.ColUpLeftlabel = wx.StaticText(parent=self, id=wx.ID_ANY, + self.ColUpLeftlabel = StaticText(parent=self, id=wx.ID_ANY, label=_("Column of upper left " "corner")) - self.ColUpLefttxt = wx.TextCtrl(parent=self, id=wx.ID_ANY, - size=(250, -1)) + self.ColUpLefttxt = TextCtrl(parent=self, id=wx.ID_ANY, + size=(250, -1)) wx.CallAfter(self.ColUpLeftlabel.SetFocus) self.sizer.Add(self.ColUpLeftlabel, border=5, pos=(1, 1), @@ -727,11 +727,11 @@ flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.AddGrowableCol(2) # row up/left - self.RowUpLeftlabel = wx.StaticText( + self.RowUpLeftlabel = StaticText( parent=self, id=wx.ID_ANY, label=_('Row of upper left corner')) - self.RowUpLefttxt = wx.TextCtrl(parent=self, id=wx.ID_ANY, - size=(250, -1)) + self.RowUpLefttxt = TextCtrl(parent=self, id=wx.ID_ANY, + size=(250, -1)) wx.CallAfter(self.RowUpLeftlabel.SetFocus) self.sizer.Add(self.RowUpLeftlabel, border=5, pos=(2, 1), @@ -740,12 +740,12 @@ flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # row length - self.RowLenlabel = wx.StaticText( + self.RowLenlabel = StaticText( parent=self, id=wx.ID_ANY, label=_('Row length of sampling frame')) - self.RowLentxt = wx.TextCtrl(parent=self, id=wx.ID_ANY, size=(250, -1)) + self.RowLentxt = TextCtrl(parent=self, id=wx.ID_ANY, size=(250, -1)) wx.CallAfter(self.RowLenlabel.SetFocus) self.sizer.Add(self.RowLenlabel, border=5, pos=(3, 1), @@ -754,12 +754,12 @@ flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # column length - self.ColLenlabel = wx.StaticText( + self.ColLenlabel = StaticText( parent=self, id=wx.ID_ANY, label=_('Row length of sampling frame')) - self.ColLentxt = wx.TextCtrl(parent=self, id=wx.ID_ANY, size=(250, -1)) + self.ColLentxt = TextCtrl(parent=self, id=wx.ID_ANY, size=(250, -1)) wx.CallAfter(self.ColLenlabel.SetFocus) self.sizer.Add(self.ColLenlabel, border=5, pos=(4, 1), @@ -912,10 +912,10 @@ self.regionPanelSizer = wx.GridBagSizer(1, 2) self.regionNumPanel = wx.Panel(parent=self, id=wx.ID_ANY) - self.regionNumLabel = wx.StaticText( + self.regionNumLabel = StaticText( parent=self.regionNumPanel, id=wx.ID_ANY, label=_('Number of regions to draw:')) - self.regionNumTxt = wx.TextCtrl(parent=self.regionNumPanel, + self.regionNumTxt = TextCtrl(parent=self.regionNumPanel, id=wx.ID_ANY, size=(50, -1)) self.regionPanelSizer.Add(self.regionNumLabel, flag=wx.ALIGN_CENTER, pos=(0, 0)) @@ -927,18 +927,18 @@ self.areaPanelSizer = wx.GridBagSizer(2, 3) self.areaPanel = wx.Panel(parent=self, id=wx.ID_ANY) - self.overwriteText = wx.StaticText( + self.overwriteText = StaticText( parent=self.areaPanel, id=wx.ID_ANY, label=_( 'Do you want to overwrite existing' ' temporal maps if they exist?')) self.overwriteCheck = wx.CheckBox(parent=self.areaPanel, id=wx.ID_ANY) - self.areaText = wx.StaticText( + self.areaText = StaticText( parent=self.areaPanel, id=wx.ID_ANY, label=_('Do you want to check vector areas?')) - self.areaOK = wx.Button(self.areaPanel, wx.ID_ANY, 'Yes', (50, 80)) - self.areaOK.SetToolTip(wx.ToolTip(_("Select if use area by area"))) - self.areaNO = wx.Button(self.areaPanel, wx.ID_ANY, 'No', (50, 80)) - self.areaNO.SetToolTip(wx.ToolTip(_("All the features will be used"))) + self.areaOK = Button(self.areaPanel, wx.ID_ANY, 'Yes', (50, 80)) + self.areaOK.SetToolTip(_("Select if use area by area")) + self.areaNO = Button(self.areaPanel, wx.ID_ANY, 'No', (50, 80)) + self.areaNO.SetToolTip(_("All the features will be used")) self.areaOK.Bind(wx.EVT_BUTTON, self.OnVectYes) self.areaNO.Bind(wx.EVT_BUTTON, self.OnVectNo) self.overwriteCheck.Bind(wx.EVT_CHECKBOX, self.OnOverwrite) @@ -953,7 +953,7 @@ self.areaPanel.SetSizer(self.areaPanelSizer) self.sizer.Add(self.areaPanel, flag=wx.ALIGN_CENTER, pos=(3, 0)) - self.calculatingAreas = wx.StaticText( + self.calculatingAreas = StaticText( parent=self, id=wx.ID_ANY, label=_('Analysing all vector features...')) self.sizer.Add(self.calculatingAreas, flag=wx.ALIGN_CENTER, pos=(4, 0)) @@ -1189,9 +1189,9 @@ self.panelSizer.Add(self.typeBox, flag=wx.ALIGN_LEFT, pos=(0, 0), span=(1, 2)) - self.widthLabel = wx.StaticText(parent=self.scrollPanel, id=wx.ID_ANY) - self.widthTxt = wx.TextCtrl(parent=self.scrollPanel, id=wx.ID_ANY, - size=(250, -1)) + self.widthLabel = StaticText(parent=self.scrollPanel, id=wx.ID_ANY) + self.widthTxt = TextCtrl(parent=self.scrollPanel, id=wx.ID_ANY, + size=(250, -1)) self.panelSizer.Add( self.widthLabel, pos=(1, 0), @@ -1200,9 +1200,9 @@ self.widthTxt, pos=(1, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) - self.heightLabel = wx.StaticText(parent=self.scrollPanel, id=wx.ID_ANY) - self.heightTxt = wx.TextCtrl(parent=self.scrollPanel, id=wx.ID_ANY, - size=(250, -1)) + self.heightLabel = StaticText(parent=self.scrollPanel, id=wx.ID_ANY) + self.heightTxt = TextCtrl(parent=self.scrollPanel, id=wx.ID_ANY, + size=(250, -1)) self.panelSizer.Add( self.heightLabel, pos=(2, 0), @@ -1231,21 +1231,21 @@ self.panelSizer.Add(self.distributionBox, pos=(3, 0), span=( 1, 2), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) - self.distr1Label = wx.StaticText(parent=self.scrollPanel, id=wx.ID_ANY, + self.distr1Label = StaticText(parent=self.scrollPanel, id=wx.ID_ANY, label=_("What number of Sampling " "Units to use?")) - self.distr1Txt = wx.TextCtrl(parent=self.scrollPanel, id=wx.ID_ANY, - size=(250, -1)) + self.distr1Txt = TextCtrl(parent=self.scrollPanel, id=wx.ID_ANY, + size=(250, -1)) self.panelSizer.Add( self.distr1Label, pos=(4, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.panelSizer.Add( self.distr1Txt, pos=(4, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) - self.distr2Label = wx.StaticText(parent=self.scrollPanel, id=wx.ID_ANY, + self.distr2Label = StaticText(parent=self.scrollPanel, id=wx.ID_ANY, label="") - self.distr2Txt = wx.TextCtrl(parent=self.scrollPanel, id=wx.ID_ANY, - size=(250, -1)) + self.distr2Txt = TextCtrl(parent=self.scrollPanel, id=wx.ID_ANY, + size=(250, -1)) self.panelSizer.Add( self.distr2Label, pos=(5, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) @@ -1367,16 +1367,16 @@ self.typeBox.Bind(wx.EVT_RADIOBOX, self.OnType) self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnEnterPage) - self.widthLabel = wx.StaticText(parent=self, id=wx.ID_ANY, + self.widthLabel = StaticText(parent=self, id=wx.ID_ANY, label=_('Width size (in cells)?')) - self.widthTxt = wx.TextCtrl(parent=self, id=wx.ID_ANY, size=(250, -1)) + self.widthTxt = TextCtrl(parent=self, id=wx.ID_ANY, size=(250, -1)) self.sizer.Add(self.widthLabel, border=5, pos=(2, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.widthTxt, border=5, pos=(2, 2), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) - self.heightLabel = wx.StaticText(parent=self, id=wx.ID_ANY, + self.heightLabel = StaticText(parent=self, id=wx.ID_ANY, label=_('Height size (in cells)?')) - self.heightTxt = wx.TextCtrl(parent=self, id=wx.ID_ANY, size=(250, -1)) + self.heightTxt = TextCtrl(parent=self, id=wx.ID_ANY, size=(250, -1)) self.sizer.Add(self.heightLabel, border=5, pos=(3, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.heightTxt, border=5, pos=(3, 2), @@ -1456,11 +1456,11 @@ self.regionPanelSizer = wx.GridBagSizer(1, 2) self.regionNumPanel = wx.Panel(parent=self, id=wx.ID_ANY) - self.regionNumLabel = wx.StaticText( + self.regionNumLabel = StaticText( parent=self.regionNumPanel, id=wx.ID_ANY, label=_('Number of sampling area to draw:')) - self.regionNumTxt = wx.TextCtrl(parent=self.regionNumPanel, - id=wx.ID_ANY, size=(50, -1)) + self.regionNumTxt = TextCtrl(parent=self.regionNumPanel, + id=wx.ID_ANY, size=(50, -1)) self.regionPanelSizer.Add(self.regionNumLabel, flag=wx.ALIGN_CENTER, pos=(0, 0)) self.regionPanelSizer.Add(self.regionNumTxt, flag=wx.ALIGN_CENTER, @@ -1617,10 +1617,10 @@ self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnExitPage) self.areaPanelSizer = wx.GridBagSizer(1, 3) self.areaPanel = wx.Panel(parent=self, id=wx.ID_ANY) - self.areaText = wx.StaticText(parent=self.areaPanel, id=wx.ID_ANY, + self.areaText = StaticText(parent=self.areaPanel, id=wx.ID_ANY, label=_('Is this area ok?')) - self.areaOK = wx.Button(self.areaPanel, wx.ID_ANY, 'Yes', (50, 80)) - self.areaNO = wx.Button(self.areaPanel, wx.ID_ANY, 'No', (50, 80)) + self.areaOK = Button(self.areaPanel, wx.ID_ANY, 'Yes', (50, 80)) + self.areaNO = Button(self.areaPanel, wx.ID_ANY, 'No', (50, 80)) self.areaOK.Bind(wx.EVT_BUTTON, self.OnYes) self.areaNO.Bind(wx.EVT_BUTTON, self.OnNo) self.areaPanelSizer.Add(self.areaText, flag=wx.ALIGN_CENTER, @@ -1740,100 +1740,100 @@ self.parent = parent # configuration file name - self.conflabel = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_('Configuration file name:')) - self.conftxt = wx.StaticText(parent=self, id=wx.ID_ANY, - label="") + self.conflabel = StaticText(parent=self, id=wx.ID_ANY, + label=_('Configuration file name:')) + self.conftxt = StaticText(parent=self, id=wx.ID_ANY, + label="") self.sizer.Add(self.conflabel, border=5, pos=(0, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.conftxt, border=5, pos=(0, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # raster name - self.rastlabel = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_('Raster name:')) - self.rasttxt = wx.StaticText(parent=self, id=wx.ID_ANY, - label="") + self.rastlabel = StaticText(parent=self, id=wx.ID_ANY, + label=_('Raster name:')) + self.rasttxt = StaticText(parent=self, id=wx.ID_ANY, + label="") self.sizer.Add(self.rastlabel, border=5, pos=(1, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.rasttxt, border=5, pos=(1, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # vector name - self.vectlabel = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_('Vector name:')) - self.vecttxt = wx.StaticText(parent=self, id=wx.ID_ANY, label="") + self.vectlabel = StaticText(parent=self, id=wx.ID_ANY, + label=_('Vector name:')) + self.vecttxt = StaticText(parent=self, id=wx.ID_ANY, label="") self.sizer.Add(self.vectlabel, border=5, pos=(2, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.vecttxt, border=5, pos=(2, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # region type name - self.regionlabel = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_('Region type:')) - self.regiontxt = wx.StaticText(parent=self, id=wx.ID_ANY, label="") + self.regionlabel = StaticText(parent=self, id=wx.ID_ANY, + label=_('Region type:')) + self.regiontxt = StaticText(parent=self, id=wx.ID_ANY, label="") self.sizer.Add(self.regionlabel, border=5, pos=(3, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.regiontxt, border=5, pos=(3, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # region keyboard - self.regionkeylabel = wx.StaticText(parent=self, id=wx.ID_ANY, - label="") - self.regionkeytxt = wx.StaticText(parent=self, id=wx.ID_ANY, label="") + self.regionkeylabel = StaticText(parent=self, id=wx.ID_ANY, + label="") + self.regionkeytxt = StaticText(parent=self, id=wx.ID_ANY, label="") self.sizer.Add(self.regionkeylabel, border=5, pos=(4, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.regionkeytxt, border=5, pos=(4, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnEnterPage) # sampling area - self.samplinglabel = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_('Sampling area type:')) - self.samplingtxt = wx.StaticText(parent=self, id=wx.ID_ANY, label="") + self.samplinglabel = StaticText(parent=self, id=wx.ID_ANY, + label=_('Sampling area type:')) + self.samplingtxt = StaticText(parent=self, id=wx.ID_ANY, label="") self.sizer.Add(self.samplinglabel, border=5, pos=(5, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.samplingtxt, border=5, pos=(5, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # shapetype - self.shapelabel = wx.StaticText(parent=self, id=wx.ID_ANY, label="") - self.shapetxt = wx.StaticText(parent=self, id=wx.ID_ANY, label="") + self.shapelabel = StaticText(parent=self, id=wx.ID_ANY, label="") + self.shapetxt = StaticText(parent=self, id=wx.ID_ANY, label="") self.sizer.Add(self.shapelabel, border=5, pos=(6, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.shapetxt, border=5, pos=(6, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # shapedim - self.shapewidthlabel = wx.StaticText(parent=self, id=wx.ID_ANY, - label="") - self.shapewidthtxt = wx.StaticText(parent=self, id=wx.ID_ANY, - label="") + self.shapewidthlabel = StaticText(parent=self, id=wx.ID_ANY, + label="") + self.shapewidthtxt = StaticText(parent=self, id=wx.ID_ANY, + label="") self.sizer.Add(self.shapewidthlabel, border=5, pos=(7, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.shapewidthtxt, border=5, pos=(7, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) - self.shapeheightlabel = wx.StaticText(parent=self, id=wx.ID_ANY, - label="") - self.shapeheighttxt = wx.StaticText(parent=self, id=wx.ID_ANY, - label="") + self.shapeheightlabel = StaticText(parent=self, id=wx.ID_ANY, + label="") + self.shapeheighttxt = StaticText(parent=self, id=wx.ID_ANY, + label="") self.sizer.Add(self.shapeheightlabel, border=5, pos=(8, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.shapeheighttxt, border=5, pos=(8, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) # units type - self.unitslabel = wx.StaticText(parent=self, id=wx.ID_ANY, label="") - self.unitstxt = wx.StaticText(parent=self, id=wx.ID_ANY, label="") + self.unitslabel = StaticText(parent=self, id=wx.ID_ANY, label="") + self.unitstxt = StaticText(parent=self, id=wx.ID_ANY, label="") self.sizer.Add(self.unitslabel, border=5, pos=(9, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.unitstxt, border=5, pos=(9, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) - self.unitsmorelabel = wx.StaticText(parent=self, id=wx.ID_ANY, - label="") - self.unitsmoretxt = wx.StaticText(parent=self, id=wx.ID_ANY, label="") + self.unitsmorelabel = StaticText(parent=self, id=wx.ID_ANY, + label="") + self.unitsmoretxt = StaticText(parent=self, id=wx.ID_ANY, label="") self.sizer.Add(self.unitsmorelabel, border=5, pos=(10, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.unitsmoretxt, border=5, pos=(10, 1), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) - self.unitsmorelabel2 = wx.StaticText(parent=self, id=wx.ID_ANY, - label="") - self.unitsmoretxt2 = wx.StaticText(parent=self, id=wx.ID_ANY, label="") + self.unitsmorelabel2 = StaticText(parent=self, id=wx.ID_ANY, + label="") + self.unitsmoretxt2 = StaticText(parent=self, id=wx.ID_ANY, label="") self.sizer.Add(self.unitsmorelabel2, border=5, pos=(11, 0), flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL) self.sizer.Add(self.unitsmoretxt2, border=5, pos=(11, 1), diff -Nru grass-7.6.1/gui/wxpython/startup/guiutils.py grass-7.8.0/gui/wxpython/startup/guiutils.py --- grass-7.6.1/gui/wxpython/startup/guiutils.py 2019-03-19 19:58:02.000000000 +0000 +++ grass-7.8.0/gui/wxpython/startup/guiutils.py 2019-08-12 16:50:46.000000000 +0000 @@ -100,7 +100,7 @@ versionFile.close() try: grassVersion, grassRevision = versionLine.split(' ', 1) - if grassVersion.endswith('svn'): + if grassVersion.endswith('dev'): grassRevisionStr = ' (%s)' % grassRevision else: grassRevisionStr = '' diff -Nru grass-7.6.1/gui/wxpython/startup/locdownload.py grass-7.8.0/gui/wxpython/startup/locdownload.py --- grass-7.6.1/gui/wxpython/startup/locdownload.py 2019-03-19 19:58:07.000000000 +0000 +++ grass-7.8.0/gui/wxpython/startup/locdownload.py 2019-06-03 20:34:20.000000000 +0000 @@ -42,9 +42,8 @@ set_gui_path() from core.debug import Debug -from core.utils import _ from core.gthread import gThread -from gui_core.wrap import Button +from gui_core.wrap import Button, StaticText # TODO: labels (and descriptions) translatable? @@ -288,7 +287,7 @@ self.database = database self.locations = locations - self.label = wx.StaticText( + self.label = StaticText( parent=self, label=_("Select sample location to download:")) @@ -307,7 +306,7 @@ # TODO: add thumbnail for each location? # TODO: messages copied from gis_set.py, need this as API? - self.message = wx.StaticText(parent=self, size=(-1, 50)) + self.message = StaticText(parent=self, size=(-1, 50)) sys.stdout = RedirectText(self.message) # It is not clear if all wx versions supports color, so try-except. diff -Nru grass-7.6.1/gui/wxpython/startup/utils.py grass-7.8.0/gui/wxpython/startup/utils.py --- grass-7.6.1/gui/wxpython/startup/utils.py 2019-03-19 19:57:59.000000000 +0000 +++ grass-7.8.0/gui/wxpython/startup/utils.py 2019-06-03 20:34:20.000000000 +0000 @@ -75,12 +75,12 @@ mapset_path = os.path.join(location_path, mapset) # create an empty directory os.mkdir(mapset_path) - # copy WIND file and its permissions from PERMANENT - # this uses PERMANENT's current region instead of default (?) - region_file = 'WIND' - region_path = os.path.join(location_path, 'PERMANENT', region_file) - shutil.copy(region_path, mapset_path) - # set permissions to u+rw,go+r (disabled) + # copy DEFAULT_WIND file and its permissions from PERMANENT + # to WIND in the new mapset + region_path1 = os.path.join(location_path, 'PERMANENT', 'DEFAULT_WIND') + region_path2 = os.path.join(location_path, mapset, 'WIND') + shutil.copy(region_path1, region_path2) + # set permissions to u+rw,go+r (disabled; why?) # os.chmod(os.path.join(database,location,mapset,'WIND'), 0644) diff -Nru grass-7.6.1/gui/wxpython/timeline/frame.py grass-7.8.0/gui/wxpython/timeline/frame.py --- grass-7.6.1/gui/wxpython/timeline/frame.py 2019-03-19 19:57:32.000000000 +0000 +++ grass-7.8.0/gui/wxpython/timeline/frame.py 2019-06-03 20:34:20.000000000 +0000 @@ -17,6 +17,7 @@ """ import os import signal +import six from math import ceil from itertools import cycle import numpy as np @@ -40,11 +41,11 @@ '(python-matplotlib) package to be installed. {0}').format(e)) import grass.script as grass -from core.utils import _ import grass.temporal as tgis from core.gcmd import GError, GException, RunCommand from gui_core import gselect +from gui_core.wrap import Button, StaticText from core import globalvar ALPHA = 1 @@ -132,9 +133,9 @@ self.datasetSelect = gselect.Select(parent=self.panel, id=wx.ID_ANY, size=globalvar.DIALOG_GSELECT_SIZE, type='stds', multiple=True) - self.drawButton = wx.Button(self.panel, id=wx.ID_ANY, label=_("Draw")) + self.drawButton = Button(self.panel, id=wx.ID_ANY, label=_("Draw")) self.drawButton.Bind(wx.EVT_BUTTON, self.OnRedraw) - self.helpButton = wx.Button(self.panel, id=wx.ID_ANY, label=_("Help")) + self.helpButton = Button(self.panel, id=wx.ID_ANY, label=_("Help")) self.helpButton.Bind(wx.EVT_BUTTON, self.OnHelp) self.view3dCheck = wx.CheckBox( self.panel, id=wx.ID_ANY, @@ -145,8 +146,8 @@ "(matplotlib >= 1.0.0)")) self.view3dCheck.Disable() - gridSizer.Add(wx.StaticText(self.panel, id=wx.ID_ANY, - label=_("Select space time dataset(s):")), + gridSizer.Add(StaticText(self.panel, id=wx.ID_ANY, + label=_("Select space time dataset(s):")), pos=(0, 0), flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL) gridSizer.Add(self.datasetSelect, pos=(1, 0), flag=wx.EXPAND) gridSizer.Add(self.drawButton, pos=(1, 1), flag=wx.EXPAND) @@ -284,7 +285,7 @@ startY = self.timeData[name]['south'] dY = self.timeData[name]['north'] - np.array(startY) - color = colors.next() + color = next(colors) plots.append(self.axes3d.bar3d(startX, startY, startZ, dX, dY, dZ, color=color, alpha=ALPHA)) @@ -332,9 +333,9 @@ # TODO: mixed if mapType == 'interval': end = convert(self.timeData[name]['end_datetime']) - lookUpData = zip(start, end) + lookUpData = list(zip(start, end)) duration = end - np.array(start) - barData = zip(start, duration) + barData = list(zip(start, duration)) lookUp.AddDataset(type_='bar', yrange=(i - 0.1, i + 0.1), xranges=lookUpData, datasetName=name) @@ -346,7 +347,7 @@ yrange=i, xranges=pointData, datasetName=name) - color = colors.next() + color = next(colors) if mapType == 'interval': plots.append( self.axes2d.broken_barh( @@ -444,8 +445,8 @@ tDict = tgis.tlist_grouped('stds', group_type=True, dbif=self.dbif) # nested list with '(map, mapset, etype)' items allDatasets = [[[(map, mapset, etype) for map in maps] - for etype, maps in etypesDict.iteritems()] - for mapset, etypesDict in tDict.iteritems()] + for etype, maps in six.iteritems(etypesDict)] + for mapset, etypesDict in six.iteritems(tDict)] # flatten this list if allDatasets: allDatasets = reduce( diff -Nru grass-7.6.1/gui/wxpython/timeline/g.gui.timeline.html grass-7.8.0/gui/wxpython/timeline/g.gui.timeline.html --- grass-7.6.1/gui/wxpython/timeline/g.gui.timeline.html 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/timeline/g.gui.timeline.html 2019-05-18 15:50:04.000000000 +0000 @@ -37,4 +37,4 @@ Czech Technical University in Prague, Czech Republic

-$Date: 2014-05-02 14:46:55 +0200 (Fri, 02 May 2014) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/timeline/g.gui.timeline.py grass-7.8.0/gui/wxpython/timeline/g.gui.timeline.py --- grass-7.6.1/gui/wxpython/timeline/g.gui.timeline.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/timeline/g.gui.timeline.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: g.gui.timeline.py @@ -50,7 +50,7 @@ # TODO: why do we need this special check here, the reason of error # is wrong intallation or something, no need to report this to the # user in a nice way - gscript.fatal(e.message) + gscript.fatal(str(e)) datasets = options['inputs'].strip().split(',') datasets = [data for data in datasets if data] diff -Nru grass-7.6.1/gui/wxpython/tools/update_menudata.py grass-7.8.0/gui/wxpython/tools/update_menudata.py --- grass-7.6.1/gui/wxpython/tools/update_menudata.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/tools/update_menudata.py 2019-06-03 20:34:20.000000000 +0000 @@ -151,7 +151,7 @@ print(sys.stderr, __doc__, file=sys.stderr) return 1 - nuldev = file(os.devnull, 'w+') + nuldev = open(os.devnull, 'w+') grass.info("Step 1: running make...") grass.call(['make'], stderr=nuldev) grass.info("Step 2: parsing modules...") diff -Nru grass-7.6.1/gui/wxpython/tplot/frame.py grass-7.8.0/gui/wxpython/tplot/frame.py --- grass-7.6.1/gui/wxpython/tplot/frame.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/tplot/frame.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ @package frame @@ -19,6 +19,7 @@ @author start stvds support Matej Krejci """ import os +import six from itertools import cycle import numpy as np @@ -26,7 +27,6 @@ from grass.pygrass.modules import Module import grass.script as grass -from core.utils import _ from functools import reduce try: @@ -44,7 +44,6 @@ raise ImportError(_('The Temporal Plot Tool needs the "matplotlib" ' '(python-matplotlib) package to be installed. {0}').format(e)) -from core.utils import _ import grass.temporal as tgis from core.gcmd import GMessage, GError, GException, RunCommand @@ -63,6 +62,7 @@ import wx.lib.filebrowsebutton as filebrowse from gui_core.widgets import GNotebook +from gui_core.wrap import TextCtrl, Button, StaticText ALPHA = 0.5 COLORS = ['b', 'g', 'r', 'c', 'm', 'y', 'k'] @@ -177,7 +177,7 @@ # ------------ITEMS IN NOTEBOOK PAGE (RASTER)------------------------ self.controlPanelRaster = wx.Panel(parent=self.ntb, id=wx.ID_ANY) - self.datasetSelectLabelR = wx.StaticText( + self.datasetSelectLabelR = StaticText( parent=self.controlPanelRaster, id=wx.ID_ANY, label=_( @@ -189,21 +189,21 @@ self.datasetSelectR = gselect.Select( parent=self.controlPanelRaster, id=wx.ID_ANY, size=globalvar.DIALOG_GSELECT_SIZE, type='strds', multiple=True) - self.coor = wx.StaticText(parent=self.controlPanelRaster, id=wx.ID_ANY, - label=_('X and Y coordinates separated by ' - 'comma:')) + self.coor = StaticText(parent=self.controlPanelRaster, id=wx.ID_ANY, + label=_('X and Y coordinates separated by ' + 'comma:')) try: self._giface.GetMapWindow() self.coorval = gselect.CoordinatesSelect( parent=self.controlPanelRaster, giface=self._giface) except: - self.coorval = wx.TextCtrl(parent=self.controlPanelRaster, + self.coorval = TextCtrl(parent=self.controlPanelRaster, id=wx.ID_ANY, size=globalvar.DIALOG_TEXTCTRL_SIZE, validator=CoordinatesValidator()) - self.coorval.SetToolTipString(_("Coordinates can be obtained for example" - " by right-clicking on Map Display.")) + self.coorval.SetToolTip(_("Coordinates can be obtained for example" + " by right-clicking on Map Display.")) self.controlPanelSizerRaster = wx.BoxSizer(wx.VERTICAL) # self.controlPanelSizer.Add(wx.StaticText(self.panel, id=wx.ID_ANY, # label=_("Select space time raster dataset(s):")), @@ -222,7 +222,7 @@ # ------------ITEMS IN NOTEBOOK PAGE (VECTOR)------------------------ self.controlPanelVector = wx.Panel(parent=self.ntb, id=wx.ID_ANY) - self.datasetSelectLabelV = wx.StaticText( + self.datasetSelectLabelV = StaticText( parent=self.controlPanelVector, id=wx.ID_ANY, label=_( 'Vector temporal ' @@ -237,22 +237,22 @@ self.OnVectorSelected) self.attribute = gselect.ColumnSelect(parent=self.controlPanelVector) - self.attributeLabel = wx.StaticText(parent=self.controlPanelVector, - id=wx.ID_ANY, - label=_('Select attribute column')) + self.attributeLabel = StaticText(parent=self.controlPanelVector, + id=wx.ID_ANY, + label=_('Select attribute column')) # TODO fix the category selection as done for coordinates try: self._giface.GetMapWindow() self.cats = gselect.VectorCategorySelect( parent=self.controlPanelVector, giface=self._giface) except: - self.cats = wx.TextCtrl( + self.cats = TextCtrl( parent=self.controlPanelVector, id=wx.ID_ANY, size=globalvar.DIALOG_TEXTCTRL_SIZE) - self.catsLabel = wx.StaticText(parent=self.controlPanelVector, - id=wx.ID_ANY, - label=_('Select category of vector(s)')) + self.catsLabel = StaticText(parent=self.controlPanelVector, + id=wx.ID_ANY, + label=_('Select category of vector(s)')) self.controlPanelSizerVector = wx.BoxSizer(wx.VERTICAL) # self.controlPanelSizer.Add(wx.StaticText(self.panel, id=wx.ID_ANY, @@ -275,21 +275,21 @@ # ------------ITEMS IN NOTEBOOK PAGE (LABELS)------------------------ self.controlPanelLabels = wx.Panel(parent=self.ntb, id=wx.ID_ANY) - self.titleLabel = wx.StaticText(parent=self.controlPanelLabels, - id=wx.ID_ANY, - label=_('Set title for the plot')) - self.title = wx.TextCtrl(parent=self.controlPanelLabels, id=wx.ID_ANY, - size=globalvar.DIALOG_TEXTCTRL_SIZE) - self.xLabel = wx.StaticText(parent=self.controlPanelLabels, - id=wx.ID_ANY, - label=_('Set label for X axis')) - self.x = wx.TextCtrl(parent=self.controlPanelLabels, id=wx.ID_ANY, - size=globalvar.DIALOG_TEXTCTRL_SIZE) - self.yLabel = wx.StaticText(parent=self.controlPanelLabels, - id=wx.ID_ANY, - label=_('Set label for Y axis')) - self.y = wx.TextCtrl(parent=self.controlPanelLabels, id=wx.ID_ANY, - size=globalvar.DIALOG_TEXTCTRL_SIZE) + self.titleLabel = StaticText(parent=self.controlPanelLabels, + id=wx.ID_ANY, + label=_('Set title for the plot')) + self.title = TextCtrl(parent=self.controlPanelLabels, id=wx.ID_ANY, + size=globalvar.DIALOG_TEXTCTRL_SIZE) + self.xLabel = StaticText(parent=self.controlPanelLabels, + id=wx.ID_ANY, + label=_('Set label for X axis')) + self.x = TextCtrl(parent=self.controlPanelLabels, id=wx.ID_ANY, + size=globalvar.DIALOG_TEXTCTRL_SIZE) + self.yLabel = StaticText(parent=self.controlPanelLabels, + id=wx.ID_ANY, + label=_('Set label for Y axis')) + self.y = TextCtrl(parent=self.controlPanelLabels, id=wx.ID_ANY, + size=globalvar.DIALOG_TEXTCTRL_SIZE) self.controlPanelSizerLabels = wx.BoxSizer(wx.VERTICAL) self.controlPanelSizerLabels.Add(self.titleLabel, flag=wx.EXPAND) self.controlPanelSizerLabels.Add(self.title, flag=wx.EXPAND) @@ -304,10 +304,10 @@ # ------------ITEMS IN NOTEBOOK PAGE (EXPORT)------------------------ self.controlPanelExport = wx.Panel(parent=self.ntb, id=wx.ID_ANY) - self.csvLabel = wx.StaticText(parent=self.controlPanelExport, - id=wx.ID_ANY, - label=_('Path for output CSV file ' - 'with plotted data')) + self.csvLabel = StaticText(parent=self.controlPanelExport, + id=wx.ID_ANY, + label=_('Path for output CSV file ' + 'with plotted data')) self.csvButton = filebrowse.FileBrowseButton(parent=self.controlPanelExport, id=wx.ID_ANY, size=globalvar.DIALOG_GSELECT_SIZE, @@ -316,10 +316,9 @@ buttonText=_('Browse'), startDirectory=os.getcwd(), fileMode=wx.FD_SAVE) - self.headerLabel = wx.StaticText(parent=self.controlPanelExport, - id=wx.ID_ANY, - label=_('Do you want the CSV header?' - )) + self.headerLabel = StaticText(parent=self.controlPanelExport, + id=wx.ID_ANY, + label=_('Do you want the CSV header?')) self.headerCheck = wx.CheckBox(parent=self.controlPanelExport, id=wx.ID_ANY) self.controlPanelSizerCheck = wx.BoxSizer(wx.HORIZONTAL) @@ -339,11 +338,11 @@ self.vButtPanel = wx.Panel(self.mainPanel, id=wx.ID_ANY) self.vButtSizer = wx.BoxSizer(wx.HORIZONTAL) - self.drawButton = wx.Button(self.vButtPanel, id=wx.ID_ANY, - label=_("Draw")) + self.drawButton = Button(self.vButtPanel, id=wx.ID_ANY, + label=_("Draw")) self.drawButton.Bind(wx.EVT_BUTTON, self.OnRedraw) - self.helpButton = wx.Button(self.vButtPanel, id=wx.ID_ANY, - label=_("Help")) + self.helpButton = Button(self.vButtPanel, id=wx.ID_ANY, + label=_("Help")) self.helpButton.Bind(wx.EVT_BUTTON, self.OnHelp) self.vButtSizer.Add(self.drawButton) self.vButtSizer.Add(self.helpButton) @@ -649,9 +648,9 @@ """Used to write CSV file of plotted data""" import csv if isinstance(y[0], list): - zipped = zip(x, *y) + zipped = list(zip(x, *y)) else: - zipped = zip(x, y) + zipped = list(zip(x, y)) with open(self.csvpath, "wb") as fi: writer = csv.writer(fi) if self.header: @@ -670,7 +669,7 @@ self.yticksPos.append(1) # TODO xdata = [] ydata = [] - for keys, values in self.timeDataR[name].iteritems(): + for keys, values in six.iteritems(self.timeDataR[name]): if keys in ['temporalType', 'granularity', 'validTopology', 'unit', 'temporalDataType']: continue @@ -685,7 +684,7 @@ return self.lookUp.AddDataset(yranges=ydata, xranges=xdata, datasetName=name) - color = self.colors.next() + color = next(self.colors) self.plots.append(self.axes2d.plot(xdata, ydata, marker='o', color=color, label=self.plotNameListR[i])[0]) @@ -711,9 +710,8 @@ xdata = [] ydata = [] xcsv = [] - for keys, values in self.timeDataV[ - name_cat[0]][ - name_cat[1]].iteritems(): + for keys, values in six.iteritems(self.timeDataV[name_cat[0]] + [name_cat[1]]): if keys in ['temporalType', 'granularity', 'validTopology', 'unit', 'temporalDataType']: continue @@ -733,7 +731,7 @@ continue self.lookUp.AddDataset(yranges=ydata, xranges=xdata, datasetName=name) - color = self.colors.next() + color = next(self.colors) self.plots.append( self.axes2d.plot( @@ -763,7 +761,7 @@ xdata = [] ydata = [] xcsv = [] - for keys, values in self.timeDataV[name].iteritems(): + for keys, values in six.iteritems(self.timeDataV[name]): if keys in ['temporalType', 'granularity', 'validTopology', 'unit', 'temporalDataType']: continue @@ -778,7 +776,7 @@ return self.lookUp.AddDataset(yranges=ydata, xranges=xdata, datasetName=name) - color = self.colors.next() + color = next(self.colors) self.plots.append(self.axes2d.plot(xdata, ydata, marker='o', color=color, label=name)[0]) @@ -911,8 +909,8 @@ tDict = tgis.tlist_grouped(type=typ, group_type=True, dbif=self.dbif) # nested list with '(map, mapset, etype)' items allDatasets = [[[(map, mapset, etype) for map in maps] - for etype, maps in etypesDict.iteritems()] - for mapset, etypesDict in tDict.iteritems()] + for etype, maps in six.iteritems(etypesDict)] + for mapset, etypesDict in six.iteritems(tDict)] # flatten this list if allDatasets: allDatasets = reduce(lambda x, y: x + y, reduce(lambda x, y: x + y, @@ -1070,7 +1068,7 @@ def GetInformation(self, x): values = {} - for key, value in self.data.iteritems(): + for key, value in six.iteritems(self.data): if value[x]: values[key] = [self.convert(x), value[x]] @@ -1083,7 +1081,7 @@ def InfoFormat(timeData, values): """Formats information about dataset""" text = [] - for key, val in values.iteritems(): + for key, val in six.iteritems(values): etype = timeData[key]['temporalDataType'] if etype == 'strds': text.append(_("Space time raster dataset: %s") % key) @@ -1186,7 +1184,7 @@ x = xData[np.argmin(abs(xData - x))] info = self.lookUp.GetInformation(x) - ys = zip(*info[1].values())[1] + ys = list(zip(*info[1].values()))[1] if not info: return # Update the annotation in the current axis.. diff -Nru grass-7.6.1/gui/wxpython/tplot/g.gui.tplot.html grass-7.8.0/gui/wxpython/tplot/g.gui.tplot.html --- grass-7.6.1/gui/wxpython/tplot/g.gui.tplot.html 2019-03-19 19:57:33.000000000 +0000 +++ grass-7.8.0/gui/wxpython/tplot/g.gui.tplot.html 2019-05-22 21:47:50.000000000 +0000 @@ -66,4 +66,4 @@ Fondazione Edmund Mach, Italy

-$Date: 2018-03-24 16:30:00 +0100 (Sat, 24 Mar 2018) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/tplot/g.gui.tplot.py grass-7.8.0/gui/wxpython/tplot/g.gui.tplot.py --- grass-7.6.1/gui/wxpython/tplot/g.gui.tplot.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/tplot/g.gui.tplot.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: g.gui.tplot.py @@ -114,7 +114,6 @@ from grass.script.setup import set_gui_path set_gui_path() - from core.utils import _ from core.giface import StandaloneGrassInterface try: from tplot.frame import TplotFrame diff -Nru grass-7.6.1/gui/wxpython/vdigit/dialogs.py grass-7.8.0/gui/wxpython/vdigit/dialogs.py --- grass-7.6.1/gui/wxpython/vdigit/dialogs.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vdigit/dialogs.py 2019-09-06 19:29:57.000000000 +0000 @@ -20,6 +20,7 @@ import sys import copy +import six import wx import wx.lib.mixins.listctrl as listmix @@ -27,8 +28,8 @@ from core.gcmd import RunCommand, GError from core.debug import Debug from core.settings import UserSettings -from core.utils import _ -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, StaticText, \ + StaticBox, Menu, ListCtrl class VDigitCategoryDialog(wx.Dialog, listmix.ColumnSorterMixin): @@ -74,7 +75,7 @@ style=style, **kwargs) # list of categories - box = wx.StaticBox( + box = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % _("List of categories - right-click to delete")) listSizer = wx.StaticBoxSizer(box, wx.VERTICAL) @@ -85,13 +86,13 @@ wx.LC_HRULES | wx.LC_VRULES) # sorter - self.fid = self.cats.keys()[0] + self.fid = list(self.cats.keys())[0] self.itemDataMap = self.list.Populate(self.cats[self.fid]) listmix.ColumnSorterMixin.__init__(self, 2) self.fidMulti = wx.Choice(parent=self, id=wx.ID_ANY, size=(150, -1)) self.fidMulti.Bind(wx.EVT_CHOICE, self.OnFeature) - self.fidText = wx.StaticText(parent=self, id=wx.ID_ANY) + self.fidText = StaticText(parent=self, id=wx.ID_ANY) if len(self.cats.keys()) == 1: self.fidMulti.Show(False) self.fidText.SetLabel(str(self.fid)) @@ -106,21 +107,21 @@ listSizer.Add(self.list, proportion=1, flag=wx.EXPAND) # add new category - box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Add new category")) + box = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Add new category")) addSizer = wx.StaticBoxSizer(box, wx.VERTICAL) flexSizer = wx.FlexGridSizer(cols=5, hgap=5, vgap=5) flexSizer.AddGrowableCol(3) - layerNewTxt = wx.StaticText(parent=self, id=wx.ID_ANY, - label="%s:" % _("Layer")) + layerNewTxt = StaticText(parent=self, id=wx.ID_ANY, + label="%s:" % _("Layer")) self.layerNew = wx.Choice(parent=self, id=wx.ID_ANY, size=(75, -1), choices=layers) if len(layers) > 0: self.layerNew.SetSelection(0) - catNewTxt = wx.StaticText(parent=self, id=wx.ID_ANY, - label="%s:" % _("Category")) + catNewTxt = StaticText(parent=self, id=wx.ID_ANY, + label="%s:" % _("Category")) try: newCat = max(self.cats[self.fid][1]) + 1 @@ -128,7 +129,7 @@ newCat = 1 self.catNew = SpinCtrl(parent=self, id=wx.ID_ANY, size=(75, -1), initial=newCat, min=0, max=1e9) - btnAddCat = wx.Button(self, wx.ID_ADD) + btnAddCat = Button(self, wx.ID_ADD) flexSizer.Add(layerNewTxt, proportion=0, flag=wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL) flexSizer.Add(self.layerNew, proportion=0, @@ -147,12 +148,12 @@ border=5) # buttons - btnApply = wx.Button(self, wx.ID_APPLY) - btnApply.SetToolTipString(_("Apply changes")) - btnCancel = wx.Button(self, wx.ID_CANCEL) - btnCancel.SetToolTipString(_("Ignore changes and close dialog")) - btnOk = wx.Button(self, wx.ID_OK) - btnOk.SetToolTipString(_("Apply changes and close dialog")) + btnApply = Button(self, wx.ID_APPLY) + btnApply.SetToolTip(_("Apply changes")) + btnCancel = Button(self, wx.ID_CANCEL) + btnCancel.SetToolTip(_("Ignore changes and close dialog")) + btnOk = Button(self, wx.ID_OK) + btnOk.SetToolTip(_("Apply changes and close dialog")) btnOk.SetDefault() # sizers @@ -171,8 +172,8 @@ flag=wx.EXPAND | wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5) fidSizer = wx.BoxSizer(wx.HORIZONTAL) - fidSizer.Add(wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Feature id:")), + fidSizer.Add(StaticText(parent=self, id=wx.ID_ANY, + label=_("Feature id:")), proportion=0, border=5, flag=wx.ALIGN_CENTER_VERTICAL) fidSizer.Add(self.fidMulti, proportion=0, @@ -280,7 +281,7 @@ self.Bind(wx.EVT_MENU, self.OnReload, id=self.popupID3) # generate popup-menu - menu = wx.Menu() + menu = Menu() menu.Append(self.popupID1, _("Delete selected")) if self.list.GetFirstSelected() == -1: menu.Enable(self.popupID1, False) @@ -413,7 +414,7 @@ newfid = -1 # add/delete new category - for action, catsCurr in check.iteritems(): + for action, catsCurr in six.iteritems(check): for layer in catsCurr[0].keys(): catList = [] for cat in catsCurr[0][layer]: @@ -525,7 +526,7 @@ self.cats_orig = copy.deepcopy(self.cats) # polulate list - self.fid = self.cats.keys()[0] + self.fid = list(self.cats.keys())[0] self.itemDataMap = self.list.Populate(self.cats[self.fid], update=True) @@ -553,7 +554,7 @@ return True -class CategoryListCtrl(wx.ListCtrl, +class CategoryListCtrl(ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.TextEditMixin): @@ -562,7 +563,7 @@ """List of layers/categories""" self.parent = parent - wx.ListCtrl.__init__(self, parent, id, pos, size, style) + ListCtrl.__init__(self, parent, id, pos, size, style) listmix.ListCtrlAutoWidthMixin.__init__(self) listmix.TextEditMixin.__init__(self) @@ -617,13 +618,13 @@ border = wx.BoxSizer(wx.VERTICAL) - txt = wx.StaticText( + txt = StaticText( parent=self, label=_("%d lines selected for z bulk-labeling") % nselected) border.Add(txt, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) - box = wx.StaticBox( + box = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % @@ -633,8 +634,8 @@ flexSizer.AddGrowableCol(0) # starting value - txt = wx.StaticText(parent=self, - label=_("Starting value")) + txt = StaticText(parent=self, + label=_("Starting value")) self.value = SpinCtrl(parent=self, id=wx.ID_ANY, size=(150, -1), initial=0, min=-1e6, max=1e6) @@ -645,8 +646,8 @@ flag=wx.ALIGN_CENTER | wx.FIXED_MINSIZE) # step - txt = wx.StaticText(parent=self, - label=_("Step")) + txt = StaticText(parent=self, + label=_("Step")) self.step = SpinCtrl(parent=self, id=wx.ID_ANY, size=(150, -1), initial=0, min=0, max=1e6) @@ -664,8 +665,8 @@ border.Add(sizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=0) # buttons - btnCancel = wx.Button(self, wx.ID_CANCEL) - btnOk = wx.Button(self, wx.ID_OK) + btnCancel = Button(self, wx.ID_CANCEL) + btnOk = Button(self, wx.ID_OK) btnOk.SetDefault() # sizers @@ -731,8 +732,8 @@ id += 1 # buttons - btnCancel = wx.Button(self, wx.ID_CANCEL) - btnOk = wx.Button(self, wx.ID_OK) + btnCancel = Button(self, wx.ID_CANCEL) + btnOk = Button(self, wx.ID_OK) btnOk.SetDefault() # sizers @@ -774,7 +775,7 @@ class CheckListFeature( - wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.CheckListCtrlMixin): + ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.CheckListCtrlMixin): def __init__(self, parent, data, pos=wx.DefaultPosition, log=None): @@ -783,8 +784,7 @@ self.parent = parent self.data = data - wx.ListCtrl.__init__(self, parent, wx.ID_ANY, - style=wx.LC_REPORT) + ListCtrl.__init__(self, parent, wx.ID_ANY, style=wx.LC_REPORT) listmix.CheckListCtrlMixin.__init__(self) diff -Nru grass-7.6.1/gui/wxpython/vdigit/g.gui.vdigit.html grass-7.8.0/gui/wxpython/vdigit/g.gui.vdigit.html --- grass-7.6.1/gui/wxpython/vdigit/g.gui.vdigit.html 2019-03-19 19:57:35.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vdigit/g.gui.vdigit.html 2019-05-18 15:50:04.000000000 +0000 @@ -307,4 +307,4 @@ University in Prague, Czech Republic

-$Date: 2018-10-14 21:39:26 +0200 (Sun, 14 Oct 2018) $ +$Date$ diff -Nru grass-7.6.1/gui/wxpython/vdigit/g.gui.vdigit.py grass-7.8.0/gui/wxpython/vdigit/g.gui.vdigit.py --- grass-7.6.1/gui/wxpython/vdigit/g.gui.vdigit.py 2019-03-19 19:57:48.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vdigit/g.gui.vdigit.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: g.gui.vdigit @@ -51,7 +51,6 @@ set_gui_path() from core.globalvar import CheckWxVersion - from core.utils import _ from core.render import Map from mapdisp.frame import MapFrame from mapdisp.main import DMonGrassInterface diff -Nru grass-7.6.1/gui/wxpython/vdigit/mapwindow.py grass-7.8.0/gui/wxpython/vdigit/mapwindow.py --- grass-7.6.1/gui/wxpython/vdigit/mapwindow.py 2019-03-19 19:57:49.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vdigit/mapwindow.py 2019-06-03 20:34:20.000000000 +0000 @@ -16,6 +16,7 @@ import wx import tempfile +import six from grass.pydispatch.signal import Signal @@ -24,7 +25,7 @@ from core.debug import Debug from mapwin.buffered import BufferedMapWindow from core.settings import UserSettings -from core.utils import ListOfCatsToRange, _ +from core.utils import ListOfCatsToRange from core.globalvar import QUERYLAYER from vdigit.dialogs import VDigitCategoryDialog, VDigitZBulkDialog, VDigitDuplicatesDialog from gui_core import gselect @@ -277,9 +278,9 @@ dbInfo = gselect.VectorDBInfo(vectorName) sqlfile = tempfile.NamedTemporaryFile(mode="w") for fid in fids: - for layer, cats in self.digit.GetLineCats(fid).iteritems(): + for layer, cats in six.iteritems(self.digit.GetLineCats(fid)): table = dbInfo.GetTable(layer) - for attrb, item in vdigit['geomAttr'].iteritems(): + for attrb, item in six.iteritems(vdigit['geomAttr']): val = -1 if attrb == 'length': val = self.digit.GetLineLength(fid) diff -Nru grass-7.6.1/gui/wxpython/vdigit/preferences.py grass-7.8.0/gui/wxpython/vdigit/preferences.py --- grass-7.6.1/gui/wxpython/vdigit/preferences.py 2019-03-19 19:57:49.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vdigit/preferences.py 2019-06-03 20:34:20.000000000 +0000 @@ -15,6 +15,7 @@ """ import textwrap +import six import wx import wx.lib.colourselect as csel @@ -24,8 +25,8 @@ from gui_core.gselect import ColumnSelect from core.units import Units from core.settings import UserSettings -from core.utils import _ -from gui_core.wrap import SpinCtrl, Button +from gui_core.wrap import SpinCtrl, Button, StaticText, \ + StaticBox class VDigitSettingsDialog(wx.Dialog): @@ -104,7 +105,7 @@ self.symbology = {} for label, key in self._symbologyData(): - textLabel = wx.StaticText(panel, wx.ID_ANY, label) + textLabel = StaticText(panel, wx.ID_ANY, label) color = csel.ColourSelect( panel, id=wx.ID_ANY, colour=UserSettings.Get( group='vdigit', key='symbol', subkey=[ @@ -154,7 +155,7 @@ # # display section # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -163,13 +164,13 @@ flexSizer = wx.FlexGridSizer(cols=3, hgap=5, vgap=5) flexSizer.AddGrowableCol(0) # line width - text = wx.StaticText(parent=panel, id=wx.ID_ANY, label=_("Line width")) + text = StaticText(parent=panel, id=wx.ID_ANY, label=_("Line width")) self.lineWidthValue = SpinCtrl( parent=panel, id=wx.ID_ANY, size=(75, -1), initial=UserSettings.Get( group='vdigit', key="lineWidth", subkey='value'), min=1, max=1e6) - units = wx.StaticText( + units = StaticText( parent=panel, id=wx.ID_ANY, size=(115, -1), label=UserSettings.Get( group='vdigit', key="lineWidth", subkey='units'), @@ -195,7 +196,7 @@ # # snapping section # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -205,7 +206,7 @@ flexSizer.AddGrowableCol(0) # snapping - text = wx.StaticText( + text = StaticText( parent=panel, id=wx.ID_ANY, label=_("Snapping threshold")) @@ -245,7 +246,7 @@ subkey='enabled')) vertexSizer.Add(self.snapVertex, proportion=0, flag=wx.EXPAND) self.mapUnits = self.parent.MapWindow.Map.GetProjInfo()['units'] - self.snappingInfo = wx.StaticText( + self.snappingInfo = StaticText( parent=panel, id=wx.ID_ANY, label=_("Snapping threshold is %(value).1f %(units)s") % {'value': self.digit.GetDisplay().GetThreshold(), @@ -261,7 +262,7 @@ # # select box # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -282,7 +283,7 @@ # threshold flexSizer = wx.FlexGridSizer(cols=3, hgap=5, vgap=5) flexSizer.AddGrowableCol(0) - text = wx.StaticText( + text = StaticText( parent=panel, id=wx.ID_ANY, label=_("Select threshold")) @@ -291,7 +292,7 @@ initial=UserSettings.Get( group='vdigit', key="selectThresh", subkey='value'), min=1, max=1e6) - units = wx.StaticText( + units = StaticText( parent=panel, id=wx.ID_ANY, size=(115, -1), label=UserSettings.Get( group='vdigit', key="lineWidth", subkey='units'), @@ -340,7 +341,7 @@ # # digitize lines box # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Digitize lines/boundaries")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) @@ -365,7 +366,7 @@ # # digitize areas box # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -392,7 +393,7 @@ # # save-on-exit box # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -427,7 +428,7 @@ # # query tool box # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -466,7 +467,7 @@ border=1) flexSizer = wx.FlexGridSizer(cols=4, hgap=5, vgap=5) flexSizer.AddGrowableCol(0) - txt = wx.StaticText( + txt = StaticText( parent=panel, id=wx.ID_ANY, label=_("Select lines")) @@ -486,7 +487,7 @@ group='vdigit', key="queryLength", subkey='thresh')) - units = wx.StaticText( + units = StaticText( parent=panel, id=wx.ID_ANY, label="%s" % @@ -520,7 +521,7 @@ border=1) flexSizer = wx.FlexGridSizer(cols=4, hgap=5, vgap=5) flexSizer.AddGrowableCol(0) - txt = wx.StaticText( + txt = StaticText( parent=panel, id=wx.ID_ANY, label=_("Select dangles")) @@ -540,7 +541,7 @@ group='vdigit', key="queryDangle", subkey='thresh')) - units = wx.StaticText( + units = StaticText( parent=panel, id=wx.ID_ANY, label="%s" % @@ -586,7 +587,7 @@ # # add new record # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % @@ -612,7 +613,7 @@ settings = ((_("Layer"), 1), (_("Category"), 1), (_("Mode"), _("Next to use"))) # layer - text = wx.StaticText(parent=panel, id=wx.ID_ANY, label=_("Layer")) + text = StaticText(parent=panel, id=wx.ID_ANY, label=_("Layer")) self.layer = SpinCtrl(parent=panel, id=wx.ID_ANY, size=(125, -1), min=1, max=1e3) self.layer.SetValue(int(UserSettings.Get( @@ -621,7 +622,7 @@ flexSizer.Add(self.layer, proportion=0, flag=wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL) # category number - text = wx.StaticText( + text = StaticText( parent=panel, id=wx.ID_ANY, label=_("Category number")) @@ -637,7 +638,7 @@ flexSizer.Add(self.category, proportion=0, flag=wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL) # category mode - text = wx.StaticText( + text = StaticText( parent=panel, id=wx.ID_ANY, label=_("Category mode")) @@ -663,7 +664,7 @@ # # delete existing record # - box = wx.StaticBox( + box = StaticBox( parent=panel, id=wx.ID_ANY, label=" %s " % _("Delete existing feature(s)")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) @@ -687,8 +688,8 @@ # # geometry attributes (currently only length and area are supported) # - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s " % _("Geometry attributes")) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s " % _("Geometry attributes")) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(hgap=3, vgap=3) self.geomAttrb = {'length': {'label': _('length')}, @@ -767,8 +768,8 @@ note = '\n'.join(textwrap.wrap(_("Note: These settings are stored " "in the workspace not in the vector digitizer " "preferences."), 55)) - gridSizer.Add(wx.StaticText(parent=panel, id=wx.ID_ANY, - label=note), + gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, + label=note), pos=(3, 0), span=(1, 3)) gridSizer.AddGrowableCol(0) @@ -817,7 +818,7 @@ checked = event.IsChecked() id = event.GetId() key = None - for attrb, val in self.geomAttrb.iteritems(): + for attrb, val in six.iteritems(self.geomAttrb): if val['check'] == id: key = attrb break @@ -985,7 +986,7 @@ if self.parent.GetLayerManager(): self.parent.GetLayerManager().WorkspaceChanged() # geometry attributes # symbology - for key, (enabled, color) in self.symbology.iteritems(): + for key, (enabled, color) in six.iteritems(self.symbology): if enabled: UserSettings.Set(group='vdigit', key='symbol', subkey=[key, 'enabled'], @@ -1033,7 +1034,7 @@ item = tree.FindItemByData('maplayer', mapLayer) else: item = None - for key, val in self.geomAttrb.iteritems(): + for key, val in six.iteritems(self.geomAttrb): checked = self.FindWindowById(val['check']).IsChecked() column = self.FindWindowById(val['column']).GetValue() unitsIdx = self.FindWindowById(val['units']).GetSelection() diff -Nru grass-7.6.1/gui/wxpython/vdigit/toolbars.py grass-7.8.0/gui/wxpython/vdigit/toolbars.py --- grass-7.6.1/gui/wxpython/vdigit/toolbars.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vdigit/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,12 +21,11 @@ from gui_core.toolbars import BaseToolbar, BaseIcons from gui_core.dialogs import CreateNewVector, VectorDialog -from gui_core.wrap import PseudoDC +from gui_core.wrap import PseudoDC, Menu from vdigit.preferences import VDigitSettingsDialog from core.debug import Debug from core.settings import UserSettings from core.gcmd import GError, RunCommand -from core.utils import _ from icons.icon import MetaIcon from iclass.digit import IClassVDigit from core.giface import Notification @@ -553,7 +552,7 @@ def OnAdditionalToolMenu(self, event): """Menu for additional tools""" point = wx.GetMousePosition() - toolMenu = wx.Menu() + toolMenu = Menu() for label, itype, handler, desc in ( (_('Break selected lines/boundaries at intersection'), diff -Nru grass-7.6.1/gui/wxpython/vdigit/wxdigit.py grass-7.8.0/gui/wxpython/vdigit/wxdigit.py --- grass-7.6.1/gui/wxpython/vdigit/wxdigit.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vdigit/wxdigit.py 2019-06-03 20:34:20.000000000 +0000 @@ -28,6 +28,7 @@ from __future__ import print_function +import six import grass.script.core as grass from grass.pydispatch.signal import Signal @@ -35,10 +36,13 @@ from core.gcmd import GError from core.debug import Debug from core.settings import UserSettings -from core.utils import _ from vdigit.wxdisplay import DisplayDriver, GetLastError try: + WindowsError +except NameError: + WindowsError = OSError +try: from grass.lib.gis import * from grass.lib.vector import * from grass.lib.vedit import * @@ -1763,7 +1767,7 @@ Vect_cidx_get_cat_by_index(self.poMapInfo, i, j, byref(cat), byref(type), byref(id)) if field in self.cats: - if cat > self.cats[field]: + if self.cats[field] is None or cat.value > self.cats[field]: self.cats[field] = cat.value else: self.cats[field] = cat.value @@ -1774,7 +1778,7 @@ self.cats[field]) # set default values - for field, cat in self.cats.iteritems(): + for field, cat in six.iteritems(self.cats): if cat is None: self.cats[field] = 0 # first category 1 Debug.msg( diff -Nru grass-7.6.1/gui/wxpython/vdigit/wxdisplay.py grass-7.8.0/gui/wxpython/vdigit/wxdisplay.py --- grass-7.6.1/gui/wxpython/vdigit/wxdisplay.py 2019-03-19 19:57:38.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vdigit/wxdisplay.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,14 +20,22 @@ from __future__ import print_function import locale +import six +import os +import sys import wx from core.debug import Debug from core.settings import UserSettings -from core.utils import _ +from core.gcmd import DecodeString +from gui_core.wrap import Rect try: + WindowsError +except NameError: + WindowsError = OSError +try: from grass.lib.gis import * from grass.lib.vector import * from grass.lib.vedit import * @@ -43,6 +51,8 @@ """Redirect stderr""" global log if log: + if sys.version_info.major >= 3: + msg = DecodeString(msg.data) log.write(msg + os.linesep) else: print(msg) @@ -336,19 +346,21 @@ pdc.SetPen(pen) pdc.SetIdBounds( dcId - 1, - wx.Rect( + Rect( point_beg.x, point_beg.y, 0, 0)) - pdc.SetIdBounds(dcId, wx.RectPP(point_beg, point_end)) + pdc.SetIdBounds(dcId, Rect(point_beg.x, point_beg.y, + point_end.x - point_beg.x, + point_end.y - point_beg.y)) pdc.DrawLine(point_beg.x, point_beg.y, point_end.x, point_end.y) i += 1 dcId += 2 pdc.SetIdBounds( dcId - 1, - wx.Rect( + Rect( robj.point[ robj.npoints - 1].x, robj.point[ @@ -891,7 +903,7 @@ points.x[idx], points.y[idx], points.z[idx]) - rect = wx.Rect(vx, vy, 0, 0) + rect = Rect(vx, vy, 0, 0) self.dc.SetIdBounds(DCid, rect) DCid += 2 @@ -1176,7 +1188,7 @@ catsDict[layer].append(cats.cat[i]) catsStr = '' - for l, c in catsDict.iteritems(): + for l, c in six.iteritems(catsDict): catsStr = '%d: (%s)' % (l, ','.join(map(str, c))) return catsStr diff -Nru grass-7.6.1/gui/wxpython/vnet/dialogs.py grass-7.8.0/gui/wxpython/vnet/dialogs.py --- grass-7.6.1/gui/wxpython/vnet/dialogs.py 2019-03-19 19:57:12.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vnet/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -27,6 +27,10 @@ import os import sys import types +import six + +if sys.version_info.major >= 3: + unicode = str from copy import copy from grass.script import core as grass @@ -44,7 +48,6 @@ from core import globalvar, utils from core.gcmd import RunCommand, GMessage from core.settings import UserSettings -from core.utils import _ from dbmgr.base import DbMgrBase from dbmgr.vinfo import VectorDBInfo @@ -52,7 +55,8 @@ from gui_core.widgets import GNotebook from gui_core.goutput import GConsoleWindow from gui_core.gselect import Select, LayerSelect, ColumnSelect -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, BitmapButton, StaticText, \ + StaticBox, TextCtrl from vnet.widgets import PointsList from vnet.toolbars import MainToolbar, PointListToolbar, AnalysisToolbar @@ -227,11 +231,11 @@ maxDistPanel = wx.Panel(parent=anSettingsPanel) maxValue = 1e8 - listBox = wx.StaticBox(parent=pointsPanel, id=wx.ID_ANY, - label=" %s " % _("Points for analysis:")) + listBox = StaticBox(parent=pointsPanel, id=wx.ID_ANY, + label=" %s " % _("Points for analysis:")) listSizer = wx.StaticBoxSizer(listBox, wx.VERTICAL) - anSettingsBox = wx.StaticBox(parent=anSettingsPanel, id=wx.ID_ANY, - label=" %s " % _("Analysis settings:")) + anSettingsBox = StaticBox(parent=anSettingsPanel, id=wx.ID_ANY, + label=" %s " % _("Analysis settings:")) anSettingsSizer = wx.StaticBoxSizer(anSettingsBox, wx.VERTICAL) self.notebook.AddPage(page=pointsPanel, @@ -246,7 +250,7 @@ dialog=self, vnet_mgr=self.vnet_mgr) - maxDistLabel = wx.StaticText( + maxDistLabel = StaticText( parent=maxDistPanel, id=wx.ID_ANY, label=_("Maximum distance of point to the network:")) self.anSettings["max_dist"] = SpinCtrl( @@ -262,11 +266,11 @@ #self.anSettings["show_cut"].Bind(wx.EVT_CHECKBOX, self.OnShowCut) isoLinesPanel = wx.Panel(parent=anSettingsPanel) - isoLineslabel = wx.StaticText( + isoLineslabel = StaticText( parent=isoLinesPanel, id=wx.ID_ANY, label=_("Iso lines:")) - self.anSettings["iso_lines"] = wx.TextCtrl( + self.anSettings["iso_lines"] = TextCtrl( parent=isoLinesPanel, id=wx.ID_ANY) self.anSettings["iso_lines"].Bind( wx.EVT_TEXT, lambda event: self.IsoLines()) @@ -379,9 +383,9 @@ # self.useTurns = wx.CheckBox(parent = dataPanel, id=wx.ID_ANY, # label = _('Use turns')) - box = wx.StaticBox(dataPanel, -1, "Vector map and layers for analysis") + box = StaticBox(dataPanel, -1, "Vector map and layers for analysis") bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) - box2 = wx.StaticBox(dataPanel, -1, "Costs") + box2 = StaticBox(dataPanel, -1, "Costs") bsizer2 = wx.StaticBoxSizer(box2, wx.VERTICAL) selPanels = {} @@ -400,10 +404,10 @@ "layer-vector-add.png")) icon.Rescale(18, 18) icon = wx.BitmapFromImage(icon) - self.addToTreeBtn = wx.BitmapButton( + self.addToTreeBtn = BitmapButton( parent=selPanels[dataSel[0]], bitmap=icon, size=globalvar.DIALOG_COLOR_SIZE) - self.addToTreeBtn.SetToolTipString( + self.addToTreeBtn.SetToolTip( _("Add vector map into layer tree")) self.addToTreeBtn.Disable() self.addToTreeBtn.Bind(wx.EVT_BUTTON, self.OnToTreeBtn) @@ -415,8 +419,8 @@ self.inputData[dataSel[0]] = dataSel[2]( parent=selPanels[dataSel[0]], size=(-1, -1)) - label[dataSel[0]] = wx.StaticText(parent=selPanels[dataSel[0]], - name=dataSel[0]) + label[dataSel[0]] = StaticText(parent=selPanels[dataSel[0]], + name=dataSel[0]) label[dataSel[0]].SetLabel(dataSel[1]) self.inputData['input'].Bind(wx.EVT_TEXT, self.OnVectSel) @@ -797,7 +801,7 @@ def _setInputData(self): params = {} - for k, v in self.inputData.iteritems(): + for k, v in six.iteritems(self.inputData): params[k] = v.GetValue() flags = {} self.vnet_mgr.SetParams(params, flags) @@ -974,7 +978,7 @@ used_cols = [] attrCols = an_props["cmdParams"]["cols"] - for col in attrCols.iterkeys(): + for col in six.iterkeys(attrCols): if "inputField" in attrCols[col]: colInptF = attrCols[col]["inputField"] @@ -1154,7 +1158,7 @@ def SetData(self, key, data): idx = self._findIndex(key) - for k, v in data.iteritems(): + for k, v in six.iteritems(data): if k == "use": if v and not self.IsChecked(idx): @@ -1206,14 +1210,14 @@ self.settings = {} # create all staticboxes before creating widgets, needed for Mac - otherBox = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Other settings")) + otherBox = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Other settings")) otherBoxSizer = wx.StaticBoxSizer(otherBox, wx.VERTICAL) - ptsStyleBox = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Point style:")) + ptsStyleBox = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Point style:")) ptsStyleBoxSizer = wx.StaticBoxSizer(ptsStyleBox, wx.VERTICAL) - styleBox = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Analysis result style:")) + styleBox = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Analysis result style:")) styleBoxSizer = wx.StaticBoxSizer(styleBox, wx.VERTICAL) rules = RunCommand('v.colors', @@ -1222,7 +1226,7 @@ settsLabels = {} - settsLabels['color_table'] = wx.StaticText( + settsLabels['color_table'] = StaticText( parent=self, id=wx.ID_ANY, label=_('Color table style %s:') % @@ -1267,8 +1271,8 @@ "point_colors", _("Color for selected point:")]} - for settKey, sett in self.colorsSetts.iteritems(): - settsLabels[settKey] = wx.StaticText( + for settKey, sett in six.iteritems(self.colorsSetts): + settsLabels[settKey] = StaticText( parent=self, id=wx.ID_ANY, label=sett[1]) col = UserSettings.Get(group='vnet', key=sett[0], subkey=settKey) self.settings[settKey] = csel.ColourSelect( @@ -1283,8 +1287,8 @@ "max_hist_steps": ["other", _("Maximum number of results in history:")] } - for settKey, sett in self.sizeSetts.iteritems(): - settsLabels[settKey] = wx.StaticText( + for settKey, sett in six.iteritems(self.sizeSetts): + settsLabels[settKey] = StaticText( parent=self, id=wx.ID_ANY, label=sett[1]) self.settings[settKey] = SpinCtrl( parent=self, id=wx.ID_ANY, min=1, max=50) @@ -1296,20 +1300,20 @@ self.settings[settKey].SetValue(size) # buttons - self.btnSave = wx.Button(self, wx.ID_SAVE) - self.btnApply = wx.Button(self, wx.ID_APPLY) - self.btnClose = wx.Button(self, wx.ID_CLOSE) + self.btnSave = Button(self, wx.ID_SAVE) + self.btnApply = Button(self, wx.ID_APPLY) + self.btnClose = Button(self, wx.ID_CLOSE) self.btnApply.SetDefault() # bindings self.btnApply.Bind(wx.EVT_BUTTON, self.OnApply) - self.btnApply.SetToolTipString( + self.btnApply.SetToolTip( _("Apply changes for the current session")) self.btnSave.Bind(wx.EVT_BUTTON, self.OnSave) - self.btnSave.SetToolTipString( + self.btnSave.SetToolTip( _("Apply and save changes to user settings file (default for next sessions)")) self.btnClose.Bind(wx.EVT_BUTTON, self.OnClose) - self.btnClose.SetToolTipString(_("Close dialog")) + self.btnClose.SetToolTip(_("Close dialog")) # Layout @@ -1443,14 +1447,14 @@ UserSettings.Set(group='vnet', key="res_style", subkey='line_width', value=self.settings["line_width"].GetValue()) - for settKey, sett in self.colorsSetts.iteritems(): + for settKey, sett in six.iteritems(self.colorsSetts): col = tuple(self.settings[settKey].GetColour()) UserSettings.Set(group='vnet', key=sett[0], subkey=settKey, value=col) - for settKey, sett in self.sizeSetts.iteritems(): + for settKey, sett in six.iteritems(self.sizeSetts): UserSettings.Set(group='vnet', key=sett[0], subkey=settKey, value=self.settings[settKey].GetValue()) @@ -1483,7 +1487,7 @@ """Create turntable dialog.""" wx.Dialog.__init__(self, parent, id, title=_(title), style=style) - box = wx.StaticBox(self, -1, "Vector map and layers for analysis") + box = StaticBox(self, -1, "Vector map and layers for analysis") bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) label = {} dataSelects = [ @@ -1510,15 +1514,15 @@ self.inputData[dataSel[0]] = dataSel[2]( parent=selPanels[dataSel[0]], size=(-1, -1)) - label[dataSel[0]] = wx.StaticText(parent=selPanels[dataSel[0]], - name=dataSel[0]) + label[dataSel[0]] = StaticText(parent=selPanels[dataSel[0]], + name=dataSel[0]) label[dataSel[0]].SetLabel(dataSel[1]) self.inputData['input'].Bind(wx.EVT_TEXT, lambda event: self.InputSel) # buttons - self.btnCancel = wx.Button(self, wx.ID_CANCEL) - self.btnOk = wx.Button(self, wx.ID_OK) + self.btnCancel = Button(self, wx.ID_CANCEL) + self.btnOk = Button(self, wx.ID_OK) self.btnOk.SetDefault() # Layout @@ -1537,7 +1541,7 @@ bsizer.Add(selPanels[sel], proportion=0, flag=wx.EXPAND) - for k, v in init_data.iteritems(): + for k, v in six.iteritems(init_data): if k in self.inputData: self.inputData[k].SetValue(v) @@ -1615,7 +1619,7 @@ def GetData(self): params = {} - for param, sel in self.inputData.iteritems(): + for param, sel in six.iteritems(self.inputData): params[param] = sel.GetValue() return params @@ -1629,8 +1633,8 @@ wx.Dialog.__init__(self, parent, id, title=_(title), style=style) self.panel = wx.Panel(parent=self) - box = wx.StaticBox(parent=self.panel, id=wx.ID_ANY, - label="Vector map") + box = StaticBox(parent=self.panel, id=wx.ID_ANY, + label="Vector map") self.boxSizer = wx.StaticBoxSizer(box, wx.HORIZONTAL) @@ -1639,12 +1643,12 @@ parent=self.panel, type='vector', mapsets=[grass.gisenv()['MAPSET']], size=(-1, -1)) - self.vectSellabel = wx.StaticText(parent=self.panel, id=wx.ID_ANY, - label=_("Name:")) + self.vectSellabel = StaticText(parent=self.panel, id=wx.ID_ANY, + label=_("Name:")) # buttons - self.btnCancel = wx.Button(self.panel, wx.ID_CANCEL) - self.btnOk = wx.Button(self.panel, wx.ID_OK) + self.btnCancel = Button(self.panel, wx.ID_CANCEL) + self.btnOk = Button(self.panel, wx.ID_OK) self.btnOk.SetDefault() self.SetInitialSize((400, -1)) @@ -1791,9 +1795,9 @@ self.angle_list = TurnAnglesList(parent=self, data=self.data) - self.btnAdd = wx.Button(parent=self, id=wx.ID_ANY, label="Add") - self.btnRemove = wx.Button(parent=self, id=wx.ID_ANY, label="Remove") - self.btnClose = wx.Button(parent=self, id=wx.ID_CLOSE) + self.btnAdd = Button(parent=self, id=wx.ID_ANY, label="Add") + self.btnRemove = Button(parent=self, id=wx.ID_ANY, label="Remove") + self.btnClose = Button(parent=self, id=wx.ID_CLOSE) self.useUTurns = wx.CheckBox( parent=self, id=wx.ID_ANY, label="Use U-turns") diff -Nru grass-7.6.1/gui/wxpython/vnet/toolbars.py grass-7.8.0/gui/wxpython/vnet/toolbars.py --- grass-7.6.1/gui/wxpython/vnet/toolbars.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vnet/toolbars.py 2019-06-03 20:34:20.000000000 +0000 @@ -22,7 +22,6 @@ from icons.icon import MetaIcon from gui_core.toolbars import BaseToolbar, BaseIcons from core.gcmd import RunCommand -from core.utils import _ class PointListToolbar(BaseToolbar): diff -Nru grass-7.6.1/gui/wxpython/vnet/vnet_core.py grass-7.8.0/gui/wxpython/vnet/vnet_core.py --- grass-7.6.1/gui/wxpython/vnet/vnet_core.py 2019-03-19 19:57:12.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vnet/vnet_core.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,6 +20,7 @@ """ import os +import six from grass.script.utils import try_remove from grass.script import core as grass from grass.script.task import cmdlist_to_tuple @@ -29,7 +30,6 @@ from core import utils from core.gcmd import RunCommand, GMessage from core.gconsole import CmdThread, EVT_CMD_DONE, GConsole -from core.utils import _ from gui_core.gselect import VectorDBInfo @@ -509,7 +509,7 @@ cmdParams.append("output=" + output) cats = {} - for cat_name, pts_coor in catPts.iteritems(): + for cat_name, pts_coor in six.iteritems(catPts): for coor in pts_coor: cat_num = str( @@ -527,7 +527,7 @@ else: cats[cat_name] = [cat_num] - for cat_name, cat_nums in cats.iteritems(): + for cat_name, cat_nums in six.iteritems(cats): cmdParams.append(cat_name + "=" + ",".join(cat_nums)) self.tmpTurnAn = AddTmpMapAnalysisMsg( @@ -679,7 +679,7 @@ self._setCmdForSpecificAn(cmdParams) - for catName, catNum in catsNums.iteritems(): + for catName, catNum in six.iteritems(catsNums): if catNum[0] == catNum[1]: cmdParams.append(catName + "=" + str(catNum[0])) else: @@ -736,8 +736,8 @@ """ inParams = [] - for col, v in self.data.GetAnalysisProperties()["cmdParams"][ - "cols"].iteritems(): + for col, v in six.iteritems(self.data.GetAnalysisProperties()["cmdParams"] + ["cols"]): if "inputField" in v: colInptF = v["inputField"] @@ -786,7 +786,7 @@ pt_ascii = "" catNum = maxCat - for catName, pts in catPts.iteritems(): + for catName, pts in six.iteritems(catPts): catsNums[catName] = [catNum + 1] for pt in pts: @@ -871,7 +871,7 @@ return # delete temporary maps in history steps which were deleted - for removedStep in removedHistData.itervalues(): + for removedStep in six.itervalues(removedHistData): mapsNames = removedStep["tmp_data"]["maps"] for vectMapName in mapsNames: tmpMap = self.tmp_maps.GetTmpVectMap(vectMapName) @@ -917,7 +917,7 @@ # update parameters params = {} histInputData = histStepData["an_params"] - for inpName, inp in histInputData.iteritems(): + for inpName, inp in six.iteritems(histInputData): params[inpName] = str(inp) if inpName == "input": inpMap = inp @@ -969,7 +969,7 @@ subkey=[ptName, "checked"], value=data["use"]) - for param, value in params.iteritems(): + for param, value in six.iteritems(params): if param == "input": inpMap = VectMap(self, value) diff -Nru grass-7.6.1/gui/wxpython/vnet/vnet_data.py grass-7.8.0/gui/wxpython/vnet/vnet_data.py --- grass-7.6.1/gui/wxpython/vnet/vnet_data.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vnet/vnet_data.py 2019-06-03 20:34:20.000000000 +0000 @@ -24,6 +24,7 @@ """ import os import types +import six from copy import deepcopy from grass.script.utils import try_remove @@ -36,7 +37,6 @@ from core import utils from core.gcmd import RunCommand, GMessage from core.settings import UserSettings -from core.utils import _ from vnet.vnet_utils import ParseMapStr, SnapToNode @@ -177,11 +177,13 @@ return False errLayerStr = "" - for layer, layerLabel in { + vals = { 'arc_layer': _("arc layer"), 'node_layer': _("node layer"), 'turn_layer': _("turntable layer"), - 'turn_cat_layer': _("unique categories layer")}.iteritems(): + 'turn_cat_layer': _("unique categories layer") + } + for layer, layerLabel in six.iteritems(vals): if layer in ["turn_layer", "turn_cat_layer"] and not flags["t"]: continue @@ -327,7 +329,7 @@ "pts_data": pts_data}) def SetPointData(self, pt_id, data): - for col, v in data.iteritems(): + for col, v in six.iteritems(data): if col == 'use': continue @@ -402,7 +404,7 @@ textProp = self.pointsToDraw.GetPropertyVal("text") textProp["font"].SetPointSize(ptSize + 2) - for colKey, col in colors.iteritems(): + for colKey, col in six.iteritems(colors): pen = self.pointsToDraw.GetPen(colKey) if pen: pen.SetColour(wx.Colour(col[0], col[1], col[2], 255)) @@ -419,7 +421,7 @@ width=ptWidth)) def ParametersChanged(self, method, kwargs): - if "analysis" in kwargs["changed_params"].keys(): + if "analysis" in list(kwargs["changed_params"].keys()): self._updateTypeCol() if self.an_params.GetParam("analysis")[0] == "v.net.path": @@ -441,7 +443,7 @@ pt_list_data = [None] * len(self.cols['name']) - for k, val in pt_data.iteritems(): + for k, val in six.iteritems(pt_data): pt_list_data[self.cols["name"].index(k)] = val return pt_list_data @@ -599,7 +601,7 @@ i_red = 0 hidden_cols.sort() for idx in hidden_cols: - for dt in cols_data.itervalues(): + for dt in six.itervalues(cols_data): dt.pop(idx - i_red) i_red += 1 @@ -632,7 +634,7 @@ def SetParams(self, params, flags): changed_params = {} - for p, v in params.iteritems(): + for p, v in six.iteritems(params): if p == "analysis" and v not in self.an_props.used_an: continue @@ -648,7 +650,7 @@ changed_params[p] = v changed_flags = {} - for p, v in flags.iteritems(): + for p, v in six.iteritems(flags): if p in self.flags: self.flags[p] = v changed_flags[p] = v @@ -721,7 +723,7 @@ except (KeyError, ValueError): table = None - if not table or not params[col] in columnchoices.keys(): + if not table or not params[col] in list(columnchoices.keys()): invParams.append(col) continue @@ -893,7 +895,7 @@ #"v.net.steiner" ] - for an in self.vnetProperties.keys(): + for an in list(self.vnetProperties.keys()): if an not in self.used_an: del self.vnetProperties[an] continue @@ -922,7 +924,7 @@ cols = self.vnetProperties[analysis]["cmdParams"]["cols"] - for col, v in cols.iteritems(): + for col, v in six.iteritems(cols): if "inputField" in col: colInptF = v["inputField"] else: @@ -1282,8 +1284,8 @@ def _saveNewHistStep(self, newHist): """Save buffer (new step) data into file""" newHist.write('%s%s%s' % (os.linesep, "history step=0", os.linesep)) - for key in self.newHistStepData.keys(): - subkeys = self.newHistStepData[key].keys() + for key in list(self.newHistStepData.keys()): + subkeys = list(self.newHistStepData[key].keys()) newHist.write('%s%s' % (key, self.sep)) for idx in range(len(subkeys)): value = self.newHistStepData[key][subkeys[idx]] @@ -1291,7 +1293,7 @@ if idx > 0: newHist.write('%s%s%s' % (os.linesep, key, self.sep)) newHist.write('%s%s' % (subkeys[idx], self.sep)) - kvalues = self.newHistStepData[key][subkeys[idx]].keys() + kvalues = list(self.newHistStepData[key][subkeys[idx]].keys()) srange = range(len(kvalues)) for sidx in srange: svalue = self._parseValue( diff -Nru grass-7.6.1/gui/wxpython/vnet/vnet_utils.py grass-7.8.0/gui/wxpython/vnet/vnet_utils.py --- grass-7.6.1/gui/wxpython/vnet/vnet_utils.py 2019-03-19 19:57:10.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vnet/vnet_utils.py 2019-06-03 20:34:20.000000000 +0000 @@ -20,7 +20,6 @@ import math from grass.script import core as grass -from core.utils import _ try: import grass.lib.vector as vectlib diff -Nru grass-7.6.1/gui/wxpython/vnet/widgets.py grass-7.8.0/gui/wxpython/vnet/widgets.py --- grass-7.6.1/gui/wxpython/vnet/widgets.py 2019-03-19 19:57:12.000000000 +0000 +++ grass-7.8.0/gui/wxpython/vnet/widgets.py 2019-06-03 20:34:20.000000000 +0000 @@ -19,14 +19,19 @@ """ import os -import wx +import sys +import six from copy import copy, deepcopy import wx -from wx.lib.mixins.listctrl import CheckListCtrlMixin, ColumnSorterMixin, ListCtrlAutoWidthMixin, TextEditMixin +from wx.lib.mixins.listctrl import CheckListCtrlMixin, ColumnSorterMixin, \ + ListCtrlAutoWidthMixin, TextEditMixin from core import globalvar -from core.utils import _ +from gui_core.wrap import Button, StaticText, StaticBox, TextCtrl + +if sys.version_info.major >= 3: + basestring = str class PointsList(wx.ListCtrl, @@ -170,7 +175,7 @@ self.selIdxs.append(itemIndexes) - for hCol in self.hiddenCols.itervalues(): + for hCol in six.itervalues(self.hiddenCols): defVal = hCol['colsData'][iDefVal] if type(hCol['colsData'][iColEd]).__name__ == "list": hCol['itemDataMap'].append(hCol['colsData'][iColEd][defVal]) @@ -184,7 +189,7 @@ itemData[0] = self.selectedkey + 1 self.itemDataMap.append(copy(itemData)) - self.Append(map(str, itemData)) + self.Append(list(map(str, itemData))) self.selected = self.GetItemCount() - 1 self.SetItemData(self.selected, self.selectedkey) @@ -287,7 +292,7 @@ self.selIdxs.pop(key) # update hidden columns - for hCol in self.hiddenCols.itervalues(): + for hCol in six.itervalues(self.hiddenCols): hCol['itemDataMap'].pop(key) hCol['selIdxs'].pop(key) @@ -552,8 +557,8 @@ panel = wx.Panel(parent=self) sizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=panel, id=wx.ID_ANY, - label=" %s %s " % (_(itemCap), str(pointNo + 1))) + box = StaticBox(parent=panel, id=wx.ID_ANY, + label=" %s %s " % (_(itemCap), str(pointNo + 1))) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) # source coordinates @@ -584,18 +589,18 @@ if validator: self.fields.append( - wx.TextCtrl( + TextCtrl( parent=panel, id=wx.ID_ANY, validator=validator, size=(150, -1))) else: - self.fields.append(wx.TextCtrl(parent=panel, id=wx.ID_ANY, - size=(150, -1))) + self.fields.append(TextCtrl(parent=panel, id=wx.ID_ANY, + size=(150, -1))) value = cell[1] if not isinstance(cell[1], basestring): value = str(cell[1]) self.fields[iField].SetValue(value) - label = wx.StaticText( + label = StaticText( parent=panel, id=wx.ID_ANY, label=_( @@ -629,8 +634,8 @@ # # buttons # - self.btnCancel = wx.Button(panel, wx.ID_CANCEL) - self.btnOk = wx.Button(panel, wx.ID_OK) + self.btnCancel = Button(panel, wx.ID_CANCEL) + self.btnOk = Button(panel, wx.ID_OK) self.btnOk.SetDefault() btnSizer = wx.StdDialogButtonSizer() diff -Nru grass-7.6.1/gui/wxpython/web_services/dialogs.py grass-7.8.0/gui/wxpython/web_services/dialogs.py --- grass-7.6.1/gui/wxpython/web_services/dialogs.py 2019-03-19 19:57:42.000000000 +0000 +++ grass-7.8.0/gui/wxpython/web_services/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -22,6 +22,7 @@ import os import sys +import six import shutil from copy import deepcopy @@ -32,11 +33,11 @@ from core import globalvar from core.debug import Debug from core.gcmd import GMessage, GWarning, GError, RunCommand -from core.utils import GetSettingsPath, _ +from core.utils import GetSettingsPath from core.gconsole import CmdThread, GStderr, EVT_CMD_DONE, EVT_CMD_OUTPUT from gui_core.gselect import Select -from gui_core.wrap import Button +from gui_core.wrap import Button, StaticText, StaticBox, TextCtrl from web_services.widgets import WSPanel, WSManageSettingsWidget @@ -91,13 +92,13 @@ parent=self, settingsFile=settingsFile, default_servers=self.default_servers) - self.settingsBox = wx.StaticBox(parent=self, - id=wx.ID_ANY, - label=_(" Server settings ")) - - self.serverText = wx.StaticText(parent=self, - id=wx.ID_ANY, label=_("Server:")) - self.server = wx.TextCtrl(parent=self, id=wx.ID_ANY) + self.settingsBox = StaticBox(parent=self, + id=wx.ID_ANY, + label=_(" Server settings ")) + + self.serverText = StaticText(parent=self, + id=wx.ID_ANY, label=_("Server:")) + self.server = TextCtrl(parent=self, id=wx.ID_ANY) self.btn_connect = Button(parent=self, id=wx.ID_ANY, label=_("&Connect")) @@ -122,16 +123,16 @@ self.reqDataPanel = wx.Panel(parent=self, id=wx.ID_ANY) - self.layerNameBox = wx.StaticBox(parent=self.reqDataPanel, - id=wx.ID_ANY, - label=_(" Layer Manager Settings ")) + self.layerNameBox = StaticBox(parent=self.reqDataPanel, + id=wx.ID_ANY, + label=_(" Layer Manager Settings ")) - self.layerNameText = wx.StaticText( + self.layerNameText = StaticText( parent=self.reqDataPanel, id=wx.ID_ANY, label=_("Output layer name:")) - self.layerName = wx.TextCtrl(parent=self.reqDataPanel, id=wx.ID_ANY) + self.layerName = TextCtrl(parent=self.reqDataPanel, id=wx.ID_ANY) - for ws in self.ws_panels.iterkeys(): + for ws in six.iterkeys(self.ws_panels): # set class WSPanel argument layerNameTxtCtrl self.ws_panels[ws]['panel'] = WSPanel(parent=self.reqDataPanel, web_service=ws) @@ -212,7 +213,7 @@ reqDataSizer.Add(self.ch_ws_sizer, proportion=0, flag=wx.TOP | wx.EXPAND, border=5) - for ws in self.ws_panels.iterkeys(): + for ws in six.iterkeys(self.ws_panels): reqDataSizer.Add( self.ws_panels[ws]['panel'], proportion=1, @@ -253,14 +254,14 @@ def MakeAdvConnPane(self, pane): """Create advanced connection settings pane """ - self.usernameText = wx.StaticText(parent=pane, - id=wx.ID_ANY, label=_("Username:")) - self.username = wx.TextCtrl(parent=pane, id=wx.ID_ANY) - - self.passwText = wx.StaticText(parent=pane, - id=wx.ID_ANY, label=_("Password:")) - self.password = wx.TextCtrl(parent=pane, id=wx.ID_ANY, - style=wx.TE_PASSWORD) + self.usernameText = StaticText(parent=pane, + id=wx.ID_ANY, label=_("Username:")) + self.username = TextCtrl(parent=pane, id=wx.ID_ANY) + + self.passwText = StaticText(parent=pane, + id=wx.ID_ANY, label=_("Password:")) + self.password = TextCtrl(parent=pane, id=wx.ID_ANY, + style=wx.TE_PASSWORD) # pane layout adv_conn_sizer = wx.BoxSizer(wx.VERTICAL) @@ -310,7 +311,7 @@ def OnSettingsChanged(self, data): """Update widgets according to chosen settings""" # data list: [server, username, password] - if len < 3: + if len(data) < 3: return self.server.SetValue(data[0]) @@ -339,7 +340,7 @@ def _getCapFiles(self): ws_cap_files = {} - for v in self.ws_panels.itervalues(): + for v in six.itervalues(self.ws_panels): ws_cap_files[v['panel'].GetWebService()] = v['panel'].GetCapFile() return ws_cap_files @@ -364,7 +365,7 @@ lname = event.GetString() lname = lname.encode('ascii', 'replace') - for v in self.ws_panels.itervalues(): + for v in six.itervalues(self.ws_panels): v['panel'].SetOutputLayerName(lname.strip()) def OnConnect(self, event): @@ -388,7 +389,7 @@ # number of panels already connected self.finished_panels_num = 0 - for ws in self.ws_panels.iterkeys(): + for ws in six.iterkeys(self.ws_panels): self.ws_panels[ws]['panel'].ConnectToServer( url=server, username=self.username.GetValue(), password=self.password.GetValue()) @@ -421,7 +422,7 @@ :return: list of found web services on server (identified as keys in self.ws_panels) """ conn_ws = [] - for ws, data in self.ws_panels.iteritems(): + for ws, data in six.iteritems(self.ws_panels): if data['panel'].IsConnected(): conn_ws.append(ws) @@ -648,7 +649,7 @@ self.revert_cmd = cmd ws_cap = self._getWSfromCmd(cmd) - for ws in self.ws_panels.iterkeys(): + for ws in six.iterkeys(self.ws_panels): # cap file used in cmd will be deleted, thnaks to the dialogs # destructor if ws == ws_cap and 'capfile' in cmd[1]: @@ -663,12 +664,12 @@ self.btn_ok.SetDefault() def __del__(self): - for f in self.revert_ws_cap_files.itervalues(): + for f in six.itervalues(self.revert_ws_cap_files): grass.try_remove(f) def _setRevertCapFiles(self, ws_cap_files): - for ws, f in ws_cap_files.iteritems(): + for ws, f in six.iteritems(ws_cap_files): if os.path.isfile(ws_cap_files[ws]): shutil.copyfile(f, self.revert_ws_cap_files[ws]) else: @@ -726,7 +727,7 @@ self.layerName.SetValue(cmd[1]['map']) - for ws, data in self.ws_panels.iteritems(): + for ws, data in six.iteritems(self.ws_panels): cap_file = None if ws in ws_cap_files: @@ -742,7 +743,7 @@ """ conn = {'url': '', 'username': '', 'password': ''} - for k in conn.iterkeys(): + for k in six.iterkeys(conn): if k in cmd[1]: conn[k] = cmd[1][k] return conn @@ -853,7 +854,7 @@ self.labels = {} self.params = {} - self.labels['output'] = wx.StaticText( + self.labels['output'] = StaticText( parent=self, id=wx.ID_ANY, label=_("Name for output raster map:")) self.params['output'] = Select( @@ -863,8 +864,8 @@ grass.gisenv()['MAPSET']], size=globalvar.DIALOG_GSELECT_SIZE) - self.regionStBoxLabel = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Export region")) + self.regionStBoxLabel = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Export region")) self.region_types_order = ['display', 'comp', 'named'] self.region_types = {} @@ -887,7 +888,7 @@ label=_("Overwrite existing raster map")) self.named_reg_panel = wx.Panel(parent=self, id=wx.ID_ANY) - self.labels['region'] = wx.StaticText( + self.labels['region'] = StaticText( parent=self.named_reg_panel, id=wx.ID_ANY, label=_("Choose named region:")) diff -Nru grass-7.6.1/gui/wxpython/web_services/widgets.py grass-7.8.0/gui/wxpython/web_services/widgets.py --- grass-7.6.1/gui/wxpython/web_services/widgets.py 2019-03-19 19:57:47.000000000 +0000 +++ grass-7.8.0/gui/wxpython/web_services/widgets.py 2019-06-03 20:34:20.000000000 +0000 @@ -18,6 +18,7 @@ import os import sys +import six import shutil from copy import deepcopy @@ -49,13 +50,13 @@ from core.debug import Debug from core.gcmd import GWarning, GMessage from core.gconsole import CmdThread, GStderr, EVT_CMD_DONE, EVT_CMD_OUTPUT -from core.utils import _ from web_services.cap_interface import WMSCapabilities, WMTSCapabilities, OnEarthCapabilities from gui_core.widgets import GNotebook from gui_core.widgets import ManageSettingsWidget -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \ + TextCtrl import grass.script as grass @@ -139,7 +140,7 @@ self.cmd_thread = CmdThread(self) self.cap_file = grass.tempfile() - reqDataBox = wx.StaticBox( + reqDataBox = StaticBox( parent=self, label=_(" Requested data settings ")) self._nb_sizer = wx.StaticBoxSizer(reqDataBox, wx.VERTICAL) self.notebook = GNotebook(parent=self, @@ -171,8 +172,8 @@ name='request') # list of layers - self.layersBox = wx.StaticBox(parent=self.req_page_panel, id=wx.ID_ANY, - label=_("List of layers ")) + self.layersBox = StaticBox(parent=self.req_page_panel, id=wx.ID_ANY, + label=_("List of layers ")) style = wx.TR_DEFAULT_STYLE | wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT if self.drv_props['req_multiple_layers']: @@ -188,7 +189,7 @@ self.params['srs'] = None if 'srs' not in self.drv_props['ignored_params']: - projText = wx.StaticText( + projText = StaticText( parent=self.req_page_panel, id=wx.ID_ANY, label=_("Source projection:")) self.params['srs'] = wx.Choice( @@ -257,22 +258,22 @@ labels = {} self.l_odrder_list = None if 'WMS' in self.ws: - labels['l_order'] = wx.StaticBox( + labels['l_order'] = StaticBox( parent=adv_setts_panel, id=wx.ID_ANY, label=_("Order of layers in raster")) self.l_odrder_list = wx.ListBox( adv_setts_panel, id=wx.ID_ANY, choices=[], style=wx.LB_SINGLE | wx.LB_NEEDED_SB) - self.btnUp = wx.Button( + self.btnUp = Button( adv_setts_panel, id=wx.ID_ANY, label=_("Up")) - self.btnDown = wx.Button( + self.btnDown = Button( adv_setts_panel, id=wx.ID_ANY, label=_("Down")) self.btnUp.Bind(wx.EVT_BUTTON, self.OnUp) self.btnDown.Bind(wx.EVT_BUTTON, self.OnDown) - labels['method'] = wx.StaticText(parent=adv_setts_panel, id=wx.ID_ANY, - label=_("Reprojection method:")) + labels['method'] = StaticText(parent=adv_setts_panel, id=wx.ID_ANY, + label=_("Reprojection method:")) self.reproj_methods = ['nearest', 'linear', 'cubic', 'cubicspline'] self.params['method'] = wx.Choice( @@ -284,13 +285,13 @@ _('Cubic interpolation'), _('Cubic spline interpolation')]) - labels['maxcols'] = wx.StaticText( + labels['maxcols'] = StaticText( parent=adv_setts_panel, id=wx.ID_ANY, label=_("Maximum columns to request from server at time:")) self.params['maxcols'] = SpinCtrl( parent=adv_setts_panel, id=wx.ID_ANY, size=(100, -1)) - labels['maxrows'] = wx.StaticText( + labels['maxrows'] = StaticText( parent=adv_setts_panel, id=wx.ID_ANY, label=_("Maximum rows to request from server at time:")) self.params['maxrows'] = SpinCtrl( @@ -312,7 +313,7 @@ label=_("Do not request transparent data")) self.flags['o'].Bind(wx.EVT_CHECKBOX, self.OnTransparent) - labels['bgcolor'] = wx.StaticText( + labels['bgcolor'] = StaticText( parent=adv_setts_panel, id=wx.ID_ANY, label=_("Background color:")) self.params['bgcolor'] = csel.ColourSelect( @@ -322,10 +323,10 @@ self.params['urlparams'] = None if self.params['urlparams'] not in self.drv_props['ignored_params']: - labels['urlparams'] = wx.StaticText( + labels['urlparams'] = StaticText( parent=adv_setts_panel, id=wx.ID_ANY, label=_("Additional query parameters for server:")) - self.params['urlparams'] = wx.TextCtrl( + self.params['urlparams'] = TextCtrl( parent=adv_setts_panel, id=wx.ID_ANY) # layout @@ -521,7 +522,7 @@ } conn_cmd = [] - for k, v in self.conn.iteritems(): + for k, v in six.iteritems(self.conn): if v: conn_cmd.append("%s=%s" % (k, v)) @@ -635,7 +636,7 @@ if 'method' in dcmd: params['method'] = dcmd['method'] - for p, v in params.iteritems(): + for p, v in six.iteritems(params): if self.params[p]: self.params[p].SetStringSelection(v) @@ -1163,8 +1164,8 @@ def _layout(self): - self.btnAddDefaultServers = wx.Button(parent=self, id=wx.ID_ANY, - label=_("Add default")) + self.btnAddDefaultServers = Button(parent=self, id=wx.ID_ANY, + label=_("Add default")) self.btnAddDefaultServers.Bind(wx.EVT_BUTTON, self.OnAddDefaultServers) ManageSettingsWidget._layout(self) @@ -1176,8 +1177,8 @@ setts = self.GetSettings() self.servers_to_add = {} - for k, v in self.default_servers.iteritems(): - if k not in setts.iterkeys(): + for k, v in six.iteritems(self.default_servers): + if k not in six.iterkeys(setts): self.servers_to_add[k] = v elif v != setts[k]: GMessage(parent=self, diff -Nru grass-7.6.1/gui/wxpython/wxgui.py grass-7.8.0/gui/wxpython/wxgui.py --- grass-7.6.1/gui/wxpython/wxgui.py 2019-03-19 19:57:15.000000000 +0000 +++ grass-7.8.0/gui/wxpython/wxgui.py 2019-06-03 20:34:20.000000000 +0000 @@ -24,12 +24,15 @@ import getopt import atexit -from core import globalvar -from core.utils import _, registerPid, unregisterPid - +# i18n is taken care of in the grass library code. +# So we need to import it before any of the GUI code. from grass.exceptions import Usage from grass.script.core import set_raise_on_error +from core import globalvar +from core.utils import registerPid, unregisterPid + + import wx try: import wx.lib.agw.advancedsplash as SC diff -Nru grass-7.6.1/gui/wxpython/wxplot/base.py grass-7.8.0/gui/wxpython/wxplot/base.py --- grass-7.6.1/gui/wxpython/wxplot/base.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/wxplot/base.py 2019-06-03 20:34:20.000000000 +0000 @@ -17,6 +17,7 @@ import os import sys +import six import wx @@ -27,7 +28,7 @@ from core.render import Map from icons.icon import MetaIcon from gui_core.toolbars import BaseIcons -from core.utils import _ +from gui_core.wrap import Menu import grass.script as grass @@ -127,12 +128,12 @@ for assigning colors to images in imagery groups""" self.colorDict = {} - for clr in grass.named_colors.iterkeys(): + for clr in six.iterkeys(grass.named_colors): if clr == 'white': continue - r = grass.named_colors[clr][0] * 255 - g = grass.named_colors[clr][1] * 255 - b = grass.named_colors[clr][2] * 255 + r = int(grass.named_colors[clr][0] * 255) + g = int(grass.named_colors[clr][1] * 255) + b = int(grass.named_colors[clr][2] * 255) self.colorDict[clr] = (r, g, b, 255) def InitPlotOpts(self, plottype): @@ -512,7 +513,7 @@ """Popup menu for plot and text options """ point = wx.GetMousePosition() - popt = wx.Menu() + popt = Menu() # Add items to the menu settext = wx.MenuItem(popt, wx.ID_ANY, _('Text settings')) popt.AppendItem(settext) @@ -606,7 +607,7 @@ """Print options and output menu """ point = wx.GetMousePosition() - printmenu = wx.Menu() + printmenu = Menu() for title, handler in ((_("Page setup"), self.OnPageSetup), (_("Print preview"), self.OnPrintPreview), (_("Print display"), self.OnDoPrint)): diff -Nru grass-7.6.1/gui/wxpython/wxplot/dialogs.py grass-7.8.0/gui/wxpython/wxplot/dialogs.py --- grass-7.6.1/gui/wxpython/wxplot/dialogs.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/wxplot/dialogs.py 2019-06-03 20:34:20.000000000 +0000 @@ -28,9 +28,9 @@ from core import globalvar from core.settings import UserSettings from core.globalvar import ICONDIR -from core.utils import _ from gui_core.gselect import Select -from gui_core.wrap import SpinCtrl +from gui_core.wrap import SpinCtrl, Button, StaticText, \ + StaticBox, TextCtrl, Choice from grass.script import core as grass @@ -79,7 +79,7 @@ rastText = rastText.rstrip(',') txt = _("Select raster map(s) to profile:") - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=txt) + label = StaticText(parent=self, id=wx.ID_ANY, label=txt) box.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) @@ -102,11 +102,11 @@ btnsizer = wx.StdDialogButtonSizer() - btn = wx.Button(self, wx.ID_OK) + btn = Button(self, wx.ID_OK) btn.SetDefault() btnsizer.AddButton(btn) - btn = wx.Button(self, wx.ID_CANCEL) + btn = Button(self, wx.ID_CANCEL) btnsizer.AddButton(btn) btnsizer.Realize() @@ -178,7 +178,7 @@ # select rasters txt = _("Select pairs of raster maps for bivariate scatterplots:") - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=txt) + label = StaticText(parent=self, id=wx.ID_ANY, label=txt) box.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) @@ -191,8 +191,8 @@ box.Add(selection, pos=(0, 1)) # Nsteps for FP maps - label = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Number of bins (for FP maps)")) + label = StaticText(parent=self, id=wx.ID_ANY, + label=_("Number of bins (for FP maps)")) box.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(1, 0)) self.spinbins = SpinCtrl( @@ -228,11 +228,11 @@ btnsizer = wx.StdDialogButtonSizer() - btn = wx.Button(self, wx.ID_OK) + btn = Button(self, wx.ID_OK) btn.SetDefault() btnsizer.AddButton(btn) - btn = wx.Button(self, wx.ID_CANCEL) + btn = Button(self, wx.ID_CANCEL) btnsizer.AddButton(btn) btnsizer.Realize() @@ -314,7 +314,7 @@ sizer = wx.BoxSizer(wx.VERTICAL) txtSizer = wx.BoxSizer(wx.VERTICAL) - statstitle = wx.StaticText( + statstitle = StaticText( parent=self.panel, id=wx.ID_ANY, label=self.title) @@ -326,7 +326,7 @@ sizer.Add(line, proportion=0, flag=wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=3) for stats in self.message: - statstxt = wx.StaticText(parent=sp, id=wx.ID_ANY, label=stats) + statstxt = StaticText(parent=sp, id=wx.ID_ANY, label=stats) statstxt.SetBackgroundColour("WHITE") txtSizer.Add( statstxt, @@ -357,8 +357,8 @@ # btnSizer = wx.BoxSizer(wx.HORIZONTAL) - btn_clipboard = wx.Button(self.panel, id=wx.ID_COPY, label=_('C&opy')) - btn_clipboard.SetToolTipString( + btn_clipboard = Button(self.panel, id=wx.ID_COPY, label=_('C&opy')) + btn_clipboard.SetToolTip( _("Copy regression statistics the clipboard (Ctrl+C)")) btnSizer.Add( btn_clipboard, @@ -366,7 +366,7 @@ flag=wx.ALIGN_LEFT | wx.ALL, border=5) - btnCancel = wx.Button(self.panel, wx.ID_CLOSE) + btnCancel = Button(self.panel, wx.ID_CLOSE) btnCancel.SetDefault() btnSizer.Add( btnCancel, @@ -463,8 +463,8 @@ # # Select a raster to histogram # - label = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Select raster map:")) + label = StaticText(parent=self, id=wx.ID_ANY, + label=_("Select raster map:")) box.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(1, 0)) self.rselection = Select(self, id=wx.ID_ANY, size=globalvar.DIALOG_GSELECT_SIZE, @@ -482,8 +482,8 @@ # # Select an image group to histogram # - label = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Select image group:")) + label = StaticText(parent=self, id=wx.ID_ANY, + label=_("Select image group:")) box.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(2, 0)) self.gselection = Select(self, id=wx.ID_ANY, size=globalvar.DIALOG_GSELECT_SIZE, @@ -498,8 +498,8 @@ # # Nsteps for FP maps and histogram type selection # - label = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Number of bins (for FP maps)")) + label = StaticText(parent=self, id=wx.ID_ANY, + label=_("Number of bins (for FP maps)")) box.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(3, 0)) self.spinbins = SpinCtrl( @@ -511,8 +511,8 @@ box.Add(self.spinbins, flag=wx.ALIGN_CENTER_VERTICAL, pos=(3, 1)) - label = wx.StaticText(parent=self, id=wx.ID_ANY, - label=_("Histogram type")) + label = StaticText(parent=self, id=wx.ID_ANY, + label=_("Histogram type")) box.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(4, 0)) types = ['count', 'percent', 'area'] @@ -533,11 +533,11 @@ btnsizer = wx.StdDialogButtonSizer() - btn = wx.Button(self, wx.ID_OK) + btn = Button(self, wx.ID_OK) btn.SetDefault() btnsizer.AddButton(btn) - btn = wx.Button(self, wx.ID_CANCEL) + btn = Button(self, wx.ID_CANCEL) btnsizer.AddButton(btn) btnsizer.Realize() @@ -660,20 +660,20 @@ # dialog layout sizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Text settings")) + box = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Text settings")) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) # # profile title # - label = wx.StaticText( + label = StaticText( parent=self, id=wx.ID_ANY, label=_("Profile title:")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) - self.ptitleentry = wx.TextCtrl( + self.ptitleentry = TextCtrl( parent=self, id=wx.ID_ANY, value="", size=(250, -1)) # self.ptitleentry.SetFont(self.font) self.ptitleentry.SetValue(self.ptitle) @@ -682,7 +682,7 @@ # # title font # - tlabel = wx.StaticText( + tlabel = StaticText( parent=self, id=wx.ID_ANY, label=_("Title font size (pts):")) @@ -699,12 +699,12 @@ # # x-axis label # - label = wx.StaticText( + label = StaticText( parent=self, id=wx.ID_ANY, label=_("X-axis label:")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(2, 0)) - self.xlabelentry = wx.TextCtrl( + self.xlabelentry = TextCtrl( parent=self, id=wx.ID_ANY, value="", size=(250, -1)) # self.xlabelentry.SetFont(self.font) self.xlabelentry.SetValue(self.xlabel) @@ -713,12 +713,12 @@ # # y-axis label # - label = wx.StaticText( + label = StaticText( parent=self, id=wx.ID_ANY, label=_("Y-axis label:")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(3, 0)) - self.ylabelentry = wx.TextCtrl( + self.ylabelentry = TextCtrl( parent=self, id=wx.ID_ANY, value="", size=(250, -1)) # self.ylabelentry.SetFont(self.font) self.ylabelentry.SetValue(self.ylabel) @@ -727,7 +727,7 @@ # # font size # - llabel = wx.StaticText( + llabel = StaticText( parent=self, id=wx.ID_ANY, label=_("Label font size (pts):")) @@ -747,22 +747,22 @@ # # font settings # - box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Font settings")) + box = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Font settings")) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) # # font family # - label1 = wx.StaticText( + label1 = StaticText( parent=self, id=wx.ID_ANY, label=_("Font family:")) gridSizer.Add(label1, flag=wx.ALIGN_CENTER_VERTICAL, pos=(0, 0)) self.ffamilycb = wx.ComboBox( parent=self, id=wx.ID_ANY, size=(250, -1), - choices=self.ffamilydict.keys(), + choices=list(self.ffamilydict.keys()), style=wx.CB_DROPDOWN) self.ffamilycb.SetStringSelection('swiss') for item in self.ffamilydict.items(): @@ -774,11 +774,11 @@ # # font style # - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Style:")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Style:")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(1, 0)) self.fstylecb = wx.ComboBox( parent=self, id=wx.ID_ANY, size=(250, -1), - choices=self.fstyledict.keys(), + choices=list(self.fstyledict.keys()), style=wx.CB_DROPDOWN) self.fstylecb.SetStringSelection('normal') for item in self.fstyledict.items(): @@ -790,11 +790,11 @@ # # font weight # - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Weight:")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Weight:")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(2, 0)) self.fwtcb = wx.ComboBox( parent=self, size=(250, -1), - choices=self.fwtdict.keys(), + choices=list(self.fwtdict.keys()), style=wx.CB_DROPDOWN) self.fwtcb.SetStringSelection('normal') for item in self.fwtdict.items(): @@ -818,24 +818,24 @@ # # buttons # - btnSave = wx.Button(self, wx.ID_SAVE) - btnApply = wx.Button(self, wx.ID_APPLY) - btnOk = wx.Button(self, wx.ID_OK) - btnCancel = wx.Button(self, wx.ID_CANCEL) + btnSave = Button(self, wx.ID_SAVE) + btnApply = Button(self, wx.ID_APPLY) + btnOk = Button(self, wx.ID_OK) + btnCancel = Button(self, wx.ID_CANCEL) btnOk.SetDefault() # bindings btnApply.Bind(wx.EVT_BUTTON, self.OnApply) - btnApply.SetToolTipString(_("Apply changes for the current session")) + btnApply.SetToolTip(_("Apply changes for the current session")) btnOk.Bind(wx.EVT_BUTTON, self.OnOk) - btnOk.SetToolTipString( + btnOk.SetToolTip( _("Apply changes for the current session and close dialog")) btnOk.SetDefault() btnSave.Bind(wx.EVT_BUTTON, self.OnSave) - btnSave.SetToolTipString( + btnSave.SetToolTip( _("Apply and save changes to user settings file (default for next sessions)")) btnCancel.Bind(wx.EVT_BUTTON, self.OnCancel) - btnCancel.SetToolTipString(_("Close dialog and ignore changes")) + btnCancel.SetToolTip(_("Close dialog and ignore changes")) # sizers btnStdSizer = wx.StdDialogButtonSizer() @@ -982,8 +982,8 @@ """ sizer = wx.BoxSizer(wx.VERTICAL) - box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Plot settings")) + box = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Plot settings")) boxMainSizer = wx.StaticBoxSizer(box, wx.HORIZONTAL) self.wxId['pcolor'] = 0 @@ -1003,8 +1003,8 @@ if len(self.rasterList) == 0: return - box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=_("Map/image plotted")) + box = StaticBox(parent=self, id=wx.ID_ANY, + label=_("Map/image plotted")) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) @@ -1014,9 +1014,9 @@ for i in self.rasterList: choicelist.append(str(i)) - self.mapchoice = wx.Choice(parent=self, id=wx.ID_ANY, size=(300, -1), + self.mapchoice = Choice(parent=self, id=wx.ID_ANY, size=(300, -1), choices=choicelist) - self.mapchoice.SetToolTipString(_("Settings for selected map")) + self.mapchoice.SetToolTip(_("Settings for selected map")) if not self.map: self.map = self.rasterList[self.mapchoice.GetCurrentSelection()] @@ -1031,7 +1031,7 @@ # if self.plottype != 'scatter': row += 1 - label = wx.StaticText( + label = StaticText( parent=self, id=wx.ID_ANY, label=_("Line color")) @@ -1048,7 +1048,7 @@ gridSizer.Add(color, pos=(row, 1)) row += 1 - label = wx.StaticText( + label = StaticText( parent=self, id=wx.ID_ANY, label=_("Line width")) @@ -1066,7 +1066,7 @@ gridSizer.Add(width, pos=(row, 1)) row += 1 - label = wx.StaticText( + label = StaticText( parent=self, id=wx.ID_ANY, label=_("Line style")) @@ -1076,18 +1076,18 @@ pos=( row, 0)) - style = wx.Choice( + style = Choice( parent=self, id=wx.ID_ANY, size=( - 120, -1), choices=self.linestyledict.keys()) + 120, -1), choices=list(self.linestyledict.keys())) style.SetStringSelection(self.raster[self.map]['pstyle']) self.wxId['pstyle'] = style.GetId() gridSizer.Add(style, pos=(row, 1)) row += 1 - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Legend")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Legend")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) - legend = wx.TextCtrl(parent=self, id=wx.ID_ANY, - value="", size=(200, -1)) + legend = TextCtrl(parent=self, id=wx.ID_ANY, + value="", size=(200, -1)) legend.SetValue(self.raster[self.map]['plegend']) gridSizer.Add(legend, pos=(row, 1)) self.wxId['plegend'] = legend.GetId() @@ -1099,14 +1099,14 @@ # segment marker settings for profiles only # if self.plottype == 'profile': - box = wx.StaticBox( + box = StaticBox( parent=self, id=wx.ID_ANY, label=" %s " % _("Transect segment marker settings")) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Color")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Color")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, @@ -1120,7 +1120,7 @@ self.wxId['marker']['color'] = ptcolor.GetId() gridSizer.Add(ptcolor, pos=(0, 1)) - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Size")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Size")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, @@ -1134,41 +1134,41 @@ self.wxId['marker']['size'] = ptsize.GetId() gridSizer.Add(ptsize, pos=(1, 1)) - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Fill")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Fill")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, pos=( 2, 0)) - ptfill = wx.Choice(parent=self, id=wx.ID_ANY, - size=(120, -1), choices=self.ptfilldict.keys()) + ptfill = Choice(parent=self, id=wx.ID_ANY, + size=(120, -1), choices=list(self.ptfilldict.keys())) ptfill.SetStringSelection(self.properties['marker']['fill']) self.wxId['marker']['fill'] = ptfill.GetId() gridSizer.Add(ptfill, pos=(2, 1)) - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Legend")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Legend")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, pos=( 3, 0)) - ptlegend = wx.TextCtrl( + ptlegend = TextCtrl( parent=self, id=wx.ID_ANY, value="", size=( 200, -1)) ptlegend.SetValue(self.properties['marker']['legend']) self.wxId['marker']['legend'] = ptlegend.GetId() gridSizer.Add(ptlegend, pos=(3, 1)) - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Style")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Style")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, pos=( 4, 0)) - pttype = wx.Choice( + pttype = Choice( parent=self, size=(200, -1), choices=self.pttypelist) pttype.SetStringSelection(self.properties['marker']['type']) @@ -1182,13 +1182,13 @@ # point options for scatterplots # elif self.plottype == 'scatter': - box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Scatterplot points")) + box = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Scatterplot points")) boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Color")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Color")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, @@ -1201,7 +1201,7 @@ self.wxId['pcolor'] = ptcolor.GetId() gridSizer.Add(ptcolor, pos=(0, 1)) - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Size")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Size")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, @@ -1215,41 +1215,41 @@ self.wxId['psize'] = ptsize.GetId() gridSizer.Add(ptsize, pos=(1, 1)) - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Fill")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Fill")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, pos=( 2, 0)) - ptfill = wx.Choice(parent=self, id=wx.ID_ANY, - size=(120, -1), choices=self.ptfilldict.keys()) + ptfill = Choice(parent=self, id=wx.ID_ANY, + size=(120, -1), choices=list(self.ptfilldict.keys())) ptfill.SetStringSelection(self.raster[self.map]['pfill']) self.wxId['pfill'] = ptfill.GetId() gridSizer.Add(ptfill, pos=(2, 1)) - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Legend")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Legend")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, pos=( 3, 0)) - ptlegend = wx.TextCtrl( + ptlegend = TextCtrl( parent=self, id=wx.ID_ANY, value="", size=( 200, -1)) ptlegend.SetValue(self.raster[self.map]['plegend']) self.wxId['plegend'] = ptlegend.GetId() gridSizer.Add(ptlegend, pos=(3, 1)) - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Style")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Style")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, pos=( 4, 0)) - pttype = wx.Choice( + pttype = Choice( parent=self, size=(200, -1), choices=self.pttypelist) pttype.SetStringSelection(self.raster[self.map]['ptype']) @@ -1264,8 +1264,8 @@ # # axis options for all plots # - box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Axis settings")) + box = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Axis settings")) boxMainSizer = wx.StaticBoxSizer(box, wx.HORIZONTAL) middleSizer = wx.BoxSizer(wx.HORIZONTAL) @@ -1273,32 +1273,32 @@ idx = 0 for axis, atype in [(_("X-Axis"), 'x-axis'), (_("Y-Axis"), 'y-axis')]: - box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % axis) + box = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % axis) boxSizer = wx.StaticBoxSizer(box, wx.HORIZONTAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) prop = self.properties[atype]['prop'] row = 0 - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Scale")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Scale")) gridSizer.Add( label, flag=wx.ALIGN_CENTER_VERTICAL, pos=( row, 0)) - type = wx.Choice( + type = Choice( parent=self, id=wx.ID_ANY, size=( 100, -1), choices=self.axislist) type.SetStringSelection(prop['type']) - type.SetToolTipString( + type.SetToolTip( _("Automatic axis scaling, custom max and min, or scale matches data range (min)")) self.wxId[atype]['type'] = type.GetId() gridSizer.Add(type, pos=(row, 1)) row += 1 - label = wx.StaticText( + label = StaticText( parent=self, id=wx.ID_ANY, label=_("Custom min")) @@ -1308,14 +1308,14 @@ pos=( row, 0)) - min = wx.TextCtrl(parent=self, id=wx.ID_ANY, - value="", size=(70, -1)) + min = TextCtrl(parent=self, id=wx.ID_ANY, + value="", size=(70, -1)) min.SetValue(str(prop['min'])) self.wxId[atype]['min'] = min.GetId() gridSizer.Add(min, pos=(row, 1)) row += 1 - label = wx.StaticText( + label = StaticText( parent=self, id=wx.ID_ANY, label=_("Custom max")) @@ -1325,8 +1325,8 @@ pos=( row, 0)) - max = wx.TextCtrl(parent=self, id=wx.ID_ANY, - value="", size=(70, -1)) + max = TextCtrl(parent=self, id=wx.ID_ANY, + value="", size=(70, -1)) max.SetValue(str(prop['max'])) self.wxId[atype]['max'] = max.GetId() gridSizer.Add(max, pos=(row, 1)) @@ -1355,13 +1355,13 @@ self.wxId['grid'] = {} self.wxId['legend'] = {} self.wxId['font'] = {} - box = wx.StaticBox(parent=self, id=wx.ID_ANY, - label=" %s " % _("Grid and Legend settings")) + box = StaticBox(parent=self, id=wx.ID_ANY, + label=" %s " % _("Grid and Legend settings")) boxMainSizer = wx.StaticBoxSizer(box, wx.HORIZONTAL) gridSizer = wx.GridBagSizer(vgap=5, hgap=5) row = 0 - label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Grid color")) + label = StaticText(parent=self, id=wx.ID_ANY, label=_("Grid color")) gridSizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 0)) gridcolor = csel.ColourSelect( parent=self, @@ -1377,7 +1377,7 @@ gridSizer.Add(gridshow, pos=(row, 0), span=(1, 2)) row += 1 - label = wx.StaticText( + label = StaticText( parent=self, id=wx.ID_ANY, label=_("Legend font size")) @@ -1418,19 +1418,19 @@ # # buttons # - btnSave = wx.Button(self, wx.ID_SAVE) - btnApply = wx.Button(self, wx.ID_APPLY) - btnOk = wx.Button(self, wx.ID_OK) - btnCancel = wx.Button(self, wx.ID_CANCEL) + btnSave = Button(self, wx.ID_SAVE) + btnApply = Button(self, wx.ID_APPLY) + btnOk = Button(self, wx.ID_OK) + btnCancel = Button(self, wx.ID_CANCEL) btnOk.SetDefault() # tooltips for buttons - btnApply.SetToolTipString(_("Apply changes for the current session")) - btnOk.SetToolTipString( + btnApply.SetToolTip(_("Apply changes for the current session")) + btnOk.SetToolTip( _("Apply changes for the current session and close dialog")) - btnSave.SetToolTipString( + btnSave.SetToolTip( _("Apply and save changes to user settings file (default for next sessions)")) - btnCancel.SetToolTipString(_("Close dialog and ignore changes")) + btnCancel.SetToolTip(_("Close dialog and ignore changes")) # sizers btnStdSizer = wx.StdDialogButtonSizer() diff -Nru grass-7.6.1/gui/wxpython/wxplot/histogram.py grass-7.8.0/gui/wxpython/wxplot/histogram.py --- grass-7.6.1/gui/wxpython/wxplot/histogram.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/wxplot/histogram.py 2019-06-03 20:34:20.000000000 +0000 @@ -21,11 +21,11 @@ import grass.script as grass import gui_core.wxlibplot as plot +from gui_core.wrap import StockCursor from gui_core.toolbars import BaseToolbar, BaseIcons from wxplot.base import BasePlotFrame, PlotIcons from wxplot.dialogs import HistRasterDialog, PlotStatsFrame from core.gcmd import RunCommand, GException, GError -from core.utils import _ class HistogramPlotFrame(BasePlotFrame): @@ -90,7 +90,7 @@ plot to create a line graph of the histogram. """ try: - self.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) + self.SetCursor(StockCursor(wx.CURSOR_ARROW)) except: pass diff -Nru grass-7.6.1/gui/wxpython/wxplot/profile.py grass-7.8.0/gui/wxpython/wxplot/profile.py --- grass-7.6.1/gui/wxpython/wxplot/profile.py 2019-03-19 19:57:17.000000000 +0000 +++ grass-7.8.0/gui/wxpython/wxplot/profile.py 2019-06-03 20:34:20.000000000 +0000 @@ -17,6 +17,7 @@ import os import sys +import six import math import numpy @@ -24,9 +25,9 @@ import gui_core.wxlibplot as plot import grass.script as grass -from core.utils import _ from wxplot.base import BasePlotFrame, PlotIcons from gui_core.toolbars import BaseToolbar, BaseIcons +from gui_core.wrap import StockCursor from wxplot.dialogs import ProfileRasterDialog, PlotStatsFrame from core.gcmd import RunCommand, GWarning, GError, GMessage @@ -219,7 +220,7 @@ self.ylabel = '' i = 0 - for r in self.raster.iterkeys(): + for r in six.iterkeys(self.raster): self.raster[r]['datalist'] = [] datalist = self.CreateDatalist(r, self.coordstr) if len(datalist) > 0: @@ -296,7 +297,7 @@ dlg.Destroy() return - self.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) + self.SetCursor(StockCursor(wx.CURSOR_ARROW)) self.SetupProfile() p = self.CreatePlotList() @@ -414,7 +415,7 @@ message = [] title = _('Statistics for Profile(s)') - for r in self.raster.iterkeys(): + for r in six.iterkeys(self.raster): try: rast = r.split('@')[0] statstr = 'Profile of %s\n\n' % rast diff -Nru grass-7.6.1/gui/wxpython/wxplot/scatter.py grass-7.8.0/gui/wxpython/wxplot/scatter.py --- grass-7.6.1/gui/wxpython/wxplot/scatter.py 2019-03-19 19:57:28.000000000 +0000 +++ grass-7.8.0/gui/wxpython/wxplot/scatter.py 2019-06-03 20:34:20.000000000 +0000 @@ -23,9 +23,9 @@ import gui_core.wxlibplot as plot from wxplot.base import BasePlotFrame, PlotIcons from gui_core.toolbars import BaseToolbar, BaseIcons +from gui_core.wrap import StockCursor from wxplot.dialogs import ScatterRasterDialog, PlotStatsFrame from core.gcmd import RunCommand, GException, GError, GMessage -from core.utils import _ class ScatterFrame(BasePlotFrame): @@ -88,7 +88,7 @@ create a list of cell value pairs. This is passed to plot to create a scatterplot. """ - self.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) + self.SetCursor(StockCursor(wx.CURSOR_ARROW)) self.SetGraphStyle() wx.BeginBusyCursor() wx.SafeYield() diff -Nru grass-7.6.1/gui/wxpython/xml/grass-gxw.dtd grass-7.8.0/gui/wxpython/xml/grass-gxw.dtd --- grass-7.6.1/gui/wxpython/xml/grass-gxw.dtd 2019-03-19 19:57:59.000000000 +0000 +++ grass-7.8.0/gui/wxpython/xml/grass-gxw.dtd 2019-06-03 20:34:20.000000000 +0000 @@ -14,7 +14,12 @@ - + + + + + + cronjob: /home/neteler/cronjobs/cron_grass76_releasebranch_72_build_bins.sh + stored in https://grass.osgeo.org/grass77/binary/linux/snapshot/transifex/ + --> cronjob: /home/neteler/cronjobs/cron_grass77_releasebranch_72_build_bins.sh [2] Transifex job copies daily from [1] to here: - https://www.transifex.com/grass-gis/grass76/ + https://www.transifex.com/grass-gis/grass77/ [3] Translators work in Transifex, @@ -298,14 +298,14 @@ 7. Send the updated .po files to a GRASS Development Team member. If possible, please send diffs against CVS: - svn diff grasslibs_LANG.po > grasslibs_LANG_po.diff - svn diff grassmods_LANG.po > grassmods_LANG_po.diff - svn diff grasswxpy_LANG.po > grasswxpy_LANG_po.diff + git diff grasslibs_LANG.po > grasslibs_LANG_po.diff + git diff grassmods_LANG.po > grassmods_LANG_po.diff + git diff grasswxpy_LANG.po > grasswxpy_LANG_po.diff If you updated .c files with _() macros as explained - above, please send C file diffs against SVN: + above, please send C file diffs against git: - svn diff file.c > file.diff + git diff file.c > file.diff Thanks for submitting. diff -Nru grass-7.6.1/Makefile grass-7.8.0/Makefile --- grass-7.6.1/Makefile 2019-03-19 20:04:32.000000000 +0000 +++ grass-7.8.0/Makefile 2019-06-11 07:26:20.000000000 +0000 @@ -54,7 +54,7 @@ FILES_DST = $(patsubst %,$(ARCH_DISTDIR)/%,$(FILES)) default: - @echo "GRASS GIS $(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR).$(GRASS_VERSION_RELEASE) $(GRASS_VERSION_SVN) compilation log" \ + @echo "GRASS GIS $(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR).$(GRASS_VERSION_RELEASE) $(GRASS_VERSION_GIT) compilation log" \ > $(ERRORLOG) @echo "--------------------------------------------------" >> $(ERRORLOG) @echo "Started compilation: `date`" >> $(ERRORLOG) diff -Nru grass-7.6.1/man/build_check.py grass-7.8.0/man/build_check.py --- grass-7.6.1/man/build_check.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_check.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # checks for HTML files missing DESCRIPTION section # (c) The GRASS Development Team, Markus Neteler, Glynn Clements 2003, 2004, 2005, 2006, 2009 diff -Nru grass-7.6.1/man/build_check_rest.py grass-7.8.0/man/build_check_rest.py --- grass-7.6.1/man/build_check_rest.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_check_rest.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # checks for HTML files missing DESCRIPTION section # (c) The GRASS Development Team, Markus Neteler, Glynn Clements 2003, 2004, 2005, 2006, 2009 diff -Nru grass-7.6.1/man/build_class_graphical.py grass-7.8.0/man/build_class_graphical.py --- grass-7.6.1/man/build_class_graphical.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_class_graphical.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ @@ -122,15 +122,14 @@ return image if basename == module: return image - return sorted(candidates, - lambda first, second: cmp(len(first), len(second)))[0] + return sorted(candidates, key=len)[0] def generate_page_for_category(short_family, module_family, imgs, year, skip_no_image=False): filename = module_family + "_graphical.html" - output = open(filename + ".tmp", 'wb') + output = open(filename + ".tmp", 'w') output.write(header1_tmpl.substitute( title="GRASS GIS %s Reference " diff -Nru grass-7.6.1/man/build_class.py grass-7.8.0/man/build_class.py --- grass-7.6.1/man/build_class.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_class.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # generates HTML man pages docs/html/.html # (c) The GRASS Development Team, Markus Neteler, Glynn Clements 2003, 2004, 2005, 2006, 2009 @@ -25,7 +25,7 @@ filename = modclass + ".html" -f = open(filename + ".tmp", 'wb') +f = open(filename + ".tmp", 'w') write_html_header(f, "GRASS GIS %s Reference Manual: %s" % (grass_version, modclass)) modclass_lower = modclass.lower() diff -Nru grass-7.6.1/man/build_class_rest.py grass-7.8.0/man/build_class_rest.py --- grass-7.6.1/man/build_class_rest.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_class_rest.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # generates REST man pages docs/rest/.txt # (c) The GRASS Development Team, Markus Neteler, Glynn Clements 2003, 2004, 2005, 2006, 2009 diff -Nru grass-7.6.1/man/build_full_index.py grass-7.8.0/man/build_full_index.py --- grass-7.6.1/man/build_full_index.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_full_index.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # generates docs/html/full_index.html # (c) The GRASS Development Team, Markus Neteler, Glynn Clements 2003, 2004, 2005, 2006, 2009 @@ -38,7 +38,7 @@ #begin full index: filename = "full_index.html" -f = open(filename + ".tmp", 'wb') +f = open(filename + ".tmp", 'w') write_html_header(f, "GRASS GIS %s Reference Manual: Full index" % grass_version, body_width="80%") diff -Nru grass-7.6.1/man/build_full_index_rest.py grass-7.8.0/man/build_full_index_rest.py --- grass-7.6.1/man/build_full_index_rest.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_full_index_rest.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # generates docs/rest/full_index.txt # (c) The GRASS Development Team, Markus Neteler, Glynn Clements 2003, 2004, 2005, 2006, 2009 diff -Nru grass-7.6.1/man/build_graphical_index.py grass-7.8.0/man/build_graphical_index.py --- grass-7.6.1/man/build_graphical_index.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_graphical_index.py 2019-08-11 09:05:20.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ @@ -6,7 +6,7 @@ # MODULE: build_graphical_index # AUTHOR(S): Vaclav Petras # PURPOSE: Build graphical index -# COPYRIGHT: (C) 2015 by Vaclav Petras and the GRASS Development Team +# COPYRIGHT: (C) 2015-2019 by Vaclav Petras and the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS @@ -102,7 +102,7 @@ ('postscript_graphical.html', std_img_name('cartography'), 'Cartography'), ('wxGUI_graphical.html', std_img_name('gui'), 'GUI'), ('wxGUI.nviz.html', std_img_name('3dview'), '3D view'), - ('https://grass.osgeo.org/grass76/manuals/libpython/index.html', std_img_name('python'), 'Python'), + ('https://grass.osgeo.org/grass78/manuals/libpython/index.html', std_img_name('python'), 'Python'), ('https://grass.osgeo.org/programming7/', std_img_name('c'), 'C library'), ('manual_gallery.html', std_img_name('gallery'), 'Gallery'), ('https://grass.osgeo.org/grass7/manuals/addons/', std_img_name('addons'), 'Addons'), diff -Nru grass-7.6.1/man/build_html.py grass-7.8.0/man/build_html.py --- grass-7.6.1/man/build_html.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_html.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # utilities for generating HTML indices @@ -350,13 +350,13 @@ return desc_override.get(basename) def read_file(name): - f = open(name, 'rb') + f = open(name, 'r') s = f.read() f.close() return s def write_file(name, contents): - f = open(name, 'wb') + f = open(name, 'w') f.write(contents) f.close() diff -Nru grass-7.6.1/man/build_index.py grass-7.8.0/man/build_index.py --- grass-7.6.1/man/build_index.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_index.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # generates docs/html/index.html # (c) The GRASS Development Team, Markus Neteler, Glynn Clements 2003, 2004, 2005, 2006, 2009 @@ -12,7 +12,7 @@ os.chdir(html_dir) filename = "index.html" -f = open(filename + ".tmp", 'wb') +f = open(filename + ".tmp", 'w') year = None if len(sys.argv) > 1: diff -Nru grass-7.6.1/man/build_index_rest.py grass-7.8.0/man/build_index_rest.py --- grass-7.6.1/man/build_index_rest.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_index_rest.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # generates docs/rest/index.txt # (c) The GRASS Development Team, Markus Neteler, Glynn Clements 2003, 2004, 2005, 2006, 2009, Luca Delucchi 2012 @@ -12,7 +12,7 @@ os.chdir(rest_dir) filename = "index.txt" -f = open(filename + ".tmp", 'wb') +f = open(filename + ".tmp", 'w') write_rest_header(f, "GRASS GIS %s Reference Manual" % grass_version, True) write_rest_cmd_overview(f) diff -Nru grass-7.6.1/man/build_keywords.py grass-7.8.0/man/build_keywords.py --- grass-7.6.1/man/build_keywords.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_keywords.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # generates keywords.html @@ -76,8 +76,7 @@ keywordsfile.write(headerkeywords_tmpl) keywordsfile.write('

') -sortedKeys = keywords.keys() -sortedKeys.sort(key=lambda s: s.lower()) +sortedKeys = sorted(keywords.keys(), key=lambda s: s.lower()) for key in sortedKeys: keyword_line = '
%s
' \ diff -Nru grass-7.6.1/man/build_manual_gallery.py grass-7.8.0/man/build_manual_gallery.py --- grass-7.6.1/man/build_manual_gallery.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_manual_gallery.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ @@ -168,7 +168,7 @@ "Manual: Manual gallery" % grass_version)) output.write(header_graphical_index_tmpl) output.write('
    \n') - for image, html_file in img_html_files.iteritems(): + for image, html_file in img_html_files.items(): name = get_module_name(html_file) title = title_from_names(name, image) output.write( diff -Nru grass-7.6.1/man/build_rest.py grass-7.8.0/man/build_rest.py --- grass-7.6.1/man/build_rest.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_rest.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Created on Thu Aug 9 14:04:12 2012 @@ -265,13 +265,13 @@ return desc_override.get(basename) def read_file(name): - f = open(name, 'rb') + f = open(name, 'r') s = f.read() f.close() return s def write_file(name, contents): - f = open(name, 'wb') + f = open(name, 'w') f.write(contents) f.close() diff -Nru grass-7.6.1/man/build_topics.py grass-7.8.0/man/build_topics.py --- grass-7.6.1/man/build_topics.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/build_topics.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # generates topics.html and topic_*.html @@ -47,14 +47,14 @@ "%s Reference Manual: Topics index" % grass_version)) topicsfile.write(headertopics_tmpl) -for key, values in sorted(keywords.iteritems(), key=lambda s: s[0].lower()): +for key, values in sorted(keywords.items(), key=lambda s: s[0].lower()): keyfile = open(os.path.join(path, 'topic_%s.html' % key), 'w') keyfile.write(header1_tmpl.substitute(title = "GRASS GIS " \ "%s Reference Manual: Topic %s" % (grass_version, key.replace('_', ' ')))) keyfile.write(headerkey_tmpl.substitute(keyword=key.replace('_', ' '))) num_modules = 0 - for mod, desc in sorted(values.iteritems()): + for mod, desc in sorted(values.items()): num_modules += 1 keyfile.write(desc1_tmpl.substitute(cmd=mod, desc=desc, basename=mod.replace('.html', ''))) diff -Nru grass-7.6.1/man/Makefile grass-7.8.0/man/Makefile --- grass-7.6.1/man/Makefile 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/Makefile 2019-07-29 15:53:12.000000000 +0000 @@ -47,8 +47,10 @@ # This must be a separate target so that evaluation of $(MANPAGES) # is delayed until the indices have been generated +left := ( +right := ) manpages: - $(MAKE) $(MANPAGES) + $(MAKE) $(subst $(left),\$(left),$(subst $(right),\$(right),$(MANPAGES))) .PHONY: manpages diff -Nru grass-7.6.1/man/parser_standard_options.py grass-7.8.0/man/parser_standard_options.py --- grass-7.6.1/man/parser_standard_options.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/parser_standard_options.py 2019-06-03 20:34:21.000000000 +0000 @@ -7,7 +7,12 @@ from __future__ import print_function import argparse import sys -from urllib import urlopen + +try: + from urllib.request import urlopen +except ImportError: + from urllib2 import urlopen + from build_html import * def parse_options(lines, startswith='Opt'): diff -Nru grass-7.6.1/man/sphinx/conf.py grass-7.8.0/man/sphinx/conf.py --- grass-7.6.1/man/sphinx/conf.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/man/sphinx/conf.py 2019-08-12 16:50:46.000000000 +0000 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# GRASS GIS 7.4 Documentation documentation build configuration file, created by +# GRASS GIS 7.8 Documentation documentation build configuration file, created by # sphinx-quickstart on Thu Aug 9 17:16:28 2012. # # This file is execfile()d with the current directory set to its containing dir. @@ -40,17 +40,17 @@ master_doc = 'index' # General information about the project. -project = u'GRASS 7.4 Documentation' -copyright = u'2017, GRASS Development Team' +project = u'GRASS 7.8 Documentation' +copyright = u'2019, GRASS Development Team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '7.4' +version = '7.8' # The full version, including alpha/beta/rc tags. -release = 'svn' +release = 'dev' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -164,7 +164,7 @@ #html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'grass76Documentationdoc' +htmlhelp_basename = 'grass78Documentationdoc' # -- Options for LaTeX output -------------------------------------------------- @@ -183,7 +183,7 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('content', 'grass76Documentation.tex', u'GRASS 7.4 Documentation Documentation', + ('content', 'grass78Documentation.tex', u'GRASS 7.8 Documentation', u'GRASS Development Team', 'manual'), ] @@ -213,7 +213,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('content', 'grass76documentation', u'GRASS 7.4 Documentation Documentation', + ('content', 'grass78documentation', u'GRASS 7.8 Documentation', [u'GRASS Development Team'], 1) ] @@ -227,8 +227,8 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('content', 'grass76Documentation', u'GRASS 7.4 Documentation Documentation', - u'GRASS Development Team', 'grass76Documentation', 'One line description of project.', + ('content', 'grass78Documentation', u'GRASS 7.8 Documentation', + u'GRASS Development Team', 'grass78Documentation', 'One line description of project.', 'Miscellaneous'), ] @@ -245,7 +245,7 @@ # -- Options for Epub output --------------------------------------------------- # Bibliographic Dublin Core info. -epub_title = u'GRASS 7.4 Documentation' +epub_title = u'GRASS 7.8 Documentation' epub_author = u'GRASS Development Team' epub_publisher = u'GRASS Development Team' epub_copyright = u'2017, GRASS Development Team' diff -Nru grass-7.6.1/misc/m.cogo/m.cogo.html grass-7.8.0/misc/m.cogo/m.cogo.html --- grass-7.6.1/misc/m.cogo/m.cogo.html 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/misc/m.cogo/m.cogo.html 2019-05-18 15:50:05.000000000 +0000 @@ -157,4 +157,4 @@ Eric G. Miller

    -Last changed: $Date: 2014-12-09 19:39:37 +0100 (Tue, 09 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/misc/m.measure/m.measure.html grass-7.8.0/misc/m.measure/m.measure.html --- grass-7.6.1/misc/m.measure/m.measure.html 2019-03-19 20:04:49.000000000 +0000 +++ grass-7.8.0/misc/m.measure/m.measure.html 2019-05-18 15:50:05.000000000 +0000 @@ -56,4 +56,4 @@ Derived from d.measure by James Westervelt, Michael Shapiro, U.S. Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2017-11-11 19:59:24 +0100 (Sat, 11 Nov 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/misc/m.nviz.image/m.nviz.image.html grass-7.8.0/misc/m.nviz.image/m.nviz.image.html --- grass-7.6.1/misc/m.nviz.image/m.nviz.image.html 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/misc/m.nviz.image/m.nviz.image.html 2019-05-18 15:50:05.000000000 +0000 @@ -31,4 +31,4 @@ Anna Kratochvilova, Google Summer of Code 2011 (mentor: Martin Landa) -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/misc/m.nviz.image/surface.c grass-7.8.0/misc/m.nviz.image/surface.c --- grass-7.6.1/misc/m.nviz.image/surface.c 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/misc/m.nviz.image/surface.c 2019-06-03 20:34:21.000000000 +0000 @@ -99,15 +99,14 @@ for (i = 0; i < nsurfs; i++) { id = surf_list[i]; + mapset = G_find_raster2(params->color_map->answers[i], ""); + if (mapset == NULL) { + G_fatal_error(_("Raster map <%s> not found"), + params->color_map->answers[i]); + } /* color */ /* check for color map */ if (i < ncolor_map && strcmp(params->color_map->answers[i], "")) { - mapset = G_find_raster2(params->color_map->answers[i], ""); - if (mapset == NULL) { - G_fatal_error(_("Raster map <%s> not found"), - params->color_map->answers[i]); - } - Nviz_set_attr(id, MAP_OBJ_SURF, ATT_COLOR, MAP_ATT, G_fully_qualified_name(params-> color_map->answers[i], diff -Nru grass-7.6.1/misc/m.nviz.image/volume.c grass-7.8.0/misc/m.nviz.image/volume.c --- grass-7.6.1/misc/m.nviz.image/volume.c 2019-03-19 20:04:47.000000000 +0000 +++ grass-7.8.0/misc/m.nviz.image/volume.c 2019-06-03 20:34:21.000000000 +0000 @@ -32,7 +32,7 @@ { int i, nvol, id; float x, y, z; - char *mapset; + const char *mapset; nvol = opt_get_num_answers(params->volume); diff -Nru grass-7.6.1/misc/m.nviz.script/local.h grass-7.8.0/misc/m.nviz.script/local.h --- grass-7.6.1/misc/m.nviz.script/local.h 2019-03-19 20:04:49.000000000 +0000 +++ grass-7.8.0/misc/m.nviz.script/local.h 2019-06-03 20:34:21.000000000 +0000 @@ -1,3 +1,5 @@ +/* dist is not initialized ! + * should dist be DIST ? */ static double dist, e = 0, n = 0; static double DIST, HT; int do_profile(double, double, double, double, const char *, int, int); diff -Nru grass-7.6.1/misc/m.nviz.script/main.c grass-7.8.0/misc/m.nviz.script/main.c --- grass-7.6.1/misc/m.nviz.script/main.c 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/misc/m.nviz.script/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -240,6 +240,7 @@ } /* Coords from Command Line */ + k = 0; for (i = 0; parm.route->answers[i]; i += 2) { /* Test for number coordinate pairs */ k = i; @@ -264,7 +265,7 @@ do_profile(e2, e2, n2, n2, name, fd, data_type); } } - /* done with coordinates */ + /* done with coordinates */ /* Output final part of script */ @@ -292,7 +293,7 @@ if (parm.f->answer) { /* Full render and save */ fprintf(fp, "\nset name %s", img_name); - fprintf(fp, "\nset num2 [format \"\%%04d\" $num]"); + fprintf(fp, "\nset num2 [format \"%%04d\" $num]"); fprintf(fp, "\nappend name $num2 \".ppm\""); fprintf(fp, "\nSendScriptLine \"Ndo_framestep $frame 1\""); fprintf(fp, "\nSendScriptLine \"Nwrite_ppm $name \""); @@ -302,7 +303,7 @@ /* Quick draw wire */ /* output full variables commented so can be easily changed */ fprintf(fp, "\nset name %s", img_name); - fprintf(fp, "\nset num2 [format \"\%%04d\" $num]"); + fprintf(fp, "\nset num2 [format \"%%04d\" $num]"); fprintf(fp, "\nappend name $num2 \".ppm\""); fprintf(fp, "\n## To render in full set to 1 and uncomment Nwrite_ppm \""); @@ -330,7 +331,7 @@ /* ************************************ - * Claculate camera and eye coordinates + * Calculate camera and eye coordinates **************************************/ int do_profile(double e1, double e2, double n1, double n2, const char *name, int fd, int data_type) @@ -350,6 +351,7 @@ return 0; } + /* dist is not initialized ! */ if (rows >= 0 && cols < 0) { /* SE Quad or due east */ AZI = fabs(atan((rows / cols))); @@ -402,6 +404,8 @@ read_rast(e2, n2, LEN, fd, 0, data_type); } + /* dist is not used ! */ + return 0; } /* done with do_profile */ @@ -414,7 +418,7 @@ int read_rast (double east, double north, - double dist, int fd, int out_type, RASTER_MAP_TYPE data_type) + double rrdist, int fd, int out_type, RASTER_MAP_TYPE data_type) { int row, col, nrows, ncols; struct Cell_head window; @@ -446,11 +450,11 @@ if (data_type == CELL_TYPE) { cell = Rast_allocate_c_buf(); Rast_get_c_row(fd, cell, row); - if (Rast_is_c_null_value(&cell[col])) camera_height = (double)9999.; else camera_height = (double)cell[col]; + G_free(cell); } if (data_type == FCELL_TYPE) { @@ -460,6 +464,7 @@ camera_height = (double)9999.; else camera_height = (double)fcell[col]; + G_free(fcell); } if (data_type == DCELL_TYPE) { @@ -469,6 +474,7 @@ camera_height = (double)9999.; else camera_height = (double)dcell[col]; + G_free(dcell); } /* Output script commands */ @@ -488,7 +494,7 @@ /* Set Camera Position */ sprintf(buf2, "\nSendScriptLine \"Nmove_to_real %f %f %f\"", east, north, camera_height); - key_time += (dist + fabs(camera_height - OLD_DEPTH)) / 10000.; + key_time += (rrdist + fabs(camera_height - OLD_DEPTH)) / 10000.; } else { diff -Nru grass-7.6.1/misc/m.nviz.script/m.nviz.script.html grass-7.8.0/misc/m.nviz.script/m.nviz.script.html --- grass-7.6.1/misc/m.nviz.script/m.nviz.script.html 2019-03-19 20:04:47.000000000 +0000 +++ grass-7.8.0/misc/m.nviz.script/m.nviz.script.html 2019-05-18 15:50:05.000000000 +0000 @@ -132,4 +132,4 @@

    AUTHOR

    Bob Covill -

    Last changed: $Date: 2016-08-23 14:46:27 +0200 (Tue, 23 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/misc/m.transform/m.transform.html grass-7.8.0/misc/m.transform/m.transform.html --- grass-7.6.1/misc/m.transform/m.transform.html 2019-03-19 20:04:47.000000000 +0000 +++ grass-7.8.0/misc/m.transform/m.transform.html 2019-05-22 21:47:51.000000000 +0000 @@ -73,4 +73,4 @@ Glynn Clements
    Hamish Bowman -

    Last changed: $Date: 2018-03-14 11:57:02 +0100 (Wed, 14 Mar 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/mswindows/env.bat grass-7.8.0/mswindows/env.bat --- grass-7.6.1/mswindows/env.bat 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/mswindows/env.bat 2019-06-03 20:34:21.000000000 +0000 @@ -2,8 +2,8 @@ REM Environmental variables for GRASS stand-alone installer REM -set GRASS_PYTHON=%GISBASE%\extrabin\python.exe -set PYTHONHOME=%GISBASE%\Python27 +set GRASS_PYTHON=%GISBASE%\extrabin\python3.exe +set PYTHONHOME=%GISBASE%\Python37 set GRASS_PROJSHARE=%GISBASE%\share\proj diff -Nru grass-7.6.1/mswindows/GRASS-Installer.nsi.tmpl grass-7.8.0/mswindows/GRASS-Installer.nsi.tmpl --- grass-7.6.1/mswindows/GRASS-Installer.nsi.tmpl 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/mswindows/GRASS-Installer.nsi.tmpl 2019-05-22 21:47:51.000000000 +0000 @@ -3,7 +3,7 @@ ;GRASS GIS Installer for Windows ;Written by Marco Pasetti ;Updated for OSGeo4W by Colin Nielsen, Helmut Kudrnovsky, and Martin Landa -;Last Update: $Id: GRASS-Installer.nsi.tmpl 74038 2019-01-28 09:56:40Z martinl $ +;Last Update: $Id$ ;Mail to: grass-dev@lists.osgeo.org ;---------------------------------------------------------------------------------------------------------------------------- diff -Nru grass-7.6.1/mswindows/GRASS-Packager.bat.tmpl grass-7.8.0/mswindows/GRASS-Packager.bat.tmpl --- grass-7.6.1/mswindows/GRASS-Packager.bat.tmpl 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/mswindows/GRASS-Packager.bat.tmpl 2019-06-03 20:34:21.000000000 +0000 @@ -3,7 +3,7 @@ rem ----------------------------------------------------------------------------------------------------------------------- rem Edited by: Marco Pasetti rem Revised for OSGeo4W by: Colin Nielsen, Helmut Kudrnovsky, and Martin Landa -rem Last Update: $Id: GRASS-Packager.bat.tmpl 74038 2019-01-28 09:56:40Z martinl $ +rem Last Update: $Id$ rem ----------------------------------------------------------------------------------------------------------------------- @echo off @@ -15,8 +15,8 @@ set PACKAGE_DIR=.\GRASS-@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@-Package set OSGEO4W_BLD_DIR=C:\OSGeo4W%1 -if exist C:\OSGeo4W%1_grass@GRASS_VERSION_MAJOR@ ( -set OSGEO4W_PKG_DIR=C:\OSGeo4W%1_grass@GRASS_VERSION_MAJOR@ +if exist C:\OSGeo4W%1_grass@GRASS_VERSION_MAJOR@_py3 ( +set OSGEO4W_PKG_DIR=C:\OSGeo4W%1_grass@GRASS_VERSION_MAJOR@_py3 ) else ( set OSGEO4W_PKG_DIR=C:\OSGeo4W%1 ) @@ -95,13 +95,13 @@ @echo. @echo ----------------------------------------------------------------------------------------------------------------------- -@echo Copy Python content to PACKAGE_DIR\Python27 +@echo Copy Python content to PACKAGE_DIR\Python37 @echo ----------------------------------------------------------------------------------------------------------------------- @echo. -mkdir %PACKAGE_DIR%\Python27 +mkdir %PACKAGE_DIR%\Python37 -xcopy %OSGEO4W_PKG_DIR%\apps\Python27\* %PACKAGE_DIR%\Python27 /S/V/F/I +xcopy %OSGEO4W_PKG_DIR%\apps\Python37\* %PACKAGE_DIR%\Python37 /S/V/F/I @echo. @echo ----------------------------------------------------------------------------------------------------------------------- diff -Nru grass-7.6.1/mswindows/Installer-Files/WinGRASS-README.url grass-7.8.0/mswindows/Installer-Files/WinGRASS-README.url --- grass-7.6.1/mswindows/Installer-Files/WinGRASS-README.url 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/mswindows/Installer-Files/WinGRASS-README.url 2019-08-11 09:05:20.000000000 +0000 @@ -1,5 +1,5 @@ [InternetShortcut] -URL=https://grass.osgeo.org/grass76/binary/mswindows/native/README.html +URL=https://grass.osgeo.org/grass78/binary/mswindows/native/README.html IDList= IconFile=http://grass.osgeo.org/favicon.ico IconIndex=1 diff -Nru grass-7.6.1/mswindows/osgeo4w/env.bat.tmpl grass-7.8.0/mswindows/osgeo4w/env.bat.tmpl --- grass-7.6.1/mswindows/osgeo4w/env.bat.tmpl 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/mswindows/osgeo4w/env.bat.tmpl 2019-06-03 20:34:21.000000000 +0000 @@ -8,8 +8,8 @@ REM Note that msys package must be also installed REM set GRASS_SH=%OSGEO4W_ROOT%\apps\msys\bin\sh.exe -set GRASS_PYTHON=%OSGEO4W_ROOT%\bin\python.exe -set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python27 +set GRASS_PYTHON=%OSGEO4W_ROOT%\bin\python3.exe +set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37 set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj diff -Nru grass-7.6.1/mswindows/osgeo4w/grass.bat.tmpl grass-7.8.0/mswindows/osgeo4w/grass.bat.tmpl --- grass-7.6.1/mswindows/osgeo4w/grass.bat.tmpl 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/mswindows/osgeo4w/grass.bat.tmpl 2019-06-03 20:34:21.000000000 +0000 @@ -9,6 +9,7 @@ rem Set environmental variables rem call "%~dp0\o4w_env.bat" +call py3_env.bat call "%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\env.bat" @echo off diff -Nru grass-7.6.1/mswindows/osgeo4w/package.cmd grass-7.8.0/mswindows/osgeo4w/package.cmd --- grass-7.6.1/mswindows/osgeo4w/package.cmd 2019-03-19 20:04:48.000000000 +0000 +++ grass-7.8.0/mswindows/osgeo4w/package.cmd 2019-06-03 20:34:21.000000000 +0000 @@ -1,7 +1,7 @@ path %PATH%;%OSGEO4W_ROOT%\apps\swig set WXWIN=h:\windows\wxPython-src-2.8.9.1 -set GRASS_HOME=%OSGEO4W_ROOT%\apps\grass\grass-7.0.0 +set GRASS_HOME=%OSGEO4W_ROOT%\apps\grass\grass-7.7.0 set GRASS_INC=%GRASS_HOME%\include set GRASS_LPATH=%GRASS_HOME%\lib diff -Nru grass-7.6.1/mswindows/osgeo4w/package.sh grass-7.8.0/mswindows/osgeo4w/package.sh --- grass-7.6.1/mswindows/osgeo4w/package.sh 2019-03-19 20:04:48.000000000 +0000 +++ grass-7.8.0/mswindows/osgeo4w/package.sh 2019-07-28 20:17:50.000000000 +0000 @@ -45,6 +45,12 @@ export PATH=/usr/bin:/mingw${MINGW_POSTFIX}/bin/:$OSGEO4W_ROOT_MSYS/bin:$PWD/mswindows/osgeo4w/lib:$PWD/mswindows/osgeo4w +# Force Python3 +# alias python=python3 +export PYTHONPATH= +export PYTHONHOME=$OSGEO4W_ROOT_MSYS/apps/Python37 +export PATH=$OSGEO4W_ROOT_MSYS/apps/Python37:$PATH + T0=$(date +%s) LT=$T0 CS="" @@ -264,6 +270,8 @@ /mingw${MINGW_POSTFIX}/bin/libpng16-16.dll \ /mingw${MINGW_POSTFIX}/bin/libsystre-0.dll \ /mingw${MINGW_POSTFIX}/bin/libtre-5.dll \ + /mingw${MINGW_POSTFIX}/bin/libgraphite2.dll \ + /mingw${MINGW_POSTFIX}/bin/libpcre-1.dll \ /mingw${MINGW_POSTFIX}/bin/zlib1.dll \ /mingw${MINGW_POSTFIX}/bin/libstdc++-6.dll \ apps/grass/grass$POSTFIX/bin diff -Nru grass-7.6.1/mswindows/osgeo4w/setup_x86_64.hint.tmpl grass-7.8.0/mswindows/osgeo4w/setup_x86_64.hint.tmpl --- grass-7.6.1/mswindows/osgeo4w/setup_x86_64.hint.tmpl 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/mswindows/osgeo4w/setup_x86_64.hint.tmpl 2019-08-12 16:50:46.000000000 +0000 @@ -1,7 +1,7 @@ sdesc: "GRASS GIS - daily builds of development version" -ldesc: "Geographic Resources Analysis Support System (GRASS GIS) - daily builds of SVN trunk" +ldesc: "Geographic Resources Analysis Support System (GRASS GIS) - daily builds of git master" category: Desktop -requires: liblas avce00 gpsbabel gs gdal-python matplotlib msvcrt msvcrt2012 msvcrt2013 msvcrt2015 iconv libtiff gdal proj pdcurses zlib fftw libpng python-wx python-numpy python-pil python-pip python-ply pyopengl cairo psycopg2 rbatch zstd zstd-bin +requires: liblas avce00 gpsbabel gs python3-gdal python3-matplotlib msvcrt msvcrt2013 msvcrt2015 iconv libtiff gdal proj pdcurses zlib fftw libpng python3-wx python3-numpy python3-pillow python3-pip python3-ply python3-pyopengl cairo python3-psycopg2 python3-six rbatch zstd zstd-bin python3-pywin32 maintainer: MartinLanda curr: @GRASS_VERSION_NUMBER@-1 prev: @GRASS_VERSION_NUMBER@-1 diff -Nru grass-7.6.1/mswindows/osgeo4w/setup_x86.hint.tmpl grass-7.8.0/mswindows/osgeo4w/setup_x86.hint.tmpl --- grass-7.6.1/mswindows/osgeo4w/setup_x86.hint.tmpl 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/mswindows/osgeo4w/setup_x86.hint.tmpl 2019-08-12 16:50:46.000000000 +0000 @@ -1,7 +1,7 @@ sdesc: "GRASS GIS - daily builds of development version" -ldesc: "Geographic Resources Analysis Support System (GRASS GIS) - daily builds of SVN trunk" +ldesc: "Geographic Resources Analysis Support System (GRASS GIS) - daily builds of git master" category: Desktop -requires: liblas avce00 gpsbabel gs gdal-python matplotlib msvcrt msvcrt2013 msvcrt2015 iconv libtiff gdal proj freetype-mingw pdcurses zlib fftw libpng python-wx python-numpy python-pil python-pip python-ply pyopengl cairo psycopg2 rbatch zstd zstd-bin +requires: liblas avce00 gpsbabel gs python3-gdal python3-matplotlib msvcrt msvcrt2013 msvcrt2015 iconv libtiff gdal proj freetype-mingw pdcurses zlib fftw libpng python3-wx python3-numpy python3-pillow python3-pip python3-ply python3-pyopengl cairo python3-psycopg2 python3-six rbatch zstd zstd-bin python3-pywin32 maintainer: MartinLanda curr: @GRASS_VERSION_NUMBER@-1 prev: @GRASS_VERSION_NUMBER@-1 diff -Nru grass-7.6.1/ps/ps.map/ps.map.html grass-7.8.0/ps/ps.map/ps.map.html --- grass-7.6.1/ps/ps.map/ps.map.html 2019-03-19 20:04:32.000000000 +0000 +++ grass-7.8.0/ps/ps.map/ps.map.html 2019-05-22 21:47:51.000000000 +0000 @@ -1636,4 +1636,4 @@ Paul Carlson, USDA, SCS, NHQ-CGIS
    Modifications: Radim Blazek, Glynn Clements, Bob Covill, Hamish Bowman -

    Last changed: $Date: 2018-11-22 07:43:56 +0100 (Thu, 22 Nov 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.basins.fill/r.basins.fill.html grass-7.8.0/raster/r.basins.fill/r.basins.fill.html --- grass-7.6.1/raster/r.basins.fill/r.basins.fill.html 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/raster/r.basins.fill/r.basins.fill.html 2019-05-18 15:50:05.000000000 +0000 @@ -53,4 +53,4 @@
    Larry Band, Dept. of Geography, University of Toronto, Canada -

    Last changed: $Date: 2014-04-11 17:46:13 +0200 (Fri, 11 Apr 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.basins.fill/testsuite/testrbf.py grass-7.8.0/raster/r.basins.fill/testsuite/testrbf.py --- grass-7.6.1/raster/r.basins.fill/testsuite/testrbf.py 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/raster/r.basins.fill/testsuite/testrbf.py 2019-06-03 20:34:21.000000000 +0000 @@ -8,8 +8,10 @@ License (>=v2). Read the file COPYING that comes with GRASS for details. """ +import unittest from grass.gunittest.case import TestCase +@unittest.skip("See #3822") class TestRasterbasin(TestCase): celevation='elevation' tgeology='geology' diff -Nru grass-7.6.1/raster/r.buffer/r.buffer.html grass-7.8.0/raster/r.buffer/r.buffer.html --- grass-7.6.1/raster/r.buffer/r.buffer.html 2019-03-19 20:03:27.000000000 +0000 +++ grass-7.8.0/raster/r.buffer/r.buffer.html 2019-05-18 15:50:05.000000000 +0000 @@ -129,4 +129,4 @@ Research Laboratory

    -Last changed: $Date: 2016-01-21 12:10:11 +0100 (Thu, 21 Jan 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.buildvrt/r.buildvrt.html grass-7.8.0/raster/r.buildvrt/r.buildvrt.html --- grass-7.6.1/raster/r.buildvrt/r.buildvrt.html 2019-03-19 20:03:09.000000000 +0000 +++ grass-7.8.0/raster/r.buildvrt/r.buildvrt.html 2019-06-03 20:34:21.000000000 +0000 @@ -60,7 +60,8 @@

    AUTHOR

    -Markus Metz +Markus Metz
    +Sponsored by mundialis

    -Last changed: $Date: 2019-02-09 12:35:10 +0100 (Sat, 09 Feb 2019) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.carve/r.carve.html grass-7.8.0/raster/r.carve/r.carve.html --- grass-7.6.1/raster/r.carve/r.carve.html 2019-03-19 20:03:18.000000000 +0000 +++ grass-7.8.0/raster/r.carve/r.carve.html 2019-05-18 15:50:05.000000000 +0000 @@ -123,4 +123,4 @@ Bill Brown (GMSL)
    GRASS 6 update: Brad Douglas -

    Last changed: $Date: 2017-05-18 13:33:28 +0200 (Thu, 18 May 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.category/r.category.html grass-7.8.0/raster/r.category/r.category.html --- grass-7.6.1/raster/r.category/r.category.html 2019-03-19 20:03:51.000000000 +0000 +++ grass-7.8.0/raster/r.category/r.category.html 2019-05-18 15:50:05.000000000 +0000 @@ -183,4 +183,4 @@ Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
    Hamish Bowman, University of Otago, New Zealand (label creation options) -

    Last changed: $Date: 2018-10-18 21:05:15 +0200 (Thu, 18 Oct 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.circle/r.circle.html grass-7.8.0/raster/r.circle/r.circle.html --- grass-7.6.1/raster/r.circle/r.circle.html 2019-03-19 20:03:48.000000000 +0000 +++ grass-7.8.0/raster/r.circle/r.circle.html 2019-05-18 15:50:05.000000000 +0000 @@ -50,4 +50,4 @@ Bill Brown, U.S. Army Construction Engineering Research Laboratory
    Additional flag/min/max parameter by Markus Neteler, University of Hannover -

    Last changed: $Date: 2017-04-28 03:31:17 +0200 (Fri, 28 Apr 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.clump/r.clump.html grass-7.8.0/raster/r.clump/r.clump.html --- grass-7.6.1/raster/r.clump/r.clump.html 2019-03-19 20:03:09.000000000 +0000 +++ grass-7.8.0/raster/r.clump/r.clump.html 2019-05-18 15:50:05.000000000 +0000 @@ -106,4 +106,4 @@ Markus Metz (diagonal clump tracing, fuzzy clumping)

    -Last changed: $Date: 2016-07-15 15:14:26 +0200 (Fri, 15 Jul 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.coin/r.coin.html grass-7.8.0/raster/r.coin/r.coin.html --- grass-7.6.1/raster/r.coin/r.coin.html 2019-03-19 20:03:00.000000000 +0000 +++ grass-7.8.0/raster/r.coin/r.coin.html 2019-05-18 15:50:05.000000000 +0000 @@ -203,4 +203,4 @@ Michael Shapiro,
    U.S. Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2014-12-28 16:42:58 +0100 (Sun, 28 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.colors/r3.colors.html grass-7.8.0/raster/r.colors/r3.colors.html --- grass-7.6.1/raster/r.colors/r3.colors.html 2019-03-19 20:03:18.000000000 +0000 +++ grass-7.8.0/raster/r.colors/r3.colors.html 2019-05-18 15:50:05.000000000 +0000 @@ -33,4 +33,4 @@
    Support for 3D rasters by Soeren Gebbert -

    Last changed: $Date: 2014-12-09 19:39:37 +0100 (Tue, 09 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.colors/r.colors.html grass-7.8.0/raster/r.colors/r.colors.html --- grass-7.6.1/raster/r.colors/r.colors.html 2019-03-19 20:03:24.000000000 +0000 +++ grass-7.8.0/raster/r.colors/r.colors.html 2019-05-18 15:50:05.000000000 +0000 @@ -310,4 +310,4 @@ Michael Shapiro and David Johnson
    Support for 3D rasters by Soeren Gebbert -

    Last changed: $Date: 2018-02-21 11:25:20 +0100 (Wed, 21 Feb 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.colors.out/r3.colors.out.html grass-7.8.0/raster/r.colors.out/r3.colors.out.html --- grass-7.6.1/raster/r.colors.out/r3.colors.out.html 2019-03-19 20:03:27.000000000 +0000 +++ grass-7.8.0/raster/r.colors.out/r3.colors.out.html 2019-05-18 15:50:05.000000000 +0000 @@ -25,4 +25,4 @@ Glynn Clements -

    Last changed: $Date: 2014-12-09 19:39:37 +0100 (Tue, 09 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.colors.out/r.colors.out.html grass-7.8.0/raster/r.colors.out/r.colors.out.html --- grass-7.6.1/raster/r.colors.out/r.colors.out.html 2019-03-19 20:03:28.000000000 +0000 +++ grass-7.8.0/raster/r.colors.out/r.colors.out.html 2019-05-18 15:50:05.000000000 +0000 @@ -20,4 +20,4 @@

    AUTHOR

    Glynn Clements -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.composite/r.composite.html grass-7.8.0/raster/r.composite/r.composite.html --- grass-7.6.1/raster/r.composite/r.composite.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.composite/r.composite.html 2019-05-18 15:50:05.000000000 +0000 @@ -54,4 +54,4 @@ Glynn Clements -

    Last changed: $Date: 2014-12-28 16:42:58 +0100 (Sun, 28 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.compress/r.compress.html grass-7.8.0/raster/r.compress/r.compress.html --- grass-7.6.1/raster/r.compress/r.compress.html 2019-03-19 20:03:09.000000000 +0000 +++ grass-7.8.0/raster/r.compress/r.compress.html 2019-05-22 21:47:51.000000000 +0000 @@ -285,4 +285,4 @@

    Markus Metz -

    Last changed: $Date: 2019-02-21 10:47:51 +0100 (Thu, 21 Feb 2019) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.contour/cont.c grass-7.8.0/raster/r.contour/cont.c --- grass-7.6.1/raster/r.contour/cont.c 2019-03-19 20:03:09.000000000 +0000 +++ grass-7.8.0/raster/r.contour/cont.c 2019-05-21 11:35:50.000000000 +0000 @@ -94,27 +94,29 @@ } /* check each cell of top and bottom borders */ - for (startrow = 0; startrow < nrow; startrow += (nrow - 2)) { + for (startrow = 0; startrow <= nrow - 2; startrow += (nrow - 2)) { for (startcol = 0; startcol <= ncol - 2; startcol++) { /* look for starting point of new line */ if (!hit[startrow][startcol]) { current.r = startrow; current.c = startcol; - outside = getnewcell(¤t, nrow, ncol, z); /* is this top or bottom? */ - if (startrow == 0) /* top */ + if (startrow < nrow - 2) /* top */ current.edge = 0; else /* bottom edge */ current.edge = 2; + + outside = getnewcell(¤t, nrow, ncol, z); + p1 = current.edge; p2 = current.edge + 1; if (checkedge(current.z[p1], current.z[p2], level)) { getpoint(¤t, level, Cell, Points); /* while not off an edge, follow line */ - while (!outside && !hit[current.r][current.c]) { + while (!outside) { hit[current.r][current.c] |= findcrossing(¤t, level, Cell, Points, &ncrossing); @@ -133,25 +135,27 @@ } /* for rows */ /* check right and left borders (each row of first and last column) */ - for (startcol = 0; startcol < ncol; startcol += (ncol - 2)) { + for (startcol = 0; startcol <= ncol - 2 ; startcol += (ncol - 2)) { for (startrow = 0; startrow <= nrow - 2; startrow++) { /* look for starting point of new line */ if (!hit[startrow][startcol]) { current.r = startrow; current.c = startcol; - outside = getnewcell(¤t, nrow, ncol, z); /* is this left or right edge? */ - if (startcol == 0) /* left */ + if (startcol < ncol - 2) /* left */ current.edge = 3; else /* right edge */ current.edge = 1; + + outside = getnewcell(¤t, nrow, ncol, z); + p1 = current.edge; p2 = (current.edge + 1) % 4; if (checkedge(current.z[p1], current.z[p2], level)) { getpoint(¤t, level, Cell, Points); /* while not off an edge, follow line */ - while (!outside && !hit[current.r][current.c]) { + while (!outside) { hit[current.r][current.c] |= findcrossing(¤t, level, Cell, Points, &ncrossing); @@ -177,9 +181,12 @@ current.r = startrow; current.c = startcol; current.edge = 0; + p1 = current.edge; + p2 = current.edge + 1; + outside = getnewcell(¤t, nrow, ncol, z); if (!outside && - checkedge(current.z[0], current.z[1], level)) { + checkedge(current.z[p1], current.z[p2], level)) { getpoint(¤t, level, Cell, Points); hit[current.r][current.c] |= findcrossing(¤t, level, Cell, Points, @@ -188,7 +195,7 @@ outside = getnewcell(¤t, nrow, ncol, z); /* while not back to starting point, follow line */ - while (!outside && !hit[current.r][current.c] && + while (!outside && ((current.edge != 0) || ((current.r != startrow) || (current.c != startcol)))) { @@ -236,6 +243,8 @@ current->z[2] = z[current->r + 1][current->c + 1]; current->z[3] = z[current->r + 1][current->c]; + /* testing for NULL values here does not work */ + return 0; } return 1; @@ -328,6 +337,7 @@ cellhit = 1; } + return cellhit; } diff -Nru grass-7.6.1/raster/r.contour/main.c grass-7.8.0/raster/r.contour/main.c --- grass-7.6.1/raster/r.contour/main.c 2019-03-19 20:03:10.000000000 +0000 +++ grass-7.8.0/raster/r.contour/main.c 2019-05-21 11:35:50.000000000 +0000 @@ -72,6 +72,7 @@ struct FPRange range; int fd; double *lev; + double snap; int nlevels; int n_cut; @@ -221,6 +222,23 @@ db_close_database_shutdown_driver(Driver); } Vect_build(&Map); + + /* if a contour line hits a border of NULL cells, it traces + * itself back until it hits a border of NULL cells again, + * then goes back to the starting point + * -> cleaning is needed */ + snap = (Wind.ns_res + Wind.ew_res) / 2000.0; + G_message(_("Snap lines")); + Vect_snap_lines(&Map, GV_LINE, snap, NULL); + G_message(_("Break lines at intersections")); + Vect_break_lines(&Map, GV_LINE, NULL); + G_message(_("Remove duplicates")); + Vect_remove_duplicates(&Map, GV_LINE, NULL); + G_message(_("Merge lines")); + Vect_merge_lines(&Map, GV_LINE, NULL, NULL); + Vect_build_partial(&Map, GV_BUILD_NONE); + Vect_build(&Map); + Vect_close(&Map); exit(EXIT_SUCCESS); diff -Nru grass-7.6.1/raster/r.contour/r.contour.html grass-7.8.0/raster/r.contour/r.contour.html --- grass-7.6.1/raster/r.contour/r.contour.html 2019-03-19 20:03:09.000000000 +0000 +++ grass-7.8.0/raster/r.contour/r.contour.html 2019-05-18 15:50:05.000000000 +0000 @@ -72,5 +72,5 @@ 3/2001: cut parameter and fixes by Andrea Aime (aaime@libero.it)

    -Last changed: $Date: 2016-12-09 19:14:52 +0100 (Fri, 09 Dec 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.contour/testsuite/test_r_contour.py grass-7.8.0/raster/r.contour/testsuite/test_r_contour.py --- grass-7.6.1/raster/r.contour/testsuite/test_r_contour.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/raster/r.contour/testsuite/test_r_contour.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,83 @@ +""" +Name: r.contour test +Purpose: Tests r.contour module and its options. + +Author: Shubham Sharma, Google Code-in 2018 +Copyright: (C) 2018 by Shubham Sharma and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" + +from grass.gunittest.case import TestCase +import os + +class TestRasterWhat(TestCase): + input = 'elevation' + output = 'elevationVector' + step = 100 + levels = (60, 90, 120, 150) + minlevel = 1000 + maxlevel = 2000 + cut = 200 + test_ref_str = "cat|level\n1|60\n2|90\n3|120\n4|150\n" + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + cls.runModule('g.region', raster=cls.input) + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + + cls.runModule('g.remove', type='vector', flags='f', name=cls.output) + cls.runModule('g.remove', type='vector', flags='f', name=cls.output+"_cut") + cls.runModule('g.remove', type='vector', flags='f', name=cls.output+"_cut_flag_t") + + if os.path.isfile('testReport'): + os.remove('testReport') + if os.path.isfile('testReportCut'): + os.remove('testReportCut') + if os.path.isfile('testReportCutFlagT'): + os.remove('testReportCutFlagT') + + + + def test_raster_contour(self): + """Testing r.contour runs successfully with input steps,levels, minlevel, maxlevel""" + self.assertModule('r.contour', input=self.input, output=self.output, step=self.step, levels=self.levels, minlevel=self.minlevel, maxlevel=self.maxlevel) + self.assertVectorExists(name=self.output, msg=self.output+" was not created.") + + # Check the attribute values of contours with v.db.select + self.assertModule('v.db.select', map=self.output, file='testReport') + self.assertFileExists('testReport', msg='testReport file was not created') + if os.path.isfile('testReport'): + file = open("testReport", "r") + fileData = file.read() + self.assertMultiLineEqual(fileData, self.test_ref_str) + file.close() + + def test_raster_contour_cut(self): + """Testing r.contour runs successfully with input steps,levels, minlevel, maxlevel and cut=100""" + self.assertModule('r.contour', input=self.input, output=self.output+"_cut", step=self.step, levels=self.levels, minlevel=self.minlevel, maxlevel=self.maxlevel,cut=self.cut) + self.assertVectorExists(name=self.output+"_cut", msg=self.output+" was not created.") + + # Check the attribute values of contours with v.db.select + self.assertModule('v.db.select', map=self.output+"_cut", file='testReportCut') + self.assertFileExists('testReportCut', msg='testReportCut file was not created') + if os.path.isfile('testReportCut'): + file = open("testReportCut", "r") + fileData = file.read() + self.assertMultiLineEqual(fileData, self.test_ref_str) + file.close() + + def test_raster_contour_flag_t(self): + """Testing r.contour runs successfully with input steps,levels, minlevel, maxlevel ,cut=100 and flag t""" + self.assertModule('r.contour', input=self.input, output=self.output+"_cut_flag_t", flags='t', step=self.step, levels=self.levels, minlevel=self.minlevel, maxlevel=self.maxlevel, cut=self.cut) + self.assertVectorExists(name=self.output+"_cut_flag_t", msg=self.output+" was not created.") + # No need to check the attribute values of contours because attribute table was not created + +if __name__ == '__main__': + from grass.gunittest.main import test + test() diff -Nru grass-7.6.1/raster/r.contour/testsuite/testrc.py grass-7.8.0/raster/r.contour/testsuite/testrc.py --- grass-7.6.1/raster/r.contour/testsuite/testrc.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/raster/r.contour/testsuite/testrc.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,112 @@ +""" +Name: r.contour test +Purpose: Tests r.contour and its flags/options. + +Author: Sunveer Singh, Google Code-in 2018 +Copyright: (C) 2018 by Sunveer Singh and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +out_where = u"""cat|level +1|56 +2|58 +3|60 +4|62 +5|64 +6|66 +7|68 +8|70 +9|72 +10|74 +11|76 +12|78 +13|80 +14|82 +15|84 +16|86 +17|88 +18|90 +19|92 +20|94 +21|96 +22|98 +23|100 +24|102 +25|104 +26|106 +27|108 +28|110 +29|112 +30|114 +31|116 +32|118 +33|120 +34|122 +35|124 +36|126 +37|128 +38|130 +39|132 +40|134 +41|136 +42|138 +43|140 +44|142 +45|144 +46|146 +47|148 +48|150 +49|152 +50|154 +51|156 +""" + +class Testrr(TestCase): + input='elevation' + output='towns' + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + cls.runModule('g.region', raster=cls.input) + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + + + def tearDown(cls): + cls.runModule('g.remove', type='vector', flags='f', name=cls.output) + + + def test_flag_t(self): + """Testing flag t""" + string=u"""min=1 + max=6""" + self.assertModule('r.contour', input=self.input, output=self.output, levels=1, step=1, flags='t') + self.assertRasterFitsUnivar(self.output, + reference=string, precision=2) + + def test_vector(self): + """Testing vector output""" + self.assertModule('r.contour', input=self.input, output=self.output, step=5, flags='t') + self.assertModule('v.info', map=self.output, flags='t') + topology = dict(points=0, lines=2222, areas=0) + self.assertVectorFitsTopoInfo(self.output, topology) + + def test_v_db_select(self): + """Testing attribute values of contours with v.db.select """ + self.assertModule('r.contour', input=self.input, output=self.output, step=2) + v_db_select = SimpleModule('v.db.select', map=self.output) + v_db_select.run() + self.assertLooksLike(reference=out_where, actual=v_db_select.outputs.stdout) + +if __name__ == '__main__': + from grass.gunittest.main import test + test() + diff -Nru grass-7.6.1/raster/r.cost/main.c grass-7.8.0/raster/r.cost/main.c --- grass-7.6.1/raster/r.cost/main.c 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.cost/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -503,7 +503,8 @@ ptr2 = cell; for (col = 0; col < ncols; col++) { solvedir[0] = *(DCELL *)ptr2; - Segment_put(&solve_seg, solvedir, row, col); + if (Segment_put(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); ptr2 = G_incr_void_ptr(ptr2, dsize); } } @@ -563,7 +564,8 @@ p = null_cost; } costs.cost_in = p; - Segment_put(&cost_seg, &costs, row, col); + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); ptr2 = G_incr_void_ptr(ptr2, dsize); } } @@ -579,7 +581,8 @@ for (row = 0; row < nrows; row++) { G_percent(row, nrows, 2); for (col = 0; col < ncols; col++) { - Segment_put(&dir_seg, &fnullval, row, col); + if (Segment_put(&dir_seg, &fnullval, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } } G_percent(1, 1, 1); @@ -729,21 +732,24 @@ if (!Rast_is_null_value(ptr2, data_type2)) { double cellval; - Segment_get(&cost_seg, &costs, row, col); + if (Segment_get(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); cellval = Rast_get_d_value(ptr2, data_type2); if (start_with_raster_vals == 1) { insert(cellval, row, col); costs.cost_out = cellval; costs.nearest = cellval; - Segment_put(&cost_seg, &costs, row, col); + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } else { value = &zero; insert(zero, row, col); costs.cost_out = *value; costs.nearest = cellval; - Segment_put(&cost_seg, &costs, row, col); + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } got_one = 1; } @@ -769,13 +775,15 @@ || next_start_pt->col < 0 || next_start_pt->col >= ncols) G_fatal_error(_("Specified starting location outside database window")); insert(zero, next_start_pt->row, next_start_pt->col); - Segment_get(&cost_seg, &costs, next_start_pt->row, - next_start_pt->col); + if (Segment_get(&cost_seg, &costs, next_start_pt->row, + next_start_pt->col) < 0) + G_fatal_error(_("Can not read from temporary file")); costs.cost_out = *value; costs.nearest = next_start_pt->value; - Segment_put(&cost_seg, &costs, next_start_pt->row, - next_start_pt->col); + if (Segment_put(&cost_seg, &costs, next_start_pt->row, + next_start_pt->col) < 0) + G_fatal_error(_("Can not write to temporary file")); next_start_pt = next_start_pt->next; } } @@ -826,7 +834,8 @@ break; /* If I've already been updated, delete me */ - Segment_get(&cost_seg, &costs, pres_cell->row, pres_cell->col); + if (Segment_get(&cost_seg, &costs, pres_cell->row, pres_cell->col) < 0) + G_fatal_error(_("Can not read from temporary file")); old_min_cost = costs.cost_out; if (!Rast_is_d_null_value(&old_min_cost)) { if (pres_cell->min_cost > old_min_cost) { @@ -842,8 +851,10 @@ } FLAG_SET(visited, pres_cell->row, pres_cell->col); - if (have_solver) - Segment_get(&solve_seg, mysolvedir, pres_cell->row, pres_cell->col); + if (have_solver) { + if (Segment_get(&solve_seg, mysolvedir, pres_cell->row, pres_cell->col) < 0) + G_fatal_error(_("Can not read from temporary file")); + } my_cost = costs.cost_in; nearest = costs.nearest; @@ -1020,7 +1031,8 @@ /* skip already processed neighbors here ? */ min_cost = dnullval; - Segment_get(&cost_seg, &costs, row, col); + if (Segment_get(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); switch (neighbor) { case 1: @@ -1109,41 +1121,50 @@ if (Rast_is_d_null_value(&min_cost)) continue; - Segment_get(&cost_seg, &costs, row, col); + if (Segment_get(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); old_min_cost = costs.cost_out; /* add to list */ if (Rast_is_d_null_value(&old_min_cost)) { costs.cost_out = min_cost; costs.nearest = nearest; - Segment_put(&cost_seg, &costs, row, col); + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); insert(min_cost, row, col); if (dir == 1) { if (dir_bin) cur_dir = (1 << (int)cur_dir); - Segment_put(&dir_seg, &cur_dir, row, col); + if (Segment_put(&dir_seg, &cur_dir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } if (have_solver) { - Segment_get(&solve_seg, solvedir, row, col); + if (Segment_get(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); solvedir[1] = mysolvedir[0]; - Segment_put(&solve_seg, solvedir, row, col); + if (Segment_put(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } } /* update with lower costs */ else if (old_min_cost > min_cost) { costs.cost_out = min_cost; costs.nearest = nearest; - Segment_put(&cost_seg, &costs, row, col); + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); insert(min_cost, row, col); if (dir == 1) { if (dir_bin) cur_dir = (1 << (int)cur_dir); - Segment_put(&dir_seg, &cur_dir, row, col); + if (Segment_put(&dir_seg, &cur_dir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } if (have_solver) { - Segment_get(&solve_seg, solvedir, row, col); + if (Segment_get(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); solvedir[1] = mysolvedir[0]; - Segment_put(&solve_seg, solvedir, row, col); + if (Segment_put(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } } else if (old_min_cost == min_cost && @@ -1159,19 +1180,23 @@ * otherwise we might get circular paths */ if (have_solver) { - Segment_get(&solve_seg, solvedir, row, col); + if (Segment_get(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); equal = (solvedir[1] == mysolvedir[0]); if (solvedir[1] > mysolvedir[0]) { solvedir[1] = mysolvedir[0]; - Segment_put(&solve_seg, solvedir, row, col); + if (Segment_put(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); costs.nearest = nearest; - Segment_put(&cost_seg, &costs, row, col); + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); if (dir == 1) { if (dir_bin) cur_dir = (1 << (int)cur_dir); - Segment_put(&dir_seg, &cur_dir, row, col); + if (Segment_put(&dir_seg, &cur_dir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } } } @@ -1180,12 +1205,15 @@ /* this can create circular paths: * set only if current cell does not point to neighbor * does not avoid longer circular paths */ - Segment_get(&dir_seg, &old_dir, pres_cell->row, pres_cell->col); + if (Segment_get(&dir_seg, &old_dir, pres_cell->row, pres_cell->col) < 0) + G_fatal_error(_("Can not read from temporary file")); dir_fwd = (1 << dir_inv[(int)cur_dir]); if (!((int)old_dir & dir_fwd)) { - Segment_get(&dir_seg, &old_dir, row, col); + if (Segment_get(&dir_seg, &old_dir, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); cur_dir = ((1 << (int)cur_dir) | (int)old_dir); - Segment_put(&dir_seg, &cur_dir, row, col); + if (Segment_put(&dir_seg, &cur_dir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } } } @@ -1263,7 +1291,8 @@ continue; } } - Segment_get(&cost_seg, &costs, row, col); + if (Segment_get(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); min_cost = costs.cost_out; nearest = costs.nearest; if (Rast_is_d_null_value(&min_cost)) { @@ -1328,7 +1357,8 @@ for (row = 0; row < nrows; row++) { p = dir_cell; for (col = 0; col < ncols; col++) { - Segment_get(&dir_seg, &cur_dir, row, col); + if (Segment_get(&dir_seg, &cur_dir, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); *((FCELL *) p) = cur_dir; p = G_incr_void_ptr(p, dir_size); } diff -Nru grass-7.6.1/raster/r.cost/r.cost.html grass-7.8.0/raster/r.cost/r.cost.html --- grass-7.6.1/raster/r.cost/r.cost.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.cost/r.cost.html 2019-06-03 20:34:21.000000000 +0000 @@ -285,8 +285,9 @@ Antony Awaida, Intelligent Engineering Systems Laboratory, M.I.T.
    James Westervelt, U.S.Army Construction Engineering Research Laboratory
    -Updated for Grass 5 by Pierre de Mouveaux (pmx@audiovu.com) -Markus Metz +Updated for Grass 5 by Pierre de Mouveaux (pmx@audiovu.com)
    +Markus Metz
    +Multiple path directions sponsored by mundialis

    -Last changed: $Date: 2018-05-19 17:50:47 +0200 (Sat, 19 May 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.covar/r.covar.html grass-7.8.0/raster/r.covar/r.covar.html --- grass-7.6.1/raster/r.covar/r.covar.html 2019-03-19 20:02:49.000000000 +0000 +++ grass-7.8.0/raster/r.covar/r.covar.html 2019-05-18 15:50:05.000000000 +0000 @@ -97,4 +97,4 @@ Michael Shapiro, U.S. Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2014-12-28 16:42:58 +0100 (Sun, 28 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.cross/r.cross.html grass-7.8.0/raster/r.cross/r.cross.html --- grass-7.6.1/raster/r.cross/r.cross.html 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.cross/r.cross.html 2019-05-22 21:47:51.000000000 +0000 @@ -97,4 +97,4 @@ Michael Shapiro, U.S. Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2018-02-26 18:40:49 +0100 (Mon, 26 Feb 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.describe/r.describe.html grass-7.8.0/raster/r.describe/r.describe.html --- grass-7.6.1/raster/r.describe/r.describe.html 2019-03-19 20:03:34.000000000 +0000 +++ grass-7.8.0/raster/r.describe/r.describe.html 2019-05-18 15:50:05.000000000 +0000 @@ -95,4 +95,4 @@ Michael Shapiro, U.S. Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.distance/r.distance.html grass-7.8.0/raster/r.distance/r.distance.html --- grass-7.6.1/raster/r.distance/r.distance.html 2019-03-19 20:02:49.000000000 +0000 +++ grass-7.8.0/raster/r.distance/r.distance.html 2019-05-18 15:50:05.000000000 +0000 @@ -70,4 +70,4 @@ Michael Shapiro, U.S. Army Construction Engineering Research Laboratory

    -Last changed: $Date: 2014-11-28 17:22:17 +0100 (Fri, 28 Nov 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.drain/r.drain.html grass-7.8.0/raster/r.drain/r.drain.html --- grass-7.6.1/raster/r.drain/r.drain.html 2019-03-19 20:03:17.000000000 +0000 +++ grass-7.8.0/raster/r.drain/r.drain.html 2019-05-18 15:50:05.000000000 +0000 @@ -313,4 +313,4 @@ Roberto Flor (ITC-irst, Trento, Italy)

    -Last changed: $Date: 2018-01-26 12:37:03 +0100 (Fri, 26 Jan 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.external/r.external.html grass-7.8.0/raster/r.external/r.external.html --- grass-7.6.1/raster/r.external/r.external.html 2019-03-19 20:03:33.000000000 +0000 +++ grass-7.8.0/raster/r.external/r.external.html 2019-05-18 15:50:05.000000000 +0000 @@ -83,4 +83,4 @@ Glynn Clements

    -Last changed: $Date: 2016-01-13 10:18:55 +0100 (Wed, 13 Jan 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.external.out/r.external.out.html grass-7.8.0/raster/r.external.out/r.external.out.html --- grass-7.6.1/raster/r.external.out/r.external.out.html 2019-03-19 20:03:10.000000000 +0000 +++ grass-7.8.0/raster/r.external.out/r.external.out.html 2019-06-03 20:34:21.000000000 +0000 @@ -27,8 +27,8 @@ # define output directory for files resulting from GRASS calculation(s) # and target format: mkdir $HOME/gisoutput/ -r.external.out directory=$HOME/gisoutput/ format="GTiff" - +# hint: the create options are not mandatory +r.external.out directory=$HOME/gisoutput/ format="GTiff" option="BIGTIFF=YES,COMPRESS=DEFLATE" # prepare sample analysis g.region raster=elevation -p @@ -86,4 +86,4 @@ Glynn Clements

    -Last changed: $Date: 2017-02-28 17:48:37 +0100 (Tue, 28 Feb 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.fill.dir/r.fill.dir.html grass-7.8.0/raster/r.fill.dir/r.fill.dir.html --- grass-7.6.1/raster/r.fill.dir/r.fill.dir.html 2019-03-19 20:03:24.000000000 +0000 +++ grass-7.8.0/raster/r.fill.dir/r.fill.dir.html 2019-05-22 21:47:51.000000000 +0000 @@ -189,4 +189,4 @@ Roger S. Miller

    -Last changed: $Date: 2017-11-24 02:59:27 +0100 (Fri, 24 Nov 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.fill.stats/r.fill.stats.html grass-7.8.0/raster/r.fill.stats/r.fill.stats.html --- grass-7.6.1/raster/r.fill.stats/r.fill.stats.html 2019-03-19 20:03:36.000000000 +0000 +++ grass-7.8.0/raster/r.fill.stats/r.fill.stats.html 2019-05-22 21:47:51.000000000 +0000 @@ -515,5 +515,5 @@ Benjamin Ducke -

    Last changed: $Date: 2018-09-19 15:51:49 +0200 (Wed, 19 Sep 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.flow/r.flow.html grass-7.8.0/raster/r.flow/r.flow.html --- grass-7.6.1/raster/r.flow/r.flow.html 2019-03-19 20:03:15.000000000 +0000 +++ grass-7.8.0/raster/r.flow/r.flow.html 2019-05-18 15:50:05.000000000 +0000 @@ -236,4 +236,4 @@ at Urbana-Champaign

    -Last changed: $Date: 2018-10-18 21:05:15 +0200 (Thu, 18 Oct 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.geomorphon/r.geomorphon.html grass-7.8.0/raster/r.geomorphon/r.geomorphon.html --- grass-7.6.1/raster/r.geomorphon/r.geomorphon.html 2019-03-19 20:03:06.000000000 +0000 +++ grass-7.8.0/raster/r.geomorphon/r.geomorphon.html 2019-05-18 15:50:05.000000000 +0000 @@ -179,4 +179,4 @@ Jarek Jasiewicz, Tomek Stepinski (merit contribution)

    -Last changed: $Date: 2018-10-18 21:05:15 +0200 (Thu, 18 Oct 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.grow.distance/r.grow.distance.html grass-7.8.0/raster/r.grow.distance/r.grow.distance.html --- grass-7.6.1/raster/r.grow.distance/r.grow.distance.html 2019-03-19 20:03:34.000000000 +0000 +++ grass-7.8.0/raster/r.grow.distance/r.grow.distance.html 2019-05-18 15:50:05.000000000 +0000 @@ -122,4 +122,4 @@ Glynn Clements

    -Last changed: $Date: 2016-01-21 14:23:39 +0100 (Thu, 21 Jan 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.gwflow/r.gwflow.html grass-7.8.0/raster/r.gwflow/r.gwflow.html --- grass-7.6.1/raster/r.gwflow/r.gwflow.html 2019-03-19 20:03:27.000000000 +0000 +++ grass-7.8.0/raster/r.gwflow/r.gwflow.html 2019-05-18 15:50:05.000000000 +0000 @@ -152,4 +152,4 @@ here at Technical University Berlin in Germany. -

    Last changed: $Date: 2018-12-26 13:09:47 +0100 (Wed, 26 Dec 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.his/r.his.html grass-7.8.0/raster/r.his/r.his.html --- grass-7.6.1/raster/r.his/r.his.html 2019-03-19 20:02:49.000000000 +0000 +++ grass-7.8.0/raster/r.his/r.his.html 2019-05-18 15:50:05.000000000 +0000 @@ -132,4 +132,4 @@ Glynn Clements (based upon d.his) -

    Last changed: $Date: 2016-01-28 12:21:34 +0100 (Thu, 28 Jan 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.horizon/r.horizon.html grass-7.8.0/raster/r.horizon/r.horizon.html --- grass-7.6.1/raster/r.horizon/r.horizon.html 2019-03-19 20:03:54.000000000 +0000 +++ grass-7.8.0/raster/r.horizon/r.horizon.html 2019-05-18 15:50:05.000000000 +0000 @@ -256,4 +256,4 @@ Marcel.Suri@jrc.it -

    Last changed: $Date: 2018-01-23 16:34:19 +0100 (Tue, 23 Jan 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.in.ascii/r.in.ascii.html grass-7.8.0/raster/r.in.ascii/r.in.ascii.html --- grass-7.6.1/raster/r.in.ascii/r.in.ascii.html 2019-03-19 20:02:57.000000000 +0000 +++ grass-7.8.0/raster/r.in.ascii/r.in.ascii.html 2019-05-22 21:47:51.000000000 +0000 @@ -57,8 +57,8 @@ split over many lines.

    -r.in.ascii may import integer, floating point, or double cell -types using the -i, -f, and -d flags, respectively. +The imported cell type can be forced using the type option, +default is auto-detection.

    The header information in ESRI Raster ASCII files differs from GRASS. @@ -109,4 +109,4 @@ Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
    Surfer support by Roger Miller -

    Last changed: $Date: 2016-01-16 20:47:30 +0100 (Sat, 16 Jan 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.in.bin/r.in.bin.html grass-7.8.0/raster/r.in.bin/r.in.bin.html --- grass-7.6.1/raster/r.in.bin/r.in.bin.html 2019-03-19 20:03:34.000000000 +0000 +++ grass-7.8.0/raster/r.in.bin/r.in.bin.html 2019-05-18 15:50:05.000000000 +0000 @@ -134,4 +134,4 @@ Markus Metz
    Man page: Zsolt Felker (felker@c160.pki.matav.hu) -

    Last changed: $Date: 2017-01-26 23:47:01 +0100 (Thu, 26 Jan 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.info/r.info.html grass-7.8.0/raster/r.info/r.info.html --- grass-7.6.1/raster/r.info/r.info.html 2019-03-19 20:03:47.000000000 +0000 +++ grass-7.8.0/raster/r.info/r.info.html 2019-05-18 15:50:05.000000000 +0000 @@ -143,4 +143,4 @@ U.S. Army Construction Engineering Research Laboratory

    -Last changed: $Date: 2014-11-26 17:43:10 +0100 (Wed, 26 Nov 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.in.gdal/main.c grass-7.8.0/raster/r.in.gdal/main.c --- grass-7.6.1/raster/r.in.gdal/main.c 2019-03-19 20:03:30.000000000 +0000 +++ grass-7.8.0/raster/r.in.gdal/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -50,6 +50,36 @@ static void error_handler_ds(void *p); static int l1bdriver; +static GDALDatasetH opends(char *dsname, const char **doo, GDALDriverH *hDriver) +{ + GDALDatasetH hDS = NULL; + +#if GDAL_VERSION_NUM >= 2000000 + hDS = GDALOpenEx(dsname, GDAL_OF_RASTER | GDAL_OF_READONLY, NULL, + doo, NULL); +#else + hDS = GDALOpen(dsname, GA_ReadOnly); +#endif + if (hDS == NULL) + G_fatal_error(_("Unable to open datasource <%s>"), dsname); + G_add_error_handler(error_handler_ds, hDS); + + *hDriver = GDALGetDatasetDriver(hDS); /* needed for AVHRR data */ + /* L1B - NOAA/AVHRR data must be treated differently */ + /* for hDriver names see gdal/frmts/gdalallregister.cpp */ + G_debug(3, "GDAL Driver: %s", GDALGetDriverShortName(*hDriver)); + if (strcmp(GDALGetDriverShortName(*hDriver), "L1B") != 0) + l1bdriver = 0; + else { + l1bdriver = 1; /* AVHRR found, needs north south flip */ + G_warning(_("Input seems to be NOAA/AVHRR data which needs to be " + "georeferenced with thin plate spline transformation " + "(%s or %s)."), "i.rectify -t", "gdalwarp -tps"); + } + + return hDS; +} + /************************************************************************/ /* main() */ @@ -407,28 +437,7 @@ /* Open the dataset. */ /* -------------------------------------------------------------------- */ -#if GDAL_VERSION_NUM >= 2000000 - hDS = GDALOpenEx(input, GDAL_OF_RASTER | GDAL_OF_READONLY, NULL, - (const char **) doo, NULL); -#else - hDS = GDALOpen(input, GA_ReadOnly); -#endif - if (hDS == NULL) - G_fatal_error(_("Unable to open datasource <%s>"), input); - G_add_error_handler(error_handler_ds, hDS); - - hDriver = GDALGetDatasetDriver(hDS); /* needed for AVHRR data */ - /* L1B - NOAA/AVHRR data must be treated differently */ - /* for hDriver names see gdal/frmts/gdalallregister.cpp */ - G_debug(3, "GDAL Driver: %s", GDALGetDriverShortName(hDriver)); - if (strcmp(GDALGetDriverShortName(hDriver), "L1B") != 0) - l1bdriver = 0; - else { - l1bdriver = 1; /* AVHRR found, needs north south flip */ - G_warning(_("Input seems to be NOAA/AVHRR data which needs to be " - "georeferenced with thin plate spline transformation " - "(%s or %s)."), "i.rectify -t", "gdalwarp -tps"); - } + hDS = opends(input, (const char **)doo, &hDriver); /* does the driver support subdatasets? */ /* test for capability GDAL_DMD_SUBDATASETS */ @@ -438,12 +447,79 @@ char **sds = GDALGetMetadata(hDS, "SUBDATASETS"); if (sds && *sds) { + int i; + G_warning(_("Input contains subdatasets which may need to " - "be imported separately")); - /* list subdatasets? */ + "be imported separately by name:")); + /* list subdatasets */ + for (i = 0; sds[i] != NULL; i++) { + char *sdsi = G_store(sds[i]); + char *p = sdsi; + + while (*p != '=' && *p != '\0') + p++; + if (*p == '=') + p++; + if ((i & 1) == 0) { + fprintf(stderr, "Subdataset %d:\n", i + 1); + fprintf(stderr, " Name: %s\n", p); + } + else { + char *sdsdim, *sdsdesc, *sdstype; + int sdsdlen; + + sdsdim = sdsdesc = sdstype = NULL; + sdsdlen = strlen(sdsi); + while (*p != '[' && *p != '\0') + p++; + if (*p == '[') { + p++; + sdsdim = p; + while (*p != ']' && *p != '\0') + p++; + if (*p == ']') { + *p = '\0'; + p++; + } + } + while (*p == ' ' && *p != '\0') + p++; + sdsdesc = p; + if (*p != '\0') { + p = sdsi + sdsdlen - 1; + + if (*p == ')') { + *p = '\0'; + p--; + while (*p != '(') + p--; + if (*p == '(') { + sdstype = p + 1; + p--; + while (*p == ' ') + p--; + } + p++; + if (*p == ' ') + *p = '\0'; + } + } + if (sdsdesc && *sdsdesc) + fprintf(stderr, " Description: %s\n", sdsdesc); + if (sdsdim && *sdsdim) + fprintf(stderr, " Dimension: %s\n", sdsdim); + if (sdstype && *sdstype) + fprintf(stderr, " Data type: %s\n", sdstype); + } + G_free(sdsi); + } } } + if (GDALGetRasterCount(hDS) == 0) { + G_fatal_error(_("No raster bands found in <%s>"), input); + } + if (flag_p->answer) { /* print number of bands */ fprintf(stdout, "%d\n", GDALGetRasterCount(hDS)); @@ -477,9 +553,14 @@ if (GDALGetGeoTransform(hDS, adfGeoTransform) == CE_None) { if (adfGeoTransform[2] != 0.0 || adfGeoTransform[4] != 0.0 || - adfGeoTransform[1] <= 0.0 || adfGeoTransform[5] >= 0.0) + adfGeoTransform[1] <= 0.0 || adfGeoTransform[5] >= 0.0) { + G_debug(0, "adfGeoTransform[2] %g", adfGeoTransform[2]); + G_debug(0, "adfGeoTransform[4] %g", adfGeoTransform[4]); + G_debug(0, "adfGeoTransform[1] %g", adfGeoTransform[1]); + G_debug(0, "adfGeoTransform[5] %g", adfGeoTransform[5]); G_fatal_error(_("Input raster map is flipped or rotated - cannot import. " "You may use 'gdalwarp' to transform the map to North-up.")); + } cellhd.north = adfGeoTransform[3]; cellhd.ns_res = fabs(adfGeoTransform[5]); cellhd.ns_res3 = fabs(adfGeoTransform[5]); @@ -676,7 +757,7 @@ /* -------------------------------------------------------------------- */ else { struct Ref ref; - char szBandName[512]; + char szBandName[1024]; int nBand = 0; char colornamebuf[512], colornamebuf2[512]; FILE *map_names_file = NULL; @@ -965,7 +1046,7 @@ { struct Cell_head cellhd; struct Key_Value *proj_info = NULL, *proj_units = NULL; - char errbuf[256]; + char errbuf[1024]; int permissions; char target_mapset[GMAPSET_MAX]; struct Key_Value *out_proj_info, /* projection information of */ diff -Nru grass-7.6.1/raster/r.in.gdal/r.in.gdal.html grass-7.8.0/raster/r.in.gdal/r.in.gdal.html --- grass-7.6.1/raster/r.in.gdal/r.in.gdal.html 2019-03-19 20:03:29.000000000 +0000 +++ grass-7.8.0/raster/r.in.gdal/r.in.gdal.html 2019-05-18 15:50:05.000000000 +0000 @@ -442,4 +442,4 @@ (email).

    -Last changed: $Date: 2018-09-24 16:54:20 +0200 (Mon, 24 Sep 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.in.gridatb/r.in.gridatb.html grass-7.8.0/raster/r.in.gridatb/r.in.gridatb.html --- grass-7.6.1/raster/r.in.gridatb/r.in.gridatb.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.in.gridatb/r.in.gridatb.html 2019-05-18 15:50:05.000000000 +0000 @@ -12,4 +12,4 @@ Huidae Cho based on code from Keith Beven -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.in.lidar/r.in.lidar.html grass-7.8.0/raster/r.in.lidar/r.in.lidar.html --- grass-7.6.1/raster/r.in.lidar/r.in.lidar.html 2019-03-19 20:02:57.000000000 +0000 +++ grass-7.8.0/raster/r.in.lidar/r.in.lidar.html 2019-05-22 21:47:51.000000000 +0000 @@ -620,4 +620,4 @@
    based on r.in.xyz by Hamish Bowman and Volker Wichmann
    -

    Last changed: $Date: 2018-11-30 22:03:25 +0100 (Fri, 30 Nov 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.in.mat/r.in.mat.html grass-7.8.0/raster/r.in.mat/r.in.mat.html --- grass-7.6.1/raster/r.in.mat/r.in.mat.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.in.mat/r.in.mat.html 2019-05-18 15:50:05.000000000 +0000 @@ -134,4 +134,4 @@ New Zealand

    -

    Last changed: $Date: 2015-05-11 02:11:34 +0200 (Mon, 11 May 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.in.png/r.in.png.html grass-7.8.0/raster/r.in.png/r.in.png.html --- grass-7.6.1/raster/r.in.png/r.in.png.html 2019-03-19 20:03:54.000000000 +0000 +++ grass-7.8.0/raster/r.in.png/r.in.png.html 2019-05-18 15:50:05.000000000 +0000 @@ -24,4 +24,4 @@ Glynn Clements

    -Last changed: $Date: 2018-11-05 14:29:23 +0100 (Mon, 05 Nov 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.in.poly/r.in.poly.html grass-7.8.0/raster/r.in.poly/r.in.poly.html --- grass-7.6.1/raster/r.in.poly/r.in.poly.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.in.poly/r.in.poly.html 2019-05-18 15:50:05.000000000 +0000 @@ -106,4 +106,4 @@ Michael Shapiro, U.S.Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2014-11-01 11:07:51 +0100 (Sat, 01 Nov 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.in.poly/testsuite/test_rinpoly.py grass-7.8.0/raster/r.in.poly/testsuite/test_rinpoly.py --- grass-7.6.1/raster/r.in.poly/testsuite/test_rinpoly.py 2019-03-19 20:03:10.000000000 +0000 +++ grass-7.8.0/raster/r.in.poly/testsuite/test_rinpoly.py 2019-06-03 20:34:21.000000000 +0000 @@ -6,7 +6,7 @@ input1 = \ -""" +b""" A 634308.630394 223320.356473 640640.712946 223092.401501 diff -Nru grass-7.6.1/raster/r.in.xyz/r.in.xyz.html grass-7.8.0/raster/r.in.xyz/r.in.xyz.html --- grass-7.6.1/raster/r.in.xyz/r.in.xyz.html 2019-03-19 20:03:18.000000000 +0000 +++ grass-7.8.0/raster/r.in.xyz/r.in.xyz.html 2019-05-18 15:50:05.000000000 +0000 @@ -353,4 +353,4 @@ median, percentile, skewness and trimmed mean.

    -Last changed: $Date: 2017-01-09 13:04:27 +0100 (Mon, 09 Jan 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.kappa/r.kappa.html grass-7.8.0/raster/r.kappa/r.kappa.html --- grass-7.6.1/raster/r.kappa/r.kappa.html 2019-03-19 20:02:49.000000000 +0000 +++ grass-7.8.0/raster/r.kappa/r.kappa.html 2019-05-18 15:50:05.000000000 +0000 @@ -94,4 +94,4 @@ Tao Wen, University of Illinois at Urbana-Champaign, Illinois

    -Last changed: $Date: 2018-10-18 21:05:15 +0200 (Thu, 18 Oct 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.lake/r.lake.html grass-7.8.0/raster/r.lake/r.lake.html --- grass-7.6.1/raster/r.lake/r.lake.html 2019-03-19 20:03:05.000000000 +0000 +++ grass-7.8.0/raster/r.lake/r.lake.html 2019-05-18 15:50:05.000000000 +0000 @@ -115,4 +115,4 @@

    AUTHOR

    Maris Nartiss (maris.nartiss gmail.com) -

    Last changed: $Date: 2015-12-19 23:27:42 +0100 (Sat, 19 Dec 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.latlong/r.latlong.html grass-7.8.0/raster/r.latlong/r.latlong.html --- grass-7.6.1/raster/r.latlong/r.latlong.html 2019-03-19 20:03:09.000000000 +0000 +++ grass-7.8.0/raster/r.latlong/r.latlong.html 2019-05-18 15:50:05.000000000 +0000 @@ -29,4 +29,4 @@ Yann Chemin, International Rice Research Institute, The Philippines -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.cwed/r.li.cwed.html grass-7.8.0/raster/r.li/r.li.cwed/r.li.cwed.html --- grass-7.6.1/raster/r.li/r.li.cwed/r.li.cwed.html 2019-03-19 20:03:13.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.cwed/r.li.cwed.html 2019-05-18 15:50:05.000000000 +0000 @@ -74,4 +74,4 @@ Markus Metz

    -Last changed: $Date: 2014-11-28 17:22:17 +0100 (Fri, 28 Nov 2014) $

    +Last changed: $Date$

    diff -Nru grass-7.6.1/raster/r.li/r.li.daemon/r.li.daemon.html grass-7.8.0/raster/r.li/r.li.daemon/r.li.daemon.html --- grass-7.6.1/raster/r.li/r.li.daemon/r.li.daemon.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.daemon/r.li.daemon.html 2019-05-18 15:50:05.000000000 +0000 @@ -96,4 +96,4 @@ Read the COPYING file that comes with GRASS for details.

    -Last changed: $Date: 2015-03-23 20:44:45 +0100 (Mon, 23 Mar 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.dominance/r.li.dominance.html grass-7.8.0/raster/r.li/r.li.dominance/r.li.dominance.html --- grass-7.6.1/raster/r.li/r.li.dominance/r.li.dominance.html 2019-03-19 20:03:13.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.dominance/r.li.dominance.html 2019-05-18 15:50:05.000000000 +0000 @@ -73,4 +73,4 @@ Markus Metz

    -Last changed: $Date: 2015-08-24 05:56:52 +0200 (Mon, 24 Aug 2015) $

    +Last changed: $Date$

    diff -Nru grass-7.6.1/raster/r.li/r.li.edgedensity/r.li.edgedensity.html grass-7.8.0/raster/r.li/r.li.edgedensity/r.li.edgedensity.html --- grass-7.6.1/raster/r.li/r.li.edgedensity/r.li.edgedensity.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.edgedensity/r.li.edgedensity.html 2019-05-18 15:50:05.000000000 +0000 @@ -94,4 +94,4 @@ Markus Metz

    -Last changed: $Date: 2015-08-24 05:56:52 +0200 (Mon, 24 Aug 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.html grass-7.8.0/raster/r.li/r.li.html --- grass-7.6.1/raster/r.li/r.li.html 2019-03-19 20:03:12.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.html 2019-05-18 15:50:05.000000000 +0000 @@ -225,4 +225,4 @@ Partially rewritten by Markus Metz

    -Last changed: $Date: 2017-11-12 14:14:46 +0100 (Sun, 12 Nov 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.mpa/r.li.mpa.html grass-7.8.0/raster/r.li/r.li.mpa/r.li.mpa.html --- grass-7.6.1/raster/r.li/r.li.mpa/r.li.mpa.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.mpa/r.li.mpa.html 2019-05-18 15:50:05.000000000 +0000 @@ -81,4 +81,4 @@ Markus Metz

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.mps/r.li.mps.html grass-7.8.0/raster/r.li/r.li.mps/r.li.mps.html --- grass-7.6.1/raster/r.li/r.li.mps/r.li.mps.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.mps/r.li.mps.html 2019-05-18 15:50:05.000000000 +0000 @@ -82,4 +82,4 @@ Markus Metz (statistics)

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.padcv/r.li.padcv.html grass-7.8.0/raster/r.li/r.li.padcv/r.li.padcv.html --- grass-7.6.1/raster/r.li/r.li.padcv/r.li.padcv.html 2019-03-19 20:03:12.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.padcv/r.li.padcv.html 2019-05-18 15:50:05.000000000 +0000 @@ -72,4 +72,4 @@ Markus Metz (statistics)

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.padrange/r.li.padrange.html grass-7.8.0/raster/r.li/r.li.padrange/r.li.padrange.html --- grass-7.6.1/raster/r.li/r.li.padrange/r.li.padrange.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.padrange/r.li.padrange.html 2019-05-18 15:50:05.000000000 +0000 @@ -74,4 +74,4 @@ Markus Metz (statistics)

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $

    +Last changed: $Date$

    diff -Nru grass-7.6.1/raster/r.li/r.li.padsd/r.li.padsd.html grass-7.8.0/raster/r.li/r.li.padsd/r.li.padsd.html --- grass-7.6.1/raster/r.li/r.li.padsd/r.li.padsd.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.padsd/r.li.padsd.html 2019-05-18 15:50:05.000000000 +0000 @@ -74,4 +74,4 @@ Markus Metz (statistics)

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.patchdensity/r.li.patchdensity.html grass-7.8.0/raster/r.li/r.li.patchdensity/r.li.patchdensity.html --- grass-7.6.1/raster/r.li/r.li.patchdensity/r.li.patchdensity.html 2019-03-19 20:03:10.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.patchdensity/r.li.patchdensity.html 2019-05-18 15:50:05.000000000 +0000 @@ -85,4 +85,4 @@ Markus Metz (statistics)

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.patchnum/r.li.patchnum.html grass-7.8.0/raster/r.li/r.li.patchnum/r.li.patchnum.html --- grass-7.6.1/raster/r.li/r.li.patchnum/r.li.patchnum.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.patchnum/r.li.patchnum.html 2019-05-18 15:50:05.000000000 +0000 @@ -68,4 +68,4 @@ Markus Metz (statistics)

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.pielou/r.li.pielou.html grass-7.8.0/raster/r.li/r.li.pielou/r.li.pielou.html --- grass-7.6.1/raster/r.li/r.li.pielou/r.li.pielou.html 2019-03-19 20:03:12.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.pielou/r.li.pielou.html 2019-05-18 15:50:05.000000000 +0000 @@ -71,4 +71,4 @@ developed by Serena Pallecchi student of Computer Science University of Pisa (Italy).

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.renyi/r.li.renyi.html grass-7.8.0/raster/r.li/r.li.renyi/r.li.renyi.html --- grass-7.6.1/raster/r.li/r.li.renyi/r.li.renyi.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.renyi/r.li.renyi.html 2019-05-18 15:50:05.000000000 +0000 @@ -75,4 +75,4 @@ Computer Science University of Pisa (Italy).

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.richness/r.li.richness.html grass-7.8.0/raster/r.li/r.li.richness/r.li.richness.html --- grass-7.6.1/raster/r.li/r.li.richness/r.li.richness.html 2019-03-19 20:03:12.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.richness/r.li.richness.html 2019-05-18 15:50:05.000000000 +0000 @@ -76,4 +76,4 @@ Commission from Faunalia Pontedera (PI), Italy (www.faunalia.it)

    -Last changed: $Date: 2015-08-24 05:56:52 +0200 (Mon, 24 Aug 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.shannon/r.li.shannon.html grass-7.8.0/raster/r.li/r.li.shannon/r.li.shannon.html --- grass-7.6.1/raster/r.li/r.li.shannon/r.li.shannon.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.shannon/r.li.shannon.html 2019-05-18 15:50:05.000000000 +0000 @@ -72,4 +72,4 @@ Commission from Faunalia Pontedera (PI), Italy (www.faunalia.it)

    -Last changed: $Date: 2015-08-24 05:56:52 +0200 (Mon, 24 Aug 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.shape/r.li.shape.html grass-7.8.0/raster/r.li/r.li.shape/r.li.shape.html --- grass-7.6.1/raster/r.li/r.li.shape/r.li.shape.html 2019-03-19 20:03:10.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.shape/r.li.shape.html 2019-05-18 15:50:05.000000000 +0000 @@ -74,4 +74,4 @@ Commission from Faunalia Pontedera (PI) (www.faunalia.it)

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.li/r.li.simpson/r.li.simpson.html grass-7.8.0/raster/r.li/r.li.simpson/r.li.simpson.html --- grass-7.6.1/raster/r.li/r.li.simpson/r.li.simpson.html 2019-03-19 20:03:12.000000000 +0000 +++ grass-7.8.0/raster/r.li/r.li.simpson/r.li.simpson.html 2019-05-18 15:50:05.000000000 +0000 @@ -72,4 +72,4 @@ Commission from Faunalia Pontedera (PI), Italy (www.faunalia.it)

    -Last changed: $Date: 2015-08-24 05:56:52 +0200 (Mon, 24 Aug 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.mapcalc/evaluate.c grass-7.8.0/raster/r.mapcalc/evaluate.c --- grass-7.6.1/raster/r.mapcalc/evaluate.c 2019-03-19 20:03:47.000000000 +0000 +++ grass-7.8.0/raster/r.mapcalc/evaluate.c 2019-06-11 07:26:20.000000000 +0000 @@ -34,8 +34,6 @@ { /* \brief Append a map to the global map list and reallocate if necessary */ - const char *mapset; - if (num_maps >= max_maps) { max_maps += 10; map_list = G_realloc(map_list, max_maps * sizeof(struct expression*)); @@ -370,19 +368,19 @@ for (current_depth = 0; current_depth < depths; current_depth++) { for (current_row = 0; current_row < rows; current_row++) { if (verbose) - G_percent(n, count, 2); + G_percent(n, count, 2); for (l = ee; l; l = l->next) { - expression *e = l->exp; - int fd; + expression *e = l->exp; + int fd; - evaluate(e); + evaluate(e); - if (e->type != expr_type_binding) - continue; + if (e->type != expr_type_binding) + continue; - fd = e->data.bind.fd; - put_map_row(fd, e->buf, e->res_type); + fd = e->data.bind.fd; + put_map_row(fd, e->buf, e->res_type); } n++; @@ -392,7 +390,9 @@ G_finish_workers(); if (verbose) - G_percent(n, count, 2); + G_percent(n, count, 2); + + close_maps(); for (l = ee; l; l = l->next) { expression *e = l->exp; @@ -412,14 +412,14 @@ if (val->type == expr_type_map) { if (val->data.map.mod == 'M') { - copy_cats(var, val->data.map.idx); - copy_colors(var, val->data.map.idx); + copy_cats(var, val->data.map.idx); + copy_colors(var, val->data.map.idx); } copy_history(var, val->data.map.idx); } else - create_history(var, val); + create_history(var, val); } G_unset_error_routine(); diff -Nru grass-7.6.1/raster/r.mapcalc/r3.mapcalc.html grass-7.8.0/raster/r.mapcalc/r3.mapcalc.html --- grass-7.6.1/raster/r.mapcalc/r3.mapcalc.html 2019-03-19 20:03:48.000000000 +0000 +++ grass-7.8.0/raster/r.mapcalc/r3.mapcalc.html 2019-05-22 21:47:51.000000000 +0000 @@ -625,4 +625,4 @@

    Glynn Clements

    -Last changed: $Date: 2018-07-01 23:03:44 +0200 (Sun, 01 Jul 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.mapcalc/r.mapcalc.html grass-7.8.0/raster/r.mapcalc/r.mapcalc.html --- grass-7.6.1/raster/r.mapcalc/r.mapcalc.html 2019-03-19 20:03:47.000000000 +0000 +++ grass-7.8.0/raster/r.mapcalc/r.mapcalc.html 2019-05-22 21:47:51.000000000 +0000 @@ -831,4 +831,4 @@

    Glynn Clements

    -Last changed: $Date: 2018-12-14 22:43:04 +0100 (Fri, 14 Dec 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.mapcalc/testsuite/test_nmedian_bug_3296.py grass-7.8.0/raster/r.mapcalc/testsuite/test_nmedian_bug_3296.py --- grass-7.6.1/raster/r.mapcalc/testsuite/test_nmedian_bug_3296.py 2019-03-19 20:03:48.000000000 +0000 +++ grass-7.8.0/raster/r.mapcalc/testsuite/test_nmedian_bug_3296.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/raster/r.mapcalc/testsuite/test_row_above_below_bug.py grass-7.8.0/raster/r.mapcalc/testsuite/test_row_above_below_bug.py --- grass-7.6.1/raster/r.mapcalc/testsuite/test_row_above_below_bug.py 2019-03-19 20:03:47.000000000 +0000 +++ grass-7.8.0/raster/r.mapcalc/testsuite/test_row_above_below_bug.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/raster/r.mfilter/r.mfilter.html grass-7.8.0/raster/r.mfilter/r.mfilter.html --- grass-7.6.1/raster/r.mfilter/r.mfilter.html 2019-03-19 20:03:49.000000000 +0000 +++ grass-7.8.0/raster/r.mfilter/r.mfilter.html 2019-05-18 15:50:05.000000000 +0000 @@ -148,4 +148,4 @@ Based upon r.mfilter, by Michael Shapiro, U.S.Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2016-09-19 12:29:41 +0200 (Mon, 19 Sep 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.mode/r.mode.html grass-7.8.0/raster/r.mode/r.mode.html --- grass-7.6.1/raster/r.mode/r.mode.html 2019-03-19 20:03:05.000000000 +0000 +++ grass-7.8.0/raster/r.mode/r.mode.html 2019-05-18 15:50:05.000000000 +0000 @@ -58,4 +58,4 @@ Michael Shapiro, U.S.Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.neighbors/r.neighbors.html grass-7.8.0/raster/r.neighbors/r.neighbors.html --- grass-7.6.1/raster/r.neighbors/r.neighbors.html 2019-03-19 20:03:09.000000000 +0000 +++ grass-7.8.0/raster/r.neighbors/r.neighbors.html 2019-05-18 15:50:05.000000000 +0000 @@ -422,4 +422,4 @@
    Updates for GRASS GIS 7 by Glynn Clements and others -

    Last changed: $Date: 2017-12-01 15:42:59 +0100 (Fri, 01 Dec 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.null/r.null.html grass-7.8.0/raster/r.null/r.null.html --- grass-7.6.1/raster/r.null/r.null.html 2019-03-19 20:02:59.000000000 +0000 +++ grass-7.8.0/raster/r.null/r.null.html 2019-09-04 13:16:01.000000000 +0000 @@ -4,7 +4,7 @@ bitmap file. The intended usage is to update maps that do not have a NULL-value bitmap file (i.e. to indicate for each pixel if zero is a valid value or is to be considered as NULL, i.e. no data value). The module does -not work with reclassified maps. +not work with reclassified or external maps.

    The design is flexible. Ranges of values can be set to NULL and/or the NULL @@ -45,6 +45,15 @@ Warning: such raster maps can then only be opened with GRASS GIS 7.2.0 or later. NULL file compression can be managed with r.null -z. +

    External maps

    +From the r.external documentation: GDAL-linked +(r.external) maps do not have or use a NULL bitmap, hence r.null cannot +manipulate them directly. Here NULL cells are those whose value matches +the value reported by the GDALGetRasterNoDataValue() function. To apply the +GDAL-linked the user need to either create a MASK (e.g. with r.mask) and +then "apply" it using e.g. r.resample, or use r.mapcalc to create a copy +with the appropriate categories changed to NULL (if() condition). +

    EXAMPLES

    Set specific values of a classified map to NULL:
    @@ -69,4 +78,4 @@
     
     U.S.Army Construction Engineering Research Laboratory
     
    -

    Last changed: $Date: 2017-01-03 14:22:09 +0100 (Tue, 03 Jan 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.ascii/main.c grass-7.8.0/raster/r.out.ascii/main.c --- grass-7.6.1/raster/r.out.ascii/main.c 2019-03-19 20:03:22.000000000 +0000 +++ grass-7.8.0/raster/r.out.ascii/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -58,6 +58,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword("ASCII"); module->description = _("Converts a raster map layer into a GRASS ASCII text file."); diff -Nru grass-7.6.1/raster/r.out.ascii/r.out.ascii.html grass-7.8.0/raster/r.out.ascii/r.out.ascii.html --- grass-7.6.1/raster/r.out.ascii/r.out.ascii.html 2019-03-19 20:03:17.000000000 +0000 +++ grass-7.8.0/raster/r.out.ascii/r.out.ascii.html 2019-05-18 15:50:05.000000000 +0000 @@ -53,4 +53,4 @@ U.S. Army Construction Engineering Research Laboratory

    Surfer support by Markus Neteler -

    Last changed: $Date: 2014-11-01 20:57:37 +0100 (Sat, 01 Nov 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.bin/main.c grass-7.8.0/raster/r.out.bin/main.c --- grass-7.6.1/raster/r.out.bin/main.c 2019-03-19 20:03:35.000000000 +0000 +++ grass-7.8.0/raster/r.out.bin/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -278,6 +278,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); module->description = _("Exports a GRASS raster to a binary array."); /* Define the different options */ diff -Nru grass-7.6.1/raster/r.out.bin/r.out.bin.html grass-7.8.0/raster/r.out.bin/r.out.bin.html --- grass-7.6.1/raster/r.out.bin/r.out.bin.html 2019-03-19 20:03:37.000000000 +0000 +++ grass-7.8.0/raster/r.out.bin/r.out.bin.html 2019-05-18 15:50:05.000000000 +0000 @@ -40,4 +40,4 @@ with a few modifications.
    Author: Bob Covill -

    Last changed: $Date: 2014-11-01 20:57:37 +0100 (Sat, 01 Nov 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.gdal/main.c grass-7.8.0/raster/r.out.gdal/main.c --- grass-7.6.1/raster/r.out.gdal/main.c 2019-03-19 20:03:36.000000000 +0000 +++ grass-7.8.0/raster/r.out.gdal/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -138,6 +138,7 @@ _("Exports GRASS raster maps into GDAL supported formats."); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); flag_l = G_define_flag(); flag_l->key = 'l'; diff -Nru grass-7.6.1/raster/r.out.gdal/r.out.gdal.html grass-7.8.0/raster/r.out.gdal/r.out.gdal.html --- grass-7.6.1/raster/r.out.gdal/r.out.gdal.html 2019-03-19 20:03:34.000000000 +0000 +++ grass-7.8.0/raster/r.out.gdal/r.out.gdal.html 2019-06-11 07:26:20.000000000 +0000 @@ -136,6 +136,11 @@ This issue only arises when writing out multi-band imagery groups. +

    Classic TIFF format supports only files with up to 4GB. Files that +exceed this limit (in compressed or uncompressed form) need to be +exported with createopt="BIGTIFF=YES". BIGTIFF is available if +GDAL is built with libtiff >= 4.0. +

    Improving GeoTIFF compatibility

    To create a GeoTIFF that is highly compatible with various other GIS @@ -198,6 +203,14 @@ r.out.gdal in=elevation output=elevation.tif createopt="COMPRESS=DEFLATE"
    +

    Export a large raster map in LZW compressed (Big) GeoTIFF format

    + +
    +g.region raster=elevation -p
    +# Using PREDICTOR 2 or 3 (the latter mainly for floating point data) can further reduce file size
    +r.out.gdal in=elevation output=elevation.tif createopt="COMPRESS=LZW,PREDICTOR=3,BIGTIFF=YES"
    +
    +

    Export a raster map with internal overview in "Deflate" compressed GeoTIFF format

    @@ -333,4 +346,4 @@
     Vytautas Vebra (oliver4grass at gmail.com)
    Markus Metz (improved nodata logic) -

    Last changed: $Date: 2019-01-15 10:57:42 +0100 (Tue, 15 Jan 2019) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.gridatb/main.c grass-7.8.0/raster/r.out.gridatb/main.c --- grass-7.6.1/raster/r.out.gridatb/main.c 2019-03-19 20:02:20.000000000 +0000 +++ grass-7.8.0/raster/r.out.gridatb/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -66,6 +66,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); module->description = _("Exports GRASS raster map to GRIDATB.FOR map file (TOPMODEL)."); diff -Nru grass-7.6.1/raster/r.out.gridatb/r.out.gridatb.html grass-7.8.0/raster/r.out.gridatb/r.out.gridatb.html --- grass-7.6.1/raster/r.out.gridatb/r.out.gridatb.html 2019-03-19 20:02:47.000000000 +0000 +++ grass-7.8.0/raster/r.out.gridatb/r.out.gridatb.html 2019-05-18 15:50:05.000000000 +0000 @@ -12,4 +12,4 @@ Huidae Cho based on code from Keith Beven -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.mat/main.c grass-7.8.0/raster/r.out.mat/main.c --- grass-7.6.1/raster/r.out.mat/main.c 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.out.mat/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -61,6 +61,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); module->description = _("Exports a GRASS raster to a binary MAT-File."); /* Define the different options */ @@ -294,7 +295,7 @@ G_calloc((Rast_window_rows() + 1) * (Rast_window_cols() + 1), Rast_cell_size(map_type)); - G_debug(1, "mem alloc is %d bytes\n", /* I think _cols()+1 is unneeded? */ + G_debug(1, "mem alloc is %zu bytes\n", /* I think _cols()+1 is unneeded? */ Rast_cell_size(map_type) * (Rast_window_rows() + 1) * (Rast_window_cols() + 1)); diff -Nru grass-7.6.1/raster/r.out.mat/r.out.mat.html grass-7.8.0/raster/r.out.mat/r.out.mat.html --- grass-7.6.1/raster/r.out.mat/r.out.mat.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.out.mat/r.out.mat.html 2019-05-18 15:50:05.000000000 +0000 @@ -96,4 +96,4 @@ New Zealand

    -

    Last changed: $Date: 2014-12-12 00:12:46 +0100 (Fri, 12 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.mpeg/main.c grass-7.8.0/raster/r.out.mpeg/main.c --- grass-7.6.1/raster/r.out.mpeg/main.c 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.out.mpeg/main.c 2019-06-11 07:26:20.000000000 +0000 @@ -6,6 +6,8 @@ * Brad Douglas , Markus Neteler , * Glynn Clements , Hamish Bowman , * Jan-Oliver Wagner , Paul Kelly + * Paolo Zatelli + * * PURPOSE: combines a series of GRASS raster maps into a single MPEG-1 * COPYRIGHT: (C) 1999-2006, 2011 by the GRASS Development Team * @@ -101,6 +103,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword(_("animation")); module->description = @@ -141,6 +144,9 @@ parse_command(viewopts, vfiles, &numviews, &frames); + /* output file */ + strcpy(outfile, out->answer); + r_out = 0; if (conv->answer) r_out = 1; diff -Nru grass-7.6.1/raster/r.out.mpeg/r.out.mpeg.html grass-7.8.0/raster/r.out.mpeg/r.out.mpeg.html --- grass-7.6.1/raster/r.out.mpeg/r.out.mpeg.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.out.mpeg/r.out.mpeg.html 2019-05-18 15:50:05.000000000 +0000 @@ -99,4 +99,4 @@ Bill Brown, U.S. Army Construction Engineering Research Laboratories -

    Last changed: $Date: 2015-05-11 02:11:34 +0200 (Mon, 11 May 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.png/main.c grass-7.8.0/raster/r.out.png/main.c --- grass-7.6.1/raster/r.out.png/main.c 2019-03-19 20:03:56.000000000 +0000 +++ grass-7.8.0/raster/r.out.png/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -111,6 +111,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword("PNG"); module->description = _("Export a GRASS raster map as a non-georeferenced PNG image."); diff -Nru grass-7.6.1/raster/r.out.png/r.out.png.html grass-7.8.0/raster/r.out.png/r.out.png.html --- grass-7.6.1/raster/r.out.png/r.out.png.html 2019-03-19 20:03:56.000000000 +0000 +++ grass-7.8.0/raster/r.out.png/r.out.png.html 2019-05-18 15:50:05.000000000 +0000 @@ -1,6 +1,6 @@

    DESCRIPTION

    -r.out.png exports a GRASS raster map in non-georeferenced +r.out.png exports a GRASS GIS raster map in non-georeferenced Portable Network Graphics (PNG) image format, respecting the current region resolution and bounds. @@ -12,6 +12,20 @@ the world file will be called png_map.wld. +

    EXAMPLE

    + +The example is based on the North Carolina sample data location. +

    +Export of the soil map to PNG format with world file: + +

    +g.region raster=soils_Kfactor -p
    +# export PNG file with additional world file
    +r.out.png input=soils_Kfactor output=soils_Kfactor -w
    +# verify
    +gdalinfo soils_Kfactor.png
    +
    +

    SEE ALSO

    @@ -27,4 +41,4 @@ Alex Shevlakov
    Hamish Bowman -

    Last changed: $Date: 2018-11-05 14:29:23 +0100 (Mon, 05 Nov 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.pov/main.c grass-7.8.0/raster/r.out.pov/main.c --- grass-7.6.1/raster/r.out.pov/main.c 2019-03-19 20:02:47.000000000 +0000 +++ grass-7.8.0/raster/r.out.pov/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -120,6 +120,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); module->description = _("Converts a raster map layer into a height-field file for POV-Ray."); diff -Nru grass-7.6.1/raster/r.out.pov/r.out.pov.html grass-7.8.0/raster/r.out.pov/r.out.pov.html --- grass-7.6.1/raster/r.out.pov/r.out.pov.html 2019-03-19 20:02:59.000000000 +0000 +++ grass-7.8.0/raster/r.out.pov/r.out.pov.html 2019-05-18 15:50:05.000000000 +0000 @@ -60,4 +60,4 @@

    AUTHOR

    Klaus D. Meyer, GEUM.tec GbR, eMail: GEUM.tec@geum.de -

    Last changed: $Date: 2016-07-01 00:16:57 +0200 (Fri, 01 Jul 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.ppm/main.c grass-7.8.0/raster/r.out.ppm/main.c --- grass-7.6.1/raster/r.out.ppm/main.c 2019-03-19 20:02:58.000000000 +0000 +++ grass-7.8.0/raster/r.out.ppm/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -53,6 +53,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); module->description = _("Converts a GRASS raster map to a PPM image file."); diff -Nru grass-7.6.1/raster/r.out.ppm/r.out.ppm.html grass-7.8.0/raster/r.out.ppm/r.out.ppm.html --- grass-7.6.1/raster/r.out.ppm/r.out.ppm.html 2019-03-19 20:02:58.000000000 +0000 +++ grass-7.8.0/raster/r.out.ppm/r.out.ppm.html 2019-05-18 15:50:05.000000000 +0000 @@ -56,4 +56,4 @@ Bill Brown, UIUC -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.ppm3/main.c grass-7.8.0/raster/r.out.ppm3/main.c --- grass-7.6.1/raster/r.out.ppm3/main.c 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.out.ppm3/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -56,6 +56,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); module->description = _("Converts 3 GRASS raster layers (R,G,B) to a PPM image file."); for (i = 0; i < 3; i++) { diff -Nru grass-7.6.1/raster/r.out.ppm3/r.out.ppm3.html grass-7.8.0/raster/r.out.ppm3/r.out.ppm3.html --- grass-7.6.1/raster/r.out.ppm3/r.out.ppm3.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.out.ppm3/r.out.ppm3.html 2019-05-18 15:50:05.000000000 +0000 @@ -31,4 +31,4 @@ Glynn Clements
    Based upon r.out.ppm and d.rgb. -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.vrml/main.c grass-7.8.0/raster/r.out.vrml/main.c --- grass-7.6.1/raster/r.out.vrml/main.c 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.out.vrml/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -46,6 +46,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword(_("VRML")); module->description = _("Exports a raster map to the Virtual Reality Modeling Language (VRML)."); diff -Nru grass-7.6.1/raster/r.out.vrml/r.out.vrml.html grass-7.8.0/raster/r.out.vrml/r.out.vrml.html --- grass-7.6.1/raster/r.out.vrml/r.out.vrml.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.out.vrml/r.out.vrml.html 2019-05-18 15:50:05.000000000 +0000 @@ -60,4 +60,4 @@

    AUTHOR

    Bill Brown, US Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.out.vtk/main.c grass-7.8.0/raster/r.out.vtk/main.c --- grass-7.6.1/raster/r.out.vtk/main.c 2019-03-19 20:03:05.000000000 +0000 +++ grass-7.8.0/raster/r.out.vtk/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -58,6 +58,7 @@ module = G_define_module(); G_add_keyword(_("raster")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword("VTK"); module->description = _("Converts raster maps into the VTK-ASCII format."); diff -Nru grass-7.6.1/raster/r.out.vtk/r.out.vtk.html grass-7.8.0/raster/r.out.vtk/r.out.vtk.html --- grass-7.6.1/raster/r.out.vtk/r.out.vtk.html 2019-03-19 20:03:00.000000000 +0000 +++ grass-7.8.0/raster/r.out.vtk/r.out.vtk.html 2019-05-18 15:50:05.000000000 +0000 @@ -129,4 +129,4 @@

    AUTHOR

    Soeren Gebbert -

    Last changed: $Date: 2014-11-28 15:27:38 +0100 (Fri, 28 Nov 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.param.scale/r.param.scale.html grass-7.8.0/raster/r.param.scale/r.param.scale.html --- grass-7.6.1/raster/r.param.scale/r.param.scale.html 2019-03-19 20:03:51.000000000 +0000 +++ grass-7.8.0/raster/r.param.scale/r.param.scale.html 2019-05-18 15:50:05.000000000 +0000 @@ -119,4 +119,4 @@

    Update to FP 3/2002: L. Potrich, M. Neteler, S. Menegon (ITC-irst)

    -Last changed: $Date: 2017-11-03 17:43:02 +0100 (Fri, 03 Nov 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.patch/r.patch.html grass-7.8.0/raster/r.patch/r.patch.html --- grass-7.6.1/raster/r.patch/r.patch.html 2019-03-19 20:02:46.000000000 +0000 +++ grass-7.8.0/raster/r.patch/r.patch.html 2019-05-22 21:47:51.000000000 +0000 @@ -214,4 +214,4 @@
    -z flag and performance improvement by Huidae Cho -

    Last changed: $Date: 2018-11-26 08:50:32 +0100 (Mon, 26 Nov 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.path/r.path.html grass-7.8.0/raster/r.path/r.path.html --- grass-7.6.1/raster/r.path/r.path.html 2019-03-19 20:03:56.000000000 +0000 +++ grass-7.8.0/raster/r.path/r.path.html 2019-06-03 20:34:21.000000000 +0000 @@ -208,7 +208,8 @@

    AUTHORS

    -Markus Metz +Markus Metz
    +Multiple path directions sponsored by mundialis

    -Last changed: $Date: 2019-02-23 15:00:42 +0100 (Sat, 23 Feb 2019) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.profile/r.profile.html grass-7.8.0/raster/r.profile/r.profile.html --- grass-7.6.1/raster/r.profile/r.profile.html 2019-03-19 20:03:22.000000000 +0000 +++ grass-7.8.0/raster/r.profile/r.profile.html 2019-05-18 15:50:05.000000000 +0000 @@ -166,4 +166,4 @@ Bob Covill

    -Last changed: $Date: 2015-06-07 20:56:26 +0200 (Sun, 07 Jun 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.proj/r.proj.html grass-7.8.0/raster/r.proj/r.proj.html --- grass-7.6.1/raster/r.proj/r.proj.html 2019-03-19 20:03:28.000000000 +0000 +++ grass-7.8.0/raster/r.proj/r.proj.html 2019-05-18 15:50:05.000000000 +0000 @@ -318,4 +318,4 @@ Updated by Morten Hulden
    Datum transformation support and cleanup by Paul Kelly -

    Last changed: $Date: 2016-01-29 10:29:57 +0100 (Fri, 29 Jan 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.quant/r.quant.html grass-7.8.0/raster/r.quant/r.quant.html --- grass-7.6.1/raster/r.quant/r.quant.html 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.quant/r.quant.html 2019-05-18 15:50:05.000000000 +0000 @@ -29,4 +29,4 @@ Michael Shapiro, Olga Waupotitsch, U.S.Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.quantile/r.quantile.html grass-7.8.0/raster/r.quantile/r.quantile.html --- grass-7.6.1/raster/r.quantile/r.quantile.html 2019-03-19 20:03:15.000000000 +0000 +++ grass-7.8.0/raster/r.quantile/r.quantile.html 2019-05-18 15:50:05.000000000 +0000 @@ -40,4 +40,4 @@ Glynn Clements

    -Last changed: $Date: 2019-02-23 15:00:42 +0100 (Sat, 23 Feb 2019) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.random/r.random.html grass-7.8.0/raster/r.random/r.random.html --- grass-7.6.1/raster/r.random/r.random.html 2019-03-19 20:03:15.000000000 +0000 +++ grass-7.8.0/raster/r.random/r.random.html 2019-05-18 15:50:05.000000000 +0000 @@ -119,4 +119,4 @@

    Modified for GRASS 5.0 by Eric G. Miller

    Cover map support by Markus Neteler, 2007 -

    Last changed: $Date: 2015-05-11 02:11:34 +0200 (Mon, 11 May 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.random/testsuite/testrandom.py grass-7.8.0/raster/r.random/testsuite/testrandom.py --- grass-7.6.1/raster/r.random/testsuite/testrandom.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/raster/r.random/testsuite/testrandom.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,79 @@ +""" +Name: r.random test +Purpose: Tests r.to.vect and its flags/options. + +Author: Sunveer Singh, Google Code-in 2018 +Copyright: (C) 2017 by Sunveer Singh and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +class Testrr(TestCase): + + input='lakes' + cover="elevation" + raster="routfile" + vector="voutfile" + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + cls.runModule('g.region', raster=cls.input) + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + + def tearDown(self): + """Remove the vector map after each test method""" + + self.runModule('g.remove', flags='f', type='vector', name=self.vector) + self.runModule('g.remove', flags='f', type='raster', name=self.raster) + + def test_flag_z(self): + """Testing flag z""" + string="""area_cat|count|sum + 1|0|null + 2|0|null + 3|0|null + 4|0|null + 5|0|null + 6|0|null + 7|0|null + 8|0|null + 9|1|7 + 10|0|null + """ + r_random = SimpleModule('r.random', input=self.input, cover=self.cover, npoints=100, vector=self.vector, flags='z') + r_random.outputs.stdout= string + self.assertLooksLike(reference=string, actual=r_random.outputs.stdout) + + def test_flag_i(self): + """Testing flag i""" + self.assertModule('r.random', input=self.input, cover=self.cover, npoints=100, flags='i') + + def test_flag_d(self): + """Testing flag d""" + self.assertModule('r.random', input=self.input, cover=self.cover, npoints=100, vector=self.vector, flags='d') + self.assertModule('v.info', map=self.vector, flags='t') + topology = dict(points=100, lines=0, areas=0, map3d=1) + self.assertVectorFitsTopoInfo(self.vector, topology) + + def test_flag_b(self): + """Testing flag b""" + self.assertModule('r.random', input=self.input, cover=self.cover, + npoints=36011, vector=self.vector, flags='b', + overwrite=True) + self.assertModule('v.info', map=self.vector, flags='t') + topology = dict(points=36011, lines=0, areas=0) + self.assertVectorFitsTopoInfo(self.vector, topology) + + + +if __name__ == '__main__': + from grass.gunittest.main import test + test() diff -Nru grass-7.6.1/raster/r.random/testsuite/test_r_random.py grass-7.8.0/raster/r.random/testsuite/test_r_random.py --- grass-7.6.1/raster/r.random/testsuite/test_r_random.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/raster/r.random/testsuite/test_r_random.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,117 @@ +""" +Name: r.random test +Purpose: Tests r.random module and some of its options. + +Author: Shubham Sharma, Google Code-in 2018 +Copyright: (C) 2018 by Shubham Sharma and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test + + +class TestRasterTile(TestCase): + input = 'landcover_1m' + npoints = '20' + raster = 'landcover_1m_raster_random' + vector = "landcover_1m_vector_random" + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + cls.runModule('g.region', raster=cls.input) + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + + cls.runModule('g.remove', type='raster', flags='f', name=cls.raster) + cls.runModule('g.remove', type='raster', flags='f', name=cls.raster + '_null') + cls.runModule('g.remove', type='raster', flags='f', name=cls.raster + '_without_topology') + cls.runModule('g.remove', type='raster', flags='f', name=cls.raster + '_3D') + cls.runModule('g.remove', type='raster', flags='f', name=cls.raster + '_cover_landcover_1m') + + cls.runModule('g.remove', type='vector', flags='f', name=cls.vector) + cls.runModule('g.remove', type='vector', flags='f', name=cls.vector+'_null') + cls.runModule('g.remove', type='vector', flags='f', name=cls.vector + '_without_topology') + cls.runModule('g.remove', type='vector', flags='f', name=cls.vector + '_3D') + cls.runModule('g.remove', type='vector', flags='f', name=cls.vector + '_cover_landcover_1m') + + def test_random_raster(self): + """Testing r.random runs successfully""" + self.assertModule('r.random', input=self.input, npoints=self.npoints, raster=self.raster) + # check if random raster was created + self.assertRasterExists(self.raster, msg="landcover_1m_raster_random was not created") + + def test_random_vector(self): + """Testing r.random runs successfully""" + self.assertModule('r.random', input=self.input, npoints=self.npoints, vector=self.vector) + # check if random vector was created + self.assertVectorExists(self.vector, msg="landcover_1m_vector_random was not created") + topology = dict(points=20,primitives=20) + self.assertVectorFitsTopoInfo(vector=self.vector, reference=topology) + + def test_random_raster_flag_z(self): + """Testing r.random runs successfully""" + self.assertModule('r.random', flags='z', input=self.input, npoints=self.npoints, raster=self.raster+'_null') + # check if random raster ( with NULL values ) was created + self.assertRasterExists(self.raster, msg="landcover_1m_raster_random_null was not created") + + + def test_vector_random_flag_z(self): + """Testing r.random runs successfully""" + self.assertModule('r.random', flags='z', input=self.input, npoints=self.npoints, vector=self.vector+'_null') + # check if random vector ( with NULL values ) was created + self.assertVectorExists(self.vector+'_null', msg="landcover_1m_vector_random_null was not created") + topology = dict(points=20,primitives=20) + self.assertVectorFitsTopoInfo(vector=self.vector+'_null', reference=topology) + + def test_random_raster_flag_b(self): + """Testing r.random runs successfully""" + self.assertModule('r.random', flags='b', input=self.input, npoints=self.npoints, raster=self.raster+'_without_topology') + # check if random raster ( without topology ) was created + self.assertRasterExists(self.raster, msg="landcover_1m_raster_random_without_topologywas not created") + + def test_vector_random_flag_b(self): + """Testing r.random runs successfully""" + self.assertModule('r.random', flags='b', input=self.input, npoints=self.npoints, vector=self.vector+'_without_topology') + # check if random vector ( without topology ) was created + self.assertVectorExists(self.vector+'_without_topology', msg="landcover_1m_vector_random_without_topology was not created") + topology = dict(points=20,primitives=20) + self.assertVectorFitsTopoInfo(vector=self.vector+'_without_topology', reference=topology) + + def test_random_raster_flag_d(self): + """Testing r.random runs successfully""" + self.assertModule('r.random', flags='d', input=self.input, npoints=self.npoints, raster=self.raster+'_3D') + # check if random raster ( 3D points ) was created + self.assertRasterExists(self.raster, msg="landcover_1m_raster_random_3D not created") + + def test_vector_random_flag_d(self): + """Testing r.random runs successfully""" + self.assertModule('r.random', flags='d', input=self.input, npoints=self.npoints, vector=self.vector+'_3D') + # check if random vector ( 3D points ) was created + self.assertVectorExists(self.vector+'_3D', msg="landcover_1m_vector_random_3D was not created") + topology = dict(points=20,primitives=20) + self.assertVectorFitsTopoInfo(vector=self.vector+'_3D', reference=topology) + + + def test_random_raster_cover(self): + """Testing r.random runs successfully""" + self.assertModule('r.random',input='landuse96_28m', npoints=self.npoints, cover='landcover_1m', raster=self.raster+'_cover_landcover_1m') + # check if random raster ( 3D points ) was created + self.assertRasterExists(self.raster+'_cover_landcover_1m', msg="landcover_1m_raster_random_cover_landcover_1m was not created") + + def test_vector_random_flag_d(self): + """Testing r.random runs successfully""" + self.assertModule('r.random',input='landuse96_28m', npoints=self.npoints, cover='landcover_1m', vector=self.vector+'_cover_landcover_1m') + # check if random vector ( 3D points ) was created + self.assertVectorExists(self.vector+'_cover_landcover_1m', msg="landcover_1m_vector_cover_landcover_1m was not created") + topology = dict(points=20, primitives=20) + self.assertVectorFitsTopoInfo(vector=self.vector+'_cover_landcover_1m', reference=topology) + + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/raster/r.random.cells/r.random.cells.html grass-7.8.0/raster/r.random.cells/r.random.cells.html --- grass-7.6.1/raster/r.random.cells/r.random.cells.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.random.cells/r.random.cells.html 2019-05-18 15:50:05.000000000 +0000 @@ -171,4 +171,4 @@ Charles Ehlschlaeger; National Center for Geographic Information and Analysis, University of California, Santa Barbara. -

    Last changed: $Date: 2015-10-10 22:01:15 +0200 (Sat, 10 Oct 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.random.surface/r.random.surface.html grass-7.8.0/raster/r.random.surface/r.random.surface.html --- grass-7.6.1/raster/r.random.surface/r.random.surface.html 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/raster/r.random.surface/r.random.surface.html 2019-05-18 15:50:05.000000000 +0000 @@ -155,4 +155,4 @@ for Geographic Information and Analysis, University of California, Santa Barbara. -

    Last changed: $Date: 2016-06-02 22:48:17 +0200 (Thu, 02 Jun 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.reclass/r.reclass.html grass-7.8.0/raster/r.reclass/r.reclass.html --- grass-7.6.1/raster/r.reclass/r.reclass.html 2019-03-19 20:03:58.000000000 +0000 +++ grass-7.8.0/raster/r.reclass/r.reclass.html 2019-05-18 15:50:05.000000000 +0000 @@ -248,4 +248,4 @@ Michael Shapiro
    U.S.Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2019-02-23 15:00:42 +0100 (Sat, 23 Feb 2019) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.recode/read_rules.c grass-7.8.0/raster/r.recode/read_rules.c --- grass-7.6.1/raster/r.recode/read_rules.c 2019-03-19 20:03:27.000000000 +0000 +++ grass-7.8.0/raster/r.recode/read_rules.c 2019-06-03 20:34:21.000000000 +0000 @@ -68,7 +68,7 @@ if (!G_getl2(buf, 1024, fp)) return nrules; - G_debug(5, "buf = [%s], strlen(buf)=%d", buf, strlen(buf)); + G_debug(5, "buf = [%s], strlen(buf)=%zu", buf, strlen(buf)); for (n = 0; buf[n]; n++) if (buf[n] == ',') diff -Nru grass-7.6.1/raster/r.recode/r.recode.html grass-7.8.0/raster/r.recode/r.recode.html --- grass-7.6.1/raster/r.recode/r.recode.html 2019-03-19 20:03:27.000000000 +0000 +++ grass-7.8.0/raster/r.recode/r.recode.html 2019-05-18 15:50:05.000000000 +0000 @@ -82,4 +82,4 @@ CERL -

    Last changed: $Date: 2019-02-23 15:00:42 +0100 (Sat, 23 Feb 2019) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.region/r.region.html grass-7.8.0/raster/r.region/r.region.html --- grass-7.6.1/raster/r.region/r.region.html 2019-03-19 20:02:20.000000000 +0000 +++ grass-7.8.0/raster/r.region/r.region.html 2019-05-18 15:50:05.000000000 +0000 @@ -56,4 +56,4 @@
    Based upon g.region -

    Last changed: $Date: 2015-08-07 05:24:55 +0200 (Fri, 07 Aug 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.regression.line/r.regression.line.html grass-7.8.0/raster/r.regression.line/r.regression.line.html --- grass-7.6.1/raster/r.regression.line/r.regression.line.html 2019-03-19 20:03:34.000000000 +0000 +++ grass-7.8.0/raster/r.regression.line/r.regression.line.html 2019-05-18 15:50:05.000000000 +0000 @@ -76,4 +76,4 @@ Script style output Markus Neteler
    Conversion to C module Markus Metz -

    Last changed: $Date: 2015-10-27 18:40:48 +0100 (Tue, 27 Oct 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.regression.multi/r.regression.multi.html grass-7.8.0/raster/r.regression.multi/r.regression.multi.html --- grass-7.6.1/raster/r.regression.multi/r.regression.multi.html 2019-03-19 20:02:58.000000000 +0000 +++ grass-7.8.0/raster/r.regression.multi/r.regression.multi.html 2019-05-18 15:50:05.000000000 +0000 @@ -92,4 +92,4 @@ Markus Metz -

    Last changed: $Date: 2015-10-27 18:40:48 +0100 (Tue, 27 Oct 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.relief/main.c grass-7.8.0/raster/r.relief/main.c --- grass-7.6.1/raster/r.relief/main.c 2019-03-19 20:03:28.000000000 +0000 +++ grass-7.8.0/raster/r.relief/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -78,7 +78,6 @@ char buf[GNAME_MAX]; int nrows, row; int ncols, col; - int overwrite=0; double zmult, scale, altitude, azimuth; double north, east, south, west, ns_med; @@ -113,10 +112,10 @@ parm.elevation = G_define_standard_option(G_OPT_R_INPUT); parm.elevation->description = _("Name of input raster (typically elevation) map"); - + parm.relief = G_define_standard_option(G_OPT_R_OUTPUT); parm.relief->description = _("Name for output shaded relief map"); - + parm.altitude = G_define_option(); parm.altitude->key = "altitude"; parm.altitude->type = TYPE_DOUBLE; @@ -169,34 +168,13 @@ degrees_to_radians = M_PI / 180.0; radians_to_degrees = 180. / M_PI; - /* Check due to default output map = input.shade map */ - overwrite = G_check_overwrite(argc, argv); - if (G_parser(argc, argv)) exit(EXIT_FAILURE); elev_name = parm.elevation->answer; - if (parm.relief->answer) { - sr_name = parm.relief->answer; - } - else { - char xname[GNAME_MAX], xmapset[GNAME_MAX]; - - if (G_name_is_fully_qualified(elev_name, xname, xmapset)) - sprintf(buf, "%s.shade", xname); - else - sprintf(buf, "%s.shade", elev_name); - sr_name = G_store(buf); - } + sr_name = parm.relief->answer; G_check_input_output_name(elev_name, sr_name, G_FATAL_EXIT); - if (G_find_raster2(sr_name, G_mapset())) { - if (overwrite) - G_warning(_("Raster map <%s> already exists and will be overwritten"), - sr_name); - else - G_fatal_error(_("Raster map <%s> already exists"), sr_name); - } if (sscanf(parm.altitude->answer, "%lf", &altitude) != 1 || altitude < 0.0) { G_fatal_error(_("%s=%s - must be a non-negative number"), diff -Nru grass-7.6.1/raster/r.relief/r.relief.html grass-7.8.0/raster/r.relief/r.relief.html --- grass-7.6.1/raster/r.relief/r.relief.html 2019-03-19 20:03:27.000000000 +0000 +++ grass-7.8.0/raster/r.relief/r.relief.html 2019-05-18 15:50:05.000000000 +0000 @@ -141,4 +141,4 @@
    Markus Metz: Enhanced fast C version of r.relief for GRASS GIS 7 -

    Last changed: $Date: 2018-10-26 15:33:19 +0200 (Fri, 26 Oct 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.report/r.report.html grass-7.8.0/raster/r.report/r.report.html --- grass-7.6.1/raster/r.report/r.report.html 2019-03-19 20:03:15.000000000 +0000 +++ grass-7.8.0/raster/r.report/r.report.html 2019-05-18 15:50:05.000000000 +0000 @@ -149,4 +149,4 @@ Sort option by Martin Landa, Czech Technical University in Prague, 2013

    -Last changed: $Date: 2014-02-11 16:15:05 +0100 (Tue, 11 Feb 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.resamp.bspline/main.c grass-7.8.0/raster/r.resamp.bspline/main.c --- grass-7.6.1/raster/r.resamp.bspline/main.c 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.resamp.bspline/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -45,8 +45,7 @@ double **N, **obsVect; /* Interpolation and least-square matrix */ SEGMENT in_seg, out_seg, mask_seg; - const char *in_file, *out_file, *mask_file; - int in_fd, out_fd, mask_fd; + char *in_file, *out_file, *mask_file; double seg_size; int seg_mb, segments_in_memory; int have_mask; @@ -313,14 +312,9 @@ segments_in_memory = 1; in_file = G_tempfile(); - in_fd = creat(in_file, 0666); - if (Segment_format(in_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(double)) != 1) + if (Segment_open(&in_seg, in_file, nrows, ncols, SEGSIZE, SEGSIZE, + sizeof(double), segments_in_memory) != 1) G_fatal_error(_("Can not create temporary file")); - close(in_fd); - - in_fd = open(in_file, 2); - if (Segment_init(&in_seg, in_fd, segments_in_memory) != 1) - G_fatal_error(_("Can not initialize temporary file")); /* read raster input */ inrastfd = Rast_open_old(in_opt->answer, ""); @@ -375,9 +369,7 @@ G_done_msg(_("Cross validation finished for ew_step = %f and ns_step = %f"), stepE, stepN); - Segment_release(&in_seg); /* release memory */ - close(in_fd); - unlink(in_file); + Segment_close(&in_seg); /* release memory */ exit(EXIT_SUCCESS); } @@ -398,14 +390,9 @@ /* use destination window */ mask_file = G_tempfile(); - mask_fd = creat(mask_file, 0666); - if (Segment_format(mask_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(char)) != 1) + if (Segment_open(&mask_seg, mask_file, nrows, ncols, SEGSIZE, SEGSIZE, + sizeof(char), segments_in_memory) != 1) G_fatal_error(_("Can not create temporary file")); - close(mask_fd); - - mask_fd = open(mask_file, 2); - if (Segment_init(&mask_seg, mask_fd, segments_in_memory) != 1) - G_fatal_error(_("Can not initialize temporary file")); if (mask_opt->answer) { maskfd = Rast_open_old(mask_opt->answer, ""); @@ -470,14 +457,9 @@ } out_file = G_tempfile(); - out_fd = creat(out_file, 0666); - if (Segment_format(out_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(double)) != 1) + if (Segment_open(&out_seg, out_file, nrows, ncols, SEGSIZE, SEGSIZE, + sizeof(double), segments_in_memory) != 1) G_fatal_error(_("Can not create temporary file")); - close(out_fd); - - out_fd = open(out_file, 2); - if (Segment_init(&out_seg, out_fd, segments_in_memory) != 1) - G_fatal_error(_("Can not initialize temporary file")); /* initialize output */ G_message(_("Initializing output...")); @@ -735,14 +717,10 @@ } /*! END WHILE; last_column = TRUE */ } /*! END WHILE; last_row = TRUE */ - Segment_release(&in_seg); /* release memory */ - close(in_fd); - unlink(in_file); + Segment_close(&in_seg); /* release memory */ if (have_mask) { - Segment_release(&mask_seg); /* release memory */ - close(mask_fd); - unlink(mask_file); + Segment_close(&mask_seg); /* release memory */ } G_message(_("Writing output...")); @@ -771,9 +749,7 @@ G_warning("only NULL cells in output raster"); } - Segment_release(&out_seg); /* release memory */ - close(out_fd); - unlink(out_file); + Segment_close(&out_seg); /* release memory */ Rast_close(outrastfd); diff -Nru grass-7.6.1/raster/r.resamp.bspline/r.resamp.bspline.html grass-7.8.0/raster/r.resamp.bspline/r.resamp.bspline.html --- grass-7.6.1/raster/r.resamp.bspline/r.resamp.bspline.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.resamp.bspline/r.resamp.bspline.html 2019-05-18 15:50:05.000000000 +0000 @@ -154,4 +154,4 @@ Maria Antonia Brovelli, Massimiliano Cannata, Ulisse Longoni, Mirko Reguzzoni, Roberto Antolin

    -Last changed: $Date: 2016-08-03 13:50:26 +0200 (Wed, 03 Aug 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.resamp.filter/r.resamp.filter.html grass-7.8.0/raster/r.resamp.filter/r.resamp.filter.html --- grass-7.6.1/raster/r.resamp.filter/r.resamp.filter.html 2019-03-19 20:02:59.000000000 +0000 +++ grass-7.8.0/raster/r.resamp.filter/r.resamp.filter.html 2019-05-18 15:50:05.000000000 +0000 @@ -95,4 +95,4 @@ Glynn Clements -

    Last changed: $Date: 2016-09-19 12:29:41 +0200 (Mon, 19 Sep 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.resamp.interp/r.resamp.interp.html grass-7.8.0/raster/r.resamp.interp/r.resamp.interp.html --- grass-7.6.1/raster/r.resamp.interp/r.resamp.interp.html 2019-03-19 20:03:15.000000000 +0000 +++ grass-7.8.0/raster/r.resamp.interp/r.resamp.interp.html 2019-05-18 15:50:05.000000000 +0000 @@ -75,4 +75,4 @@ Glynn Clements -

    Last changed: $Date: 2016-08-03 13:50:26 +0200 (Wed, 03 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.resample/r.resample.html grass-7.8.0/raster/r.resample/r.resample.html --- grass-7.6.1/raster/r.resample/r.resample.html 2019-03-19 20:02:47.000000000 +0000 +++ grass-7.8.0/raster/r.resample/r.resample.html 2019-05-18 15:50:05.000000000 +0000 @@ -51,4 +51,4 @@ Michael Shapiro, U.S.Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2016-08-03 13:50:26 +0200 (Wed, 03 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.resamp.rst/r.resamp.rst.html grass-7.8.0/raster/r.resamp.rst/r.resamp.rst.html --- grass-7.6.1/raster/r.resamp.rst/r.resamp.rst.html 2019-03-19 20:03:56.000000000 +0000 +++ grass-7.8.0/raster/r.resamp.rst/r.resamp.rst.html 2019-05-18 15:50:05.000000000 +0000 @@ -156,4 +156,4 @@ of data, Journal of Computational Physics , 23, pp 93-123.

    Wahba, G., 1990. Spline models for observational data, CNMS-NSF Regional Conference series in applied mathematics, 59, SIAM, Philadelphia, Pennsylvania. -

    Last changed: $Date: 2016-08-03 13:50:26 +0200 (Wed, 03 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.resamp.stats/r.resamp.stats.html grass-7.8.0/raster/r.resamp.stats/r.resamp.stats.html --- grass-7.6.1/raster/r.resamp.stats/r.resamp.stats.html 2019-03-19 20:03:35.000000000 +0000 +++ grass-7.8.0/raster/r.resamp.stats/r.resamp.stats.html 2019-05-18 15:50:05.000000000 +0000 @@ -62,4 +62,4 @@ Glynn Clements -

    Last changed: $Date: 2017-01-08 09:46:20 +0100 (Sun, 08 Jan 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.rescale/r.rescale.html grass-7.8.0/raster/r.rescale/r.rescale.html --- grass-7.6.1/raster/r.rescale/r.rescale.html 2019-03-19 20:03:34.000000000 +0000 +++ grass-7.8.0/raster/r.rescale/r.rescale.html 2019-05-18 15:50:05.000000000 +0000 @@ -62,4 +62,4 @@ Michael Shapiro, U.S.Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2016-05-03 19:09:18 +0200 (Tue, 03 May 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.rescale.eq/r.rescale.eq.html grass-7.8.0/raster/r.rescale.eq/r.rescale.eq.html --- grass-7.6.1/raster/r.rescale.eq/r.rescale.eq.html 2019-03-19 20:03:33.000000000 +0000 +++ grass-7.8.0/raster/r.rescale.eq/r.rescale.eq.html 2019-05-18 15:50:05.000000000 +0000 @@ -62,4 +62,4 @@ Michael Shapiro, U.S.Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2014-12-09 19:39:37 +0100 (Tue, 09 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.ros/r.ros.html grass-7.8.0/raster/r.ros/r.ros.html --- grass-7.6.1/raster/r.ros/r.ros.html 2019-03-19 20:03:24.000000000 +0000 +++ grass-7.8.0/raster/r.ros/r.ros.html 2019-05-18 15:50:05.000000000 +0000 @@ -146,4 +146,4 @@ Jianping Xu, Center for Remote Sensing and Spatial Analysis, Rutgers University. -

    Last changed: $Date: 2014-10-27 16:35:33 +0100 (Mon, 27 Oct 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.series/r.series.html grass-7.8.0/raster/r.series/r.series.html --- grass-7.6.1/raster/r.series/r.series.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.series/r.series.html 2019-05-22 21:47:51.000000000 +0000 @@ -220,4 +220,4 @@ Glynn Clements -

    Last changed: $Date: 2018-01-16 19:50:49 +0100 (Tue, 16 Jan 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.series.accumulate/r.series.accumulate.html grass-7.8.0/raster/r.series.accumulate/r.series.accumulate.html --- grass-7.6.1/raster/r.series.accumulate/r.series.accumulate.html 2019-03-19 20:02:47.000000000 +0000 +++ grass-7.8.0/raster/r.series.accumulate/r.series.accumulate.html 2019-05-18 15:50:05.000000000 +0000 @@ -156,4 +156,4 @@ Markus Metz and Soeren Gebbert (based on r.series) -

    Last changed: $Date: 2018-02-11 22:29:12 +0100 (Sun, 11 Feb 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.series.interp/r.series.interp.html grass-7.8.0/raster/r.series.interp/r.series.interp.html --- grass-7.6.1/raster/r.series.interp/r.series.interp.html 2019-03-19 20:03:09.000000000 +0000 +++ grass-7.8.0/raster/r.series.interp/r.series.interp.html 2019-05-18 15:50:05.000000000 +0000 @@ -62,4 +62,4 @@ Sören Gebbert -

    Last changed: $Date: 2014-09-24 15:16:23 +0200 (Wed, 24 Sep 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.sim/r.sim.sediment/r.sim.sediment.html grass-7.8.0/raster/r.sim/r.sim.sediment/r.sim.sediment.html --- grass-7.6.1/raster/r.sim/r.sim.sediment/r.sim.sediment.html 2019-03-19 20:03:55.000000000 +0000 +++ grass-7.8.0/raster/r.sim/r.sim.sediment/r.sim.sediment.html 2019-05-18 15:50:05.000000000 +0000 @@ -99,4 +99,4 @@ Neteler, M. and Mitasova, H., 2008, Open Source GIS: A GRASS GIS Approach. Third Edition. The International Series in Engineering and Computer Science: Volume 773. Springer New York Inc, p. 406.

    -

    Last changed: $Date: 2018-06-12 02:43:40 +0200 (Tue, 12 Jun 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.sim/r.sim.water/r.sim.water.html grass-7.8.0/raster/r.sim/r.sim.water/r.sim.water.html --- grass-7.6.1/raster/r.sim/r.sim.water/r.sim.water.html 2019-03-19 20:03:54.000000000 +0000 +++ grass-7.8.0/raster/r.sim/r.sim.water/r.sim.water.html 2019-05-22 21:47:51.000000000 +0000 @@ -235,4 +235,4 @@ North Carolina State University
    csthaxto@unity.ncsu.edu -

    Last changed: $Date: 2019-01-30 12:02:35 +0100 (Wed, 30 Jan 2019) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.slope.aspect/main.c grass-7.8.0/raster/r.slope.aspect/main.c --- grass-7.6.1/raster/r.slope.aspect/main.c 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/raster/r.slope.aspect/main.c 2019-06-11 07:26:20.000000000 +0000 @@ -373,12 +373,17 @@ parm.dxx->key, parm.dyy->key, parm.dxy->key); } + G_get_window(&window); + /* set the window from the header for the elevation file */ if (!flag.a->answer) { - G_get_window(&window); Rast_get_cellhd(elev_name, "", &cellhd); Rast_align_window(&window, &cellhd); Rast_set_window(&window); + /* probably not needed, just to make sure + * G_get_window() and Rast_get_window() + * return the same */ + G_set_window(&window); } if (strcmp(parm.out_precision->answer, "DCELL") == 0) @@ -395,8 +400,6 @@ out_type is type of map being created */ /* ? why not use Rast_map_type() then ? */ - G_get_set_window(&window); - nrows = Rast_window_rows(); ncols = Rast_window_cols(); diff -Nru grass-7.6.1/raster/r.slope.aspect/r.slope.aspect.html grass-7.8.0/raster/r.slope.aspect/r.slope.aspect.html --- grass-7.6.1/raster/r.slope.aspect/r.slope.aspect.html 2019-03-19 20:03:58.000000000 +0000 +++ grass-7.8.0/raster/r.slope.aspect/r.slope.aspect.html 2019-05-22 21:47:51.000000000 +0000 @@ -280,4 +280,4 @@ Olga Waupotitsch, U.S.Army Construction Engineering Research Laboratory

    -Last changed: $Date: 2018-04-29 16:19:55 +0200 (Sun, 29 Apr 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.slope.aspect/testsuite/test_r_slope_aspect.py grass-7.8.0/raster/r.slope.aspect/testsuite/test_r_slope_aspect.py --- grass-7.6.1/raster/r.slope.aspect/testsuite/test_r_slope_aspect.py 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/raster/r.slope.aspect/testsuite/test_r_slope_aspect.py 2019-06-03 20:34:21.000000000 +0000 @@ -19,25 +19,33 @@ class TestSlopeAspect(TestCase): + slope = 'limits_slope' + aspect = 'limits_aspect' + + def setUp(self): + self.use_temp_region() + call_module('g.region', raster='elevation') + + def tearDown(self): + self.del_temp_region() + call_module('g.remove', flags='f', type_='raster', + name=[self.slope, self.aspect]) + def test_limits(self): - slope = 'limits_slope' - aspect = 'limits_aspect' self.assertModule('r.slope.aspect', elevation='elevation', - slope=slope, aspect=aspect) - self.assertRasterMinMax(map=slope, refmin=0, refmax=90, + slope=self.slope, aspect=self.aspect) + self.assertRasterMinMax(map=self.slope, refmin=0, refmax=90, msg="Slope in degrees must be between 0 and 90") - self.assertRasterMinMax(map=aspect, refmin=0, refmax=360, + self.assertRasterMinMax(map=self.aspect, refmin=0, refmax=360, msg="Aspect in degrees must be between 0 and 360") def test_limits_precent(self): """Assumes NC elevation and allows slope up to 100% (45deg)""" - slope = 'limits_percent_slope' - aspect = 'limits_percent_aspect' self.assertModule('r.slope.aspect', elevation='elevation', - slope=slope, aspect=aspect, format='percent') - self.assertRasterMinMax(map=slope, refmin=0, refmax=100, + slope=self.slope, aspect=self.aspect, format='percent') + self.assertRasterMinMax(map=self.slope, refmin=0, refmax=100, msg="Slope in percent must be between 0 and 100") - self.assertRasterMinMax(map=aspect, refmin=0, refmax=360, + self.assertRasterMinMax(map=self.aspect, refmin=0, refmax=360, msg="Aspect in degrees must be between 0 and 360") @@ -58,6 +66,10 @@ # precision for comparisons precision = 0.0001 + ref_aspect = 'reference_aspect' + aspect = 'fractal_aspect' + ref_slope = 'reference_slope' + slope = 'fractal_slope' @classmethod def setUpClass(cls): @@ -65,48 +77,49 @@ call_module('g.region', n=20, s=10, e=25, w=15, res=1) cls.elevation = 'fractal_surf' cls.runModule('r.in.ascii', input='data/fractal_surf.ascii', - output=cls.elevation) + output=cls.elevation) @classmethod def tearDownClass(cls): cls.del_temp_region() - cls.runModule('g.remove', flags='f', type='raster', name=cls.elevation) + cls.runModule('g.remove', flags='f', type='raster', + name=[cls.elevation, cls.slope, cls.aspect, cls.ref_aspect, cls.ref_slope]) def test_slope(self): - ref_slope = 'reference_slope' - slope = 'fractal_slope' - # TODO: using gdal instead of ascii because of cannot seek error self.runModule('r.in.gdal', flags='o', - input='data/gdal_slope.grd', output=ref_slope) + input='data/gdal_slope.grd', output=self.ref_slope) self.assertModule('r.slope.aspect', elevation=self.elevation, - slope=slope) + slope=self.slope) # check we have expected values - self.assertRasterMinMax(map=slope, refmin=0, refmax=90, + self.assertRasterMinMax(map=self.slope, refmin=0, refmax=90, msg="Slope in degrees must be between 0 and 90") # check against reference data - self.assertRastersNoDifference(actual=slope, reference=ref_slope, + self.assertRastersNoDifference(actual=self.slope, reference=self.ref_slope, precision=self.precision) def test_aspect(self): - ref_aspect = 'reference_aspect' - aspect = 'fractal_aspect' # TODO: using gdal instead of ascii because of cannot seek error self.runModule('r.in.gdal', flags='o', - input='data/gdal_aspect.grd', output=ref_aspect) + input='data/gdal_aspect.grd', output=self.ref_aspect) self.assertModule('r.slope.aspect', elevation=self.elevation, - aspect=aspect) + aspect=self.aspect) # check we have expected values - self.assertRasterMinMax(map=aspect, refmin=0, refmax=360, + self.assertRasterMinMax(map=self.aspect, refmin=0, refmax=360, msg="Aspect in degrees must be between 0 and 360") # check against reference data - self.assertRastersNoDifference(actual=aspect, reference=ref_aspect, + self.assertRastersNoDifference(actual=self.aspect, reference=self.ref_aspect, precision=self.precision) class TestSlopeAspectAgainstItself(TestCase): precision = 0.0000001 + elevation = 'elevation' + t_aspect = 'sa_together_aspect' + t_slope = 'sa_together_slope' + s_aspect = 'sa_separately_aspect' + s_slope = 'sa_separately_slope' @classmethod def setUpClass(cls): @@ -116,48 +129,48 @@ @classmethod def tearDownClass(cls): cls.del_temp_region() + call_module('g.remove', flags='f', type_='raster', + name=[cls.t_aspect, cls.t_slope, cls.s_slope, cls.s_aspect]) def test_slope_aspect_together(self): """Slope and aspect computed separately and together should be the same """ - elevation = 'elevation' - t_aspect = 'sa_together_aspect' - t_slope = 'sa_together_slope' - s_aspect = 'sa_separately_aspect' - s_slope = 'sa_separately_slope' - self.assertModule('r.slope.aspect', elevation=elevation, - aspect=s_aspect) - self.assertModule('r.slope.aspect', elevation=elevation, - slope=s_slope) - self.assertModule('r.slope.aspect', elevation=elevation, - slope=t_slope, aspect=t_aspect) - self.assertRastersNoDifference(actual=t_aspect, reference=s_aspect, + self.assertModule('r.slope.aspect', elevation=self.elevation, + aspect=self.s_aspect) + self.assertModule('r.slope.aspect', elevation=self.elevation, + slope=self.s_slope) + self.assertModule('r.slope.aspect', elevation=self.elevation, + slope=self.t_slope, aspect=self.t_aspect) + self.assertRastersNoDifference(actual=self.t_aspect, reference=self.s_aspect, precision=self.precision) - self.assertRastersNoDifference(actual=t_slope, reference=s_slope, + self.assertRastersNoDifference(actual=self.t_slope, reference=self.s_slope, precision=self.precision) # TODO: implement this class class TestExtremes(TestCase): + slope = 'small_slope' + aspect = 'small_aspect' + elevation = 'small_elevation' + def setUp(self): self.use_temp_region() def tearDown(self): self.del_temp_region() + call_module('g.remove', flags='f', type_='raster', + name=[self.slope, self.aspect, self.elevation]) def test_small(self): - elevation = 'small_elevation' - slope = 'small_slope' - aspect = 'small_aspect' - self.runModule('r.in.ascii', input='-', output=elevation, + self.runModule('r.in.ascii', input='-', output=self.elevation, stdin_=SMALL_MAP) - call_module('g.region', raster=elevation) - self.assertModule('r.slope.aspect', elevation=elevation, - slope=slope, aspect=aspect) - self.assertRasterMinMax(map=slope, refmin=0, refmax=90, + call_module('g.region', raster=self.elevation) + self.assertModule('r.slope.aspect', elevation=self.elevation, + slope=self.slope, aspect=self.aspect) + self.assertRasterMinMax(map=self.slope, refmin=0, refmax=90, msg="Slope in degrees must be between 0 and 90") - self.assertRasterMinMax(map=aspect, refmin=0, refmax=360, + self.assertRasterMinMax(map=self.aspect, refmin=0, refmax=360, msg="Aspect in degrees must be between 0 and 360") diff -Nru grass-7.6.1/raster/r.solute.transport/example.py grass-7.8.0/raster/r.solute.transport/example.py --- grass-7.6.1/raster/r.solute.transport/example.py 2019-03-19 20:03:12.000000000 +0000 +++ grass-7.8.0/raster/r.solute.transport/example.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # This is an example script how groundwater flow and solute transport are # computed within grass import sys diff -Nru grass-7.6.1/raster/r.solute.transport/r.solute.transport.html grass-7.8.0/raster/r.solute.transport/r.solute.transport.html --- grass-7.6.1/raster/r.solute.transport/r.solute.transport.html 2019-03-19 20:03:12.000000000 +0000 +++ grass-7.8.0/raster/r.solute.transport/r.solute.transport.html 2019-08-06 19:42:45.000000000 +0000 @@ -88,7 +88,7 @@ Make sure you are not in a lat/lon projection.

    -#!/usr/bin/env python
    +#!/usr/bin/env python3
     # This is an example script how groundwater flow and solute transport are
     # computed within grass
     import sys
    @@ -154,4 +154,4 @@
     at Technical University Berlin in Germany.
     
     
    -

    Last changed: $Date: 2017-02-17 22:14:15 +0100 (Fri, 17 Feb 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.solute.transport/seguin_verify.py grass-7.8.0/raster/r.solute.transport/seguin_verify.py --- grass-7.6.1/raster/r.solute.transport/seguin_verify.py 2019-03-19 20:03:12.000000000 +0000 +++ grass-7.8.0/raster/r.solute.transport/seguin_verify.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Shellscript to verify r.solute.transport calculation, this calculation is based on # the example 1.1 and 1.2 at page 175 of the following book: # title = "Str{\"o}mungs und Transportmodellierung", diff -Nru grass-7.6.1/raster/r.solute.transport/seguin_verify_well.py grass-7.8.0/raster/r.solute.transport/seguin_verify_well.py --- grass-7.6.1/raster/r.solute.transport/seguin_verify_well.py 2019-03-19 20:03:13.000000000 +0000 +++ grass-7.8.0/raster/r.solute.transport/seguin_verify_well.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Shellscript to verify r.solute.transport calculation, this calculation is based on # the example 2.1 and 2.2 at page 181 of the following book: # title = "Str{\"o}mungs und Transportmodellierung", diff -Nru grass-7.6.1/raster/r.spread/r.spread.html grass-7.8.0/raster/r.spread/r.spread.html --- grass-7.6.1/raster/r.spread/r.spread.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.spread/r.spread.html 2019-05-18 15:50:05.000000000 +0000 @@ -138,4 +138,4 @@ Jianping Xu and Richard G. Lathrop, Jr., Center for Remote Sensing and Spatial Analysis, Rutgers University. -

    Last changed: $Date: 2014-10-27 16:35:33 +0100 (Mon, 27 Oct 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.spreadpath/main.c grass-7.8.0/raster/r.spreadpath/main.c --- grass-7.6.1/raster/r.spreadpath/main.c 2019-03-19 20:03:15.000000000 +0000 +++ grass-7.8.0/raster/r.spreadpath/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -68,12 +68,12 @@ col, row, len, flag, srows, scols, - backrow_fd, backcol_fd, path_fd, in_row_fd, in_col_fd, out_fd; - const char *current_mapset, - *search_mapset, - *path_mapset, - *backrow_mapset, - *backcol_mapset, *in_row_file, *in_col_file, *out_file; + backrow_fd, backcol_fd, path_fd; + const char *search_mapset, + *path_mapset, + *backrow_mapset, + *backcol_mapset; + char *in_row_file, *in_col_file, *out_file; CELL *cell; POINT *PRES_PT, *PRESENT_PT, *OLD_PT; struct Cell_head window; @@ -113,7 +113,6 @@ if (G_parser(argc, argv)) exit(EXIT_FAILURE); - current_mapset = G_mapset(); in_row_file = G_tempfile(); in_col_file = G_tempfile(); out_file = G_tempfile(); @@ -155,32 +154,18 @@ /* Parameters for map submatrices */ len = sizeof(CELL); + /* TODO: improve segment handling */ srows = nrows / 4 + 1; scols = ncols / 4 + 1; - G_verbose_message(_("\eading the input map -%s- and -%s- and creating some temporary files..."), + G_verbose_message(_("Reading the input map -%s- and -%s- and creating some temporary files..."), backrow_layer, backcol_layer); /* Create segmented files for back cell and output layers */ - in_row_fd = creat(in_row_file, 0666); - Segment_format(in_row_fd, nrows, ncols, srows, scols, len); - close(in_row_fd); - in_col_fd = creat(in_col_file, 0666); - Segment_format(in_col_fd, nrows, ncols, srows, scols, len); - close(in_col_fd); - - out_fd = creat(out_file, 0666); - Segment_format(out_fd, nrows, ncols, srows, scols, len); - close(out_fd); - - /* Open initialize and segment all files */ - in_row_fd = open(in_row_file, 2); - Segment_init(&in_row_seg, in_row_fd, 4); - in_col_fd = open(in_col_file, 2); - Segment_init(&in_col_seg, in_col_fd, 4); + Segment_open(&in_row_seg, in_row_file, nrows, ncols, srows, scols, len, 4); + Segment_open(&in_col_seg, in_col_file, nrows, ncols, srows, scols, len, 4); - out_fd = open(out_file, 2); - Segment_init(&out_seg, out_fd, 4); + Segment_open(&out_seg, out_file, nrows, ncols, srows, scols, len, 4); /* Write the back cell layers in the segmented files, and * Change UTM coordinates to ROWs and COLUMNs */ @@ -301,21 +286,13 @@ Rast_put_row(path_fd, cell, CELL_TYPE); } - Segment_release(&in_row_seg); /* release memory */ - Segment_release(&in_col_seg); - Segment_release(&out_seg); - - close(in_row_fd); /* close all files */ - close(in_col_fd); - close(out_fd); + Segment_close(&in_row_seg); /* release memory */ + Segment_close(&in_col_seg); + Segment_close(&out_seg); Rast_close(path_fd); Rast_close(backrow_fd); Rast_close(backcol_fd); - unlink(in_row_file); /* remove submatrix files */ - unlink(in_col_file); - unlink(out_file); - exit(EXIT_SUCCESS); } diff -Nru grass-7.6.1/raster/r.spreadpath/r.spreadpath.html grass-7.8.0/raster/r.spreadpath/r.spreadpath.html --- grass-7.6.1/raster/r.spreadpath/r.spreadpath.html 2019-03-19 20:03:15.000000000 +0000 +++ grass-7.8.0/raster/r.spreadpath/r.spreadpath.html 2019-05-18 15:50:05.000000000 +0000 @@ -64,4 +64,4 @@ Jianping Xu and Richard G. Lathrop, Jr., Center for Remote Sensing and Spatial Analysis, Rutgers University. -

    Last changed: $Date: 2014-11-28 16:43:22 +0100 (Fri, 28 Nov 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.statistics/r.statistics.html grass-7.8.0/raster/r.statistics/r.statistics.html --- grass-7.6.1/raster/r.statistics/r.statistics.html 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.statistics/r.statistics.html 2019-05-18 15:50:05.000000000 +0000 @@ -73,4 +73,4 @@

    AUTHOR

    Martin Schroeder, Geographisches Institut Heidelberg, Germany -

    Last changed: $Date: 2017-01-19 14:35:33 +0100 (Thu, 19 Jan 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.stats/r.stats.html grass-7.8.0/raster/r.stats/r.stats.html --- grass-7.6.1/raster/r.stats/r.stats.html 2019-03-19 20:03:01.000000000 +0000 +++ grass-7.8.0/raster/r.stats/r.stats.html 2019-05-18 15:50:05.000000000 +0000 @@ -15,10 +15,11 @@

    NOTES

    -If a single raster map is specified, a list of categories will be -printed. If multiple raster maps are specified, a cross-tabulation -table for each combination of categories in the raster maps will be -printed. +If a single raster map is specified, a list of categories will be printed. +The -x flag will print x and y (column and row) starting with 1 +(both first row and first column are indexed with 1). If multiple raster maps +are specified, a cross-tabulation table for each combination of categories in +the raster maps will be printed.

    For example, if one raster map was specified, the output would look like: @@ -175,6 +176,8 @@ # landuse/landcover, geology and zipcodes with category labels r.stats -c input=landclass96,zipcodes,geology_30m separator=comma -l +

    +

    SEE ALSO

    @@ -194,4 +197,4 @@ Sort option by Martin Landa, Czech Technical University in Prague, 2013

    -Last changed: $Date: 2019-02-11 22:09:00 +0100 (Mon, 11 Feb 2019) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.stats.quantile/r.stats.quantile.html grass-7.8.0/raster/r.stats.quantile/r.stats.quantile.html --- grass-7.6.1/raster/r.stats.quantile/r.stats.quantile.html 2019-03-19 20:03:56.000000000 +0000 +++ grass-7.8.0/raster/r.stats.quantile/r.stats.quantile.html 2019-05-18 15:50:05.000000000 +0000 @@ -52,4 +52,4 @@ Markus Metz

    -Last changed: $Date: 2017-05-07 22:27:56 +0200 (Sun, 07 May 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.stats.zonal/main.c grass-7.8.0/raster/r.stats.zonal/main.c --- grass-7.6.1/raster/r.stats.zonal/main.c 2019-03-19 20:03:09.000000000 +0000 +++ grass-7.8.0/raster/r.stats.zonal/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -87,6 +87,7 @@ int reclass; int base_fd, cover_fd; struct Categories cats; + struct History history; CELL *base_buf; DCELL *cover_buf; struct Range range; @@ -517,6 +518,10 @@ Rast_close(out_fd); + Rast_short_history(output, "raster", &history); + Rast_command_history(&history); + Rast_write_history(output, &history); + if (Rast_read_colors(covermap, "", &colors) > 0) Rast_write_colors(output, G_mapset(), &colors); } diff -Nru grass-7.6.1/raster/r.stats.zonal/r.stats.zonal.html grass-7.8.0/raster/r.stats.zonal/r.stats.zonal.html --- grass-7.6.1/raster/r.stats.zonal/r.stats.zonal.html 2019-03-19 20:03:05.000000000 +0000 +++ grass-7.8.0/raster/r.stats.zonal/r.stats.zonal.html 2019-05-18 15:50:05.000000000 +0000 @@ -41,4 +41,4 @@ Glynn Clements

    -Last changed: $Date: 2018-04-25 14:03:54 +0200 (Wed, 25 Apr 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.stream.extract/bseg.c grass-7.8.0/raster/r.stream.extract/bseg.c --- grass-7.6.1/raster/r.stream.extract/bseg.c 2019-03-19 20:02:47.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/bseg.c 2019-06-03 20:34:21.000000000 +0000 @@ -7,7 +7,6 @@ { char *filename; int errflag; - int fd; bseg->filename = NULL; bseg->fd = -1; @@ -15,52 +14,44 @@ bseg->mapset = NULL; filename = G_tempfile(); - if (-1 == (fd = creat(filename, 0666))) { - G_warning(_("Unable to create segment file")); - return -2; - } - if (0 > (errflag = Segment_format(fd, Rast_window_rows(), - Rast_window_cols(), srows, scols, - sizeof(char)))) { - close(fd); - unlink(filename); + if (0 > (errflag = Segment_open(&(bseg->seg), filename, Rast_window_rows(), + Rast_window_cols(), srows, scols, + sizeof(char), nsegs_in_memory))) { if (errflag == -1) { - G_warning(_("Unable to write segment file")); + G_warning(_("File name is invalid")); return -1; } - else { - G_warning(_("Illegal configuration parameter(s)")); + else if (errflag == -2) { + G_warning(_("File write error")); + return -2; + } + else if (errflag == -3) { + G_warning(_("Illegal parameters are passed")); return -3; } - } - close(fd); - if (-1 == (fd = open(filename, 2))) { - unlink(filename); - G_warning(_("Unable to re-open segment file")); - return -4; - } - if (0 > (errflag = Segment_init(&(bseg->seg), fd, nsegs_in_memory))) { - close(fd); - unlink(filename); - if (errflag == -1) { - G_warning(_("Unable to read segment file")); + else if (errflag == -4) { + G_warning(_("File could not be re-opened")); + return -4; + } + else if (errflag == -5) { + G_warning(_("Prepared file could not be read")); return -5; } - else { + else if (errflag == -6) { G_warning(_("Out of memory")); return -6; } } + + bseg->filename = filename; - bseg->fd = fd; + return 0; } int bseg_close(BSEG *bseg) { - Segment_release(&(bseg->seg)); - close(bseg->fd); - unlink(bseg->filename); + Segment_close(&(bseg->seg)); if (bseg->name) { G_free(bseg->name); bseg->name = NULL; @@ -102,8 +93,8 @@ int bseg_read_raster(BSEG *bseg, char *map_name, char *mapset) { - int row, nrows; - int col, ncols; + int row, rows; + int col, cols; int map_fd; CELL *buffer; char cbuf; @@ -112,12 +103,12 @@ bseg->mapset = NULL; map_fd = Rast_open_old(map_name, mapset); - nrows = Rast_window_rows(); - ncols = Rast_window_cols(); + rows = Rast_window_rows(); + cols = Rast_window_cols(); buffer = Rast_allocate_c_buf(); - for (row = 0; row < nrows; row++) { + for (row = 0; row < rows; row++) { Rast_get_c_row(map_fd, buffer, row); - for (col = ncols; col >= 0; col--) { + for (col = cols; col >= 0; col--) { cbuf = (char) buffer[col]; bseg_put(bseg, &cbuf, row, col); } @@ -135,24 +126,24 @@ int bseg_write_raster(BSEG *bseg, char *map_name) { int map_fd; - int row, nrows; - int col, ncols; + int row, rows; + int col, cols; CELL *buffer; char value; map_fd = Rast_open_c_new(map_name); - nrows = Rast_window_rows(); - ncols = Rast_window_cols(); + rows = Rast_window_rows(); + cols = Rast_window_cols(); buffer = Rast_allocate_c_buf(); - for (row = 0; row < nrows; row++) { - G_percent(row, nrows, 1); - for (col = 0; col < ncols; col++) { + for (row = 0; row < rows; row++) { + G_percent(row, rows, 1); + for (col = 0; col < cols; col++) { bseg_get(bseg, &value, row, col); buffer[col] = value; } Rast_put_row(map_fd, buffer, CELL_TYPE); } - G_percent(row, nrows, 1); /* finish it */ + G_percent(row, rows, 1); /* finish it */ G_free(buffer); Rast_close(map_fd); return 0; diff -Nru grass-7.6.1/raster/r.stream.extract/close.c grass-7.8.0/raster/r.stream.extract/close.c --- grass-7.6.1/raster/r.stream.extract/close.c 2019-03-19 20:02:59.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/close.c 2019-06-03 20:34:21.000000000 +0000 @@ -206,7 +206,7 @@ /* stream nodes */ for (i = 1; i <= n_stream_nodes; i++) { - sprintf(buf, "insert into %s values ( %lld, \'%s\', %d, %d )", + sprintf(buf, "insert into %s values ( %"PRI_OFF_T", \'%s\', %d, %d )", Fi->table, i, (stream_node[i].n_trib > 0 ? "intermediate" : "start"), (stream_node[i].n_trib > 0), network_id[i]); diff -Nru grass-7.6.1/raster/r.stream.extract/cseg.c grass-7.8.0/raster/r.stream.extract/cseg.c --- grass-7.6.1/raster/r.stream.extract/cseg.c 2019-03-19 20:02:46.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/cseg.c 2019-06-03 20:34:21.000000000 +0000 @@ -7,7 +7,6 @@ { char *filename; int errflag; - int fd; cseg->filename = NULL; cseg->fd = -1; @@ -15,53 +14,43 @@ cseg->mapset = NULL; filename = G_tempfile(); - if (-1 == (fd = creat(filename, 0666))) { - G_warning(_("Unable to create segment file")); - return -2; - } - if (0 > - (errflag = - Segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols, - sizeof(CELL)))) { - close(fd); - unlink(filename); + if (0 > (errflag = Segment_open(&(cseg->seg), filename, Rast_window_rows(), + Rast_window_cols(), srows, scols, + sizeof(CELL), nsegs_in_memory))) { if (errflag == -1) { - G_warning(_("Unable to write segment file")); + G_warning(_("File name is invalid")); return -1; } - else { - G_warning(_("Illegal configuration parameter(s)")); + else if (errflag == -2) { + G_warning(_("File write error")); + return -2; + } + else if (errflag == -3) { + G_warning(_("Illegal parameters are passed")); return -3; } - } - close(fd); - if (-1 == (fd = open(filename, 2))) { - unlink(filename); - G_warning(_("Unable to re-open segment file")); - return -4; - } - if (0 > (errflag = Segment_init(&(cseg->seg), fd, nsegs_in_memory))) { - close(fd); - unlink(filename); - if (errflag == -1) { - G_warning(_("Unable to read segment file")); + else if (errflag == -4) { + G_warning(_("File could not be re-opened")); + return -4; + } + else if (errflag == -5) { + G_warning(_("Prepared file could not be read")); return -5; } - else { + else if (errflag == -6) { G_warning(_("Out of memory")); return -6; } } + cseg->filename = filename; - cseg->fd = fd; + return 0; } int cseg_close(CSEG *cseg) { - Segment_release(&(cseg->seg)); - close(cseg->fd); - unlink(cseg->filename); + Segment_close(&(cseg->seg)); if (cseg->name) { G_free(cseg->name); cseg->name = NULL; @@ -102,7 +91,7 @@ int cseg_read_raster(CSEG *cseg, char *map_name, char *mapset) { - int row, nrows; + int row, rows; int map_fd; CELL *buffer; @@ -110,9 +99,9 @@ cseg->mapset = NULL; map_fd = Rast_open_old(map_name, mapset); - nrows = Rast_window_rows(); + rows = Rast_window_rows(); buffer = Rast_allocate_c_buf(); - for (row = 0; row < nrows; row++) { + for (row = 0; row < rows; row++) { Rast_get_c_row(map_fd, buffer, row); if (Segment_put_row(&(cseg->seg), buffer, row) < 0) { G_free(buffer); @@ -135,19 +124,19 @@ int cseg_write_raster(CSEG *cseg, char *map_name) { int map_fd; - int row, nrows; + int row, rows; CELL *buffer; map_fd = Rast_open_c_new(map_name); - nrows = Rast_window_rows(); + rows = Rast_window_rows(); buffer = Rast_allocate_c_buf(); Segment_flush(&(cseg->seg)); - for (row = 0; row < nrows; row++) { - G_percent(row, nrows, 1); + for (row = 0; row < rows; row++) { + G_percent(row, rows, 1); Segment_get_row(&(cseg->seg), buffer, row); Rast_put_row(map_fd, buffer, CELL_TYPE); } - G_percent(row, nrows, 1); /* finish it */ + G_percent(row, rows, 1); /* finish it */ G_free(buffer); Rast_close(map_fd); return 0; diff -Nru grass-7.6.1/raster/r.stream.extract/do_astar.c grass-7.8.0/raster/r.stream.extract/do_astar.c --- grass-7.6.1/raster/r.stream.extract/do_astar.c 2019-03-19 20:02:47.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/do_astar.c 2019-06-03 20:34:21.000000000 +0000 @@ -59,12 +59,12 @@ while (heap_size > 0) { G_percent(count++, n_points, 1); if (count > n_points) - G_fatal_error(_("%lld surplus points"), + G_fatal_error(_("%"PRI_OFF_T" surplus points"), heap_size); if (heap_size > n_points) G_fatal_error - (_("Too many points in heap %lld, should be %lld"), + (_("Too many points in heap %"PRI_OFF_T", should be %"PRI_OFF_T""), heap_size, n_points); heap_p = heap_drop(); diff -Nru grass-7.6.1/raster/r.stream.extract/dseg.c grass-7.8.0/raster/r.stream.extract/dseg.c --- grass-7.6.1/raster/r.stream.extract/dseg.c 2019-03-19 20:02:47.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/dseg.c 2019-06-03 20:34:21.000000000 +0000 @@ -7,7 +7,6 @@ { char *filename; int errflag; - int fd; dseg->filename = NULL; dseg->fd = -1; @@ -15,53 +14,43 @@ dseg->mapset = NULL; filename = G_tempfile(); - if (-1 == (fd = creat(filename, 0666))) { - G_warning(_("dseg_open(): unable to create segment file")); - return -2; - } - if (0 > - (errflag = - Segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols, - sizeof(DCELL)))) { - close(fd); - unlink(filename); + if (0 > (errflag = Segment_open(&(dseg->seg), filename, Rast_window_rows(), + Rast_window_cols(), srows, scols, + sizeof(DCELL), nsegs_in_memory))) { if (errflag == -1) { - G_warning(_("Unable to write segment file")); + G_warning(_("File name is invalid")); return -1; } - else { - G_warning(_("Iillegal configuration parameter(s)")); + else if (errflag == -2) { + G_warning(_("File write error")); + return -2; + } + else if (errflag == -3) { + G_warning(_("Illegal parameters are passed")); return -3; } - } - close(fd); - if (-1 == (fd = open(filename, 2))) { - unlink(filename); - G_warning(_("Unable to re-open segment file")); - return -4; - } - if (0 > (errflag = Segment_init(&(dseg->seg), fd, nsegs_in_memory))) { - close(fd); - unlink(filename); - if (errflag == -1) { - G_warning(_("Unable to read segment file")); + else if (errflag == -4) { + G_warning(_("File could not be re-opened")); + return -4; + } + else if (errflag == -5) { + G_warning(_("Prepared file could not be read")); return -5; } - else { + else if (errflag == -6) { G_warning(_("Out of memory")); return -6; } } + dseg->filename = filename; - dseg->fd = fd; + return 0; } int dseg_close(DSEG *dseg) { - Segment_release(&(dseg->seg)); - close(dseg->fd); - unlink(dseg->filename); + Segment_close(&(dseg->seg)); if (dseg->name) { G_free(dseg->name); dseg->name = NULL; @@ -102,7 +91,7 @@ int dseg_read_raster(DSEG *dseg, char *map_name, char *mapset) { - int row, nrows; + int row, rows; int map_fd; DCELL *dbuffer; @@ -110,9 +99,9 @@ dseg->mapset = NULL; map_fd = Rast_open_old(map_name, mapset); - nrows = Rast_window_rows(); + rows = Rast_window_rows(); dbuffer = Rast_allocate_d_buf(); - for (row = 0; row < nrows; row++) { + for (row = 0; row < rows; row++) { Rast_get_d_row(map_fd, dbuffer, row); if (Segment_put_row(&(dseg->seg), (DCELL *) dbuffer, row) < 0) { G_free(dbuffer); @@ -135,19 +124,19 @@ int dseg_write_cellfile(DSEG *dseg, char *map_name) { int map_fd; - int row, nrows; + int row, rows; DCELL *dbuffer; map_fd = Rast_open_new(map_name, DCELL_TYPE); - nrows = Rast_window_rows(); + rows = Rast_window_rows(); dbuffer = Rast_allocate_d_buf(); Segment_flush(&(dseg->seg)); - for (row = 0; row < nrows; row++) { - G_percent(row, nrows, 1); + for (row = 0; row < rows; row++) { + G_percent(row, rows, 1); Segment_get_row(&(dseg->seg), (DCELL *) dbuffer, row); Rast_put_row(map_fd, dbuffer, DCELL_TYPE); } - G_percent(row, nrows, 1); /* finish it */ + G_percent(row, rows, 1); /* finish it */ G_free(dbuffer); Rast_close(map_fd); return 0; diff -Nru grass-7.6.1/raster/r.stream.extract/init_search.c grass-7.8.0/raster/r.stream.extract/init_search.c --- grass-7.6.1/raster/r.stream.extract/init_search.c 2019-03-19 20:02:58.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/init_search.c 2019-06-03 20:34:21.000000000 +0000 @@ -114,9 +114,9 @@ G_free(depr_buf); } - G_debug(1, "%lld edge cells", heap_size - n_depr_cells); + G_debug(1, "%"PRI_OFF_T" edge cells", heap_size - n_depr_cells); if (n_depr_cells) - G_debug(1, "%lld cells in depressions", n_depr_cells); + G_debug(1, "%"PRI_OFF_T" cells in depressions", n_depr_cells); return 1; } diff -Nru grass-7.6.1/raster/r.stream.extract/load.c grass-7.8.0/raster/r.stream.extract/load.c --- grass-7.6.1/raster/r.stream.extract/load.c 2019-03-19 20:02:58.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/load.c 2019-06-03 20:34:21.000000000 +0000 @@ -167,7 +167,7 @@ G_free(acc_buf); } - G_debug(1, "%lld non-NULL cells", n_points); + G_debug(1, "%"PRI_OFF_T" non-NULL cells", n_points); return (n_points > 0); } diff -Nru grass-7.6.1/raster/r.stream.extract/main.c grass-7.8.0/raster/r.stream.extract/main.c --- grass-7.6.1/raster/r.stream.extract/main.c 2019-03-19 20:02:46.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/main.c 2019-06-11 07:26:20.000000000 +0000 @@ -169,16 +169,16 @@ /***********************/ /* input maps exist ? */ - if (!G_find_raster(input.ele->answer, "")) + if (!G_find_raster2(input.ele->answer, "")) G_fatal_error(_("Raster map <%s> not found"), input.ele->answer); if (input.acc->answer) { - if (!G_find_raster(input.acc->answer, "")) + if (!G_find_raster2(input.acc->answer, "")) G_fatal_error(_("Raster map <%s> not found"), input.acc->answer); } if (input.depression->answer) { - if (!G_find_raster(input.depression->answer, "")) + if (!G_find_raster2(input.depression->answer, "")) G_fatal_error(_("Raster map <%s> not found"), input.depression->answer); have_depressions = 1; } diff -Nru grass-7.6.1/raster/r.stream.extract/r.stream.extract.html grass-7.8.0/raster/r.stream.extract/r.stream.extract.html --- grass-7.6.1/raster/r.stream.extract/r.stream.extract.html 2019-03-19 20:02:47.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/r.stream.extract.html 2019-05-18 15:50:05.000000000 +0000 @@ -291,4 +291,4 @@ Markus Metz

    -Last changed: $Date: 2017-11-12 14:07:55 +0100 (Sun, 12 Nov 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.stream.extract/seg.c grass-7.8.0/raster/r.stream.extract/seg.c --- grass-7.6.1/raster/r.stream.extract/seg.c 2019-03-19 20:02:46.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/seg.c 2019-06-03 20:34:21.000000000 +0000 @@ -10,63 +10,49 @@ { char *filename; int errflag; - int fd; sseg->filename = NULL; sseg->fd = -1; filename = G_tempfile(); - if (-1 == (fd = creat(filename, 0666))) { - G_warning(_("Unable to create segment file")); - return -2; - } - if (fill) - errflag = Segment_format(fd, nrows, ncols, row_in_seg, - col_in_seg, size_struct); - else - errflag = Segment_format_nofill(fd, nrows, ncols, row_in_seg, - col_in_seg, size_struct); - - if (0 > errflag) { - close(fd); - unlink(filename); + if (0 > (errflag = Segment_open(&(sseg->seg), filename, nrows, ncols, + row_in_seg, col_in_seg, + size_struct, nsegs_in_memory))) { if (errflag == -1) { - G_warning(_("Unable to write segment file")); + G_warning(_("File name is invalid")); return -1; } - else { - G_warning(_("Illegal configuration parameter(s)")); + else if (errflag == -2) { + G_warning(_("File write error")); + return -2; + } + else if (errflag == -3) { + G_warning(_("Illegal parameters are passed")); return -3; } - } - close(fd); - if (-1 == (fd = open(filename, 2))) { - unlink(filename); - G_warning(_("Unable to re-open file '%s'"), filename); - return -4; - } - if (0 > (errflag = Segment_init(&(sseg->seg), fd, nsegs_in_memory))) { - close(fd); - unlink(filename); - if (errflag == -1) { - G_warning(_("Unable to read segment file")); + else if (errflag == -4) { + G_warning(_("File could not be re-opened")); + return -4; + } + else if (errflag == -5) { + G_warning(_("Prepared file could not be read")); return -5; } - else { + else if (errflag == -6) { G_warning(_("Out of memory")); return -6; } } + sseg->filename = filename; - sseg->fd = fd; + return 0; } int seg_close(SSEG *sseg) { - Segment_release(&(sseg->seg)); - close(sseg->fd); - unlink(sseg->filename); + Segment_close(&(sseg->seg)); + return 0; } diff -Nru grass-7.6.1/raster/r.stream.extract/streams.c grass-7.8.0/raster/r.stream.extract/streams.c --- grass-7.6.1/raster/r.stream.extract/streams.c 2019-03-19 20:02:47.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/streams.c 2019-06-03 20:34:21.000000000 +0000 @@ -69,7 +69,7 @@ /* debug */ if (n_stream_nodes != *stream_no) - G_warning(_("Stream_no %d and n_stream_nodes %lld out of sync"), + G_warning(_("Stream_no %d and n_stream_nodes %"PRI_OFF_T" out of sync"), *stream_no, n_stream_nodes); stream_node[*stream_no].n_alloc += 2; @@ -665,7 +665,7 @@ /* debug */ if (n_stream_nodes != stream_no) - G_warning(_("Stream_no %d and n_stream_nodes %lld out of sync"), + G_warning(_("Stream_no %d and n_stream_nodes %"PRI_OFF_T" out of sync"), stream_no, n_stream_nodes); } @@ -697,7 +697,7 @@ } G_percent(1, 1, 2); if (workedon) - G_warning(_("MFD: A * path already processed when setting drainage direction: %lld of %lld cells"), + G_warning(_("MFD: A * path already processed when setting drainage direction: %"PRI_OFF_T" of %"PRI_OFF_T" cells"), workedon, n_points); G_free(dist_to_nbr); @@ -705,8 +705,8 @@ G_free(ele_nbr); G_free(flag_nbr); - G_debug(1, "%lld outlets", n_outlets); - G_debug(1, "%lld nodes", n_stream_nodes); + G_debug(1, "%"PRI_OFF_T" outlets", n_outlets); + G_debug(1, "%"PRI_OFF_T" nodes", n_stream_nodes); G_debug(1, "%d streams", stream_no); return 1; diff -Nru grass-7.6.1/raster/r.stream.extract/thin.c grass-7.8.0/raster/r.stream.extract/thin.c --- grass-7.6.1/raster/r.stream.extract/thin.c 2019-03-19 20:02:47.000000000 +0000 +++ grass-7.8.0/raster/r.stream.extract/thin.c 2019-06-03 20:34:21.000000000 +0000 @@ -166,7 +166,7 @@ G_free(nodestack); - G_verbose_message(_("%d of %lld stream segments were thinned"), n_thinned, n_stream_nodes); + G_verbose_message(_("%d of %"PRI_OFF_T" stream segments were thinned"), n_thinned, n_stream_nodes); return 1; } diff -Nru grass-7.6.1/raster/r.sun/main.c grass-7.8.0/raster/r.sun/main.c --- grass-7.6.1/raster/r.sun/main.c 2019-03-19 20:03:24.000000000 +0000 +++ grass-7.8.0/raster/r.sun/main.c 2019-08-12 06:07:45.000000000 +0000 @@ -915,7 +915,7 @@ if (longin != NULL) { cell7 = Rast_allocate_f_buf(); - if (latitudeArray == NULL) { + if (longitudeArray == NULL) { if (!(longitudeArray = G_alloc_fmatrix(numRows, n))) { G_fatal_error(_("Out of memory")); diff -Nru grass-7.6.1/raster/r.sun/r.sun.html grass-7.8.0/raster/r.sun/r.sun.html --- grass-7.6.1/raster/r.sun/r.sun.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.sun/r.sun.html 2019-05-18 15:50:05.000000000 +0000 @@ -381,4 +381,4 @@

    -Last changed: $Date: 2018-01-22 15:17:21 +0100 (Mon, 22 Jan 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.sunhours/r.sunhours.html grass-7.8.0/raster/r.sunhours/r.sunhours.html --- grass-7.6.1/raster/r.sunhours/r.sunhours.html 2019-03-19 20:03:06.000000000 +0000 +++ grass-7.8.0/raster/r.sunhours/r.sunhours.html 2019-05-18 15:50:05.000000000 +0000 @@ -77,4 +77,4 @@ Markus Metz -

    Last changed: $Date: 2017-04-14 23:43:40 +0200 (Fri, 14 Apr 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.sunmask/r.sunmask.html grass-7.8.0/raster/r.sunmask/r.sunmask.html --- grass-7.6.1/raster/r.sunmask/r.sunmask.html 2019-03-19 20:03:33.000000000 +0000 +++ grass-7.8.0/raster/r.sunmask/r.sunmask.html 2019-05-18 15:50:05.000000000 +0000 @@ -114,4 +114,4 @@ update to FP by Huidae Cho 2001
    added solpos algorithm feature by Markus Neteler 2001 -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.support/r.support.html grass-7.8.0/raster/r.support/r.support.html --- grass-7.6.1/raster/r.support/r.support.html 2019-03-19 20:03:00.000000000 +0000 +++ grass-7.8.0/raster/r.support/r.support.html 2019-05-18 15:50:05.000000000 +0000 @@ -59,5 +59,5 @@ M. Hamish Bowman: command line enhancements
    Markus Neteler: category copy from other map -

    Last changed: $Date: 2017-12-08 10:46:36 +0100 (Fri, 08 Dec 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.support.stats/r.support.stats.html grass-7.8.0/raster/r.support.stats/r.support.stats.html --- grass-7.6.1/raster/r.support.stats/r.support.stats.html 2019-03-19 20:03:17.000000000 +0000 +++ grass-7.8.0/raster/r.support.stats/r.support.stats.html 2019-05-18 15:50:05.000000000 +0000 @@ -19,4 +19,4 @@ Micharl Shapiro, CERL: Original author
    Brad Douglas: GRASS 6 Port
    -

    Last changed: $Date: 2011-09-29 21:18:47 +0200 (Thu, 29 Sep 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.surf.area/r.surf.area.html grass-7.8.0/raster/r.surf.area/r.surf.area.html --- grass-7.6.1/raster/r.surf.area/r.surf.area.html 2019-03-19 20:03:51.000000000 +0000 +++ grass-7.8.0/raster/r.surf.area/r.surf.area.html 2019-05-18 15:50:05.000000000 +0000 @@ -75,4 +75,4 @@ Updated for GRASS 7, and units option by Martin Landa, Czech Technical University in Prague, Czech Republic (October 2011) -

    Last changed: $Date: 2016-09-19 11:37:30 +0200 (Mon, 19 Sep 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.surf.contour/r.surf.contour.html grass-7.8.0/raster/r.surf.contour/r.surf.contour.html --- grass-7.6.1/raster/r.surf.contour/r.surf.contour.html 2019-03-19 20:03:51.000000000 +0000 +++ grass-7.8.0/raster/r.surf.contour/r.surf.contour.html 2019-05-18 15:50:05.000000000 +0000 @@ -114,4 +114,4 @@ Chuck Ehlschlaeger, U.S. Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2016-08-03 13:50:26 +0200 (Wed, 03 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.surf.fractal/r.surf.fractal.html grass-7.8.0/raster/r.surf.fractal/r.surf.fractal.html --- grass-7.6.1/raster/r.surf.fractal/r.surf.fractal.html 2019-03-19 20:03:33.000000000 +0000 +++ grass-7.8.0/raster/r.surf.fractal/r.surf.fractal.html 2019-05-18 15:50:05.000000000 +0000 @@ -109,4 +109,4 @@ University of Leicester

    -Last changed: $Date: 2015-07-20 10:45:41 +0200 (Mon, 20 Jul 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.surf.gauss/r.surf.gauss.html grass-7.8.0/raster/r.surf.gauss/r.surf.gauss.html --- grass-7.6.1/raster/r.surf.gauss/r.surf.gauss.html 2019-03-19 20:03:56.000000000 +0000 +++ grass-7.8.0/raster/r.surf.gauss/r.surf.gauss.html 2019-05-18 15:50:05.000000000 +0000 @@ -36,4 +36,4 @@ Jo Wood, ASSIST's home

    -Last changed: $Date: 2018-10-18 21:05:15 +0200 (Thu, 18 Oct 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.surf.idw/r.surf.idw.html grass-7.8.0/raster/r.surf.idw/r.surf.idw.html --- grass-7.6.1/raster/r.surf.idw/r.surf.idw.html 2019-03-19 20:03:11.000000000 +0000 +++ grass-7.8.0/raster/r.surf.idw/r.surf.idw.html 2019-05-18 15:50:05.000000000 +0000 @@ -125,4 +125,4 @@ Corvallis, OR 97333

    -Last changed: $Date: 2017-01-05 08:56:15 +0100 (Thu, 05 Jan 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.surf.random/r.surf.random.html grass-7.8.0/raster/r.surf.random/r.surf.random.html --- grass-7.6.1/raster/r.surf.random/r.surf.random.html 2019-03-19 20:02:57.000000000 +0000 +++ grass-7.8.0/raster/r.surf.random/r.surf.random.html 2019-05-18 15:50:05.000000000 +0000 @@ -46,4 +46,4 @@
    ASSIST's home --> -

    Last changed: $Date: 2018-10-18 21:05:15 +0200 (Thu, 18 Oct 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.terraflow/r.terraflow.html grass-7.8.0/raster/r.terraflow/r.terraflow.html --- grass-7.6.1/raster/r.terraflow/r.terraflow.html 2019-03-19 20:03:55.000000000 +0000 +++ grass-7.8.0/raster/r.terraflow/r.terraflow.html 2019-05-18 15:50:05.000000000 +0000 @@ -249,4 +249,4 @@

    Contact: Laura Toma
-

Last changed: $Date: 2017-02-11 22:22:16 +0100 (Sat, 11 Feb 2017) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.texture/r.texture.html grass-7.8.0/raster/r.texture/r.texture.html --- grass-7.6.1/raster/r.texture/r.texture.html 2019-03-19 20:03:58.000000000 +0000 +++ grass-7.8.0/raster/r.texture/r.texture.html 2019-05-18 15:50:05.000000000 +0000 @@ -277,4 +277,4 @@ Markus Metz (correction and optimization of the initial version)
Moritz Lennert (documentation) -

Last changed: $Date: 2018-10-18 21:05:15 +0200 (Thu, 18 Oct 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.thin/local_proto.h grass-7.8.0/raster/r.thin/local_proto.h --- grass-7.6.1/raster/r.thin/local_proto.h 2019-03-19 20:03:48.000000000 +0000 +++ grass-7.8.0/raster/r.thin/local_proto.h 2019-05-22 21:47:51.000000000 +0000 @@ -11,4 +11,4 @@ /* thin_lines.c */ int thin_lines(int); -char encode_neighbours(CELL *, CELL *, CELL *, int, int); +unsigned char encode_neighbours(CELL *, CELL *, CELL *, int, int); diff -Nru grass-7.6.1/raster/r.thin/r.thin.html grass-7.8.0/raster/r.thin/r.thin.html --- grass-7.6.1/raster/r.thin/r.thin.html 2019-03-19 20:03:48.000000000 +0000 +++ grass-7.8.0/raster/r.thin/r.thin.html 2019-05-18 15:50:05.000000000 +0000 @@ -127,4 +127,4 @@

The code for finding the bounding box as well as input/output code was written by Mike Baba (DBA Systems, 1990) and Jean Ezell (USACERL, 1988). -

Last changed: $Date: 2015-04-20 16:08:53 +0200 (Mon, 20 Apr 2015) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.thin/thin_lines.c grass-7.8.0/raster/r.thin/thin_lines.c --- grass-7.6.1/raster/r.thin/thin_lines.c 2019-03-19 20:03:49.000000000 +0000 +++ grass-7.8.0/raster/r.thin/thin_lines.c 2019-05-22 21:47:51.000000000 +0000 @@ -26,7 +26,6 @@ #define false 0 #define DELETED_PIX 9999 -static char *work_file_name; static int n_rows, n_cols, pad_size; static int box_right, box_left, box_top, box_bottom; @@ -37,7 +36,7 @@ { int j, i, col, deleted, row; CELL *row_buf, *new_med, *med, *bottom, *top, *get_a_row(); - char W, N_W, Templ[8], N_Templ[8]; + unsigned char W, N_W, Templ[8], N_Templ[8]; map_size(&n_rows, &n_cols, &pad_size); box_right = box_bottom = 0; @@ -63,7 +62,6 @@ put_a_row(row, bottom); } /* row-loop */ if (box_right < box_left || box_bottom < box_top) { - unlink(work_file_name); G_fatal_error(_("Unable to find bounding box for lines")); } G_message(_("Bounding box: l = %d, r = %d, t = %d, b = %d"), @@ -178,7 +176,13 @@ /* encode_neighbours- return neighborhood information for pixel at (middle,col) */ -char +/* bit position + * 1 8 7 + * 2 x 6 + * 3 4 5 + */ + +unsigned char encode_neighbours(CELL * top, CELL * middle, CELL * bottom, int col, int neg) { char T; diff -Nru grass-7.6.1/raster/r.tile/r.tile.html grass-7.8.0/raster/r.tile/r.tile.html --- grass-7.6.1/raster/r.tile/r.tile.html 2019-03-19 20:03:15.000000000 +0000 +++ grass-7.8.0/raster/r.tile/r.tile.html 2019-05-18 15:50:05.000000000 +0000 @@ -42,4 +42,4 @@ Glynn Clements -

Last changed: $Date: 2016-06-26 01:33:50 +0200 (Sun, 26 Jun 2016) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.tile/testsuite/test_r_tile.py grass-7.8.0/raster/r.tile/testsuite/test_r_tile.py --- grass-7.6.1/raster/r.tile/testsuite/test_r_tile.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/raster/r.tile/testsuite/test_r_tile.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,65 @@ +""" +Name: r.tile test +Purpose: Tests r.tile module and the number of created tiles. + +Author: Shubham Sharma, Google Code-in 2018 +Copyright: (C) 2018 by Shubham Sharma and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test + + +class TestRasterTile(TestCase): + input = 'lakes' + output_prefix = 'lakes_tile' + width = '1000' + height = '1000' + overlap = '10' + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + cls.runModule('g.region', raster=cls.input) + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + cls.runModule('g.remove', type='raster', flags='f', name=cls.output_prefix + '-000-000') + cls.runModule('g.remove', type='raster', flags='f', name=cls.output_prefix + '-000-001') + cls.runModule('g.remove', type='raster', flags='f', name=cls.output_prefix + '-001-000') + cls.runModule('g.remove', type='raster', flags='f', name=cls.output_prefix + '-001-001') + + cls.runModule('g.remove', type='raster', flags='f', name=cls.output_prefix + 'overlap' + '-000-000') + cls.runModule('g.remove', type='raster', flags='f', name=cls.output_prefix + 'overlap' + '-000-001') + cls.runModule('g.remove', type='raster', flags='f', name=cls.output_prefix + 'overlap' + '-001-000') + cls.runModule('g.remove', type='raster', flags='f', name=cls.output_prefix + 'overlap' + '-001-001') + + def test_raster_tile(self): + """Testing r.tile runs successfully""" + self.assertModule('r.tile', input=self.input, output=self.output_prefix, width=self.width, height=self.height) + # If the above statement executed successful then + # 4 rasters tiles with following details should exits + self.assertRasterExists(self.output_prefix+'-000-000', msg="lakes_tile-000-000 does not exits") + self.assertRasterExists(self.output_prefix+'-000-001', msg="lakes_tile-000-001 does not exits") + self.assertRasterExists(self.output_prefix+'-001-000', msg="lakes_tile-001-000 does not exits") + self.assertRasterExists(self.output_prefix+'-001-001', msg="lakes_tile-001-001 does not exits") + + def test_raster_tile_overlap(self): + """Testing r.tile runs successfully with overlap option""" + self.assertModule('r.tile', input=self.input, output=self.output_prefix+'overlap', width=self.width, height=self.height, overlap=self.overlap) + # If the above statement executed successful then + # 4 rasters tiles with following details should exits + self.assertRasterExists(self.output_prefix+'overlap'+'-000-000', msg="lakes_tile-000-000 does not exits") + self.assertRasterExists(self.output_prefix+'overlap'+'-000-001', msg="lakes_tile-000-001 does not exits") + self.assertRasterExists(self.output_prefix+'overlap'+'-001-000', msg="lakes_tile-001-000 does not exits") + self.assertRasterExists(self.output_prefix+'overlap'+'-001-001', msg="lakes_tile-001-001 does not exits") + + + + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/raster/r.tile/testsuite/testrt.py grass-7.8.0/raster/r.tile/testsuite/testrt.py --- grass-7.6.1/raster/r.tile/testsuite/testrt.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/raster/r.tile/testsuite/testrt.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,58 @@ +""" +Name: r.tile test +Purpose: Tests r.tile and its flags/options. + +Author: Sunveer Singh, Google Code-in 2018 +Copyright: (C) 2018 by Sunveer Singh and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" +from grass.gunittest.case import TestCase +from grass.gunittest.main import test + +class Testrr(TestCase): + input='elevation' + output='tile' + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + cls.runModule('g.region', raster=cls.input) + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + + + def test_basic(self): + """Running a basic test""" + self.assertModule('r.tile', input=self.input, output=self.output, width=1500/2, height=1350/2) + + def test_univar(self): + """Testing the output map tile-001-002""" + string="""min=55.5787925720215 + n=506250 + max=144.267288208008""" + self.assertModule('r.tile', input=self.input, output=self.output, width=1500/2, height=1350/2) + self.assertRasterFitsUnivar('tile-000-001', + reference=string, precision=2) + + def test_overlap(self): + """Testing overlap parameter with output map tile-000-000""" + tile="tile-000-000" + self.assertModule('r.tile', input=self.input, output=self.output, width=1500/2, height=1350/2, overlap=250) + self.assertRasterMinMax(map=tile, refmin=74.75374, refmax=156.3299, + msg="tile-000-000 in degrees must be between 74.75374 and 156.3299") + + def test_minmax(self): + """Testing output map tile-000-001""" + tile1="tile-000-001" + self.assertModule('r.tile', input=self.input, output=self.output, width=1500/2, height=1350/2) + self.assertRasterMinMax(map=tile1, refmin=55.57879, refmax=144.2673, + msg="tile-000-001 in degrees must be between 55.57879 and 144.2673") + +if __name__ == '__main__': + from grass.gunittest.main import test + test() + diff -Nru grass-7.6.1/raster/r.timestamp/r.timestamp.html grass-7.8.0/raster/r.timestamp/r.timestamp.html --- grass-7.6.1/raster/r.timestamp/r.timestamp.html 2019-03-19 20:03:33.000000000 +0000 +++ grass-7.8.0/raster/r.timestamp/r.timestamp.html 2019-05-18 15:50:05.000000000 +0000 @@ -141,4 +141,4 @@ Michael Shapiro, U.S.Army Construction Engineering Research Laboratory -

Last changed: $Date: 2017-02-22 22:19:55 +0100 (Wed, 22 Feb 2017) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.topidx/r.topidx.html grass-7.8.0/raster/r.topidx/r.topidx.html --- grass-7.6.1/raster/r.topidx/r.topidx.html 2019-03-19 20:03:12.000000000 +0000 +++ grass-7.8.0/raster/r.topidx/r.topidx.html 2019-05-18 15:50:05.000000000 +0000 @@ -57,4 +57,4 @@

Based on GRIDATB.FOR by Keith Beven. -

Last changed: $Date: 2017-12-19 23:53:50 +0100 (Tue, 19 Dec 2017) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.topmodel/r.topmodel.html grass-7.8.0/raster/r.topmodel/r.topmodel.html --- grass-7.6.1/raster/r.topmodel/r.topmodel.html 2019-03-19 20:03:15.000000000 +0000 +++ grass-7.8.0/raster/r.topmodel/r.topmodel.html 2019-05-18 15:50:05.000000000 +0000 @@ -175,4 +175,4 @@ Based on TMOD9502.FOR by Keith Beven.

-Last changed: $Date: 2017-03-18 15:48:37 +0100 (Sat, 18 Mar 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.to.rast3/r.to.rast3.html grass-7.8.0/raster/r.to.rast3/r.to.rast3.html --- grass-7.6.1/raster/r.to.rast3/r.to.rast3.html 2019-03-19 20:03:33.000000000 +0000 +++ grass-7.8.0/raster/r.to.rast3/r.to.rast3.html 2019-05-18 15:50:05.000000000 +0000 @@ -58,4 +58,4 @@

AUTHOR

Soeren Gebbert -

Last changed: $Date: 2015-03-20 21:25:22 +0100 (Fri, 20 Mar 2015) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.to.rast3elev/r.to.rast3elev.html grass-7.8.0/raster/r.to.rast3elev/r.to.rast3elev.html --- grass-7.6.1/raster/r.to.rast3elev/r.to.rast3elev.html 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.to.rast3elev/r.to.rast3elev.html 2019-05-18 15:50:05.000000000 +0000 @@ -83,4 +83,4 @@

AUTHOR

Soeren Gebbert -

Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.to.vect/areas_io.c grass-7.8.0/raster/r.to.vect/areas_io.c --- grass-7.6.1/raster/r.to.vect/areas_io.c 2019-03-19 20:03:37.000000000 +0000 +++ grass-7.8.0/raster/r.to.vect/areas_io.c 2019-06-03 20:34:21.000000000 +0000 @@ -152,9 +152,9 @@ /* this should NEVER happen */ if ((p = move(p)) == NULPTR) G_fatal_error(_("write_bnd: line terminated unexpectedly\n" - "previous (%d) point %p (%d,%d,%d) %p %p"), - direction, last, last->row, last->col, last->node, - last->fptr, last->bptr); + "previous (%d) point %d (%d,%d,%d) %p %p"), + direction, i, last->row, last->col, last->node, + (void *)last->fptr, (void *)last->bptr); y = cell_head.north - p->row * cell_head.ns_res; x = cell_head.west + p->col * cell_head.ew_res; @@ -203,9 +203,9 @@ last = p; if ((p = move(p)) == NULPTR) { /* this should NEVER happen */ G_debug(3, "write_smooth_bnd: line terminated unexpectedly\n"); - G_debug(3, " previous (%d) point %p (%d,%d,%d) %p %p\n", - direction, last, last->row, last->col, last->node, - last->fptr, last->bptr); + G_debug(3, " previous (%d) point %d (%d,%d,%d) %p %p\n", + direction, i, last->row, last->col, last->node, + (void *)last->fptr, (void *)last->bptr); exit(EXIT_FAILURE); } diff -Nru grass-7.6.1/raster/r.to.vect/lines.c grass-7.8.0/raster/r.to.vect/lines.c --- grass-7.6.1/raster/r.to.vect/lines.c 2019-03-19 20:03:37.000000000 +0000 +++ grass-7.8.0/raster/r.to.vect/lines.c 2019-06-03 20:34:21.000000000 +0000 @@ -16,7 +16,7 @@ * * Algorithm was modified by Olga Waupotitsch * USA CERL on nov, 1993 - * because the previous implementation was incosistent + * because the previous implementation was inconsistent * stopped in the middle of map, because it tried to continue * a line which was presumed to have been started earlier * but in fact was not started. diff -Nru grass-7.6.1/raster/r.to.vect/lines_io.c grass-7.8.0/raster/r.to.vect/lines_io.c --- grass-7.6.1/raster/r.to.vect/lines_io.c 2019-03-19 20:03:35.000000000 +0000 +++ grass-7.8.0/raster/r.to.vect/lines_io.c 2019-06-03 20:34:21.000000000 +0000 @@ -175,9 +175,9 @@ /* this should NEVER happen */ if ((p = move(p)) == NULL) G_fatal_error(_("write_line: line terminated unexpectedly\n" - " previous (%d) point %p (%d,%d,%d) %p %p"), - direction, last, last->row, last->col, last->node, - last->fptr, last->bptr); + " previous (%d) point %d (%d,%d,%d) %p %p"), + direction, i, last->row, last->col, last->node, + (void *)last->fptr, (void *)last->bptr); y = cell_head.north - ((double)p->row + 0.5) * cell_head.ns_res; x = cell_head.west + ((double)p->col + 0.5) * cell_head.ew_res; diff -Nru grass-7.6.1/raster/r.to.vect/r.to.vect.html grass-7.8.0/raster/r.to.vect/r.to.vect.html --- grass-7.6.1/raster/r.to.vect/r.to.vect.html 2019-03-19 20:03:35.000000000 +0000 +++ grass-7.8.0/raster/r.to.vect/r.to.vect.html 2019-05-18 15:50:05.000000000 +0000 @@ -147,4 +147,4 @@ Update
Original r.to.sites, r.line and r.poly merged and updated to 5.7 by Radim Blazek -

Last changed: $Date: 2015-05-11 02:11:34 +0200 (Mon, 11 May 2015) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.transect/r.transect.html grass-7.8.0/raster/r.transect/r.transect.html --- grass-7.6.1/raster/r.transect/r.transect.html 2019-03-19 20:03:05.000000000 +0000 +++ grass-7.8.0/raster/r.transect/r.transect.html 2019-05-18 15:50:05.000000000 +0000 @@ -40,4 +40,4 @@ Michael Shapiro, U.S. Army Construction Engineering Research Laboratory -

Last changed: $Date: 2012-11-25 11:59:42 +0100 (Sun, 25 Nov 2012) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.univar/r3.univar.html grass-7.8.0/raster/r.univar/r3.univar.html --- grass-7.6.1/raster/r.univar/r3.univar.html 2019-03-19 20:03:35.000000000 +0000 +++ grass-7.8.0/raster/r.univar/r3.univar.html 2019-05-18 15:50:05.000000000 +0000 @@ -113,4 +113,4 @@ and Martin Landa
Zonal loop by Markus Metz -

Last changed: $Date: 2016-05-03 19:09:18 +0200 (Tue, 03 May 2016) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.univar/r3.univar_main.c grass-7.8.0/raster/r.univar/r3.univar_main.c --- grass-7.6.1/raster/r.univar/r3.univar_main.c 2019-03-19 20:03:33.000000000 +0000 +++ grass-7.8.0/raster/r.univar/r3.univar_main.c 2019-06-03 20:34:21.000000000 +0000 @@ -88,7 +88,7 @@ unsigned int x, y, z; double dmin, dmax; int zone, n_zones, use_zone = 0; - char *mapset, *name; + const char *mapset, *name; struct GModule *module; diff -Nru grass-7.6.1/raster/r.univar/r.univar.html grass-7.8.0/raster/r.univar/r.univar.html --- grass-7.6.1/raster/r.univar/r.univar.html 2019-03-19 20:03:33.000000000 +0000 +++ grass-7.8.0/raster/r.univar/r.univar.html 2019-05-18 15:50:05.000000000 +0000 @@ -245,4 +245,4 @@ Multiple input map support by Ivan Shmakov
Zonal loop by Markus Metz -

Last changed: $Date: 2017-11-11 19:59:24 +0100 (Sat, 11 Nov 2017) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.univar/stats.c grass-7.8.0/raster/r.univar/stats.c --- grass-7.6.1/raster/r.univar/stats.c 2019-03-19 20:03:34.000000000 +0000 +++ grass-7.8.0/raster/r.univar/stats.c 2019-06-03 20:34:21.000000000 +0000 @@ -113,16 +113,12 @@ char sum_str[100]; double mean, variance, stdev, var_coef; - /* for extendet stats */ + /* for extended stats */ double quartile_25 = 0.0, quartile_75 = 0.0, *quartile_perc; double median = 0.0; unsigned int i; int qpos_25, qpos_75, *qpos_perc; - /* stats collected for this zone? */ - if (stats[z].n == 0) - continue; - /* all these calculations get promoted to doubles, so any DIV0 becomes nan */ mean = stats[z].sum / stats[z].n; variance = (stats[z].sumsq - stats[z].sum * stats[z].sum / stats[z].n) / stats[z].n; @@ -131,6 +127,8 @@ stdev = sqrt(variance); var_coef = (stdev / mean) * 100.; /* perhaps stdev/fabs(mean) ? */ + if (stats[z].n == 0) + stats[z].sum = stats[z].sum_abs = 0.0 / 0.0; sprintf(sum_str, "%.15g", stats[z].sum); G_trim_decimal(sum_str); @@ -182,63 +180,71 @@ if (param.extended->answer) { qpos_perc = (int *)G_calloc(stats[z].n_perc, sizeof(int)); quartile_perc = (double *)G_calloc(stats[z].n_perc, sizeof(double)); - for (i = 0; i < stats[z].n_perc; i++) { - qpos_perc[i] = (int)(stats[z].n * 1e-2 * stats[z].perc[i] - 0.5); - } - qpos_25 = (int)(stats[z].n * 0.25 - 0.5); - qpos_75 = (int)(stats[z].n * 0.75 - 0.5); - switch (stats[z].map_type) { - case CELL_TYPE: - heapsort_int(stats[z].cell_array, stats[z].n); - - quartile_25 = (double)stats[z].cell_array[qpos_25]; - if (stats[z].n % 2) /* odd */ - median = (double)stats[z].cell_array[(int)(stats[z].n / 2)]; - else /* even */ - median = - (double)(stats[z].cell_array[stats[z].n / 2 - 1] + - stats[z].cell_array[stats[z].n / 2]) / 2.0; - quartile_75 = (double)stats[z].cell_array[qpos_75]; + if (stats[z].n == 0) { + quartile_25 = median = quartile_75 = 0.0 / 0.0; + for (i = 0; i < stats[z].n_perc; i++) + quartile_perc[i] = 0.0 / 0.0; + } + else { for (i = 0; i < stats[z].n_perc; i++) { - quartile_perc[i] = (double)stats[z].cell_array[qpos_perc[i]]; + qpos_perc[i] = (int)(stats[z].n * 1e-2 * stats[z].perc[i] - 0.5); } - break; + qpos_25 = (int)(stats[z].n * 0.25 - 0.5); + qpos_75 = (int)(stats[z].n * 0.75 - 0.5); - case FCELL_TYPE: - heapsort_float(stats[z].fcell_array, stats[z].n); + switch (stats[z].map_type) { + case CELL_TYPE: + heapsort_int(stats[z].cell_array, stats[z].n); + + quartile_25 = (double)stats[z].cell_array[qpos_25]; + if (stats[z].n % 2) /* odd */ + median = (double)stats[z].cell_array[(int)(stats[z].n / 2)]; + else /* even */ + median = + (double)(stats[z].cell_array[stats[z].n / 2 - 1] + + stats[z].cell_array[stats[z].n / 2]) / 2.0; + quartile_75 = (double)stats[z].cell_array[qpos_75]; + for (i = 0; i < stats[z].n_perc; i++) { + quartile_perc[i] = (double)stats[z].cell_array[qpos_perc[i]]; + } + break; - quartile_25 = (double)stats[z].fcell_array[qpos_25]; - if (stats[z].n % 2) /* odd */ - median = (double)stats[z].fcell_array[(int)(stats[z].n / 2)]; - else /* even */ - median = - (double)(stats[z].fcell_array[stats[z].n / 2 - 1] + - stats[z].fcell_array[stats[z].n / 2]) / 2.0; - quartile_75 = (double)stats[z].fcell_array[qpos_75]; - for (i = 0; i < stats[z].n_perc; i++) { - quartile_perc[i] = (double)stats[z].fcell_array[qpos_perc[i]]; - } - break; + case FCELL_TYPE: + heapsort_float(stats[z].fcell_array, stats[z].n); + + quartile_25 = (double)stats[z].fcell_array[qpos_25]; + if (stats[z].n % 2) /* odd */ + median = (double)stats[z].fcell_array[(int)(stats[z].n / 2)]; + else /* even */ + median = + (double)(stats[z].fcell_array[stats[z].n / 2 - 1] + + stats[z].fcell_array[stats[z].n / 2]) / 2.0; + quartile_75 = (double)stats[z].fcell_array[qpos_75]; + for (i = 0; i < stats[z].n_perc; i++) { + quartile_perc[i] = (double)stats[z].fcell_array[qpos_perc[i]]; + } + break; - case DCELL_TYPE: - heapsort_double(stats[z].dcell_array, stats[z].n); + case DCELL_TYPE: + heapsort_double(stats[z].dcell_array, stats[z].n); - quartile_25 = stats[z].dcell_array[qpos_25]; - if (stats[z].n % 2) /* odd */ - median = stats[z].dcell_array[(int)(stats[z].n / 2)]; - else /* even */ - median = - (stats[z].dcell_array[stats[z].n / 2 - 1] + - stats[z].dcell_array[stats[z].n / 2]) / 2.0; - quartile_75 = stats[z].dcell_array[qpos_75]; - for (i = 0; i < stats[z].n_perc; i++) { - quartile_perc[i] = stats[z].dcell_array[qpos_perc[i]]; - } - break; + quartile_25 = stats[z].dcell_array[qpos_25]; + if (stats[z].n % 2) /* odd */ + median = stats[z].dcell_array[(int)(stats[z].n / 2)]; + else /* even */ + median = + (stats[z].dcell_array[stats[z].n / 2 - 1] + + stats[z].dcell_array[stats[z].n / 2]) / 2.0; + quartile_75 = stats[z].dcell_array[qpos_75]; + for (i = 0; i < stats[z].n_perc; i++) { + quartile_perc[i] = stats[z].dcell_array[qpos_perc[i]]; + } + break; - default: - break; + default: + break; + } } if (param.shell_style->answer) { @@ -358,7 +364,7 @@ int qpos_25, qpos_75, *qpos_perc; /* stats collected for this zone? */ - if (stats[z].n == 0) + if (stats[z].size == 0) continue; i = 0; @@ -371,6 +377,9 @@ stdev = sqrt(variance); var_coef = (stdev / mean) * 100.; /* perhaps stdev/fabs(mean) ? */ + if (stats[z].n == 0) + stats[z].sum = stats[z].sum_abs = 0.0 / 0.0; + if (zone_info.n_zones) { int z_cat = z + zone_info.min; /* zone number */ @@ -412,63 +421,72 @@ if (param.extended->answer) { qpos_perc = (int *)G_calloc(stats[z].n_perc, sizeof(int)); quartile_perc = (double *)G_calloc(stats[z].n_perc, sizeof(double)); - for (i = 0; i < stats[z].n_perc; i++) { - qpos_perc[i] = (int)(stats[z].n * 1e-2 * stats[z].perc[i] - 0.5); - } - qpos_25 = (int)(stats[z].n * 0.25 - 0.5); - qpos_75 = (int)(stats[z].n * 0.75 - 0.5); - switch (stats[z].map_type) { - case CELL_TYPE: - heapsort_int(stats[z].cell_array, stats[z].n); - - quartile_25 = (double)stats[z].cell_array[qpos_25]; - if (stats[z].n % 2) /* odd */ - median = (double)stats[z].cell_array[(int)(stats[z].n / 2)]; - else /* even */ - median = - (double)(stats[z].cell_array[stats[z].n / 2 - 1] + - stats[z].cell_array[stats[z].n / 2]) / 2.0; - quartile_75 = (double)stats[z].cell_array[qpos_75]; + + if (stats[z].n == 0) { + quartile_25 = median = quartile_75 = 0.0 / 0.0; + for (i = 0; i < stats[z].n_perc; i++) + quartile_perc[i] = 0.0 / 0.0; + } + else { for (i = 0; i < stats[z].n_perc; i++) { - quartile_perc[i] = (double)stats[z].cell_array[qpos_perc[i]]; + qpos_perc[i] = (int)(stats[z].n * 1e-2 * stats[z].perc[i] - 0.5); } - break; + qpos_25 = (int)(stats[z].n * 0.25 - 0.5); + qpos_75 = (int)(stats[z].n * 0.75 - 0.5); - case FCELL_TYPE: - heapsort_float(stats[z].fcell_array, stats[z].n); + switch (stats[z].map_type) { + case CELL_TYPE: + heapsort_int(stats[z].cell_array, stats[z].n); + + quartile_25 = (double)stats[z].cell_array[qpos_25]; + if (stats[z].n % 2) /* odd */ + median = (double)stats[z].cell_array[(int)(stats[z].n / 2)]; + else /* even */ + median = + (double)(stats[z].cell_array[stats[z].n / 2 - 1] + + stats[z].cell_array[stats[z].n / 2]) / 2.0; + quartile_75 = (double)stats[z].cell_array[qpos_75]; + for (i = 0; i < stats[z].n_perc; i++) { + quartile_perc[i] = (double)stats[z].cell_array[qpos_perc[i]]; + } + break; - quartile_25 = (double)stats[z].fcell_array[qpos_25]; - if (stats[z].n % 2) /* odd */ - median = (double)stats[z].fcell_array[(int)(stats[z].n / 2)]; - else /* even */ - median = - (double)(stats[z].fcell_array[stats[z].n / 2 - 1] + - stats[z].fcell_array[stats[z].n / 2]) / 2.0; - quartile_75 = (double)stats[z].fcell_array[qpos_75]; - for (i = 0; i < stats[z].n_perc; i++) { - quartile_perc[i] = (double)stats[z].fcell_array[qpos_perc[i]]; - } - break; + case FCELL_TYPE: + heapsort_float(stats[z].fcell_array, stats[z].n); - case DCELL_TYPE: - heapsort_double(stats[z].dcell_array, stats[z].n); + quartile_25 = (double)stats[z].fcell_array[qpos_25]; + if (stats[z].n % 2) /* odd */ + median = (double)stats[z].fcell_array[(int)(stats[z].n / 2)]; + else /* even */ + median = + (double)(stats[z].fcell_array[stats[z].n / 2 - 1] + + stats[z].fcell_array[stats[z].n / 2]) / 2.0; + quartile_75 = (double)stats[z].fcell_array[qpos_75]; + for (i = 0; i < stats[z].n_perc; i++) { + quartile_perc[i] = (double)stats[z].fcell_array[qpos_perc[i]]; + } + break; - quartile_25 = stats[z].dcell_array[qpos_25]; - if (stats[z].n % 2) /* odd */ - median = stats[z].dcell_array[(int)(stats[z].n / 2)]; - else /* even */ - median = - (stats[z].dcell_array[stats[z].n / 2 - 1] + - stats[z].dcell_array[stats[z].n / 2]) / 2.0; - quartile_75 = stats[z].dcell_array[qpos_75]; - for (i = 0; i < stats[z].n_perc; i++) { - quartile_perc[i] = stats[z].dcell_array[qpos_perc[i]]; - } - break; + case DCELL_TYPE: + heapsort_double(stats[z].dcell_array, stats[z].n); + + quartile_25 = stats[z].dcell_array[qpos_25]; + if (stats[z].n % 2) /* odd */ + median = stats[z].dcell_array[(int)(stats[z].n / 2)]; + else /* even */ + median = + (stats[z].dcell_array[stats[z].n / 2 - 1] + + stats[z].dcell_array[stats[z].n / 2]) / 2.0; + quartile_75 = stats[z].dcell_array[qpos_75]; + for (i = 0; i < stats[z].n_perc; i++) { + quartile_perc[i] = stats[z].dcell_array[qpos_perc[i]]; + } + break; - default: - break; + default: + break; + } } /* first quartile */ diff -Nru grass-7.6.1/raster/r.uslek/r.uslek.html grass-7.8.0/raster/r.uslek/r.uslek.html --- grass-7.6.1/raster/r.uslek/r.uslek.html 2019-03-19 20:03:35.000000000 +0000 +++ grass-7.8.0/raster/r.uslek/r.uslek.html 2019-05-18 15:50:05.000000000 +0000 @@ -65,4 +65,4 @@ Yann Chemin, SIC-ISDC, Turkmenistan
-

Last changed: $Date: 2014-11-24 18:15:23 +0100 (Mon, 24 Nov 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.usler/r.usler.html grass-7.8.0/raster/r.usler/r.usler.html --- grass-7.6.1/raster/r.usler/r.usler.html 2019-03-19 20:03:33.000000000 +0000 +++ grass-7.8.0/raster/r.usler/r.usler.html 2019-05-18 15:50:05.000000000 +0000 @@ -23,4 +23,4 @@ Natialia Medvedeva, SIC-ISDC, Ashgabat, Turkmenistan
Yann Chemin, SIC-ISDC, Ashgabat, Turkmenistan -

Last changed: $Date: 2014-11-24 18:22:45 +0100 (Mon, 24 Nov 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.viewshed/r.viewshed.html grass-7.8.0/raster/r.viewshed/r.viewshed.html --- grass-7.6.1/raster/r.viewshed/r.viewshed.html 2019-03-19 20:03:05.000000000 +0000 +++ grass-7.8.0/raster/r.viewshed/r.viewshed.html 2019-05-18 15:50:05.000000000 +0000 @@ -240,4 +240,4 @@

Markus Metz

-Last changed: $Date: 2017-11-11 19:59:24 +0100 (Sat, 11 Nov 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.volume/r.volume.html grass-7.8.0/raster/r.volume/r.volume.html --- grass-7.6.1/raster/r.volume/r.volume.html 2019-03-19 20:03:05.000000000 +0000 +++ grass-7.8.0/raster/r.volume/r.volume.html 2019-05-18 15:50:05.000000000 +0000 @@ -119,4 +119,4 @@ Updated to GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic

-Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.walk/main.c grass-7.8.0/raster/r.walk/main.c --- grass-7.6.1/raster/r.walk/main.c 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.walk/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -138,10 +138,10 @@ int main(int argc, char *argv[]) { - const char *cum_cost_layer, *move_dir_layer; + const char *cum_cost_layer, *move_dir_layer, *nearest_layer; const char *cost_layer, *dtm_layer; const char *dtm_mapset, *cost_mapset, *search_mapset; - void *dtm_cell, *cost_cell, *cum_cell, *dir_cell, *cell2 = NULL; + void *dtm_cell, *cost_cell, *cum_cell, *dir_cell, *cell2 = NULL, *nearest_cell; SEGMENT cost_seg, dir_seg, solve_seg; int have_solver; double *value; @@ -157,9 +157,9 @@ int nseg, nbytes; int maxmem; int segments_in_memory; - int cost_fd, cum_fd, dtm_fd, dir_fd; + int cost_fd, cum_fd, dtm_fd, dir_fd, nearest_fd; int dir = 0; - double my_dtm, my_cost, check_dtm; + double my_dtm, my_cost, check_dtm, nearest; double null_cost, dnullval; double a, b, c, d, lambda, slope_factor; int srows, scols; @@ -172,7 +172,7 @@ struct GModule *module; struct Flag *flag2, *flag3, *flag4, *flag5, *flag6; struct Option *opt1, *opt2, *opt3, *opt4, *opt5, *opt6, *opt7, *opt8; - struct Option *opt9, *opt10, *opt11, *opt12, *opt13, *opt14, *opt15; + struct Option *opt9, *opt10, *opt11, *opt12, *opt13, *opt14, *opt15, *opt16; struct Option *opt_solve; struct cost *pres_cell; struct start_pt *head_start_pt = NULL; @@ -181,15 +181,17 @@ double dtm; /* elevation model */ double cost_in; /* friction costs */ double cost_out; /* cumulative costs */ + double nearest; /* nearest start point */ } costs; FLAG *visited; void *ptr1, *ptr2; RASTER_MAP_TYPE dtm_data_type, cost_data_type, cum_data_type = - DCELL_TYPE, dir_data_type = FCELL_TYPE; + DCELL_TYPE, dir_data_type = FCELL_TYPE, + nearest_data_type = CELL_TYPE; /* output nearest type */ struct History history; double peak = 0.0; - int dtm_dsize, cost_dsize; + int dtm_dsize, cost_dsize, nearest_size; double disk_mb, mem_mb, pq_mb; int dir_bin; DCELL mysolvedir[2], solvedir[2]; @@ -228,6 +230,13 @@ opt_solve->description = _("Helper variable to pick a direction if two directions have equal cumulative costs (smaller is better)"); + opt16 = G_define_standard_option(G_OPT_R_OUTPUT); + opt16->key = "nearest"; + opt16->required = NO; + opt16->description = + _("Name for output raster map with nearest start point"); + opt16->guisection = _("Optional outputs"); + opt11 = G_define_standard_option(G_OPT_R_OUTPUT); opt11->key = "outdir"; opt11->required = NO; @@ -475,6 +484,7 @@ cost_layer = opt2->answer; move_dir_layer = opt11->answer; dtm_layer = opt12->answer; + nearest_layer = opt16->answer; /* Find number of rows and columns in window */ nrows = Rast_window_rows(); @@ -618,7 +628,8 @@ ptr2 = cell; for (col = 0; col < ncols; col++) { solvedir[0] = *(DCELL *)ptr2; - Segment_put(&solve_seg, solvedir, row, col); + if (Segment_put(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); ptr2 = G_incr_void_ptr(ptr2, dsize); } } @@ -638,6 +649,7 @@ Rast_set_d_null_value(&dnullval, 1); costs.cost_out = dnullval; + costs.nearest = 0; total_cells = nrows * ncols; @@ -701,7 +713,8 @@ } costs.dtm = p_dtm; - Segment_put(&cost_seg, &costs, row, col); + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); ptr1 = G_incr_void_ptr(ptr1, cost_dsize); ptr2 = G_incr_void_ptr(ptr2, dtm_dsize); } @@ -719,7 +732,8 @@ for (row = 0; row < nrows; row++) { G_percent(row, nrows, 2); for (col = 0; col < ncols; col++) { - Segment_put(&dir_seg, &fnullval, row, col); + if (Segment_put(&dir_seg, &fnullval, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } } G_percent(1, 1, 1); @@ -853,6 +867,7 @@ fd = Rast_open_old(opt9->answer, search_mapset); data_type2 = Rast_get_map_type(fd); + nearest_data_type = data_type2; dsize2 = Rast_cell_size(data_type2); cell2 = Rast_allocate_buf(data_type2); if (!cell2) @@ -868,19 +883,24 @@ if (!Rast_is_null_value(ptr2, data_type2)) { double cellval; - Segment_get(&cost_seg, &costs, row, col); + if (Segment_get(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); cellval = Rast_get_d_value(ptr2, data_type2); if (start_with_raster_vals == 1) { insert(cellval, row, col); costs.cost_out = cellval; - Segment_put(&cost_seg, &costs, row, col); + costs.nearest = cellval; + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } else { value = &zero; insert(zero, row, col); costs.cost_out = *value; - Segment_put(&cost_seg, &costs, row, col); + costs.nearest = cellval; + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } got_one = 1; } @@ -906,11 +926,15 @@ || next_start_pt->col < 0 || next_start_pt->col >= ncols) G_fatal_error(_("Specified starting location outside database window")); insert(zero, next_start_pt->row, next_start_pt->col); - Segment_get(&cost_seg, &costs, next_start_pt->row, - next_start_pt->col); + if (Segment_get(&cost_seg, &costs, next_start_pt->row, + next_start_pt->col) < 0) + G_fatal_error(_("Can not read from temporary file")); costs.cost_out = *value; - Segment_put(&cost_seg, &costs, next_start_pt->row, - next_start_pt->col); + costs.nearest = next_start_pt->value; + + if (Segment_put(&cost_seg, &costs, next_start_pt->row, + next_start_pt->col) < 0) + G_fatal_error(_("Can not write to temporary file")); next_start_pt = next_start_pt->next; } } @@ -969,7 +993,8 @@ break; /* If I've already been updated, delete me */ - Segment_get(&cost_seg, &costs, pres_cell->row, pres_cell->col); + if (Segment_get(&cost_seg, &costs, pres_cell->row, pres_cell->col) < 0) + G_fatal_error(_("Can not read from temporary file")); old_min_cost = costs.cost_out; if (!Rast_is_d_null_value(&old_min_cost)) { if (pres_cell->min_cost > old_min_cost) { @@ -997,8 +1022,12 @@ } FLAG_SET(visited, pres_cell->row, pres_cell->col); - if (have_solver) - Segment_get(&solve_seg, mysolvedir, pres_cell->row, pres_cell->col); + if (have_solver) { + if (Segment_get(&solve_seg, mysolvedir, pres_cell->row, pres_cell->col) < 0) + G_fatal_error(_("Can not read from temporary file")); + } + + nearest = costs.nearest; row = pres_cell->row; col = pres_cell->col; @@ -1172,7 +1201,8 @@ /* skip already processed neighbors here ? */ min_cost = dnullval; - Segment_get(&cost_seg, &costs, row, col); + if (Segment_get(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); switch (neighbor) { case 1: @@ -1461,39 +1491,50 @@ if (Rast_is_d_null_value(&min_cost)) continue; - Segment_get(&cost_seg, &costs, row, col); + if (Segment_get(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); old_min_cost = costs.cost_out; /* add to list */ if (Rast_is_d_null_value(&old_min_cost)) { costs.cost_out = min_cost; - Segment_put(&cost_seg, &costs, row, col); + costs.nearest = nearest; + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); insert(min_cost, row, col); if (dir == 1) { if (dir_bin) cur_dir = (1 << (int)cur_dir); - Segment_put(&dir_seg, &cur_dir, row, col); + if (Segment_put(&dir_seg, &cur_dir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } if (have_solver) { - Segment_get(&solve_seg, solvedir, row, col); + if (Segment_get(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); solvedir[1] = mysolvedir[0]; - Segment_put(&solve_seg, solvedir, row, col); + if (Segment_put(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } } /* update with lower costs */ else if (old_min_cost > min_cost) { costs.cost_out = min_cost; - Segment_put(&cost_seg, &costs, row, col); + costs.nearest = nearest; + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); insert(min_cost, row, col); if (dir == 1) { if (dir_bin) cur_dir = (1 << (int)cur_dir); - Segment_put(&dir_seg, &cur_dir, row, col); + if (Segment_put(&dir_seg, &cur_dir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } if (have_solver) { - Segment_get(&solve_seg, solvedir, row, col); + if (Segment_get(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); solvedir[1] = mysolvedir[0]; - Segment_put(&solve_seg, solvedir, row, col); + if (Segment_put(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } } else if (old_min_cost == min_cost && @@ -1509,18 +1550,23 @@ * otherwise we might get circular paths */ if (have_solver) { - Segment_get(&solve_seg, solvedir, row, col); + if (Segment_get(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); equal = (solvedir[1] == mysolvedir[0]); if (solvedir[1] > mysolvedir[0]) { solvedir[1] = mysolvedir[0]; - Segment_put(&solve_seg, solvedir, row, col); + if (Segment_put(&solve_seg, solvedir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); - Segment_put(&cost_seg, &costs, row, col); + costs.nearest = nearest; + if (Segment_put(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); if (dir == 1) { if (dir_bin) cur_dir = (1 << (int)cur_dir); - Segment_put(&dir_seg, &cur_dir, row, col); + if (Segment_put(&dir_seg, &cur_dir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } } } @@ -1529,12 +1575,15 @@ /* this can create circular paths: * set only if current cell does not point to neighbor * does not avoid longer circular paths */ - Segment_get(&dir_seg, &old_dir, pres_cell->row, pres_cell->col); + if (Segment_get(&dir_seg, &old_dir, pres_cell->row, pres_cell->col) < 0) + G_fatal_error(_("Can not read from temporary file")); dir_fwd = (1 << dir_inv[(int)cur_dir]); if (!((int)old_dir & dir_fwd)) { - Segment_get(&dir_seg, &old_dir, row, col); + if (Segment_get(&dir_seg, &old_dir, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); cur_dir = ((1 << (int)cur_dir) | (int)old_dir); - Segment_put(&dir_seg, &cur_dir, row, col); + if (Segment_put(&dir_seg, &cur_dir, row, col) < 0) + G_fatal_error(_("Can not write to temporary file")); } } } @@ -1559,18 +1608,33 @@ if (have_solver) { Segment_close(&solve_seg); } - + /* Open cumulative cost layer for writing */ cum_fd = Rast_open_new(cum_cost_layer, cum_data_type); cum_cell = Rast_allocate_buf(cum_data_type); + /* Open nearest start point layer */ + if (nearest_layer) { + nearest_fd = Rast_open_new(nearest_layer, nearest_data_type); + nearest_cell = Rast_allocate_buf(nearest_data_type); + } + else { + nearest_fd = -1; + nearest_cell = NULL; + } + nearest_size = Rast_cell_size(nearest_data_type); + /* Copy segmented map to output map */ G_message(_("Writing output raster map <%s>... "), cum_cost_layer); + if (nearest_layer) { + G_message(_("Writing raster map with nearest start point <%s>..."), nearest_layer); + } cell2 = Rast_allocate_buf(dtm_data_type); { void *p; void *p2; + void *p3; int cum_dsize = Rast_cell_size(cum_data_type); Rast_set_null_value(cell2, ncols, dtm_data_type); @@ -1582,19 +1646,29 @@ p = cum_cell; p2 = cell2; + p3 = nearest_cell; for (col = 0; col < ncols; col++) { if (keep_nulls) { if (Rast_is_null_value(p2, dtm_data_type)) { Rast_set_null_value(p, 1, cum_data_type); p = G_incr_void_ptr(p, cum_dsize); p2 = G_incr_void_ptr(p2, dtm_dsize); + if (nearest_layer) { + Rast_set_null_value(p3, 1, nearest_data_type); + p3 = G_incr_void_ptr(p3, nearest_size); + } + continue; } } - Segment_get(&cost_seg, &costs, row, col); + if (Segment_get(&cost_seg, &costs, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); min_cost = costs.cost_out; + nearest = costs.nearest; if (Rast_is_d_null_value(&min_cost)) { Rast_set_null_value((p), 1, cum_data_type); + if (nearest_layer) + Rast_set_null_value(p3, 1, nearest_data_type); } else { if (min_cost > peak) @@ -1611,15 +1685,35 @@ *(DCELL *)p = (DCELL)(min_cost); break; } + + if (nearest_layer) { + switch (nearest_data_type) { + case CELL_TYPE: + *(CELL *)p3 = (CELL)(nearest); + break; + case FCELL_TYPE: + *(FCELL *)p3 = (FCELL)(nearest); + break; + case DCELL_TYPE: + *(DCELL *)p3 = (DCELL)(nearest); + break; + } + } } p = G_incr_void_ptr(p, cum_dsize); p2 = G_incr_void_ptr(p2, dtm_dsize); + if (nearest_layer) + p3 = G_incr_void_ptr(p3, nearest_size); } Rast_put_row(cum_fd, cum_cell, cum_data_type); + if (nearest_layer) + Rast_put_row(nearest_fd, nearest_cell, nearest_data_type); } G_percent(1, 1, 1); G_free(cum_cell); G_free(cell2); + if (nearest_layer) + G_free(nearest_cell); } if (dir == 1) { @@ -1633,7 +1727,8 @@ for (row = 0; row < nrows; row++) { p = dir_cell; for (col = 0; col < ncols; col++) { - Segment_get(&dir_seg, &cur_dir, row, col); + if (Segment_get(&dir_seg, &cur_dir, row, col) < 0) + G_fatal_error(_("Can not read from temporary file")); *((FCELL *) p) = cur_dir; p = G_incr_void_ptr(p, dir_size); } @@ -1653,6 +1748,8 @@ Rast_close(cum_fd); if (dir == 1) Rast_close(dir_fd); + if (nearest_layer) + Rast_close(nearest_fd); /* writing history file */ Rast_short_history(cum_cost_layer, "raster", &history); @@ -1665,6 +1762,27 @@ Rast_write_history(move_dir_layer, &history); } + if (nearest_layer) { + Rast_short_history(nearest_layer, "raster", &history); + Rast_command_history(&history); + Rast_write_history(nearest_layer, &history); + if (opt9->answer) { + struct Colors colors; + Rast_read_colors(opt9->answer, "", &colors); + Rast_write_colors(nearest_layer, G_mapset(), &colors); + } + else { + struct Colors colors; + struct Range range; + CELL min, max; + + Rast_read_range(nearest_layer, G_mapset(), &range); + Rast_get_range_min_max(&range, &min, &max); + Rast_make_random_colors(&colors, min, max); + Rast_write_colors(nearest_layer, G_mapset(), &colors); + } + } + /* Create colours for output map */ /* diff -Nru grass-7.6.1/raster/r.walk/r.walk.html grass-7.8.0/raster/r.walk/r.walk.html --- grass-7.6.1/raster/r.walk/r.walk.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.walk/r.walk.html 2019-06-03 20:34:21.000000000 +0000 @@ -135,7 +135,7 @@ g.region swwake_30m -p # create friction map based on land cover -r.recode landclass96 out=friction << EOF +r.recode landclass96 out=friction rules=- << EOF 1:3:0.1:0.1 4:5:10.:10. 6:6:1000.0:1000.0 @@ -194,7 +194,8 @@ Roberto Flor and Markus Neteler

Updated for GRASS GIS 7:
-Markus Metz +Markus Metz
+Multiple path directions sponsored by mundialis

-Last changed: $Date: 2019-02-23 15:00:42 +0100 (Sat, 23 Feb 2019) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.water.outlet/r.water.outlet.html grass-7.8.0/raster/r.water.outlet/r.water.outlet.html --- grass-7.6.1/raster/r.water.outlet/r.water.outlet.html 2019-03-19 20:02:57.000000000 +0000 +++ grass-7.8.0/raster/r.water.outlet/r.water.outlet.html 2019-05-22 21:47:51.000000000 +0000 @@ -71,4 +71,4 @@ Charles Ehlschlaeger, U.S. Army Construction Engineering Research Laboratory

-Last changed: $Date: 2018-06-16 10:34:49 +0200 (Sat, 16 Jun 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.watershed/front/main.c grass-7.8.0/raster/r.watershed/front/main.c --- grass-7.6.1/raster/r.watershed/front/main.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/front/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) { char command[GPATH_MAX]; - int err, ret; + int ret; struct Option *opt1; struct Option *opt2; struct Option *opt3; @@ -155,7 +155,7 @@ opt18 = G_define_standard_option(G_OPT_R_OUTPUT); opt18->key = "spi"; - opt18->label = _("Stream power index a * tan(b)"); + opt18->label = _("Name for output stream power index a * tan(b)"); opt18->required = NO; opt18->guisection = _("Outputs"); @@ -245,22 +245,18 @@ flag_flat->description = _("Flow direction in flat areas is modified to look prettier"); - if (G_parser(argc, argv)) - exit(EXIT_FAILURE); - - - /* Check option combinations */ + /* Some options requires threshold */ + G_option_requires(opt10, opt6, NULL); + G_option_requires(opt11, opt6, NULL); + G_option_requires(opt12, opt6, NULL); + G_option_requires(opt13, opt6, NULL); + G_option_requires(opt14, opt6, NULL); /* Check for some output map */ - if ((opt8->answer == NULL) - && (opt9->answer == NULL) - && (opt10->answer == NULL) - && (opt11->answer == NULL) - && (opt12->answer == NULL) - && (opt14->answer == NULL) - && (opt15->answer == NULL)) { - G_fatal_error(_("Sorry, you must choose an output map.")); - } + G_option_required(opt8, opt17, opt18, opt9, opt10, opt11, opt12, opt13, opt14, NULL); + + if (G_parser(argc, argv)) + exit(EXIT_FAILURE); /* basin threshold */ if (opt6->answer) { @@ -268,27 +264,6 @@ G_fatal_error(_("The basin threshold must be a positive number.")); } - err = 0; - /* basin and basin threshold */ - err += (opt10->answer != NULL && opt6->answer == NULL); - /* stream and basin threshold */ - err += (opt11->answer != NULL && opt6->answer == NULL); - /* half_basin and basin threshold */ - err += (opt12->answer != NULL && opt6->answer == NULL); - /* LS factor and basin threshold */ - err += (opt13->answer != NULL && opt6->answer == NULL); - /* S factor and basin threshold */ - err += (opt14->answer != NULL && opt6->answer == NULL); - - if (err) { - G_message(_("Sorry, if any of the following options are set:\n" - " basin, stream, half_basin, length_slope, or slope_steepness\n" - " you MUST provide a value for the basin " - "threshold parameter.")); - G_usage(); - exit(EXIT_FAILURE); - } - /* Build command line */ sprintf(command, "%s/etc/r.watershed/%s", G_gisbase(), flag_seg->answer ? "seg" : "ram"); Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/raster/r.watershed/front/r_watershed_drainage.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/raster/r.watershed/front/r_watershed_drainage.png differ diff -Nru grass-7.6.1/raster/r.watershed/front/r.watershed.html grass-7.8.0/raster/r.watershed/front/r.watershed.html --- grass-7.6.1/raster/r.watershed/front/r.watershed.html 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/front/r.watershed.html 2019-06-03 20:34:21.000000000 +0000 @@ -144,6 +144,16 @@

Output drainage raster map contains drainage direction. Provides the "aspect" for each cell measured CCW from East. + +

+ +drainage +
+Figure: Drainage is 8 directions numbered counter-clockwise +starting from 1 in north-east direction +(source) +
+ Multiplying positive values by 45 will give the direction in degrees that the surface runoff will travel from that cell. The value 0 (zero) indicates that the cell is a depression area (defined by the @@ -577,4 +587,4 @@ Retention for flow distribution by Andreas Gericke (IGB Berlin)

-Last changed: $Date: 2018-10-18 21:05:15 +0200 (Thu, 18 Oct 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.watershed/ram/do_cum.c grass-7.8.0/raster/r.watershed/ram/do_cum.c --- grass-7.6.1/raster/r.watershed/ram/do_cum.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/ram/do_cum.c 2019-06-03 20:34:21.000000000 +0000 @@ -271,7 +271,7 @@ /* MFD */ int mfd_cells, stream_cells, swale_cells, astar_not_set, is_null; double *dist_to_nbr, *contour, *weight, sum_weight, max_weight; - int r_nbr, c_nbr, r_max, c_max, ct_dir, np_side; + int r_nbr, c_nbr, r_max, c_max, ct_dir, np_side, max_side; CELL ele, ele_nbr, aspect, is_worked; double prop, max_val; int workedon, edge, flat; @@ -339,7 +339,6 @@ ele = alt[this_index]; is_null = 0; edge = 0; - mfdir = 0; /* this loop is needed to get the sum of weights */ for (ct_dir = 0; ct_dir < sides; ct_dir++) { /* get r, c (r_nbr, c_nbr) for neighbours */ @@ -429,8 +428,6 @@ is_worked = FLAG_GET(worked, r_nbr, c_nbr); if (is_worked == 0) { - mfdir |= (1 << nextmfd[ct_dir]); - nbr_index = SEG_INDEX(wat_seg, r_nbr, c_nbr); weight[ct_dir] = weight[ct_dir] / sum_weight; @@ -532,6 +529,9 @@ /* get max flow accumulation */ max_val = -1; + max_side = 0; + mfd_cells = 0; + mfdir = 0; stream_cells = 0; swale_cells = 0; ele = alt[this_index]; @@ -570,6 +570,11 @@ max_val = ABS(valued); r_max = r_nbr; c_max = c_nbr; + max_side = ct_dir; + } + if (!is_null && ele_nbr <= ele) { + mfdir |= (1 << nextmfd[ct_dir]); + mfd_cells++; } } } @@ -595,6 +600,9 @@ aspect = -aspect; asp[this_index] = aspect; } + if (mfd_cells == 1) + mfdir = (1 << nextmfd[max_side]); + is_swale = FLAG_GET(swale, r, c); /* start new stream */ value = ABS(value) + 0.5; diff -Nru grass-7.6.1/raster/r.watershed/seg/bseg_close.c grass-7.8.0/raster/r.watershed/seg/bseg_close.c --- grass-7.6.1/raster/r.watershed/seg/bseg_close.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/seg/bseg_close.c 2019-06-03 20:34:21.000000000 +0000 @@ -4,9 +4,7 @@ int bseg_close(BSEG * bseg) { - Segment_release(&(bseg->seg)); - close(bseg->fd); - unlink(bseg->filename); + Segment_close(&(bseg->seg)); if (bseg->name) { G_free(bseg->name); bseg->name = NULL; diff -Nru grass-7.6.1/raster/r.watershed/seg/bseg_open.c grass-7.8.0/raster/r.watershed/seg/bseg_open.c --- grass-7.6.1/raster/r.watershed/seg/bseg_open.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/seg/bseg_open.c 2019-06-03 20:34:21.000000000 +0000 @@ -2,6 +2,7 @@ #include #include #include +#include #include "Gwater.h" @@ -9,7 +10,6 @@ { char *filename; int errflag; - int fd; bseg->filename = NULL; bseg->fd = -1; @@ -17,43 +17,36 @@ bseg->mapset = NULL; filename = G_tempfile(); - if (-1 == (fd = creat(filename, 0666))) { - G_warning("bseg_open(): unable to create segment file"); - return -2; - } - if (0 > (errflag = Segment_format(fd, Rast_window_rows(), - Rast_window_cols(), srows, scols, - sizeof(char)))) { - close(fd); - unlink(filename); + if (0 > (errflag = Segment_open(&(bseg->seg), filename, Rast_window_rows(), + Rast_window_cols(), srows, scols, + sizeof(char), nsegs_in_memory))) { if (errflag == -1) { - G_warning("bseg_open(): could not write segment file"); + G_warning(_("File name is invalid")); return -1; } - else { - G_warning("bseg_open(): illegal configuration parameter(s)"); + else if (errflag == -2) { + G_warning(_("File write error")); + return -2; + } + else if (errflag == -3) { + G_warning(_("Illegal parameters are passed")); return -3; } - } - close(fd); - if (-1 == (fd = open(filename, 2))) { - unlink(filename); - G_warning("bseg_open(): unable to re-open segment file"); - return -4; - } - if (0 > (errflag = Segment_init(&(bseg->seg), fd, nsegs_in_memory))) { - close(fd); - unlink(filename); - if (errflag == -1) { - G_warning("bseg_open(): could not read segment file"); + else if (errflag == -4) { + G_warning(_("File could not be re-opened")); + return -4; + } + else if (errflag == -5) { + G_warning(_("Prepared file could not be read")); return -5; } - else { - G_warning("bseg_open(): out of memory"); + else if (errflag == -6) { + G_warning(_("Out of memory")); return -6; } } + bseg->filename = filename; - bseg->fd = fd; + return 0; } diff -Nru grass-7.6.1/raster/r.watershed/seg/cseg_close.c grass-7.8.0/raster/r.watershed/seg/cseg_close.c --- grass-7.6.1/raster/r.watershed/seg/cseg_close.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/seg/cseg_close.c 2019-06-03 20:34:21.000000000 +0000 @@ -5,9 +5,7 @@ int cseg_close(CSEG * cseg) { - Segment_release(&(cseg->seg)); - close(cseg->fd); - unlink(cseg->filename); + Segment_close(&(cseg->seg)); if (cseg->name) { G_free(cseg->name); cseg->name = NULL; diff -Nru grass-7.6.1/raster/r.watershed/seg/cseg_open.c grass-7.8.0/raster/r.watershed/seg/cseg_open.c --- grass-7.6.1/raster/r.watershed/seg/cseg_open.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/seg/cseg_open.c 2019-06-03 20:34:21.000000000 +0000 @@ -1,6 +1,7 @@ #include #include #include +#include #include "Gwater.h" @@ -8,7 +9,6 @@ { char *filename; int errflag; - int fd; cseg->filename = NULL; cseg->fd = -1; @@ -16,44 +16,36 @@ cseg->mapset = NULL; filename = G_tempfile(); - if (-1 == (fd = creat(filename, 0666))) { - G_warning("cseg_open(): unable to create segment file"); - return -2; - } - if (0 > - (errflag = - Segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, - scols, sizeof(CELL)))) { - close(fd); - unlink(filename); + if (0 > (errflag = Segment_open(&(cseg->seg), filename, Rast_window_rows(), + Rast_window_cols(), srows, scols, + sizeof(CELL), nsegs_in_memory))) { if (errflag == -1) { - G_warning("cseg_open(): could not write segment file"); + G_warning(_("File name is invalid")); return -1; } - else { - G_warning("cseg_open(): illegal configuration parameter(s)"); + else if (errflag == -2) { + G_warning(_("File write error")); + return -2; + } + else if (errflag == -3) { + G_warning(_("Illegal parameters are passed")); return -3; } - } - close(fd); - if (-1 == (fd = open(filename, 2))) { - unlink(filename); - G_warning("cseg_open(): unable to re-open segment file"); - return -4; - } - if (0 > (errflag = Segment_init(&(cseg->seg), fd, nsegs_in_memory))) { - close(fd); - unlink(filename); - if (errflag == -1) { - G_warning("cseg_open(): could not read segment file"); + else if (errflag == -4) { + G_warning(_("File could not be re-opened")); + return -4; + } + else if (errflag == -5) { + G_warning(_("Prepared file could not be read")); return -5; } - else { - G_warning("cseg_open(): out of memory"); + else if (errflag == -6) { + G_warning(_("Out of memory")); return -6; } } + cseg->filename = filename; - cseg->fd = fd; + return 0; } diff -Nru grass-7.6.1/raster/r.watershed/seg/do_cum.c grass-7.8.0/raster/r.watershed/seg/do_cum.c --- grass-7.6.1/raster/r.watershed/seg/do_cum.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/seg/do_cum.c 2019-06-03 20:34:21.000000000 +0000 @@ -290,7 +290,7 @@ /* MFD */ int mfd_cells, stream_cells, swale_cells, astar_not_set, is_null; double *dist_to_nbr, *contour, *weight, sum_weight, max_weight; - int r_nbr, c_nbr, r_max, c_max, ct_dir, np_side; + int r_nbr, c_nbr, r_max, c_max, ct_dir, np_side, max_side; CELL ele, *ele_nbr; double prop, max_val; int workedon, edge, is_swale, flat; @@ -466,9 +466,6 @@ c_nbr < ncols && weight[ct_dir] > -0.5) { if (FLAG_GET(flag_nbr[ct_dir], WORKEDFLAG)) { - - mfdir |= (1 << nextmfd[ct_dir]); - weight[ct_dir] = weight[ct_dir] / sum_weight; /* check everything adds up to 1.0 */ prop += weight[ct_dir]; @@ -588,6 +585,9 @@ /* get max flow accumulation */ max_val = -1; + max_side = 0; + mfd_cells = 0; + mfdir = 0; stream_cells = 0; swale_cells = 0; ele = wa.ele; @@ -634,6 +634,11 @@ max_val = ABS(wa.wat); r_max = r_nbr; c_max = c_nbr; + max_side = ct_dir; + } + if (!is_null && ele_nbr[ct_dir] <= ele) { + mfdir |= (1 << nextmfd[ct_dir]); + mfd_cells++; } } } @@ -659,6 +664,9 @@ else af.asp = drain[r - r_max + 1][c - c_max + 1]; } + if (mfd_cells == 1) + mfdir = (1 << nextmfd[max_side]); + is_swale = FLAG_GET(af.flag, SWALEFLAG); /* start new stream */ if (!is_swale && fabs(value) >= threshold && stream_cells < 1 && diff -Nru grass-7.6.1/raster/r.watershed/seg/dseg_close.c grass-7.8.0/raster/r.watershed/seg/dseg_close.c --- grass-7.6.1/raster/r.watershed/seg/dseg_close.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/seg/dseg_close.c 2019-06-03 20:34:21.000000000 +0000 @@ -4,9 +4,7 @@ int dseg_close(DSEG * dseg) { - Segment_release(&(dseg->seg)); - close(dseg->fd); - unlink(dseg->filename); + Segment_close(&(dseg->seg)); if (dseg->name) { G_free(dseg->name); dseg->name = NULL; diff -Nru grass-7.6.1/raster/r.watershed/seg/dseg_open.c grass-7.8.0/raster/r.watershed/seg/dseg_open.c --- grass-7.6.1/raster/r.watershed/seg/dseg_open.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/seg/dseg_open.c 2019-06-03 20:34:21.000000000 +0000 @@ -2,6 +2,7 @@ #include #include #include +#include #include "Gwater.h" @@ -9,7 +10,6 @@ { char *filename; int errflag; - int fd; dseg->filename = NULL; dseg->fd = -1; @@ -17,44 +17,36 @@ dseg->mapset = NULL; filename = G_tempfile(); - if (-1 == (fd = creat(filename, 0666))) { - G_warning("dseg_open(): unable to create segment file"); - return -2; - } - if (0 > - (errflag = - Segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, - scols, sizeof(double)))) { - close(fd); - unlink(filename); + if (0 > (errflag = Segment_open(&(dseg->seg), filename, Rast_window_rows(), + Rast_window_cols(), srows, scols, + sizeof(DCELL), nsegs_in_memory))) { if (errflag == -1) { - G_warning("dseg_open(): could not write segment file"); + G_warning(_("File name is invalid")); return -1; } - else { - G_warning("dseg_open(): illegal configuration parameter(s)"); + else if (errflag == -2) { + G_warning(_("File write error")); + return -2; + } + else if (errflag == -3) { + G_warning(_("Illegal parameters are passed")); return -3; } - } - close(fd); - if (-1 == (fd = open(filename, 2))) { - unlink(filename); - G_warning("dseg_open(): unable to re-open segment file"); - return -4; - } - if (0 > (errflag = Segment_init(&(dseg->seg), fd, nsegs_in_memory))) { - close(fd); - unlink(filename); - if (errflag == -1) { - G_warning("dseg_open(): could not read segment file"); + else if (errflag == -4) { + G_warning(_("File could not be re-opened")); + return -4; + } + else if (errflag == -5) { + G_warning(_("Prepared file could not be read")); return -5; } - else { - G_warning("dseg_open(): out of memory"); + else if (errflag == -6) { + G_warning(_("Out of memory")); return -6; } } + dseg->filename = filename; - dseg->fd = fd; + return 0; } diff -Nru grass-7.6.1/raster/r.watershed/seg/sseg_close.c grass-7.8.0/raster/r.watershed/seg/sseg_close.c --- grass-7.6.1/raster/r.watershed/seg/sseg_close.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/seg/sseg_close.c 2019-06-03 20:34:21.000000000 +0000 @@ -5,8 +5,7 @@ int seg_close(SSEG * sseg) { - Segment_release(&(sseg->seg)); - close(sseg->fd); - unlink(sseg->filename); + Segment_close(&(sseg->seg)); + return 0; } diff -Nru grass-7.6.1/raster/r.watershed/seg/sseg_open.c grass-7.8.0/raster/r.watershed/seg/sseg_open.c --- grass-7.6.1/raster/r.watershed/seg/sseg_open.c 2019-03-19 20:03:46.000000000 +0000 +++ grass-7.8.0/raster/r.watershed/seg/sseg_open.c 2019-06-03 20:34:21.000000000 +0000 @@ -2,6 +2,7 @@ #include #include #include +#include #include "Gwater.h" int @@ -10,48 +11,41 @@ { char *filename; int errflag; - int fd; sseg->filename = NULL; sseg->fd = -1; filename = G_tempfile(); - if (-1 == (fd = creat(filename, 0666))) { - G_warning("seg_open(): unable to create segment file"); - return -2; - } - if (0 > (errflag = Segment_format(fd, rows, cols, - row_in_seg, col_in_seg, size_struct))) { - close(fd); - unlink(filename); + if (0 > (errflag = Segment_open(&(sseg->seg), filename, rows, cols, + row_in_seg, col_in_seg, + size_struct, nsegs_in_memory))) { if (errflag == -1) { - G_warning("seg_open(): could not write segment file"); + G_warning(_("File name is invalid")); return -1; } - else { - G_warning("seg_open(): illegal configuration parameter(s)"); + else if (errflag == -2) { + G_warning(_("File write error")); + return -2; + } + else if (errflag == -3) { + G_warning(_("Illegal parameters are passed")); return -3; } - } - close(fd); - if (-1 == (fd = open(filename, 2))) { - unlink(filename); - G_warning("seg_open(): unable to re-open segment file"); - return -4; - } - if (0 > (errflag = Segment_init(&(sseg->seg), fd, nsegs_in_memory))) { - close(fd); - unlink(filename); - if (errflag == -1) { - G_warning("seg_open(): could not read segment file"); + else if (errflag == -4) { + G_warning(_("File could not be re-opened")); + return -4; + } + else if (errflag == -5) { + G_warning(_("Prepared file could not be read")); return -5; } - else { - G_warning("seg_open(): out of memory"); + else if (errflag == -6) { + G_warning(_("Out of memory")); return -6; } } + sseg->filename = filename; - sseg->fd = fd; + return 0; } diff -Nru grass-7.6.1/raster/r.what/r.what.html grass-7.8.0/raster/r.what/r.what.html --- grass-7.6.1/raster/r.what/r.what.html 2019-03-19 20:03:58.000000000 +0000 +++ grass-7.8.0/raster/r.what/r.what.html 2019-05-18 15:50:05.000000000 +0000 @@ -193,4 +193,4 @@ Vector point input added by Martin Landa, Czech Technical University in Prague, Czech Republic

-Last changed: $Date: 2017-05-16 16:04:44 +0200 (Tue, 16 May 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster/r.what/testsuite/test_r_what.py grass-7.8.0/raster/r.what/testsuite/test_r_what.py --- grass-7.6.1/raster/r.what/testsuite/test_r_what.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/raster/r.what/testsuite/test_r_what.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,516 @@ +""" +Name: r.what test +Purpose: Tests r.what module and its options. + +Author: Shubham Sharma, Google Code-in 2018 +Copyright: (C) 2018 by Shubham Sharma and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.gmodules import SimpleModule +import os + + +class TestRasterWhat(TestCase): + map1 = 'boundary_county_500m' + map2 = 'landuse96_28m,aspect' + coordinates = (633614.08, 224125.12, 632972.36, 225382.87) + points = 'comm_colleges' + refrence_points="""145096.8591495|154534.264883875||39 +616341.4371495|146049.750883875||51 +410595.7191495|174301.828883875||71 +734153.6871495|169168.437883875||107 +706338.2501495|54889.417883875||129 +758009.7501495|112019.898883875||133 +754002.7501495|200902.234883875||147 +704771.7501495|183364.484883875||191 +399187.0631495|220018.859883875||35 +685098.9371495|33282.089883875||19 +577750.8131495|257153.109883875||1 +794095.5621495|199742.671883875||13 +634688.2501495|100629.616883875||17 +287638.7811495|207582.624883875||21 +366218.5321495|222940.625883875||23 +385212.4371495|236593.109883875||27 +628137.4371495|63995.550883875||47 +782600.5631495|152698.890883875||49 +502813.9381495|235232.577883875||57 +705922.6251495|136589.359883875||61 +620397.8131495|246847.640883875||63 +738465.3751495|237233.983883875||65 +708944.7501495|247632.296883875||127 +526666.6871495|249780.312883875||81 +733439.3741495|298005.311883875||83 +253886.0321495|204702.171883875||87 +298337.5621495|178131.233883875||89 +788989.3121495|284544.562883875||91 +438378.3431495|227157.890883875||97 +227406.0621495|190462.640883875||99 +668782.8121495|195518.718883875||101 +596325.2501495|190688.374883875||105 +777034.8131495|229280.030883875||117 +337714.9681495|219991.202883875||111 +442913.7181495|164364.608883875||119 +528779.3741495|179793.890883875||123 +571926.0621495|162885.202883875||125 +801852.0621495|154744.077883875||137 +611371.9381495|295204.467883875||145 +534602.9371495|213605.812883875||151 +608960.3121495|102612.546883875||155 +541667.1251495|293002.124883875||157 +475819.8131495|210685.359883875||159 +343685.3441495|182222.358883875||161 +670160.3121495|140070.249883875||163 +497214.4691495|177053.639883875||167 +455564.7811495|293568.937883875||171 +636209.2501495|210858.014883875||183 +413565.1871495|267534.562883875||193 +709485.0001495|220209.202883875||195 +815182.1881495|110335.429883875||31 +495151.3131495|258002.374883875||67 +859129.4371495|288849.968883875||139 +545200.0621495|127391.304883875||153 +655627.6871495|285597.342883875||181 +382174.7811495|171687.280883875||45 +511235.1561495|135372.358883875||7 +332533.5941495|242831.139883875||121 +""" + refrence_coordinates="""633614.08|224125.12||2|209.5939 +632972.36|225382.87||15|140.7571 +""" + refrence_cats="""1|145096.8591495|154534.264883875||39 +2|616341.4371495|146049.750883875||51 +3|410595.7191495|174301.828883875||71 +4|734153.6871495|169168.437883875||107 +5|706338.2501495|54889.417883875||129 +6|758009.7501495|112019.898883875||133 +7|754002.7501495|200902.234883875||147 +8|704771.7501495|183364.484883875||191 +9|399187.0631495|220018.859883875||35 +10|685098.9371495|33282.089883875||19 +11|577750.8131495|257153.109883875||1 +12|794095.5621495|199742.671883875||13 +13|634688.2501495|100629.616883875||17 +14|287638.7811495|207582.624883875||21 +15|366218.5321495|222940.625883875||23 +16|385212.4371495|236593.109883875||27 +17|628137.4371495|63995.550883875||47 +18|782600.5631495|152698.890883875||49 +19|502813.9381495|235232.577883875||57 +20|705922.6251495|136589.359883875||61 +21|620397.8131495|246847.640883875||63 +22|738465.3751495|237233.983883875||65 +23|708944.7501495|247632.296883875||127 +24|526666.6871495|249780.312883875||81 +25|733439.3741495|298005.311883875||83 +26|253886.0321495|204702.171883875||87 +27|298337.5621495|178131.233883875||89 +28|788989.3121495|284544.562883875||91 +29|438378.3431495|227157.890883875||97 +30|227406.0621495|190462.640883875||99 +31|668782.8121495|195518.718883875||101 +32|596325.2501495|190688.374883875||105 +33|777034.8131495|229280.030883875||117 +34|337714.9681495|219991.202883875||111 +35|442913.7181495|164364.608883875||119 +36|528779.3741495|179793.890883875||123 +37|571926.0621495|162885.202883875||125 +38|801852.0621495|154744.077883875||137 +39|611371.9381495|295204.467883875||145 +40|534602.9371495|213605.812883875||151 +41|608960.3121495|102612.546883875||155 +42|541667.1251495|293002.124883875||157 +43|475819.8131495|210685.359883875||159 +44|343685.3441495|182222.358883875||161 +45|670160.3121495|140070.249883875||163 +46|497214.4691495|177053.639883875||167 +47|455564.7811495|293568.937883875||171 +48|636209.2501495|210858.014883875||183 +49|413565.1871495|267534.562883875||193 +50|709485.0001495|220209.202883875||195 +51|815182.1881495|110335.429883875||31 +52|495151.3131495|258002.374883875||67 +53|859129.4371495|288849.968883875||139 +54|545200.0621495|127391.304883875||153 +55|655627.6871495|285597.342883875||181 +56|382174.7811495|171687.280883875||45 +57|511235.1561495|135372.358883875||7 +58|332533.5941495|242831.139883875||121 +""" + refrence_csv="""easting,northing,site_name,boundary_county_500m +145096.8591495,154534.264883875,,39 +616341.4371495,146049.750883875,,51 +410595.7191495,174301.828883875,,71 +734153.6871495,169168.437883875,,107 +706338.2501495,54889.417883875,,129 +758009.7501495,112019.898883875,,133 +754002.7501495,200902.234883875,,147 +704771.7501495,183364.484883875,,191 +399187.0631495,220018.859883875,,35 +685098.9371495,33282.089883875,,19 +577750.8131495,257153.109883875,,1 +794095.5621495,199742.671883875,,13 +634688.2501495,100629.616883875,,17 +287638.7811495,207582.624883875,,21 +366218.5321495,222940.625883875,,23 +385212.4371495,236593.109883875,,27 +628137.4371495,63995.550883875,,47 +782600.5631495,152698.890883875,,49 +502813.9381495,235232.577883875,,57 +705922.6251495,136589.359883875,,61 +620397.8131495,246847.640883875,,63 +738465.3751495,237233.983883875,,65 +708944.7501495,247632.296883875,,127 +526666.6871495,249780.312883875,,81 +733439.3741495,298005.311883875,,83 +253886.0321495,204702.171883875,,87 +298337.5621495,178131.233883875,,89 +788989.3121495,284544.562883875,,91 +438378.3431495,227157.890883875,,97 +227406.0621495,190462.640883875,,99 +668782.8121495,195518.718883875,,101 +596325.2501495,190688.374883875,,105 +777034.8131495,229280.030883875,,117 +337714.9681495,219991.202883875,,111 +442913.7181495,164364.608883875,,119 +528779.3741495,179793.890883875,,123 +571926.0621495,162885.202883875,,125 +801852.0621495,154744.077883875,,137 +611371.9381495,295204.467883875,,145 +534602.9371495,213605.812883875,,151 +608960.3121495,102612.546883875,,155 +541667.1251495,293002.124883875,,157 +475819.8131495,210685.359883875,,159 +343685.3441495,182222.358883875,,161 +670160.3121495,140070.249883875,,163 +497214.4691495,177053.639883875,,167 +455564.7811495,293568.937883875,,171 +636209.2501495,210858.014883875,,183 +413565.1871495,267534.562883875,,193 +709485.0001495,220209.202883875,,195 +815182.1881495,110335.429883875,,31 +495151.3131495,258002.374883875,,67 +859129.4371495,288849.968883875,,139 +545200.0621495,127391.304883875,,153 +655627.6871495,285597.342883875,,181 +382174.7811495,171687.280883875,,45 +511235.1561495,135372.358883875,,7 +332533.5941495,242831.139883875,,121""" + + refrence_flag_i="""145096.8591495|154534.264883875||39 +616341.4371495|146049.750883875||51 +410595.7191495|174301.828883875||71 +734153.6871495|169168.437883875||107 +706338.2501495|54889.417883875||129 +758009.7501495|112019.898883875||133 +754002.7501495|200902.234883875||147 +704771.7501495|183364.484883875||191 +399187.0631495|220018.859883875||35 +685098.9371495|33282.089883875||19 +577750.8131495|257153.109883875||1 +794095.5621495|199742.671883875||13 +634688.2501495|100629.616883875||17 +287638.7811495|207582.624883875||21 +366218.5321495|222940.625883875||23 +385212.4371495|236593.109883875||27 +628137.4371495|63995.550883875||47 +782600.5631495|152698.890883875||49 +502813.9381495|235232.577883875||57 +705922.6251495|136589.359883875||61 +620397.8131495|246847.640883875||63 +738465.3751495|237233.983883875||65 +708944.7501495|247632.296883875||127 +526666.6871495|249780.312883875||81 +733439.3741495|298005.311883875||83 +253886.0321495|204702.171883875||87 +298337.5621495|178131.233883875||89 +788989.3121495|284544.562883875||91 +438378.3431495|227157.890883875||97 +227406.0621495|190462.640883875||99 +668782.8121495|195518.718883875||101 +596325.2501495|190688.374883875||105 +777034.8131495|229280.030883875||117 +337714.9681495|219991.202883875||111 +442913.7181495|164364.608883875||119 +528779.3741495|179793.890883875||123 +571926.0621495|162885.202883875||125 +801852.0621495|154744.077883875||137 +611371.9381495|295204.467883875||145 +534602.9371495|213605.812883875||151 +608960.3121495|102612.546883875||155 +541667.1251495|293002.124883875||157 +475819.8131495|210685.359883875||159 +343685.3441495|182222.358883875||161 +670160.3121495|140070.249883875||163 +497214.4691495|177053.639883875||167 +455564.7811495|293568.937883875||171 +636209.2501495|210858.014883875||183 +413565.1871495|267534.562883875||193 +709485.0001495|220209.202883875||195 +815182.1881495|110335.429883875||31 +495151.3131495|258002.374883875||67 +859129.4371495|288849.968883875||139 +545200.0621495|127391.304883875||153 +655627.6871495|285597.342883875||181 +382174.7811495|171687.280883875||45 +511235.1561495|135372.358883875||7 +332533.5941495|242831.139883875||121 +""" + refrence_flag_f="""145096.8591495|154534.264883875||39| +616341.4371495|146049.750883875||51| +410595.7191495|174301.828883875||71| +734153.6871495|169168.437883875||107| +706338.2501495|54889.417883875||129| +758009.7501495|112019.898883875||133| +754002.7501495|200902.234883875||147| +704771.7501495|183364.484883875||191| +399187.0631495|220018.859883875||35| +685098.9371495|33282.089883875||19| +577750.8131495|257153.109883875||1| +794095.5621495|199742.671883875||13| +634688.2501495|100629.616883875||17| +287638.7811495|207582.624883875||21| +366218.5321495|222940.625883875||23| +385212.4371495|236593.109883875||27| +628137.4371495|63995.550883875||47| +782600.5631495|152698.890883875||49| +502813.9381495|235232.577883875||57| +705922.6251495|136589.359883875||61| +620397.8131495|246847.640883875||63| +738465.3751495|237233.983883875||65| +708944.7501495|247632.296883875||127| +526666.6871495|249780.312883875||81| +733439.3741495|298005.311883875||83| +253886.0321495|204702.171883875||87| +298337.5621495|178131.233883875||89| +788989.3121495|284544.562883875||91| +438378.3431495|227157.890883875||97| +227406.0621495|190462.640883875||99| +668782.8121495|195518.718883875||101| +596325.2501495|190688.374883875||105| +777034.8131495|229280.030883875||117| +337714.9681495|219991.202883875||111| +442913.7181495|164364.608883875||119| +528779.3741495|179793.890883875||123| +571926.0621495|162885.202883875||125| +801852.0621495|154744.077883875||137| +611371.9381495|295204.467883875||145| +534602.9371495|213605.812883875||151| +608960.3121495|102612.546883875||155| +541667.1251495|293002.124883875||157| +475819.8131495|210685.359883875||159| +343685.3441495|182222.358883875||161| +670160.3121495|140070.249883875||163| +497214.4691495|177053.639883875||167| +455564.7811495|293568.937883875||171| +636209.2501495|210858.014883875||183| +413565.1871495|267534.562883875||193| +709485.0001495|220209.202883875||195| +815182.1881495|110335.429883875||31| +495151.3131495|258002.374883875||67| +859129.4371495|288849.968883875||139| +545200.0621495|127391.304883875||153| +655627.6871495|285597.342883875||181| +382174.7811495|171687.280883875||45| +511235.1561495|135372.358883875||7| +332533.5941495|242831.139883875||121| +""" + refrence_flag_r="""145096.8591495|154534.264883875||39|006:255:000 +616341.4371495|146049.750883875||51|000:255:071 +410595.7191495|174301.828883875||71|000:255:199 +734153.6871495|169168.437883875||107|000:080:255 +706338.2501495|54889.417883875||129|061:000:255 +758009.7501495|112019.898883875||133|087:000:255 +754002.7501495|200902.234883875||147|176:000:255 +704771.7501495|183364.484883875||191|255:000:052 +399187.0631495|220018.859883875||35|031:255:000 +685098.9371495|33282.089883875||19|134:255:000 +577750.8131495|257153.109883875||1|249:255:000 +794095.5621495|199742.671883875||13|172:255:000 +634688.2501495|100629.616883875||17|147:255:000 +287638.7811495|207582.624883875||21|121:255:000 +366218.5321495|222940.625883875||23|108:255:000 +385212.4371495|236593.109883875||27|083:255:000 +628137.4371495|63995.550883875||47|000:255:046 +782600.5631495|152698.890883875||49|000:255:058 +502813.9381495|235232.577883875||57|000:255:110 +705922.6251495|136589.359883875||61|000:255:135 +620397.8131495|246847.640883875||63|000:255:148 +738465.3751495|237233.983883875||65|000:255:161 +708944.7501495|247632.296883875||127|048:000:255 +526666.6871495|249780.312883875||81|000:247:255 +733439.3741495|298005.311883875||83|000:234:255 +253886.0321495|204702.171883875||87|000:208:255 +298337.5621495|178131.233883875||89|000:195:255 +788989.3121495|284544.562883875||91|000:182:255 +438378.3431495|227157.890883875||97|000:144:255 +227406.0621495|190462.640883875||99|000:131:255 +668782.8121495|195518.718883875||101|000:118:255 +596325.2501495|190688.374883875||105|000:093:255 +777034.8131495|229280.030883875||117|000:016:255 +337714.9681495|219991.202883875||111|000:054:255 +442913.7181495|164364.608883875||119|000:003:255 +528779.3741495|179793.890883875||123|023:000:255 +571926.0621495|162885.202883875||125|035:000:255 +801852.0621495|154744.077883875||137|112:000:255 +611371.9381495|295204.467883875||145|164:000:255 +534602.9371495|213605.812883875||151|202:000:255 +608960.3121495|102612.546883875||155|228:000:255 +541667.1251495|293002.124883875||157|240:000:255 +475819.8131495|210685.359883875||159|253:000:255 +343685.3441495|182222.358883875||161|255:000:244 +670160.3121495|140070.249883875||163|255:000:231 +497214.4691495|177053.639883875||167|255:000:206 +455564.7811495|293568.937883875||171|255:000:180 +636209.2501495|210858.014883875||183|255:000:103 +413565.1871495|267534.562883875||193|255:000:039 +709485.0001495|220209.202883875||195|255:000:026 +815182.1881495|110335.429883875||31|057:255:000 +495151.3131495|258002.374883875||67|000:255:174 +859129.4371495|288849.968883875||139|125:000:255 +545200.0621495|127391.304883875||153|215:000:255 +655627.6871495|285597.342883875||181|255:000:116 +382174.7811495|171687.280883875||45|000:255:033 +511235.1561495|135372.358883875||7|211:255:000 +332533.5941495|242831.139883875||121|010:000:255 +""" + refrence_cache="""145096.8591495|154534.264883875||39 +616341.4371495|146049.750883875||51 +410595.7191495|174301.828883875||71 +734153.6871495|169168.437883875||107 +706338.2501495|54889.417883875||129 +758009.7501495|112019.898883875||133 +754002.7501495|200902.234883875||147 +704771.7501495|183364.484883875||191 +399187.0631495|220018.859883875||35 +685098.9371495|33282.089883875||19 +577750.8131495|257153.109883875||1 +794095.5621495|199742.671883875||13 +634688.2501495|100629.616883875||17 +287638.7811495|207582.624883875||21 +366218.5321495|222940.625883875||23 +385212.4371495|236593.109883875||27 +628137.4371495|63995.550883875||47 +782600.5631495|152698.890883875||49 +502813.9381495|235232.577883875||57 +705922.6251495|136589.359883875||61 +620397.8131495|246847.640883875||63 +738465.3751495|237233.983883875||65 +708944.7501495|247632.296883875||127 +526666.6871495|249780.312883875||81 +733439.3741495|298005.311883875||83 +253886.0321495|204702.171883875||87 +298337.5621495|178131.233883875||89 +788989.3121495|284544.562883875||91 +438378.3431495|227157.890883875||97 +227406.0621495|190462.640883875||99 +668782.8121495|195518.718883875||101 +596325.2501495|190688.374883875||105 +777034.8131495|229280.030883875||117 +337714.9681495|219991.202883875||111 +442913.7181495|164364.608883875||119 +528779.3741495|179793.890883875||123 +571926.0621495|162885.202883875||125 +801852.0621495|154744.077883875||137 +611371.9381495|295204.467883875||145 +534602.9371495|213605.812883875||151 +608960.3121495|102612.546883875||155 +541667.1251495|293002.124883875||157 +475819.8131495|210685.359883875||159 +343685.3441495|182222.358883875||161 +670160.3121495|140070.249883875||163 +497214.4691495|177053.639883875||167 +455564.7811495|293568.937883875||171 +636209.2501495|210858.014883875||183 +413565.1871495|267534.562883875||193 +709485.0001495|220209.202883875||195 +815182.1881495|110335.429883875||31 +495151.3131495|258002.374883875||67 +859129.4371495|288849.968883875||139 +545200.0621495|127391.304883875||153 +655627.6871495|285597.342883875||181 +382174.7811495|171687.280883875||45 +511235.1561495|135372.358883875||7 +332533.5941495|242831.139883875||121 +""" + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + cls.runModule('g.region', raster=cls.map1, flags='p') + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + if os.path.isfile('result.csv'): + os.remove('result.csv') + + def test_raster_what_points(self): + """Testing r.what runs successfully with input coordinates given as a vector points map""" + module = SimpleModule('r.what', map=self.map1, points=self.points) + module.run() + self.assertLooksLike(actual=str(module.outputs.stdout), reference=self.refrence_points, + msg="test_raster_what_points did't run successfully") + + def test_raster_what_coordinates(self): + """Testing r.what runs successfully with input coordinates given as an option and with multiple maps""" + module = SimpleModule('r.what', map=self.map2, coordinates=self.coordinates) + module.run() + self.assertLooksLike(actual=str(module.outputs.stdout), reference=self.refrence_coordinates, + msg="test_raster_what_coordinates did't run successfully") + + + def test_raster_what_cats(self): + """Testing r.what runs successfully with input coordinates given as a vector points map with cats and flag v""" + module = SimpleModule('r.what', map=self.map1, points=self.points, flags='v') + module.run() + self.assertLooksLike(actual=str(module.outputs.stdout), reference=self.refrence_cats, + msg="test_raster_what_cats did't run successfully") + + def test_raster_what_csv(self): + """Testing r.what runs successfully with input coordinates given as a vector points map, output into CSV file and flag n""" + self.assertModule('r.what', map=self.map1, points=self.points, separator='comma', output='result.csv', flags='n') + self.assertFileExists(filename='result.csv', msg="CSV file was not created") + if os.path.isfile('result.csv'): + file = open("result.csv", "r") + fileData = file.read() + self.assertLooksLike(actual=fileData, reference=self.refrence_csv, + msg="test_raster_what_csv did't run successfully") + file.close() + + def test_raster_what_points_flag_i(self): + """Testing r.what runs successfully with flag i""" + module = SimpleModule('r.what', map=self.map1, points=self.points, flags='i') + module.run() + self.assertLooksLike(actual=str(module.outputs.stdout), reference=self.refrence_flag_i, + msg="test_raster_what_cats did't run successfully") + + + def test_raster_what_points_flag_f(self): + """Testing r.what runs successfully with flag f""" + module = SimpleModule('r.what', map=self.map1, points=self.points, flags='f') + module.run() + self.assertLooksLike(actual=str(module.outputs.stdout), reference=self.refrence_flag_f, + msg="test_raster_what_cats did't run successfully") + + def test_raster_what_points_flag_r(self): + """Testing r.what runs successfully with flag r""" + module = SimpleModule('r.what', map=self.map1, points=self.points, flags='r') + module.run() + self.assertLooksLike(actual=str(module.outputs.stdout), reference=self.refrence_flag_r, + msg="test_raster_what_cats did't run successfully") + + def test_raster_what_cache(self): + """Testing r.what runs successfully with cache""" + module = SimpleModule('r.what', map=self.map1, points=self.points, flags='c', cache=500) + module.run() + self.assertLooksLike(actual=str(module.outputs.stdout), reference=self.refrence_cache, + msg="test_raster_what_cats did't run successfully") + + +if __name__ == '__main__': + from grass.gunittest.main import test + test() diff -Nru grass-7.6.1/raster/r.what/testsuite/testrw.py grass-7.8.0/raster/r.what/testsuite/testrw.py --- grass-7.6.1/raster/r.what/testsuite/testrw.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/raster/r.what/testsuite/testrw.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,94 @@ +""" +Name: r.what test +Purpose: Tests r.what and its flags/options. + +Author: Sunveer Singh, Google Code-in 2018 +Copyright: (C) 2018 by Sunveer Singh and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +class Testrr(TestCase): + input='elevation' + coordinates=(633614.08,224125.12,632972.36,225382.87) + points='comm_colleges' + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + cls.runModule('g.region', raster=cls.input, flags='p') + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + + + def test_flag_n(self): + """Testing output with flag n""" + string="""1|145096.8591495|154534.264883875||* + 2|616341.4371495|146049.750883875||* + 3|410595.7191495|174301.828883875||* + 4|734153.6871495|169168.437883875||* + """ + r_what = SimpleModule('r.what', map=self.input, coordinates=self.coordinates, flags='n') + r_what.outputs.stdout= string + self.assertLooksLike(reference=string, actual=r_what.outputs.stdout) + + def test_flag_f(self): + """Testing output with flag f""" + string="""5|706338.2501495|54889.417883875||* + 6|758009.7501495|112019.898883875||* + 7|754002.7501495|200902.234883875||* + 8|704771.7501495|183364.484883875||*""" + r_what = SimpleModule('r.what', map=self.input, coordinates=self.coordinates, flags='f') + r_what.outputs.stdout= string + self.assertLooksLike(reference=string, actual=r_what.outputs.stdout) + + def test_flag_r(self): + """Testing output with flag r""" + string="""9|399187.0631495|220018.859883875||* + 10|685098.9371495|33282.089883875||* + 11|577750.8131495|257153.109883875||* + 12|794095.5621495|199742.671883875||*""" + r_what = SimpleModule('r.what', map=self.input, coordinates=self.coordinates, flags='r') + r_what.outputs.stdout= string + self.assertLooksLike(reference=string, actual=r_what.outputs.stdout) + + def test_flag_i(self): + """Testing output with flag i""" + string="""13|634688.2501495|100629.616883875||* + 14|287638.7811495|207582.624883875||* + 15|366218.5321495|222940.625883875||* + 16|385212.4371495|236593.109883875||*""" + r_what = SimpleModule('r.what', map=self.input, coordinates=self.coordinates, flags='i') + r_what.outputs.stdout= string + self.assertLooksLike(reference=string, actual=r_what.outputs.stdout) + + def test_flag_c(self): + """Testing output with flag c""" + string="""17|628137.4371495|63995.550883875||* + 18|782600.5631495|152698.890883875||* + 19|502813.9381495|235232.577883875||* + 20|705922.6251495|136589.359883875||*""" + r_what = SimpleModule('r.what', map=self.input, coordinates=self.coordinates, flags='c') + r_what.outputs.stdout= string + self.assertLooksLike(reference=string, actual=r_what.outputs.stdout) + + def test_flag_v(self): + """Testing output with flag v""" + string="""21|620397.8131495|246847.640883875||* + 22|738465.3751495|237233.983883875||* + 23|708944.7501495|247632.296883875||* + 24|526666.6871495|249780.312883875||*""" + r_what = SimpleModule('r.what', map=self.input, coordinates=self.coordinates, flags='v', points=self.points) + r_what.outputs.stdout= string + self.assertLooksLike(reference=string, actual=r_what.outputs.stdout) + + +if __name__ == '__main__': + from grass.gunittest.main import test + test() diff -Nru grass-7.6.1/raster/r.what.color/r.what.color.html grass-7.8.0/raster/r.what.color/r.what.color.html --- grass-7.6.1/raster/r.what.color/r.what.color.html 2019-03-19 20:03:26.000000000 +0000 +++ grass-7.8.0/raster/r.what.color/r.what.color.html 2019-05-18 15:50:05.000000000 +0000 @@ -67,4 +67,4 @@

AUTHOR

Glynn Clements -

Last changed: $Date: 2018-06-12 02:46:28 +0200 (Tue, 12 Jun 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.cross.rast/r3.cross.rast.html grass-7.8.0/raster3d/r3.cross.rast/r3.cross.rast.html --- grass-7.6.1/raster3d/r3.cross.rast/r3.cross.rast.html 2019-03-19 19:58:41.000000000 +0000 +++ grass-7.8.0/raster3d/r3.cross.rast/r3.cross.rast.html 2019-05-18 15:50:05.000000000 +0000 @@ -68,4 +68,4 @@

AUTHOR

Sören Gebbert -

Last changed: $Date: 2013-03-26 21:28:19 +0100 (Tue, 26 Mar 2013) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.flow/r3.flow.html grass-7.8.0/raster3d/r3.flow/r3.flow.html --- grass-7.6.1/raster3d/r3.flow/r3.flow.html 2019-03-19 19:58:43.000000000 +0000 +++ grass-7.8.0/raster3d/r3.flow/r3.flow.html 2019-05-18 15:50:05.000000000 +0000 @@ -97,4 +97,4 @@ Anna Petrasova, NCSU OSGeoREL, developed during GSoC 2014.

-Last changed: $Date: 2016-07-07 19:18:24 +0200 (Thu, 07 Jul 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.flow/test.r3flow.html grass-7.8.0/raster3d/r3.flow/test.r3flow.html --- grass-7.6.1/raster3d/r3.flow/test.r3flow.html 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/raster3d/r3.flow/test.r3flow.html 2019-05-18 15:50:05.000000000 +0000 @@ -11,4 +11,4 @@ Anna Petrasova -

Last changed: $Date: 2018-06-12 02:49:22 +0200 (Tue, 12 Jun 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.gradient/r3.gradient.html grass-7.8.0/raster3d/r3.gradient/r3.gradient.html --- grass-7.6.1/raster3d/r3.gradient/r3.gradient.html 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.gradient/r3.gradient.html 2019-05-18 15:50:05.000000000 +0000 @@ -28,4 +28,4 @@ developed during GSoC 2014.

-Last changed: $Date: 2014-11-27 00:20:52 +0100 (Thu, 27 Nov 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.gwflow/r3.gwflow.html grass-7.8.0/raster3d/r3.gwflow/r3.gwflow.html --- grass-7.6.1/raster3d/r3.gwflow/r3.gwflow.html 2019-03-19 19:58:42.000000000 +0000 +++ grass-7.8.0/raster3d/r3.gwflow/r3.gwflow.html 2019-05-18 15:50:05.000000000 +0000 @@ -137,4 +137,4 @@ here at Technical University Berlin, Germany. -

Last changed: $Date: 2018-12-26 13:09:47 +0100 (Wed, 26 Dec 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.in.ascii/r3.in.ascii.html grass-7.8.0/raster3d/r3.in.ascii/r3.in.ascii.html --- grass-7.6.1/raster3d/r3.in.ascii/r3.in.ascii.html 2019-03-19 19:58:39.000000000 +0000 +++ grass-7.8.0/raster3d/r3.in.ascii/r3.in.ascii.html 2019-05-18 15:50:05.000000000 +0000 @@ -106,4 +106,4 @@ g.region -

Last changed: $Date: 2016-01-29 10:29:57 +0100 (Fri, 29 Jan 2016) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.in.bin/r3.in.bin.html grass-7.8.0/raster3d/r3.in.bin/r3.in.bin.html --- grass-7.6.1/raster3d/r3.in.bin/r3.in.bin.html 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/raster3d/r3.in.bin/r3.in.bin.html 2019-05-18 15:50:05.000000000 +0000 @@ -52,4 +52,4 @@ Soren Gebbert, based on r.in.bin from Jacques Bouchard and Bob Covill -

Last changed: $Date: 2018-06-12 02:46:28 +0200 (Tue, 12 Jun 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.info/r3.info.html grass-7.8.0/raster3d/r3.info/r3.info.html --- grass-7.6.1/raster3d/r3.info/r3.info.html 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.info/r3.info.html 2019-05-18 15:50:05.000000000 +0000 @@ -13,4 +13,4 @@ Helena Mitasova, Bill Brown, Lubos Mitas, Jaro Hofierka -

Last changed: $Date: 2011-09-13 22:15:31 +0200 (Tue, 13 Sep 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.in.lidar/r3.in.lidar.html grass-7.8.0/raster3d/r3.in.lidar/r3.in.lidar.html --- grass-7.6.1/raster3d/r3.in.lidar/r3.in.lidar.html 2019-03-19 19:58:41.000000000 +0000 +++ grass-7.8.0/raster3d/r3.in.lidar/r3.in.lidar.html 2019-05-18 15:50:05.000000000 +0000 @@ -208,4 +208,4 @@ Vaclav Petras, NCSU GeoForAll Lab -

Last changed: $Date: 2017-11-25 23:04:19 +0100 (Sat, 25 Nov 2017) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.in.v5d/r3.in.v5d.html grass-7.8.0/raster3d/r3.in.v5d/r3.in.v5d.html --- grass-7.6.1/raster3d/r3.in.v5d/r3.in.v5d.html 2019-03-19 19:58:42.000000000 +0000 +++ grass-7.8.0/raster3d/r3.in.v5d/r3.in.v5d.html 2019-05-18 15:50:05.000000000 +0000 @@ -21,4 +21,4 @@

AUTHOR

Jaro Hofierka, GeoModel s.r.o., Slovakia -

Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.mask/r3.mask.html grass-7.8.0/raster3d/r3.mask/r3.mask.html --- grass-7.6.1/raster3d/r3.mask/r3.mask.html 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.mask/r3.mask.html 2019-05-18 15:50:05.000000000 +0000 @@ -17,4 +17,4 @@ Helena Mitasova, Bill Brown, Lubos Mitas, Jaro Hofierka -

Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.mkdspf/r3.mkdspf.html grass-7.8.0/raster3d/r3.mkdspf/r3.mkdspf.html --- grass-7.6.1/raster3d/r3.mkdspf/r3.mkdspf.html 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.mkdspf/r3.mkdspf.html 2019-05-18 15:50:05.000000000 +0000 @@ -65,4 +65,4 @@ bbrown@gis.uiuc.edu -

Last changed: $Date: 2014-12-12 00:12:46 +0100 (Fri, 12 Dec 2014) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.neighbors/r3.neighbors.html grass-7.8.0/raster3d/r3.neighbors/r3.neighbors.html --- grass-7.6.1/raster3d/r3.neighbors/r3.neighbors.html 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/raster3d/r3.neighbors/r3.neighbors.html 2019-05-18 15:50:05.000000000 +0000 @@ -113,4 +113,4 @@ Soeren Gebbert

-Last changed: $Date: 2013-07-01 09:35:50 +0200 (Mon, 01 Jul 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.null/r3.null.html grass-7.8.0/raster3d/r3.null/r3.null.html --- grass-7.6.1/raster3d/r3.null/r3.null.html 2019-03-19 19:58:43.000000000 +0000 +++ grass-7.8.0/raster3d/r3.null/r3.null.html 2019-05-18 15:50:05.000000000 +0000 @@ -13,4 +13,4 @@ Helena Mitasova, Bill Brown, Lubos Mitas, Jaro Hofierka -

Last changed: $Date: 2011-09-13 22:15:31 +0200 (Tue, 13 Sep 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.out.ascii/main.c grass-7.8.0/raster3d/r3.out.ascii/main.c --- grass-7.6.1/raster3d/r3.out.ascii/main.c 2019-03-19 19:58:41.000000000 +0000 +++ grass-7.8.0/raster3d/r3.out.ascii/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -301,6 +301,7 @@ module = G_define_module(); G_add_keyword(_("raster3d")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword(_("voxel")); G_add_keyword(_("conversion")); G_add_keyword("ASCII"); diff -Nru grass-7.6.1/raster3d/r3.out.ascii/r3.out.ascii.html grass-7.8.0/raster3d/r3.out.ascii/r3.out.ascii.html --- grass-7.6.1/raster3d/r3.out.ascii/r3.out.ascii.html 2019-03-19 19:58:41.000000000 +0000 +++ grass-7.8.0/raster3d/r3.out.ascii/r3.out.ascii.html 2019-05-18 15:50:05.000000000 +0000 @@ -192,4 +192,4 @@ Roman Waupotitsch, Michael Shapiro, Helena Mitasova, Bill Brown, Lubos Mitas, Jaro Hofierka, Sören Gebbert -

Last changed: $Date: 2015-01-21 04:31:26 +0100 (Wed, 21 Jan 2015) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.out.bin/r3.out.bin.html grass-7.8.0/raster3d/r3.out.bin/r3.out.bin.html --- grass-7.6.1/raster3d/r3.out.bin/r3.out.bin.html 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/raster3d/r3.out.bin/r3.out.bin.html 2019-05-18 15:50:05.000000000 +0000 @@ -34,4 +34,4 @@

AUTHOR

Sören Gebbert, based on r.out.bin from Bob Covill and Glynn Clements -

Last changed: $Date: 2018-06-12 02:46:28 +0200 (Tue, 12 Jun 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.out.netcdf/main.c grass-7.8.0/raster3d/r3.out.netcdf/main.c --- grass-7.6.1/raster3d/r3.out.netcdf/main.c 2019-03-19 19:58:43.000000000 +0000 +++ grass-7.8.0/raster3d/r3.out.netcdf/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -586,6 +586,7 @@ module = G_define_module(); G_add_keyword(_("raster3d")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword(_("netCDF")); G_add_keyword(_("voxel")); module->description = _("Export a 3D raster map as netCDF file."); diff -Nru grass-7.6.1/raster3d/r3.out.netcdf/r3.out.netcdf.html grass-7.8.0/raster3d/r3.out.netcdf/r3.out.netcdf.html --- grass-7.6.1/raster3d/r3.out.netcdf/r3.out.netcdf.html 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/raster3d/r3.out.netcdf/r3.out.netcdf.html 2019-05-18 15:50:05.000000000 +0000 @@ -262,4 +262,4 @@

AUTHORS

Sören Gebbert -

Last changed: $Date: 2012-06-14 11:20:10 +0200 (Thu, 14 Jun 2012) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.out.v5d/main.c grass-7.8.0/raster3d/r3.out.v5d/main.c --- grass-7.6.1/raster3d/r3.out.v5d/main.c 2019-03-19 19:58:42.000000000 +0000 +++ grass-7.8.0/raster3d/r3.out.v5d/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -283,6 +283,7 @@ module = G_define_module(); G_add_keyword(_("raster3d")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword(_("voxel")); module->description = _("Exports GRASS 3D raster map to 3-dimensional Vis5D file."); diff -Nru grass-7.6.1/raster3d/r3.out.v5d/r3.out.v5d.html grass-7.8.0/raster3d/r3.out.v5d/r3.out.v5d.html --- grass-7.6.1/raster3d/r3.out.v5d/r3.out.v5d.html 2019-03-19 19:58:42.000000000 +0000 +++ grass-7.8.0/raster3d/r3.out.v5d/r3.out.v5d.html 2019-05-18 15:50:05.000000000 +0000 @@ -23,4 +23,4 @@

AUTHOR

Jaro Hofierka, GeoModel s.r.o., Slovakia -

Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.out.vtk/main.c grass-7.8.0/raster3d/r3.out.vtk/main.c --- grass-7.6.1/raster3d/r3.out.vtk/main.c 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/raster3d/r3.out.vtk/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -375,6 +375,7 @@ module = G_define_module(); G_add_keyword(_("raster3d")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword(_("voxel")); G_add_keyword("VTK"); module->description = diff -Nru grass-7.6.1/raster3d/r3.out.vtk/r3.out.vtk.html grass-7.8.0/raster3d/r3.out.vtk/r3.out.vtk.html --- grass-7.6.1/raster3d/r3.out.vtk/r3.out.vtk.html 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/raster3d/r3.out.vtk/r3.out.vtk.html 2019-05-18 15:50:05.000000000 +0000 @@ -173,4 +173,4 @@

AUTHOR

Sören Gebbert -

Last changed: $Date: 2018-11-22 07:39:19 +0100 (Thu, 22 Nov 2018) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.retile/r3.retile.html grass-7.8.0/raster3d/r3.retile/r3.retile.html --- grass-7.6.1/raster3d/r3.retile/r3.retile.html 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.retile/r3.retile.html 2019-05-18 15:50:05.000000000 +0000 @@ -17,4 +17,4 @@

AUTHOR

Sören Gebbert -

Last changed: $Date: 2013-03-27 22:42:23 +0100 (Wed, 27 Mar 2013) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.showdspf/r3.showdspf.html grass-7.8.0/raster3d/r3.showdspf/r3.showdspf.html --- grass-7.6.1/raster3d/r3.showdspf/r3.showdspf.html 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.showdspf/r3.showdspf.html 2019-05-18 15:50:05.000000000 +0000 @@ -145,4 +145,4 @@ brown@gis.uiuc.edu -

Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.stats/r3.stats.html grass-7.8.0/raster3d/r3.stats/r3.stats.html --- grass-7.6.1/raster3d/r3.stats/r3.stats.html 2019-03-19 19:58:41.000000000 +0000 +++ grass-7.8.0/raster3d/r3.stats/r3.stats.html 2019-05-18 15:50:05.000000000 +0000 @@ -98,4 +98,4 @@

AUTHOR

Sören Gebbert -

Last changed: $Date: 2013-02-07 10:56:17 +0100 (Thu, 07 Feb 2013) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.support/r3.support.html grass-7.8.0/raster3d/r3.support/r3.support.html --- grass-7.6.1/raster3d/r3.support/r3.support.html 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/raster3d/r3.support/r3.support.html 2019-05-18 15:50:05.000000000 +0000 @@ -22,5 +22,5 @@ Based on r.support written by Micharl Shapiro, CERL and others -

Last changed: $Date: 2012-03-17 11:57:36 +0100 (Sat, 17 Mar 2012) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.timestamp/r3.timestamp.html grass-7.8.0/raster3d/r3.timestamp/r3.timestamp.html --- grass-7.6.1/raster3d/r3.timestamp/r3.timestamp.html 2019-03-19 19:58:42.000000000 +0000 +++ grass-7.8.0/raster3d/r3.timestamp/r3.timestamp.html 2019-05-18 15:50:05.000000000 +0000 @@ -70,4 +70,4 @@ based on r.timestamp by Michael Shapiro,
U.S. Army Construction Engineering Research Laboratory -

Last changed: $Date: 2016-08-22 15:22:27 +0200 (Mon, 22 Aug 2016) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.to.rast/r3.to.rast.html grass-7.8.0/raster3d/r3.to.rast/r3.to.rast.html --- grass-7.6.1/raster3d/r3.to.rast/r3.to.rast.html 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.to.rast/r3.to.rast.html 2019-05-18 15:50:05.000000000 +0000 @@ -73,4 +73,4 @@ Sören Gebbert Vaclav Petras, NCSU GeoForAll Lab -

Last changed: $Date: 2016-12-26 23:22:38 +0100 (Mon, 26 Dec 2016) $ +

Last changed: $Date$ diff -Nru grass-7.6.1/raster3d/r3.to.rast/testsuite/test_a_b_coeff.py grass-7.8.0/raster3d/r3.to.rast/testsuite/test_a_b_coeff.py --- grass-7.6.1/raster3d/r3.to.rast/testsuite/test_a_b_coeff.py 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.to.rast/testsuite/test_a_b_coeff.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/raster3d/r3.to.rast/testsuite/test_integer_rounding.py grass-7.8.0/raster3d/r3.to.rast/testsuite/test_integer_rounding.py --- grass-7.6.1/raster3d/r3.to.rast/testsuite/test_integer_rounding.py 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.to.rast/testsuite/test_integer_rounding.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/raster3d/r3.to.rast/testsuite/test_nulls.py grass-7.8.0/raster3d/r3.to.rast/testsuite/test_nulls.py --- grass-7.6.1/raster3d/r3.to.rast/testsuite/test_nulls.py 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.to.rast/testsuite/test_nulls.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/raster3d/r3.to.rast/testsuite/test_small_data.py grass-7.8.0/raster3d/r3.to.rast/testsuite/test_small_data.py --- grass-7.6.1/raster3d/r3.to.rast/testsuite/test_small_data.py 2019-03-19 19:58:38.000000000 +0000 +++ grass-7.8.0/raster3d/r3.to.rast/testsuite/test_small_data.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/README grass-7.8.0/README --- grass-7.6.1/README 2019-03-19 20:04:47.000000000 +0000 +++ grass-7.8.0/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -GRASS GIS Development Subversion repository - -########################################################## -How to get write access here? - -Write access is only granted to developers who agree to abide by -RFC2 - Legal aspects of code contributions - http://trac.osgeo.org/grass/wiki/RFC/2_LegalAspectsOfCodeContributions -and the code submission guidelines - http://trac.osgeo.org/grass/wiki/Submitting - -This needs to be communicated to a GRASS developer. S/he will -then possibly propose you to the GRASS Project Steering committee -after a period of evaluation. For details, see - http://trac.osgeo.org/grass/wiki/RFC - -Once write access is granted, you, the new developer need to -obtain an "osgeo_id" at http://www.osgeo.org/osgeo_userid -If you already have an "osgeo_id" but forgot it, search for it at -Search at http://www.osgeo.org/cgi-bin/ldap_web_search.py - -########################################################## -How to compile GRASS: - See INSTALL file. - -Yes, you should really read INSTALL. - -########################################################################## -How to generate the 'Programmer's Manual': - -This needs doxygen (http://www.doxygen.org) and optionally -Graphviz dot (http://www.research.att.com/sw/tools/graphviz/). - -To build the GRASS programmer's documentation, run - make htmldocs -or to generate documentation as single html file (recommended for simple reading) - make htmldocs-single -here. This takes quite some time. The result is in lib/html/index.html -which refers to further document repositories in - lib/vector/html/index.html - lib/db/html/index.html - lib/gis/html/index.html - -The master file is: ./grasslib.dox where all sub-documents have to -be linked into. - -To generate the documents in PDF format, run - make pdfdocs - -An online version is available at: -https://grass.osgeo.org/programming7/ - -## Docker - -Build using the downloaded source code (in the directory with the -source code): - - docker build -t grassgis76 . - -A test run (assuming you have existing GRASS GIS location; it can be downloaded from -https://grass.osgeo.org/sampledata/north_carolina/nc_basic_spm_grass7.zip) - - # case 1: launching in the grassdata directory in which the location is stored: - docker run -it --rm --user=$(id -u):$(id -g) --volume $(pwd):/data --env HOME=/data/ grassgis76 \ - grass --text nc_spm_08_grass7/user1 --exec g.region -p - - # case 2: launching anywhere - docker run -it --rm --user=$(id -u):$(id -g) --volume /your/test/grassdata/:/data --env HOME=/data/ grassgis76 \ - grass /data/nc_basic_spm/PERMANENT --exec g.region -p - -Note that the first `grassgis76` is the name of the image while the second -`grass` is the name of the executable. - -To run the tests (again assuming local location): - - docker run -it --rm --user=$(id -u):$(id -g) --volume /your/test/grassdata/:/data --env HOME=/data/ -w /code/grass \ - grassgis76 grass /data/nc_basic_spm/PERMANENT --exec \ - python -m grass.gunittest.main \ - --location nc_basic_spm --location-type nc - -Note: If you compiled locally before building the Docker image, you may -encounter problems as the local configuration and locally compiled file -are copied to and used in the Docker image. To make sure you don't have -this issue, clean all the compiled files from the source code: - - make distclean diff -Nru grass-7.6.1/README.md grass-7.8.0/README.md --- grass-7.6.1/README.md 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/README.md 2019-08-04 10:21:41.000000000 +0000 @@ -0,0 +1,101 @@ +[![Build Status](https://travis-ci.com/OSGeo/grass.svg?branch=master)](https://travis-ci.com/OSGeo/grass) + +GRASS GIS Repository +==================== + +GRASS GIS ([https://grass.osgeo.org/](https://grass.osgeo.org/)) is a Geographic Information System +used for geospatial data management and analysis, image processing, graphics/map production, +spatial modeling, and visualization. + + +How to get write access here? +----------------------------- + +In general: you don't really need write access as you can simply open a +[pull request](https://github.com/OSGeo/grass/pulls) to contribute to GRASS GIS. + +Want to become a core developer? See +[Procedure for gaining Git write access](https://trac.osgeo.org/grass/wiki/HowToContribute#WriteaccesstotheGRASScorerepository) + +How to compile GRASS? +--------------------- + +> See INSTALL file. + +Yes, you should really read INSTALL. + +How to generate the 'Programmer's Manual'? +------------------------------------------ + +This needs doxygen (http://www.doxygen.org) and optionally +Graphviz dot (http://www.research.att.com/sw/tools/graphviz/). + +To build the GRASS programmer's documentation, run +``` +make htmldocs +``` +or to generate documentation as single html file (recommended for simple reading) +``` +make htmldocs-single +``` +here. This takes quite some time. The result is in `lib/html/index.html` +which refers to further document repositories in +``` + lib/vector/html/index.html + lib/db/html/index.html + lib/gis/html/index.html +``` + +The master file is: `./grasslib.dox` where all sub-documents have to +be linked into. + +To generate the documents in PDF format, run + +``` +make pdfdocs +``` + +An online version is available [here](https://grass.osgeo.org/programming7/) + +## Docker + +Build using the downloaded source code (in the directory with the +source code): + +``` + docker build -t grassgis78 . +``` + +A test run (assuming you have existing GRASS GIS location; it can be downloaded from +[here](https://grass.osgeo.org/sampledata/north_carolina/nc_basic_spm_grass7.zip)) + +``` +# case 1: launching in the grassdata directory in which the location is stored: +docker run -it --rm --user=$(id -u):$(id -g) --volume $(pwd):/data --env HOME=/data/ grassgis78 \ + grass --text nc_spm_08_grass7/user1 --exec g.region -p + +# case 2: launching anywhere +docker run -it --rm --user=$(id -u):$(id -g) --volume /your/test/grassdata/:/data --env HOME=/data/ grassgis78 \ + grass /data/nc_basic_spm/PERMANENT --exec g.region -p +``` + +Note that the first `grassgis78` is the name of the image while the second +`grass` is the name of the executable. + +To run the tests (again assuming local location): + +``` + docker run -it --rm --user=$(id -u):$(id -g) --volume /your/test/grassdata/:/data --env HOME=/data/ -w /code/grass \ + grassgis78 grass /data/nc_basic_spm/PERMANENT --exec \ + python -m grass.gunittest.main \ + --location nc_basic_spm --location-type nc +``` + +Note: If you compiled locally before building the Docker image, you may +encounter problems as the local configuration and locally compiled file +are copied to and used in the Docker image. To make sure you don't have +this issue, clean all the compiled files from the source code: + +``` +make distclean +``` diff -Nru grass-7.6.1/REQUIREMENTS.html grass-7.8.0/REQUIREMENTS.html --- grass-7.6.1/REQUIREMENTS.html 2019-03-19 19:58:37.000000000 +0000 +++ grass-7.8.0/REQUIREMENTS.html 2019-09-06 20:46:18.000000000 +0000 @@ -62,7 +62,7 @@ -

Optional requirements:

+

Optional packages:

Note: also the respective development packages (commonly named xxx-dev or xxx-devel) need to be installed. @@ -73,6 +73,14 @@ gcc: http://www.gnu.org/software/gcc/gcc.html +
  • bzip2, needed for raster compression with bzip2
    +http://www.bzip.org +
  • + +
  • zstd (Zstandard), needed for raster compression with zstd
    +https://facebook.github.io/zstd +
  • +
  • FFTW 2.x or 3.x (library for computing the Discrete Fourier Transform), required for i.fft and i.ifft and other modules
    http://www.fftw.org @@ -165,6 +173,10 @@ http://matplotlib.org/
  • +
  • Python six Library ("python-six", needed for Python API)
    +https://github.com/benjaminp/six +
  • +
  • Python wxPython backend for python-matplotlib ("python-matplotlib-wx", needed for e.g. g.gui.timeline)
    http://matplotlib.org/
  • @@ -173,6 +185,10 @@ https://pypi.python.org/pypi/termcolor +
  • six (needed for cross-version Python compatibility)
    +https://pypi.python.org/pypi/six +
  • +
  • FFMPEG or alternative (for wxGUI Animation tool - g.gui.module), specifically ffmpeg tool
    http://ffmpeg.org @@ -191,10 +207,12 @@ http://avce00.maptools.org
  • -
  • Subversion (svn for g.extension)
    -https://subversion.apache.org/
    +
  • git (git for g.extension)
    +https://git-scm.com/
  • - + +
  • Subversion (svn in g.extension to fetch code selectively from grass-addons on GitHub)
    +https://subversion.apache.org/
    @@ -221,6 +239,6 @@
    https://grass.osgeo.org/development/bug-tracking/

    -Last changed: $Date: 2019-03-07 00:21:50 +0100 (Thu, 07 Mar 2019) $ +Last changed: $Date$ diff -Nru grass-7.6.1/rpm/grass.spec grass-7.8.0/rpm/grass.spec --- grass-7.6.1/rpm/grass.spec 2019-03-19 20:04:49.000000000 +0000 +++ grass-7.8.0/rpm/grass.spec 2019-08-11 09:05:20.000000000 +0000 @@ -2,12 +2,12 @@ # https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 %global _python_bytecompile_extra 1 -%global shortver 76 +%global shortver 78 %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) Name: grass -Version: 7.6.0 -Release: 2%{?dist} +Version: 7.8.0 +Release: 1%{?dist} Summary: GRASS GIS - Geographic Resources Analysis Support System %if 0%{?rhel} diff -Nru grass-7.6.1/scripts/db.dropcolumn/db.dropcolumn.html grass-7.8.0/scripts/db.dropcolumn/db.dropcolumn.html --- grass-7.6.1/scripts/db.dropcolumn/db.dropcolumn.html 2019-03-19 20:04:36.000000000 +0000 +++ grass-7.8.0/scripts/db.dropcolumn/db.dropcolumn.html 2019-05-18 15:50:05.000000000 +0000 @@ -41,4 +41,4 @@ Markus Neteler -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/db.dropcolumn/db.dropcolumn.py grass-7.8.0/scripts/db.dropcolumn/db.dropcolumn.py --- grass-7.6.1/scripts/db.dropcolumn/db.dropcolumn.py 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/db.dropcolumn/db.dropcolumn.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -41,11 +41,6 @@ from grass.exceptions import CalledModuleError import grass.script as gscript -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): table = options['table'] diff -Nru grass-7.6.1/scripts/db.dropcolumn/testsuite/test_db_dropcolumn.py grass-7.8.0/scripts/db.dropcolumn/testsuite/test_db_dropcolumn.py --- grass-7.6.1/scripts/db.dropcolumn/testsuite/test_db_dropcolumn.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/db.dropcolumn/testsuite/test_db_dropcolumn.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,54 @@ +""" +Created on Sun Jun 07 19:08:34 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command +from grass.script.utils import decode + + +class TestDbDropColumn(TestCase): + """Test db.dropcolumn script""" + + mapName = 'myroads' + colName = 'SHAPE_LEN' + + @classmethod + def setUpClass(cls): + """Copy vector.""" + run_command('g.copy', vector='roadsmajor,myroads') + + @classmethod + def tearDownClass(cls): + """Remove copied vector""" + run_command('g.remove', type='vector', name=cls.mapName, + flags='f') + + def test_drop_column_check(self): + """Drop column check, the column should still be in the table""" + module = SimpleModule('db.dropcolumn', table=self.mapName, + column=self.colName) + self.assertModule(module) + + m = SimpleModule('db.columns', table=self.mapName) + self.assertModule(m) + self.assertRegexpMatches(decode(m.outputs.stdout), self.colName) + + def test_drop_column_with_force(self): + """Drop column with force, the column should not be in the table""" + module = SimpleModule('db.dropcolumn', table=self.mapName, + column=self.colName, + flags='f') + self.assertModule(module) + + m = SimpleModule('db.columns', table=self.mapName) + self.assertModule(m) + self.assertNotRegexpMatches(decode(m.outputs.stdout), self.colName) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/db.droptable/db.droptable.html grass-7.8.0/scripts/db.droptable/db.droptable.html --- grass-7.6.1/scripts/db.droptable/db.droptable.html 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/db.droptable/db.droptable.html 2019-05-18 15:50:05.000000000 +0000 @@ -62,4 +62,4 @@ Driver and database options added by Martin Landa, Czech Technical University in Prague, Czech Republic

    -Last changed: $Date: 2016-09-19 11:37:30 +0200 (Mon, 19 Sep 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/db.droptable/db.droptable.py grass-7.8.0/scripts/db.droptable/db.droptable.py --- grass-7.6.1/scripts/db.droptable/db.droptable.py 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/db.droptable/db.droptable.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -44,11 +44,7 @@ import sys import grass.script as grass - -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) +from grass.script.utils import encode def main(): @@ -94,7 +90,7 @@ p = grass.feed_command('db.execute', input='-', database=database, driver=driver) - p.stdin.write("DROP TABLE " + table) + p.stdin.write(encode("DROP TABLE " + table)) p.stdin.close() p.wait() if p.returncode != 0: diff -Nru grass-7.6.1/scripts/db.droptable/testsuite/test_db_droptable.py grass-7.8.0/scripts/db.droptable/testsuite/test_db_droptable.py --- grass-7.6.1/scripts/db.droptable/testsuite/test_db_droptable.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/db.droptable/testsuite/test_db_droptable.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,50 @@ +""" +Created on Sun Jun 07 19:38:12 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command +from grass.script.utils import decode + + +class TestDbDropTable(TestCase): + """Test db.droptable script""" + + mapName = 'myroads' + + @classmethod + def setUpClass(cls): + """Copy vector.""" + run_command('g.copy', vector='roadsmajor,myroads') + + @classmethod + def tearDownClass(cls): + """Remove copied vector""" + run_command('g.remove', type='vector', name=cls.mapName, + flags='f') + + def test_drop_table_check(self): + """Drop table check, the column should still be in the table""" + module = SimpleModule('db.droptable', table=self.mapName) + self.assertModule(module) + + m = SimpleModule('db.tables', flags='p') + self.assertModule(m) + self.assertRegexpMatches(decode(m.outputs.stdout), self.mapName) + + def test_drop_table_with_force(self): + """Drop table with force, the column should not be in the table""" + module = SimpleModule('db.droptable', table=self.mapName, flags='f') + self.assertModule(module) + + m = SimpleModule('db.tables', flags='p') + self.assertModule(m) + self.assertNotRegexpMatches(decode(m.outputs.stdout), self.mapName) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/db.in.ogr/db.in.ogr.html grass-7.8.0/scripts/db.in.ogr/db.in.ogr.html --- grass-7.6.1/scripts/db.in.ogr/db.in.ogr.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/db.in.ogr/db.in.ogr.html 2019-05-18 15:50:05.000000000 +0000 @@ -74,4 +74,4 @@ Markus Neteler

    -Last changed: $Date: 2015-12-17 15:38:13 +0100 (Thu, 17 Dec 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/db.in.ogr/db.in.ogr.py grass-7.8.0/scripts/db.in.ogr/db.in.ogr.py --- grass-7.6.1/scripts/db.in.ogr/db.in.ogr.py 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/db.in.ogr/db.in.ogr.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -60,13 +60,9 @@ import os import grass.script as grass +from grass.script.utils import decode from grass.exceptions import CalledModuleError -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): input = options['input'] @@ -85,7 +81,7 @@ # check if table exists try: - nuldev = file(os.devnull, 'w+') + nuldev = open(os.devnull, 'w+') s = grass.read_command('db.tables', flags='p', quiet=True, stderr=nuldev) nuldev.close() except CalledModuleError: @@ -93,7 +89,7 @@ grass.read_command('db.connect', flags='c') s = grass.read_command('db.tables', flags='p', quiet=True) - for l in s.splitlines(): + for l in decode(s).splitlines(): if l == output: if grass.overwrite(): grass.warning(_("Table <%s> already exists and will be " @@ -142,7 +138,7 @@ name=output) # get rid of superfluous auto-added cat column (and cat_ if present) - nuldev = file(os.devnull, 'w+') + nuldev = open(os.devnull, 'w+') grass.run_command('db.dropcolumn', quiet=True, flags='f', table=output, column='cat', stdout=nuldev, stderr=nuldev) nuldev.close() diff -Nru grass-7.6.1/scripts/db.in.ogr/testsuite/test_db_in_ogr.py grass-7.8.0/scripts/db.in.ogr/testsuite/test_db_in_ogr.py --- grass-7.6.1/scripts/db.in.ogr/testsuite/test_db_in_ogr.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/db.in.ogr/testsuite/test_db_in_ogr.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,63 @@ +""" +Created on Sun Jun 07 20:14:04 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command +from grass.script.utils import decode + +import os + + +class TestDbInOgr(TestCase): + """Test db.in.ogr script""" + + csvFile = 'sample_data.csv' + dbfFile = 'sample_data.dbf' + tableName1 = 'sample_table1' + tableName2 = 'sample_table2' + + @classmethod + def setUpClass(cls): + """Create temporary files. Remove if the tables already exists.""" + cls.runModule('db.out.ogr', input='geology', output=cls.csvFile) + cls.runModule('db.out.ogr', input='geology', output=cls.dbfFile, + format='DBF') + cls.runModule('db.droptable', table=cls.tableName1, flags='f') + cls.runModule('db.droptable', table=cls.tableName2, flags='f') + + @classmethod + def tearDownClass(cls): + """Remove the created files and the created table""" + os.remove(cls.csvFile) + os.remove(cls.dbfFile) + cls.runModule('db.droptable', table=cls.tableName1, flags='f') + cls.runModule('db.droptable', table=cls.tableName2, flags='f') + + def test_import_csv_file(self): + """import csv table""" + module = SimpleModule('db.in.ogr', input=self.csvFile, + output=self.tableName1) + self.assertModule(module) + + m = SimpleModule('db.tables', flags='p') + self.assertModule(m) + self.assertRegexpMatches(decode(m.outputs.stdout), self.tableName1) + + def test_import_dbf_file(self): + """import dbf table""" + module = SimpleModule('db.in.ogr', input=self.dbfFile, + output=self.tableName2) + self.assertModule(module) + + m = SimpleModule('db.tables', flags='p') + self.assertModule(m) + self.assertRegexpMatches(decode(m.outputs.stdout), self.tableName2) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/db.out.ogr/db.out.ogr.html grass-7.8.0/scripts/db.out.ogr/db.out.ogr.html --- grass-7.6.1/scripts/db.out.ogr/db.out.ogr.html 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/db.out.ogr/db.out.ogr.html 2019-05-18 15:50:05.000000000 +0000 @@ -52,4 +52,4 @@ Markus Neteler
    Converted to Python by Glynn Clements -

    Last changed: $Date: 2014-12-02 23:10:00 +0100 (Tue, 02 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/db.out.ogr/db.out.ogr.py grass-7.8.0/scripts/db.out.ogr/db.out.ogr.py --- grass-7.6.1/scripts/db.out.ogr/db.out.ogr.py 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/db.out.ogr/db.out.ogr.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -18,6 +18,7 @@ #% description: Exports attribute tables into various formats. #% keyword: database #% keyword: export +#% keyword: output #% keyword: attribute table #%end @@ -60,10 +61,6 @@ from grass.script import core as gcore from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): input = options['input'] diff -Nru grass-7.6.1/scripts/db.test/db.test.html grass-7.8.0/scripts/db.test/db.test.html --- grass-7.6.1/scripts/db.test/db.test.html 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/db.test/db.test.html 2019-05-18 15:50:05.000000000 +0000 @@ -23,4 +23,4 @@

    AUTHOR

    Radim Blazek -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/db.test/db.test.py grass-7.8.0/scripts/db.test/db.test.py --- grass-7.6.1/scripts/db.test/db.test.py 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/db.test/db.test.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: db.test @@ -33,10 +33,6 @@ from grass.script import db as grassdb from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): test_file = options['test'] @@ -48,7 +44,7 @@ gcore.message(_("Using DB driver: %s") % dbconn['driver']) infile = os.path.join(os.environ['GISBASE'], 'etc', 'db.test', test_file) - inf = file(infile) + inf = open(infile) while True: type = inf.readline() @@ -64,7 +60,7 @@ if type == 'X': gcore.write_command('db.execute', input='-', stdin=sql + '\n') else: - resf = file(result, 'w') + resf = open(result, 'w') gcore.write_command('db.select', input='-', flags='c', stdin=sql + '\n', stdout=resf) resf.close() @@ -74,7 +70,7 @@ else: gcore.message(_("EXECUTE: OK")) - expf = file(expected, 'w') + expf = open(expected, 'w') while True: res = inf.readline().rstrip('\r\n') if not res: diff -Nru grass-7.6.1/scripts/db.univar/db.univar.html grass-7.8.0/scripts/db.univar/db.univar.html --- grass-7.6.1/scripts/db.univar/db.univar.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/db.univar/db.univar.html 2019-05-18 15:50:05.000000000 +0000 @@ -40,4 +40,4 @@ Michael Barton, Arizona State University

    and authors of r.univar.sh -

    Last changed: $Date: 2016-11-14 00:05:32 +0100 (Mon, 14 Nov 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/db.univar/db.univar.py grass-7.8.0/scripts/db.univar/db.univar.py --- grass-7.6.1/scripts/db.univar/db.univar.py 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/db.univar/db.univar.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -61,11 +61,6 @@ import grass.script as gscript -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): for ext in ['', '.sort']: @@ -73,8 +68,8 @@ def sortfile(infile, outfile): - inf = file(infile, 'r') - outf = file(outfile, 'w') + inf = open(infile, 'r') + outf = open(outfile, 'w') if gscript.find_program('sort', '--help'): gscript.run_command('sort', flags='n', stdin=inf, stdout=outf) @@ -134,14 +129,14 @@ if not driver: driver = None - tmpf = file(tmp, 'w') + tmpf = open(tmp, 'w') gscript.run_command('db.select', flags='c', table=table, database=database, driver=driver, sql=sql, stdout=tmpf) tmpf.close() # check if result is empty - tmpf = file(tmp) + tmpf = open(tmp) if tmpf.read(1) == '': gscript.fatal(_("Table <%s> contains no data.") % table) tmpf.close() @@ -157,7 +152,7 @@ minv = 1e300 maxv = -1e300 - tmpf = file(tmp) + tmpf = open(tmp) for line in tmpf: if len(line.rstrip('\r\n')) == 0: continue @@ -237,7 +232,7 @@ ppos[i] = 1 pval[i] = 0 - inf = file(tmp + ".sort") + inf = open(tmp + ".sort") l = 1 for line in inf: if l == q25pos: diff -Nru grass-7.6.1/scripts/db.univar/testsuite/test_db_univar.py grass-7.8.0/scripts/db.univar/testsuite/test_db_univar.py --- grass-7.6.1/scripts/db.univar/testsuite/test_db_univar.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/db.univar/testsuite/test_db_univar.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,48 @@ +""" +Created on Sun Jun 07 21:01:34 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command + + +class TestDbUnivar(TestCase): + """Test db.univar script""" + + columnName = 'heights' + mapName = 'samples' + + @classmethod + def setUpClass(cls): + """Use temp region""" + cls.use_temp_region() + cls.runModule('g.region', raster='elevation', flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.runModule('g.remove', flags='f', type='raster', name='elevation') + cls.del_temp_region() + + run_command('v.db.droptable', map='samples', flags='f') + + def test_calculate(self): + """run db.univar""" + run_command('v.random', output=self.mapName, n=100, overwrite='True') + run_command('v.db.addtable', map=self.mapName, + column="heights double precision") + run_command('v.what.rast', map=self.mapName, raster='elevation', + column=self.columnName) + run_command('v.db.select', map=self.mapName) + + module = SimpleModule('db.univar', table=self.mapName, + column=self.columnName) + self.assertModule(module) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/d.correlate/d.correlate.html grass-7.8.0/scripts/d.correlate/d.correlate.html --- grass-7.6.1/scripts/d.correlate/d.correlate.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/d.correlate/d.correlate.html 2019-05-18 15:50:05.000000000 +0000 @@ -44,4 +44,4 @@ U.S.Army Construction Engineering Research Laboratory

    Rewritten to GRASS 6 (from csh to sh) by Markus Neteler; from sh to Python by Glynn Clements -

    Last changed: $Date: 2015-10-27 18:40:48 +0100 (Tue, 27 Oct 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.correlate/d.correlate.py grass-7.8.0/scripts/d.correlate/d.correlate.py --- grass-7.6.1/scripts/d.correlate/d.correlate.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/d.correlate/d.correlate.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -32,10 +32,6 @@ from grass.script import core as gcore from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): layers = options['map'].split(',') diff -Nru grass-7.6.1/scripts/d.frame/d.frame.html grass-7.8.0/scripts/d.frame/d.frame.html --- grass-7.6.1/scripts/d.frame/d.frame.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/d.frame/d.frame.html 2019-05-18 15:50:05.000000000 +0000 @@ -92,4 +92,4 @@ Research Laboratory

    -Last changed: $Date: 2015-02-03 17:55:49 +0100 (Tue, 03 Feb 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.frame/d.frame.py grass-7.8.0/scripts/d.frame/d.frame.py --- grass-7.6.1/scripts/d.frame/d.frame.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/d.frame/d.frame.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -70,10 +70,6 @@ from grass.script.core import parser, read_command, fatal, debug, run_command, gisenv, warning, parse_command -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - # check if monitor is running @@ -304,7 +300,6 @@ if __name__ == "__main__": if len(sys.argv) == 2 and sys.argv[1] == '--doctest': import doctest - _ = str # doctest gettext workaround sys.exit(doctest.testmod().failed) options, flags = parser() sys.exit(main()) diff -Nru grass-7.6.1/scripts/d.out.file/d.out.file.html grass-7.8.0/scripts/d.out.file/d.out.file.html --- grass-7.6.1/scripts/d.out.file/d.out.file.html 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/d.out.file/d.out.file.html 2019-05-18 15:50:05.000000000 +0000 @@ -19,4 +19,4 @@ Anna Petrasova, NCSU OSGeoREL -

    Last changed: $Date: 2016-02-19 02:42:11 +0100 (Fri, 19 Feb 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.out.file/d.out.file.py grass-7.8.0/scripts/d.out.file/d.out.file.py --- grass-7.6.1/scripts/d.out.file/d.out.file.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/d.out.file/d.out.file.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -17,6 +17,7 @@ #% description: Saves the contents of the active display monitor to a graphics file. #% keyword: display #% keyword: export +#% keyword: output #%end #%option G_OPT_F_OUTPUT #% description: Name for output file @@ -40,11 +41,6 @@ from grass.script import core as gcore -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): options, flags = gcore.parser() diff -Nru grass-7.6.1/scripts/d.polar/d.polar.html grass-7.8.0/scripts/d.polar/d.polar.html --- grass-7.6.1/scripts/d.polar/d.polar.html 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/d.polar/d.polar.html 2019-05-18 15:50:05.000000000 +0000 @@ -72,4 +72,4 @@ Bruno Caprile, ITC-irst, Italy
    Hamish Bowman, Otago University, New Zealand
    -

    Last changed: $Date: 2015-09-05 17:57:08 +0200 (Sat, 05 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.polar/d.polar.py grass-7.8.0/scripts/d.polar/d.polar.py --- grass-7.6.1/scripts/d.polar/d.polar.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/d.polar/d.polar.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -52,10 +52,6 @@ from grass.script.utils import try_remove, basename from grass.script import core as gcore -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def raster_map_required(name): if not gcore.find_file(name, 'cell')['file']: diff -Nru grass-7.6.1/scripts/d.rast.edit/d.rast.edit.html grass-7.8.0/scripts/d.rast.edit/d.rast.edit.html --- grass-7.6.1/scripts/d.rast.edit/d.rast.edit.html 2019-03-19 20:04:43.000000000 +0000 +++ grass-7.8.0/scripts/d.rast.edit/d.rast.edit.html 2019-05-18 15:50:05.000000000 +0000 @@ -143,4 +143,4 @@ Replaces Xdriver version in C by Chris Rewerts, April 1991, Agricultural Engineering, Purdue University -

    Last changed: $Date: 2018-12-15 12:16:30 +0100 (Sat, 15 Dec 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.rast.edit/d.rast.edit.py grass-7.8.0/scripts/d.rast.edit/d.rast.edit.py --- grass-7.6.1/scripts/d.rast.edit/d.rast.edit.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/d.rast.edit/d.rast.edit.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -79,11 +79,6 @@ import atexit import grass.script as grass -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - try: import wxversion wxversion.select(['3.0', '2.8', '2.6']) diff -Nru grass-7.6.1/scripts/d.rast.leg/d.rast.leg.html grass-7.8.0/scripts/d.rast.leg/d.rast.leg.html --- grass-7.6.1/scripts/d.rast.leg/d.rast.leg.html 2019-03-19 20:04:34.000000000 +0000 +++ grass-7.8.0/scripts/d.rast.leg/d.rast.leg.html 2019-05-18 15:50:05.000000000 +0000 @@ -46,4 +46,4 @@ Markus Neteler

    -Last changed: $Date: 2014-11-28 17:22:17 +0100 (Fri, 28 Nov 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.rast.leg/d.rast.leg.py grass-7.8.0/scripts/d.rast.leg/d.rast.leg.py --- grass-7.6.1/scripts/d.rast.leg/d.rast.leg.py 2019-03-19 20:04:36.000000000 +0000 +++ grass-7.8.0/scripts/d.rast.leg/d.rast.leg.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -65,10 +65,6 @@ import os import grass.script as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def make_frame(f, b, t, l, r): (fl, fr, ft, fb) = f diff -Nru grass-7.6.1/scripts/d.redraw/d.redraw.html grass-7.8.0/scripts/d.redraw/d.redraw.html --- grass-7.6.1/scripts/d.redraw/d.redraw.html 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/d.redraw/d.redraw.html 2019-05-18 15:50:05.000000000 +0000 @@ -17,4 +17,4 @@ Martin Landa, Czech Republic -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.redraw/d.redraw.py grass-7.8.0/scripts/d.redraw/d.redraw.py --- grass-7.6.1/scripts/d.redraw/d.redraw.py 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/d.redraw/d.redraw.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -26,10 +26,6 @@ from grass.script import core as grass from grass.script.utils import split -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): mon = grass.gisenv().get('MONITOR', None) diff -Nru grass-7.6.1/scripts/d.shade/d.shade.html grass-7.8.0/scripts/d.shade/d.shade.html --- grass-7.6.1/scripts/d.shade/d.shade.html 2019-03-19 20:04:36.000000000 +0000 +++ grass-7.8.0/scripts/d.shade/d.shade.html 2019-05-18 15:50:05.000000000 +0000 @@ -86,4 +86,4 @@ Unknown; updated to GRASS 5.7 by Michael Barton

    -Last changed: $Date: 2015-02-13 16:14:07 +0100 (Fri, 13 Feb 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.shade/d.shade.py grass-7.8.0/scripts/d.shade/d.shade.py --- grass-7.6.1/scripts/d.shade/d.shade.py 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/d.shade/d.shade.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -43,11 +43,6 @@ from grass.script import core as gcore from grass.exceptions import CalledModuleError -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): options, unused = gcore.parser() diff -Nru grass-7.6.1/scripts/d.to.rast/d.to.rast.html grass-7.8.0/scripts/d.to.rast/d.to.rast.html --- grass-7.6.1/scripts/d.to.rast/d.to.rast.html 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/d.to.rast/d.to.rast.html 2019-05-18 15:50:05.000000000 +0000 @@ -48,4 +48,4 @@ Anna Petrasova, NCSU OSGeoREL -

    Last changed: $Date: 2016-02-19 02:42:11 +0100 (Fri, 19 Feb 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.to.rast/d.to.rast.py grass-7.8.0/scripts/d.to.rast/d.to.rast.py --- grass-7.6.1/scripts/d.to.rast/d.to.rast.py 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/d.to.rast/d.to.rast.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -25,11 +25,6 @@ from grass.script import core as gcore -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): options, flags = gcore.parser() diff -Nru grass-7.6.1/scripts/d.what.rast/d.what.rast.html grass-7.8.0/scripts/d.what.rast/d.what.rast.html --- grass-7.6.1/scripts/d.what.rast/d.what.rast.html 2019-03-19 20:04:34.000000000 +0000 +++ grass-7.8.0/scripts/d.what.rast/d.what.rast.html 2019-05-18 15:50:05.000000000 +0000 @@ -19,4 +19,4 @@ Anna Petrasova, NCSU OSGeoREL -

    Last changed: $Date: 2015-09-05 18:13:18 +0200 (Sat, 05 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.what.rast/d.what.rast.py grass-7.8.0/scripts/d.what.rast/d.what.rast.py --- grass-7.6.1/scripts/d.what.rast/d.what.rast.py 2019-03-19 20:04:34.000000000 +0000 +++ grass-7.8.0/scripts/d.what.rast/d.what.rast.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -25,11 +25,6 @@ from grass.script import core as gcore -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): options, flags = gcore.parser() diff -Nru grass-7.6.1/scripts/d.what.vect/d.what.vect.html grass-7.8.0/scripts/d.what.vect/d.what.vect.html --- grass-7.6.1/scripts/d.what.vect/d.what.vect.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/d.what.vect/d.what.vect.html 2019-05-18 15:50:05.000000000 +0000 @@ -19,4 +19,4 @@ Anna Petrasova, NCSU OSGeoREL -

    Last changed: $Date: 2015-09-05 18:13:18 +0200 (Sat, 05 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/d.what.vect/d.what.vect.py grass-7.8.0/scripts/d.what.vect/d.what.vect.py --- grass-7.6.1/scripts/d.what.vect/d.what.vect.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/d.what.vect/d.what.vect.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -25,11 +25,6 @@ from grass.script import core as gcore -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): options, flags = gcore.parser() diff -Nru grass-7.6.1/scripts/g.extension/g.extension.html grass-7.8.0/scripts/g.extension/g.extension.html --- grass-7.6.1/scripts/g.extension/g.extension.html 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/g.extension/g.extension.html 2019-08-12 16:50:46.000000000 +0000 @@ -59,16 +59,16 @@

    Source code sources and repositories

    -

    GRASS GIS Addons SVN repository

    +

    GRASS GIS Addons repository on GitHub

    By default, g.extension installs extensions from the official -GRASS GIS Addons SVN repository. However, different sources can be specified +GRASS GIS Addons GitHub repository. However, different sources can be specified using the url option.

    Individual extensions can also be installed by providing a URL to the -source code on OSGeo Trac. This, however, works only for certain directories -where the download of ZIP files was enabled by project administrators of -the trac server. +source code on GitHub or OSGeo Trac. The latter, however, works only for certain +directories where the download of ZIP files was enabled by project administrators +of the trac server.

    Local source code directory

    Optionally, new extension can be also installed from a source code placed @@ -104,7 +104,8 @@

    Needed directory layout

    When none of the above sources is identified, g.extension assumes -that the source is a Subversion repository and uses the svn command + +that the source is in a GitHub repository and uses the svn command line tool to obtain the source code. The expected structure of the repository should be the same as the one of the official repository. @@ -149,14 +150,14 @@ Example for an open http proxy:
     # syntax: http://proxyurl:proxyport
    -g.extension extension=r.stream.distance proxy="http://proxy.example.com:8080"
    +g.extension extension=r.stream.distance proxy="http=http://proxy.example.com:8080"
     

    Example for a proxy with proxy authentication:

     # syntax: http://username:password@proxyurl:proxyport
    -g.extension extension=r.stream.distance proxy="http://username:password@proxy.example.com:8080"
    +g.extension extension=r.stream.distance proxy="http=http://username:password@proxy.example.com:8080"
     

    Managing the extensions

    @@ -263,4 +264,4 @@ Vaclav Petras, NCSU OSGeoREL (support for general sources, partial refactoring)

    -Last changed: $Date: 2018-06-10 02:40:48 +0200 (Sun, 10 Jun 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/g.extension/g.extension.py grass-7.8.0/scripts/g.extension/g.extension.py --- grass-7.6.1/scripts/g.extension/g.extension.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/g.extension/g.extension.py 2019-08-11 09:34:09.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -8,14 +8,15 @@ # Vaclav Petras (support for general sources) # PURPOSE: Tool to download and install extensions into local installation # -# COPYRIGHT: (C) 2009-2016 by Markus Neteler, and the GRASS Development Team +# COPYRIGHT: (C) 2009-2019 by Markus Neteler, and the GRASS Development Team # # This program is free software under the GNU General # Public License (>=v2). Read the file COPYING that # comes with GRASS for details. # -# TODO: add sudo support where needed (i.e. check first permission to write into -# $GISBASE directory) +# TODO: - add sudo support where needed (i.e. check first permission to write into +# $GISBASE directory) +# - fix toolbox support in install_private_extension_xml() ############################################################################# #%module @@ -128,6 +129,7 @@ from __future__ import print_function +import fileinput import os import sys import re @@ -135,20 +137,12 @@ import shutil import zipfile import tempfile +import xml.etree.ElementTree as etree from distutils.dir_util import copy_tree -try: - from urllib2 import HTTPError, URLError - from urllib import urlopen, urlretrieve -except ImportError: - # there is also HTTPException, perhaps change to list - from urllib.error import HTTPError, URLError - from urllib.request import urlopen, urlretrieve - -try: - import xml.etree.ElementTree as etree -except ImportError: - import elementtree.ElementTree as etree # Python <= 2.4 +from six.moves.urllib.request import urlopen, urlretrieve, ProxyHandler, build_opener, install_opener +from six.moves.urllib.error import HTTPError, URLError + # Get the XML parsing exceptions to catch. The behavior changed with Python 2.7 # and ElementTree 1.3. from xml.parsers import expat # TODO: works for any Python? @@ -160,10 +154,7 @@ import grass.script as gscript from grass.script.utils import try_rmdir from grass.script import core as grass - -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) +from grass.script import task as gtask # temp dir REMOVE_TMPDIR = True @@ -176,9 +167,9 @@ return etree.fromstring(file_.read()) -def etree_fromurl(url, proxies=None): +def etree_fromurl(url): """Create XML element tree from a given URL""" - file_ = urlopen(url, proxies=proxies) + file_ = urlopen(url) return etree.fromstring(file_.read()) @@ -334,7 +325,9 @@ if flags['t']: grass.message(_("List of available extensions (toolboxes):")) tlist = get_available_toolboxes(url) - for toolbox_code, toolbox_data in tlist.items(): + tkeys = sorted(tlist.keys()) + for toolbox_code in tkeys: + toolbox_data = tlist[toolbox_code] if flags['g']: print('toolbox_name=' + toolbox_data['name']) print('toolbox_code=' + toolbox_code) @@ -355,7 +348,7 @@ tdict = dict() url = url + "toolboxes.xml" try: - tree = etree_fromurl(url, proxies=PROXIES) + tree = etree_fromurl(url) for tnode in tree.findall('toolbox'): mlist = list() clist = list() @@ -385,7 +378,7 @@ url = url + "toolboxes.xml" try: - tree = etree_fromurl(url, proxies=PROXIES) + tree = etree_fromurl(url) for tnode in tree.findall('toolbox'): if name == tnode.get('code'): for mnode in tnode.findall('task'): @@ -460,7 +453,7 @@ file_url = url + "modules.xml" grass.debug("url=%s" % file_url, 1) try: - tree = etree_fromurl(file_url, proxies=PROXIES) + tree = etree_fromurl(file_url) except ETREE_EXCEPTIONS: grass.warning(_("Unable to parse '%s'. Trying to scan" " SVN repository (may take some time)...") % file_url) @@ -527,7 +520,7 @@ file_url = '%s/%s' % (url, modclass) grass.debug("url = %s" % file_url, debug=2) try: - file_ = urlopen(file_url, proxies=PROXIES) + file_ = urlopen(url) except (HTTPError, IOError, OSError): grass.debug(_("Unable to fetch '%s'") % file_url, debug=1) continue @@ -559,7 +552,7 @@ # construct a full URL of a file url = '%s/%s' % (url, 'gui/wxpython') grass.debug("url = %s" % url, debug=2) - file_ = urlopen(url, proxies=PROXIES) + file_ = urlopen(url) if not file_: grass.warning(_("Unable to fetch '%s'") % url) return @@ -683,8 +676,9 @@ if sys.platform == "win32": ret += install_extension_win(module) else: - ret += install_extension_std_platforms(module, + ret1, installed_modules, tmp_dir = install_extension_std_platforms(module, source=source, url=url) + ret += ret1 if len(mlist) > 1: print('-' * 60) @@ -697,9 +691,19 @@ else: # for now it is reasonable to assume that only official source # will provide the metadata file - if source == 'official': + if source == 'official' and len(installed_modules) <= len(mlist): grass.message(_("Updating addons metadata file...")) blist = install_extension_xml(xmlurl, mlist) + if source == 'official' and len(installed_modules) > len(mlist): + grass.message(_("Updating addons metadata file...")) + blist = install_private_extension_xml(tmp_dir, installed_modules) + else: + grass.message(_("Updating private addons metadata file...")) + if len(installed_modules) > 1: + blist = install_private_extension_xml(tmp_dir, installed_modules) + else: + blist = install_private_extension_xml(tmp_dir, mlist) + # the blist was used here, but it seems that it is the same as mlist for module in mlist: update_manual_page(module) @@ -724,7 +728,7 @@ """ data = dict() try: - tree = etree_fromurl(url, proxies=PROXIES) + tree = etree_fromurl(url) for tnode in tree.findall('toolbox'): clist = list() for cnode in tnode.findall('correlate'): @@ -809,7 +813,7 @@ data = {} bin_list = [] try: - tree = etree_fromurl(url, proxies=PROXIES) + tree = etree_fromurl(url) except (HTTPError, URLError, IOError, OSError) as error: grass.error(_("Unable to read addons metadata file" " from the remote server: {0}").format(error)) @@ -924,6 +928,87 @@ return bin_list +def install_private_extension_xml(url, mlist): + """Update XML files with metadata about installed modules and toolbox + of an private addon + + """ + # TODO toolbox + # if len(mlist) > 1: + # # read metadata from remote server (toolboxes) + # install_toolbox_xml(url, options['extension']) + + xml_file = os.path.join(options['prefix'], 'modules.xml') + # create an empty file if not exists + if not os.path.exists(xml_file): + write_xml_modules(xml_file) + + # read XML file + tree = etree_fromfile(xml_file) + + # update tree + for name in mlist: + + try: + desc = gtask.parse_interface(name).description + # mname = gtask.parse_interface(name).name + keywords = gtask.parse_interface(name).keywords + except Exception as e: + grass.warning(_("No addons metadata available." + " Addons metadata file not updated.")) + return [] + + tnode = None + for node in tree.findall('task'): + if node.get('name') == name: + tnode = node + break + + # create new node for task + tnode = etree.Element('task', attrib={'name': name}) + dnode = etree.Element('description') + dnode.text = desc + tnode.append(dnode) + knode = etree.Element('keywords') + knode.text = (',').join(keywords) + tnode.append(knode) + + # create binary + bnode = etree.Element('binary') + list_of_binary_files = [] + for file_name in os.listdir(url): + file_type = os.path.splitext(file_name)[-1] + file_n = os.path.splitext(file_name)[0] + html_path = os.path.join(options['prefix'], 'docs', 'html') + c_path = os.path.join(options['prefix'], 'bin') + py_path = os.path.join(options['prefix'], 'scripts') + # html or image file + if file_type in ['.html', '.jpg', '.png'] \ + and file_n in os.listdir(html_path): + list_of_binary_files.append(os.path.join(html_path, file_name)) + # c file + elif file_type in ['.c'] and file_name in os.listdir(c_path): + list_of_binary_files.append(os.path.join(c_path, file_n)) + # python file + elif file_type in ['.py'] and file_name in os.listdir(py_path): + list_of_binary_files.append(os.path.join(py_path, file_n)) + # man file + man_path = os.path.join(options['prefix'], 'docs', 'man', 'man1') + if name + '.1' in os.listdir(man_path): + list_of_binary_files.append(os.path.join(man_path, name + '.1')) + # add binaries to xml file + for binary_file_name in list_of_binary_files: + fnode = etree.Element('file') + fnode.text = binary_file_name + bnode.append(fnode) + tnode.append(bnode) + tree.append(tnode) + + write_xml_modules(xml_file, tree) + + return mlist + + def install_extension_win(name): """Install extension on MS Windows""" grass.message(_("Downloading precompiled GRASS Addons <%s>...") % @@ -939,7 +1024,7 @@ "grass-%(major)s.%(minor)s.%(patch)s" % \ {'platform': platform, 'major': version[0], 'minor': version[1], - 'patch': version[2]} + 'patch': 'dev'} # resolve ZIP URL source, url = resolve_source_code(url='{0}/{1}.zip'.format(base_url, name)) @@ -956,6 +1041,21 @@ download_source_code(source=source, url=url, name=name, outdev=outdev, directory=srcdir, tmpdir=TMPDIR) + # change shebang from python to python3 + pyfiles = [] + for r, d, f in os.walk(srcdir): + for file in f: + if file.endswith('.py'): + pyfiles.append(os.path.join(r, file)) + + for filename in pyfiles: + with fileinput.FileInput(filename, inplace=True) as file: + for line in file: + print(line.replace( + "#!/usr/bin/env python\n", + "#!/usr/bin/env python3\n" + ), end='') + # copy Addons copy tree to destination directory move_extracted_files(extract_dir=srcdir, target_dir=options['prefix'], files=os.listdir(srcdir)) @@ -991,8 +1091,35 @@ return directory +def download_source_code_official_github(url, name, outdev, directory=None): + """Download source code from a official GitHub reporsitory + + .. note: + Stdout is passed to to *outdev* while stderr is will be just printed. + + :param url: URL of the repository + (module class/family and name are attached) + :param name: module name + :param outdev: output divide for the standard output of the svn command + :param directory: directory where the source code will be downloaded + (default is the current directory with name attached) + + :returns: full path to the directory with the source code + (useful when you not specify directory, if *directory* is specified + the return value is equal to it) + """ + if not directory: + directory = os.path.join(os.getcwd, name) + classchar = name.split('.', 1)[0] + moduleclass = expand_module_class_name(classchar) + if grass.call(['svn', 'export', + url, directory], stdout=outdev) != 0: + grass.fatal(_("GRASS Addons <%s> not found") % name) + return directory + + def move_extracted_files(extract_dir, target_dir, files): - """Fix state of extracted file by moving them to different diretcory + """Fix state of extracted files by moving them to different directory When extracting, it is not clear what will be the root directory or if there will be one at all. So this function moves the files to @@ -1026,20 +1153,28 @@ Binary files are ignored. Recurses into subdirectories. """ + # skip binary files + # see https://stackoverflow.com/a/7392391 + textchars = bytearray({7,8,9,10,12,13,27} | set(range(0x20, 0x100)) - {0x7f}) + is_binary_string = lambda bytes: bool(bytes.translate(None, textchars)) + for root, unused, files in os.walk(directory): for name in files: filename = os.path.join(root, name) - data = open(filename, 'rb').read() - if '\0' in data: + if is_binary_string(open(filename, 'rb').read(1024)): continue # ignore binary files - # we don't expect there would be CRLF file by purpose - # if we want to allow CRLF files we would have to whitelite .py etc - newdata = data.replace('\r\n', '\n') - if newdata != data: - newfile = open(filename, 'wb') - newfile.write(newdata) - newfile.close() + # read content of text file + with open(filename, 'rb') as fd: + data = fd.read() + + # we don't expect there would be CRLF file by + # purpose if we want to allow CRLF files we would + # have to whitelite .py etc + newdata = data.replace(b'\r\n', b'\n') + if newdata != data: + with open(filename, 'wb') as newfile: + newfile.write(newdata) def extract_zip(name, directory, tmpdir): """Extract a ZIP file into a directory""" @@ -1090,15 +1225,19 @@ gscript.verbose("Downloading source code for <{name}> from <{url}>" " which is identified as '{source}' type of source..." .format(source=source, url=url, name=name)) - if source == 'svn': + if source == 'official': + download_source_code_official_github(url, name, outdev, directory) + elif source == 'svn': download_source_code_svn(url, name, outdev, directory) - elif source in ['remote_zip', 'official']: + elif source in ['remote_zip']: # , 'official' # we expect that the module.zip file is not by chance in the archive zip_name = os.path.join(tmpdir, 'extension.zip') - f, h = urlretrieve(url, zip_name) - if h.get('content-type', '') != 'application/zip': + try: + response = urlopen(url) + except URLError: grass.fatal(_("Extension <%s> not found") % name) - + with open(zip_name, 'wb') as out_file: + shutil.copyfileobj(response, out_file) extract_zip(name=zip_name, directory=directory, tmpdir=tmpdir) fix_newlines(directory) elif source.startswith('remote_') and \ @@ -1150,6 +1289,22 @@ outdev=outdev, directory=srcdir, tmpdir=TMPDIR) os.chdir(srcdir) + # change shebang from python to python3 + pyfiles = [] + # r=root, d=directories, f = files + for r, d, f in os.walk(srcdir): + for file in f: + if file.endswith('.py'): + pyfiles.append(os.path.join(r, file)) + + for filename in pyfiles: + with fileinput.FileInput(filename, inplace=True) as file: + for line in file: + print(line.replace( + "#!/usr/bin/env python\n", + "#!/usr/bin/env python3\n" + ), end='') + dirs = { 'bin': os.path.join(TMPDIR, name, 'bin'), 'docs': os.path.join(TMPDIR, name, 'docs'), @@ -1209,8 +1364,29 @@ grass.message(_("Installing...")) - return grass.call(install_cmd, - stdout=outdev) + + with open(os.path.join(TMPDIR, name, 'Makefile')) as f: + datafile = f.readlines() + + makefile_part = "" + next_line = False + for line in datafile: + if 'SUBDIRS' in line or next_line: + makefile_part += line + if (line.strip()).endswith('\\'): + next_line = True + else: + next_line = False + + modules = makefile_part.replace('SUBDIRS', '').replace('=', '').replace('\\', '').strip().split('\n') + c_path = os.path.join(options['prefix'], 'bin') + py_path = os.path.join(options['prefix'], 'scripts') + + all_modules = os.listdir(c_path) + all_modules.extend(os.listdir(py_path)) + module_list = [x.strip() for x in modules if x.strip() in all_modules] + + return grass.call(install_cmd, stdout=outdev), module_list, os.path.join(TMPDIR, name) def remove_extension(force=False): @@ -1491,15 +1667,15 @@ It ensures that there is a single slash at the end of URL, so we can attach file name easily: - >>> resolve_xmlurl_prefix('http://grass.osgeo.org/addons') - 'http://grass.osgeo.org/addons/' - >>> resolve_xmlurl_prefix('http://grass.osgeo.org/addons/') - 'http://grass.osgeo.org/addons/' + >>> resolve_xmlurl_prefix('https://grass.osgeo.org/addons') + 'https://grass.osgeo.org/addons/' + >>> resolve_xmlurl_prefix('https://grass.osgeo.org/addons/') + 'https://grass.osgeo.org/addons/' """ gscript.debug("resolve_xmlurl_prefix(url={0}, source={1})".format(url, source)) if source == 'official': # use pregenerated modules XML file - url = 'http://grass.osgeo.org/addons/grass%s/' % version[0] + url = 'https://grass.osgeo.org/addons/grass%s/' % version[0] # else try to get modules XMl from SVN repository (provided URL) # the exact action depends on subsequent code (somewhere) @@ -1535,7 +1711,7 @@ 'ignored_suffixes': ['.zip', '.tar.gz', '.gz', '.bz2'], 'possible_starts': ['', 'https://', 'http://'], 'url_start': 'https://', - 'url_end': '/get/default.zip', + 'url_end': '/get/master.zip', }, } @@ -1601,12 +1777,12 @@ Subversion: - >>> resolve_source_code('http://svn.osgeo.org/grass/grass-addons/grass7') - ('svn', 'http://svn.osgeo.org/grass/grass-addons/grass7') + >>> resolve_source_code('https://svn.osgeo.org/grass/grass-addons/grass7') + ('svn', 'https://svn.osgeo.org/grass/grass-addons/grass7') ZIP files online: - >>> resolve_source_code('https://trac.osgeo.org/.../r.modis?format=zip') + >>> resolve_source_code('https://trac.osgeo.org/.../r.modis?format=zip') # doctest: +SKIP ('remote_zip', 'https://trac.osgeo.org/.../r.modis?format=zip') Local directories and ZIP files: @@ -1618,43 +1794,81 @@ OSGeo Trac: - >>> resolve_source_code('trac.osgeo.org/.../r.agent.aco') + >>> resolve_source_code('trac.osgeo.org/.../r.agent.aco') # doctest: +SKIP ('remote_zip', 'https://trac.osgeo.org/.../r.agent.aco?format=zip') - >>> resolve_source_code('https://trac.osgeo.org/.../r.agent.aco') + >>> resolve_source_code('https://trac.osgeo.org/.../r.agent.aco') # doctest: +SKIP ('remote_zip', 'https://trac.osgeo.org/.../r.agent.aco?format=zip') GitHub: - >>> resolve_source_code('github.com/user/g.example') + >>> resolve_source_code('github.com/user/g.example') # doctest: +SKIP ('remote_zip', 'https://github.com/user/g.example/archive/master.zip') - >>> resolve_source_code('github.com/user/g.example/') + >>> resolve_source_code('github.com/user/g.example/') # doctest: +SKIP ('remote_zip', 'https://github.com/user/g.example/archive/master.zip') - >>> resolve_source_code('https://github.com/user/g.example') + >>> resolve_source_code('https://github.com/user/g.example') # doctest: +SKIP ('remote_zip', 'https://github.com/user/g.example/archive/master.zip') - >>> resolve_source_code('https://github.com/user/g.example/') + >>> resolve_source_code('https://github.com/user/g.example/') # doctest: +SKIP ('remote_zip', 'https://github.com/user/g.example/archive/master.zip') GitLab: - >>> resolve_source_code('gitlab.com/JoeUser/GrassModule') + >>> resolve_source_code('gitlab.com/JoeUser/GrassModule') # doctest: +SKIP ('remote_zip', 'https://gitlab.com/JoeUser/GrassModule/repository/archive.zip') - >>> resolve_source_code('https://gitlab.com/JoeUser/GrassModule') + >>> resolve_source_code('https://gitlab.com/JoeUser/GrassModule') # doctest: +SKIP ('remote_zip', 'https://gitlab.com/JoeUser/GrassModule/repository/archive.zip') Bitbucket: - >>> resolve_source_code('bitbucket.org/joe-user/grass-module') + >>> resolve_source_code('bitbucket.org/joe-user/grass-module') # doctest: +SKIP ('remote_zip', 'https://bitbucket.org/joe-user/grass-module/get/default.zip') - >>> resolve_source_code('https://bitbucket.org/joe-user/grass-module') + >>> resolve_source_code('https://bitbucket.org/joe-user/grass-module') # doctest: +SKIP ('remote_zip', 'https://bitbucket.org/joe-user/grass-module/get/default.zip') """ if not url and name: module_class = get_module_class_name(name) - trac_url = 'https://trac.osgeo.org/grass/browser/grass-addons/' \ - 'grass{version}/{module_class}/{module_name}?format=zip' \ + # note: 'trunk' is required to make URL usable for 'svn export' call + git_url = 'https://github.com/OSGeo/grass-addons/trunk/' \ + 'grass{version}/{module_class}/{module_name}' \ .format(version=version[0], module_class=module_class, module_name=name) - return 'official', trac_url + # trac_url = 'https://trac.osgeo.org/grass/browser/grass-addons/' \ + # 'grass{version}/{module_class}/{module_name}?format=zip' \ + # .format(version=version[0], + # module_class=module_class, module_name=name) + # return 'official', trac_url + return 'official', git_url + + # Check if URL can be found + # Catch corner case if local URL is given starting with file:// + url = url[6:] if url.startswith('file://') else url + if not os.path.exists(url): + url_validated = False + if url.startswith('http'): + try: + open_url = urlopen(url) + open_url.close() + url_validated = True + except: + pass + else: + try: + open_url = urlopen('http://' + url) + open_url.close() + url_validated = True + except: + pass + try: + open_url = urlopen('https://' + url) + open_url.close() + url_validated = True + except: + pass + + if not url_validated: + grass.fatal(_('Cannot open URL: {}'.format(url))) + + + # Handle local URLs if os.path.isdir(url): return 'dir', os.path.abspath(url) elif os.path.exists(url): @@ -1663,6 +1877,7 @@ for suffix in extract_tar.supported_formats: if url.endswith('.' + suffix): return suffix, os.path.abspath(url) + # Handle remote URLs else: source, resolved_url = resolve_known_host_service(url) if source: @@ -1692,6 +1907,9 @@ PROXIES = {} for ptype, purl in (p.split('=') for p in options['proxy'].split(',')): PROXIES[ptype] = purl + proxy = ProxyHandler(PROXIES) + opener = build_opener(proxy) + install_opener(opener) # define path options['prefix'] = resolve_install_prefix(path=options['prefix'], @@ -1734,7 +1952,6 @@ if __name__ == "__main__": if len(sys.argv) == 2 and sys.argv[1] == '--doctest': import doctest - _ = str # doctest gettext workaround sys.exit(doctest.testmod().failed) options, flags = grass.parser() global TMPDIR diff -Nru grass-7.6.1/scripts/g.extension/testsuite/data/sample_modules/r.plus.example/r.plus.example.html grass-7.8.0/scripts/g.extension/testsuite/data/sample_modules/r.plus.example/r.plus.example.html --- grass-7.6.1/scripts/g.extension/testsuite/data/sample_modules/r.plus.example/r.plus.example.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/g.extension/testsuite/data/sample_modules/r.plus.example/r.plus.example.html 2019-05-18 15:50:05.000000000 +0000 @@ -22,4 +22,4 @@ Vaclav Petras, NCSU OSGeoREL

    -Last changed: $Date: 2015-09-05 18:13:18 +0200 (Sat, 05 Sep 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/g.extension/testsuite/data/sample_modules/r.plus.example/r.plus.example.py grass-7.8.0/scripts/g.extension/testsuite/data/sample_modules/r.plus.example/r.plus.example.py --- grass-7.6.1/scripts/g.extension/testsuite/data/sample_modules/r.plus.example/r.plus.example.py 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/g.extension/testsuite/data/sample_modules/r.plus.example/r.plus.example.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #%module #% description: Adds the values of two rasters (A + B) diff -Nru grass-7.6.1/scripts/g.extension/testsuite/test_addons_modules.py grass-7.8.0/scripts/g.extension/testsuite/test_addons_modules.py --- grass-7.6.1/scripts/g.extension/testsuite/test_addons_modules.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/g.extension/testsuite/test_addons_modules.py 2019-06-03 20:34:21.000000000 +0000 @@ -16,6 +16,7 @@ from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule from grass.gunittest.utils import silent_rmtree +from grass.script.utils import decode import os @@ -54,7 +55,7 @@ """List individual extensions/modules/addons""" module = SimpleModule('g.extension', flags='l', url=self.url) self.assertModule(module) - stdout = module.outputs.stdout + stdout = decode(module.outputs.stdout) self.assertMultiLineEqual(stdout, MODULES_OUTPUT) diff -Nru grass-7.6.1/scripts/g.extension/testsuite/test_addons_toolboxes.py grass-7.8.0/scripts/g.extension/testsuite/test_addons_toolboxes.py --- grass-7.6.1/scripts/g.extension/testsuite/test_addons_toolboxes.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/g.extension/testsuite/test_addons_toolboxes.py 2019-06-03 20:34:21.000000000 +0000 @@ -18,7 +18,7 @@ import os -FULL_TOOLBOXES_OUTPUT = """\ +FULL_TOOLBOXES_OUTPUT = u"""\ Hydrology (HY) * r.stream.basins * r.stream.channel @@ -45,7 +45,7 @@ module = SimpleModule('g.extension', flags='lt', url=self.url) self.assertModule(module) stdout = module.outputs.stdout - self.assertLooksLike(stdout, FULL_TOOLBOXES_OUTPUT) + self.assertMultiLineEqual(stdout, FULL_TOOLBOXES_OUTPUT) if __name__ == '__main__': diff -Nru grass-7.6.1/scripts/g.extension.all/g.extension.all.html grass-7.8.0/scripts/g.extension.all/g.extension.all.html --- grass-7.6.1/scripts/g.extension.all/g.extension.all.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/g.extension.all/g.extension.all.html 2019-05-18 15:50:05.000000000 +0000 @@ -36,4 +36,4 @@ Martin Landa, Czech Technical University in Prague, Czech Republic

    -Last changed: $Date: 2014-09-09 11:05:01 +0200 (Tue, 09 Sep 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/g.extension.all/g.extension.all.py grass-7.8.0/scripts/g.extension.all/g.extension.all.py --- grass-7.6.1/scripts/g.extension.all/g.extension.all.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/g.extension.all/g.extension.all.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -47,10 +47,6 @@ import grass.script as gscript from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def get_extensions(): addon_base = os.getenv('GRASS_ADDON_BASE') diff -Nru grass-7.6.1/scripts/g.manual/g.manual.html grass-7.8.0/scripts/g.manual/g.manual.html --- grass-7.6.1/scripts/g.manual/g.manual.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/g.manual/g.manual.html 2019-05-18 15:50:05.000000000 +0000 @@ -34,4 +34,4 @@ Markus Neteler

    -Last changed: $Date: 2013-01-06 16:32:45 +0100 (Sun, 06 Jan 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/g.manual/g.manual.py grass-7.8.0/scripts/g.manual/g.manual.py --- grass-7.6.1/scripts/g.manual/g.manual.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/g.manual/g.manual.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -60,10 +60,6 @@ from grass.script.utils import basename from grass.script import core as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def start_browser(entry): if browser and \ diff -Nru grass-7.6.1/scripts/g.search.modules/g.search.modules.html grass-7.8.0/scripts/g.search.modules/g.search.modules.html --- grass-7.6.1/scripts/g.search.modules/g.search.modules.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/g.search.modules/g.search.modules.html 2019-06-03 20:34:21.000000000 +0000 @@ -1,15 +1,18 @@

    DESCRIPTION

    -g.search.module searches for given keyword in GRASS modules name, -description, keywords and optionally manpages too. +g.search.module searches for given keyword in GRASS GIS modules name, +description, keywords and optionally manpages, too. Also installed addons are +considered in the search.

    NOTES

    -There can be more keywords, g.search.modules will search for each of them +Multiple keywords may be specified, g.search.modules will search for +all of them.

    EXAMPLE

    -Search all modules, where keywords buffer OR clip can be found +Search all modules, where keywords buffer OR clip can be found: +
     g.search.modules keyword=buffer,clip
     
    @@ -30,17 +33,28 @@
                      that contain non-NULL category values.
     
    +

    Search all modules, where keywords overlay AND clip can be -found with some fancy terminal output +found with some fancy terminal output (not shown here): +

     g.search.modules keyword=clip,overlay -a -c
     
    +v.clip
    +    keywords: vector,clip,area
    +    description: Extracts features of input map which overlay features
    +                 of clip map.
    +
     v.overlay
    -    keywords: vector,geometry,spatial query,intersection,union,clip
    -    description: Overlays two vector maps.;
    +    keywords: vector,geometry,spatial
    +              query,clip,difference,intersection,union
    +    description: Overlays two vector maps offering clip, intersection,
    +                 difference, symmetrical difference, union operators.
     
    -Search in manual pages too +

    +Search in manual pages as well: +

     g.search.modules -m keyword=kapri
     
    @@ -64,7 +78,9 @@
     
     

    AUTHORS

    -Jachym Cepicky, OpenGeoLabs s.r.o., Czech Republic +Jachym Cepicky, OpenGeoLabs s.r.o., Czech Republic: original author +
    +Anika Bettge, mundialis, Germany: addon search added

    -Last changed: $Date: 2016-04-21 16:33:08 +0200 (Thu, 21 Apr 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/g.search.modules/g.search.modules.py grass-7.8.0/scripts/g.search.modules/g.search.modules.py --- grass-7.6.1/scripts/g.search.modules/g.search.modules.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/g.search.modules/g.search.modules.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,10 +1,10 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: g.search.modules # AUTHOR(S): Jachym Cepicky # PURPOSE: g.search.modules in grass modules using keywords -# COPYRIGHT: (C) 2015-2016 by the GRASS Development Team +# COPYRIGHT: (C) 2015-2019 by the GRASS Development Team # # This program is free software under the GNU General # Public License (>=v2). Read the file COPYING that @@ -61,16 +61,14 @@ #% description: JSON format #% guisection: Output #%end + from __future__ import print_function import os import sys from grass.script.utils import diff_files, try_rmdir from grass.script import core as grass - -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) +from grass.exceptions import CalledModuleError try: import xml.etree.ElementTree as etree @@ -202,6 +200,25 @@ items = menudata.findall('module-item') + # add installed addons to modules list + if os.getenv("GRASS_ADDON_BASE"): + filename_addons = os.path.join(os.getenv("GRASS_ADDON_BASE"), 'modules.xml') + if os.path.isfile(filename_addons): + addon_menudata_file = open(filename_addons, 'r') + addon_menudata = etree.parse(addon_menudata_file) + addon_menudata_file.close() + addon_items = addon_menudata.findall('task') + items.extend(addon_items) + + # add system-wide installed addons to modules list + filename_addons_s = os.path.join(os.getenv("GISBASE"), 'modules.xml') + if os.path.isfile(filename_addons_s): + addon_menudata_file_s = open(filename_addons_s, 'r') + addon_menudata_s = etree.parse(addon_menudata_file_s) + addon_menudata_file_s.close() + addon_items_s = addon_menudata_s.findall('task') + items.extend(addon_items_s) + found_modules = [] for item in items: name = item.attrib['name'] @@ -222,7 +239,10 @@ keyword_found = _basic_search(keyword, name, description, module_keywords) - if not keyword_found and manpages: + # meta-modules (i.sentinel, r.modis, ...) do not have descriptions + # and keywords, but they have a manpage + # TODO change the handling of meta-modules + if (description and module_keywords) and not keyword_found and manpages: keyword_found = _manpage_search(keyword, name) if keyword_found: @@ -250,7 +270,7 @@ } }) - return found_modules + return sorted(found_modules, key=lambda k: k['name']) def _basic_search(pattern, name, description, module_keywords): @@ -259,11 +279,13 @@ This lowercases the strings before searching in them, so the pattern string should be lowercased too. """ - if name.lower().find(pattern) > -1 or\ - description.lower().find(pattern) > -1 or\ - module_keywords.lower().find(pattern) > -1: - - return True + if (name and description and module_keywords): + if name.lower().find(pattern) > -1 or\ + description.lower().find(pattern) > -1 or\ + module_keywords.lower().find(pattern) > -1: + return True + else: + return False else: return False @@ -282,8 +304,11 @@ def _manpage_search(pattern, name): - - manpage = grass.read_command('g.manual', flags='m', entry=name) + try: + manpage = grass.read_command('g.manual', flags='m', entry=name) + except CalledModuleError: + # in case man page is missing + return False return manpage.lower().find(pattern) > -1 diff -Nru grass-7.6.1/scripts/g.search.modules/testsuite/test_g_search_modules.py grass-7.8.0/scripts/g.search.modules/testsuite/test_g_search_modules.py --- grass-7.6.1/scripts/g.search.modules/testsuite/test_g_search_modules.py 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/g.search.modules/testsuite/test_g_search_modules.py 2019-06-03 20:34:21.000000000 +0000 @@ -15,6 +15,7 @@ from grass.gunittest.case import TestCase from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule +from grass.script.utils import decode import unittest @@ -31,14 +32,14 @@ """ """ module = SimpleModule('g.search.modules', keyword="water") self.assertModule(module) - stdout = module.outputs.stdout + stdout = decode(module.outputs.stdout) self.assertEqual(stdout.split()[0], 'r.basins.fill') def test_json_output(self): import json module = SimpleModule('g.search.modules', keyword="water", flags="j") self.assertModule(module) - stdout = json.loads(module.outputs.stdout) + stdout = json.loads(decode(module.outputs.stdout)) self.assertEqual(len(stdout), 6, 'Six modules found') self.assertEqual(stdout[3]['name'], 'r.water.outlet', 'r.water.outlet') self.assertTrue('keywords' in stdout[3]['attributes']) @@ -46,7 +47,7 @@ def test_shell_outout(self): module = SimpleModule('g.search.modules', keyword="water", flags="g") self.assertModule(module) - stdout = module.outputs.stdout.split() + stdout = decode(module.outputs.stdout).split() self.assertEqual(len(stdout), 6) self.assertEqual(stdout[3], 'r.water.outlet') @@ -55,7 +56,7 @@ def test_colored_terminal(self): module = SimpleModule('g.search.modules', keyword="water", flags="c") self.assertModule(module) - stdout = module.outputs.stdout.split() + stdout = decode(module.outputs.stdout).split() self.assertEqual(stdout[0], termcolor.colored('r.basins.fill', attrs=['bold'])) @@ -63,7 +64,7 @@ def test_manual_pages(self): module = SimpleModule('g.search.modules', keyword="kapri", flags="gm") self.assertModule(module) - stdout = module.outputs.stdout.split() + stdout = decode(module.outputs.stdout).split() self.assertEqual(len(stdout), 2) if __name__ == '__main__': diff -Nru grass-7.6.1/scripts/i.colors.enhance/i.colors.enhance.html grass-7.8.0/scripts/i.colors.enhance/i.colors.enhance.html --- grass-7.6.1/scripts/i.colors.enhance/i.colors.enhance.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/i.colors.enhance/i.colors.enhance.html 2019-05-18 15:50:05.000000000 +0000 @@ -72,4 +72,4 @@ Markus Neteler, Trento, Italy
    M. Hamish Bowman, Dept. Marine Science, Otago University, New Zealand -

    Last changed: $Date: 2018-03-02 23:22:33 +0100 (Fri, 02 Mar 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/i.colors.enhance/i.colors.enhance.py grass-7.8.0/scripts/i.colors.enhance/i.colors.enhance.py --- grass-7.6.1/scripts/i.colors.enhance/i.colors.enhance.py 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/i.colors.enhance/i.colors.enhance.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -71,11 +71,6 @@ import grass.script as gscript -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - try: # new for python 2.6, in 2.5 it may be easy_install'd. import multiprocessing as mp diff -Nru grass-7.6.1/scripts/i.image.mosaic/i.image.mosaic.html grass-7.8.0/scripts/i.image.mosaic/i.image.mosaic.html --- grass-7.6.1/scripts/i.image.mosaic/i.image.mosaic.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/i.image.mosaic/i.image.mosaic.html 2019-05-18 15:50:05.000000000 +0000 @@ -15,4 +15,4 @@ Markus Neteler, ITC-Irst, Trento, Italy Updated to GRASS 5.7 by Michael Barton, Arizona State University -

    Last changed: $Date: 2011-09-29 21:18:47 +0200 (Thu, 29 Sep 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/i.image.mosaic/i.image.mosaic.py grass-7.8.0/scripts/i.image.mosaic/i.image.mosaic.py --- grass-7.6.1/scripts/i.image.mosaic/i.image.mosaic.py 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/i.image.mosaic/i.image.mosaic.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # written by Markus Neteler 18. August 1998 / 20. Jan. 1999 # neteler geog.uni-hannover.de @@ -36,11 +36,6 @@ import grass.script as gscript -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def copy_colors(fh, map, offset): p = gscript.pipe_command('r.colors.out', map=map) diff -Nru grass-7.6.1/scripts/i.in.spotvgt/i.in.spotvgt.html grass-7.8.0/scripts/i.in.spotvgt/i.in.spotvgt.html --- grass-7.6.1/scripts/i.in.spotvgt/i.in.spotvgt.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/i.in.spotvgt/i.in.spotvgt.html 2019-05-18 15:50:05.000000000 +0000 @@ -48,4 +48,4 @@ Markus Neteler -

    Last changed: $Date: 2013-05-11 15:23:40 +0200 (Sat, 11 May 2013) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/i.in.spotvgt/i.in.spotvgt.py grass-7.8.0/scripts/i.in.spotvgt/i.in.spotvgt.py --- grass-7.6.1/scripts/i.in.spotvgt/i.in.spotvgt.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/i.in.spotvgt/i.in.spotvgt.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -53,10 +53,6 @@ import grass.script as gscript from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - vrt = """ GEOGCS["wgs84",DATUM["WGS_1984",SPHEROID["wgs84",6378137,298.257223563],TOWGS84[0.000,0.000,0.000]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]] @@ -77,7 +73,7 @@ def create_VRT_file(projfile, vrtfile, infile): - fh = file(projfile) + fh = open(projfile) kv = {} for l in fh: f = l.rstrip('\r\n').split() @@ -104,7 +100,7 @@ s = t.substitute(NORTHCORNER=north_corner, WESTCORNER=west_corner, XSIZE=xsize, YSIZE=ysize, RESOLUTION=map_proj_res, FILENAME=infile) - outf = file(vrtfile, 'w') + outf = open(vrtfile, 'w') outf.write(s) outf.close() diff -Nru grass-7.6.1/scripts/i.oif/i.oif.html grass-7.8.0/scripts/i.oif/i.oif.html --- grass-7.6.1/scripts/i.oif/i.oif.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/i.oif/i.oif.html 2019-05-18 15:50:05.000000000 +0000 @@ -81,4 +81,4 @@ Updated to GRASS 5.7 by Michael Barton, Arizona State University

    -Last changed: $Date: 2015-07-20 10:45:41 +0200 (Mon, 20 Jul 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/i.oif/i.oif.py grass-7.8.0/scripts/i.oif/i.oif.py --- grass-7.6.1/scripts/i.oif/i.oif.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/i.oif/i.oif.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -45,10 +45,6 @@ from grass.script.utils import parse_key_val from grass.script import core as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def oifcalc(sdev, corr, k1, k2, k3): grass.debug(_("Calculating OIF for combination: %s, %s, %s" % (k1, k2, @@ -156,7 +152,7 @@ for v, p in oif: sys.stdout.write(fmt % (p + (v,))) else: - outf = file(output, 'w') + outf = open(output, 'w') for v, p in oif: outf.write(fmt % (p + (v,))) outf.close() diff -Nru grass-7.6.1/scripts/i.pansharpen/i.pansharpen.html grass-7.8.0/scripts/i.pansharpen/i.pansharpen.html --- grass-7.6.1/scripts/i.pansharpen/i.pansharpen.html 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/i.pansharpen/i.pansharpen.html 2019-05-22 21:47:51.000000000 +0000 @@ -5,101 +5,110 @@ lower resolution bands can then be combined into an RGB color image at a higher (more detailed) resolution than is possible using the original 3 bands. For example, Landsat ETM has low resolution spectral bands 1 (blue), -2 (green), 3 (red), 4 (near IR), 5 (mid-IR), and 7 (mid-IR) at 30m resolution, +2 (green), 3 (red), 4 (near IR), 5 (mid-IR), and 7 (mid-IR) at 30m resolution, and a high resolution panchromatic band 8 at 15m resolution. Pan sharpening -allows bands 3-2-1 (or other combinations of 30m resolution bands like 4-3-2 +allows bands 3-2-1 (or other combinations of 30m resolution bands like 4-3-2 or 5-4-2) to be combined into a 15m resolution color image.

    -i.pansharpen offers a choice of three different 'pan sharpening' +i.pansharpen offers a choice of three different 'pan sharpening' algorithms: IHS, Brovey, and PCA.

    -For IHS pan sharpening, the original 3 lower resolution bands, selected -as red, green and blue channels for creating an RGB composite image, are -transformed into IHS (intensity, hue, and saturation) color space. The -panchromatic band is then substituted for the intensity channel (I), combined -with the original hue (H) and saturation (S) channels, and transformed back to -RGB color space at the higher resolution of the panchromatic band. The +For IHS pan sharpening, the original 3 lower resolution bands, selected +as red, green and blue channels for creating an RGB composite image, are +transformed into IHS (intensity, hue, and saturation) color space. The +panchromatic band is then substituted for the intensity channel (I), combined +with the original hue (H) and saturation (S) channels, and transformed back to +RGB color space at the higher resolution of the panchromatic band. The algorithm for this can be represented as: RGB -> IHS -> [pan]HS -> RGB.

    -With a Brovey pan sharpening, each of the 3 lower resolution bands and -panchromatic band are combined using the following algorithm to calculate +With a Brovey pan sharpening, each of the 3 lower resolution bands and +panchromatic band are combined using the following algorithm to calculate 3 new bands at the higher resolution (example for band 1):

    -                         band1 
    +                         band1
         new band1 = ----------------------- * panband
                      band1 + band2 + band3
     
    -In PCA pan sharpening, a principal component analysis is performed on the +In PCA pan sharpening, a principal component analysis is performed on the original 3 lower resolution bands to create 3 principal component images (PC1, PC2, and PC3) and their associated eigenvectors (EV), such that:
    -    
    +
          band1  band2  band3
     PC1: EV1-1  EV1-2  EV1-3
     PC2: EV2-1  EV2-2  EV2-3
    -PC3: EV3-1  EV3-2  EV3-3  
    +PC3: EV3-1  EV3-2  EV3-3
     
     and
     
     PC1 = EV1-1 * band1 + EV1-2 * band2 + EV1-3 * band3 - mean(bands 1,2,3)
     
     
    -An inverse PCA is then performed, substituting the panchromatic band for PC1. -To do this, the eigenvectors matrix is inverted (in this case transposed), the -PC images are multiplied by the eigenvectors with the panchromatic band -substituted for PC1, and mean of each band is added to each transformed image +An inverse PCA is then performed, substituting the panchromatic band for PC1. +To do this, the eigenvectors matrix is inverted (in this case transposed), the +PC images are multiplied by the eigenvectors with the panchromatic band +substituted for PC1, and mean of each band is added to each transformed image band using the following algorithm (example for band 1):
     
    -band1' = pan * EV1-1 + PC2 * EV2-1 + PC3 * EV3-1 + mean(band1)
    -   
    +band1 = pan * EV1-1 + PC2 * EV1-2 + PC3 * EV1-3 + mean(band1)
    +
     
    -The assignment of the channels depends on the satellite. Examples of satellite -imagery with high resolution panchromatic bands, and lower resolution spectral +The assignment of the channels depends on the satellite. Examples of satellite +imagery with high resolution panchromatic bands, and lower resolution spectral bands include Landsat 7 ETM, QuickBird, and SPOT.

    NOTES

    -The module currently only works for 8-bit images. -

    -The command temporarily changes the computational region to the high -resolution of the panchromatic band during sharpening calculations, then -restores the previous region settings. The current region coordinates (and -null values) are respected. The high resolution panchromatic image is -histogram matched to the band it is replaces prior to substitution (i.e., the -intensity channel for IHS sharpening, the low res band selected for each color +The module works for 2-bit to 30-bit images. All images are rescaled to 8-bit +for processing. By default, the entire possible range for the selected bit depth is +rescaled to 8-bit. For example, the range of 0-65535 for a 16-bit image is +rescaled to 0-255). The 'r' flag allows the range of pixel values actually +present in an image rescaled to a full 8-bit range. For example, a 16 bit image +might only have pixels that range from 70 to 35000; this range of 70-35000 would +be rescaled to 0-255. This can give better visual distinction to features, +especially when the range of actual values in an image only occupies a +relatively limited portion of the possible range. +

    +i.pansharpen temporarily changes the computational region to the high +resolution of the panchromatic band during sharpening calculations, then +restores the previous region settings. The current region coordinates (and +null values) are respected. The high resolution panchromatic image is +histogram matched to the band it is replaces prior to substitution (i.e., the +intensity channel for IHS sharpening, the low res band selected for each color channel with Brovey sharpening, and the PC1 image for PCA sharpening).

    -By default, the command will attempt to employ parallel processing, using -up to 3 cores simultaneously. The -s flag will disable parallel processing, +By default, the command will attempt to employ parallel processing, using +up to 3 cores simultaneously. The -s flag will disable parallel processing, but does use an optimized r.mapcalc expression to reduce disk I/O.

    -The three pan-sharpened output channels may be combined with d.rgb or +The three pan-sharpened output channels may be combined with d.rgb or r.composite. Colors may be optionally optimized with i.colors.enhance. -While the resulting color image will be at the higher resolution in all cases, -the 3 pan sharpening algorithms differ in terms of spectral response. +While the resulting color image will be at the higher resolution in all cases, +the 3 pan sharpening algorithms differ in terms of spectral response.

    EXAMPLES

    Pan sharpening comparison example

    -Pan sharpening of a Landsat image from Boulder, Colorado, USA: +Pan sharpening of a Landsat image from Boulder, Colorado, USA +(LANDSAT ETM+ [Landsat 7] spectral bands 5,4,2, and pan band 8):
    -# R, G, B composite at 30m 
    -g.region raster=p034r032_7dt20010924_z13_10 -p
    -d.rgb b=p034r032_7dt20010924_z13_10 g=lp034r032_7dt20010924_z13_20 
    -    r=p034r032_7dt20010924_z13_30
    +# R, G, B composite at 30m
    +g.region raster=p034r032_7dt20010924_z13_20 -p
    +d.rgb b=p034r032_7dt20010924_z13_20 g=lp034r032_7dt20010924_z13_40
    +    r=p034r032_7dt20010924_z13_50
     
     # i.pansharpen with IHS algorithm
    -i.pansharpen red=p034r032_7dt20010924_z13_30 green=p034r032_7dt20010924_z13_20 
    -    blue=p034r032_7dt20010924_z13_10 pan=p034r032_7dp20010924_z13_80 
    +i.pansharpen red=p034r032_7dt20010924_z13_50 green=p034r032_7dt20010924_z13_40
    +    blue=p034r032_7dt20010924_z13_20 pan=p034r032_7dp20010924_z13_80
         output=ihs321 method=ihs
     
     # ... likewise with method=brovey and method=pca
     
     # display at 15m
    -g.region raster=ihs321_blue -p
    -d.rgb b=ihs321_blue g=ihs321_green r=ihs321_red
    +g.region raster=ihs542_blue -p
    +d.rgb b=ihs542_blue g=ihs542_green r=ihs542_red
     

    @@ -109,14 +118,14 @@
    -  R, G, B composite of Landsat at 30m +  R, G, B composite of Landsat at 30m
    R, G, B composite of Landsat at 30m
    -  R, G, B composite of Brovey sharpened image at 15m +  R, G, B composite of Brovey sharpened image at 15m
    R, G, B composite of Brovey sharpened image at 15m @@ -125,14 +134,14 @@
    -  R, G, B composite of IHS sharpened image at 15m +  R, G, B composite of IHS sharpened image at 15m
    R, G, B composite of IHS sharpened image at 15m
    -  R, G, B composite of PCA sharpened image at 15m +  R, G, B composite of PCA sharpened image at 15m
    R, G, B composite of PCA sharpened image at 15m" @@ -175,7 +184,6 @@

    SEE ALSO

    -i.colors.enhance, i.his.rgb, i.rgb.his, i.pca, @@ -193,26 +201,26 @@ Proc. of the 14th International Symposium on Remote Sensing of Environment, San Jose, Costa Rica, 23-30 April, pp. 1001-1007 -
  • Amarsaikhan, D., Douglas, T. (2004). Data fusion and multisource image +
  • Amarsaikhan, D., Douglas, T. (2004). Data fusion and multisource image classification. International Journal of Remote Sensing, 25(17), 3529-3539. -
  • Behnia, P. (2005). Comparison between four methods for data fusion of ETM+ +
  • Behnia, P. (2005). Comparison between four methods for data fusion of ETM+ multispectral and pan images. Geo-spatial Information Science, 8(2), 98-103. - -
  • Du, Q., Younan, N. H., King, R., Shah, V. P. (2007). On the Performance - Evaluation of Pan-Sharpening Techniques. Geoscience and Remote Sensing + +
  • Du, Q., Younan, N. H., King, R., Shah, V. P. (2007). On the Performance + Evaluation of Pan-Sharpening Techniques. Geoscience and Remote Sensing Letters, IEEE, 4(4), 518-522. -
  • Karathanassi, V., Kolokousis, P., Ioannidou, S. (2007). A comparison - study on fusion methods using evaluation indicators. International Journal +
  • Karathanassi, V., Kolokousis, P., Ioannidou, S. (2007). A comparison + study on fusion methods using evaluation indicators. International Journal of Remote Sensing, 28(10), 2309-2341.
  • Neteler, M, D. Grasso, I. Michelazzi, L. Miori, S. Merler, and C. - Furlanello (2005). An integrated toolbox for image registration, fusion and + Furlanello (2005). An integrated toolbox for image registration, fusion and classification. International Journal of Geoinformatics, 1(1):51-61 (PDF) -
  • Pohl, C, and J.L van Genderen (1998). Multisensor image fusion in remote +
  • Pohl, C, and J.L van Genderen (1998). Multisensor image fusion in remote sensing: concepts, methods and application. Int. J. of Rem. Sens., 19, 823-854. @@ -222,6 +230,6 @@ Michael Barton (Arizona State University, USA)
    with contributions from Markus Neteler (ITC-irst, Italy); Glynn Clements; -Luca Delucchi (Fondazione E. Mach, Italy); Markus Metz; and Hamish Bowman. +Luca Delucchi (Fondazione E. Mach, Italy); Markus Metz; and Hamish Bowman. -

    Last changed: $Date: 2019-01-21 21:08:55 +0100 (Mon, 21 Jan 2019) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/i.pansharpen/i.pansharpen.py grass-7.8.0/scripts/i.pansharpen/i.pansharpen.py --- grass-7.6.1/scripts/i.pansharpen/i.pansharpen.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/i.pansharpen/i.pansharpen.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,8 +1,8 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # -# MODULE: i.panmethod +# MODULE: i.pansharpen # # AUTHOR(S): Overall script by Michael Barton (ASU) # Brovey transformation in i.fusion.brovey by Markus Neteler <> @@ -14,7 +14,7 @@ # # PURPOSE: Sharpening of 3 RGB channels using a high-resolution panchromatic channel # -# COPYRIGHT: (C) 2002-2012 by the GRASS Development Team +# COPYRIGHT: (C) 2002-2019 by the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS @@ -71,6 +71,14 @@ #% answer: ihs #% required: yes #%end +#%option +#% key: bitdepth +#% type: integer +#% description: Bit depth of image (must be in range of 2-30) +#% options: 2-32 +#% answer: 8 +#% required: yes +#%end #%flag #% key: s #% description: Serial processing rather than parallel processing @@ -79,6 +87,10 @@ #% key: l #% description: Rebalance blue channel for LANDSAT #%end +#%flag +#% key: r +#% description: Rescale (stretch) the range of pixel values in each channel to the entire 0-255 8-bit range for processing (see notes) +#%end import os @@ -90,23 +102,27 @@ import grass.script as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): if not hasNumPy: grass.fatal(_("Required dependency NumPy not found. Exiting.")) - sharpen = options['method'] # sharpening algorithm - ms1 = options['blue'] # blue channel - ms2 = options['green'] # green channel - ms3 = options['red'] # red channel - pan = options['pan'] # high res pan channel - out = options['output'] # prefix for output RGB maps - bladjust = flags['l'] # adjust blue channel - sproc = flags['s'] # serial processing + sharpen = options['method'] # sharpening algorithm + ms1_orig = options['blue'] # blue channel + ms2_orig = options['green'] # green channel + ms3_orig = options['red'] # red channel + pan_orig = options['pan'] # high res pan channel + out = options['output'] # prefix for output RGB maps + bits = options['bitdepth'] # bit depth of image channels + bladjust = flags['l'] # adjust blue channel + sproc = flags['s'] # serial processing + rescale = flags['r'] # rescale to spread pixel values to entire 0-255 range + + # Checking bit depth + bits = float(bits) + if bits < 2 or bits > 30: + grass.warning(_("Bit depth is outside acceptable range")) + return outb = grass.core.find_file('%s_blue' % out) outg = grass.core.find_file('%s_green' % out) @@ -119,205 +135,136 @@ pid = str(os.getpid()) - # get PAN resolution: - kv = grass.raster_info(map=pan) - nsres = kv['nsres'] - ewres = kv['ewres'] - panres = (nsres + ewres) / 2 - - # clone current region - grass.use_temp_region() - - grass.run_command('g.region', res=panres, align=pan) - - grass.message(_("Performing pan sharpening with hi res pan image: %f" % panres)) - - if sharpen == "brovey": - grass.verbose(_("Using Brovey algorithm")) - - # pan/intensity histogram matching using linear regression - outname = 'tmp%s_pan1' % pid - panmatch1 = matchhist(pan, ms1, outname) - - outname = 'tmp%s_pan2' % pid - panmatch2 = matchhist(pan, ms2, outname) - - outname = 'tmp%s_pan3' % pid - panmatch3 = matchhist(pan, ms3, outname) + # convert input image channels to 8 bit for processing + ms1 = 'tmp%s_ms1' % pid + ms2 = 'tmp%s_ms2' % pid + ms3 = 'tmp%s_ms3' % pid + pan = 'tmp%s_pan' % pid + + if rescale == False: + if bits == 8: + grass.message(_("Using 8bit image channels")) + if sproc: + # serial processing + grass.run_command('g.copy', raster='%s,%s' % (ms1_orig, ms1), + quiet=True, overwrite=True) + grass.run_command('g.copy', raster='%s,%s' % (ms2_orig, ms2), + quiet=True, overwrite=True) + grass.run_command('g.copy', raster='%s,%s' % (ms3_orig, ms3), + quiet=True, overwrite=True) + grass.run_command('g.copy', raster='%s,%s' % (pan_orig, pan), + quiet=True, overwrite=True) + else: + # parallel processing + pb = grass.start_command('g.copy', raster='%s,%s' % (ms1_orig, ms1), + quiet=True, overwrite=True) + pg = grass.start_command('g.copy', raster='%s,%s' % (ms2_orig, ms2), + quiet=True, overwrite=True) + pr = grass.start_command('g.copy', raster='%s,%s' % (ms3_orig, ms3), + quiet=True, overwrite=True) + pp = grass.start_command('g.copy', raster='%s,%s' % (pan_orig, pan), + quiet=True, overwrite=True) + + pb.wait() + pg.wait() + pr.wait() + pp.wait() - outr = '%s_red' % out - outg = '%s_green' % out - outb = '%s_blue' % out + else: + grass.message(_("Converting image chanels to 8bit for processing")) + maxval = pow(2, bits) - 1 + if sproc: + # serial processing + grass.run_command('r.rescale', input=ms1_orig, from_='0,%f' % maxval, + output=ms1, to='0,255', quiet=True, overwrite=True) + grass.run_command('r.rescale', input=ms2_orig, from_='0,%f' % maxval, + output=ms2, to='0,255', quiet=True, overwrite=True) + grass.run_command('r.rescale', input=ms3_orig, from_='0,%f' % maxval, + output=ms3, to='0,255', quiet=True, overwrite=True) + grass.run_command('r.rescale', input=pan_orig, from_='0,%f' % maxval, + output=pan, to='0,255', quiet=True, overwrite=True) - # calculate brovey transformation - grass.message(_("Calculating Brovey transformation...")) + else: + # parallel processing + pb = grass.start_command('r.rescale', input=ms1_orig, from_='0,%f' % maxval, + output=ms1, to='0,255', quiet=True, overwrite=True) + pg = grass.start_command('r.rescale', input=ms2_orig, from_='0,%f' % maxval, + output=ms2, to='0,255', quiet=True, overwrite=True) + pr = grass.start_command('r.rescale', input=ms3_orig, from_='0,%f' % maxval, + output=ms3, to='0,255', quiet=True, overwrite=True) + pp = grass.start_command('r.rescale', input=pan_orig, from_='0,%f' % maxval, + output=pan, to='0,255', quiet=True, overwrite=True) + + pb.wait() + pg.wait() + pr.wait() + pp.wait() + + else: + grass.message(_("Rescaling image chanels to 8bit for processing")) + + min_ms1 = int(grass.raster_info(ms1_orig)['min']) + max_ms1 = int(grass.raster_info(ms1_orig)['max']) + min_ms2 = int(grass.raster_info(ms2_orig)['min']) + max_ms2 = int(grass.raster_info(ms2_orig)['max']) + min_ms3 = int(grass.raster_info(ms3_orig)['min']) + max_ms3 = int(grass.raster_info(ms3_orig)['max']) + min_pan = int(grass.raster_info(pan_orig)['min']) + max_pan = int(grass.raster_info(pan_orig)['max']) + maxval = pow(2, bits) - 1 if sproc: # serial processing - e = '''eval(k = "$ms1" + "$ms2" + "$ms3") - "$outr" = 1.0 * "$ms3" * "$panmatch3" / k - "$outg" = 1.0 * "$ms2" * "$panmatch2" / k - "$outb" = 1.0 * "$ms1" * "$panmatch1" / k''' - grass.mapcalc(e, outr=outr, outg=outg, outb=outb, - panmatch1=panmatch1, panmatch2=panmatch2, - panmatch3=panmatch3, ms1=ms1, ms2=ms2, ms3=ms3, - overwrite=True) + grass.run_command('r.rescale', input=ms1_orig, from_='%f,%f' % (min_ms1, max_ms1), + output=ms1, to='0,255', quiet=True, overwrite=True) + grass.run_command('r.rescale', input=ms2_orig, from_='%f,%f' % (min_ms2, max_ms2), + output=ms2, to='0,255', quiet=True, overwrite=True) + grass.run_command('r.rescale', input=ms3_orig, from_='%f,%f' % (min_ms3, max_ms3), + output=ms3, to='0,255', quiet=True, overwrite=True) + grass.run_command('r.rescale', input=pan_orig, from_='%f,%f' % (min_pan, max_pan), + output=pan, to='0,255', quiet=True, overwrite=True) + else: # parallel processing - pb = grass.mapcalc_start('%s_blue = (1.0 * %s * %s) / (%s + %s + %s)' % - (out, ms1, panmatch1, ms1, ms2, ms3), - overwrite=True) - pg = grass.mapcalc_start('%s_green = (1.0 * %s * %s) / (%s + %s + %s)' % - (out, ms2, panmatch2, ms1, ms2, ms3), - overwrite=True) - pr = grass.mapcalc_start('%s_red = (1.0 * %s * %s) / (%s + %s + %s)' % - (out, ms3, panmatch3, ms1, ms2, ms3), - overwrite=True) + pb = grass.start_command('r.rescale', input=ms1_orig, from_='%f,%f' % (min_ms1, max_ms1), + output=ms1, to='0,255', quiet=True, overwrite=True) + pg = grass.start_command('r.rescale', input=ms2_orig, from_='%f,%f' % (min_ms2, max_ms2), + output=ms2, to='0,255', quiet=True, overwrite=True) + pr = grass.start_command('r.rescale', input=ms3_orig, from_='%f,%f' % (min_ms3, max_ms3), + output=ms3, to='0,255', quiet=True, overwrite=True) + pp = grass.start_command('r.rescale', input=pan_orig, from_='%f,%f' % (min_pan, max_pan), + output=pan, to='0,255', quiet=True, overwrite=True) pb.wait() pg.wait() pr.wait() + pp.wait() - # Cleanup - grass.run_command('g.remove', flags='f', quiet=True, type='raster', - name='%s,%s,%s' % (panmatch1, panmatch2, panmatch3)) - elif sharpen == "ihs": - grass.verbose(_("Using IHS<->RGB algorithm")) - # transform RGB channels into IHS color space - grass.message(_("Transforming to IHS color space...")) - grass.run_command('i.rgb.his', overwrite=True, - red=ms3, - green=ms2, - blue=ms1, - hue="tmp%s_hue" % pid, - intensity="tmp%s_int" % pid, - saturation="tmp%s_sat" % pid) - - # pan/intensity histogram matching using linear regression - target = "tmp%s_int" % pid - outname = "tmp%s_pan_int" % pid - panmatch = matchhist(pan, target, outname) - - # substitute pan for intensity channel and transform back to RGB color space - grass.message(_("Transforming back to RGB color space and sharpening...")) - grass.run_command('i.his.rgb', overwrite=True, - hue="tmp%s_hue" % pid, - intensity="%s" % panmatch, - saturation="tmp%s_sat" % pid, - red="%s_red" % out, - green="%s_green" % out, - blue="%s_blue" % out) + # get PAN resolution: + kv = grass.raster_info(map=pan) + nsres = kv['nsres'] + ewres = kv['ewres'] + panres = (nsres + ewres) / 2 - # Cleanup - grass.run_command('g.remove', flags='f', quiet=True, type='raster', - name=panmatch) + # clone current region + grass.use_temp_region() + grass.run_command('g.region', res=panres, align=pan) + # Select sharpening method + grass.message(_("Performing pan sharpening with hi res pan image: %f" % panres)) + if sharpen == "brovey": + brovey(pan, ms1, ms2, ms3, out, pid, sproc) + elif sharpen == "ihs": + ihs(pan, ms1, ms2, ms3, out, pid, sproc) elif sharpen == "pca": - grass.verbose(_("Using PCA/inverse PCA algorithm")) - grass.message(_("Creating PCA images and calculating eigenvectors...")) - - # initial PCA with RGB channels - pca_out = grass.read_command('i.pca', quiet=True, rescale='0,0', - input='%s,%s,%s' % (ms1, ms2, ms3), - output='tmp%s.pca' % pid) - if len(pca_out) < 1: - grass.fatal(_("Input has no data. Check region settings.")) - - b1evect = [] - b2evect = [] - b3evect = [] - for l in pca_out.replace('(', ',').replace(')', ',').splitlines(): - b1evect.append(float(l.split(',')[1])) - b2evect.append(float(l.split(',')[2])) - b3evect.append(float(l.split(',')[3])) - - # inverse PCA with hi res pan channel substituted for principal component 1 - pca1 = 'tmp%s.pca.1' % pid - pca2 = 'tmp%s.pca.2' % pid - pca3 = 'tmp%s.pca.3' % pid - b1evect1 = b1evect[0] - b1evect2 = b1evect[1] - b1evect3 = b1evect[2] - b2evect1 = b2evect[0] - b2evect2 = b2evect[1] - b2evect3 = b2evect[2] - b3evect1 = b3evect[0] - b3evect2 = b3evect[1] - b3evect3 = b3evect[2] - - outname = 'tmp%s_pan' % pid - panmatch = matchhist(pan, ms1, outname) - - grass.message(_("Performing inverse PCA ...")) - - stats1 = grass.parse_command("r.univar", map=ms1, flags='g', - parse=(grass.parse_key_val, - {'sep': '='})) - stats2 = grass.parse_command("r.univar", map=ms2, flags='g', - parse=(grass.parse_key_val, - {'sep': '='})) - stats3 = grass.parse_command("r.univar", map=ms3, flags='g', - parse=(grass.parse_key_val, - {'sep': '='})) - - b1mean = float(stats1['mean']) - b2mean = float(stats2['mean']) - b3mean = float(stats3['mean']) - - if sproc: - # serial processing - e = '''eval(k = "$ms1" + "$ms2" + "$ms3") - "$outr" = 1.0 * "$ms3" * "$panmatch3" / k - "$outg" = 1.0 * "$ms2" * "$panmatch2" / k - "$outb" = 1.0* "$ms1" * "$panmatch1" / k''' - - outr = '%s_red' % out - outg = '%s_green' % out - outb = '%s_blue' % out - - cmd1 = "$outb = (1.0 * $panmatch * $b1evect1) + ($pca2 * $b2evect1) + ($pca3 * $b3evect1) + $b1mean" - cmd2 = "$outg = (1.0 * $panmatch * $b1evect2) + ($pca2 * $b2evect1) + ($pca3 * $b3evect2) + $b2mean" - cmd3 = "$outr = (1.0 * $panmatch * $b1evect3) + ($pca2 * $b2evect3) + ($pca3 * $b3evect3) + $b3mean" - - cmd = '\n'.join([cmd1, cmd2, cmd3]) - - grass.mapcalc(cmd, outb=outb, outg=outg, outr=outr, - panmatch=panmatch, pca2=pca2, pca3=pca3, - b1evect1=b1evect1, b2evect1=b2evect1, b3evect1=b3evect1, - b1evect2=b1evect2, b2evect2=b2evect2, b3evect2=b3evect2, - b1evect3=b1evect3, b2evect3=b2evect3, b3evect3=b3evect3, - b1mean=b1mean, b2mean=b2mean, b3mean=b3mean, - overwrite=True) - else: - # parallel processing - pb = grass.mapcalc_start('%s_blue = (%s * %f) + (%s * %f) + (%s * %f) + %f' - % (out, panmatch, b1evect1, pca2, - b2evect1, pca3, b3evect1, b1mean), - overwrite=True) - - pg = grass.mapcalc_start('%s_green = (%s * %f) + (%s * %f) + (%s * %f) + %f' - % (out, panmatch, b1evect2, pca2, - b2evect2, pca3, b3evect2, b2mean), - overwrite=True) - - pr = grass.mapcalc_start('%s_red = (%s * %f) + (%s * %f) + (%s * ''%f) + %f' - % (out, panmatch, b1evect3, pca2, - b2evect3, pca3, b3evect3, b3mean), - overwrite=True) - - pr.wait() - pg.wait() - pb.wait() - - # Cleanup - grass.run_command('g.remove', flags='f', quiet=True, type="raster", - pattern='tmp%s*,%s' % (pid, panmatch)) - + pca(pan, ms1, ms2, ms3, out, pid, sproc) # Could add other sharpening algorithms here, e.g. wavelet transformation grass.message(_("Assigning grey equalized color tables to output images...")) + # equalized grey scales give best contrast + grass.message(_("setting pan-sharpened channels to equalized grey scale")) for ch in ['red', 'green', 'blue']: grass.run_command('r.colors', quiet=True, map="%s_%s" % (out, ch), flags="e", color='grey') @@ -326,13 +273,12 @@ # light, so output blue channed can be modified if bladjust: grass.message(_("Adjusting blue channel color table...")) - rules = grass.tempfile() - colors = open(rules, 'w') - colors.write('5 0 0 0\n20 200 200 200\n40 230 230 230\n67 255 255 255 \n') - colors.close() - - grass.run_command('r.colors', map="%s_blue" % out, rules=rules) - os.remove(rules) + blue_colors = ['0 0 0 0\n5% 0 0 0\n67% 255 255 255\n100% 255 255 255'] + # these previous colors are way too blue for landsat + # blue_colors = ['0 0 0 0\n10% 0 0 0\n20% 200 200 200\n40% 230 230 230\n67% 255 255 255\n100% 255 255 255'] + bc = grass.feed_command('r.colors', quiet = True, map = "%s_blue" % out, rules = "-") + bc.stdin.write('\n'.join(blue_colors)) + bc.stdin.close() # output notice grass.verbose(_("The following pan-sharpened output maps have been generated:")) @@ -348,14 +294,244 @@ for ch in ['red', 'green', 'blue']: grass.raster_history("%s_%s" % (out, ch)) - # create a group with the three output - grass.run_command('i.group', group=out, - input="{n}_red,{n}_blue,{n}_green".format(n=out)) + # create a group with the three outputs + #grass.run_command('i.group', group=out, + # input="{n}_red,{n}_blue,{n}_green".format(n=out)) + + # Cleanup + grass.message(_("cleaning up temp files")) + try: + grass.run_command('g.remove', flags="f", type="raster", + pattern="tmp%s*" % pid, quiet=True) + except: + "" + +def brovey(pan, ms1, ms2, ms3, out, pid, sproc): + grass.verbose(_("Using Brovey algorithm")) + + # pan/intensity histogram matching using linear regression + grass.message(_("Pan channel/intensity histogram matching using linear regression")) + outname = 'tmp%s_pan1' % pid + panmatch1 = matchhist(pan, ms1, outname) + + outname = 'tmp%s_pan2' % pid + panmatch2 = matchhist(pan, ms2, outname) + + outname = 'tmp%s_pan3' % pid + panmatch3 = matchhist(pan, ms3, outname) + + outr = '%s_red' % out + outg = '%s_green' % out + outb = '%s_blue' % out + + # calculate brovey transformation + grass.message(_("Calculating Brovey transformation...")) + + if sproc: + # serial processing + e = '''eval(k = "$ms1" + "$ms2" + "$ms3") + "$outr" = 1 * round("$ms3" * "$panmatch3" / k) + "$outg" = 1 * round("$ms2" * "$panmatch2" / k) + "$outb" = 1 * round("$ms1" * "$panmatch1" / k)''' + grass.mapcalc(e, outr=outr, outg=outg, outb=outb, + panmatch1=panmatch1, panmatch2=panmatch2, + panmatch3=panmatch3, ms1=ms1, ms2=ms2, ms3=ms3, + overwrite=True) + else: + # parallel processing + pb = grass.mapcalc_start('%s_blue = 1 * round((%s * %s) / (%s + %s + %s))' % + (out, ms1, panmatch1, ms1, ms2, ms3), + overwrite=True) + pg = grass.mapcalc_start('%s_green = 1 * round((%s * %s) / (%s + %s + %s))' % + (out, ms2, panmatch2, ms1, ms2, ms3), + overwrite=True) + pr = grass.mapcalc_start('%s_red = 1 * round((%s * %s) / (%s + %s + %s))' % + (out, ms3, panmatch3, ms1, ms2, ms3), + overwrite=True) + + pb.wait(), pg.wait(), pr.wait() + try: + pb.terminate(), pg.terminate(), pr.terminate() + except: + "" + + # Cleanup + try: + grass.run_command('g.remove', flags='f', quiet=True, type='raster', + name='%s,%s,%s' % (panmatch1, panmatch2, panmatch3)) + except: + "" + +def ihs(pan, ms1, ms2, ms3, out, pid, sproc): + grass.verbose(_("Using IHS<->RGB algorithm")) + # transform RGB channels into IHS color space + grass.message(_("Transforming to IHS color space...")) + grass.run_command('i.rgb.his', overwrite=True, + red=ms3, + green=ms2, + blue=ms1, + hue="tmp%s_hue" % pid, + intensity="tmp%s_int" % pid, + saturation="tmp%s_sat" % pid) + + # pan/intensity histogram matching using linear regression + target = "tmp%s_int" % pid + outname = "tmp%s_pan_int" % pid + panmatch = matchhist(pan, target, outname) + + # substitute pan for intensity channel and transform back to RGB color space + grass.message(_("Transforming back to RGB color space and sharpening...")) + grass.run_command('i.his.rgb', overwrite=True, + hue="tmp%s_hue" % pid, + intensity="%s" % panmatch, + saturation="tmp%s_sat" % pid, + red="%s_red" % out, + green="%s_green" % out, + blue="%s_blue" % out) # Cleanup - grass.run_command('g.remove', flags="f", type="raster", - pattern="tmp%s*" % pid, quiet=True) + try: + grass.run_command('g.remove', flags='f', quiet=True, type='raster', + name=panmatch) + except: + "" + +def pca(pan, ms1, ms2, ms3, out, pid, sproc): + + grass.verbose(_("Using PCA/inverse PCA algorithm")) + grass.message(_("Creating PCA images and calculating eigenvectors...")) + + # initial PCA with RGB channels + pca_out = grass.read_command('i.pca', quiet=True, rescale='0,0', + input='%s,%s,%s' % (ms1, ms2, ms3), + output='tmp%s.pca' % pid) + if len(pca_out) < 1: + grass.fatal(_("Input has no data. Check region settings.")) + + b1evect = [] + b2evect = [] + b3evect = [] + for l in pca_out.replace('(', ',').replace(')', ',').splitlines(): + b1evect.append(float(l.split(',')[1])) + b2evect.append(float(l.split(',')[2])) + b3evect.append(float(l.split(',')[3])) + + # inverse PCA with hi res pan channel substituted for principal component 1 + pca1 = 'tmp%s.pca.1' % pid + pca2 = 'tmp%s.pca.2' % pid + pca3 = 'tmp%s.pca.3' % pid + b1evect1 = b1evect[0] + b1evect2 = b1evect[1] + b1evect3 = b1evect[2] + b2evect1 = b2evect[0] + b2evect2 = b2evect[1] + b2evect3 = b2evect[2] + b3evect1 = b3evect[0] + b3evect2 = b3evect[1] + b3evect3 = b3evect[2] + + # Histogram matching + outname = 'tmp%s_pan1' % pid + panmatch1 = matchhist(pan, ms1, outname) + + outname = 'tmp%s_pan2' % pid + panmatch2 = matchhist(pan, ms2, outname) + + outname = 'tmp%s_pan3' % pid + panmatch3 = matchhist(pan, ms3, outname) + + grass.message(_("Performing inverse PCA ...")) + + # Get mean value of each channel + stats1 = grass.parse_command("r.univar", map=ms1, flags='g', + parse=(grass.parse_key_val, + {'sep': '='})) + stats2 = grass.parse_command("r.univar", map=ms2, flags='g', + parse=(grass.parse_key_val, + {'sep': '='})) + stats3 = grass.parse_command("r.univar", map=ms3, flags='g', + parse=(grass.parse_key_val, + {'sep': '='})) + + b1mean = float(stats1['mean']) + b2mean = float(stats2['mean']) + b3mean = float(stats3['mean']) + + if sproc: + # serial processing + outr = '%s_red' % out + outg = '%s_green' % out + outb = '%s_blue' % out + cmd1 = "$outb = 1 * round(($panmatch1 * $b1evect1) + ($pca2 * $b1evect2) + ($pca3 * $b1evect3) + $b1mean)" + cmd2 = "$outg = 1 * round(($panmatch2 * $b2evect1) + ($pca2 * $b2evect2) + ($pca3 * $b2evect3) + $b2mean)" + cmd3 = "$outr = 1 * round(($panmatch3 * $b3evect1) + ($pca2 * $b3evect2) + ($pca3 * $b3evect3) + $b3mean)" + + cmd = '\n'.join([cmd1, cmd2, cmd3]) + + grass.mapcalc(cmd, outb=outb, outg=outg, outr=outr, + panmatch1=panmatch1, + panmatch2=panmatch2, + panmatch3=panmatch3, + pca2=pca2, + pca3=pca3, + b1evect1=b1evect1, + b2evect1=b2evect1, + b3evect1=b3evect1, + b1evect2=b1evect2, + b2evect2=b2evect2, + b3evect2=b3evect2, + b1evect3=b1evect3, + b2evect3=b2evect3, + b3evect3=b3evect3, + b1mean=b1mean, + b2mean=b2mean, + b3mean=b3mean, + overwrite=True) + else: + # parallel processing + pb = grass.mapcalc_start('%s_blue = 1 * round((%s * %f) + (%s * %f) + (%s * %f) + %f)' + % (out, + panmatch1, + b1evect1, + pca2, + b1evect2, + pca3, + b1evect3, + b1mean), + overwrite=True) + + pg = grass.mapcalc_start('%s_green = 1 * round((%s * %f) + (%s * %f) + (%s * %f) + %f)' + % (out, + panmatch2, + b2evect1, + pca2, + b2evect2, + pca3, + b2evect3, + b2mean), + overwrite=True) + + pr = grass.mapcalc_start('%s_red = 1 * round((%s * %f) + (%s * %f) + (%s * %f) + %f)' + % (out, + panmatch3, + b3evect1, + pca2, + b3evect2, + pca3, + b3evect3, + b3mean), + overwrite=True) + + pb.wait(), pg.wait(), pr.wait() + try: + pb.terminate(), pg.terminate(), pr.terminate() + except: + "" + + # Cleanup + grass.run_command('g.remove', flags='f', quiet=True, type='raster', + name='%s,%s,%s' % (panmatch1, panmatch2, panmatch3)) def matchhist(original, target, matched): # pan/intensity histogram matching using numpy arrays @@ -369,9 +545,9 @@ # create a dictionary to hold arrays for each image arrays = {} - for i in images: + for img in images: # calculate number of cells for each grey value for for each image - stats_out = grass.pipe_command('r.stats', flags='cin', input=i, + stats_out = grass.pipe_command('r.stats', flags='cin', input=img, sep=':') stats = stats_out.communicate()[0].split('\n')[:-1] stats_dict = dict(s.split(':', 1) for s in stats) @@ -388,7 +564,7 @@ # cumulative distribution function (CDF) for each grey value. # Grey value is the integer (i4) and cdf is float (f4). - arrays[i] = np.zeros((256, ), dtype=('i4,f4')) + arrays[img] = np.zeros((256, ), dtype=('i4,f4')) cum_cells = 0 # cumulative total of cells for sum of current and all lower grey values for n in range(0, 256): @@ -404,7 +580,7 @@ cdf = float(cum_cells) / float(total_cells) # insert values into array - arrays[i][n] = (n, cdf) + arrays[img][n] = (n, cdf) # open file for reclass rules outfile = open(grass.tempfile(), 'w') @@ -424,7 +600,7 @@ for j in arrays[target]: # find the grey value in target that corresponds to the cdf # closest to the original cdf - if j[1] == i[1] + min_difference or j[1] == i[1] - min_difference: + if j[1] <= i[1] + min_difference and j[1] >= i[1] - min_difference: # build a reclass rules file from the original grey value and # corresponding grey value from target out_line = "%d = %d\n" % (i[0], j[0]) Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/scripts/i.pansharpen/i_pansharpen_rgb_brovey321.jpg and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/scripts/i.pansharpen/i_pansharpen_rgb_brovey321.jpg differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/scripts/i.pansharpen/i_pansharpen_rgb_brovey542.jpg and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/scripts/i.pansharpen/i_pansharpen_rgb_brovey542.jpg differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/scripts/i.pansharpen/i_pansharpen_rgb_ihs321.jpg and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/scripts/i.pansharpen/i_pansharpen_rgb_ihs321.jpg differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/scripts/i.pansharpen/i_pansharpen_rgb_ihs542.jpg and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/scripts/i.pansharpen/i_pansharpen_rgb_ihs542.jpg differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/scripts/i.pansharpen/i_pansharpen_rgb_landsat321.jpg and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/scripts/i.pansharpen/i_pansharpen_rgb_landsat321.jpg differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/scripts/i.pansharpen/i_pansharpen_rgb_landsat542.jpg and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/scripts/i.pansharpen/i_pansharpen_rgb_landsat542.jpg differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/scripts/i.pansharpen/i_pansharpen_rgb_pca321.jpg and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/scripts/i.pansharpen/i_pansharpen_rgb_pca321.jpg differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/scripts/i.pansharpen/i_pansharpen_rgb_pca542.jpg and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/scripts/i.pansharpen/i_pansharpen_rgb_pca542.jpg differ diff -Nru grass-7.6.1/scripts/i.spectral/i.spectral.html grass-7.8.0/scripts/i.spectral/i.spectral.html --- grass-7.6.1/scripts/i.spectral/i.spectral.html 2019-03-19 20:04:35.000000000 +0000 +++ grass-7.8.0/scripts/i.spectral/i.spectral.html 2019-05-18 15:50:05.000000000 +0000 @@ -50,4 +50,4 @@ Francesco Pirotti

    -Last changed: $Date: 2014-12-27 00:33:06 +0100 (Sat, 27 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/i.spectral/i.spectral.py grass-7.8.0/scripts/i.spectral/i.spectral.py --- grass-7.6.1/scripts/i.spectral/i.spectral.py 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/i.spectral/i.spectral.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -83,10 +83,6 @@ from grass.script.utils import try_rmdir from grass.script import core as gcore -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): try_rmdir(tmp_dir) diff -Nru grass-7.6.1/scripts/i.tasscap/i.tasscap.html grass-7.8.0/scripts/i.tasscap/i.tasscap.html --- grass-7.6.1/scripts/i.tasscap/i.tasscap.html 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/i.tasscap/i.tasscap.html 2019-06-03 20:34:21.000000000 +0000 @@ -1,7 +1,7 @@

    DESCRIPTION

    i.tasscap calculates Tasseled Cap (Kauth Thomas, TC) transformation -for Landsat TM data (TM4, TM5, ETM7) and MODIS data. +for Landsat TM data (TM4, TM5, ETM7), MODIS and Sentinel-2 data. The tasseled cap transformation is effectively a compression method to reduce multiple spectral data into a few bands. The method was originally @@ -27,7 +27,7 @@ Calculation of TC maps from North Carolina Landsat 7 ETM scene:
    -# See manual page of i.landsat.toar for preprocessing
    +# See manual page of i.landsat.toar for pre-processing
     
     g.region raster=lsat7_2002_toar.1 -p
     
    @@ -92,9 +92,12 @@
       http://landcover.usgs.gov/pdf/tasseled.pdf
     
    This is published as well in INT. J. OF RS, 2002, VOL 23, NO. 8, 1741-1748. -
  • MODIS Tasselled Cap coefficients - Ref: Lobser & Cohen (2007). MODIS tasselled cap: +
  • MODIS Tasseled Cap coefficients - Ref: Lobser & Cohen (2007). MODIS tasseled cap: land cover characteristics expressed through transformed MODIS data. International Journal of Remote Sensing, Volume 28(22), Table 3 +
  • Sentinel-2 Tasseled Cap coefficients - Ref: Nedkov, R. (2017). Orthogonal transformation + of segmented images from the satellite Sentinel-2. + Comptes rendus de l'Académie bulgare des sciences, 70:687-692.

    SEE ALSO

    @@ -114,4 +117,4 @@

    Converted to Python by Glynn Clements -

    Last changed: $Date: 2018-03-02 23:18:09 +0100 (Fri, 02 Mar 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/i.tasscap/i.tasscap.py grass-7.8.0/scripts/i.tasscap/i.tasscap.py --- grass-7.6.1/scripts/i.tasscap/i.tasscap.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/i.tasscap/i.tasscap.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,11 +1,12 @@ -#!/usr/bin/env python - +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- ############################################################################ # # MODULE: i.tasscap # AUTHOR(S): Agustin Lobo, Markus Neteler # Converted to Python by Glynn Clements # Code improvements by Leonardo Perathoner +# Sentinel-2 support by Veronica Andreo # # PURPOSE: At-satellite reflectance based tasseled cap transformation. # COPYRIGHT: (C) 1997-2014 by the GRASS Development Team @@ -36,12 +37,17 @@ # based on Landsat 8 at-satellite reflectance. Remote Sensing Letters 5, 423-431. # doi:10.1080/2150704X.2014.915434 # -# MODIS Tasselled Cap coefficients +# MODIS Tasseled Cap coefficients # https://gis.stackexchange.com/questions/116107/tasseled-cap-transformation-on-modis-in-grass/116110 # Ref: Lobser & Cohen (2007). MODIS tasselled cap: land cover characteristics # expressed through transformed MODIS data. # International Journal of Remote Sensing, Volume 28(22), Table 3 # +# Sentinel-2 Tasseled Cap coefficients +# https://www.researchgate.net/publication/329184434_ORTHOGONAL_TRANSFORMATION_OF_SEGMENTED_IMAGES_FROM_THE_SATELLITE_SENTINEL-2 +# Nedkov, R. (2017). ORTHOGONAL TRANSFORMATION OF SEGMENTED IMAGES FROM THE SATELLITE SENTINEL-2. +# Comptes rendus de l'Académie bulgare des sciences. 70. 687-692. +# ############################################################################# #%Module @@ -54,11 +60,11 @@ #%end #%option G_OPT_R_INPUTS -#% description: For Landsat4-7: bands 1, 2, 3, 4, 5, 7; for Landsat8: bands 2, 3, 4, 5, 6, 7; for MODIS: bands 1, 2, 3, 4, 5, 6, 7 +#% description: For Landsat4-7: bands 1, 2, 3, 4, 5, 7; for Landsat8: bands 2, 3, 4, 5, 6, 7; for MODIS: bands 1, 2, 3, 4, 5, 6, 7; for Sentinel-2: bands 1 to 12, 8A #%end #%option G_OPT_R_BASENAME_OUTPUT -#% label: Name for output basename raster map(s) +#% label: basename for output raster map(s) #%end #%option @@ -67,19 +73,15 @@ #% description: Satellite sensor #% required: yes #% multiple: no -#% options: landsat4_tm,landsat5_tm,landsat7_etm,landsat8_oli,modis -#% descriptions: landsat4_tm;Use transformation rules for Landsat 4 TM;landsat5_tm;Use transformation rules for Landsat 5 TM;landsat7_etm;Use transformation rules for Landsat 7 ETM;landsat8_oli;Use transformation rules for Landsat 8 OLI;modis;Use transformation rules for MODIS +#% options: landsat4_tm,landsat5_tm,landsat7_etm,landsat8_oli,modis,sentinel2 #%end import grass.script as grass -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) # weights for 6 Landsat bands: TM4, TM5, TM7, OLI # MODIS: Red, NIR1, Blue, Green, NIR2, SWIR1, SWIR2 +# Sentinel-2: B1 to B12, B8A parms = [[(0.3037, 0.2793, 0.4743, 0.5585, 0.5082, 0.1863), # Landsat TM4 (-0.2848, -0.2435, -0.5435, 0.7243, 0.0840, -0.1800), (0.1509, 0.1973, 0.3279, 0.3406, -0.7112, -0.4572)], @@ -97,13 +99,16 @@ (-0.8239, 0.0849, 0.4396, -0.0580, 0.2013, -0.2773)], [(0.4395, 0.5945, 0.2460, 0.3918, 0.3506, 0.2136, 0.2678), # MODIS (-0.4064, 0.5129, -0.2744, -0.2893, 0.4882, -0.0036, -0.4169), - (0.1147, 0.2489, 0.2408, 0.3132, -0.3122, -0.6416, -0.5087)]] + (0.1147, 0.2489, 0.2408, 0.3132, -0.3122, -0.6416, -0.5087)], + [(0.0356, 0.0822, 0.1360, 0.2611, 0.2964, 0.3338, 0.3877, 0.3895, 0.0949, 0.0009, 0.3882, 0.1366, 0.4750), # Sentinel-2 + (-0.0635, -0.1128, -0.1680, -0.3480, -0.3303, 0.0852, 0.3302, 0.3165, 0.0467, -0.0009, -0.4578, -0.4064, 0.3625), + (0.0649, 0.1363, 0.2802, 0.3072, 0.5288, 0.1379, -0.0001, -0.0807, -0.0302, 0.0003, -0.4064, -0.5602, -0.1389)]] # satellite information satellites = ['landsat4_tm', 'landsat5_tm', 'landsat7_etm', 'landsat8_oli', - 'modis'] -used_bands = [6, 6, 6, 6, 7] + 'modis', 'sentinel2'] +used_bands = [6, 6, 6, 6, 7, 13] # components information ordinals = ["first", "second", "third", "fourth"] @@ -131,6 +136,19 @@ k7=k7, **bands) +def calc1bands13(out, bands, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13): + """ + Tasseled cap transformation equation for Sentinel-2 bands + """ + equation = ('$out = $k1 * $in1band + $k2 * $in2band + $k3 * $in3band + ' + '$k4 * $in4band + $k5 * $in5band + $k6 * $in6band + $k7 * ' + '$in7band + $k8 * $in8band + $k9 * $in9band + $k10 * $in10band + ' + '$k11 * $in11band + $k12 * $in12band + $k13 * $in13band') + grass.mapcalc(equation, out=out, k1=k1, k2=k2, k3=k3, k4=k4, k5=k5, k6=k6, + k7=k7, k8=k8, k9=k9, k10=k10, k11=k11, k12=k12, k13=k13, + **bands) + + def calcN(outpre, bands, satel): """ Calculating Tasseled Cap components @@ -165,13 +183,15 @@ for i, band in enumerate(inputs): band_num = i + 1 bands['in' + str(band_num) + 'band'] = band - grass.debug(1, bands) + grass.debug(bands, 1) # core tasseled cap components computation calcN(output_basename, bands, satellite) # assign "Data Description" field in all four component maps - for i, comp in enumerate(names): + num_comp=len(parms[satellites.index(satellite)]) + for i in range(0,num_comp): + comp=names[i] grass.run_command('r.support', map="%s.%d" % (output_basename, i + 1), description="Tasseled Cap %d: %s" % (i + 1, comp)) diff -Nru grass-7.6.1/scripts/m.proj/m.proj.html grass-7.8.0/scripts/m.proj/m.proj.html --- grass-7.6.1/scripts/m.proj/m.proj.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/m.proj/m.proj.html 2019-05-18 15:50:05.000000000 +0000 @@ -221,4 +221,4 @@ GRASS GIS 5.

    -Last changed: $Date: 2017-08-16 08:58:03 +0200 (Wed, 16 Aug 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/m.proj/m.proj.py grass-7.8.0/scripts/m.proj/m.proj.py --- grass-7.6.1/scripts/m.proj/m.proj.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/m.proj/m.proj.py 2019-09-04 13:16:01.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ MODULE: m.proj @@ -10,7 +10,7 @@ PURPOSE: cs2cs reprojection frontend for a list of coordinates. Replacement for m.proj2 from GRASS 5 -COPYRIGHT: (c) 2006-2014 Hamish Bowman, and the GRASS Development Team +COPYRIGHT: (c) 2006-2019 Hamish Bowman, and the GRASS Development Team This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details. @@ -90,18 +90,20 @@ #% description: Include column names in output file #% guisection: Output #%end - +#%rules +#% required: coordinates, input +#% exclusive: coordinates, input +#% exclusive: proj_in, -i +#% exclusive: proj_out, -o +#% exclusive: -i, -o +#%end import sys import os import threading -from grass.script.utils import separator, parse_key_val +from grass.script.utils import separator, parse_key_val, encode, decode from grass.script import core as gcore -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - class TrThread(threading.Thread): @@ -117,6 +119,7 @@ if not line: break line = line.replace(self.ifs, ' ') + line = encode(line) self.outf.write(line) self.outf.flush() @@ -142,25 +145,6 @@ "cs2cs program not found, install PROJ.4 first: \ http://proj.maptools.org")) - # check for overenthusiasm - if proj_in and ll_in: - gcore.fatal(_("Choose only one input parameter method")) - - if proj_out and ll_out: - gcore.fatal(_("Choose only one output parameter method")) - - if ll_in and ll_out: - gcore.fatal(_("Choose only one auto-projection parameter method")) - - if output and not gcore.overwrite() and os.path.exists(output): - gcore.fatal(_("Output file already exists")) - - if not coords and not input: - gcore.fatal(_("One of and must be given")) - if coords and input: - gcore.fatal(_( - "Options and are mutually exclusive")) - # parse field separator # FIXME: input_x,y needs to split on multiple whitespace between them if fs == ',': @@ -231,7 +215,7 @@ fd = open(tmpfile, "w") fd.write("%s%s%s\n" % (x, ifs, y)) fd.close() - inf = file(tmpfile) + inf = open(tmpfile) else: if input == '-': infile = None @@ -240,7 +224,7 @@ infile = input if not os.path.exists(infile): gcore.fatal(_("Unable to read input data")) - inf = file(infile) + inf = open(infile) gcore.debug("input file=[%s]" % infile) # set up output file @@ -279,7 +263,7 @@ outf.write("x%sy%sz\n" % (ofs, ofs)) for line in p.stdout: try: - xy, z = line.split(' ', 1) + xy, z = decode(line).split(' ', 1) x, y = xy.split('\t') except ValueError: gcore.fatal(line) @@ -290,7 +274,7 @@ if include_header: outf.write("input_x%sinput_y%sx%sy%sz\n" % (ofs, ofs, ofs, ofs)) for line in p.stdout: - inXYZ, x, rest = line.split('\t') + inXYZ, x, rest = decode(line).split('\t') inX, inY = inXYZ.split(' ')[:2] y, z = rest.split(' ', 1) outf.write('%s%s%s%s%s%s%s%s%s\n' % diff -Nru grass-7.6.1/scripts/r3.in.xyz/r3.in.xyz.html grass-7.8.0/scripts/r3.in.xyz/r3.in.xyz.html --- grass-7.6.1/scripts/r3.in.xyz/r3.in.xyz.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/r3.in.xyz/r3.in.xyz.html 2019-05-18 15:50:05.000000000 +0000 @@ -87,4 +87,4 @@ Dunedin, New Zealand

    -Last changed: $Date: 2015-05-11 02:11:34 +0200 (Mon, 11 May 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r3.in.xyz/r3.in.xyz.py grass-7.8.0/scripts/r3.in.xyz/r3.in.xyz.py --- grass-7.6.1/scripts/r3.in.xyz/r3.in.xyz.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/r3.in.xyz/r3.in.xyz.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: r3.in.xyz @@ -174,10 +174,6 @@ from grass.script import core as grass from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): grass.run_command('g.remove', flags='f', diff -Nru grass-7.6.1/scripts/r.blend/r.blend.html grass-7.8.0/scripts/r.blend/r.blend.html --- grass-7.6.1/scripts/r.blend/r.blend.html 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/r.blend/r.blend.html 2019-05-18 15:50:05.000000000 +0000 @@ -37,4 +37,4 @@ Updated to GRASS 5.7 by Michael Barton, Arizona State University

    -Last changed: $Date: 2016-03-18 15:09:00 +0100 (Fri, 18 Mar 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.blend/r.blend.py grass-7.8.0/scripts/r.blend/r.blend.py --- grass-7.6.1/scripts/r.blend/r.blend.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.blend/r.blend.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -47,10 +47,6 @@ import string import grass.script as gscript -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): first = options['first'] diff -Nru grass-7.6.1/scripts/r.blend/testsuite/test_r_blend.py grass-7.8.0/scripts/r.blend/testsuite/test_r_blend.py --- grass-7.6.1/scripts/r.blend/testsuite/test_r_blend.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.blend/testsuite/test_r_blend.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,47 @@ +""" +Created on Sun Jun 07 21:42:39 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule +from grass.script.core import run_command + + +class TestRBlend(TestCase): + """Test r.blend script""" + + map1 = 'aspect' + map2 = 'elevation' + temp1 = 'elev_shade_blend.r' + temp2 = 'elev_shade_blend.g' + temp3 = 'elev_shade_blend.b' + + @classmethod + def setUpClass(cls): + """Create maps in a small region.""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.map1, flags='p') + run_command('d.mon', start='wx0') + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.runModule('g.remove', flags='f', type='raster', + name=(cls.temp1, cls.temp2, cls.temp3)) + cls.del_temp_region() + run_command('d.mon', stop='wx0') + + def test_blend(self): + """blends color test""" + module = SimpleModule('r.blend', first=self.map1, second=self.map2, + output='elev_shade_blend') + self.assertModule(module) + + run_command('d.rgb', red=self.temp1, green=self.temp2, + blue=self.temp3) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.buffer.lowmem/r.buffer.lowmem.html grass-7.8.0/scripts/r.buffer.lowmem/r.buffer.lowmem.html --- grass-7.6.1/scripts/r.buffer.lowmem/r.buffer.lowmem.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.buffer.lowmem/r.buffer.lowmem.html 2019-05-18 15:50:05.000000000 +0000 @@ -62,4 +62,4 @@ Low-memory Python version by Glynn Clements

    -Last changed: $Date: 2013-01-04 16:21:51 +0100 (Fri, 04 Jan 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.buffer.lowmem/r.buffer.lowmem.py grass-7.8.0/scripts/r.buffer.lowmem/r.buffer.lowmem.py --- grass-7.6.1/scripts/r.buffer.lowmem/r.buffer.lowmem.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.buffer.lowmem/r.buffer.lowmem.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -46,10 +46,8 @@ import atexit import math import grass.script as grass +from grass.script.utils import encode -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) scales = { 'meters': 1.0, @@ -124,10 +122,12 @@ p = grass.feed_command('r.category', map=output, separator=':', rules='-') - p.stdin.write("1:distances calculated from these locations\n") + msg = "1:distances calculated from these locations\n" + p.stdin.write(encode(msg)) d0 = "0" for n, d in enumerate(distances): - p.stdin.write("%d:%s-%s %s\n" % (n + 2, d0, d, units)) + msg = "%d:%s-%s %s\n" % (n + 2, d0, d, units) + p.stdin.write(encode(msg)) d0 = d p.stdin.close() p.wait() diff -Nru grass-7.6.1/scripts/r.colors.stddev/r.colors.stddev.html grass-7.8.0/scripts/r.colors.stddev/r.colors.stddev.html --- grass-7.6.1/scripts/r.colors.stddev/r.colors.stddev.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/r.colors.stddev/r.colors.stddev.html 2019-05-18 15:50:05.000000000 +0000 @@ -35,4 +35,4 @@ Hamish Bowman, Dunedin, New Zealand -

    Last changed: $Date: 2016-05-16 12:06:50 +0200 (Mon, 16 May 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.colors.stddev/r.colors.stddev.py grass-7.8.0/scripts/r.colors.stddev/r.colors.stddev.py --- grass-7.6.1/scripts/r.colors.stddev/r.colors.stddev.py 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/r.colors.stddev/r.colors.stddev.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: r.colors.stddev @@ -34,6 +34,7 @@ import atexit import grass.script as gscript +from grass.script.utils import decode def z(n): @@ -56,7 +57,7 @@ if not zero: s = gscript.read_command('r.univar', flags='g', map=map) - kv = gscript.parse_key_val(s) + kv = gscript.parse_key_val(decode(s)) global mean, stddev mean = float(kv['mean']) stddev = float(kv['stddev']) @@ -103,7 +104,7 @@ percentile=[95.45, 68.2689, 99.7300]) - kv = gscript.parse_key_val(s) + kv = gscript.parse_key_val(decode(s)) stddev1 = float(kv['percentile_68_2689']) stddev2 = float(kv['percentile_95_45']) diff -Nru grass-7.6.1/scripts/r.drain/r.drain.html grass-7.8.0/scripts/r.drain/r.drain.html --- grass-7.6.1/scripts/r.drain/r.drain.html 2019-03-19 20:04:36.000000000 +0000 +++ grass-7.8.0/scripts/r.drain/r.drain.html 2019-05-22 21:47:51.000000000 +0000 @@ -313,4 +313,4 @@ Roberto Flor (ITC-irst, Trento, Italy)

    -Last changed: $Date: 2018-12-26 17:29:08 +0100 (Wed, 26 Dec 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.drain/r.drain.py grass-7.8.0/scripts/r.drain/r.drain.py --- grass-7.6.1/scripts/r.drain/r.drain.py 2019-03-19 20:04:36.000000000 +0000 +++ grass-7.8.0/scripts/r.drain/r.drain.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: r.drain diff -Nru grass-7.6.1/scripts/r.fillnulls/r.fillnulls.html grass-7.8.0/scripts/r.fillnulls/r.fillnulls.html --- grass-7.6.1/scripts/r.fillnulls/r.fillnulls.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.fillnulls/r.fillnulls.html 2019-05-18 15:50:05.000000000 +0000 @@ -134,4 +134,4 @@ Improvement by Hamish Bowman, NZ

    -Last changed: $Date: 2018-08-27 18:32:33 +0200 (Mon, 27 Aug 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.fillnulls/r.fillnulls.py grass-7.8.0/scripts/r.fillnulls/r.fillnulls.py --- grass-7.6.1/scripts/r.fillnulls/r.fillnulls.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.fillnulls/r.fillnulls.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -111,14 +111,11 @@ import sys import os import atexit +import subprocess import grass.script as grass from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - tmp_rmaps = list() tmp_vmaps = list() usermask = None @@ -258,7 +255,7 @@ file=cats_file_name, quiet=quiet) cat_list = list() - cats_file = file(cats_file_name) + cats_file = open(cats_file_name) for line in cats_file: cat_list.append(line.rstrip('\n')) cats_file.close() @@ -456,16 +453,54 @@ reg = grass.region() # launch r.resamp.bspline tmp_rmaps.append(prefix + 'filled') + # If there are no NULL cells, r.resamp.bslpine call + # will end with an error although for our needs it's fine + # Only problem - this state must be read from stderr + new_env = dict(os.environ) + new_env['LC_ALL'] = 'C' if usermask: - grass.run_command('r.resamp.bspline', input=input, mask=usermask, - output=prefix + 'filled', method=method, - ew_step=3 * reg['ewres'], ns_step=3 * reg['nsres'], - lambda_=lambda_, memory=memory, flags='n') + try: + p = grass.core.start_command( + 'r.resamp.bspline', + input=input, + mask=usermask, + output=prefix + 'filled', + method=method, + ew_step=3 * reg['ewres'], + ns_step=3 * reg['nsres'], + lambda_=lambda_, + memory=memory, + flags='n', + stderr=subprocess.PIPE, + env=new_env) + stdout, stderr = p.communicate() + if "No NULL cells found" in stderr: + grass.run_command('g.copy', raster='%s,%sfilled' % (input, prefix), overwrite=True) + p.returncode = 0 + grass.warning(_("Input map <%s> has no holes. Copying to output without modification.") % (input,)) + except CalledModuleError as e: + grass.fatal(_("Failure during bspline interpolation. Error message: %s") % stderr) else: - grass.run_command('r.resamp.bspline', input=input, - output=prefix + 'filled', method=method, - ew_step=3 * reg['ewres'], ns_step=3 * reg['nsres'], - lambda_=lambda_, memory=memory, flags='n') + try: + p = grass.core.start_command( + 'r.resamp.bspline', + input=input, + output=prefix + 'filled', + method=method, + ew_step=3 * reg['ewres'], + ns_step=3 * reg['nsres'], + lambda_=lambda_, + memory=memory, + flags='n', + stderr=subprocess.PIPE, + env=new_env) + stdout, stderr = p.communicate() + if "No NULL cells found" in stderr: + grass.run_command('g.copy', raster='%s,%sfilled' % (input, prefix), overwrite=True) + p.returncode = 0 + grass.warning(_("Input map <%s> has no holes. Copying to output without modification.") % (input,)) + except CalledModuleError as e: + grass.fatal(_("Failure during bspline interpolation. Error message: %s") % stderr) # restoring user's mask, if present: if usermask: @@ -505,6 +540,7 @@ grass.message(_("Done.")) + if __name__ == "__main__": options, flags = grass.parser() atexit.register(cleanup) diff -Nru grass-7.6.1/scripts/r.fillnulls/testsuite/test_r_fillnulls.py grass-7.8.0/scripts/r.fillnulls/testsuite/test_r_fillnulls.py --- grass-7.6.1/scripts/r.fillnulls/testsuite/test_r_fillnulls.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.fillnulls/testsuite/test_r_fillnulls.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,48 @@ +""" +Created on Sun Jun 07 21:57:07 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule +from grass.script.core import run_command + + +class TestRFillNulls(TestCase): + """Test r.fillnulls script""" + + mapName = 'elev_srtm_30m' + expression = 'elev_srtm_30m_filt = if(elev_srtm_30m < 50.0, \ + null(), elev_srtm_30m)' + mapNameCalc = 'elev_srtm_30m_filt' + mapComplete = 'elev_srtm_30m_complete' + values = 'null_cells=0' + + @classmethod + def setUpClass(cls): + """Create maps in a small region.""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.runModule('g.remove', flags='f', type='raster', + name=(cls.mapNameCalc, cls.mapComplete)) + cls.del_temp_region() + + def test_fill_nulls(self): + """Fill nulls test""" + run_command('r.mapcalc', expression=self.expression) + + module = SimpleModule('r.fillnulls', input=self.mapNameCalc, + output=self.mapComplete, tension=20) + self.assertModule(module) + + self.assertRasterFitsUnivar(raster=self.mapComplete, + reference=self.values) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.grow/r.grow.html grass-7.8.0/scripts/r.grow/r.grow.html --- grass-7.6.1/scripts/r.grow/r.grow.html 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/r.grow/r.grow.html 2019-05-22 21:47:51.000000000 +0000 @@ -89,4 +89,4 @@ U.S. Army Construction Engineering Research Laboratory

    Glynn Clements -

    Last changed: $Date: 2018-12-06 17:53:42 +0100 (Thu, 06 Dec 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.grow/r.grow.py grass-7.8.0/scripts/r.grow/r.grow.py --- grass-7.6.1/scripts/r.grow/r.grow.py 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/r.grow/r.grow.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -67,10 +67,6 @@ import grass.script as grass from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - # what to do in case of user break: def cleanup(): diff -Nru grass-7.6.1/scripts/r.grow/testsuite/test_r_grow.py grass-7.8.0/scripts/r.grow/testsuite/test_r_grow.py --- grass-7.6.1/scripts/r.grow/testsuite/test_r_grow.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.grow/testsuite/test_r_grow.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,49 @@ +""" +Created on Sun Jun 07 22:09:41 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule +from grass.script.core import run_command + + +class TestRGrow(TestCase): + """Test r.grow script""" + + mapName = 'lakes' + mapGrownOutput = 'lakes_grown_100m' + mapShrunkOutput = 'lakes_shrunk_100m' + + @classmethod + def setUpClass(cls): + """Create maps in a small region.""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.runModule('g.remove', flags='f', type='raster', + name=(cls.mapGrownOutput, + cls.mapShrunkOutput)) + cls.del_temp_region() + + def test_grow(self): + """Grow test""" + module = SimpleModule('r.grow', input=self.mapName, + output=self.mapGrownOutput, + radius=10) + self.assertModule(module) + + def test_shrink(self): + """Shrink test""" + module = SimpleModule('r.grow', input=self.mapName, + output=self.mapShrunkOutput, + radius=-10) + self.assertModule(module) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.import/r.import.html grass-7.8.0/scripts/r.import/r.import.html --- grass-7.6.1/scripts/r.import/r.import.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.import/r.import.html 2019-05-18 15:50:05.000000000 +0000 @@ -141,4 +141,4 @@ Improvements: Martin Landa, Anna Petrasova

    -Last changed: $Date: 2017-08-19 17:23:37 +0200 (Sat, 19 Aug 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.import/r.import.py grass-7.8.0/scripts/r.import/r.import.py --- grass-7.6.1/scripts/r.import/r.import.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.import/r.import.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -128,19 +128,18 @@ import grass.script as grass from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - # initialize global vars TMPLOC = None SRCGISRC = None +TGTGISRC = None GISDBASE = None TMP_REG_NAME = None def cleanup(): + if TGTGISRC: + os.environ['GISRC'] = str(TGTGISRC) # remove temp location if TMPLOC: grass.try_rmdir(os.path.join(GISDBASE, TMPLOC)) @@ -153,7 +152,7 @@ def main(): - global TMPLOC, SRCGISRC, GISDBASE, TMP_REG_NAME + global TMPLOC, SRCGISRC, TGTGISRC, GISDBASE, TMP_REG_NAME GDALdatasource = options['input'] output = options['output'] @@ -207,7 +206,7 @@ tgtmapset = grassenv['MAPSET'] GISDBASE = grassenv['GISDBASE'] - tgtgisrc = os.environ['GISRC'] + TGTGISRC = os.environ['GISRC'] SRCGISRC = grass.tempfile() TMPLOC = 'temp_import_location_' + str(os.getpid()) @@ -266,7 +265,7 @@ grass.fatal(_("Input contains GCPs, rectification is required")) # switch to target location - os.environ['GISRC'] = str(tgtgisrc) + os.environ['GISRC'] = str(TGTGISRC) region = grass.region() @@ -323,6 +322,9 @@ try: grass.run_command('v.proj', input=vreg, output=vreg, location=tgtloc, mapset=tgtmapset, quiet=True) + # test if v.proj created a valid area + if grass.vector_info_topo(vreg)['areas'] != 1: + rass.fatal(_("Please check the 'extent' parameter")) except CalledModuleError: grass.fatal(_("Unable to reproject to source location")) @@ -339,7 +341,7 @@ grass.run_command('g.remove', type='vector', name=vreg, flags='f', quiet=True) - os.environ['GISRC'] = str(tgtgisrc) + os.environ['GISRC'] = str(TGTGISRC) grass.run_command('g.remove', type='vector', name=vreg, flags='f', quiet=True) diff -Nru grass-7.6.1/scripts/r.in.aster/r.in.aster.html grass-7.8.0/scripts/r.in.aster/r.in.aster.html --- grass-7.6.1/scripts/r.in.aster/r.in.aster.html 2019-03-19 20:04:47.000000000 +0000 +++ grass-7.8.0/scripts/r.in.aster/r.in.aster.html 2019-05-18 15:50:05.000000000 +0000 @@ -20,5 +20,5 @@ Michael Barton, Arizona State University and Paul Kelly -

    Last changed: $Date: 2016-01-29 10:29:57 +0100 (Fri, 29 Jan 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.in.aster/r.in.aster.py grass-7.8.0/scripts/r.in.aster/r.in.aster.py --- grass-7.6.1/scripts/r.in.aster/r.in.aster.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.in.aster/r.in.aster.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -56,10 +56,6 @@ import platform import grass.script as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - bands = { 'L1A': { '1': "VNIR_Band1:ImageData", diff -Nru grass-7.6.1/scripts/r.in.srtm/r.in.srtm.html grass-7.8.0/scripts/r.in.srtm/r.in.srtm.html --- grass-7.6.1/scripts/r.in.srtm/r.in.srtm.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.in.srtm/r.in.srtm.html 2019-05-22 21:47:51.000000000 +0000 @@ -46,4 +46,4 @@ Improved by W. Kyngesburye and H. Bowman
    Update for SRTM V3 by Markus Metz -

    Last changed: $Date: 2018-11-09 14:36:41 +0100 (Fri, 09 Nov 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.in.srtm/r.in.srtm.py grass-7.8.0/scripts/r.in.srtm/r.in.srtm.py --- grass-7.6.1/scripts/r.in.srtm/r.in.srtm.py 2019-03-19 20:04:47.000000000 +0000 +++ grass-7.8.0/scripts/r.in.srtm/r.in.srtm.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -136,10 +136,6 @@ from grass.exceptions import CalledModuleError import zipfile as zfile -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): if not in_temp: @@ -263,13 +259,13 @@ header = tmpl % (ulxmap, ulymap) hdrfile = tile + '.hdr' - outf = file(hdrfile, 'w') + outf = open(hdrfile, 'w') outf.write(header) outf.close() # create prj file: To be precise, we would need EGS96! But who really cares... prjfile = tile + '.prj' - outf = file(prjfile, 'w') + outf = open(prjfile, 'w') outf.write(proj) outf.close() diff -Nru grass-7.6.1/scripts/r.in.wms/r.in.wms.html grass-7.8.0/scripts/r.in.wms/r.in.wms.html --- grass-7.6.1/scripts/r.in.wms/r.in.wms.html 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/r.in.wms/r.in.wms.html 2019-06-03 20:34:21.000000000 +0000 @@ -16,6 +16,10 @@ request (see examples)

    +If possible, the EPSG code of the current location should be used with the +srs option to avoid unnecessary reprojection. + +

    When using GDAL WMS driver (driver=WMS_GDAL), the GDAL library needs to be built with WMS support, see GDAL WMS manual page @@ -49,6 +53,7 @@ # OSM g.region n=90 s=-90 w=-180 e=180 res=0:10:00 -p r.in.wms url="http://watzmann-geog.urz.uni-heidelberg.de/cached/osm" layers=osm_auto:all output=osm format=png +r.info osm

  • @@ -57,9 +62,11 @@
     
     # TOPO-OSM-WMS
     r.in.wms url="http://ows.mundialis.de/services/service?" layer=TOPO-OSM-WMS output=topo_osm format=png
    +r.info topo_osm
     
     # TOPO-WMS
     r.in.wms url="http://ows.mundialis.de/services/service?" layer=TOPO-WMS output=topo format=png
    +r.info topo
     

    More OSM WMS servers can be found online, e.g. on the OSM wiki in a @@ -70,6 +77,7 @@

     r.in.wms url="http://www2.demis.nl/WMS/wms.asp" layers=Countries,Borders,Coastline output=countries srs=4326 format=png 
    +r.info countries
     

    Sentinel-2 satellite cloud free global coverage

    @@ -78,6 +86,7 @@ # North Carolina sample data g.region raster=elevation -p r.in.wms url="https://tiles.maps.eox.at/wms?" layers=s2cloudless output=sentinel2 format=png +r.info sentinel2
    @@ -90,6 +99,7 @@
     r.in.wms url="http://gpp3-wxs.ign.fr/yourAPIkey/geoportail/wmts" layers=ORTHOIMAGERY.ORTHOPHOTOS \
              output=orthophoto srs=3857 format=jpeg driver=WMTS_GRASS style=normal password="*" username="*"
    +r.info orthophoto
     
    Note: username, password and API key can be obtained from IGN API website @@ -101,13 +111,35 @@
    -r.in.wms url="http://geoportal.cuzk.cz/WMTS_ORTOFOTO/WMTService.aspx" layers=orto output=ortofoto \
    +r.in.wms url="http://geoportal.cuzk.cz/WMTS_ORTOFOTO/WMTService.aspx" layers=orto output=orthophoto \
              srs=3857 format=jpeg driver=WMTS_GRASS style=default
    +r.info orthophoto
     
    Note: data are provided by Czech office for surveying, mapping and cadastre. + +

    Satellite data covering Europe

    + +Copernicus Core003 View Services - Optical VHR2 coverage over EU 2011-2013 (provided by JRC; +usage is restricted to non-commercial activities): + +
    +# get WMS layer list
    +r.in.wms -c url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?"
    +r.in.wms -c url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?" | grep Name
    +
    +# spatial subset of Europe
    +# enlarging maxcols and maxrows in order to minimize impact of copyright notice in map
    +g.region n=56 s=47 w=5 e=16 res=0:00:10 -pa
    +r.in.wms url="http://cidportal.jrc.ec.europa.eu/copernicus/services/ows/wms/public/core003?" \
    +         layer="OI.Mosaic.NaturalColor.Feathering" output="jrc_copernicus_core003_mosaik" \
    +         maxcols=3400 maxrows=3400
    +r.info jrc_copernicus_core003_mosaik
    +
    + +

    REQUIREMENTS

    r.in.wms requires the gdalwarp @@ -140,4 +172,4 @@ (bachelor's final project 2012, mentor: Martin Landa)

    -Last changed: $Date: 2019-03-06 15:13:47 +0100 (Wed, 06 Mar 2019) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.in.wms/r.in.wms.py grass-7.8.0/scripts/r.in.wms/r.in.wms.py --- grass-7.6.1/scripts/r.in.wms/r.in.wms.py 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/r.in.wms/r.in.wms.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ MODULE: r.in.wms @@ -145,6 +145,20 @@ #% guisection: Map style #%end +#%option +#% key: proxy +#% label: HTTP proxy only GDAL driver (GDAL_HTTP_PROXY) +#% type: string +#% description: HTTP proxy +#%end + +#%option +#% key: proxy_user_pw +#% label: User and password for HTTP proxy only for GDAL driver (GDAL_HTTP_PROXYUSERPWD). Must be in the form of [user name]:[password]. +#% type: string +#% description: User and password for HTTP proxy +#%end + #%option G_OPT_F_BIN_INPUT #% key: capfile #% required: no @@ -170,6 +184,12 @@ #% guisection: Map style #%end +#%flag +#% key: b +#% description: Keep original bands (default: create composite) +#% guisection: Map style +#%end + #%rules #% exclusive: capfile_output, capfile #%end @@ -179,10 +199,7 @@ sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'etc', 'r.in.wms')) import grass.script as grass - -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) +from grass.script.utils import decode def GetRegionParams(opt_region): @@ -202,7 +219,7 @@ quiet=True, flags='ug', region=opt_region) - region_params = grass.parse_key_val(s, val_type=float) + region_params = grass.parse_key_val(decode(s), val_type=float) else: region_params = grass.region() @@ -224,6 +241,14 @@ wms.GetCapabilities(options) else: from wms_base import GRASSImporter + # set proxy + if options['proxy'] and options['proxy_user_pw']: + wms.setProxy(options['proxy'], options['proxy_user_pw']) + if options['proxy']: + wms.setProxy(options['proxy']) + if 'GRASS' in options['driver']: + grass.warning(_("The proxy will be ignored by the choosen GRASS driver. It is only used with the GDAL driver.")) + options['region'] = GetRegionParams(options['region']) fetched_map = wms.GetMap(options, flags) @@ -231,7 +256,7 @@ if not fetched_map: grass.warning(_("Nothing to import.\nNo data has been downloaded from wms server.")) return - importer = GRASSImporter(options['output']) + importer = GRASSImporter(options['output'], (flags['b'] == False)) importer.ImportMapIntoGRASS(fetched_map) return 0 diff -Nru grass-7.6.1/scripts/r.in.wms/wms_base.py grass-7.8.0/scripts/r.in.wms/wms_base.py --- grass-7.6.1/scripts/r.in.wms/wms_base.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.in.wms/wms_base.py 2019-06-11 07:26:20.000000000 +0000 @@ -6,7 +6,7 @@ - wms_base::GRASSImporter - wms_base::WMSDriversInfo -(C) 2012-2016 by the GRASS Development Team +(C) 2012-2019 by the GRASS Development Team This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details. @@ -31,12 +31,8 @@ import grass.script as grass from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - -class WMSBase: +class WMSBase(object): def __init__(self): # these variables are information for destructor @@ -125,15 +121,19 @@ flags='jf').rstrip('\n') self.proj_location = self._modifyProj(self.proj_location) - if self.params['srs'] in [3857, 900913]: - # HACK: epsg 3857 def: http://spatialreference.org/ref/sr-org/7483/ - # g.proj can return: ...+a=6378137 +rf=298.257223563... (WGS84 elipsoid def instead of sphere), it can make 20km shift in Y, when raster is transformed - # needed to be tested on more servers - self.proj_srs = '+proj=merc +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +no_defs +a=6378137 +b=6378137 +nadgrids=@null +to_meter=1' - else: - self.proj_srs = grass.read_command('g.proj', - flags='jf', - epsg=str(GetEpsg(self.params['srs']))).rstrip('\n') + self.source_epsg = str(GetEpsg(self.params['srs'])) + self.target_epsg = None + target_crs = grass.parse_command('g.proj', flags='g', delimiter = '=') + if 'epsg' in target_crs.keys(): + self.target_epsg = target_crs['epsg'] + if self.source_epsg != self.target_epsg: + grass.warning(_("SRS differences: WMS source EPSG %s != location EPSG %s (use srs=%s to adjust)") % + (self.source_epsg, self.target_epsg, self.target_epsg)) + + self.proj_srs = grass.read_command('g.proj', + flags='jf', + epsg=str(GetEpsg(self.params['srs']))) + self.proj_srs = self.proj_srs.rstrip('\n') self.proj_srs = self._modifyProj(self.proj_srs) @@ -378,12 +378,19 @@ """!Reproject data using gdalwarp if needed """ # reprojection of raster - if self.proj_srs != self.proj_location: # TODO: do it better + do_reproject = True + if self.source_epsg is not None and self.target_epsg is not None \ + and self.source_epsg == self.target_epsg: + do_reproject = False + # TODO: correctly compare source and target crs + if do_reproject == True and self.proj_srs == self.proj_location: + do_reproject = False + if do_reproject: grass.message(_("Reprojecting raster...")) self.temp_warpmap = grass.tempfile() + '.tif' if int(os.getenv('GRASS_VERBOSE', '2')) <= 2: - nuldev = file(os.devnull, 'w+') + nuldev = open(os.devnull, 'w+') else: nuldev = None @@ -394,7 +401,6 @@ else: gdal_method = self.params['method'] - #"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs" # RGB rasters - alpha layer is added for cropping edges of projected raster try: if self.temp_map_bands_num == 3: @@ -445,10 +451,10 @@ class GRASSImporter: - def __init__(self, opt_output): + def __init__(self, opt_output, cleanup_bands): self.cleanup_mask = False - self.cleanup_layers = False + self.cleanup_bands = cleanup_bands # output map name self.opt_output = opt_output @@ -488,30 +494,47 @@ grass.fatal(_('%s failed') % 'g.copy') # remove temporary created rasters - if self.cleanup_layers: - maps = [] - for suffix in ('.red', '.green', '.blue', '.alpha', self.original_mask_suffix): + maps = [] + rast = self.opt_output + '.alpha' + if grass.find_file(rast, element='cell', mapset='.')['file']: + maps.append(rast) + + if self.cleanup_bands: + for suffix in ('.red', '.green', '.blue', self.original_mask_suffix): rast = self.opt_output + suffix if grass.find_file(rast, element='cell', mapset='.')['file']: maps.append(rast) - if maps: - grass.run_command('g.remove', - quiet=True, - flags='fb', - type='raster', - name=','.join(maps)) + if maps: + grass.run_command('g.remove', + quiet=True, + flags='fb', + type='raster', + name=','.join(maps)) # delete environmental variable which overrides region if 'GRASS_REGION' in os.environ.keys(): os.environ.pop('GRASS_REGION') + maplist = grass.read_command('g.list', type = 'raster', + pattern = '%s*' % (self.opt_output), + mapset = '.', separator = ',').rstrip('\n') + + if len(maplist) == 0: + grass.fatal(_('WMS import failed, nothing imported')) + else: + for raster in maplist.split(','): + grass.raster_history(raster, overwrite = True) + grass.run_command('r.support', map=raster, description='generated by r.in.wms') + grass.message(_('<%s> created.') % raster) + + def ImportMapIntoGRASS(self, raster): """!Import raster into GRASS. """ # importing temp_map into GRASS try: - # -o flag needed to overcome different ellipsoid representations + # do not use -o flag ! grass.run_command('r.in.gdal', flags='o', quiet=True, overwrite=True, input=raster, output=self.opt_output) @@ -520,7 +543,6 @@ # information for destructor to cleanup temp_layers, created # with r.in.gdal - self.cleanup_layers = True # setting region for full extend of imported raster if grass.find_file(self.opt_output + '.red', element='cell', mapset='.')['file']: @@ -553,8 +575,17 @@ except CalledModuleError: grass.fatal(_('%s failed') % 'r.mask') + if not self.cleanup_bands: + # use the MASK to set NULL vlues + for suffix in ('.red', '.green', '.blue'): + rast = self.opt_output + suffix + if grass.find_file(rast, element='cell', mapset='.')['file']: + grass.run_command('g.rename', rast='%s,%s' % (rast, rast + '_null'), quiet = True) + grass.run_command('r.mapcalc', expression = '%s = %s' % (rast, rast + '_null'), quiet = True) + grass.run_command('g.remove', type='raster', name='%s' % (rast + '_null'), flags = 'f', quiet = True) + # TODO one band + alpha band? - if grass.find_file(self.opt_output + '.red', element='cell', mapset='.')['file']: + if grass.find_file(self.opt_output + '.red', element='cell', mapset='.')['file'] and self.cleanup_bands: try: grass.run_command('r.composite', quiet=True, overwrite=True, @@ -565,8 +596,6 @@ except CalledModuleError: grass.fatal(_('%s failed') % 'r.composite') - grass.message(_('<%s> created.') % self.opt_output) - class WMSDriversInfo: diff -Nru grass-7.6.1/scripts/r.in.wms/wms_cap_parsers.py grass-7.8.0/scripts/r.in.wms/wms_cap_parsers.py --- grass-7.6.1/scripts/r.in.wms/wms_cap_parsers.py 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/r.in.wms/wms_cap_parsers.py 2019-06-03 20:34:21.000000000 +0000 @@ -24,11 +24,6 @@ import xml.etree.ElementTree as etree import grass.script as grass -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - class BaseCapabilitiesTree(etree.ElementTree): diff -Nru grass-7.6.1/scripts/r.in.wms/wms_drv.py grass-7.8.0/scripts/r.in.wms/wms_drv.py --- grass-7.6.1/scripts/r.in.wms/wms_drv.py 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/r.in.wms/wms_drv.py 2019-06-03 20:34:21.000000000 +0000 @@ -19,11 +19,6 @@ import socket import grass.script as grass -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - from time import sleep try: @@ -63,6 +58,7 @@ @return temp_map with downloaded data """ grass.message(_("Downloading data from WMS server...")) + server_url = self.params["url"] if "?" in self.params["url"]: self.params["url"] += "&" @@ -187,6 +183,8 @@ grass.fatal(_("WMS server unknown error")) temp_tile_pct2rgb = None + if tile_dataset_info.RasterCount < 1: + grass.fatal(_("WMS server error: no band(s) received. Is server URL correct? <%s>") % server_url ) if tile_dataset_info.RasterCount == 1 and \ tile_dataset_info.GetRasterBand(1).GetRasterColorTable() is not None: # expansion of color table into bands @@ -227,8 +225,9 @@ # georeferencing and setting projection of temp_map projection = grass.read_command('g.proj', flags='wf', - epsg=self.params['srs']).rstrip('\n') - temp_map_dataset.SetProjection(projection) + epsg=self.params['srs']) + projection = projection.rstrip('\n') + temp_map_dataset.SetProjection(grass.encode(projection)) pixel_x_length = (map_region['maxx'] - map_region['minx']) / int(map_region['cols']) pixel_y_length = (map_region['miny'] - map_region['maxy']) / int(map_region['rows']) diff -Nru grass-7.6.1/scripts/r.in.wms/wms_gdal_drv.py grass-7.8.0/scripts/r.in.wms/wms_gdal_drv.py --- grass-7.6.1/scripts/r.in.wms/wms_gdal_drv.py 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/r.in.wms/wms_gdal_drv.py 2019-06-11 07:26:20.000000000 +0000 @@ -16,10 +16,6 @@ import os import grass.script as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - try: from osgeo import gdal from osgeo import gdalconst @@ -39,6 +35,20 @@ class WMSGdalDrv(WMSBase): + def __init__(self): + super(WMSGdalDrv, self).__init__() + self.proxy = None + self.proxy_user_pw = None + + def setProxy(self, proxy, proxy_user_pw=None): + """ Set the HTTP proxy and its user and password + + @input proxy HTTP proxy with [IP address]:[port] + @input proxy_user_pw with [user name]:[password] + """ + self.proxy = proxy + self.proxy_user_pw = proxy_user_pw + def _createXML(self): """!Create XML for GDAL WMS driver @@ -131,6 +141,11 @@ temp_map = self._tempfile() xml_file = self._createXML() + + if self.proxy: + gdal.SetConfigOption('GDAL_HTTP_PROXY', str(self.proxy)) + if self.proxy_user_pw: + gdal.SetConfigOption('GDAL_HTTP_PROXYUSERPWD', str(self.proxy_user_pw)) wms_dataset = gdal.Open(xml_file, gdal.GA_ReadOnly) grass.try_remove(xml_file) if wms_dataset is None: diff -Nru grass-7.6.1/scripts/r.mapcalc.simple/r.mapcalc.simple.html grass-7.8.0/scripts/r.mapcalc.simple/r.mapcalc.simple.html --- grass-7.6.1/scripts/r.mapcalc.simple/r.mapcalc.simple.html 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/r.mapcalc.simple/r.mapcalc.simple.html 2019-05-18 15:50:05.000000000 +0000 @@ -118,4 +118,4 @@ Michael Barton, Arizona State University (updated to GRASS 5.7)
    R. Brunzema (original 5.0 Bash version) -

    Last changed: $Date: 2018-12-11 07:28:51 +0100 (Tue, 11 Dec 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.mapcalc.simple/r.mapcalc.simple.py grass-7.8.0/scripts/r.mapcalc.simple/r.mapcalc.simple.py --- grass-7.6.1/scripts/r.mapcalc.simple/r.mapcalc.simple.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/r.mapcalc.simple/r.mapcalc.simple.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ MODULE: r.mapcalc.simple diff -Nru grass-7.6.1/scripts/r.mask/r.mask.html grass-7.8.0/scripts/r.mask/r.mask.html --- grass-7.6.1/scripts/r.mask/r.mask.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/r.mask/r.mask.html 2019-05-18 15:50:05.000000000 +0000 @@ -102,4 +102,4 @@ Michael Barton, Arizona State University

    -Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.mask/r.mask.py grass-7.8.0/scripts/r.mask/r.mask.py --- grass-7.6.1/scripts/r.mask/r.mask.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/r.mask/r.mask.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -71,12 +71,9 @@ import atexit import grass.script as grass +from grass.script.utils import encode from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): if tmp: @@ -141,7 +138,8 @@ output='MASK', overwrite=True, rules='-') - p.stdin.write("%s = 1" % maskcats) + res = "%s = 1" % maskcats + p.stdin.write(encode(res)) p.stdin.close() p.wait() elif vector: diff -Nru grass-7.6.1/scripts/r.mask/testsuite/test_r_mask.py grass-7.8.0/scripts/r.mask/testsuite/test_r_mask.py --- grass-7.6.1/scripts/r.mask/testsuite/test_r_mask.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.mask/testsuite/test_r_mask.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,42 @@ +""" +Created on Sun Jun 07 22:19:41 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + + +class TestRMask(TestCase): + """Test r.mask script""" + + mapName = 'lakes' + mapNameOther = 'elevation' + values = 'min=56.8785\nmax=134.87' + + @classmethod + def setUpClass(cls): + """Create maps in a small region.""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region. Remove mask""" + cls.del_temp_region() + + cls.runModule('r.mask', flags='r') + + def test_mask(self): + """Mask test""" + module = SimpleModule('r.mask', raster=self.mapName) + self.assertModule(module) + + self.assertRasterFitsUnivar(raster=self.mapNameOther, + reference=self.values, + precision=5) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.out.xyz/r.out.xyz.html grass-7.8.0/scripts/r.out.xyz/r.out.xyz.html --- grass-7.6.1/scripts/r.out.xyz/r.out.xyz.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/r.out.xyz/r.out.xyz.html 2019-05-18 15:50:05.000000000 +0000 @@ -69,4 +69,4 @@ Dept. Marine Science
    Otago University, New Zealand
    -

    Last changed: $Date: 2016-12-06 23:05:06 +0100 (Tue, 06 Dec 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.out.xyz/r.out.xyz.py grass-7.8.0/scripts/r.out.xyz/r.out.xyz.py --- grass-7.6.1/scripts/r.out.xyz/r.out.xyz.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/r.out.xyz/r.out.xyz.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: r.out.xyz @@ -20,6 +20,7 @@ #% description: Exports a raster map to a text file as x,y,z values based on cell centers. #% keyword: raster #% keyword: export +#% keyword: output #% keyword: ASCII #% keyword: conversion #%end diff -Nru grass-7.6.1/scripts/r.out.xyz/testsuite/test_r_out_xyz.py grass-7.8.0/scripts/r.out.xyz/testsuite/test_r_out_xyz.py --- grass-7.6.1/scripts/r.out.xyz/testsuite/test_r_out_xyz.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.out.xyz/testsuite/test_r_out_xyz.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,43 @@ +""" +Created on Sun Jun 08 10:11:18 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +import os + + +class TestROutXyz(TestCase): + """Test r.out.xyz script""" + + mapName = 'elev_lid792_1m' + csvFile = 'elev_lid792_1m.csv' + + @classmethod + def setUpClass(cls): + """Create maps in a small region.""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.del_temp_region() + + if (os.path.isfile(cls.csvFile)): + os.remove(cls.csvFile) + + def test_r_out_xyz(self): + """ASCII text file test""" + module = SimpleModule('r.out.xyz', input=self.mapName, + output=self.csvFile, separator=",") + self.assertModule(module) + + self.assertFileExists(filename=self.csvFile) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.pack/r.pack.html grass-7.8.0/scripts/r.pack/r.pack.html --- grass-7.6.1/scripts/r.pack/r.pack.html 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/r.pack/r.pack.html 2019-05-18 15:50:05.000000000 +0000 @@ -49,4 +49,4 @@ Converted to Python and updated for GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic

    -Last changed: $Date: 2016-04-14 09:01:22 +0200 (Thu, 14 Apr 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.pack/r.pack.py grass-7.8.0/scripts/r.pack/r.pack.py --- grass-7.6.1/scripts/r.pack/r.pack.py 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/r.pack/r.pack.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: r.pack @@ -40,10 +40,6 @@ from grass.script.utils import try_rmdir, try_remove from grass.script import core as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): try_rmdir(tmp) diff -Nru grass-7.6.1/scripts/r.pack/testsuite/test_r_pack.py grass-7.8.0/scripts/r.pack/testsuite/test_r_pack.py --- grass-7.6.1/scripts/r.pack/testsuite/test_r_pack.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.pack/testsuite/test_r_pack.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,43 @@ +""" +Created on Sun Jun 08 10:15:22 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +import os + + +class TestRPack(TestCase): + """Test r.pack script""" + + mapName = 'aspect' + outFile = 'aspect.pack' + + @classmethod + def setUpClass(cls): + """Create maps in a small region.""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region. Delete output file""" + cls.del_temp_region() + + if (os.path.isfile(cls.outFile)): + os.remove(cls.outFile) + + def test_r_pack(self): + """Create a pack file test""" + module = SimpleModule('r.pack', input=self.mapName, + output=self.outFile) + self.assertModule(module) + + self.assertFileExists(filename=self.outFile) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.plane/r.plane.html grass-7.8.0/scripts/r.plane/r.plane.html --- grass-7.6.1/scripts/r.plane/r.plane.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.plane/r.plane.html 2019-05-18 15:50:05.000000000 +0000 @@ -40,4 +40,4 @@ Full rewrite for GRASS 7 by Glynn Clements

    -Last changed: $Date: 2017-10-17 19:33:31 +0200 (Tue, 17 Oct 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.plane/r.plane.py grass-7.8.0/scripts/r.plane/r.plane.py --- grass-7.6.1/scripts/r.plane/r.plane.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.plane/r.plane.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -67,19 +67,21 @@ import string import grass.script as gscript -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): name = options['output'] type = options['type'] dip = float(options['dip']) az = float(options['azimuth']) - ea = float(options['easting']) - no = float(options['northing']) + try: + ea = float(options['easting']) + no = float(options['northing']) + except ValueError: + try: + ea = float(gscript.utils.float_or_dms(options['easting'])) + no = float(gscript.utils.float_or_dms(options['northing'])) + except: + gscript.fatal(_("Input coordinates seems to be invalid")) el = float(options['elevation']) # reg = gscript.region() diff -Nru grass-7.6.1/scripts/r.plane/testsuite/test_r_plane.py grass-7.8.0/scripts/r.plane/testsuite/test_r_plane.py --- grass-7.6.1/scripts/r.plane/testsuite/test_r_plane.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.plane/testsuite/test_r_plane.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,41 @@ +""" +Created on Sun Jun 08 12:12:34 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + + +class TestRPlane(TestCase): + """Test r.plane script""" + + mapName = 'elevation' + mapOutput = 'myplane45' + + @classmethod + def setUpClass(cls): + """Create maps in a small region.""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.runModule('g.remove', flags='f', type='raster', + name=cls.mapOutput) + cls.del_temp_region() + + def test_creates_raster_plane_map(self): + """Create a tilted plane raster map test""" + module = SimpleModule('r.plane', output=self.mapOutput, dip=45, + easting=527500.0, northing=165000.0, + elevation=1000, type='FCELL') + self.assertModule(module) + + self.assertRasterExists(self.mapOutput) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.reclass.area/r.reclass.area.html grass-7.8.0/scripts/r.reclass.area/r.reclass.area.html --- grass-7.6.1/scripts/r.reclass.area/r.reclass.area.html 2019-03-19 20:04:35.000000000 +0000 +++ grass-7.8.0/scripts/r.reclass.area/r.reclass.area.html 2019-05-22 21:47:51.000000000 +0000 @@ -58,4 +58,4 @@ NRCS,
    Markus Neteler -

    Last changed: $Date: 2018-12-16 17:58:23 +0100 (Sun, 16 Dec 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.reclass.area/r.reclass.area.py grass-7.8.0/scripts/r.reclass.area/r.reclass.area.py --- grass-7.6.1/scripts/r.reclass.area/r.reclass.area.py 2019-03-19 20:04:35.000000000 +0000 +++ grass-7.8.0/scripts/r.reclass.area/r.reclass.area.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -76,10 +76,7 @@ import os import atexit import grass.script as grass - -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) +from grass.script.utils import decode, encode TMPRAST = [] @@ -93,6 +90,7 @@ diagonal = diag s = grass.read_command("g.region", flags='p') + s = decode(s) kv = grass.parse_key_val(s, sep=':') s = kv['projection'].strip().split() if s == '0': @@ -142,7 +140,7 @@ rules='-') rules = '' for line in p1.stdout: - f = line.rstrip(os.linesep).split(';') + f = decode(line).rstrip(os.linesep).split(';') if len(f) < 5: continue hectares = float(f[4]) * 0.0001 @@ -153,7 +151,7 @@ if test: rules += "%s = %s %s\n" % (f[0], f[2], f[3]) if rules: - p2.stdin.write(rules) + p2.stdin.write(encode(rules)) p1.wait() p2.stdin.close() p2.wait() diff -Nru grass-7.6.1/scripts/r.reclass.area/testsuite/testrra.py grass-7.8.0/scripts/r.reclass.area/testsuite/testrra.py --- grass-7.6.1/scripts/r.reclass.area/testsuite/testrra.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.reclass.area/testsuite/testrra.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,60 @@ +""" +Name: r.reclass.area test +Purpose: Tests r.reclass.area and its flags/options. + +Author: Sunveer Singh, Google Code-in 2018 +Copyright: (C) 2018 by Sunveer Singh and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" +from grass.gunittest.case import TestCase +from grass.gunittest.main import test + +class Testrr(TestCase): + input='zipcodes' + output='rraoutput' + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + cls.runModule('g.region', raster=cls.input) + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + + def tearDown(cls): + cls.runModule('g.remove', type='raster', flags='f', name=cls.output) + + def test_flag_c(self): + """Testing flag c""" + string="""min=27603 + max=27607 + cells=2025000""" + self.assertModule('r.reclass.area', input=self.input, output=self.output, value=2000, mode="greater", flags='c') + self.assertRasterFitsUnivar(self.output, + reference=string, precision=2) + + def test_flag_d(self): + """Testing flag d""" + self.assertModule('r.reclass.area', input=self.input, output=self.output, value=2000, mode="lesser", flags='d') + self.assertRasterMinMax(map=self.output, refmin=27511, refmax=27610, + msg="Output Map in degrees must be between 27511 and 27610") + + def test_module_output(self): + """Testing Module without flags""" + self.assertModule('r.reclass.area', input=self.input, output=self.output, value=2000, mode="greater") + self.assertRasterMinMax(map=self.output, refmin=27603, refmax=27607, + msg="Output Map in degrees must be between 27603 and 27607") + + def test_method_rmarea(self): + """Testing Module without flags""" + self.assertModule('r.reclass.area', input=self.input, output=self.output, value=2000, mode="lesser", method="rmarea") + self.assertRasterMinMax(map=self.output, refmin=27603, refmax=27607, + msg="Output Map in degrees must be between 27603 and 27607") + + +if __name__ == '__main__': + from grass.gunittest.main import test + test() diff -Nru grass-7.6.1/scripts/r.reclass.area/testsuite/test_r_reclass_area.py grass-7.8.0/scripts/r.reclass.area/testsuite/test_r_reclass_area.py --- grass-7.6.1/scripts/r.reclass.area/testsuite/test_r_reclass_area.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.reclass.area/testsuite/test_r_reclass_area.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,47 @@ +""" +Name: r.reclass.area test +Purpose: Tests r.reclass.area. + +Author: Shubham Sharma, Google Code-in 2018 +Copyright: (C) 2018 by Shubham Sharma and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test + + +class TestReclassArea(TestCase): + input = 'geology_30m' + output = 'reclassarea' + value = '20' + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + cls.runModule('g.region', raster=cls.input) + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + cls.runModule('g.remove', type='raster', flags='f', name=cls.output + 'Greater') + cls.runModule('g.remove', type='raster', flags='f', name=cls.output + 'Lesser') + + def test_reclassaeaGreater(self): + """Testing r.reclass.area with greater""" + self.assertModule('r.reclass.area', input=self.input, output=self.output + 'Greater', + value=self.value, mode='greater', method='reclass') + self.assertRasterMinMax(map=self.output + 'Greater', refmin=200, refmax=1000, + msg="Range of data: min = 200 max = 1000") + + def test_reclassareaLesser(self): + """Testing r.reclass.area with lesser""" + self.assertModule('r.reclass.area', input=self.input, output=self.output + 'Lesser', + value=self.value, mode='lesser', method='reclass') + self.assertRasterMinMax(map=self.output + 'Lesser', refmin=900, refmax=1000, + msg="Range of data: min = 900 max = 1000") + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.rgb/r.rgb.html grass-7.8.0/scripts/r.rgb/r.rgb.html --- grass-7.6.1/scripts/r.rgb/r.rgb.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/r.rgb/r.rgb.html 2019-05-18 15:50:05.000000000 +0000 @@ -54,4 +54,4 @@ Glynn Clements

    -Last changed: $Date: 2016-03-18 15:09:00 +0100 (Fri, 18 Mar 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.rgb/r.rgb.py grass-7.8.0/scripts/r.rgb/r.rgb.py --- grass-7.6.1/scripts/r.rgb/r.rgb.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/r.rgb/r.rgb.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -43,11 +43,6 @@ import grass.script as gscript -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): options, unused = gscript.parser() diff -Nru grass-7.6.1/scripts/r.rgb/testsuite/test_r_rgb.py grass-7.8.0/scripts/r.rgb/testsuite/test_r_rgb.py --- grass-7.6.1/scripts/r.rgb/testsuite/test_r_rgb.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.rgb/testsuite/test_r_rgb.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,44 @@ +""" +Created on Sun Jun 08 13:20:31 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + + +class TestRRGB(TestCase): + """Test r.rgb script""" + + mapName = 'elevation' + red = 'elevation.r' + green = 'elevation.g' + blue = 'elevation.b' + + @classmethod + def setUpClass(cls): + """Create maps in a small region.""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.runModule('g.remove', flags='f', type='raster', + name=(cls.red, cls.green, cls.blue)) + cls.del_temp_region() + + def test_rgb_maps(self): + """Generates rgb maps from a raster map test""" + module = SimpleModule('r.rgb', input=self.mapName, red=self.red, + green=self.green, blue=self.blue) + self.assertModule(module) + + self.assertRasterExists(self.red) + self.assertRasterExists(self.green) + self.assertRasterExists(self.blue) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.shade/r.shade.html grass-7.8.0/scripts/r.shade/r.shade.html --- grass-7.6.1/scripts/r.shade/r.shade.html 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/r.shade/r.shade.html 2019-05-18 15:50:05.000000000 +0000 @@ -106,4 +106,4 @@ manual for r.his.

    -Last changed: $Date: 2015-09-02 13:01:34 +0200 (Wed, 02 Sep 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.shade/r.shade.py grass-7.8.0/scripts/r.shade/r.shade.py --- grass-7.6.1/scripts/r.shade/r.shade.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/r.shade/r.shade.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -67,10 +67,6 @@ from grass.script import raster as grast from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def remove(maps): """Remove raster maps""" diff -Nru grass-7.6.1/scripts/r.shade/testsuite/test_r_shade.py grass-7.8.0/scripts/r.shade/testsuite/test_r_shade.py --- grass-7.6.1/scripts/r.shade/testsuite/test_r_shade.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.shade/testsuite/test_r_shade.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,41 @@ +""" +Created on Sun Jun 08 13:44:07 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + + +class TestRShade(TestCase): + """Test r.shade script""" + + mapName = 'aspect' + color = 'elevation' + outputMap = 'elevation_aspect_shaded' + + @classmethod + def setUpClass(cls): + """Create maps in a small region.""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.runModule('g.remove', flags='f', type='raster', + name=cls.outputMap) + cls.del_temp_region() + + def test_shade_map(self): + """Generates a color raster map over shaded relief map test""" + module = SimpleModule('r.shade', shade=self.mapName, color=self.color, + output=self.outputMap) + self.assertModule(module) + + self.assertRasterExists(self.outputMap) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.tileset/r.tileset.html grass-7.8.0/scripts/r.tileset/r.tileset.html --- grass-7.6.1/scripts/r.tileset/r.tileset.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.tileset/r.tileset.html 2019-07-28 20:17:50.000000000 +0000 @@ -46,14 +46,14 @@ w=5;s=125;e=45;n=175;cols=80;rows=100; -

    This is output in a format convinent for setting variables in a shell +
    This is output in a format convenient for setting variables in a shell script.
    bbox=5,125,45,175&width=80&height=100 -
    This is output in a format convinent for requesting data from some +
    This is output in a format convenient for requesting data from some http services. @@ -101,4 +101,4 @@ Updated for GRASS 7 by Martin Landa, CTU in Prague, Czech Republic

    -Last changed: $Date: 2015-05-11 02:11:34 +0200 (Mon, 11 May 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.tileset/r.tileset.py grass-7.8.0/scripts/r.tileset/r.tileset.py --- grass-7.6.1/scripts/r.tileset/r.tileset.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.tileset/r.tileset.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -114,13 +114,9 @@ from grass.script.utils import separator from grass.script import core as gcore +from grass.script.utils import decode from grass.exceptions import CalledModuleError -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def bboxToPoints(bbox): """Make points that are the corners of a bounding box""" @@ -171,6 +167,7 @@ proj_out=dest['proj'], sep=';', input=file) + ret = decode(ret) except CalledModuleError: gcore.fatal(cs2cs + ' failed') @@ -255,7 +252,8 @@ if not options['destproj']: dest_proj = gcore.read_command('g.proj', quiet=True, - flags='jf').rstrip('\n') + flags='jf') + dest_proj = decode(dest_proj).rstrip('\n') if not dest_proj: gcore.fatal(_('g.proj failed')) else: diff -Nru grass-7.6.1/scripts/r.tileset/testsuite/test_r_tileset.py grass-7.8.0/scripts/r.tileset/testsuite/test_r_tileset.py --- grass-7.6.1/scripts/r.tileset/testsuite/test_r_tileset.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/r.tileset/testsuite/test_r_tileset.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,46 @@ +""" +Created on Sun Jun 08 19:42:32 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.utils import decode + +import os + +output = """\ +-78.77462049|35.6875073|-78.60830318|35.74855834|1506|678 +-78.77462049|35.74855834|-78.60830318|35.80960938|1506|678 +""".replace('\n', os.linesep) + + +class TestRTileset(TestCase): + """Test r.tileset script""" + + mapName = 'elevation' + + @classmethod + def setUpClass(cls): + """Use temporary region settings""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """!Remove the temporary region""" + cls.del_temp_region() + + def test_tiling(self): + """Produce tiling test""" + module = SimpleModule('r.tileset', sourceproj='+init=epsg:4326', + maxrows=1024, maxcols=2048) + self.assertModule(module) + + self.assertMultiLineEqual(decode(module.outputs.stdout), output) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/r.unpack/r.unpack.html grass-7.8.0/scripts/r.unpack/r.unpack.html --- grass-7.6.1/scripts/r.unpack/r.unpack.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/r.unpack/r.unpack.html 2019-05-18 15:50:05.000000000 +0000 @@ -37,4 +37,4 @@
    Converted to Python and updated for GRASS 7 by Martin Landa, CTU in Prague, Czech Republic -

    Last changed: $Date: 2015-09-05 17:57:08 +0200 (Sat, 05 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/r.unpack/r.unpack.py grass-7.8.0/scripts/r.unpack/r.unpack.py --- grass-7.6.1/scripts/r.unpack/r.unpack.py 2019-03-19 20:04:47.000000000 +0000 +++ grass-7.8.0/scripts/r.unpack/r.unpack.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: r.unpack @@ -49,10 +49,6 @@ from grass.script.utils import diff_files, try_rmdir from grass.script import core as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): try_rmdir(tmp_dir) diff -Nru grass-7.6.1/scripts/v.build.all/v.build.all.html grass-7.8.0/scripts/v.build.all/v.build.all.html --- grass-7.6.1/scripts/v.build.all/v.build.all.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.build.all/v.build.all.html 2019-05-18 15:50:05.000000000 +0000 @@ -13,4 +13,4 @@

    AUTHOR

    Radim Blazek -

    Last changed: $Date: 2013-02-12 12:01:38 +0100 (Tue, 12 Feb 2013) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.build.all/v.build.all.py grass-7.8.0/scripts/v.build.all/v.build.all.py --- grass-7.6.1/scripts/v.build.all/v.build.all.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.build.all/v.build.all.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: v.build.all @@ -22,11 +22,6 @@ from grass.script import core as grass from grass.exceptions import CalledModuleError -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): env = grass.gisenv() diff -Nru grass-7.6.1/scripts/v.centroids/testsuite/test_v_centroids.py grass-7.8.0/scripts/v.centroids/testsuite/test_v_centroids.py --- grass-7.6.1/scripts/v.centroids/testsuite/test_v_centroids.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.centroids/testsuite/test_v_centroids.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,40 @@ +""" +Created on Thrs Jun 09 11:26:12 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + + +class TestVCentroids(TestCase): + """Test v.centroids script""" + mapName = 'busroute11' + outRouteMap = 'busroute11_boundary' + fromType = 'line' + toType = 'boundary' + outAreaMap = 'busroute11_area' + + @classmethod + def setUpClass(cls): + """Create an area from a closed line""" + cls.runModule('v.type', input=cls.mapName, output=cls.outRouteMap, + from_type=cls.fromType, to_type=cls.toType) + + @classmethod + def tearDownClass(cls): + """Remove the generated maps""" + cls.runModule('g.remove', flags='f', type='vector', + name=(cls.outRouteMap, cls.outAreaMap)) + + def test_area(self): + """Adds missing centroids to closed boundaries test""" + module = SimpleModule('v.centroids', input=self.outRouteMap, + output=self.outAreaMap) + self.assertModule(module) + self.assertVectorExists(self.outAreaMap) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.centroids/v.centroids.html grass-7.8.0/scripts/v.centroids/v.centroids.html --- grass-7.6.1/scripts/v.centroids/v.centroids.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.centroids/v.centroids.html 2019-05-18 15:50:05.000000000 +0000 @@ -42,4 +42,4 @@
    help page: Trevor Wiens -

    Last changed: $Date: 2017-11-11 19:59:24 +0100 (Sat, 11 Nov 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.centroids/v.centroids.py grass-7.8.0/scripts/v.centroids/v.centroids.py --- grass-7.6.1/scripts/v.centroids/v.centroids.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.centroids/v.centroids.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: v.centroids @@ -52,11 +52,6 @@ import sys import grass.script as gscript -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): if options['option'] == 'add': diff -Nru grass-7.6.1/scripts/v.clip/v.clip.py grass-7.8.0/scripts/v.clip/v.clip.py --- grass-7.6.1/scripts/v.clip/v.clip.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.clip/v.clip.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/scripts/v.db.addcolumn/testsuite/test_v_db_addcolumn.py grass-7.8.0/scripts/v.db.addcolumn/testsuite/test_v_db_addcolumn.py --- grass-7.6.1/scripts/v.db.addcolumn/testsuite/test_v_db_addcolumn.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.db.addcolumn/testsuite/test_v_db_addcolumn.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,52 @@ +""" +Created on Sun Jun 09 11:28:34 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command +from grass.script.utils import decode + + +class TestVDbAddColumn(TestCase): + """Test v.db.addcolumn script""" + + @classmethod + def setUpClass(cls): + """Copy vector.""" + run_command('g.copy', vector='roadsmajor,myroads') + + @classmethod + def tearDownClass(cls): + """Remove copied vector""" + run_command('g.remove', type='vector', name='myroads', + flags='f') + + def test_add_single_column_check(self): + """Add column to the attribute table""" + module = SimpleModule('v.db.addcolumn', map='myroads', + columns='slope double precision') + self.assertModule(module) + + m = SimpleModule('v.info', map='myroads', flags='c') + self.assertModule(m) + self.assertRegexpMatches(decode(m.outputs.stdout), 'slope') + + def test_add_two_columns_check(self): + """Add two column to the attribute table""" + module = SimpleModule('v.db.addcolumn', map='myroads', + columns='slope_2 double precision, \ + myname varchar(15)') + self.assertModule(module) + + m = SimpleModule('v.info', map='myroads', flags='c') + self.assertModule(m) + self.assertRegexpMatches(decode(m.outputs.stdout), 'slope_2') + self.assertRegexpMatches(decode(m.outputs.stdout), 'myname') + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.db.addcolumn/v.db.addcolumn.html grass-7.8.0/scripts/v.db.addcolumn/v.db.addcolumn.html --- grass-7.6.1/scripts/v.db.addcolumn/v.db.addcolumn.html 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.db.addcolumn/v.db.addcolumn.html 2019-05-18 15:50:05.000000000 +0000 @@ -47,4 +47,4 @@ Moritz Lennert (mlennert@club.worldonline.be) -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.db.addcolumn/v.db.addcolumn.py grass-7.8.0/scripts/v.db.addcolumn/v.db.addcolumn.py --- grass-7.6.1/scripts/v.db.addcolumn/v.db.addcolumn.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.db.addcolumn/v.db.addcolumn.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -43,10 +43,7 @@ import sys import os import grass.script as grass - -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) +from grass.script.utils import encode def main(): @@ -81,9 +78,11 @@ grass.error(_("Column <%s> is already in the table. Skipping.") % col_name) continue grass.verbose(_("Adding column <%s> to the table") % col_name) - p = grass.feed_command('db.execute', input='-', database=database, driver=driver) - p.stdin.write("ALTER TABLE %s ADD COLUMN %s" % (table, col)) - grass.debug("ALTER TABLE %s ADD COLUMN %s" % (table, col)) + p = grass.feed_command('db.execute', input='-', + database=database, driver=driver) + res = "ALTER TABLE {} ADD COLUMN {}".format(table, col) + p.stdin.write(encode(res)) + grass.debug(res) p.stdin.close() if p.wait() != 0: grass.fatal(_("Unable to add column <%s>.") % col) diff -Nru grass-7.6.1/scripts/v.db.addtable/testsuite/test_v_db_addtable.py grass-7.8.0/scripts/v.db.addtable/testsuite/test_v_db_addtable.py --- grass-7.6.1/scripts/v.db.addtable/testsuite/test_v_db_addtable.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.db.addtable/testsuite/test_v_db_addtable.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,46 @@ +""" +Created on Sun Jun 09 12:01:34 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command +from grass.script.utils import decode + + +class TestVDbAddTable(TestCase): + """Test v.db.addtable script""" + + @classmethod + def setUpClass(cls): + """Copy vector.""" + run_command('g.copy', vector='roadsmajor,myroads') + + @classmethod + def tearDownClass(cls): + """Remove copied vector""" + run_command('g.remove', type='vector', name='myroads', + flags='f') + + def test_add_single_columned_table_check(self): + """Add a new attribute table with single column to layer 2""" + module = SimpleModule('v.db.addtable', map='myroads', + columns='slope double precision', layer=2) + self.assertModule(module) + + run_command('v.db.connect', flags='p', map='myroads') + + m = SimpleModule('v.info', map='myroads', flags='c') + self.assertModule(m) + self.assertNotRegexpMatches(decode(m.outputs.stdout), 'slope') + + m = SimpleModule('v.info', map='myroads', flags='c', layer=2) + self.assertModule(m) + self.assertRegexpMatches(decode(m.outputs.stdout), 'slope') + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.db.addtable/v.db.addtable.html grass-7.8.0/scripts/v.db.addtable/v.db.addtable.html --- grass-7.6.1/scripts/v.db.addtable/v.db.addtable.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/v.db.addtable/v.db.addtable.html 2019-05-18 15:50:05.000000000 +0000 @@ -61,4 +61,4 @@ Markus Neteler -

    Last changed: $Date: 2018-06-14 05:19:32 +0200 (Thu, 14 Jun 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.db.addtable/v.db.addtable.py grass-7.8.0/scripts/v.db.addtable/v.db.addtable.py --- grass-7.6.1/scripts/v.db.addtable/v.db.addtable.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/v.db.addtable/v.db.addtable.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -56,12 +56,9 @@ import sys import os import grass.script as grass +from grass.script.utils import decode from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): vector = options['map'] @@ -98,8 +95,10 @@ driver = kv['driver'] schema = kv['schema'] + database2 = database.replace('$MAP/', map_name + '/') + # maybe there is already a table linked to the selected layer? - nuldev = file(os.devnull, 'w') + nuldev = open(os.devnull, 'w') try: grass.vector_db(map_name, stderr=nuldev)[int(layer)] grass.fatal(_("There is already a table linked to layer <%s>") % layer) @@ -107,21 +106,21 @@ pass # maybe there is already a table with that name? - tables = grass.read_command('db.tables', flags='p', database=database, driver=driver, + tables = grass.read_command('db.tables', flags='p', database=database2, driver=driver, stderr=nuldev) + tables = decode(tables) if not table in tables.splitlines(): colnames = [] + column_def = [] if columns: column_def = [] - for x in ' '.join(columns.lower().split()).split(','): - colname = x.split()[0] + for x in ' '.join(columns.split()).split(','): + colname = x.lower().split()[0] if colname in colnames: grass.fatal(_("Duplicate column name '%s' not allowed") % colname) colnames.append(colname) column_def.append(x) - else: - column_def = [] # if not existing, create it: if not key in colnames: @@ -133,23 +132,14 @@ sql = "CREATE TABLE %s (%s)" % (table, column_def) try: grass.run_command('db.execute', - database=database, driver=driver, sql=sql) + database=database2, driver=driver, sql=sql) except CalledModuleError: grass.fatal(_("Unable to create table <%s>") % table) - # create index, see db/driver/*/index.c - if driver != "dbf": - sql = "CREATE UNIQUE INDEX %s_%s ON %s (%s)" % (table, key, table, key) - try: - grass.run_command('db.execute', - database=database, driver=driver, sql=sql) - except: - grass.warning(_("Unable to create index on table <%s>") % table) - pass - # connect the map to the DB: if schema: table = '{schema}.{table}'.format(schema=schema, table=table) + grass.verbose(_("Connecting new table to vector map <%s>...") % map_name) grass.run_command('v.db.connect', quiet=True, map=map_name, database=database, driver=driver, layer=layer, table=table, key=key) diff -Nru grass-7.6.1/scripts/v.db.dropcolumn/testsuite/test_v_db_dropcolumn.py grass-7.8.0/scripts/v.db.dropcolumn/testsuite/test_v_db_dropcolumn.py --- grass-7.6.1/scripts/v.db.dropcolumn/testsuite/test_v_db_dropcolumn.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.db.dropcolumn/testsuite/test_v_db_dropcolumn.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,40 @@ +""" +Created on Sun Jun 09 01:12:22 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command +from grass.script.utils import decode + + +class TestVDbDropColumn(TestCase): + """Test v.db.dropcolumn script""" + + @classmethod + def setUpClass(cls): + """Copy vector.""" + run_command('g.copy', vector='roadsmajor,myroads') + + @classmethod + def tearDownClass(cls): + """Remove copied vector""" + run_command('g.remove', type='vector', name='myroads', + flags='f') + + def test_drop_single_column_check(self): + """Drop column to the attribute table""" + module = SimpleModule('v.db.dropcolumn', map='myroads', + columns='SHAPE_LEN') + self.assertModule(module) + + m = SimpleModule('v.info', map='myroads', flags='c') + self.assertModule(m) + self.assertNotRegexpMatches(decode(m.outputs.stdout), 'SHAPE_LEN') + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.db.dropcolumn/v.db.dropcolumn.html grass-7.8.0/scripts/v.db.dropcolumn/v.db.dropcolumn.html --- grass-7.6.1/scripts/v.db.dropcolumn/v.db.dropcolumn.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/v.db.dropcolumn/v.db.dropcolumn.html 2019-05-18 15:50:05.000000000 +0000 @@ -38,4 +38,4 @@ Markus Neteler -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.db.dropcolumn/v.db.dropcolumn.py grass-7.8.0/scripts/v.db.dropcolumn/v.db.dropcolumn.py --- grass-7.6.1/scripts/v.db.dropcolumn/v.db.dropcolumn.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.db.dropcolumn/v.db.dropcolumn.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -43,10 +43,6 @@ import grass.script as grass from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): map = options['map'] @@ -101,7 +97,7 @@ cmds = [ "BEGIN TRANSACTION", - "CREATE TEMPORARY TABLE ${table}_backup(${coldef})", + "CREATE TEMPORARY TABLE ${table}_backup (${coldef})", "INSERT INTO ${table}_backup SELECT ${colnames} FROM ${table}", "DROP TABLE ${table}", "CREATE TABLE ${table}(${coldef})", diff -Nru grass-7.6.1/scripts/v.db.droprow/testsuite/test_v_db_droprow.py grass-7.8.0/scripts/v.db.droprow/testsuite/test_v_db_droprow.py --- grass-7.6.1/scripts/v.db.droprow/testsuite/test_v_db_droprow.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.db.droprow/testsuite/test_v_db_droprow.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,53 @@ +""" +Created on Sun Jun 09 01:52:34 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command +from grass.script.utils import decode + + +class TestVDbDropRow(TestCase): + """Test v.db.droprow script""" + + mapName = 'elevation' + inputMap = 'rand5k_elev' + outputMap = 'rand5k_elev_filt' + values = 'min=56.12\nmax=155.157' + + @classmethod + def setUpClass(cls): + """Create maps in a small region.""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.del_temp_region() + + cls.runModule('g.remove', flags='f', type='vector', + name=(cls.inputMap, cls.outputMap)) + + def test_drop_row_check(self): + """Drop vector object from a vector map""" + run_command('v.random', output=self.inputMap, n=5000) + run_command('v.db.addtable', map=self.inputMap, + column="elevation double precision") + run_command('v.what.rast', map=self.inputMap, + raster=self.mapName, column=self.mapName) + + module = SimpleModule('v.db.droprow', input=self.inputMap, + output=self.outputMap, where='elevation IS NULL') + self.assertModule(module) + + self.assertVectorFitsUnivar(map=self.outputMap, column='elevation', + reference=self.values, precision=5) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.db.droprow/v.db.droprow.html grass-7.8.0/scripts/v.db.droprow/v.db.droprow.html --- grass-7.6.1/scripts/v.db.droprow/v.db.droprow.html 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.db.droprow/v.db.droprow.html 2019-05-18 15:50:05.000000000 +0000 @@ -50,4 +50,4 @@ Markus Neteler -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.db.droprow/v.db.droprow.py grass-7.8.0/scripts/v.db.droprow/v.db.droprow.py --- grass-7.6.1/scripts/v.db.droprow/v.db.droprow.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.db.droprow/v.db.droprow.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -39,11 +39,6 @@ import grass.script as grass from grass.exceptions import CalledModuleError -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): # delete vectors via reverse selection diff -Nru grass-7.6.1/scripts/v.db.droptable/testsuite/test_v_db_droptable.py grass-7.8.0/scripts/v.db.droptable/testsuite/test_v_db_droptable.py --- grass-7.6.1/scripts/v.db.droptable/testsuite/test_v_db_droptable.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.db.droptable/testsuite/test_v_db_droptable.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,48 @@ +""" +Created on Sun Jun 09 09:18:39 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command +from grass.script.utils import decode + + +class TestVDbDropTable(TestCase): + """Test v.db.droptable script""" + + @classmethod + def setUpClass(cls): + """Copy vector.""" + run_command('g.copy', vector='roadsmajor,myroads') + + @classmethod + def tearDownClass(cls): + """Remove copied vector""" + run_command('g.remove', type='vector', name='myroads', + flags='f') + + def test_drop_table_check(self): + """Drop table check, the column should still be in the table""" + module = SimpleModule('v.db.droptable', map='myroads') + self.assertModule(module) + + m = SimpleModule('db.tables', flags='p') + self.assertModule(m) + self.assertRegexpMatches(decode(m.outputs.stdout), 'myroads') + + def test_drop_table_with_force(self): + """Drop table with force, the column should not be in the table""" + module = SimpleModule('v.db.droptable', map='myroads', flags='f') + self.assertModule(module) + + m = SimpleModule('db.tables', flags='p') + self.assertModule(m) + self.assertNotRegexpMatches(decode(m.outputs.stdout), 'myroads') + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.db.droptable/v.db.droptable.html grass-7.8.0/scripts/v.db.droptable/v.db.droptable.html --- grass-7.6.1/scripts/v.db.droptable/v.db.droptable.html 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/v.db.droptable/v.db.droptable.html 2019-05-18 15:50:05.000000000 +0000 @@ -37,4 +37,4 @@ Markus Neteler -

    Last changed: $Date: 2012-11-25 11:59:42 +0100 (Sun, 25 Nov 2012) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.db.droptable/v.db.droptable.py grass-7.8.0/scripts/v.db.droptable/v.db.droptable.py --- grass-7.6.1/scripts/v.db.droptable/v.db.droptable.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/v.db.droptable/v.db.droptable.py 2019-09-04 13:16:01.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -39,10 +39,6 @@ import grass.script as gscript from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): force = flags['f'] @@ -50,6 +46,17 @@ table = options['table'] layer = options['layer'] + # We check for existence of the map in the current mapset before + # doing any other operation. + info = gscript.find_file(map, element='vector', mapset=".") + if not info['file']: + mapset = gscript.gisenv()["MAPSET"] + # Message is formulated in the way that it does not mislead + # in case where a map of the same name is in another mapset. + gscript.fatal(_("Vector map <{name}> not found" + " in the current mapset ({mapset})").format( + name=map, mapset=mapset)) + # do some paranoia tests as well: f = gscript.vector_layer_db(map, layer) @@ -91,7 +98,7 @@ gscript.message(_("Current attribute table link(s):")) # silently test first to avoid confusing error messages - nuldev = file(os.devnull, 'w') + nuldev = open(os.devnull, 'w') try: gscript.run_command('v.db.connect', flags='p', map=map, quiet=True, stdout=nuldev, stderr=nuldev) diff -Nru grass-7.6.1/scripts/v.db.join/v.db.join.html grass-7.8.0/scripts/v.db.join/v.db.join.html --- grass-7.6.1/scripts/v.db.join/v.db.join.html 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.db.join/v.db.join.html 2019-05-18 15:50:05.000000000 +0000 @@ -112,4 +112,4 @@ Markus Neteler -

    Last changed: $Date: 2015-12-17 15:38:13 +0100 (Thu, 17 Dec 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.db.join/v.db.join.py grass-7.8.0/scripts/v.db.join/v.db.join.py --- grass-7.6.1/scripts/v.db.join/v.db.join.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.db.join/v.db.join.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -61,11 +61,6 @@ import grass.script as grass from grass.exceptions import CalledModuleError -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): map = options['map'] diff -Nru grass-7.6.1/scripts/v.db.reconnect.all/v.db.reconnect.all.html grass-7.8.0/scripts/v.db.reconnect.all/v.db.reconnect.all.html --- grass-7.6.1/scripts/v.db.reconnect.all/v.db.reconnect.all.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/v.db.reconnect.all/v.db.reconnect.all.html 2019-05-18 15:50:05.000000000 +0000 @@ -127,4 +127,4 @@ Major update by Martin Landa, Czech Technical University in Prague, Czech Republic

    -Last changed: $Date: 2013-02-08 08:20:43 +0100 (Fri, 08 Feb 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.db.reconnect.all/v.db.reconnect.all.py grass-7.8.0/scripts/v.db.reconnect.all/v.db.reconnect.all.py --- grass-7.6.1/scripts/v.db.reconnect.all/v.db.reconnect.all.py 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/v.db.reconnect.all/v.db.reconnect.all.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: v.db.reconnect.all @@ -56,10 +56,6 @@ import grass.script as gscript from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - # substitute variables (gisdbase, location_name, mapset) @@ -284,5 +280,5 @@ if __name__ == "__main__": options, flags = gscript.parser() - nuldev = file(os.devnull, 'w') + nuldev = open(os.devnull, 'w') sys.exit(main()) diff -Nru grass-7.6.1/scripts/v.db.renamecolumn/testsuite/test_v_db_renamecolumn.py grass-7.8.0/scripts/v.db.renamecolumn/testsuite/test_v_db_renamecolumn.py --- grass-7.6.1/scripts/v.db.renamecolumn/testsuite/test_v_db_renamecolumn.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.db.renamecolumn/testsuite/test_v_db_renamecolumn.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,41 @@ +""" +Created on Sun Jun 07 19:08:34 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command +from grass.script.utils import decode + + +class TestVDbRenameColumn(TestCase): + """Test v.db.renamecolumn script""" + + @classmethod + def setUpClass(cls): + """Copy vector.""" + run_command('g.copy', vector='roadsmajor,myroads') + + @classmethod + def tearDownClass(cls): + """Remove copied vector""" + run_command('g.remove', type='vector', name='myroads', + flags='f') + + def test_rename_column(self): + """Renaming a column""" + module = SimpleModule('v.db.renamecolumn', map='myroads', + column=('ROAD_NAME', 'roadname')) + self.assertModule(module) + + m = SimpleModule('v.info', flags='c', map='myroads') + self.assertModule(m) + self.assertRegexpMatches(decode(m.outputs.stdout), 'roadname') + self.assertNotRegexpMatches(decode(m.outputs.stdout), 'ROAD_NAME') + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.db.renamecolumn/v.db.renamecolumn.html grass-7.8.0/scripts/v.db.renamecolumn/v.db.renamecolumn.html --- grass-7.6.1/scripts/v.db.renamecolumn/v.db.renamecolumn.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.db.renamecolumn/v.db.renamecolumn.html 2019-05-18 15:50:05.000000000 +0000 @@ -46,4 +46,4 @@ Markus Neteler -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.db.renamecolumn/v.db.renamecolumn.py grass-7.8.0/scripts/v.db.renamecolumn/v.db.renamecolumn.py --- grass-7.6.1/scripts/v.db.renamecolumn/v.db.renamecolumn.py 2019-03-19 20:04:45.000000000 +0000 +++ grass-7.8.0/scripts/v.db.renamecolumn/v.db.renamecolumn.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -44,10 +44,6 @@ import os import grass.script as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): map = options['map'] diff -Nru grass-7.6.1/scripts/v.db.univar/testsuite/test_v_db_univar.py grass-7.8.0/scripts/v.db.univar/testsuite/test_v_db_univar.py --- grass-7.6.1/scripts/v.db.univar/testsuite/test_v_db_univar.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.db.univar/testsuite/test_v_db_univar.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,47 @@ +""" +Created on Sun Jun 08 19:08:07 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command + + +class TestVDbUnivar(TestCase): + """Test v.db.univar script""" + + mapName = 'elevation' + columnName = 'heights' + outputMap = 'samples' + + @classmethod + def setUpClass(cls): + """Use temp region""" + cls.use_temp_region() + cls.runModule('g.region', raster=cls.mapName, flags='p') + + @classmethod + def tearDownClass(cls): + """Remove temporary region""" + cls.runModule('g.remove', flags='f', type='raster', name=cls.mapName) + cls.del_temp_region() + + def test_calculate(self): + """run db.univar""" + run_command('v.random', output=self.outputMap, n=100, overwrite='True') + run_command('v.db.addtable', map=self.outputMap, + column="heights double precision") + run_command('v.what.rast', map=self.outputMap, raster=self.mapName, + column=self.columnName) + run_command('v.db.select', map=self.outputMap) + + module = SimpleModule('v.db.univar', map=self.outputMap, + column=self.columnName) + self.assertModule(module) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.db.univar/v.db.univar.html grass-7.8.0/scripts/v.db.univar/v.db.univar.html --- grass-7.6.1/scripts/v.db.univar/v.db.univar.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/v.db.univar/v.db.univar.html 2019-05-18 15:50:05.000000000 +0000 @@ -70,4 +70,4 @@ Michael Barton, Arizona State University

    and authors of r.univar.sh (Markus Neteler et al.) -

    Last changed: $Date: 2018-09-30 18:55:29 +0200 (Sun, 30 Sep 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.db.univar/v.db.univar.py grass-7.8.0/scripts/v.db.univar/v.db.univar.py --- grass-7.6.1/scripts/v.db.univar/v.db.univar.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/v.db.univar/v.db.univar.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -56,10 +56,6 @@ import grass.script as gscript from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): global tmp @@ -101,5 +97,5 @@ if __name__ == "__main__": options, flags = gscript.parser() - nuldev = file(os.devnull, 'w') + nuldev = open(os.devnull, 'w') main() diff -Nru grass-7.6.1/scripts/v.db.update/testsuite/test_v_db_update.py grass-7.8.0/scripts/v.db.update/testsuite/test_v_db_update.py --- grass-7.6.1/scripts/v.db.update/testsuite/test_v_db_update.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.db.update/testsuite/test_v_db_update.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,41 @@ +""" +Created on Sun Jun 08 22:14:26 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command + + +class TestVDbUpdate(TestCase): + """Test v.db.update script""" + + mapName = 'mygeodetic_pts' + + @classmethod + def setUpClass(cls): + """Copy vect""" + run_command('g.copy', vector='geodetic_pts,mygeodetic_pts') + + @classmethod + def tearDownClass(cls): + """Remove vector""" + run_command('v.db.dropcolumn', map=cls.mapName, columns="zval") + run_command('g.remove', flags='f', type='vector', name=cls.mapName) + + def test_update(self): + """update value test""" + run_command('v.db.addcolumn', map=self.mapName, + column="zval double precision") + + module = SimpleModule('v.db.update', map=self.mapName, column='zval', + query_column="CAST(z_value AS double precision)", + where="z_value <> 'N/A'") + self.assertModule(module) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.db.update/v.db.update.html grass-7.8.0/scripts/v.db.update/v.db.update.html --- grass-7.6.1/scripts/v.db.update/v.db.update.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.db.update/v.db.update.html 2019-05-18 15:50:05.000000000 +0000 @@ -105,4 +105,4 @@ Moritz Lennert (mlennert@club.worldonline.be)

    -Last changed: $Date: 2017-03-12 11:58:07 +0100 (Sun, 12 Mar 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.db.update/v.db.update.py grass-7.8.0/scripts/v.db.update/v.db.update.py --- grass-7.6.1/scripts/v.db.update/v.db.update.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.db.update/v.db.update.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -56,10 +56,6 @@ import os import grass.script as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): vector = options['map'] diff -Nru grass-7.6.1/scripts/v.dissolve/testsuite/test_v_dissolve.py grass-7.8.0/scripts/v.dissolve/testsuite/test_v_dissolve.py --- grass-7.6.1/scripts/v.dissolve/testsuite/test_v_dissolve.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.dissolve/testsuite/test_v_dissolve.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,40 @@ +""" +Created on Sun Jun 08 23:58:10 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command + + +class TestVDissolve(TestCase): + """Test v.dissolve script""" + + mapName = 'mysoils_general' + outputName = 'mysoils_general_families' + + @classmethod + def setUpClass(cls): + """Copy vect""" + run_command('g.copy', vector='soils_general,mysoils_general') + + @classmethod + def tearDownClass(cls): + """Remove vector""" + run_command('g.remove', flags='f', type='vector', + name=(cls.mapName, cls.outputName)) + + def test_dissolve(self): + """dissolve test""" + module = SimpleModule('v.dissolve', input=self.mapName, + output=self.outputName, column='GSL_NAME') + self.assertModule(module) + + self.assertVectorExists(self.outputName) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.dissolve/v.dissolve.html grass-7.8.0/scripts/v.dissolve/v.dissolve.html --- grass-7.6.1/scripts/v.dissolve/v.dissolve.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.dissolve/v.dissolve.html 2019-05-18 15:50:05.000000000 +0000 @@ -76,4 +76,4 @@ Markus Neteler for column support
    help page: Trevor Wiens -

    Last changed: $Date: 2014-12-27 00:33:06 +0100 (Sat, 27 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.dissolve/v.dissolve.py grass-7.8.0/scripts/v.dissolve/v.dissolve.py --- grass-7.6.1/scripts/v.dissolve/v.dissolve.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.dissolve/v.dissolve.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # # MODULE: v.dissolve @@ -40,13 +40,9 @@ import grass.script as grass from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): - nuldev = file(os.devnull, 'w') + nuldev = open(os.devnull, 'w') grass.run_command( 'g.remove', flags='f', type='vector', name='%s_%s' % (output, tmp), quiet=True, stderr=nuldev) diff -Nru grass-7.6.1/scripts/v.import/v.import.html grass-7.8.0/scripts/v.import/v.import.html --- grass-7.6.1/scripts/v.import/v.import.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.import/v.import.html 2019-05-18 15:50:05.000000000 +0000 @@ -116,4 +116,4 @@ Improvements: Martin Landa, Anna Petrasova

    -Last changed: $Date: 2018-10-14 13:08:03 +0200 (Sun, 14 Oct 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.import/v.import.py grass-7.8.0/scripts/v.import/v.import.py --- grass-7.6.1/scripts/v.import/v.import.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.import/v.import.py 2019-09-04 13:16:01.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -104,17 +104,16 @@ import grass.script as grass from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - # initialize global vars TMPLOC = None SRCGISRC = None +TGTGISRC = None GISDBASE = None def cleanup(): + if TGTGISRC: + os.environ['GISRC'] = str(TGTGISRC) # remove temp location if TMPLOC: grass.try_rmdir(os.path.join(GISDBASE, TMPLOC)) @@ -123,7 +122,7 @@ def main(): - global TMPLOC, SRCGISRC, GISDBASE + global TMPLOC, SRCGISRC, TGTGISRC, GISDBASE overwrite = grass.overwrite() # list formats and exit @@ -192,7 +191,7 @@ tgtmapset = grassenv['MAPSET'] GISDBASE = grassenv['GISDBASE'] - tgtgisrc = os.environ['GISRC'] + TGTGISRC = os.environ['GISRC'] SRCGISRC = grass.tempfile() TMPLOC = 'temp_import_location_' + str(os.getpid()) @@ -232,7 +231,7 @@ if options['extent'] == 'region': # switch to target location - os.environ['GISRC'] = str(tgtgisrc) + os.environ['GISRC'] = str(TGTGISRC) # v.in.region in tgt vreg = 'vreg_' + str(os.getpid()) @@ -264,7 +263,7 @@ output = grass.list_grouped('vector')['PERMANENT'][0] # switch to target location - os.environ['GISRC'] = str(tgtgisrc) + os.environ['GISRC'] = str(TGTGISRC) # check if map exists if not grass.overwrite() and \ diff -Nru grass-7.6.1/scripts/v.in.e00/v.in.e00.html grass-7.8.0/scripts/v.in.e00/v.in.e00.html --- grass-7.6.1/scripts/v.in.e00/v.in.e00.html 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/v.in.e00/v.in.e00.html 2019-05-18 15:50:05.000000000 +0000 @@ -22,4 +22,4 @@ Markus Neteler, Otto Dassau, GDF Hannover bR, Germany -

    Last changed: $Date: 2015-11-24 09:07:58 +0100 (Tue, 24 Nov 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.in.e00/v.in.e00.py grass-7.8.0/scripts/v.in.e00/v.in.e00.py --- grass-7.6.1/scripts/v.in.e00/v.in.e00.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.in.e00/v.in.e00.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -46,10 +46,6 @@ from grass.script import core as gcore from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): filename = options['input'] @@ -109,14 +105,14 @@ if merging: files.sort() filename = "%s.cat.%s.e00" % (e00name, e00tmp) - outf = file(filename, 'wb') + outf = open(filename, 'wb') for f in files: - inf = file(f, 'rb') + inf = open(f, 'rb') shutil.copyfileobj(inf, outf) inf.close() outf.close() - nuldev = file(os.devnull, 'w+') + nuldev = open(os.devnull, 'w+') gcore.message(_("An error may appear next which will be ignored...")) if gcore.call(['avcimport', filename, e00shortname], stdout=nuldev, diff -Nru grass-7.6.1/scripts/v.in.geonames/v.in.geonames.html grass-7.8.0/scripts/v.in.geonames/v.in.geonames.html --- grass-7.6.1/scripts/v.in.geonames/v.in.geonames.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.in.geonames/v.in.geonames.html 2019-05-18 15:50:05.000000000 +0000 @@ -81,4 +81,4 @@ Markus Neteler

    -Last changed: $Date: 2012-12-30 18:23:10 +0100 (Sun, 30 Dec 2012) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.in.geonames/v.in.geonames.py grass-7.8.0/scripts/v.in.geonames/v.in.geonames.py --- grass-7.6.1/scripts/v.in.geonames/v.in.geonames.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.in.geonames/v.in.geonames.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -35,12 +35,11 @@ #%end import os +import sys +if sys.version_info.major == 2: + from io import open import grass.script as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): infile = options['input'] @@ -63,8 +62,8 @@ grass.warning( _("Since DBF driver is used, the content of the 'alternatenames' column might be cut with respect to the original Geonames.org column content")) - with open(infile) as f: - num_places = sum(1 for _ in f) + with open(infile, encoding='utf-8') as f: + num_places = sum(1 for each in f) grass.message(_("Converting %d place names...") % num_places) # pump data into GRASS: diff -Nru grass-7.6.1/scripts/v.in.lines/v.in.lines.html grass-7.8.0/scripts/v.in.lines/v.in.lines.html --- grass-7.6.1/scripts/v.in.lines/v.in.lines.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/v.in.lines/v.in.lines.html 2019-05-18 15:50:05.000000000 +0000 @@ -47,4 +47,4 @@ Hamish Bowman
    Dunedin, New Zealand -

    Last changed: $Date: 2012-09-09 21:11:23 +0200 (Sun, 09 Sep 2012) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.in.lines/v.in.lines.py grass-7.8.0/scripts/v.in.lines/v.in.lines.py --- grass-7.6.1/scripts/v.in.lines/v.in.lines.py 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/v.in.lines/v.in.lines.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -41,10 +41,6 @@ from grass.script.utils import separator, try_remove from grass.script import core as grass -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): try_remove(tmp) @@ -77,7 +73,7 @@ if not infile: # read from stdin and write to tmpfile (v.in.mapgen wants a real file) - outf = file(tmp, 'w') + outf = open(tmp, 'w') for line in inf: if len(line.lstrip()) == 0 or line[0] == '#': continue @@ -90,8 +86,8 @@ if fs == ' ': runfile = infile else: - inf = file(infile) - outf = file(tmp, 'w') + inf = open(infile) + outf = open(tmp, 'w') for line in inf: if len(line.lstrip()) == 0 or line[0] == '#': @@ -103,7 +99,7 @@ runfile = tmp # check that there are at least two columns (three if -z is given) - inf = file(runfile) + inf = open(runfile) for line in inf: if len(line.lstrip()) == 0 or line[0] == '#': continue diff -Nru grass-7.6.1/scripts/v.in.mapgen/v.in.mapgen.html grass-7.8.0/scripts/v.in.mapgen/v.in.mapgen.html --- grass-7.6.1/scripts/v.in.mapgen/v.in.mapgen.html 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/v.in.mapgen/v.in.mapgen.html 2019-05-18 15:50:05.000000000 +0000 @@ -27,4 +27,4 @@ Based on v.in.mapgen.sh for GRASS 5.0 by Andreas Lange
    Rewritten for GRASS 6 by Hamish Bowman -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.in.mapgen/v.in.mapgen.py grass-7.8.0/scripts/v.in.mapgen/v.in.mapgen.py --- grass-7.6.1/scripts/v.in.mapgen/v.in.mapgen.py 2019-03-19 20:04:36.000000000 +0000 +++ grass-7.8.0/scripts/v.in.mapgen/v.in.mapgen.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -54,10 +54,6 @@ from grass.script import core as grass from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): try_remove(tmp) @@ -95,8 +91,8 @@ tmp = grass.tempfile() # create ascii vector file - inf = file(infile) - outf = file(tmp, 'w') + inf = open(infile) + outf = open(tmp, 'w') grass.message(_("Importing data...")) cat = 1 @@ -163,7 +159,7 @@ # create digit header digfile = tmp + '.dig' - outf = file(digfile, 'w') + outf = open(digfile, 'w') t = string.Template( """ORGANIZATION: GRASSroots organization DIGIT DATE: $date @@ -186,7 +182,7 @@ outf.write(s) # process points list to ascii vector file (merge in vertices) - inf = file(tmp) + inf = open(tmp) shutil.copyfileobj(inf, outf) inf.close() @@ -194,7 +190,7 @@ if not name: # if no name for vector file given, cat to stdout - inf = file(digfile) + inf = open(digfile) shutil.copyfileobj(inf, sys.stdout) inf.close() else: diff -Nru grass-7.6.1/scripts/v.in.wfs/v.in.wfs.html grass-7.8.0/scripts/v.in.wfs/v.in.wfs.html --- grass-7.6.1/scripts/v.in.wfs/v.in.wfs.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.in.wfs/v.in.wfs.html 2019-05-18 15:50:05.000000000 +0000 @@ -55,4 +55,4 @@ Markus Neteler, Hamish Bowman

    -Last changed: $Date: 2013-04-13 17:23:39 +0200 (Sat, 13 Apr 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.in.wfs/v.in.wfs.py grass-7.8.0/scripts/v.in.wfs/v.in.wfs.py --- grass-7.6.1/scripts/v.in.wfs/v.in.wfs.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.in.wfs/v.in.wfs.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -85,10 +85,6 @@ from urllib.request import urlopen from urllib.error import URLError, HTTPError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): out = options['output'] @@ -137,9 +133,8 @@ except URLError as e: # GTC WFS request network failure grass.fatal(_("Failed to reach the server.\nReason: %s") % e.reason) - - - outf = file(tmpxml, 'wb') + + outf = open(tmpxml, 'wb') while True: s = inf.read() if not s: diff -Nru grass-7.6.1/scripts/v.pack/testsuite/test_v_pack.py grass-7.8.0/scripts/v.pack/testsuite/test_v_pack.py --- grass-7.6.1/scripts/v.pack/testsuite/test_v_pack.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.pack/testsuite/test_v_pack.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,35 @@ +""" +Created on Sun Jun 08 23:19:09 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +import os + + +class TestVPack(TestCase): + """Test v.pack script""" + + mapName = 'roadsmajor' + outFile = 'roadsmajor.pack' + + @classmethod + def tearDownClass(cls): + """Remove output file""" + if (os.path.isfile(cls.outFile)): + os.remove(cls.outFile) + + def test_v_pack(self): + """Create a pack file test""" + module = SimpleModule('v.pack', input=self.mapName, + output=self.outFile, overwrite=True) + self.assertModule(module) + + self.assertFileExists(filename=self.outFile) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.pack/v.pack.html grass-7.8.0/scripts/v.pack/v.pack.html --- grass-7.6.1/scripts/v.pack/v.pack.html 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/v.pack/v.pack.html 2019-05-18 15:50:05.000000000 +0000 @@ -43,4 +43,4 @@ Luca Delucchi, Fondazione E. Mach (Italy), based on the r.pack code -

    Last changed: $Date: 2015-09-05 17:57:08 +0200 (Sat, 05 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.pack/v.pack.py grass-7.8.0/scripts/v.pack/v.pack.py --- grass-7.6.1/scripts/v.pack/v.pack.py 2019-03-19 20:04:39.000000000 +0000 +++ grass-7.8.0/scripts/v.pack/v.pack.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -43,10 +43,6 @@ from grass.script import core as grass from grass.script import vector as vector -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): try_rmdir(basedir) diff -Nru grass-7.6.1/scripts/v.rast.stats/testsuite/test_v_rast_stats.py grass-7.8.0/scripts/v.rast.stats/testsuite/test_v_rast_stats.py --- grass-7.6.1/scripts/v.rast.stats/testsuite/test_v_rast_stats.py 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.rast.stats/testsuite/test_v_rast_stats.py 2019-06-03 20:34:21.000000000 +0000 @@ -61,7 +61,7 @@ v_db_select = SimpleModule("v.db.select", map="zone_map") self.runModule(v_db_select) - self.assertLooksLike(univar_string, v_db_select.outputs.stdout) + self.assertLooksLike(univar_string, str(v_db_select.outputs.stdout)) def test_line_d(self): @@ -75,7 +75,7 @@ v_db_select = SimpleModule("v.db.select", map="test_line") self.runModule(v_db_select) - self.assertLooksLike(output_str, v_db_select.outputs.stdout) + self.assertLooksLike(output_str, str(v_db_select.outputs.stdout)) def test_line(self): @@ -90,7 +90,7 @@ v_db_select = SimpleModule("v.db.select", map="test_line") self.runModule(v_db_select) - self.assertLooksLike(output_str, v_db_select.outputs.stdout) + self.assertLooksLike(output_str, str(v_db_select.outputs.stdout)) class TestRastStatsFails(TestCase): diff -Nru grass-7.6.1/scripts/v.rast.stats/v.rast.stats.html grass-7.8.0/scripts/v.rast.stats/v.rast.stats.html --- grass-7.6.1/scripts/v.rast.stats/v.rast.stats.html 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.rast.stats/v.rast.stats.html 2019-05-22 21:47:51.000000000 +0000 @@ -72,4 +72,4 @@ Markus Neteler, CEA (for the EDEN EU/FP6 Project) -

    Last changed: $Date: 2018-05-03 22:08:30 +0200 (Thu, 03 May 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.rast.stats/v.rast.stats.py grass-7.8.0/scripts/v.rast.stats/v.rast.stats.py --- grass-7.6.1/scripts/v.rast.stats/v.rast.stats.py 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/v.rast.stats/v.rast.stats.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -75,12 +75,9 @@ import os import atexit import grass.script as grass +from grass.script.utils import decode from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): if rastertmp: @@ -99,7 +96,7 @@ # we need a random name tmpname = grass.basename(tmp) - nuldev = file(os.devnull, 'w') + nuldev = open(os.devnull, 'w') rasters = options['raster'].split(',') colprefixes = options['column_prefix'].split(',') @@ -174,6 +171,7 @@ cats = [] for line in p.stdout: + line = decode(line) cats.append(line.rstrip('\r\n').split(';')[0]) p.wait() @@ -212,7 +210,7 @@ # replaced by user choiche #basecols = ['n', 'min', 'max', 'range', 'mean', 'stddev', 'variance', 'cf_var', 'sum'] - for i in xrange(len(rasters)): + for i in range(len(rasters)): raster = rasters[i] colprefix = colprefixes[i] # we need at least three chars to distinguish [mea]n from [med]ian @@ -286,7 +284,7 @@ # get rid of any earlier attempts grass.try_remove(sqltmp) - f = file(sqltmp, 'w') + f = open(sqltmp, 'w') # do the stats p = grass.pipe_command('r.univar', flags='t' + extstat, map=raster, @@ -300,7 +298,7 @@ first_line = 0 continue - vars = line.rstrip('\r\n').split(';') + vars = decode(line).rstrip('\r\n').split(';') f.write("UPDATE %s SET" % fi['table']) first_var = 1 diff -Nru grass-7.6.1/scripts/v.report/v.report.html grass-7.8.0/scripts/v.report/v.report.html --- grass-7.6.1/scripts/v.report/v.report.html 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/v.report/v.report.html 2019-05-18 15:50:05.000000000 +0000 @@ -36,4 +36,4 @@ Markus Neteler, GDF Hannover -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.report/v.report.py grass-7.8.0/scripts/v.report/v.report.py --- grass-7.6.1/scripts/v.report/v.report.py 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/v.report/v.report.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # @@ -6,7 +6,7 @@ # AUTHOR(S): Markus Neteler, converted to Python by Glynn Clements # Bug fixes, sort for coor by Huidae Cho # PURPOSE: Reports geometry statistics for vector maps -# COPYRIGHT: (C) 2005, 2007-2017 by MN and the GRASS Development Team +# COPYRIGHT: (C) 2005, 2007-2017, 2019 by MN and the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2). Read the file COPYING that comes with GRASS @@ -42,14 +42,19 @@ #% options: asc,desc #% descriptions: asc;Sort in ascending order;desc;Sort in descending order #%end +#%flag +#% key: c +#% description: Do not include column names in output +#%end +#%flag +#% key: d +#% description: Report for geometries with no database records +#%end import sys import os import grass.script as grass - -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) +from grass.script.utils import decode def uniq(l): @@ -68,7 +73,7 @@ layer = options['layer'] units = options['units'] - nuldev = file(os.devnull, 'w') + nuldev = open(os.devnull, 'w') if not grass.find_file(mapname, 'vector')['file']: grass.fatal(_("Vector map <%s> not found") % mapname) @@ -98,10 +103,12 @@ p = grass.pipe_command('v.db.select', quiet=True, map=mapname, layer=layer) records1 = [] catcol = -1 + ncols = 0 for line in p.stdout: - cols = line.rstrip('\r\n').split('|') + cols = decode(line).rstrip('\r\n').split('|') if catcol == -1: - for i in range(0, len(cols)): + ncols = len(cols) + for i in range(0, ncols): if cols[i] == f['key']: catcol = i break @@ -132,7 +139,7 @@ layer=layer, units=unitsp) records2 = [] for line in p.stdout: - fields = line.rstrip('\r\n').split('|') + fields = decode(line).rstrip('\r\n').split('|') if fields[0] in ['cat', '-1', '0']: continue records2.append([int(fields[0])] + fields[1:]) @@ -144,13 +151,20 @@ # v.db.select can return attributes that are not linked to features. records3 = [] for r2 in records2: - records3.append(filter(lambda r1: r1[catcol] == r2[0], records1)[0] + r2[1:]) + rec = list(filter(lambda r1: r1[catcol] == r2[0], records1)) + if len(rec) > 0: + res = rec[0] + r2[1:] + elif flags['d']: + res = [r2[0]] + [''] * (ncols - 1) + r2[1:] + else: + continue + records3.append(res) else: catcol = 0 records1 = [] p = grass.pipe_command('v.category', inp=mapname, layer=layer, option='print') for line in p.stdout: - field = int(line.rstrip()) + field = int(decode(line).rstrip()) if field > 0: records1.append(field) p.wait() @@ -163,7 +177,7 @@ layer=layer, units=unitsp) records3 = [] for line in p.stdout: - fields = line.rstrip('\r\n').split('|') + fields = decode(line).rstrip('\r\n').split('|') if fields[0] in ['cat', '-1', '0']: continue records3.append([int(fields[0])] + fields[1:]) @@ -171,7 +185,8 @@ records3.sort() # print table header - sys.stdout.write('|'.join(colnames + extracolnames) + '\n') + if not flags['c']: + sys.stdout.write('|'.join(colnames + extracolnames) + '\n') # make and print the table: numcols = len(colnames) + len(extracolnames) diff -Nru grass-7.6.1/scripts/v.to.lines/testsuite/test_v_to_lines.py grass-7.8.0/scripts/v.to.lines/testsuite/test_v_to_lines.py --- grass-7.6.1/scripts/v.to.lines/testsuite/test_v_to_lines.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.to.lines/testsuite/test_v_to_lines.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,44 @@ +""" +Created on Sun Jun 09 12:28:03 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + + +class TestVDToLines(TestCase): + """Test v.to.lines script""" + + inputMap = 'boundary_municp' + outputMap = 'boundary_municp_lines' + + inputMap2 = 'geodetic_pts' + outputMap2 = 'geodetic_pts_lines' + + @classmethod + def tearDownClass(cls): + """Remove created vector""" + cls.runModule('g.remove', type='vector', name=(cls.outputMap, + cls.outputMap2), flags='f') + + def test_area_to_line_check(self): + """Area to line conversion test""" + module = SimpleModule('v.to.lines', input=self.inputMap, + output=self.outputMap) + self.assertModule(module) + + self.assertVectorExists(self.outputMap) + + def test_point_to_line_check(self): + """Point to line conversion test""" + module = SimpleModule('v.to.lines', input=self.inputMap2, + output=self.outputMap2, overwrite=True) + self.assertModule(module) + + self.assertVectorExists(self.outputMap2) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.to.lines/v.to.lines.html grass-7.8.0/scripts/v.to.lines/v.to.lines.html --- grass-7.6.1/scripts/v.to.lines/v.to.lines.html 2019-03-19 20:04:38.000000000 +0000 +++ grass-7.8.0/scripts/v.to.lines/v.to.lines.html 2019-05-18 15:50:05.000000000 +0000 @@ -47,4 +47,4 @@ Luca Delucchi, Fondazione Edmund Mach

    -Last changed: $Date: 2015-01-07 21:51:53 +0100 (Wed, 07 Jan 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.to.lines/v.to.lines.py grass-7.8.0/scripts/v.to.lines/v.to.lines.py --- grass-7.6.1/scripts/v.to.lines/v.to.lines.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/v.to.lines/v.to.lines.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -41,13 +41,10 @@ #%end import grass.script as grass +from grass.script.utils import decode from grass.exceptions import CalledModuleError import os -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def main(): # Get the options @@ -127,7 +124,8 @@ name=remove_names, quiet=quiet) grass.fatal(_("Error converting polygon to line")) report = grass.read_command('v.category', flags='g', input=out_type, - option='report', quiet=quiet).split('\n') + option='report', quiet=quiet) + report = decode(report).split('\n') for r in report: if r.find('centroid') != -1: min_cat = report[0].split()[-2] diff -Nru grass-7.6.1/scripts/v.unpack/testsuite/test_v_unpack.py grass-7.8.0/scripts/v.unpack/testsuite/test_v_unpack.py --- grass-7.6.1/scripts/v.unpack/testsuite/test_v_unpack.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.unpack/testsuite/test_v_unpack.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,38 @@ +""" +Created on Sun Jun 08 12:50:45 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +import os + + +class TestVUnpack(TestCase): + """Test v.unpack script""" + + mapName = 'roadsmajor' + packFile = 'roadsmajor.pack' + + @classmethod + def setUpClass(cls): + """Run v.pack to create packfile.""" + cls.runModule('v.pack', input=cls.mapName, output=cls.packFile) + + @classmethod + def tearDownClass(cls): + """Remove pack file created region""" + cls.runModule('g.remove', type='vector', name=cls.mapName, flags='f') + if (os.path.isfile(cls.packFile)): + os.remove(cls.packFile) + + def test_v_pack(self): + """Unpack file test""" + module = SimpleModule('v.unpack', input=self.packFile, overwrite=True) + self.assertModule(module) + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.unpack/v.unpack.html grass-7.8.0/scripts/v.unpack/v.unpack.html --- grass-7.6.1/scripts/v.unpack/v.unpack.html 2019-03-19 20:04:43.000000000 +0000 +++ grass-7.8.0/scripts/v.unpack/v.unpack.html 2019-05-18 15:50:05.000000000 +0000 @@ -34,4 +34,4 @@ Luca Delucchi, Fondazione E. Mach (Italy), based on the r.unpack code

    -Last changed: $Date: 2015-09-05 17:57:08 +0200 (Sat, 05 Sep 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.unpack/v.unpack.py grass-7.8.0/scripts/v.unpack/v.unpack.py --- grass-7.6.1/scripts/v.unpack/v.unpack.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/v.unpack/v.unpack.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -53,10 +53,6 @@ from grass.script import db as grassdb from grass.exceptions import CalledModuleError -# i18N -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - def cleanup(): try_rmdir(tmp_dir) diff -Nru grass-7.6.1/scripts/v.what.strds/testsuite/test_what_strds.py grass-7.8.0/scripts/v.what.strds/testsuite/test_what_strds.py --- grass-7.6.1/scripts/v.what.strds/testsuite/test_what_strds.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/v.what.strds/testsuite/test_what_strds.py 2019-06-03 20:34:21.000000000 +0000 @@ -10,8 +10,10 @@ """ from grass.gunittest.case import TestCase +from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule import grass.script as gscript +from grass.script.utils import decode class TestWhatStrds(TestCase): @@ -63,8 +65,7 @@ 2|100|200|300|400 3|100|200|300|400 """ - self.assertLooksLike(output, db_sel.outputs.stdout) + self.assertMultiLineEqual(output, decode(db_sel.outputs.stdout)) if __name__ == '__main__': - from grass.gunittest.main import test test() diff -Nru grass-7.6.1/scripts/v.what.strds/v.what.strds.html grass-7.8.0/scripts/v.what.strds/v.what.strds.html --- grass-7.6.1/scripts/v.what.strds/v.what.strds.html 2019-03-19 20:04:41.000000000 +0000 +++ grass-7.8.0/scripts/v.what.strds/v.what.strds.html 2019-05-18 15:50:05.000000000 +0000 @@ -25,4 +25,4 @@ Luca Delucchi

    -Last changed: $Date: 2014-03-27 17:21:58 +0100 (Thu, 27 Mar 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.what.strds/v.what.strds.py grass-7.8.0/scripts/v.what.strds/v.what.strds.py --- grass-7.6.1/scripts/v.what.strds/v.what.strds.py 2019-03-19 20:04:40.000000000 +0000 +++ grass-7.8.0/scripts/v.what.strds/v.what.strds.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -52,11 +52,6 @@ import grass.script as grass from grass.exceptions import CalledModuleError -# i18N -import os -import gettext -gettext.install('grassmods', os.path.join(os.getenv("GISBASE"), 'locale')) - ############################################################################ diff -Nru grass-7.6.1/scripts/v.what.vect/testsuite/test_v_what_vect.py grass-7.8.0/scripts/v.what.vect/testsuite/test_v_what_vect.py --- grass-7.6.1/scripts/v.what.vect/testsuite/test_v_what_vect.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/scripts/v.what.vect/testsuite/test_v_what_vect.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,45 @@ +""" +Created on Sun Jun 09 11:42:54 2018 + +@author: Sanjeet Bhatti +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +from grass.gunittest.gmodules import SimpleModule + +from grass.script.core import run_command +from grass.script.utils import decode + + +class TestVWhatVect(TestCase): + """Test v.what.vect script""" + + mapName = 'myhospitals' + + @classmethod + def setUpClass(cls): + """setup""" + run_command('g.copy', vector='hospitals,myhospitals') + + @classmethod + def tearDownClass(cls): + """Remove created vector""" + cls.runModule('g.remove', type='vector', name=cls.mapName, flags='f') + + def test_what_vect(self): + """Uploads vector values""" + run_command('v.db.addcolumn', map=self.mapName, + columns="urb_name varchar(25)") + + module = SimpleModule('v.what.vect', map=self.mapName, + query_map='urbanarea', column='urb_name', + query_column='NAME') + self.assertModule(module) + + m = SimpleModule('v.db.select', map=self.mapName) + self.assertModule(m) + self.assertRegexpMatches(decode(m.outputs.stdout), 'urb_name') + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/scripts/v.what.vect/v.what.vect.html grass-7.8.0/scripts/v.what.vect/v.what.vect.html --- grass-7.6.1/scripts/v.what.vect/v.what.vect.html 2019-03-19 20:04:36.000000000 +0000 +++ grass-7.8.0/scripts/v.what.vect/v.what.vect.html 2019-05-22 21:47:51.000000000 +0000 @@ -76,4 +76,4 @@ Markus Neteler -

    Last changed: $Date: 2018-08-03 20:49:03 +0200 (Fri, 03 Aug 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/v.what.vect/v.what.vect.py grass-7.8.0/scripts/v.what.vect/v.what.vect.py --- grass-7.6.1/scripts/v.what.vect/v.what.vect.py 2019-03-19 20:04:37.000000000 +0000 +++ grass-7.8.0/scripts/v.what.vect/v.what.vect.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ############################################################################ # diff -Nru grass-7.6.1/scripts/wxpyimgview/wxpyimgview_gui.py grass-7.8.0/scripts/wxpyimgview/wxpyimgview_gui.py --- grass-7.6.1/scripts/wxpyimgview/wxpyimgview_gui.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/wxpyimgview/wxpyimgview_gui.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/scripts/wxpyimgview/wxpyimgview.html grass-7.8.0/scripts/wxpyimgview/wxpyimgview.html --- grass-7.6.1/scripts/wxpyimgview/wxpyimgview.html 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/wxpyimgview/wxpyimgview.html 2019-05-18 15:50:05.000000000 +0000 @@ -22,4 +22,4 @@

    AUTHOR

    Glynn Clements -

    Last changed: $Date: 2014-10-27 18:15:56 +0100 (Mon, 27 Oct 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/scripts/wxpyimgview/wxpyimgview.py grass-7.8.0/scripts/wxpyimgview/wxpyimgview.py --- grass-7.6.1/scripts/wxpyimgview/wxpyimgview.py 2019-03-19 20:04:42.000000000 +0000 +++ grass-7.8.0/scripts/wxpyimgview/wxpyimgview.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/temporal/t.connect/t.connect.html grass-7.8.0/temporal/t.connect/t.connect.html --- grass-7.6.1/temporal/t.connect/t.connect.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.connect/t.connect.html 2019-05-18 15:50:05.000000000 +0000 @@ -60,4 +60,4 @@ Soeren Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-22 10:10:38 +0200 (Tue, 22 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py grass-7.8.0/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py --- grass-7.6.1/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py 2019-06-03 20:34:21.000000000 +0000 @@ -167,9 +167,9 @@ tinfo_string = """id=A@test3d1 name=A mapset=test3d1 - start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 - granularity=1 month""" + start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00' + granularity='1 month'""" info = SimpleModule( "t.info", flags="g", type="str3ds", input="A@test3d1") @@ -180,9 +180,9 @@ tinfo_string = """id=A@test3d2 name=A mapset=test3d2 - start_time=2001-01-01 00:00:00 - end_time=2001-07-01 00:00:00 - granularity=2 months""" + start_time='2001-01-01 00:00:00' + end_time='2001-07-01 00:00:00' + granularity='2 months'""" info = SimpleModule( "t.info", flags="g", type="str3ds", input="A@test3d2") @@ -193,9 +193,9 @@ tinfo_string = """id=A@test3d3 name=A mapset=test3d3 - start_time=2001-01-01 00:00:00 - end_time=2001-10-01 00:00:00 - granularity=3 months""" + start_time='2001-01-01 00:00:00' + end_time='2001-10-01 00:00:00' + granularity='3 months'""" info = SimpleModule( "t.info", flags="g", type="str3ds", input="A@test3d3") @@ -206,9 +206,9 @@ tinfo_string = """id=A@test3d4 name=A mapset=test3d4 - start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=4 months""" + start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='4 months'""" info = SimpleModule( "t.info", flags="g", type="str3ds", input="A@test3d4") @@ -221,8 +221,8 @@ name=a1 mapset=test3d1 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-02-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-02-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="raster_3d", input="a1@test3d1") @@ -233,8 +233,8 @@ name=a1 mapset=test3d2 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-03-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-03-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="raster_3d", input="a1@test3d2") @@ -245,8 +245,8 @@ name=a1 mapset=test3d3 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="raster_3d", input="a1@test3d3") @@ -257,8 +257,8 @@ name=a1 mapset=test3d4 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-05-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-05-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="raster_3d", input="a1@test3d4") diff -Nru grass-7.6.1/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py grass-7.8.0/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py --- grass-7.6.1/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py 2019-06-03 20:34:21.000000000 +0000 @@ -180,9 +180,9 @@ tinfo_string = """id=A@test1 name=A mapset=test1 - start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 - granularity=1 month""" + start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00' + granularity='1 month'""" info = SimpleModule("t.info", flags="g", input="A@test1") self.assertModuleKeyValue( @@ -192,9 +192,9 @@ tinfo_string = """id=A@test2 name=A mapset=test2 - start_time=2001-01-01 00:00:00 - end_time=2001-07-01 00:00:00 - granularity=2 months""" + start_time='2001-01-01 00:00:00' + end_time='2001-07-01 00:00:00' + granularity='2 months'""" info = SimpleModule("t.info", flags="g", input="A@test2") self.assertModuleKeyValue( @@ -204,9 +204,9 @@ tinfo_string = """id=A@test3 name=A mapset=test3 - start_time=2001-01-01 00:00:00 - end_time=2001-10-01 00:00:00 - granularity=3 months""" + start_time='2001-01-01 00:00:00' + end_time='2001-10-01 00:00:00' + granularity='3 months'""" info = SimpleModule("t.info", flags="g", input="A@test3") self.assertModuleKeyValue( @@ -216,9 +216,9 @@ tinfo_string = """id=A@test4 name=A mapset=test4 - start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=4 months""" + start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='4 months'""" info = SimpleModule("t.info", flags="g", input="A@test4") self.assertModuleKeyValue( @@ -227,9 +227,9 @@ tinfo_string = """id=A@test5 name=A mapset=test5 - start_time=2001-01-01 00:00:00 - end_time=2002-04-01 00:00:00 - granularity=5 months""" + start_time='2001-01-01 00:00:00' + end_time='2002-04-01 00:00:00' + granularity='5 months'""" info = SimpleModule("t.info", flags="g", input="A@test5") self.assertModuleKeyValue( @@ -241,8 +241,8 @@ name=a1 mapset=test1 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-02-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-02-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="raster", input="a1@test1") @@ -253,8 +253,8 @@ name=a1 mapset=test2 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-03-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-03-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="raster", input="a1@test2") @@ -265,8 +265,8 @@ name=a1 mapset=test3 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="raster", input="a1@test3") @@ -277,8 +277,8 @@ name=a1 mapset=test4 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-05-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-05-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="raster", input="a1@test4") @@ -289,8 +289,8 @@ name=a1 mapset=test5 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-06-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-06-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="raster", input="a1@test5") diff -Nru grass-7.6.1/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py grass-7.8.0/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py --- grass-7.6.1/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py 2019-06-03 20:34:21.000000000 +0000 @@ -175,9 +175,9 @@ tinfo_string = """id=A@testvect1 name=A mapset=testvect1 - start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 - granularity=1 month""" + start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00' + granularity='1 month'""" info = SimpleModule( "t.info", flags="g", type="stvds", input="A@testvect1") @@ -188,9 +188,9 @@ tinfo_string = """id=A@testvect2 name=A mapset=testvect2 - start_time=2001-01-01 00:00:00 - end_time=2001-07-01 00:00:00 - granularity=2 months""" + start_time='2001-01-01 00:00:00' + end_time='2001-07-01 00:00:00' + granularity='2 months'""" info = SimpleModule( "t.info", flags="g", type="stvds", input="A@testvect2") @@ -201,9 +201,9 @@ tinfo_string = """id=A@testvect3 name=A mapset=testvect3 - start_time=2001-01-01 00:00:00 - end_time=2001-10-01 00:00:00 - granularity=3 months""" + start_time='2001-01-01 00:00:00' + end_time='2001-10-01 00:00:00' + granularity='3 months'""" info = SimpleModule( "t.info", flags="g", type="stvds", input="A@testvect3") @@ -214,9 +214,9 @@ tinfo_string = """id=A@testvect4 name=A mapset=testvect4 - start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=4 months""" + start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='4 months'""" info = SimpleModule( "t.info", flags="g", type="stvds", input="A@testvect4") @@ -229,8 +229,8 @@ name=a1 mapset=testvect1 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-02-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-02-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="vector", input="a1@testvect1") @@ -241,8 +241,8 @@ name=a1 mapset=testvect2 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-03-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-03-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="vector", input="a1@testvect2") @@ -253,8 +253,8 @@ name=a1 mapset=testvect3 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="vector", input="a1@testvect3") @@ -265,8 +265,8 @@ name=a1 mapset=testvect4 temporal_type=absolute - start_time=2001-01-01 00:00:00 - end_time=2001-05-01 00:00:00 """ + start_time='2001-01-01 00:00:00' + end_time='2001-05-01 00:00:00'""" info = SimpleModule( "t.info", flags="g", type="vector", input="a1@testvect4") diff -Nru grass-7.6.1/temporal/t.create/t.create.html grass-7.8.0/temporal/t.create/t.create.html --- grass-7.6.1/temporal/t.create/t.create.html 2019-03-19 19:56:54.000000000 +0000 +++ grass-7.8.0/temporal/t.create/t.create.html 2019-05-18 15:50:05.000000000 +0000 @@ -52,5 +52,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-22 14:04:47 +0200 (Tue, 22 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.create/t.create.py grass-7.8.0/temporal/t.create/t.create.py --- grass-7.6.1/temporal/t.create/t.create.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.create/t.create.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/temporalintro.html grass-7.8.0/temporal/temporalintro.html --- grass-7.6.1/temporal/temporalintro.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/temporalintro.html 2019-09-04 13:16:10.000000000 +0000 @@ -243,23 +243,23 @@

    See also

      -
    • - Gebbert, S., Pebesma, E., 2014. TGRASS: A temporal GIS for field - based environmental modeling. Environmental Modelling & - Software 53, 1-12. (DOI) -
    • -
    • - Temporal - data processing (Wiki) -
    • -
    • - Vaclav Petras, Anna Petrasova, Helena Mitasova, Markus Neteler, +
    • Gebbert, S., Pebesma, E. 2014. TGRASS: A temporal GIS for field based environmental modeling. + Environmental Modelling & Software 53, 1-12 (DOI) + - preprint PDF
    • + +
    • Gebbert, S., Pebesma, E. 2017. The GRASS GIS temporal framework. International Journal of + Geographical Information Science 31, 1273-1292 (DOI)
    • + +
    • Gebbert, S., Leppelt, T., Pebesma, E., 2019. A topology based spatio-temporal map algebra for big data analysis. + Data 4, 86. (DOI)
    • + +
    • Temporal + data processing (Wiki)
    • + +
    • Vaclav Petras, Anna Petrasova, Helena Mitasova, Markus Neteler, FOSS4G 2014 workshop:
      Spatio-temporal - data handling and visualization in GRASS GIS -
    • -
    • - GEOSTAT 2012 - TGRASS Course -
    • + data handling and visualization in GRASS GIS + +
    • GEOSTAT 2012 GRASS Course
    diff -Nru grass-7.6.1/temporal/t.info/t.info.html grass-7.8.0/temporal/t.info/t.info.html --- grass-7.6.1/temporal/t.info/t.info.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.info/t.info.html 2019-05-18 15:50:05.000000000 +0000 @@ -152,5 +152,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-09-17 01:03:06 +0200 (Sat, 17 Sep 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.info/t.info.py grass-7.8.0/temporal/t.info/t.info.py --- grass-7.6.1/temporal/t.info/t.info.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.info/t.info.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -105,7 +105,7 @@ if name.find("@") >= 0: id_ = name else: - id_ = name + "@" + grass.encode(grass.gisenv()["MAPSET"]) + id_ = name + "@" + grass.gisenv()["MAPSET"] dataset = tgis.dataset_factory(type_, id_) diff -Nru grass-7.6.1/temporal/t.list/t.list.html grass-7.8.0/temporal/t.list/t.list.html --- grass-7.6.1/temporal/t.list/t.list.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.list/t.list.html 2019-05-18 15:50:05.000000000 +0000 @@ -94,5 +94,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2017-10-21 17:23:24 +0200 (Sat, 21 Oct 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.list/t.list.py grass-7.8.0/temporal/t.list/t.list.py --- grass-7.6.1/temporal/t.list/t.list.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.list/t.list.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.merge/t.merge.html grass-7.8.0/temporal/t.merge/t.merge.html --- grass-7.6.1/temporal/t.merge/t.merge.html 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.merge/t.merge.html 2019-05-18 15:50:05.000000000 +0000 @@ -224,5 +224,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-22 10:10:38 +0200 (Tue, 22 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.merge/t.merge.py grass-7.8.0/temporal/t.merge/t.merge.py --- grass-7.6.1/temporal/t.merge/t.merge.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.merge/t.merge.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -58,7 +58,7 @@ tgis.init() #Get the current mapset to create the id of the space time dataset - mapset = grass.encode(grass.gisenv()["MAPSET"]) + mapset = grass.gisenv()["MAPSET"] inputs_split = inputs.split(",") input_ids = [] diff -Nru grass-7.6.1/temporal/t.rast3d.algebra/t.rast3d.algebra.html grass-7.8.0/temporal/t.rast3d.algebra/t.rast3d.algebra.html --- grass-7.6.1/temporal/t.rast3d.algebra/t.rast3d.algebra.html 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.algebra/t.rast3d.algebra.html 2019-05-18 15:50:05.000000000 +0000 @@ -33,5 +33,5 @@ Thomas Leppelt, Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2014-11-26 14:25:33 +0100 (Wed, 26 Nov 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast3d.algebra/t.rast3d.algebra.py grass-7.8.0/temporal/t.rast3d.algebra/t.rast3d.algebra.py --- grass-7.6.1/temporal/t.rast3d.algebra/t.rast3d.algebra.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.algebra/t.rast3d.algebra.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast3d.extract/testsuite/test_extract.py grass-7.8.0/temporal/t.rast3d.extract/testsuite/test_extract.py --- grass-7.6.1/temporal/t.rast3d.extract/testsuite/test_extract.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.extract/testsuite/test_extract.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,163 +0,0 @@ -"""Test t.rast3d.extract - -(C) 2014 by the GRASS Development Team -This program is free software under the GNU General Public -License (>=v2). Read the file COPYING that comes with GRASS -for details. - -:authors: Soeren Gebbert -""" - -import grass.pygrass.modules as pymod -import subprocess -from grass.gunittest.case import TestCase -from grass.gunittest.gmodules import SimpleModule - -class TestRaster3dExtraction(TestCase): - - @classmethod - def setUpClass(cls): - """Initiate the temporal GIS and set the region - """ - cls.use_temp_region() - cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=10, res3=10) - - @classmethod - def tearDownClass(cls): - """Remove the temporary region - """ - cls.del_temp_region() - - def setUp(self): - """Create input data for transient groundwater flow computation - """ - # Use always the current mapset as temporal database - self.runModule("r3.mapcalc", expression="a1 = 100", overwrite=True) - self.runModule("r3.mapcalc", expression="a2 = 200", overwrite=True) - self.runModule("r3.mapcalc", expression="a3 = 300", overwrite=True) - self.runModule("r3.mapcalc", expression="a4 = 400", overwrite=True) - self.runModule("r3.mapcalc", expression="a5 = 500", overwrite=True) - self.runModule("r3.mapcalc", expression="a6 = 600", overwrite=True) - - self.runModule("t.create", type="str3ds", temporaltype="absolute", - output="A", title="A test", description="A test", overwrite=True) - self.runModule("t.register", flags="i", type="raster_3d", input="A", - maps="a1,a2,a3,a4,a5,a6", - start="2001-01-01", increment="3 months", overwrite=True) - - def tearDown(self): - """Remove generated data""" - self.runModule("t.remove", flags="rf", type="str3ds", - inputs="A,B") - - def test_selection(self): - """Perform a simple selection by datetime""" - self.assertModule("t.rast3d.extract", input="A", output="B", - where="start_time > '2001-06-01'") - - #self.assertModule("t.info", flags="g", input="B") - - tinfo_string="""start_time=2001-07-01 00:00:00 - end_time=2002-07-01 00:00:00 - granularity=3 months - map_time=interval - aggregation_type=None - number_of_maps=4 - min_min=300.0 - min_max=600.0 - max_min=300.0 - max_max=600.0""" - - info = SimpleModule("t.info", flags="g", type="str3ds", input="B") - self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") - - def test_selection_and_expression(self): - """Perform a selection by datetime and a r3.mapcalc expression""" - self.assertModule("t.rast3d.extract", input="A", output="B", - where="start_time > '2001-06-01'", - expression=" if(A > 400, A, null())", - basename="b", nprocs=2, overwrite=True) - - #self.assertModule("t.info", flags="g", input="B") - - tinfo_string="""start_time=2002-01-01 00:00:00 - end_time=2002-07-01 00:00:00 - granularity=3 months - map_time=interval - aggregation_type=None - number_of_maps=2 - min_min=500.0 - min_max=600.0 - max_min=500.0 - max_max=600.0""" - - info = SimpleModule("t.info", flags="g", type="str3ds", input="B") - self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") - - def test_expression_with_empty_maps(self): - """Perform r3.mapcalc expression and register empty maps""" - self.assertModule("t.rast3d.extract", flags="n", input="A", output="B", - expression=" if(A > 400, A, null())", - basename="b", nprocs=2, overwrite=True) - - #self.assertModule("t.info", flags="g", input="B") - - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-07-01 00:00:00 - granularity=3 months - map_time=interval - aggregation_type=None - number_of_maps=6 - min_min=500.0 - min_max=600.0 - max_min=500.0 - max_max=600.0""" - - info = SimpleModule("t.info", flags="g", type="str3ds", input="B") - self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") - - def test_time_suffix_with_expression(self): - """Perform extract with time suffix support and test if maps exists""" - self.assertModule("t.rast3d.extract", flags="n", input="A", nprocs=2, - output="B", basename="b", overwrite=True, - suffix="time", expression="if(A > 400, A, null())") - self.assertRaster3dExists('b_2001_01_01T00_00_00') - self.assertRaster3dDoesNotExist('b_2001_01') - - def test_num_suffix_with_expression(self): - """Perform extract with time suffix support and test if maps exists""" - self.assertModule("t.rast3d.extract", flags="n", input="A", nprocs=2, - output="B", basename="b", overwrite=True, - suffix='num%03', expression="if(A > 400, A, null())") - self.assertRaster3dExists('b_001') - self.assertRaster3dDoesNotExist('b_00001') - - -class TestRaster3dExtractionFails(TestCase): - - @classmethod - def setUpClass(cls): - """Initiate the temporal GIS and set the region - """ - cls.use_temp_region() - cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=10, res3=10) - - @classmethod - def tearDownClass(cls): - """Remove the temporary region - """ - cls.del_temp_region() - - def test_error_handling(self): - """Perform r3.mapcalc expression and register empty maps""" - # No input - self.assertModuleFail("t.rast3d.extract", output="B", basename="b") - # No output - self.assertModuleFail("t.rast3d.extract", input="A", basename="b") - # No basename - self.assertModuleFail("t.rast3d.extract", input="A", output="B", - expression=" if(A > 400, A, null())") - -if __name__ == '__main__': - from grass.gunittest.main import test - test() diff -Nru grass-7.6.1/temporal/t.rast3d.extract/testsuite/test_t_rast3d_extract.py grass-7.8.0/temporal/t.rast3d.extract/testsuite/test_t_rast3d_extract.py --- grass-7.6.1/temporal/t.rast3d.extract/testsuite/test_t_rast3d_extract.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.extract/testsuite/test_t_rast3d_extract.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,163 @@ +"""Test t.rast3d.extract + +(C) 2014 by the GRASS Development Team +This program is free software under the GNU General Public +License (>=v2). Read the file COPYING that comes with GRASS +for details. + +:authors: Soeren Gebbert +""" + +import grass.pygrass.modules as pymod +import subprocess +from grass.gunittest.case import TestCase +from grass.gunittest.gmodules import SimpleModule + +class TestRaster3dExtraction(TestCase): + + @classmethod + def setUpClass(cls): + """Initiate the temporal GIS and set the region + """ + cls.use_temp_region() + cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=10, res3=10) + + @classmethod + def tearDownClass(cls): + """Remove the temporary region + """ + cls.del_temp_region() + + def setUp(self): + """Create input data for transient groundwater flow computation + """ + # Use always the current mapset as temporal database + self.runModule("r3.mapcalc", expression="a1 = 100", overwrite=True) + self.runModule("r3.mapcalc", expression="a2 = 200", overwrite=True) + self.runModule("r3.mapcalc", expression="a3 = 300", overwrite=True) + self.runModule("r3.mapcalc", expression="a4 = 400", overwrite=True) + self.runModule("r3.mapcalc", expression="a5 = 500", overwrite=True) + self.runModule("r3.mapcalc", expression="a6 = 600", overwrite=True) + + self.runModule("t.create", type="str3ds", temporaltype="absolute", + output="A", title="A test", description="A test", overwrite=True) + self.runModule("t.register", flags="i", type="raster_3d", input="A", + maps="a1,a2,a3,a4,a5,a6", + start="2001-01-01", increment="3 months", overwrite=True) + + def tearDown(self): + """Remove generated data""" + self.runModule("t.remove", flags="rf", type="str3ds", + inputs="A,B") + + def test_selection(self): + """Perform a simple selection by datetime""" + self.assertModule("t.rast3d.extract", input="A", output="B", + where="start_time > '2001-06-01'") + + #self.assertModule("t.info", flags="g", input="B") + + tinfo_string="""start_time='2001-07-01 00:00:00' + end_time='2002-07-01 00:00:00' + granularity='3 months' + map_time=interval + aggregation_type=None + number_of_maps=4 + min_min=300.0 + min_max=600.0 + max_min=300.0 + max_max=600.0""" + + info = SimpleModule("t.info", flags="g", type="str3ds", input="B") + self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") + + def test_selection_and_expression(self): + """Perform a selection by datetime and a r3.mapcalc expression""" + self.assertModule("t.rast3d.extract", input="A", output="B", + where="start_time > '2001-06-01'", + expression=" if(A > 400, A, null())", + basename="b", nprocs=2, overwrite=True) + + #self.assertModule("t.info", flags="g", input="B") + + tinfo_string="""start_time='2002-01-01 00:00:00' + end_time='2002-07-01 00:00:00' + granularity='3 months' + map_time=interval + aggregation_type=None + number_of_maps=2 + min_min=500.0 + min_max=600.0 + max_min=500.0 + max_max=600.0""" + + info = SimpleModule("t.info", flags="g", type="str3ds", input="B") + self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") + + def test_expression_with_empty_maps(self): + """Perform r3.mapcalc expression and register empty maps""" + self.assertModule("t.rast3d.extract", flags="n", input="A", output="B", + expression=" if(A > 400, A, null())", + basename="b", nprocs=2, overwrite=True) + + #self.assertModule("t.info", flags="g", input="B") + + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-07-01 00:00:00' + granularity='3 months' + map_time=interval + aggregation_type=None + number_of_maps=6 + min_min=500.0 + min_max=600.0 + max_min=500.0 + max_max=600.0""" + + info = SimpleModule("t.info", flags="g", type="str3ds", input="B") + self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") + + def test_time_suffix_with_expression(self): + """Perform extract with time suffix support and test if maps exists""" + self.assertModule("t.rast3d.extract", flags="n", input="A", nprocs=2, + output="B", basename="b", overwrite=True, + suffix="time", expression="if(A > 400, A, null())") + self.assertRaster3dExists('b_2001_01_01T00_00_00') + self.assertRaster3dDoesNotExist('b_2001_01') + + def test_num_suffix_with_expression(self): + """Perform extract with time suffix support and test if maps exists""" + self.assertModule("t.rast3d.extract", flags="n", input="A", nprocs=2, + output="B", basename="b", overwrite=True, + suffix='num%03', expression="if(A > 400, A, null())") + self.assertRaster3dExists('b_001') + self.assertRaster3dDoesNotExist('b_00001') + + +class TestRaster3dExtractionFails(TestCase): + + @classmethod + def setUpClass(cls): + """Initiate the temporal GIS and set the region + """ + cls.use_temp_region() + cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=10, res3=10) + + @classmethod + def tearDownClass(cls): + """Remove the temporary region + """ + cls.del_temp_region() + + def test_error_handling(self): + """Perform r3.mapcalc expression and register empty maps""" + # No input + self.assertModuleFail("t.rast3d.extract", output="B", basename="b") + # No output + self.assertModuleFail("t.rast3d.extract", input="A", basename="b") + # No basename + self.assertModuleFail("t.rast3d.extract", input="A", output="B", + expression=" if(A > 400, A, null())") + +if __name__ == '__main__': + from grass.gunittest.main import test + test() diff -Nru grass-7.6.1/temporal/t.rast3d.extract/t.rast3d.extract.html grass-7.8.0/temporal/t.rast3d.extract/t.rast3d.extract.html --- grass-7.6.1/temporal/t.rast3d.extract/t.rast3d.extract.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.extract/t.rast3d.extract.html 2019-05-18 15:50:05.000000000 +0000 @@ -21,5 +21,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2014-11-26 14:25:33 +0100 (Wed, 26 Nov 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast3d.extract/t.rast3d.extract.py grass-7.8.0/temporal/t.rast3d.extract/t.rast3d.extract.py --- grass-7.6.1/temporal/t.rast3d.extract/t.rast3d.extract.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.extract/t.rast3d.extract.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast3d.list/t.rast3d.list.html grass-7.8.0/temporal/t.rast3d.list/t.rast3d.list.html --- grass-7.6.1/temporal/t.rast3d.list/t.rast3d.list.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.list/t.rast3d.list.html 2019-05-18 15:50:05.000000000 +0000 @@ -20,5 +20,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2014-11-26 14:25:33 +0100 (Wed, 26 Nov 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast3d.list/t.rast3d.list.py grass-7.8.0/temporal/t.rast3d.list/t.rast3d.list.py --- grass-7.6.1/temporal/t.rast3d.list/t.rast3d.list.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.list/t.rast3d.list.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.html grass-7.8.0/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.html --- grass-7.6.1/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.html 2019-05-18 15:50:05.000000000 +0000 @@ -20,4 +20,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2014-11-26 14:25:33 +0100 (Wed, 26 Nov 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py grass-7.8.0/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py --- grass-7.6.1/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast3d.univar/testsuite/test_t_rast3d_univar.py grass-7.8.0/temporal/t.rast3d.univar/testsuite/test_t_rast3d_univar.py --- grass-7.6.1/temporal/t.rast3d.univar/testsuite/test_t_rast3d_univar.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.univar/testsuite/test_t_rast3d_univar.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,133 @@ +"""Test t.rast.univar + +(C) 2014 by the GRASS Development Team +This program is free software under the GNU General Public +License (>=v2). Read the file COPYING that comes with GRASS +for details. + +@author Soeren Gebbert +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.gmodules import SimpleModule + + +class TestRasterUnivar(TestCase): + + @classmethod + def setUpClass(cls): + """Initiate the temporal GIS and set the region + """ + cls.use_temp_region() + cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=1, res3=1) + + cls.runModule("r3.mapcalc", expression="a_1 = 100", overwrite=True) + cls.runModule("r3.mapcalc", expression="a_2 = 200", overwrite=True) + cls.runModule("r3.mapcalc", expression="a_3 = 300", overwrite=True) + cls.runModule("r3.mapcalc", expression="a_4 = 400", overwrite=True) + + cls.runModule("t.create", type="str3ds", temporaltype="absolute", + output="A", title="A test", description="A test", + overwrite=True) + cls.runModule("t.register", flags="i", type="raster_3d", input="A", + maps="a_1,a_2,a_3,a_4", start="2001-01-01", + increment="3 months", overwrite=True) + + @classmethod + def tearDownClass(cls): + """Remove the temporary region + """ + cls.runModule("t.remove", flags="rf", type="str3ds", + inputs="A") + cls.del_temp_region() + + def test_1(self): + + t_rast3d_univar = SimpleModule("t.rast3d.univar", input="A", + where="start_time >= '2001-01-01'", + overwrite=True, verbose=True) + self.assertModule(t_rast3d_univar) + + univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells +a_1@testing|2001-01-01 00:00:00|2001-04-01 00:00:00|100|100|100|100|0|0|0|48000000|0|480000|480000 +a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|96000000|0|480000|480000 +a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|144000000|0|480000|480000 +a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|192000000|0|480000|480000 +""" + for ref, res in zip(univar_text.split("\n"), t_rast3d_univar.outputs.stdout.split("\n")): + if ref and res: + ref_line = ref.split("|", 1)[1] + res_line = res.split("|", 1)[1] + self.assertLooksLike(ref_line, res_line) + + def test_2(self): + + t_rast3d_univar = SimpleModule("t.rast3d.univar", input="A", + where="start_time >= '2001-03-01'", + overwrite=True, verbose=True) + self.assertModule(t_rast3d_univar) + + univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells +a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|96000000|0|480000|480000 +a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|144000000|0|480000|480000 +a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|192000000|0|480000|480000 +""" + for ref, res in zip(univar_text.split("\n"), t_rast3d_univar.outputs.stdout.split("\n")): + if ref and res: + ref_line = ref.split("|", 1)[1] + res_line = res.split("|", 1)[1] + self.assertLooksLike(ref_line, res_line) + + def test_3(self): + + self.assertModule("t.rast3d.univar", input="A", + output="univar_output.txt", + where="start_time >= '2001-03-01'", + overwrite=True, verbose=True) + + univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells +a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|96000000|0|480000|480000 +a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|144000000|0|480000|480000 +a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|192000000|0|480000|480000 +""" + univar_output = open("univar_output.txt", "r").read() + + for ref, res in zip(univar_text.split("\n"), univar_output.split("\n")): + if ref and res: + ref_line = ref.split("|", 1)[1] + res_line = res.split("|", 1)[1] + self.assertLooksLike(ref_line, res_line) + + def test_4(self): + + self.assertModule("t.rast3d.univar", input="A", + output="univar_output.txt", flags="s", + where="start_time >= '2001-03-01'", + overwrite=True, verbose=True) + + univar_text=u"""a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|96000000|0|480000|480000 +a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|144000000|0|480000|480000 +a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|192000000|0|480000|480000 +""" + univar_output = open("univar_output.txt", "r").read() + + for ref, res in zip(univar_text.split("\n"), univar_output.split("\n")): + if ref and res: + ref_line = ref.split("|", 1)[1] + res_line = res.split("|", 1)[1] + self.assertLooksLike(ref_line, res_line) + + def test_5_error_handling_empty_strds(self): + # Empty str3ds + self.assertModuleFail("t.rast3d.univar", input="A", + output="univar_output.txt", + where="start_time >= '2015-03-01'", + overwrite=True, verbose=True) + + def test_6_error_handling_no_input(self): + # No input + self.assertModuleFail("t.rast3d.univar", output="out.txt") + +if __name__ == '__main__': + from grass.gunittest.main import test + test() diff -Nru grass-7.6.1/temporal/t.rast3d.univar/testsuite/test_univar.py grass-7.8.0/temporal/t.rast3d.univar/testsuite/test_univar.py --- grass-7.6.1/temporal/t.rast3d.univar/testsuite/test_univar.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.univar/testsuite/test_univar.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -"""Test t.rast.univar - -(C) 2014 by the GRASS Development Team -This program is free software under the GNU General Public -License (>=v2). Read the file COPYING that comes with GRASS -for details. - -@author Soeren Gebbert -""" - -from grass.gunittest.case import TestCase -from grass.gunittest.gmodules import SimpleModule - - -class TestRasterUnivar(TestCase): - - @classmethod - def setUpClass(cls): - """Initiate the temporal GIS and set the region - """ - cls.use_temp_region() - cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=1, res3=1) - - cls.runModule("r3.mapcalc", expression="a_1 = 100", overwrite=True) - cls.runModule("r3.mapcalc", expression="a_2 = 200", overwrite=True) - cls.runModule("r3.mapcalc", expression="a_3 = 300", overwrite=True) - cls.runModule("r3.mapcalc", expression="a_4 = 400", overwrite=True) - - cls.runModule("t.create", type="str3ds", temporaltype="absolute", - output="A", title="A test", description="A test", - overwrite=True) - cls.runModule("t.register", flags="i", type="raster_3d", input="A", - maps="a_1,a_2,a_3,a_4", start="2001-01-01", - increment="3 months", overwrite=True) - - @classmethod - def tearDownClass(cls): - """Remove the temporary region - """ - cls.runModule("t.remove", flags="rf", type="str3ds", - inputs="A") - cls.del_temp_region() - - def test_1(self): - - t_rast3d_univar = SimpleModule("t.rast3d.univar", input="A", - where="start_time >= '2001-01-01'", - overwrite=True, verbose=True) - self.assertModule(t_rast3d_univar) - - univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells -a_1@testing|2001-01-01 00:00:00|2001-04-01 00:00:00|100|100|100|100|0|0|0|48000000|0|480000|480000 -a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|96000000|0|480000|480000 -a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|144000000|0|480000|480000 -a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|192000000|0|480000|480000 -""" - for ref, res in zip(univar_text.split("\n"), t_rast3d_univar.outputs.stdout.split("\n")): - if ref and res: - ref_line = ref.split("|", 1)[1] - res_line = res.split("|", 1)[1] - self.assertLooksLike(ref_line, res_line) - - def test_2(self): - - t_rast3d_univar = SimpleModule("t.rast3d.univar", input="A", - where="start_time >= '2001-03-01'", - overwrite=True, verbose=True) - self.assertModule(t_rast3d_univar) - - univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells -a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|96000000|0|480000|480000 -a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|144000000|0|480000|480000 -a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|192000000|0|480000|480000 -""" - for ref, res in zip(univar_text.split("\n"), t_rast3d_univar.outputs.stdout.split("\n")): - if ref and res: - ref_line = ref.split("|", 1)[1] - res_line = res.split("|", 1)[1] - self.assertLooksLike(ref_line, res_line) - - def test_3(self): - - self.assertModule("t.rast3d.univar", input="A", - output="univar_output.txt", - where="start_time >= '2001-03-01'", - overwrite=True, verbose=True) - - univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells -a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|96000000|0|480000|480000 -a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|144000000|0|480000|480000 -a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|192000000|0|480000|480000 -""" - univar_output = open("univar_output.txt", "r").read() - - for ref, res in zip(univar_text.split("\n"), univar_output.split("\n")): - if ref and res: - ref_line = ref.split("|", 1)[1] - res_line = res.split("|", 1)[1] - self.assertLooksLike(ref_line, res_line) - - def test_4(self): - - self.assertModule("t.rast3d.univar", input="A", - output="univar_output.txt", flags="s", - where="start_time >= '2001-03-01'", - overwrite=True, verbose=True) - - univar_text="""a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|96000000|0|480000|480000 -a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|144000000|0|480000|480000 -a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|192000000|0|480000|480000 -""" - univar_output = open("univar_output.txt", "r").read() - - for ref, res in zip(univar_text.split("\n"), univar_output.split("\n")): - if ref and res: - ref_line = ref.split("|", 1)[1] - res_line = res.split("|", 1)[1] - self.assertLooksLike(ref_line, res_line) - - def test_5_error_handling_empty_strds(self): - # Empty str3ds - self.assertModuleFail("t.rast3d.univar", input="A", - output="univar_output.txt", - where="start_time >= '2015-03-01'", - overwrite=True, verbose=True) - - def test_6_error_handling_no_input(self): - # No input - self.assertModuleFail("t.rast3d.univar", output="out.txt") - -if __name__ == '__main__': - from grass.gunittest.main import test - test() diff -Nru grass-7.6.1/temporal/t.rast3d.univar/t.rast3d.univar.html grass-7.8.0/temporal/t.rast3d.univar/t.rast3d.univar.html --- grass-7.6.1/temporal/t.rast3d.univar/t.rast3d.univar.html 2019-03-19 19:56:54.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.univar/t.rast3d.univar.html 2019-05-18 15:50:05.000000000 +0000 @@ -17,5 +17,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2014-11-26 14:25:33 +0100 (Wed, 26 Nov 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast3d.univar/t.rast3d.univar.py grass-7.8.0/temporal/t.rast3d.univar/t.rast3d.univar.py --- grass-7.6.1/temporal/t.rast3d.univar/t.rast3d.univar.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast3d.univar/t.rast3d.univar.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_1_temp_accumulation.ref grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_1_temp_accumulation.ref --- grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_1_temp_accumulation.ref 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_1_temp_accumulation.ref 2019-06-03 20:34:21.000000000 +0000 @@ -1,7 +1,7 @@ name|start_time|min|max -temp_acc_1|2001-01-01 00:00:00|5.0|5.0 -temp_acc_2|2001-03-01 00:00:00|15.0|15.0 -temp_acc_3|2001-05-01 00:00:00|30.0|30.0 -temp_acc_4|2001-07-01 00:00:00|50.0|50.0 -temp_acc_5|2001-09-01 00:00:00|75.0|75.0 -temp_acc_6|2001-11-01 00:00:00|105.0|105.0 +temp_acc_001|2001-01-01 00:00:00|5.0|5.0 +temp_acc_002|2001-03-01 00:00:00|15.0|15.0 +temp_acc_003|2001-05-01 00:00:00|30.0|30.0 +temp_acc_004|2001-07-01 00:00:00|50.0|50.0 +temp_acc_005|2001-09-01 00:00:00|75.0|75.0 +temp_acc_006|2001-11-01 00:00:00|105.0|105.0 diff -Nru grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_1_temp_indi.ref grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_1_temp_indi.ref --- grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_1_temp_indi.ref 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_1_temp_indi.ref 2019-06-03 20:34:21.000000000 +0000 @@ -1,4 +1,4 @@ name|start_time|min|max -temp_occ_indicator_3|2001-05-01 00:00:00|1.0|1.0 -temp_occ_indicator_4|2001-07-01 00:00:00|2.0|2.0 -temp_occ_indicator_5|2001-09-01 00:00:00|3.0|3.0 +temp_occ_indicator_003|2001-05-01 00:00:00|1.0|1.0 +temp_occ_indicator_004|2001-07-01 00:00:00|2.0|2.0 +temp_occ_indicator_005|2001-09-01 00:00:00|3.0|3.0 diff -Nru grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_a.ref grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_a.ref --- grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_a.ref 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_a.ref 2019-06-03 20:34:21.000000000 +0000 @@ -1,4 +1,4 @@ name|start_time|min|max -temp_occ_3|2001-05-01 00:00:00|120.0|120.0 -temp_occ_4|2001-07-01 00:00:00|181.0|181.0 -temp_occ_5|2001-09-01 00:00:00|243.0|243.0 +temp_occ_003|2001-05-01 00:00:00|120.0|120.0 +temp_occ_004|2001-07-01 00:00:00|181.0|181.0 +temp_occ_005|2001-09-01 00:00:00|243.0|243.0 diff -Nru grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_b.ref grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_b.ref --- grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_b.ref 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_1_temp_occ_b.ref 2019-06-03 20:34:21.000000000 +0000 @@ -1,4 +1,4 @@ name|start_time|min|max -temp_occ_3|2001-05-01 00:00:00|120.0|120.0 -temp_occ_4|2001-07-01 00:00:00|181.0|181.0 -temp_occ_5|2001-09-01 00:00:00|243.0|243.0 +temp_occ_003|2001-05-01 00:00:00|120.0|120.0 +temp_occ_004|2001-07-01 00:00:00|181.0|181.0 +temp_occ_005|2001-09-01 00:00:00|243.0|243.0 diff -Nru grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_2_temp_accumulation.ref grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_2_temp_accumulation.ref --- grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_2_temp_accumulation.ref 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_2_temp_accumulation.ref 2019-06-03 20:34:21.000000000 +0000 @@ -1,7 +1,7 @@ name|start_time|min|max -temp_acc_6|2001-01-01 00:00:00|105.0|105.0 -temp_acc_5|2001-03-01 00:00:00|75.0|75.0 -temp_acc_4|2001-05-01 00:00:00|50.0|50.0 -temp_acc_3|2001-07-01 00:00:00|30.0|30.0 -temp_acc_2|2001-09-01 00:00:00|15.0|15.0 -temp_acc_1|2001-11-01 00:00:00|5.0|5.0 +temp_acc_006|2001-01-01 00:00:00|105.0|105.0 +temp_acc_005|2001-03-01 00:00:00|75.0|75.0 +temp_acc_004|2001-05-01 00:00:00|50.0|50.0 +temp_acc_003|2001-07-01 00:00:00|30.0|30.0 +temp_acc_002|2001-09-01 00:00:00|15.0|15.0 +temp_acc_001|2001-11-01 00:00:00|5.0|5.0 diff -Nru grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_2_temp_indi.ref grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_2_temp_indi.ref --- grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_2_temp_indi.ref 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_2_temp_indi.ref 2019-06-03 20:34:21.000000000 +0000 @@ -1,4 +1,4 @@ name|start_time|min|max -temp_occ_indicator_5|2001-03-01 00:00:00|3.0|3.0 -temp_occ_indicator_4|2001-05-01 00:00:00|2.0|2.0 -temp_occ_indicator_3|2001-07-01 00:00:00|1.0|1.0 +temp_occ_indicator_005|2001-03-01 00:00:00|3.0|3.0 +temp_occ_indicator_004|2001-05-01 00:00:00|2.0|2.0 +temp_occ_indicator_003|2001-07-01 00:00:00|1.0|1.0 diff -Nru grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_2_temp_occ.ref grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_2_temp_occ.ref --- grass-7.6.1/temporal/t.rast.accdetect/testsuite/data/test_2_temp_occ.ref 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accdetect/testsuite/data/test_2_temp_occ.ref 2019-06-03 20:34:21.000000000 +0000 @@ -1,4 +1,4 @@ name|start_time|min|max -temp_occ_5|2001-03-01 00:00:00|59.0|59.0 -temp_occ_4|2001-05-01 00:00:00|120.0|120.0 -temp_occ_3|2001-07-01 00:00:00|181.0|181.0 +temp_occ_005|2001-03-01 00:00:00|59.0|59.0 +temp_occ_004|2001-05-01 00:00:00|120.0|120.0 +temp_occ_003|2001-07-01 00:00:00|181.0|181.0 diff -Nru grass-7.6.1/temporal/t.rast.accdetect/testsuite/test_simple.py grass-7.8.0/temporal/t.rast.accdetect/testsuite/test_simple.py --- grass-7.6.1/temporal/t.rast.accdetect/testsuite/test_simple.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accdetect/testsuite/test_simple.py 2019-06-03 20:34:21.000000000 +0000 @@ -54,9 +54,9 @@ indicator="C", start="2001-01-01", cycle="12 months", basename='result', range=(1,8)) tinfo_string="""semantic_type=mean - start_time=2001-01-01 00:00:00 - end_time=2009-05-01 00:00:00 - granularity=1 month + start_time='2001-01-01 00:00:00' + end_time='2009-05-01 00:00:00' + granularity='1 month' map_time=interval number_of_maps=100""" info = SimpleModule("t.info", flags="g", type="strds", input="B") @@ -64,9 +64,9 @@ precision=2, sep="=") tinfo_string="""semantic_type=mean - start_time=2001-01-01 00:00:00 - end_time=2009-05-01 00:00:00 - granularity=1 month + start_time='2001-01-01 00:00:00' + end_time='2009-05-01 00:00:00' + granularity='1 month' map_time=interval number_of_maps=100""" info = SimpleModule("t.info", flags="g", type="strds", input="C") @@ -78,9 +78,9 @@ indicator="C", start="2001-01-01", stop='2008-12-31', cycle="12 months", basename='result', range=(1,8)) tinfo_string="""semantic_type=mean - start_time=2001-01-01 00:00:00 - end_time=2009-01-01 00:00:00 - granularity=1 month + start_time='2001-01-01 00:00:00' + end_time='2009-01-01 00:00:00' + granularity='1 month' map_time=interval number_of_maps=96""" info = SimpleModule("t.info", flags="g", type="strds", input="B") @@ -88,9 +88,9 @@ precision=2, sep="=") tinfo_string="""semantic_type=mean - start_time=2001-01-01 00:00:00 - end_time=2009-01-01 00:00:00 - granularity=1 month + start_time='2001-01-01 00:00:00' + end_time='2009-01-01 00:00:00' + granularity='1 month' map_time=interval number_of_maps=96""" info = SimpleModule("t.info", flags="g", type="strds", input="C") diff -Nru grass-7.6.1/temporal/t.rast.accdetect/t.rast.accdetect.html grass-7.8.0/temporal/t.rast.accdetect/t.rast.accdetect.html --- grass-7.6.1/temporal/t.rast.accdetect/t.rast.accdetect.html 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accdetect/t.rast.accdetect.html 2019-05-18 15:50:05.000000000 +0000 @@ -81,4 +81,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2017-11-18 09:59:58 +0100 (Sat, 18 Nov 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.accdetect/t.rast.accdetect.py grass-7.8.0/temporal/t.rast.accdetect/t.rast.accdetect.py --- grass-7.6.1/temporal/t.rast.accdetect/t.rast.accdetect.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accdetect/t.rast.accdetect.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -156,7 +156,7 @@ minimum = options["minimum"] maximum = options["maximum"] occurrence = options["occurrence"] - range = options["range"] + range_ = options["range"] indicator = options["indicator"] staend = options["staend"] register_null = flags["n"] @@ -191,7 +191,7 @@ # The occurrence space time raster dataset if occurrence: if not minimum or not maximum: - if not range: + if not range_: dbif.close() grass.fatal(_("You need to set the range to compute the occurrence" " space time raster dataset")) @@ -320,14 +320,14 @@ count = compute_occurrence(occurrence_maps, input_strds, input_maps, start, base, count, time_suffix, mapset, - where, reverse, range, minimum_strds, + where, reverse, range_, minimum_strds, maximum_strds, dbif) # Indicator computation is based on the occurrence so we need to start it after # the occurrence cycle if indicator: num_maps = len(input_maps) - for i in xrange(num_maps): + for i in range(num_maps): if reverse: map = input_maps[num_maps - i - 1] else: @@ -492,7 +492,7 @@ ############################################################################ def compute_occurrence(occurrence_maps, input_strds, input_maps, start, base, - count, tsuffix, mapset, where, reverse, range, + count, tsuffix, mapset, where, reverse, range_, minimum_strds, maximum_strds, dbif): if minimum_strds: @@ -511,7 +511,7 @@ # Aggregate num_maps = len(input_maps) - for i in xrange(num_maps): + for i in range(num_maps): if reverse: map = input_maps[num_maps - i - 1] else: @@ -550,7 +550,7 @@ " database, use overwrite flag to overwrite.") % (occurrence_map.get_map_id())) - range_vals = range.split(",") + range_vals = range_.split(",") min = range_vals[0] max = range_vals[1] diff -Nru grass-7.6.1/temporal/t.rast.accumulate/t.rast.accumulate.html grass-7.8.0/temporal/t.rast.accumulate/t.rast.accumulate.html --- grass-7.6.1/temporal/t.rast.accumulate/t.rast.accumulate.html 2019-03-19 19:56:53.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accumulate/t.rast.accumulate.html 2019-08-11 09:05:20.000000000 +0000 @@ -66,7 +66,7 @@ mkdir -p /tmp/grassdata/LL # Start GRASS and create a new location with PERMANENT mapset -grass76 -c EPSG:4326 /tmp/grassdata/LL/PERMANENT +grass78 -c EPSG:4326 /tmp/grassdata/LL/PERMANENT # Import the temperature data t.rast.import input=temperature_mean_1990_2000_daily_celsius.tar.gz \ @@ -297,4 +297,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2018-08-31 17:01:15 +0200 (Fri, 31 Aug 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.accumulate/t.rast.accumulate.py grass-7.8.0/temporal/t.rast.accumulate/t.rast.accumulate.py --- grass-7.6.1/temporal/t.rast.accumulate/t.rast.accumulate.py 2019-03-19 19:56:53.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.accumulate/t.rast.accumulate.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute_parallel.py grass-7.8.0/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute_parallel.py --- grass-7.6.1/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute_parallel.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute_parallel.py 2019-06-03 20:34:21.000000000 +0000 @@ -61,9 +61,9 @@ method="sum", sampling=["contains"], nprocs=9, file_limit=2) - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 - granularity=12 hours + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00' + granularity='12 hours' map_time=interval aggregation_type=sum number_of_maps=180 @@ -90,9 +90,9 @@ delta = end - start print("test_aggregation_1day_4procs:", delta.total_seconds()) - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 - granularity=1 day + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00' + granularity='1 day' map_time=interval aggregation_type=sum number_of_maps=90""" @@ -116,9 +116,9 @@ print("test_aggregation_1day_3procs:", delta.total_seconds()) - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 - granularity=1 day + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00' + granularity='1 day' map_time=interval aggregation_type=sum number_of_maps=90 @@ -146,9 +146,9 @@ print("test_aggregation_1day_2procs:", delta.total_seconds()) - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 - granularity=1 day + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00' + granularity='1 day' map_time=interval aggregation_type=sum number_of_maps=90 diff -Nru grass-7.6.1/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute.py grass-7.8.0/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute.py --- grass-7.6.1/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute.py 2019-03-19 19:56:53.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.aggregate/testsuite/test_aggregation_absolute.py 2019-06-03 20:34:21.000000000 +0000 @@ -60,9 +60,9 @@ sampling=["overlaps","overlapped","during"], nprocs=2, flags="n") - tinfo_string="""start_time=2001-01-15 00:00:00 - end_time=2001-04-25 00:00:00 - granularity=2 days + tinfo_string="""start_time='2001-01-15 00:00:00' + end_time='2001-04-25 00:00:00' + granularity='2 days' aggregation_type=average number_of_maps=50 map_time=interval @@ -84,9 +84,9 @@ method="maximum", sampling=["contains"], file_limit=0, nprocs=3) - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 - granularity=1 month + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00' + granularity='1 month' map_time=interval aggregation_type=maximum number_of_maps=3 @@ -125,9 +125,9 @@ method="minimum", sampling=["contains"], nprocs=4, offset=10, suffix='num%02') - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2001-05-01 00:00:00 - granularity=2 months + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2001-05-01 00:00:00' + granularity='2 months' map_time=interval aggregation_type=minimum number_of_maps=2 @@ -158,9 +158,9 @@ file_limit=0, nprocs=9, offset=100, suffix='num%03') - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2001-04-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2001-04-01 00:00:00' + granularity='3 months' map_time=interval aggregation_type=sum number_of_maps=1 diff -Nru grass-7.6.1/temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py grass-7.8.0/temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py --- grass-7.6.1/temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.aggregate/testsuite/test_aggregation_relative.py 2019-06-03 20:34:21.000000000 +0000 @@ -59,8 +59,8 @@ sampling=["overlaps","overlapped","contains"], nprocs=2, verbose=True) - tinfo_string="""start_time=0 - end_time=18 + tinfo_string="""start_time='0' + end_time='18' unit=days granularity=6 map_time=interval @@ -86,8 +86,8 @@ nprocs=4, flags="n", verbose=True) tinfo_string="""semantic_type=mean - start_time=0 - end_time=27 + start_time='0' + end_time='27' unit=days granularity=9 map_time=interval @@ -113,8 +113,8 @@ nprocs=4, verbose=True) tinfo_string="""semantic_type=mean - start_time=0 - end_time=18 + start_time='0' + end_time='18' unit=days granularity=9 map_time=interval @@ -140,8 +140,8 @@ nprocs=4, verbose=True) tinfo_string="""semantic_type=mean - start_time=0 - end_time=21 + start_time='0' + end_time='21' unit=days granularity=21 map_time=interval diff -Nru grass-7.6.1/temporal/t.rast.aggregate/t.rast.aggregate.html grass-7.8.0/temporal/t.rast.aggregate/t.rast.aggregate.html --- grass-7.6.1/temporal/t.rast.aggregate/t.rast.aggregate.html 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.aggregate/t.rast.aggregate.html 2019-05-18 15:50:05.000000000 +0000 @@ -213,4 +213,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-09-19 12:29:41 +0200 (Mon, 19 Sep 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.aggregate/t.rast.aggregate.py grass-7.8.0/temporal/t.rast.aggregate/t.rast.aggregate.py --- grass-7.6.1/temporal/t.rast.aggregate/t.rast.aggregate.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.aggregate/t.rast.aggregate.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.html grass-7.8.0/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.html --- grass-7.6.1/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.html 2019-03-19 19:56:54.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.html 2019-05-18 15:50:05.000000000 +0000 @@ -362,5 +362,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-09-19 12:29:41 +0200 (Mon, 19 Sep 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py grass-7.8.0/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py --- grass-7.6.1/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py 2019-03-19 19:56:53.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.algebra/t.rast.algebra.html grass-7.8.0/temporal/t.rast.algebra/t.rast.algebra.html --- grass-7.6.1/temporal/t.rast.algebra/t.rast.algebra.html 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.algebra/t.rast.algebra.html 2019-09-04 13:16:10.000000000 +0000 @@ -583,15 +583,27 @@

     # Ubuntu/Debian
    -sudo apt-get install python-ply
    +sudo apt-get install python3-ply
     
     # Fedora
    -sudo dnf install python-ply
    +sudo dnf install python3-ply
     
    -# MS-Windows (OSGeo4W: requires "python-pip" package to be installed)
    -python-pip install ply
    +# MS-Windows (OSGeo4W: requires "python3-pip" package to be installed)
    +python3-pip install ply
     
    +

    +Related publications: +

      +
    • Gebbert, S., Pebesma, E. 2014. TGRASS: A temporal GIS for field based environmental modeling. + Environmental Modelling & Software 53, 1-12 (DOI) + - preprint PDF
    • +
    • Gebbert, S., Pebesma, E. 2017. The GRASS GIS temporal framework. International Journal of + Geographical Information Science 31, 1273-1292 (DOI)
    • +
    • Gebbert, S., Leppelt, T., Pebesma, E., 2019. A topology based spatio-temporal map algebra for big data analysis. + Data 4, 86. (DOI)
    • +
    +

    SEE ALSO

    @@ -605,5 +617,5 @@ Thomas Leppelt, Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2018-08-24 15:03:58 +0200 (Fri, 24 Aug 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.algebra/t.rast.algebra.py grass-7.8.0/temporal/t.rast.algebra/t.rast.algebra.py --- grass-7.6.1/temporal/t.rast.algebra/t.rast.algebra.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.algebra/t.rast.algebra.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.colors/t.rast.colors.html grass-7.8.0/temporal/t.rast.colors/t.rast.colors.html --- grass-7.6.1/temporal/t.rast.colors/t.rast.colors.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.colors/t.rast.colors.html 2019-05-18 15:50:05.000000000 +0000 @@ -66,5 +66,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-01-25 18:55:23 +0100 (Sun, 25 Jan 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.colors/t.rast.colors.py grass-7.8.0/temporal/t.rast.colors/t.rast.colors.py --- grass-7.6.1/temporal/t.rast.colors/t.rast.colors.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.colors/t.rast.colors.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.contour/testsuite/test_convert.py grass-7.8.0/temporal/t.rast.contour/testsuite/test_convert.py --- grass-7.6.1/temporal/t.rast.contour/testsuite/test_convert.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.contour/testsuite/test_convert.py 2019-06-03 20:34:21.000000000 +0000 @@ -55,9 +55,9 @@ #self.assertModule("t.info", type="stvds", flags="g", input="result") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-04-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-04-01 00:00:00' + granularity='3 months' map_time=interval number_of_maps=5 lines=28 @@ -76,9 +76,9 @@ #self.assertModule("t.info", type="stvds", flags="g", input="result") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='3 months' map_time=interval number_of_maps=4 lines=28 @@ -98,9 +98,9 @@ #self.assertModule("t.info", type="stvds", flags="g", input="result") - tinfo_string="""start_time=2001-04-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-04-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='3 months' map_time=interval number_of_maps=3 lines=21 @@ -119,9 +119,9 @@ #self.assertModule("t.info", type="stvds", flags="g", input="result") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='3 months' map_time=interval number_of_maps=4 lines=28 @@ -140,9 +140,9 @@ #self.assertModule("t.info", type="stvds", flags="g", input="result") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='3 months' map_time=interval number_of_maps=4 lines=28 @@ -162,9 +162,9 @@ #self.assertModule("t.info", type="stvds", flags="g", input="result") - tinfo_string="""start_time=2001-04-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-04-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='3 months' map_time=interval number_of_maps=3 lines=21 diff -Nru grass-7.6.1/temporal/t.rast.contour/t.rast.contour.html grass-7.8.0/temporal/t.rast.contour/t.rast.contour.html --- grass-7.6.1/temporal/t.rast.contour/t.rast.contour.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.contour/t.rast.contour.html 2019-05-18 15:50:05.000000000 +0000 @@ -40,4 +40,4 @@ Sören Gebbert, Geoinformatikbüro Dassau -

    Last changed: $Date: 2015-09-05 18:13:18 +0200 (Sat, 05 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.contour/t.rast.contour.py grass-7.8.0/temporal/t.rast.contour/t.rast.contour.py --- grass-7.6.1/temporal/t.rast.contour/t.rast.contour.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.contour/t.rast.contour.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.export/t.rast.export.html grass-7.8.0/temporal/t.rast.export/t.rast.export.html --- grass-7.6.1/temporal/t.rast.export/t.rast.export.html 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.export/t.rast.export.html 2019-05-18 15:50:05.000000000 +0000 @@ -144,4 +144,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-11-13 18:50:28 +0100 (Sun, 13 Nov 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.export/t.rast.export.py grass-7.8.0/temporal/t.rast.export/t.rast.export.py --- grass-7.6.1/temporal/t.rast.export/t.rast.export.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.export/t.rast.export.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.extract/testsuite/test_extract.py grass-7.8.0/temporal/t.rast.extract/testsuite/test_extract.py --- grass-7.6.1/temporal/t.rast.extract/testsuite/test_extract.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.extract/testsuite/test_extract.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -"""Test t.rast.extract - -(C) 2014 by the GRASS Development Team -This program is free software under the GNU General Public -License (>=v2). Read the file COPYING that comes with GRASS -for details. - -@author Soeren Gebbert -""" - -import grass.pygrass.modules as pymod -import subprocess -from grass.gunittest.case import TestCase -from grass.gunittest.gmodules import SimpleModule - -class TestRasterExtraction(TestCase): - - @classmethod - def setUpClass(cls): - """Initiate the temporal GIS and set the region - """ - cls.use_temp_region() - cls.runModule("g.gisenv", set="TGIS_USE_CURRENT_MAPSET=1") - cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=10, res3=10) - cls.runModule("r.mapcalc", expression="prec_1 = 100", overwrite=True) - cls.runModule("r.mapcalc", expression="prec_2 = 200", overwrite=True) - cls.runModule("r.mapcalc", expression="prec_3 = 300", overwrite=True) - cls.runModule("r.mapcalc", expression="prec_4 = 400", overwrite=True) - cls.runModule("r.mapcalc", expression="prec_5 = 500", overwrite=True) - cls.runModule("r.mapcalc", expression="prec_6 = 600", overwrite=True) - - cls.runModule("t.create", type="strds", temporaltype="absolute", - output="precip_abs1", title="A test", - description="A test", overwrite=True) - cls.runModule("t.register", flags="i", type="raster", input="precip_abs1", - maps="prec_1,prec_2,prec_3,prec_4,prec_5,prec_6", - start="2001-01-01", increment="3 months", overwrite=True) - - @classmethod - def tearDownClass(cls): - """Remove the temporary region - """ - cls.del_temp_region() - - def setUp(self): - """Create input data for transient groundwater flow computation - """ - # Use always the current mapset as temporal database - self.runModule("r.mapcalc", expression="prec_1 = 100", overwrite=True) - self.runModule("r.mapcalc", expression="prec_2 = 200", overwrite=True) - self.runModule("r.mapcalc", expression="prec_3 = 300", overwrite=True) - self.runModule("r.mapcalc", expression="prec_4 = 400", overwrite=True) - self.runModule("r.mapcalc", expression="prec_5 = 500", overwrite=True) - self.runModule("r.mapcalc", expression="prec_6 = 600", overwrite=True) - - self.runModule("t.create", type="strds", temporaltype="absolute", - output="precip_abs1", title="A test", description="A test", overwrite=True) - self.runModule("t.register", flags="i", type="raster", input="precip_abs1", - maps="prec_1,prec_2,prec_3,prec_4,prec_5,prec_6", - start="2001-01-01", increment="3 months", overwrite=True) - - def tearDown(self): - """Remove generated data""" - self.runModule("t.remove", flags="rf", type="strds", - inputs="precip_abs2") - - def test_selection(self): - """Perform a simple selection by datetime""" - self.assertModule("t.rast.extract", input="precip_abs1", output="precip_abs2", - where="start_time > '2001-06-01'") - - #self.assertModule("t.info", flags="g", input="precip_abs2") - - tinfo_string="""start_time=2001-07-01 00:00:00 - end_time=2002-07-01 00:00:00 - granularity=3 months - map_time=interval - north=80.0 - south=0.0 - east=120.0 - west=0.0 - top=0.0 - bottom=0.0 - aggregation_type=None - number_of_maps=4 - nsres_min=10.0 - nsres_max=10.0 - ewres_min=10.0 - ewres_max=10.0 - min_min=300.0 - min_max=600.0 - max_min=300.0 - max_max=600.0""" - - info = SimpleModule("t.info", flags="g", input="precip_abs2") - self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") - - def test_selection_and_expression(self): - """Perform a selection by datetime and a r.mapcalc expression""" - self.assertModule("t.rast.extract", input="precip_abs1", output="precip_abs2", - where="start_time > '2001-06-01'", - expression=" if(precip_abs1 > 400, precip_abs1, null())", - basename="new_prec", nprocs=2, overwrite=True) - - #self.assertModule("t.info", flags="g", input="precip_abs2") - - tinfo_string="""start_time=2002-01-01 00:00:00 - end_time=2002-07-01 00:00:00 - granularity=3 months - map_time=interval - north=80.0 - south=0.0 - east=120.0 - west=0.0 - top=0.0 - bottom=0.0 - aggregation_type=None - number_of_maps=2 - nsres_min=10.0 - nsres_max=10.0 - ewres_min=10.0 - ewres_max=10.0 - min_min=500.0 - min_max=600.0 - max_min=500.0 - max_max=600.0""" - - info = SimpleModule("t.info", flags="g", input="precip_abs2") - self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") - - def test_expression_with_empty_maps(self): - """Perform r.mapcalc expression and register empty maps""" - self.assertModule("t.rast.extract", flags="n", input="precip_abs1", output="precip_abs2", - expression=" if(precip_abs1 > 400, precip_abs1, null())", - basename="new_prec", nprocs=2, overwrite=True) - - #self.assertModule("t.info", flags="g", input="precip_abs2") - - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-07-01 00:00:00 - granularity=3 months - map_time=interval - north=80.0 - south=0.0 - east=120.0 - west=0.0 - top=0.0 - bottom=0.0 - aggregation_type=None - number_of_maps=6 - nsres_min=10.0 - nsres_max=10.0 - ewres_min=10.0 - ewres_max=10.0 - min_min=500.0 - min_max=600.0 - max_min=500.0 - max_max=600.0""" - - info = SimpleModule("t.info", flags="g", input="precip_abs2") - self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") - - - def test_time_suffix_with_expression(self): - """Perform extract with time suffix support and test if maps exists""" - self.assertModule("t.rast.extract", flags="n", input="precip_abs1", - output="precip_abs2", basename="new_prec", - nprocs=2, overwrite=True, suffix="time", - expression="if(precip_abs1 > 400, precip_abs1, null())") - self.assertRasterExists('new_prec_2001_01_01T00_00_00') - self.assertRasterDoesNotExist('new_prec_2001_01') - - def test_num_suffix_with_expression(self): - """Perform extract with time suffix support and test if maps exists""" - self.assertModule("t.rast.extract", flags="n", input="precip_abs1", - output="precip_abs2", basename="new_prec", - nprocs=2, overwrite=True, suffix='num%03', - expression="if(precip_abs1 > 400, precip_abs1, null())") - self.assertRasterExists('new_prec_001') - self.assertRasterDoesNotExist('new_prec_00001') - - - -class TestRasterExtractionFails(TestCase): - - @classmethod - def setUpClass(cls): - """Initiate the temporal GIS and set the region - """ - cls.use_temp_region() - cls.runModule("g.gisenv", set="TGIS_USE_CURRENT_MAPSET=1") - cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=10, res3=10) - - @classmethod - def tearDownClass(cls): - """Remove the temporary region - """ - cls.del_temp_region() - - def test_error_handling(self): - """Perform r.mapcalc expression and register empty maps""" - # No input - self.assertModuleFail("t.rast.extract", output="precip_abs2", basename="new_prec") - # No output - self.assertModuleFail("t.rast.extract", input="precip_abs1", basename="new_prec") - # No basename - self.assertModuleFail("t.rast.extract", input="precip_abs1", output="precip_abs2", - expression=" if(precip_abs1 > 400, precip_abs1, null())") - -if __name__ == '__main__': - from grass.gunittest.main import test - test() diff -Nru grass-7.6.1/temporal/t.rast.extract/testsuite/test_t_rast_extract.py grass-7.8.0/temporal/t.rast.extract/testsuite/test_t_rast_extract.py --- grass-7.6.1/temporal/t.rast.extract/testsuite/test_t_rast_extract.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.extract/testsuite/test_t_rast_extract.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,212 @@ +"""Test t.rast.extract + +(C) 2014 by the GRASS Development Team +This program is free software under the GNU General Public +License (>=v2). Read the file COPYING that comes with GRASS +for details. + +@author Soeren Gebbert +""" + +import grass.pygrass.modules as pymod +import subprocess +from grass.gunittest.case import TestCase +from grass.gunittest.gmodules import SimpleModule + +class TestRasterExtraction(TestCase): + + @classmethod + def setUpClass(cls): + """Initiate the temporal GIS and set the region + """ + cls.use_temp_region() + cls.runModule("g.gisenv", set="TGIS_USE_CURRENT_MAPSET=1") + cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=10, res3=10) + cls.runModule("r.mapcalc", expression="prec_1 = 100", overwrite=True) + cls.runModule("r.mapcalc", expression="prec_2 = 200", overwrite=True) + cls.runModule("r.mapcalc", expression="prec_3 = 300", overwrite=True) + cls.runModule("r.mapcalc", expression="prec_4 = 400", overwrite=True) + cls.runModule("r.mapcalc", expression="prec_5 = 500", overwrite=True) + cls.runModule("r.mapcalc", expression="prec_6 = 600", overwrite=True) + + cls.runModule("t.create", type="strds", temporaltype="absolute", + output="precip_abs1", title="A test", + description="A test", overwrite=True) + cls.runModule("t.register", flags="i", type="raster", input="precip_abs1", + maps="prec_1,prec_2,prec_3,prec_4,prec_5,prec_6", + start="2001-01-01", increment="3 months", overwrite=True) + + @classmethod + def tearDownClass(cls): + """Remove the temporary region + """ + cls.del_temp_region() + + def setUp(self): + """Create input data for transient groundwater flow computation + """ + # Use always the current mapset as temporal database + self.runModule("r.mapcalc", expression="prec_1 = 100", overwrite=True) + self.runModule("r.mapcalc", expression="prec_2 = 200", overwrite=True) + self.runModule("r.mapcalc", expression="prec_3 = 300", overwrite=True) + self.runModule("r.mapcalc", expression="prec_4 = 400", overwrite=True) + self.runModule("r.mapcalc", expression="prec_5 = 500", overwrite=True) + self.runModule("r.mapcalc", expression="prec_6 = 600", overwrite=True) + + self.runModule("t.create", type="strds", temporaltype="absolute", + output="precip_abs1", title="A test", description="A test", overwrite=True) + self.runModule("t.register", flags="i", type="raster", input="precip_abs1", + maps="prec_1,prec_2,prec_3,prec_4,prec_5,prec_6", + start="2001-01-01", increment="3 months", overwrite=True) + + def tearDown(self): + """Remove generated data""" + self.runModule("t.remove", flags="rf", type="strds", + inputs="precip_abs2") + + def test_selection(self): + """Perform a simple selection by datetime""" + self.assertModule("t.rast.extract", input="precip_abs1", output="precip_abs2", + where="start_time > '2001-06-01'") + + #self.assertModule("t.info", flags="g", input="precip_abs2") + + tinfo_string="""start_time='2001-07-01 00:00:00' + end_time='2002-07-01 00:00:00' + granularity='3 months' + map_time=interval + north=80.0 + south=0.0 + east=120.0 + west=0.0 + top=0.0 + bottom=0.0 + aggregation_type=None + number_of_maps=4 + nsres_min=10.0 + nsres_max=10.0 + ewres_min=10.0 + ewres_max=10.0 + min_min=300.0 + min_max=600.0 + max_min=300.0 + max_max=600.0""" + + info = SimpleModule("t.info", flags="g", input="precip_abs2") + self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") + + def test_selection_and_expression(self): + """Perform a selection by datetime and a r.mapcalc expression""" + self.assertModule("t.rast.extract", input="precip_abs1", output="precip_abs2", + where="start_time > '2001-06-01'", + expression=" if(precip_abs1 > 400, precip_abs1, null())", + basename="new_prec", nprocs=2, overwrite=True) + + #self.assertModule("t.info", flags="g", input="precip_abs2") + + tinfo_string="""start_time='2002-01-01 00:00:00' + end_time='2002-07-01 00:00:00' + granularity='3 months' + map_time=interval + north=80.0 + south=0.0 + east=120.0 + west=0.0 + top=0.0 + bottom=0.0 + aggregation_type=None + number_of_maps=2 + nsres_min=10.0 + nsres_max=10.0 + ewres_min=10.0 + ewres_max=10.0 + min_min=500.0 + min_max=600.0 + max_min=500.0 + max_max=600.0""" + + info = SimpleModule("t.info", flags="g", input="precip_abs2") + self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") + + def test_expression_with_empty_maps(self): + """Perform r.mapcalc expression and register empty maps""" + self.assertModule("t.rast.extract", flags="n", input="precip_abs1", output="precip_abs2", + expression=" if(precip_abs1 > 400, precip_abs1, null())", + basename="new_prec", nprocs=2, overwrite=True) + + #self.assertModule("t.info", flags="g", input="precip_abs2") + + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-07-01 00:00:00' + granularity='3 months' + map_time=interval + north=80.0 + south=0.0 + east=120.0 + west=0.0 + top=0.0 + bottom=0.0 + aggregation_type=None + number_of_maps=6 + nsres_min=10.0 + nsres_max=10.0 + ewres_min=10.0 + ewres_max=10.0 + min_min=500.0 + min_max=600.0 + max_min=500.0 + max_max=600.0""" + + info = SimpleModule("t.info", flags="g", input="precip_abs2") + self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") + + + def test_time_suffix_with_expression(self): + """Perform extract with time suffix support and test if maps exists""" + self.assertModule("t.rast.extract", flags="n", input="precip_abs1", + output="precip_abs2", basename="new_prec", + nprocs=2, overwrite=True, suffix="time", + expression="if(precip_abs1 > 400, precip_abs1, null())") + self.assertRasterExists('new_prec_2001_01_01T00_00_00') + self.assertRasterDoesNotExist('new_prec_2001_01') + + def test_num_suffix_with_expression(self): + """Perform extract with time suffix support and test if maps exists""" + self.assertModule("t.rast.extract", flags="n", input="precip_abs1", + output="precip_abs2", basename="new_prec", + nprocs=2, overwrite=True, suffix='num%03', + expression="if(precip_abs1 > 400, precip_abs1, null())") + self.assertRasterExists('new_prec_001') + self.assertRasterDoesNotExist('new_prec_00001') + + + +class TestRasterExtractionFails(TestCase): + + @classmethod + def setUpClass(cls): + """Initiate the temporal GIS and set the region + """ + cls.use_temp_region() + cls.runModule("g.gisenv", set="TGIS_USE_CURRENT_MAPSET=1") + cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=10, res3=10) + + @classmethod + def tearDownClass(cls): + """Remove the temporary region + """ + cls.del_temp_region() + + def test_error_handling(self): + """Perform r.mapcalc expression and register empty maps""" + # No input + self.assertModuleFail("t.rast.extract", output="precip_abs2", basename="new_prec") + # No output + self.assertModuleFail("t.rast.extract", input="precip_abs1", basename="new_prec") + # No basename + self.assertModuleFail("t.rast.extract", input="precip_abs1", output="precip_abs2", + expression=" if(precip_abs1 > 400, precip_abs1, null())") + +if __name__ == '__main__': + from grass.gunittest.main import test + test() diff -Nru grass-7.6.1/temporal/t.rast.extract/t.rast.extract.html grass-7.8.0/temporal/t.rast.extract/t.rast.extract.html --- grass-7.6.1/temporal/t.rast.extract/t.rast.extract.html 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.extract/t.rast.extract.html 2019-05-18 15:50:05.000000000 +0000 @@ -65,5 +65,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-22 10:10:38 +0200 (Tue, 22 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.extract/t.rast.extract.py grass-7.8.0/temporal/t.rast.extract/t.rast.extract.py --- grass-7.6.1/temporal/t.rast.extract/t.rast.extract.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.extract/t.rast.extract.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.gapfill/testsuite/test_gapfill.py grass-7.8.0/temporal/t.rast.gapfill/testsuite/test_gapfill.py --- grass-7.6.1/temporal/t.rast.gapfill/testsuite/test_gapfill.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.gapfill/testsuite/test_gapfill.py 2019-06-03 20:34:21.000000000 +0000 @@ -56,9 +56,9 @@ #self.assertModule("t.info", type="strds", flags="g", input="A") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=1 month + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='1 month' map_time=interval number_of_maps=12 min_min=100.0 @@ -94,9 +94,9 @@ #self.assertModule("t.info", type="strds", flags="g", input="A") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=1 month + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='1 month' map_time=interval number_of_maps=10 min_min=100.0 @@ -129,9 +129,9 @@ #self.assertModule("t.info", type="strds", flags="g", input="A") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=1 month + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='1 month' map_time=interval number_of_maps=5 min_min=100.0 @@ -159,9 +159,9 @@ #self.assertModule("t.info", type="strds", flags="g", input="A") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=1 month + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='1 month' map_time=interval number_of_maps=3 min_min=100.0 @@ -187,9 +187,9 @@ #self.assertModule("t.info", type="strds", flags="g", input="A") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=1 month + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='1 month' map_time=interval number_of_maps=12 min_min=100.0 @@ -225,9 +225,9 @@ #self.assertModule("t.info", type="strds", flags="g", input="A") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=1 month + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='1 month' map_time=interval number_of_maps=12 min_min=100.0 diff -Nru grass-7.6.1/temporal/t.rast.gapfill/t.rast.gapfill.html grass-7.8.0/temporal/t.rast.gapfill/t.rast.gapfill.html --- grass-7.6.1/temporal/t.rast.gapfill/t.rast.gapfill.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.gapfill/t.rast.gapfill.html 2019-05-18 15:50:05.000000000 +0000 @@ -83,5 +83,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-22 10:10:38 +0200 (Tue, 22 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.gapfill/t.rast.gapfill.py grass-7.8.0/temporal/t.rast.gapfill/t.rast.gapfill.py --- grass-7.6.1/temporal/t.rast.gapfill/t.rast.gapfill.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.gapfill/t.rast.gapfill.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -89,7 +89,7 @@ nprocs = options["nprocs"] tsuffix = options["suffix"] - mapset = grass.encode(grass.gisenv()["MAPSET"]) + mapset = grass.gisenv()["MAPSET"] # Make sure the temporal database exists tgis.init() diff -Nru grass-7.6.1/temporal/t.rast.import/testsuite/test_temporal_rast_import.py grass-7.8.0/temporal/t.rast.import/testsuite/test_temporal_rast_import.py --- grass-7.6.1/temporal/t.rast.import/testsuite/test_temporal_rast_import.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.import/testsuite/test_temporal_rast_import.py 2019-06-03 20:34:21.000000000 +0000 @@ -32,9 +32,9 @@ def test_import(self): self.assertModule("t.rast.import", input=self.input_, output="A", basename="a", overwrite=True) - tinfo = """start_time=2000-01-01 00:00:00 - end_time=2001-01-01 00:00:00 - granularity=1 month + tinfo = """start_time='2000-01-01 00:00:00' + end_time='2001-01-01 00:00:00' + granularity='1 month' map_time=interval north=320000.0 south=10000.0 @@ -44,4 +44,4 @@ info = SimpleModule("t.info", flags="g", input="A") self.assertModuleKeyValue(module=info, reference=tinfo, - precision=2, sep="=") \ No newline at end of file + precision=2, sep="=") diff -Nru grass-7.6.1/temporal/t.rast.import/t.rast.import.html grass-7.8.0/temporal/t.rast.import/t.rast.import.html --- grass-7.6.1/temporal/t.rast.import/t.rast.import.html 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.import/t.rast.import.html 2019-05-18 15:50:05.000000000 +0000 @@ -39,4 +39,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-10-06 17:24:26 +0200 (Tue, 06 Oct 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.import/t.rast.import.py grass-7.8.0/temporal/t.rast.import/t.rast.import.py --- grass-7.6.1/temporal/t.rast.import/t.rast.import.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.import/t.rast.import.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.list/t.rast.list.html grass-7.8.0/temporal/t.rast.list/t.rast.list.html --- grass-7.6.1/temporal/t.rast.list/t.rast.list.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.list/t.rast.list.html 2019-05-18 15:50:05.000000000 +0000 @@ -202,5 +202,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-10-06 17:24:26 +0200 (Tue, 06 Oct 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.list/t.rast.list.py grass-7.8.0/temporal/t.rast.list/t.rast.list.py --- grass-7.6.1/temporal/t.rast.list/t.rast.list.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.list/t.rast.list.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.mapcalc/t.rast.mapcalc.html grass-7.8.0/temporal/t.rast.mapcalc/t.rast.mapcalc.html --- grass-7.6.1/temporal/t.rast.mapcalc/t.rast.mapcalc.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.mapcalc/t.rast.mapcalc.html 2019-05-18 15:50:05.000000000 +0000 @@ -168,5 +168,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2017-12-01 15:09:57 +0100 (Fri, 01 Dec 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.mapcalc/t.rast.mapcalc.py grass-7.8.0/temporal/t.rast.mapcalc/t.rast.mapcalc.py --- grass-7.6.1/temporal/t.rast.mapcalc/t.rast.mapcalc.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.mapcalc/t.rast.mapcalc.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.neighbors/testsuite/test_neighbors.py grass-7.8.0/temporal/t.rast.neighbors/testsuite/test_neighbors.py --- grass-7.6.1/temporal/t.rast.neighbors/testsuite/test_neighbors.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.neighbors/testsuite/test_neighbors.py 2019-06-03 20:34:21.000000000 +0000 @@ -6,10 +6,13 @@ """ import os +import sys +import unittest import grass.temporal as tgis from grass.gunittest.case import TestCase from grass.gunittest.gmodules import SimpleModule +@unittest.skipIf(sys.version_info[0] > 2, "temporary disabled") class TestAggregationAbsolute(TestCase): @classmethod diff -Nru grass-7.6.1/temporal/t.rast.neighbors/t.rast.neighbors.html grass-7.8.0/temporal/t.rast.neighbors/t.rast.neighbors.html --- grass-7.6.1/temporal/t.rast.neighbors/t.rast.neighbors.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.neighbors/t.rast.neighbors.html 2019-05-18 15:50:05.000000000 +0000 @@ -115,4 +115,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-10-27 23:20:55 +0200 (Thu, 27 Oct 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.neighbors/t.rast.neighbors.py grass-7.8.0/temporal/t.rast.neighbors/t.rast.neighbors.py --- grass-7.6.1/temporal/t.rast.neighbors/t.rast.neighbors.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.neighbors/t.rast.neighbors.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.out.vtk/t.rast.out.vtk.html grass-7.8.0/temporal/t.rast.out.vtk/t.rast.out.vtk.html --- grass-7.6.1/temporal/t.rast.out.vtk/t.rast.out.vtk.html 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.out.vtk/t.rast.out.vtk.html 2019-05-18 15:50:05.000000000 +0000 @@ -44,5 +44,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-08-30 15:28:34 +0200 (Tue, 30 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.out.vtk/t.rast.out.vtk.py grass-7.8.0/temporal/t.rast.out.vtk/t.rast.out.vtk.py --- grass-7.6.1/temporal/t.rast.out.vtk/t.rast.out.vtk.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.out.vtk/t.rast.out.vtk.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -24,6 +24,7 @@ #% description: Exports space time raster dataset as VTK time series. #% keyword: temporal #% keyword: export +#% keyword: output #% keyword: raster #% keyword: VTK #% keyword: time diff -Nru grass-7.6.1/temporal/t.rast.series/testsuite/test_series.py grass-7.8.0/temporal/t.rast.series/testsuite/test_series.py --- grass-7.6.1/temporal/t.rast.series/testsuite/test_series.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.series/testsuite/test_series.py 2019-06-03 20:34:21.000000000 +0000 @@ -58,8 +58,8 @@ self.assertModule("t.rast.series", input="A", method="average", output="series_time_stamp", where="start_time > '2001-02-01'") - tinfo_string="""start_time=2001-02-01 00:00:00 - end_time=2001-05-01 00:00:00""" + tinfo_string="""start_time='2001-02-01 00:00:00' + end_time='2001-05-01 00:00:00'""" info = SimpleModule("t.info", flags="g", type="raster", input="series_time_stamp") self.assertModuleKeyValue(module=info, reference=tinfo_string, precision=2, sep="=") @@ -84,6 +84,22 @@ self.assertRasterMinMax(map="series_minimum", refmin=100, refmax=100, msg="Minimum must be 100") + + def test_multi_stats(self): + self.assertModule("t.rast.series", input="A", + method=["average", "maximum", "minimum"], + output=["series_average", "series_maximum", + "series_minimum"], + overwrite=True) + + self.assertRasterMinMax(map="series_average", refmin=250, refmax=250, + msg="Average must be 250") + + self.assertRasterMinMax(map="series_maximum", refmin=400, refmax=400, + msg="Maximum must be 400") + + self.assertRasterMinMax(map="series_minimum", refmin=100, refmax=100, + msg="Minimum must be 100") def test_minimum_where(self): self.assertModule("t.rast.series", input="A", method="minimum", diff -Nru grass-7.6.1/temporal/t.rast.series/test.t.rast.series.sh grass-7.8.0/temporal/t.rast.series/test.t.rast.series.sh --- grass-7.6.1/temporal/t.rast.series/test.t.rast.series.sh 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.series/test.t.rast.series.sh 2019-06-03 20:34:21.000000000 +0000 @@ -18,6 +18,7 @@ t.register type=raster input=precip_abs maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="1 months" t.rast.list precip_abs +t.rast.series --o -t input=precip_abs method=average,range output=prec_average,prec_range where="start_time > '2001-03-01'" t.rast.series --o -t input=precip_abs method=average output=prec_average where="start_time > '2001-03-01'" t.rast.series --o input=precip_abs method=maximum output=prec_max order=start_time t.rast.series input=precip_abs method=sum output=prec_sum @@ -32,4 +33,4 @@ t.unregister type=raster maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6,prec_sum,prec_max t.remove type=strds input=precip_abs -g.remove -f type=raster name=prec_sum,prec_max,prec_average +g.remove -f type=raster name=prec_sum,prec_max,prec_average,prec_range diff -Nru grass-7.6.1/temporal/t.rast.series/t.rast.series.html grass-7.8.0/temporal/t.rast.series/t.rast.series.html --- grass-7.6.1/temporal/t.rast.series/t.rast.series.html 2019-03-19 19:56:54.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.series/t.rast.series.html 2019-05-18 15:50:05.000000000 +0000 @@ -71,5 +71,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-01-13 00:28:48 +0100 (Wed, 13 Jan 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.series/t.rast.series.py grass-7.8.0/temporal/t.rast.series/t.rast.series.py --- grass-7.6.1/temporal/t.rast.series/t.rast.series.py 2019-03-19 19:56:54.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.series/t.rast.series.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,13 +1,13 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # -# MODULE: t.rast.series -# AUTHOR(S): Soeren Gebbert +# MODULE: t.rast.series +# AUTHOR(S): Soeren Gebbert # -# PURPOSE: Perform different aggregation algorithms from r.series on all or a +# PURPOSE: Perform different aggregation algorithms from r.series on all or a # selected subset of raster maps in a space time raster dataset -# COPYRIGHT: (C) 2011-2017 by the GRASS Development Team +# COPYRIGHT: (C) 2011-2017 by the GRASS Development Team # # 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 @@ -38,7 +38,7 @@ #% type: string #% description: Aggregate operation to be performed on the raster maps #% required: yes -#% multiple: no +#% multiple: yes #% options: average,count,median,mode,minimum,min_raster,maximum,max_raster,stddev,range,sum,variance,diversity,slope,offset,detcoeff,quart1,quart3,perc90,quantile,skewness,kurtosis #% answer: average #%end @@ -48,7 +48,7 @@ #% type: double #% description: Quantile to calculate for method=quantile #% required: no -#% multiple: no +#% multiple: yes #% options: 0.0-1.0 #%end @@ -65,7 +65,7 @@ #%option G_OPT_T_WHERE #%end -#%option G_OPT_R_OUTPUT +#%option G_OPT_R_OUTPUTS #%end #%flag @@ -99,6 +99,16 @@ add_time = flags["t"] nulls = flags["n"] + # Check if number of methods and output maps matches + if 'quantile' in method: + len_method = len(method.split(',')) - 1 + else: + len_method = len(method.split(',')) + + if (len(list(filter(None, quantile.split(',')))) + + len_method) != len(output.split(',')): + grass.fatal(_('Number requested methods and output maps do not match.')) + # Make sure the temporal database exists tgis.init() @@ -133,16 +143,6 @@ if not add_time: - # Create the time range for the output map - if output.find("@") >= 0: - id = output - else: - mapset = grass.encode(grass.gisenv()["MAPSET"]) - id = output + "@" + mapset - - map = sp.get_new_map_instance(id) - map.load() - # We need to set the temporal extent from the subset of selected maps maps = sp.get_registered_maps_as_objects(where=where, order=order, dbif=None) first_map = maps[0] @@ -159,13 +159,25 @@ extent = tgis.RelativeTemporalExtent(start_time=start_a, end_time=end_b, unit=first_map.get_relative_time_unit()) - map.set_temporal_extent(extent=extent) + for out_map in output.split(','): - # Register the map in the temporal database - if map.is_in_db(): - map.update_all() - else: - map.insert() + # Create the time range for the output map + if out_map.find("@") >= 0: + id = out_map + else: + mapset = grass.gisenv()["MAPSET"] + id = out_map + "@" + mapset + + map = sp.get_new_map_instance(id) + map.load() + + map.set_temporal_extent(extent=extent) + + # Register the map in the temporal database + if map.is_in_db(): + map.update_all() + else: + map.insert() if __name__ == "__main__": options, flags = grass.parser() diff -Nru grass-7.6.1/temporal/t.rast.to.rast3/t.rast.to.rast3.html grass-7.8.0/temporal/t.rast.to.rast3/t.rast.to.rast3.html --- grass-7.6.1/temporal/t.rast.to.rast3/t.rast.to.rast3.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.to.rast3/t.rast.to.rast3.html 2019-05-18 15:50:05.000000000 +0000 @@ -160,5 +160,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-10-27 23:20:55 +0200 (Thu, 27 Oct 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.to.rast3/t.rast.to.rast3.py grass-7.8.0/temporal/t.rast.to.rast3/t.rast.to.rast3.py --- grass-7.6.1/temporal/t.rast.to.rast3/t.rast.to.rast3.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.to.rast3/t.rast.to.rast3.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -56,7 +56,7 @@ # Make sure the temporal database exists tgis.init() - mapset = grass.encode(grass.gisenv()["MAPSET"]) + mapset = grass.gisenv()["MAPSET"] sp = tgis.open_old_stds(input, "strds") diff -Nru grass-7.6.1/temporal/t.rast.to.vect/testsuite/test_to_vect.py grass-7.8.0/temporal/t.rast.to.vect/testsuite/test_to_vect.py --- grass-7.6.1/temporal/t.rast.to.vect/testsuite/test_to_vect.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.to.vect/testsuite/test_to_vect.py 2019-06-03 20:34:21.000000000 +0000 @@ -55,9 +55,9 @@ #self.assertModule("t.info", type="stvds", flags="g", input="result") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-04-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-04-01 00:00:00' + granularity='3 months' map_time=interval number_of_maps=5 points=384 @@ -74,9 +74,9 @@ #self.assertModule("t.info", type="stvds", flags="g", input="result") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-04-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-04-01 00:00:00' + granularity='3 months' map_time=interval number_of_maps=5 boundaries=4 @@ -98,9 +98,9 @@ #self.assertModule("t.info", type="stvds", flags="g", input="result") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='3 months' map_time=interval number_of_maps=4 boundaries=4 @@ -121,9 +121,9 @@ #self.assertModule("t.info", type="stvds", flags="g", input="result") - tinfo_string="""start_time=2001-01-01 00:00:00 - end_time=2002-01-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-01-01 00:00:00' + end_time='2002-01-01 00:00:00' + granularity='3 months' number_of_maps=4 points=384 primitives=384""" diff -Nru grass-7.6.1/temporal/t.rast.to.vect/t.rast.to.vect.html grass-7.8.0/temporal/t.rast.to.vect/t.rast.to.vect.html --- grass-7.6.1/temporal/t.rast.to.vect/t.rast.to.vect.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.to.vect/t.rast.to.vect.html 2019-05-18 15:50:05.000000000 +0000 @@ -39,4 +39,4 @@ Sören Gebbert, Geoinformatikbüro Dassau -

    Last changed: $Date: 2015-09-05 18:13:18 +0200 (Sat, 05 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.to.vect/t.rast.to.vect.py grass-7.8.0/temporal/t.rast.to.vect/t.rast.to.vect.py --- grass-7.6.1/temporal/t.rast.to.vect/t.rast.to.vect.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.to.vect/t.rast.to.vect.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.univar/testsuite/test_t_rast_univar.py grass-7.8.0/temporal/t.rast.univar/testsuite/test_t_rast_univar.py --- grass-7.6.1/temporal/t.rast.univar/testsuite/test_t_rast_univar.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.univar/testsuite/test_t_rast_univar.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,157 @@ +"""Test t.rast.univar + +(C) 2014 by the GRASS Development Team +This program is free software under the GNU General Public +License (>=v2). Read the file COPYING that comes with GRASS +for details. + +@author Soeren Gebbert +""" + +from grass.gunittest.case import TestCase +from grass.gunittest.gmodules import SimpleModule + +class TestRasterUnivar(TestCase): + + @classmethod + def setUpClass(cls): + """Initiate the temporal GIS and set the region + """ + cls.use_temp_region() + cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=1, res3=1) + + cls.runModule("r.mapcalc", expression="a_1 = 100", overwrite=True) + cls.runModule("r.mapcalc", expression="a_2 = 200", overwrite=True) + cls.runModule("r.mapcalc", expression="a_3 = 300", overwrite=True) + cls.runModule("r.mapcalc", expression="a_4 = 400", overwrite=True) + + cls.runModule("t.create", type="strds", temporaltype="absolute", + output="A", title="A test", description="A test", + overwrite=True) + cls.runModule("t.register", flags="i", type="raster", input="A", + maps="a_1,a_2,a_3,a_4", start="2001-01-01", + increment="3 months", overwrite=True) + + @classmethod + def tearDownClass(cls): + """Remove the temporary region + """ + cls.runModule("t.remove", flags="rf", type="strds", + inputs="A") + cls.del_temp_region() + + def test_1(self): + + t_rast_univar = SimpleModule("t.rast.univar", input="A", + where="start_time >= '2001-01-01'", + overwrite=True, verbose=True) + self.runModule("g.region", res=1) + self.assertModule(t_rast_univar) + + univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells +a_1@testing|2001-01-01 00:00:00|2001-04-01 00:00:00|100|100|100|100|0|0|0|960000|0|9600|9600 +a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600 +a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600 +a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600 +""" + for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.split("\n")): + if ref and res: + ref_line = ref.split("|", 1)[1] + res_line = res.split("|", 1)[1] + self.assertLooksLike(ref_line, res_line) + + def test_2(self): + + t_rast_univar = SimpleModule("t.rast.univar", input="A", + where="start_time >= '2001-03-01'", + overwrite=True, verbose=True) + self.runModule("g.region", res=1) + self.assertModule(t_rast_univar) + + univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells +a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600 +a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600 +a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600 +""" + for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.split("\n")): + if ref and res: + ref_line = ref.split("|", 1)[1] + res_line = res.split("|", 1)[1] + self.assertLooksLike(ref_line, res_line) + + def test_3(self): + + t_rast_univar = SimpleModule("t.rast.univar", input="A", + where="start_time >= '2001-03-01'", + overwrite=True, verbose=True) + self.runModule("g.region", res=10) + self.assertModule(t_rast_univar) + + univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells +a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|19200|0|96|96 +a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|28800|0|96|96 +a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|38400|0|96|96 +""" + for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.split("\n")): + if ref and res: + ref_line = ref.split("|", 1)[1] + res_line = res.split("|", 1)[1] + self.assertLooksLike(ref_line, res_line) + + def test_4(self): + + self.runModule("g.region", res=10) + self.assertModule("t.rast.univar", input="A", flags="r", + output="univar_output.txt", + where="start_time >= '2001-03-01'", + overwrite=True, verbose=True) + + univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells +a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600 +a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600 +a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600 +""" + univar_output = open("univar_output.txt", "r").read() + + for ref, res in zip(univar_text.split("\n"), univar_output.split("\n")): + if ref and res: + ref_line = ref.split("|", 1)[1] + res_line = res.split("|", 1)[1] + print(type(ref_line)) + print(type(res_line)) + self.assertLooksLike(ref_line, res_line) + + def test_5(self): + + self.runModule("g.region", res=10) + self.assertModule("t.rast.univar", input="A", flags="ru", + output="univar_output.txt", + where="start_time >= '2001-03-01'", + overwrite=True, verbose=True) + + univar_text=u"""a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600 +a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600 +a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600 +""" + univar_output = open("univar_output.txt", "r").read() + + for ref, res in zip(univar_text.split("\n"), univar_output.split("\n")): + if ref and res: + ref_line = ref.split("|", 1)[1] + res_line = res.split("|", 1)[1] + self.assertLooksLike(ref_line, res_line) + + def test_6_error_handling_empty_strds(self): + # Empty strds + self.assertModuleFail("t.rast.univar", input="A", + output="univar_output.txt", + where="start_time >= '2015-03-01'", + overwrite=True, verbose=True) + + def test_7_error_handling_no_input(self): + # No input + self.assertModuleFail("t.rast.univar", output="out.txt") + +if __name__ == '__main__': + from grass.gunittest.main import test + test() diff -Nru grass-7.6.1/temporal/t.rast.univar/testsuite/test_univar.py grass-7.8.0/temporal/t.rast.univar/testsuite/test_univar.py --- grass-7.6.1/temporal/t.rast.univar/testsuite/test_univar.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.univar/testsuite/test_univar.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ -"""Test t.rast.univar - -(C) 2014 by the GRASS Development Team -This program is free software under the GNU General Public -License (>=v2). Read the file COPYING that comes with GRASS -for details. - -@author Soeren Gebbert -""" - -from grass.gunittest.case import TestCase -from grass.gunittest.gmodules import SimpleModule - -class TestRasterUnivar(TestCase): - - @classmethod - def setUpClass(cls): - """Initiate the temporal GIS and set the region - """ - cls.use_temp_region() - cls.runModule("g.region", s=0, n=80, w=0, e=120, b=0, t=50, res=1, res3=1) - - cls.runModule("r.mapcalc", expression="a_1 = 100", overwrite=True) - cls.runModule("r.mapcalc", expression="a_2 = 200", overwrite=True) - cls.runModule("r.mapcalc", expression="a_3 = 300", overwrite=True) - cls.runModule("r.mapcalc", expression="a_4 = 400", overwrite=True) - - cls.runModule("t.create", type="strds", temporaltype="absolute", - output="A", title="A test", description="A test", - overwrite=True) - cls.runModule("t.register", flags="i", type="raster", input="A", - maps="a_1,a_2,a_3,a_4", start="2001-01-01", - increment="3 months", overwrite=True) - - @classmethod - def tearDownClass(cls): - """Remove the temporary region - """ - cls.runModule("t.remove", flags="rf", type="strds", - inputs="A") - cls.del_temp_region() - - def test_1(self): - - t_rast_univar = SimpleModule("t.rast.univar", input="A", - where="start_time >= '2001-01-01'", - overwrite=True, verbose=True) - self.runModule("g.region", res=1) - self.assertModule(t_rast_univar) - - univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells -a_1@testing|2001-01-01 00:00:00|2001-04-01 00:00:00|100|100|100|100|0|0|0|960000|0|9600|9600 -a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600 -a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600 -a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600 -""" - for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.split("\n")): - if ref and res: - ref_line = ref.split("|", 1)[1] - res_line = res.split("|", 1)[1] - self.assertLooksLike(ref_line, res_line) - - def test_2(self): - - t_rast_univar = SimpleModule("t.rast.univar", input="A", - where="start_time >= '2001-03-01'", - overwrite=True, verbose=True) - self.runModule("g.region", res=1) - self.assertModule(t_rast_univar) - - univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells -a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600 -a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600 -a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600 -""" - for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.split("\n")): - if ref and res: - ref_line = ref.split("|", 1)[1] - res_line = res.split("|", 1)[1] - self.assertLooksLike(ref_line, res_line) - - def test_3(self): - - t_rast_univar = SimpleModule("t.rast.univar", input="A", - where="start_time >= '2001-03-01'", - overwrite=True, verbose=True) - self.runModule("g.region", res=10) - self.assertModule(t_rast_univar) - - univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells -a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|19200|0|96|96 -a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|28800|0|96|96 -a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|38400|0|96|96 -""" - for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.split("\n")): - if ref and res: - ref_line = ref.split("|", 1)[1] - res_line = res.split("|", 1)[1] - self.assertLooksLike(ref_line, res_line) - - def test_4(self): - - self.runModule("g.region", res=10) - self.assertModule("t.rast.univar", input="A", flags="r", - output="univar_output.txt", - where="start_time >= '2001-03-01'", - overwrite=True, verbose=True) - - univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells -a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600 -a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600 -a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600 -""" - univar_output = open("univar_output.txt", "r").read() - - for ref, res in zip(univar_text.split("\n"), univar_output.split("\n")): - if ref and res: - ref_line = ref.split("|", 1)[1] - res_line = res.split("|", 1)[1] - self.assertLooksLike(ref_line, res_line) - - def test_5(self): - - self.runModule("g.region", res=10) - self.assertModule("t.rast.univar", input="A", flags="ru", - output="univar_output.txt", - where="start_time >= '2001-03-01'", - overwrite=True, verbose=True) - - univar_text="""a_2@testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600 -a_3@testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600 -a_4@testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600 -""" - univar_output = open("univar_output.txt", "r").read() - - for ref, res in zip(univar_text.split("\n"), univar_output.split("\n")): - if ref and res: - ref_line = ref.split("|", 1)[1] - res_line = res.split("|", 1)[1] - self.assertLooksLike(ref_line, res_line) - - def test_6_error_handling_empty_strds(self): - # Empty strds - self.assertModuleFail("t.rast.univar", input="A", - output="univar_output.txt", - where="start_time >= '2015-03-01'", - overwrite=True, verbose=True) - - def test_7_error_handling_no_input(self): - # No input - self.assertModuleFail("t.rast.univar", output="out.txt") - -if __name__ == '__main__': - from grass.gunittest.main import test - test() diff -Nru grass-7.6.1/temporal/t.rast.univar/t.rast.univar.html grass-7.8.0/temporal/t.rast.univar/t.rast.univar.html --- grass-7.6.1/temporal/t.rast.univar/t.rast.univar.html 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.univar/t.rast.univar.html 2019-05-18 15:50:05.000000000 +0000 @@ -38,5 +38,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-09-17 01:03:06 +0200 (Sat, 17 Sep 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.univar/t.rast.univar.py grass-7.8.0/temporal/t.rast.univar/t.rast.univar.py --- grass-7.6.1/temporal/t.rast.univar/t.rast.univar.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.univar/t.rast.univar.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rast.what/testsuite/test_what.py grass-7.8.0/temporal/t.rast.what/testsuite/test_what.py --- grass-7.6.1/temporal/t.rast.what/testsuite/test_what.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.what/testsuite/test_what.py 2019-06-03 20:34:21.000000000 +0000 @@ -144,7 +144,7 @@ 79.6816763826|45.2391522853|2001-10-01 00:00:00|2002-01-01 00:00:00|400 97.4892579600|79.2347263950|2001-10-01 00:00:00|2002-01-01 00:00:00|400 """ - self.assertLooksLike(text, t_rast_what.outputs.stdout) + self.assertLooksLike(text, str(t_rast_what.outputs.stdout)) def test_row_stdout_where_parallel_cat(self): @@ -165,7 +165,7 @@ 2|79.6816763826|45.2391522853|2001-10-01 00:00:00|2002-01-01 00:00:00|400 3|97.4892579600|79.2347263950|2001-10-01 00:00:00|2002-01-01 00:00:00|400 """ - self.assertLooksLike(text, t_rast_what.outputs.stdout) + self.assertLooksLike(text, str(t_rast_what.outputs.stdout)) def test_row_stdout_where_parallel2(self): """Here without output definition, the default is used then""" @@ -186,7 +186,7 @@ 79.6816763826|45.2391522853|2001-10-01 00:00:00|2002-01-01 00:00:00|400 97.4892579600|79.2347263950|2001-10-01 00:00:00|2002-01-01 00:00:00|400 """ - self.assertLooksLike(text, t_rast_what.outputs.stdout) + self.assertLooksLike(text, str(t_rast_what.outputs.stdout)) def test_row_output_where_parallel(self): self.assertModule("t.rast.what", strds="A", output="out_where.txt", @@ -260,7 +260,7 @@ 115.0043586274|36.3593955783|2001-01-01 00:00:00|2001-04-01 00:00:00|100 115.0043586274|36.3593955783|2001-04-01 00:00:00|2001-07-01 00:00:00|NULL """ - self.assertLooksLike(text, t_rast_what.outputs.stdout) + self.assertLooksLike(text, str(t_rast_what.outputs.stdout)) if __name__ == '__main__': diff -Nru grass-7.6.1/temporal/t.rast.what/t.rast.what.html grass-7.8.0/temporal/t.rast.what/t.rast.what.html --- grass-7.6.1/temporal/t.rast.what/t.rast.what.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.what/t.rast.what.html 2019-05-18 15:50:05.000000000 +0000 @@ -135,4 +135,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-25 13:07:25 +0200 (Fri, 25 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rast.what/t.rast.what.py grass-7.8.0/temporal/t.rast.what/t.rast.what.py --- grass-7.6.1/temporal/t.rast.what/t.rast.what.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.rast.what/t.rast.what.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.register/t.register.html grass-7.8.0/temporal/t.register/t.register.html --- grass-7.6.1/temporal/t.register/t.register.html 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/temporal/t.register/t.register.html 2019-05-18 15:50:05.000000000 +0000 @@ -269,5 +269,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2018-03-21 14:07:11 +0100 (Wed, 21 Mar 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.register/t.register.py grass-7.8.0/temporal/t.register/t.register.py --- grass-7.6.1/temporal/t.register/t.register.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.register/t.register.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.remove/t.remove.html grass-7.8.0/temporal/t.remove/t.remove.html --- grass-7.6.1/temporal/t.remove/t.remove.html 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.remove/t.remove.html 2019-05-18 15:50:05.000000000 +0000 @@ -57,5 +57,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-27 13:10:53 +0200 (Sun, 27 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.remove/t.remove.py grass-7.8.0/temporal/t.remove/t.remove.py --- grass-7.6.1/temporal/t.remove/t.remove.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.remove/t.remove.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.rename/t.rename.html grass-7.8.0/temporal/t.rename/t.rename.html --- grass-7.6.1/temporal/t.rename/t.rename.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rename/t.rename.html 2019-05-18 15:50:05.000000000 +0000 @@ -34,5 +34,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-12 11:38:35 +0200 (Sat, 12 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.rename/t.rename.py grass-7.8.0/temporal/t.rename/t.rename.py --- grass-7.6.1/temporal/t.rename/t.rename.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.rename/t.rename.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -57,7 +57,7 @@ tgis.init() #Get the current mapset to create the id of the space time dataset - mapset = grass.encode(grass.gisenv()["MAPSET"]) + mapset = grass.gisenv()["MAPSET"] if input.find("@") >= 0: old_id = input diff -Nru grass-7.6.1/temporal/t.sample/t.sample.html grass-7.8.0/temporal/t.sample/t.sample.html --- grass-7.6.1/temporal/t.sample/t.sample.html 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/temporal/t.sample/t.sample.html 2019-05-18 15:50:05.000000000 +0000 @@ -175,5 +175,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-06-27 00:24:39 +0200 (Mon, 27 Jun 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.sample/t.sample.py grass-7.8.0/temporal/t.sample/t.sample.py --- grass-7.6.1/temporal/t.sample/t.sample.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.sample/t.sample.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.select/t.select.html grass-7.8.0/temporal/t.select/t.select.html --- grass-7.6.1/temporal/t.select/t.select.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.select/t.select.html 2019-05-18 15:50:05.000000000 +0000 @@ -372,5 +372,5 @@ Thomas Leppelt, Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-11-14 00:05:32 +0100 (Mon, 14 Nov 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.select/t.select.py grass-7.8.0/temporal/t.select/t.select.py --- grass-7.6.1/temporal/t.select/t.select.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.select/t.select.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.shift/t.shift.html grass-7.8.0/temporal/t.shift/t.shift.html --- grass-7.6.1/temporal/t.shift/t.shift.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.shift/t.shift.html 2019-05-18 15:50:05.000000000 +0000 @@ -196,5 +196,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-22 10:10:38 +0200 (Tue, 22 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.shift/t.shift.py grass-7.8.0/temporal/t.shift/t.shift.py --- grass-7.6.1/temporal/t.shift/t.shift.py 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/temporal/t.shift/t.shift.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.snap/t.snap.html grass-7.8.0/temporal/t.snap/t.snap.html --- grass-7.6.1/temporal/t.snap/t.snap.html 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.snap/t.snap.html 2019-05-18 15:50:05.000000000 +0000 @@ -197,5 +197,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-08-24 18:26:08 +0200 (Mon, 24 Aug 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.snap/t.snap.py grass-7.8.0/temporal/t.snap/t.snap.py --- grass-7.6.1/temporal/t.snap/t.snap.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.snap/t.snap.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.support/t.support.html grass-7.8.0/temporal/t.support/t.support.html --- grass-7.6.1/temporal/t.support/t.support.html 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.support/t.support.html 2019-05-18 15:50:05.000000000 +0000 @@ -41,5 +41,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-02-13 16:14:07 +0100 (Fri, 13 Feb 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.support/t.support.py grass-7.8.0/temporal/t.support/t.support.py --- grass-7.6.1/temporal/t.support/t.support.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.support/t.support.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.topology/t.topology.html grass-7.8.0/temporal/t.topology/t.topology.html --- grass-7.6.1/temporal/t.topology/t.topology.html 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.topology/t.topology.html 2019-05-18 15:50:05.000000000 +0000 @@ -52,5 +52,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2014-12-03 20:39:26 +0100 (Wed, 03 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.topology/t.topology.py grass-7.8.0/temporal/t.topology/t.topology.py --- grass-7.6.1/temporal/t.topology/t.topology.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.topology/t.topology.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.unregister/t.unregister.html grass-7.8.0/temporal/t.unregister/t.unregister.html --- grass-7.6.1/temporal/t.unregister/t.unregister.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.unregister/t.unregister.html 2019-05-18 15:50:05.000000000 +0000 @@ -61,4 +61,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2014-12-27 00:33:06 +0100 (Sat, 27 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.unregister/t.unregister.py grass-7.8.0/temporal/t.unregister/t.unregister.py --- grass-7.6.1/temporal/t.unregister/t.unregister.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.unregister/t.unregister.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -73,7 +73,7 @@ if not maps and not file: grass.fatal(_("%s= or %s= must be specified") % ("input", "file")) - mapset = grass.encode(grass.gisenv()["MAPSET"]) + mapset = grass.gisenv()["MAPSET"] dbif = tgis.SQLDatabaseInterfaceConnection() dbif.connect() diff -Nru grass-7.6.1/temporal/t.vect.algebra/t.vect.algebra.html grass-7.8.0/temporal/t.vect.algebra/t.vect.algebra.html --- grass-7.6.1/temporal/t.vect.algebra/t.vect.algebra.html 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.algebra/t.vect.algebra.html 2019-05-18 15:50:05.000000000 +0000 @@ -459,5 +459,5 @@ Thomas Leppelt, Soeren Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-11-14 00:05:32 +0100 (Mon, 14 Nov 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.vect.algebra/t.vect.algebra.py grass-7.8.0/temporal/t.vect.algebra/t.vect.algebra.py --- grass-7.6.1/temporal/t.vect.algebra/t.vect.algebra.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.algebra/t.vect.algebra.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.vect.db.select/t.vect.db.select.html grass-7.8.0/temporal/t.vect.db.select/t.vect.db.select.html --- grass-7.6.1/temporal/t.vect.db.select/t.vect.db.select.html 2019-03-19 19:56:53.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.db.select/t.vect.db.select.html 2019-05-18 15:50:05.000000000 +0000 @@ -52,5 +52,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-22 10:10:38 +0200 (Tue, 22 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.vect.db.select/t.vect.db.select.py grass-7.8.0/temporal/t.vect.db.select/t.vect.db.select.py --- grass-7.6.1/temporal/t.vect.db.select/t.vect.db.select.py 2019-03-19 19:56:54.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.db.select/t.vect.db.select.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.vect.export/t.vect.export.html grass-7.8.0/temporal/t.vect.export/t.vect.export.html --- grass-7.6.1/temporal/t.vect.export/t.vect.export.html 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.export/t.vect.export.html 2019-05-18 15:50:05.000000000 +0000 @@ -132,4 +132,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-11-13 18:50:28 +0100 (Sun, 13 Nov 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.vect.export/t.vect.export.py grass-7.8.0/temporal/t.vect.export/t.vect.export.py --- grass-7.6.1/temporal/t.vect.export/t.vect.export.py 2019-03-19 19:56:52.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.export/t.vect.export.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.vect.extract/testsuite/test_vect_extract.py grass-7.8.0/temporal/t.vect.extract/testsuite/test_vect_extract.py --- grass-7.6.1/temporal/t.vect.extract/testsuite/test_vect_extract.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.extract/testsuite/test_vect_extract.py 2019-06-03 20:34:21.000000000 +0000 @@ -50,9 +50,9 @@ self.assertModule("t.vect.extract", input="A", output="B", where="start_time > '2001-06-01'", overwrite=True) - tinfo_string="""start_time=2001-07-01 00:00:00 - end_time=2003-07-01 00:00:00 - granularity=3 months + tinfo_string="""start_time='2001-07-01 00:00:00' + end_time='2003-07-01 00:00:00' + granularity='3 months' map_time=interval number_of_maps=8 primitives=160 diff -Nru grass-7.6.1/temporal/t.vect.extract/t.vect.extract.html grass-7.8.0/temporal/t.vect.extract/t.vect.extract.html --- grass-7.6.1/temporal/t.vect.extract/t.vect.extract.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.extract/t.vect.extract.html 2019-05-18 15:50:05.000000000 +0000 @@ -87,5 +87,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-22 10:10:38 +0200 (Tue, 22 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.vect.extract/t.vect.extract.py grass-7.8.0/temporal/t.vect.extract/t.vect.extract.py --- grass-7.6.1/temporal/t.vect.extract/t.vect.extract.py 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.extract/t.vect.extract.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.vect.import/t.vect.import.html grass-7.8.0/temporal/t.vect.import/t.vect.import.html --- grass-7.6.1/temporal/t.vect.import/t.vect.import.html 2019-03-19 19:56:51.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.import/t.vect.import.html 2019-05-18 15:50:05.000000000 +0000 @@ -68,4 +68,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-06-27 00:24:39 +0200 (Mon, 27 Jun 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.vect.import/t.vect.import.py grass-7.8.0/temporal/t.vect.import/t.vect.import.py --- grass-7.6.1/temporal/t.vect.import/t.vect.import.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.import/t.vect.import.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.vect.list/t.vect.list.html grass-7.8.0/temporal/t.vect.list/t.vect.list.html --- grass-7.6.1/temporal/t.vect.list/t.vect.list.html 2019-03-19 19:56:49.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.list/t.vect.list.html 2019-05-18 15:50:05.000000000 +0000 @@ -68,5 +68,5 @@ Sören Gebbert -

    Last changed: $Date: 2015-09-22 10:10:38 +0200 (Tue, 22 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.vect.list/t.vect.list.py grass-7.8.0/temporal/t.vect.list/t.vect.list.py --- grass-7.6.1/temporal/t.vect.list/t.vect.list.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.list/t.vect.list.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.vect.observe.strds/t.vect.observe.strds.html grass-7.8.0/temporal/t.vect.observe.strds/t.vect.observe.strds.html --- grass-7.6.1/temporal/t.vect.observe.strds/t.vect.observe.strds.html 2019-03-19 19:56:54.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.observe.strds/t.vect.observe.strds.html 2019-05-18 15:50:05.000000000 +0000 @@ -141,4 +141,4 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-10-27 23:20:55 +0200 (Thu, 27 Oct 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.vect.observe.strds/t.vect.observe.strds.py grass-7.8.0/temporal/t.vect.observe.strds/t.vect.observe.strds.py --- grass-7.6.1/temporal/t.vect.observe.strds/t.vect.observe.strds.py 2019-03-19 19:56:53.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.observe.strds/t.vect.observe.strds.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # @@ -104,7 +104,7 @@ dbif = tgis.SQLDatabaseInterfaceConnection() dbif.connect() - mapset = grass.encode(grass.gisenv()["MAPSET"]) + mapset = grass.gisenv()["MAPSET"] out_sp = tgis.check_new_stds(output, "stvds", dbif, overwrite) diff -Nru grass-7.6.1/temporal/t.vect.univar/t.vect.univar.html grass-7.8.0/temporal/t.vect.univar/t.vect.univar.html --- grass-7.6.1/temporal/t.vect.univar/t.vect.univar.html 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.univar/t.vect.univar.html 2019-05-18 15:50:05.000000000 +0000 @@ -32,5 +32,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2015-09-22 10:10:38 +0200 (Tue, 22 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.vect.univar/t.vect.univar.py grass-7.8.0/temporal/t.vect.univar/t.vect.univar.py --- grass-7.6.1/temporal/t.vect.univar/t.vect.univar.py 2019-03-19 19:56:50.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.univar/t.vect.univar.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/temporal/t.vect.what.strds/t.vect.what.strds.html grass-7.8.0/temporal/t.vect.what.strds/t.vect.what.strds.html --- grass-7.6.1/temporal/t.vect.what.strds/t.vect.what.strds.html 2019-03-19 19:56:53.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.what.strds/t.vect.what.strds.html 2019-05-18 15:50:05.000000000 +0000 @@ -34,5 +34,5 @@ Sören Gebbert, Thünen Institute of Climate-Smart Agriculture -

    Last changed: $Date: 2016-10-27 23:20:55 +0200 (Thu, 27 Oct 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/temporal/t.vect.what.strds/t.vect.what.strds.py grass-7.8.0/temporal/t.vect.what.strds/t.vect.what.strds.py --- grass-7.6.1/temporal/t.vect.what.strds/t.vect.what.strds.py 2019-03-19 19:56:54.000000000 +0000 +++ grass-7.8.0/temporal/t.vect.what.strds/t.vect.what.strds.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################ # diff -Nru grass-7.6.1/testsuite/examples/test_framework_GRASS_GIS_with_NC.conf grass-7.8.0/testsuite/examples/test_framework_GRASS_GIS_with_NC.conf --- grass-7.6.1/testsuite/examples/test_framework_GRASS_GIS_with_NC.conf 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/testsuite/examples/test_framework_GRASS_GIS_with_NC.conf 2019-08-11 09:05:20.000000000 +0000 @@ -1,11 +1,11 @@ ### CONFIGURATION # # name of binary: -GRASSBIN=grass76 +GRASSBIN=grass78 # source code directory as full path: GRASSSRC="$(realpath ../../)" # temporary grassdata directory -GRASSDATA="$HOME/grassdata/tests-grassdata" +GRASSDATA="$HOME/grassdata" # leave 1 or more CPU free for other usage than testing FREECPU=1 diff -Nru grass-7.6.1/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh grass-7.8.0/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh --- grass-7.6.1/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh 2019-03-19 19:58:45.000000000 +0000 +++ grass-7.8.0/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh 2019-08-12 16:50:46.000000000 +0000 @@ -9,8 +9,7 @@ # https://grass.osgeo.org/grass76/manuals/libpython/gunittest_running_tests.html#example-bash-script-to-run-be-used-as-a-cron-job # # Data: -# Since we use the full NC dataset (nc_spm_08_grass7.tar.gz) here, we need to generate -# some simplified names as used in NC basic for some test cases. This happens automatically below. +# We use the full NC dataset (nc_spm_full_v2_alpha.tar.gz) # # COPYRIGHT: (C) 2019 by Markus Neteler, and the GRASS Development Team # @@ -102,33 +101,18 @@ mkdir -p $GRASSDATA # fetch sample data -SAMPLEDATA=nc_spm_08_grass7.tar.gz -(cd $GRASSDATA ; wget -c https://grass.osgeo.org/sampledata/north_carolina/$SAMPLEDATA ; tar xfz $SAMPLEDATA ) +SAMPLEDATA=nc_spm_full_v2alpha +(cd $GRASSDATA ; wget -c http://fatra.cnr.ncsu.edu/data/$SAMPLEDATA.tar.gz ; tar xfz $SAMPLEDATA.tar.gz --strip-components 2) -echo "Nightly GRASS GIS test started: $NOW" >> ${LOGFILE} +set -x -# Preparation: Since we use the full NC dataset, we need to generate some simplified names as used in NC basic for some test cases -echo " -g.copy raster=basin_50K,basin -g.copy raster=boundary_county_500m,boundary -g.copy raster=landcover_1m,landcover -g.copy raster=geology_30m,geology -g.copy raster=landuse96_28m,landuse -g.copy raster=soilsID,soils -g.copy vector=census_wake2000,census -g.copy vector=elev_lid792_bepts,elev_points -g.copy vector=zipcodes_wake,zipcodes -g.copy vector=schools_wake,schools -g.copy vector=streets_wake,streets -" > $GRASSDATA/tmp_rename.sh -$GRASSBIN $GRASSDATA/nc_spm_08_grass7/PERMANENT --exec sh $GRASSDATA/tmp_rename.sh -rm -f $GRASSDATA/tmp_rename.sh +echo "Testing of GRASS GIS started: $NOW" >> ${LOGFILE} if [ "$COMPILE" = "yes" ] ; then ## compile current source code from scratch cd $GRASSSRC make distclean -j$GCCTHREADS - svn update + git pull ./$CONFIGURE ... # configure meta script containing all the compiler flags make -j$GCCTHREADS fi @@ -139,8 +123,8 @@ --grassbin $GRASSBIN \ --grasssrc $GRASSSRC \ --grassdata $GRASSDATA \ - --location nc_spm_08_grass7 --location-type nc \ - --location other_location --location-type other_type + --location $SAMPLEDATA --location-type nc # \ +# --location other_location --location-type other_type # create overall report of all so far executed tests # the script depends on GRASS but just Python part is enough diff -Nru grass-7.6.1/tools/create_python_init_file.py grass-7.8.0/tools/create_python_init_file.py --- grass-7.6.1/tools/create_python_init_file.py 2019-03-19 20:04:48.000000000 +0000 +++ grass-7.8.0/tools/create_python_init_file.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Script for creating an __init__.py file for a package. diff -Nru grass-7.6.1/tools/g.html2man/g.html2man.py grass-7.8.0/tools/g.html2man/g.html2man.py --- grass-7.6.1/tools/g.html2man/g.html2man.py 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/tools/g.html2man/g.html2man.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import re from ghtml import HTMLParser, HTMLParseError @@ -69,9 +69,10 @@ s = s.lstrip() # write groff - outf = open(sys.argv[2], 'w') - outf.write(s) - outf.close() + with open(sys.argv[2], 'wb') as outf: + if sys.version_info.major >= 3: + s = s.encode('UTF-8') + outf.write(s) if __name__ == "__main__": main() diff -Nru grass-7.6.1/tools/gitlog2changelog.py grass-7.8.0/tools/gitlog2changelog.py --- grass-7.6.1/tools/gitlog2changelog.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/tools/gitlog2changelog.py 2019-08-06 18:48:31.000000000 +0000 @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 +# Copyright 2008 Marcus D. Hanwell +# Minor changes for NUT by Charles Lepple +# Distributed under the terms of the GNU General Public License v2 or later + +import string, re, os +from textwrap import TextWrapper +import sys + +rev_range = '' + +if len(sys.argv) > 1: + base = sys.argv[1] + rev_range = '%s..HEAD' % base + +# Execute git log with the desired command line options. +fin = os.popen('git log --summary --stat --no-merges --date=short %s' % rev_range, 'r') +# Create a ChangeLog file in the current directory. +fout = open('ChangeLog', 'w') + +# Set up the loop variables in order to locate the blocks we want +authorFound = False +dateFound = False +messageFound = False +filesFound = False +message = "" +messageNL = False +files = "" +prevAuthorLine = "" + +wrapper = TextWrapper(initial_indent="\t", subsequent_indent="\t ") + +# The main part of the loop +for line in fin: + # The commit line marks the start of a new commit object. + if line.startswith('commit'): + # Start all over again... + authorFound = False + dateFound = False + messageFound = False + messageNL = False + message = "" + filesFound = False + files = "" + continue + # Match the author line and extract the part we want + # (Don't use startswith to allow Author override inside commit message.) + elif 'Author:' in line: + authorList = re.split(': ', line, 1) + try: + author = authorList[1] + author = author[0:len(author)-1] + authorFound = True + except: + print ("Could not parse authorList = '%s'" % (line)) + + # Match the date line + elif line.startswith('Date:'): + dateList = re.split(': ', line, 1) + try: + date = dateList[1] + date = date[0:len(date)-1] + dateFound = True + except: + print ("Could not parse dateList = '%s'" % (line)) + # The Fossil-IDs are ignored: + elif line.startswith(' Fossil-ID:') or line.startswith(' [[SVN:'): + continue + # The svn-id lines are ignored + elif ' git-svn-id:' in line: + continue + # The sign off line is ignored too + elif 'Signed-off-by' in line: + continue + # Extract the actual commit message for this commit + elif authorFound & dateFound & messageFound == False: + # Find the commit message if we can + if len(line) == 1: + if messageNL: + messageFound = True + else: + messageNL = True + elif len(line) == 4: + messageFound = True + else: + if len(message) == 0: + message = message + line.strip() + else: + message = message + " " + line.strip() + # If this line is hit all of the files have been stored for this commit + elif re.search('files? changed', line): + filesFound = True + continue + # Collect the files for this commit. FIXME: Still need to add +/- to files + elif authorFound & dateFound & messageFound: + fileList = re.split(' \| ', line, 2) + if len(fileList) > 1: + if len(files) > 0: + files = files + ", " + fileList[0].strip() + else: + files = fileList[0].strip() + # All of the parts of the commit have been found - write out the entry + if authorFound & dateFound & messageFound & filesFound: + # First the author line, only outputted if it is the first for that + # author on this day + authorLine = date + " " + author + if len(prevAuthorLine) == 0: + fout.write(authorLine + "\n\n") + elif authorLine == prevAuthorLine: + pass + else: + fout.write("\n" + authorLine + "\n\n") + + # Assemble the actual commit message line(s) and limit the line length + # to 80 characters. + commitLine = "* " + files + ": " + message + + # Write out the commit line + fout.write(wrapper.fill(commitLine) + "\n") + + #Now reset all the variables ready for a new commit block. + authorFound = False + dateFound = False + messageFound = False + messageNL = False + message = "" + filesFound = False + files = "" + prevAuthorLine = authorLine + +# Close the input and output lines now that we are finished. +fin.close() +fout.close() diff -Nru grass-7.6.1/tools/grass_indent.sh grass-7.8.0/tools/grass_indent.sh --- grass-7.6.1/tools/grass_indent.sh 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/tools/grass_indent.sh 2019-06-03 20:34:21.000000000 +0000 @@ -26,8 +26,10 @@ # fix broken gettext macros: grep -l '\<_$' "$@" | \ - while read file ; do sed -i -e '/[( \t]_$/{;N;s/\n[ \t]*//;}' $file ; done + while read file ; do sed -i -e '/[( \t]_$/{;N;s/\n[ \t]*//;}' "$file" ; done # restore original file with timestamp if indent did not change anything - cmp "$@"~ "$@" > /dev/null && mv -f "$@"~ "$@" + for file in "$@" ; do + cmp "$file"~ "$file" > /dev/null && mv -f "$file"~ "$file" + done fi diff -Nru grass-7.6.1/tools/mkhtml.py grass-7.8.0/tools/mkhtml.py --- grass-7.6.1/tools/mkhtml.py 2019-03-19 20:04:51.000000000 +0000 +++ grass-7.8.0/tools/mkhtml.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # @@ -72,8 +72,8 @@ src_file = "%s.html" % pgm tmp_file = "%s.tmp.html" % pgm -trunk_url = "https://trac.osgeo.org/grass/browser/grass/trunk/" -addons_url = "https://trac.osgeo.org/grass/browser/grass-addons/" +trunk_url = "https://github.com/OSGeo/grass/tree/master/" +addons_url = "https://github.com/OSGeo/grass-addons/tree/master/" header_base = """ @@ -381,7 +381,7 @@ if index_name: sys.stdout.write(sourcecode.substitute(URL_SOURCE=url_source, PGM=pgm, - URL_LOG=url_source.replace('browser', 'log'))) + URL_LOG=url_source.replace('grass/tree', 'grass/commits'))) sys.stdout.write(footer_index.substitute(INDEXNAME=index_name, INDEXNAMECAP=index_name_cap, YEAR=year, GRASS_VERSION=grass_version)) diff -Nru grass-7.6.1/tools/mkrest.py grass-7.8.0/tools/mkrest.py --- grass-7.6.1/tools/mkrest.py 2019-03-19 20:04:48.000000000 +0000 +++ grass-7.8.0/tools/mkrest.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,5 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################ # diff -Nru grass-7.6.1/tools/ppmrotate.py grass-7.8.0/tools/ppmrotate.py --- grass-7.6.1/tools/ppmrotate.py 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/tools/ppmrotate.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # ppmrotate.py: Rotate PPM images # @@ -68,9 +68,9 @@ def rotate_ppm(srcd): dstd = array.array('B', len(srcd) * '\0') - for y in xrange(height): - for x in xrange(width): - for c in xrange(3): + for y in range(height): + for x in range(width): + for c in range(3): old_pos = (y * width + x) * 3 + c new_pos = (x * height + (height - 1 - y)) * 3 + c dstd[new_pos] = srcd[old_pos] @@ -80,7 +80,7 @@ def flip_ppm(srcd): dstd = array.array('B', len(srcd) * '\0') stride = width * 3 - for y in xrange(height): + for y in range(height): dy = (height - 1 - y) dstd[dy * stride:(dy + 1) * stride] = srcd[y * stride:(y + 1) * stride] return dstd diff -Nru grass-7.6.1/tools/thumbnails.py grass-7.8.0/tools/thumbnails.py --- grass-7.6.1/tools/thumbnails.py 2019-03-19 20:04:51.000000000 +0000 +++ grass-7.8.0/tools/thumbnails.py 2019-08-06 18:48:31.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # thumbnails.py: Create thumbnail images of the GRASS color tables # @@ -74,6 +74,19 @@ minval += abs(minval / 100) maxval = float(records[-1][0]) maxval = min(maxval, 2500000) + if os.path.basename(path) in ('ndvi', 'ndwi', 'ndwi2'): + minval = -1.0 + maxval = 1.0 + if os.path.basename(path) == 'ndvi_MODIS': + minval = -10000.0 + maxval = 10000.0 + if os.path.basename(path) == 'population_dens': + maxval = 1000.0 + if os.path.basename(path) == 'precipitation': + maxval = 2000.0 + if os.path.basename(path) in ('terrain', 'srtm', 'srtm_plus'): + minval = -500.0 + maxval = 3000.0 grad = tmp_grad_abs grass.mapcalc("$grad = " " float($min) + (col() - 1) * " @@ -149,6 +162,8 @@ if var in os.environ: del os.environ[var] + os.environ['GRASS_ANTIALIAS'] = 'none' + grass.use_temp_region() grass.run_command('g.region', s=0, w=0, n=height, e=width, rows=height, cols=width, res=1, flags='a') diff -Nru grass-7.6.1/tools/vagrant/compile.sh grass-7.8.0/tools/vagrant/compile.sh --- grass-7.6.1/tools/vagrant/compile.sh 2019-03-19 20:04:50.000000000 +0000 +++ grass-7.8.0/tools/vagrant/compile.sh 2019-06-27 08:06:44.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -### inspired by https://svn.osgeo.org/gdal/trunk/gdal/scripts/vagrant/gdal.sh +### inspired by https://github.com/OSGeo/gdal/blob/master/gdal/scripts/vagrant/gdal.sh # abort install if any errors occur and enable tracing set -o errexit diff -Nru grass-7.6.1/translators.csv grass-7.8.0/translators.csv --- grass-7.6.1/translators.csv 2019-03-19 20:05:30.000000000 +0000 +++ grass-7.8.0/translators.csv 2019-06-03 20:34:21.000000000 +0000 @@ -14,7 +14,7 @@ Georg Lösel,,DE Helmut Kudrnovsky,,DE Markus Neteler,,DE -Robert Nuske,,DE +Robert Nuske,,DE Vasilios Antoniou,,EL Nikos Ves,,EL diff -Nru grass-7.6.1/Vagrantfile grass-7.8.0/Vagrantfile --- grass-7.6.1/Vagrantfile 2019-03-19 20:04:48.000000000 +0000 +++ grass-7.8.0/Vagrantfile 2019-08-16 12:55:06.000000000 +0000 @@ -1,7 +1,7 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -### Inspired by https://svn.osgeo.org/gdal/trunk/gdal/Vagrantfile +### Inspired by https://github.com/OSGeo/gdal/blob/master/Vagrantfile require 'socket' @@ -63,14 +63,16 @@ "proj-bin", "libreadline-dev", "libsqlite3-dev", - "libwxgtk3.0-dev", + "libwxgtk3.0-gtk3-dev", "libxmu-dev", - "python", - "python-wxgtk3.0", - "python-dev", - "python-numpy", - "python-ply", - "python-pil", + "python3", + "python3-wxgtk4.0", + "python3-dateutil", + "python3-dev", + "python3-numpy", + "python3-ply", + "python3-pil", + "python3-six", "libnetcdf-dev", "netcdf-bin", "libblas-dev", diff -Nru grass-7.6.1/vector/v.buffer/main.c grass-7.8.0/vector/v.buffer/main.c --- grass-7.6.1/vector/v.buffer/main.c 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/vector/v.buffer/main.c 2019-05-22 21:47:51.000000000 +0000 @@ -666,6 +666,11 @@ G_debug(2, _("The tolerance in map units: %g"), unit_tolerance); } + + if (da <= 0) { + G_warning(_("Distances must be positive, ignoring distance %g"), da); + continue; + } Vect_line_prune(Points); if (ltype & GV_POINTS || Points->n_points == 1) { diff -Nru grass-7.6.1/vector/v.buffer/v.buffer.html grass-7.8.0/vector/v.buffer/v.buffer.html --- grass-7.6.1/vector/v.buffer/v.buffer.html 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/vector/v.buffer/v.buffer.html 2019-05-22 21:47:51.000000000 +0000 @@ -177,4 +177,4 @@ Rewritten by Markus Metz (2011, 2012)

    -Last changed: $Date: 2018-03-12 09:47:35 +0100 (Mon, 12 Mar 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.build/v.build.html grass-7.8.0/vector/v.build/v.build.html --- grass-7.6.1/vector/v.build/v.build.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.build/v.build.html 2019-05-18 15:50:05.000000000 +0000 @@ -89,4 +89,4 @@ Radim Blazek, ITC-irst, Trento, Italy

    -Last changed: $Date: 2016-03-08 09:06:33 +0100 (Tue, 08 Mar 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.build.polylines/v.build.polylines.html grass-7.8.0/vector/v.build.polylines/v.build.polylines.html --- grass-7.6.1/vector/v.build.polylines/v.build.polylines.html 2019-03-19 20:04:10.000000000 +0000 +++ grass-7.8.0/vector/v.build.polylines/v.build.polylines.html 2019-05-18 15:50:05.000000000 +0000 @@ -84,4 +84,4 @@ Category mode added by Martin Landa, FBK-irst, Trento, Italy, October 2007
    Support for categories, attributes, and different line types by Markus Metz -

    Last changed: $Date: 2017-02-15 23:17:07 +0100 (Wed, 15 Feb 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.category/v.category.html grass-7.8.0/vector/v.category/v.category.html --- grass-7.6.1/vector/v.category/v.category.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.category/v.category.html 2019-05-18 15:50:05.000000000 +0000 @@ -145,4 +145,4 @@ Modified (the id parameter) by Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy, 2008/02 -

    Last changed: $Date: 2018-09-15 22:00:54 +0200 (Sat, 15 Sep 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.class/v.class.html grass-7.8.0/vector/v.class/v.class.html --- grass-7.6.1/vector/v.class/v.class.html 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.class/v.class.html 2019-05-18 15:50:05.000000000 +0000 @@ -90,4 +90,4 @@ Moritz Lennert -

    Last changed: $Date: 2018-06-12 02:46:28 +0200 (Tue, 12 Jun 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.clean/test/description.html grass-7.8.0/vector/v.clean/test/description.html --- grass-7.6.1/vector/v.clean/test/description.html 2019-03-19 20:04:01.000000000 +0000 +++ grass-7.8.0/vector/v.clean/test/description.html 2019-05-18 15:50:05.000000000 +0000 @@ -11,4 +11,4 @@ Radim Blazek -

    Last changed: $Date: 2011-09-29 21:18:47 +0200 (Thu, 29 Sep 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.clean/v.clean.html grass-7.8.0/vector/v.clean/v.clean.html --- grass-7.6.1/vector/v.clean/v.clean.html 2019-03-19 20:04:01.000000000 +0000 +++ grass-7.8.0/vector/v.clean/v.clean.html 2019-05-18 15:50:05.000000000 +0000 @@ -385,4 +385,4 @@ Radim Blazek, ITC-irst, Trento, Italy
    Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy -

    Last changed: $Date: 2018-01-15 22:39:37 +0100 (Mon, 15 Jan 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.cluster/v.cluster.html grass-7.8.0/vector/v.cluster/v.cluster.html --- grass-7.6.1/vector/v.cluster/v.cluster.html 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.cluster/v.cluster.html 2019-05-18 15:50:05.000000000 +0000 @@ -204,4 +204,4 @@ Markus Metz -

    Last changed: $Date: 2015-09-07 10:09:13 +0200 (Mon, 07 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.colors/v.colors.html grass-7.8.0/vector/v.colors/v.colors.html --- grass-7.6.1/vector/v.colors/v.colors.html 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.colors/v.colors.html 2019-05-18 15:50:05.000000000 +0000 @@ -134,4 +134,4 @@ Martin Landa, OSGeoREL, Czech Technical University in Prague, Czech Republic

    -Last changed: $Date: 2015-02-13 16:14:07 +0100 (Fri, 13 Feb 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.colors.out/v.colors.out.html grass-7.8.0/vector/v.colors.out/v.colors.out.html --- grass-7.6.1/vector/v.colors.out/v.colors.out.html 2019-03-19 20:04:13.000000000 +0000 +++ grass-7.8.0/vector/v.colors.out/v.colors.out.html 2019-05-18 15:50:05.000000000 +0000 @@ -25,4 +25,4 @@ Martin Landa, Czech Technical University in Prague, Czech Republic -

    Last changed: $Date: 2014-12-09 19:39:37 +0100 (Tue, 09 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.db.connect/main.c grass-7.8.0/vector/v.db.connect/main.c --- grass-7.6.1/vector/v.db.connect/main.c 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/vector/v.db.connect/main.c 2019-06-11 07:26:20.000000000 +0000 @@ -208,6 +208,7 @@ } } /* end print */ else { /* columns */ + char *database_novar; if ((fi = Vect_get_field2(&Map, field_opt->answer)) == NULL) G_fatal_error(_("Database connection not defined for layer <%s>"), @@ -217,8 +218,10 @@ G_fatal_error(_("Unable to start driver <%s>"), fi->driver); + database_novar = Vect_subst_var(fi->database, &Map); + db_init_handle(&handle); - db_set_handle(&handle, fi->database, NULL); + db_set_handle(&handle, database_novar, NULL); if (db_open_database(driver, &handle) != DB_OK) G_fatal_error(_("Unable to open database <%s> by driver <%s>"), fi->database, fi->driver); @@ -251,6 +254,8 @@ else { if (field_opt->answer && dbtable->answer && dbkey->answer && dbdatabase->answer && dbdriver->answer) { + char *database_novar; + fi = (struct field_info *)G_malloc(sizeof(struct field_info)); fi->name = fieldname; fi->table = dbtable->answer; @@ -258,6 +263,8 @@ fi->database = dbdatabase->answer; fi->driver = dbdriver->answer; + database_novar = Vect_subst_var(fi->database, &Map); + ret = Vect_map_check_dblink(&Map, field, fieldname); G_debug(3, "Vect_map_check_dblink = %d", ret); if (ret == 1) { @@ -269,16 +276,13 @@ dbColumn *column; if (db_table_exists - (dbdriver->answer, dbdatabase->answer, + (dbdriver->answer, database_novar, dbtable->answer) < 1) G_fatal_error(_("Table <%s> does not exist in database <%s>"), - dbtable->answer, - dbdatabase->answer); + dbtable->answer, database_novar); driver = db_start_driver_open_database(fi->driver, - Vect_subst_var - (fi->database, - &Map)); + database_novar); if (!driver) G_fatal_error(_("Unable to start driver <%s>"), dbdriver->answer); @@ -309,7 +313,7 @@ } else { /* field not yet defined, add new field */ if (db_table_exists - (dbdriver->answer, dbdatabase->answer, + (dbdriver->answer, database_novar, dbtable->answer) < 1) G_warning(_("Table <%s> does not exist in database <%s>"), dbtable->answer, dbdatabase->answer); @@ -323,9 +327,7 @@ dbtable->answer, input); driver = db_start_driver_open_database(fi->driver, - Vect_subst_var - (fi->database, - &Map)); + database_novar); if (!driver) G_fatal_error(_("Unable to open database <%s> by driver <%s>"), diff -Nru grass-7.6.1/vector/v.db.connect/v.db.connect.html grass-7.8.0/vector/v.db.connect/v.db.connect.html --- grass-7.6.1/vector/v.db.connect/v.db.connect.html 2019-03-19 20:04:00.000000000 +0000 +++ grass-7.8.0/vector/v.db.connect/v.db.connect.html 2019-05-22 21:47:51.000000000 +0000 @@ -208,4 +208,4 @@ Radim Blazek, ITC-Irst, Trento, Italy -

    Last changed: $Date: 2018-11-22 07:43:56 +0100 (Thu, 22 Nov 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.db.select/testsuite/test_v_db_select.py grass-7.8.0/vector/v.db.select/testsuite/test_v_db_select.py --- grass-7.6.1/vector/v.db.select/testsuite/test_v_db_select.py 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.db.select/testsuite/test_v_db_select.py 2019-06-03 20:34:21.000000000 +0000 @@ -14,7 +14,7 @@ from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule -out_group = """CZab +out_group = u"""CZab CZam CZba CZbb @@ -153,12 +153,12 @@ bz """ -out_where = """1076|366545504|324050.96875|1077|1076|Zwe|366545512.376|324050.97237 +out_where = u"""1076|366545504|324050.96875|1077|1076|Zwe|366545512.376|324050.97237 1123|1288.555298|254.393951|1124|1123|Zwe|1288.546525|254.393964 1290|63600420|109186.835938|1291|1290|Zwe|63600422.4739|109186.832069 """ -out_sep = """1076,366545504,324050.96875,1077,1076,Zwe,366545512.376,324050.97237 +out_sep = u"""1076,366545504,324050.96875,1077,1076,Zwe,366545512.376,324050.97237 1123,1288.555298,254.393951,1124,1123,Zwe,1288.546525,254.393964 1290,63600420,109186.835938,1291,1290,Zwe,63600422.4739,109186.832069 """ diff -Nru grass-7.6.1/vector/v.db.select/v.db.select.html grass-7.8.0/vector/v.db.select/v.db.select.html --- grass-7.6.1/vector/v.db.select/v.db.select.html 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.db.select/v.db.select.html 2019-05-18 15:50:05.000000000 +0000 @@ -140,4 +140,4 @@ Group option added by Luca Delucchi, Fondazione Edmund Mach, Trento, Italy (2015/12) -

    Last changed: $Date: 2016-10-27 23:20:55 +0200 (Thu, 27 Oct 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.decimate/v.decimate.html grass-7.8.0/vector/v.decimate/v.decimate.html --- grass-7.6.1/vector/v.decimate/v.decimate.html 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.decimate/v.decimate.html 2019-05-18 15:50:05.000000000 +0000 @@ -135,4 +135,4 @@ Vaclav Petras, NCSU OSGeoREL -

    Last changed: $Date: 2015-10-01 03:55:00 +0200 (Thu, 01 Oct 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.delaunay/v.delaunay.html grass-7.8.0/vector/v.delaunay/v.delaunay.html --- grass-7.6.1/vector/v.delaunay/v.delaunay.html 2019-03-19 20:04:22.000000000 +0000 +++ grass-7.8.0/vector/v.delaunay/v.delaunay.html 2019-05-18 15:50:05.000000000 +0000 @@ -39,4 +39,4 @@ Based on "dct" by Geoff Leach, Department of Computer Science, RMIT.

    -Last changed: $Date: 2015-08-10 15:56:03 +0200 (Mon, 10 Aug 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.distance/v.distance.html grass-7.8.0/vector/v.distance/v.distance.html --- grass-7.6.1/vector/v.distance/v.distance.html 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.distance/v.distance.html 2019-05-18 15:50:05.000000000 +0000 @@ -236,4 +236,4 @@ New table without the -p flag: Huidae Cho

    -Last changed: $Date: 2017-02-19 22:47:27 +0100 (Sun, 19 Feb 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.drape/v.drape.html grass-7.8.0/vector/v.drape/v.drape.html --- grass-7.6.1/vector/v.drape/v.drape.html 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.drape/v.drape.html 2019-05-18 15:50:05.000000000 +0000 @@ -75,4 +75,4 @@ Prague, Czech Republic

    -Last changed: $Date: 2014-11-28 17:22:17 +0100 (Fri, 28 Nov 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/vectorintro.html grass-7.8.0/vector/vectorintro.html --- grass-7.6.1/vector/vectorintro.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/vectorintro.html 2019-06-27 08:06:44.000000000 +0000 @@ -10,6 +10,17 @@ site ID, geologic type, etc.). As a general rule these can exist in 2D or 3D space and are independent of the GIS's computation region. +

    Attribute management

    + +The default database driver used by GRASS GIS 7 is SQLite. GRASS GIS +handles multiattribute vector data by default. The db.* set of +commands provides basic SQL support for attribute management, while the +v.db.* set of commands operates on vector maps. + +

    +Note: The list of available database drivers can vary in various binary +distributions of GRASS GIS, for details see +SQL support in GRASS GIS.

    Vector data import and export

    @@ -199,10 +210,12 @@
  • SQL support
    -The DBF driver provides only very limited SQL support (as DBF is not an -SQL DB) while the other DBMS backends (such as SQLite, PostgreSQL, MySQL -etc) provide full SQL support since the SQL commands are sent directly -to the DBMI. SQL commands can be directly executed with +By default, SQLite is used as the attribute database. Also other +supported DBMS backends (such as SQLite, PostgreSQL, MySQL etc.) +provide full SQL support as the SQL statements are sent directly +to GRASS' database management interface (DBMI). Only the DBF driver +provides just very limited SQL support (as DBF is not an SQL DB). +SQL commands can be directly executed with db.execute, db.select and the other db.* modules.
  • diff -Nru grass-7.6.1/vector/v.edit/v.edit.html grass-7.8.0/vector/v.edit/v.edit.html --- grass-7.6.1/vector/v.edit/v.edit.html 2019-03-19 20:04:01.000000000 +0000 +++ grass-7.8.0/vector/v.edit/v.edit.html 2019-05-18 15:50:05.000000000 +0000 @@ -452,4 +452,4 @@ Major update by Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy

    -Last changed: $Date: 2017-02-16 07:49:21 +0100 (Thu, 16 Feb 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.external/v.external.html grass-7.8.0/vector/v.external/v.external.html --- grass-7.6.1/vector/v.external/v.external.html 2019-03-19 20:04:02.000000000 +0000 +++ grass-7.8.0/vector/v.external/v.external.html 2019-05-18 15:50:05.000000000 +0000 @@ -156,4 +156,4 @@ Technical University in Prague, Czech Republic

    -Last changed: $Date: 2017-11-18 09:59:58 +0100 (Sat, 18 Nov 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.external.out/v.external.out.html grass-7.8.0/vector/v.external.out/v.external.out.html --- grass-7.6.1/vector/v.external.out/v.external.out.html 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.external.out/v.external.out.html 2019-05-18 15:50:05.000000000 +0000 @@ -205,4 +205,4 @@ (development supported by Fondazione Edmund Mach and Comune di Trento, Italy)

    -Last changed: $Date: 2015-11-24 09:07:58 +0100 (Tue, 24 Nov 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.extract/testsuite/test_extract.py grass-7.8.0/vector/v.extract/testsuite/test_extract.py --- grass-7.6.1/vector/v.extract/testsuite/test_extract.py 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.extract/testsuite/test_extract.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -""" -Name: v.extract test -Purpose: Tests v.extract and its flags/options. - -Author: Sunveer Singh, Google Code-in 2017 -Copyright: (C) 2017 by Sunveer Singh and the GRASS Development Team -Licence: This program is free software under the GNU General Public - License (>=v2). Read the file COPYING that comes with GRASS - for details. -""" -import os -from grass.gunittest.case import TestCase -from grass.gunittest.gmodules import SimpleModule -from grass.script.core import read_command - -TABLE_1="""cat|MAJORRDS_|ROAD_NAME|MULTILANE|PROPYEAR|OBJECTID|SHAPE_LEN -1|1|NC-50|no|0|1|4825.369405 -2|2|NC-50|no|0|2|14392.589058 -3|3|NC-98|no|0|3|3212.981242 -4|4|NC-50|no|0|4|13391.907552 -""" -TABLE_2="""cat|onemap_pro|PERIMETER|GEOL250_|GEOL250_ID|GEO_NAME|SHAPE_area|SHAPE_len -1|963738.75|4083.97998|2|1|Zml|963738.608571|4083.979839 -2|22189124|26628.261719|3|2|Zmf|22189123.2296|26628.261112 -3|579286.875|3335.55835|4|3|Zml|579286.829631|3335.557182 -4|20225526|33253|5|4|Zml|20225526.6368|33253.000508 -5|450650720|181803.765625|6|5|Ybgg|450650731.029|181803.776199 -""" - -TABLE_3="""cat|MAJORRDS_|ROAD_NAME|MULTILANE|PROPYEAR|OBJECTID|SHAPE_LEN -1|1|NC-50|no|0|1|4825.369405 -2|2|NC-50|no|0|2|14392.589058 -3|3|NC-98|no|0|3|3212.981242 -4|4|NC-50|no|0|4|13391.907552 -5|5|NC-98|no|0|5|7196.001495 -6|6||no|0|6|10185.513951 -7|7|US-1|yes|0|7|13655.438596 -8|8||no|0|8|797.901095 -9|9|NC-98|no|0|9|14772.176241 -""" -class TestRasterreport(TestCase): - input="roadsmajor" - output="testoutput" - geology='geology' - - @classmethod - def setUpClass(cls): - cls.use_temp_region() - - @classmethod - def tearDownClass(cls): - cls.del_temp_region() - - def tearDown(cls): - cls.runModule('g.remove', flags='f', type='vector', name=cls.output) - - def test_flagd(self): - """Testing flag d """ - self.assertModule('v.extract', input=self.input, output=self.output, cats="1,2,3,4") - category = read_command('v.db.select', map=self.output, - separator='pipe') - self.assertEqual(first=TABLE_1.replace('\n', os.linesep), - second=category, - msg="Attribute table has wrong entries") - - def test_cats2(self): - """Testing cats=2 """ - self.assertModule('v.extract', input=self.geology, output=self.output, flags='d', cats="1,2,3,4,5") - category = read_command('v.db.select', map=self.output, - separator='pipe') - self.assertEqual(first=TABLE_2.replace('\n', os.linesep), - second=category, - msg="Attribute table has wrong entries") - - def test_flagt(self): - """Testing Falg T""" - self.assertModule('v.extract', input=self.input, output=self.output, flags='t', cats=1 ) - - def test_flatr(self): - """Testing flag r """ - self.assertModule('v.extract', input=self.geology, output=self.output, flags='r', cats=1 ) - - def test_where(self): - """Testing where""" - self.assertModule('v.extract', input=self.input, output=self.output, flags='d', - where="cat < 10") - category = read_command('v.db.select', map=self.output, - separator='pipe') - self.assertEqual(first=TABLE_3.replace('\n', os.linesep), - second=category, - msg="Attribute table has wrong entries") -if __name__ == '__main__': - from grass.gunittest.main import test - test() diff -Nru grass-7.6.1/vector/v.extract/testsuite/test_v_extract.py grass-7.8.0/vector/v.extract/testsuite/test_v_extract.py --- grass-7.6.1/vector/v.extract/testsuite/test_v_extract.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/vector/v.extract/testsuite/test_v_extract.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,94 @@ +""" +Name: v.extract test +Purpose: Tests v.extract and its flags/options. + +Author: Sunveer Singh, Google Code-in 2017 +Copyright: (C) 2017 by Sunveer Singh and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" +import os +from grass.gunittest.case import TestCase +from grass.gunittest.gmodules import SimpleModule +from grass.script.core import read_command + +TABLE_1="""cat|MAJORRDS_|ROAD_NAME|MULTILANE|PROPYEAR|OBJECTID|SHAPE_LEN +1|1|NC-50|no|0|1|4825.369405 +2|2|NC-50|no|0|2|14392.589058 +3|3|NC-98|no|0|3|3212.981242 +4|4|NC-50|no|0|4|13391.907552 +""" +TABLE_2="""cat|onemap_pro|PERIMETER|GEOL250_|GEOL250_ID|GEO_NAME|SHAPE_area|SHAPE_len +1|963738.75|4083.97998|2|1|Zml|963738.608571|4083.979839 +2|22189124|26628.261719|3|2|Zmf|22189123.2296|26628.261112 +3|579286.875|3335.55835|4|3|Zml|579286.829631|3335.557182 +4|20225526|33253|5|4|Zml|20225526.6368|33253.000508 +5|450650720|181803.765625|6|5|Ybgg|450650731.029|181803.776199 +""" + +TABLE_3="""cat|MAJORRDS_|ROAD_NAME|MULTILANE|PROPYEAR|OBJECTID|SHAPE_LEN +1|1|NC-50|no|0|1|4825.369405 +2|2|NC-50|no|0|2|14392.589058 +3|3|NC-98|no|0|3|3212.981242 +4|4|NC-50|no|0|4|13391.907552 +5|5|NC-98|no|0|5|7196.001495 +6|6||no|0|6|10185.513951 +7|7|US-1|yes|0|7|13655.438596 +8|8||no|0|8|797.901095 +9|9|NC-98|no|0|9|14772.176241 +""" +class TestRasterreport(TestCase): + input="roadsmajor" + output="testoutput" + geology='geology' + + @classmethod + def setUpClass(cls): + cls.use_temp_region() + + @classmethod + def tearDownClass(cls): + cls.del_temp_region() + + def tearDown(cls): + cls.runModule('g.remove', flags='f', type='vector', name=cls.output) + + def test_flagd(self): + """Testing flag d """ + self.assertModule('v.extract', input=self.input, output=self.output, cats="1,2,3,4") + category = read_command('v.db.select', map=self.output, + separator='pipe') + self.assertEqual(first=TABLE_1.replace('\n', os.linesep), + second=category, + msg="Attribute table has wrong entries") + + def test_cats2(self): + """Testing cats=2 """ + self.assertModule('v.extract', input=self.geology, output=self.output, flags='d', cats="1,2,3,4,5") + category = read_command('v.db.select', map=self.output, + separator='pipe') + self.assertEqual(first=TABLE_2.replace('\n', os.linesep), + second=category, + msg="Attribute table has wrong entries") + + def test_flagt(self): + """Testing Falg T""" + self.assertModule('v.extract', input=self.input, output=self.output, flags='t', cats=1 ) + + def test_flatr(self): + """Testing flag r """ + self.assertModule('v.extract', input=self.geology, output=self.output, flags='r', cats=1 ) + + def test_where(self): + """Testing where""" + self.assertModule('v.extract', input=self.input, output=self.output, flags='d', + where="cat < 10") + category = read_command('v.db.select', map=self.output, + separator='pipe') + self.assertEqual(first=TABLE_3.replace('\n', os.linesep), + second=category, + msg="Attribute table has wrong entries") +if __name__ == '__main__': + from grass.gunittest.main import test + test() diff -Nru grass-7.6.1/vector/v.extract/v.extract.html grass-7.8.0/vector/v.extract/v.extract.html --- grass-7.6.1/vector/v.extract/v.extract.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.extract/v.extract.html 2019-05-22 21:47:51.000000000 +0000 @@ -130,4 +130,4 @@ R.L. Glenn, USDA, SCS, NHQ-CGIS
    GRASS 6 port by Radim Blazek -

    Last changed: $Date: 2018-05-04 16:47:55 +0200 (Fri, 04 May 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.extrude/v.extrude.html grass-7.8.0/vector/v.extrude/v.extrude.html --- grass-7.6.1/vector/v.extrude/v.extrude.html 2019-03-19 20:04:11.000000000 +0000 +++ grass-7.8.0/vector/v.extrude/v.extrude.html 2019-05-18 15:50:05.000000000 +0000 @@ -82,4 +82,4 @@ Italy and Czech Technical University in Prague, Czech Republic

    -Last changed: $Date: 2014-11-28 17:22:17 +0100 (Fri, 28 Nov 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.generalize/displacement.c grass-7.8.0/vector/v.generalize/displacement.c --- grass-7.6.1/vector/v.generalize/displacement.c 2019-03-19 20:04:06.000000000 +0000 +++ grass-7.8.0/vector/v.generalize/displacement.c 2019-06-03 20:34:21.000000000 +0000 @@ -289,7 +289,7 @@ } index = 0; for (i = 1; i <= n_lines; i++) { - int type = Vect_read_line(In, Points, Cats, i); + type = Vect_read_line(In, Points, Cats, i); if (type != GV_LINE || (layer > 0 && !Vect_cats_in_constraint(Cats, layer, cat_list))) { diff -Nru grass-7.6.1/vector/v.generalize/main.c grass-7.8.0/vector/v.generalize/main.c --- grass-7.6.1/vector/v.generalize/main.c 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.generalize/main.c 2019-05-22 21:47:51.000000000 +0000 @@ -358,6 +358,10 @@ if (layer > 0) cat_list = Vect_cats_set_constraint(&In, layer, where_opt->answer, cat_opt->answer); + else if (where_opt->answer || cat_opt->answer) { + G_warning(_("No layer selected, '%s' and '%s' options are ignored"), + where_opt->key, cat_opt->key); + } if (method == DISPLACEMENT) { /* modifies only lines, all other features including boundaries are preserved */ diff -Nru grass-7.6.1/vector/v.generalize/matrix.c grass-7.8.0/vector/v.generalize/matrix.c --- grass-7.6.1/vector/v.generalize/matrix.c 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.generalize/matrix.c 2019-06-03 20:34:21.000000000 +0000 @@ -164,6 +164,7 @@ for (i = 0; i < n; i++) { int found = 0; + double c; if (percents) G_percent(i, n, 1); @@ -177,14 +178,16 @@ } if (!found) return 0; - double c = (double)1.0 / a->a[i][i]; + + c = (double)1.0 / a->a[i][i]; matrix_row_scalar(i, c, a); matrix_row_scalar(i, c, res); for (j = 0; j < n; j++) { if (i == j) continue; - double c = -a->a[j][i]; + + c = -a->a[j][i]; if (c == 0.0) continue; diff -Nru grass-7.6.1/vector/v.generalize/misc.c grass-7.8.0/vector/v.generalize/misc.c --- grass-7.6.1/vector/v.generalize/misc.c 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.generalize/misc.c 2019-06-03 20:34:21.000000000 +0000 @@ -202,7 +202,7 @@ int ai = *(int *)a; int bi = *(int *)b; - return (ai - bi); + return (ai < bi ? -1 : (ai > bi)); } /* check topology corruption by boundary modification diff -Nru grass-7.6.1/vector/v.generalize/network.c grass-7.8.0/vector/v.generalize/network.c --- grass-7.6.1/vector/v.generalize/network.c 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.generalize/network.c 2019-06-03 20:34:21.000000000 +0000 @@ -184,7 +184,7 @@ Vect_reset_list(prev[j]); while (front != back) { - int v, j; + int v; v = queue[front]; comp[i]++; @@ -220,7 +220,7 @@ } memset(betw, 0, sizeof(double) * g.vertices); while (front != back) { - int v, j; + int v; v = queue[front]; front = (front + 1) % g.vertices; diff -Nru grass-7.6.1/vector/v.generalize/simplification.c grass-7.8.0/vector/v.generalize/simplification.c --- grass-7.6.1/vector/v.generalize/simplification.c 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.generalize/simplification.c 2019-06-03 20:34:21.000000000 +0000 @@ -70,7 +70,6 @@ int maxindex = -1; double maxdist = -1; - int i; for (i = first + 1; i <= last - 1; i++) { /* Find the furthermost point between first, last */ double px, py, pz, pdist; @@ -87,7 +86,6 @@ } } - if (maxindex == -1 || maxdist <= thresh) { /* no points between or all point are inside the threshold */ index[icount++] = last; } @@ -98,11 +96,8 @@ stack[top++] = first; stack[top++] = maxindex; } - - } - Points->n_points = icount; /* finally, select only points marked in the algorithm */ @@ -114,6 +109,7 @@ G_free(stack); G_free(index); + return (Points->n_points); } diff -Nru grass-7.6.1/vector/v.generalize/v.generalize.html grass-7.8.0/vector/v.generalize/v.generalize.html --- grass-7.6.1/vector/v.generalize/v.generalize.html 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.generalize/v.generalize.html 2019-05-22 21:47:51.000000000 +0000 @@ -1,9 +1,16 @@

    DESCRIPTION

    -v.generalize -is a module for the generalization of GRASS vector maps. This module -consists of algorithms for line simplification, line smoothing, -network generalization and displacement (new methods may be added later). +v.generalize is a module for the generalization of GRASS +vector maps. This module consists of algorithms for line +simplification, line smoothing, network generalization and displacement +(new methods may be added later). + +

    +The cats and where options are used only if a layer +> 0 is specified, otherwise, those options are ignored. Be aware +that the default is layer=-1, meaning that all layers are +processed, ignoring the cats and where options. +

    If type=area is selected, boundaries of selected areas will be generalized, and the options cats, where, and layer will be used to select areas. @@ -359,4 +366,4 @@ Wolf Bergenheim, Mentor
    Partial rewrite: Markus Metz -

    Last changed: $Date: 2017-05-07 22:50:11 +0200 (Sun, 07 May 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.hull/v.hull.html grass-7.8.0/vector/v.hull/v.hull.html --- grass-7.6.1/vector/v.hull/v.hull.html 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.hull/v.hull.html 2019-05-18 15:50:05.000000000 +0000 @@ -73,4 +73,4 @@ Benjamin Ducke, CAU Kiel (3D hull support)
    Martin Landa, CTU in Prague, Czech Republic (vector lines support) -

    Last changed: $Date: 2018-02-22 20:14:51 +0100 (Thu, 22 Feb 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.in.ascii/local_proto.h grass-7.8.0/vector/v.in.ascii/local_proto.h --- grass-7.6.1/vector/v.in.ascii/local_proto.h 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.in.ascii/local_proto.h 2019-09-04 13:16:01.000000000 +0000 @@ -6,7 +6,7 @@ #include int points_analyse(FILE *, FILE *, char *, char *, int *, int *, int *, int *, int **, - int **, int, int, int, int, int, int, int); + char ***, int **, int, int, int, int, int, int, int); int points_to_bin(FILE *, int, struct Map_info *, dbDriver *, char *, char *, char *, int, int *, int, int, int, int, int); diff -Nru grass-7.6.1/vector/v.in.ascii/main.c grass-7.8.0/vector/v.in.ascii/main.c --- grass-7.6.1/vector/v.in.ascii/main.c 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.in.ascii/main.c 2019-09-04 13:16:01.000000000 +0000 @@ -104,7 +104,7 @@ tdelim_opt = G_define_standard_option(G_OPT_F_SEP); tdelim_opt->key = "text"; tdelim_opt->label = "Text delimiter"; - tdelim_opt->answer = "doublequote"; + tdelim_opt->answer = NULL; tdelim_opt->description = _("Special characters: doublequote, singlequote, none"); tdelim_opt->guisection = _("Input format"); @@ -261,6 +261,7 @@ if (format == GV_ASCII_FORMAT_POINT) { int i, rowlen, ncols, minncols, *coltype, *coltype2, *collen, nrows; + char **colsample; int n_int = 0, n_double = 0, n_string = 0; char buf[1000]; struct field_info *Fi; @@ -277,7 +278,7 @@ unlink(tmp); points_analyse(ascii, tmpascii, fs, td, &rowlen, &ncols, &minncols, - &nrows, &coltype, &collen, skip_lines, xcol, ycol, + &nrows, &coltype, &colsample, &collen, skip_lines, xcol, ycol, zcol, catcol, region_flag->answer, ignore_flag->answer); G_verbose_message(_("Maximum input row length: %d"), rowlen); @@ -312,16 +313,20 @@ } if (coltype[xcol] == DB_C_TYPE_STRING) { - G_fatal_error(_("'%s' column is not of number type"), "x"); + G_fatal_error(_("'%s' column is not of number type, " + "encountered: '%s'"), "x", colsample[xcol]); } if (coltype[ycol] == DB_C_TYPE_STRING) { - G_fatal_error(_("'%s' column is not of number type"), "y"); + G_fatal_error(_("'%s' column is not of number type, " + "encountered: '%s'"), "y", colsample[ycol]); } if (zcol >= 0 && coltype[zcol] == DB_C_TYPE_STRING) { - G_fatal_error(_("'%s' column is not of number type"), "z"); + G_fatal_error(_("'%s' column is not of number type, " + "encountered: '%s'"), "z", colsample[zcol]); } if (catcol >= 0 && coltype[catcol] == DB_C_TYPE_STRING) { - G_fatal_error(_("'%s' column is not of number type"), "cat"); + G_fatal_error(_("'%s' column is not of number type, " + "encountered: '%s'"), "cat", colsample[catcol]); } /* Create table */ @@ -467,12 +472,14 @@ switch (coltype[i]) { case DB_C_TYPE_INT: - if (ctype == DB_C_TYPE_DOUBLE) { + /* coltype=int and colsample=NULL indicate, + * an empty column, so we don't report anything. */ + if (ctype == DB_C_TYPE_DOUBLE && colsample[i]) { G_warning(_("Column number %d <%s> defined as double " "has only integer values"), i + 1, db_get_column_name(column)); } - else if (ctype == DB_C_TYPE_STRING) { + else if (ctype == DB_C_TYPE_STRING && colsample[i]) { G_warning(_("Column number %d <%s> defined as string " "has only integer values"), i + 1, db_get_column_name(column)); @@ -481,8 +488,10 @@ case DB_C_TYPE_DOUBLE: if (ctype == DB_C_TYPE_INT) { G_fatal_error(_("Column number %d <%s> defined as integer " - "has double values"), i + 1, - db_get_column_name(column)); + "has double values, encountered: '%s'"), + i + 1, + db_get_column_name(column), + colsample[i]); } else if (ctype == DB_C_TYPE_STRING) { G_warning(_("Column number %d <%s> defined as string " @@ -493,13 +502,15 @@ case DB_C_TYPE_STRING: if (ctype == DB_C_TYPE_INT) { G_fatal_error(_("Column number %d <%s> defined as integer " - "has string values"), i + 1, - db_get_column_name(column)); + "has string values, encountered: '%s'"), + i + 1, db_get_column_name(column), + colsample[i]); } else if (ctype == DB_C_TYPE_DOUBLE) { G_fatal_error(_("Column number %d <%s> defined as double " - "has string values"), i + 1, - db_get_column_name(column)); + "has string values, encountered: '%s'"), + i + 1, db_get_column_name(column), + colsample[i]); } if (length < collen[i]) { G_fatal_error(_("Length of column %d <%s> (%d) is less than " diff -Nru grass-7.6.1/vector/v.in.ascii/points.c grass-7.8.0/vector/v.in.ascii/points.c --- grass-7.6.1/vector/v.in.ascii/points.c 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.in.ascii/points.c 2019-09-04 13:16:01.000000000 +0000 @@ -48,12 +48,17 @@ * minncolumns: minimum number of columns * nrows: number of rows * column_type: column types + * column_sample: values which was used to decide the type or NULLs * column_length: column lengths (string only) + * + * If the who whole column is empty, column_sample will contain NULL + * for that given column. */ int points_analyse(FILE * ascii_in, FILE * ascii, char *fs, char *td, int *rowlength, int *ncolumns, int *minncolumns, - int *nrows, int **column_type, int **column_length, + int *nrows, int **column_type, char ***column_sample, + int **column_length, int skip_lines, int xcol, int ycol, int zcol, int catcol, int region_flag, int ignore_flag) { @@ -64,6 +69,7 @@ int ncols = 0; /* number of columns */ int minncols = -1; int *coltype = NULL; /* column types */ + char **colsample = NULL; /* column samples */ int *collen = NULL; /* column lengths */ char **tokens; int ntokens; /* number of tokens */ @@ -131,6 +137,7 @@ row, buf); } else { + G_warning(_("Expected %d columns, found %d columns"), ncols, ntokens); G_fatal_error(_("Broken row %d: '%s'"), row, buf); } } @@ -141,6 +148,7 @@ continue; } else { + G_warning(_("ntokens: %d, xcol: %d, ycol: %d, zcol: %d"), xcol, ycol, zcol); G_fatal_error(_("Broken row %d: '%s'"), row, buf); } } @@ -151,9 +159,12 @@ if (ntokens > ncols) { coltype = (int *)G_realloc(coltype, ntokens * sizeof(int)); + colsample = (char **)G_realloc(colsample, ntokens * sizeof(char *)); collen = (int *)G_realloc(collen, ntokens * sizeof(int)); for (i = ncols; i < ntokens; i++) { coltype[i] = DB_C_TYPE_INT; /* default type */ + /* We store a value later if column is not empty. */ + colsample[i] = NULL; collen[i] = 0; } ncols = ntokens; @@ -244,6 +255,9 @@ len = strlen(tokens[i]); /* do not guess column type for missing values */ + /* continue here ensures that we preserve NULLs in + * colsample for (completely) empty columns (which, however, + * should probably default to string rather than int). */ if (len == 0) continue; @@ -252,16 +266,30 @@ is_double(tokens[i])); if (is_int(tokens[i])) { + /* We store the first encountered value for integers. + * Rest is for consistency. */ + if (!colsample[i] || coltype[i] != DB_C_TYPE_INT) { + G_free(colsample[i]); + colsample[i] = G_store(tokens[i]); + } continue; /* integer */ } if (is_double(tokens[i])) { /* double */ if (coltype[i] == DB_C_TYPE_INT) { coltype[i] = DB_C_TYPE_DOUBLE; + G_free(colsample[i]); + colsample[i] = G_store(tokens[i]); } continue; } /* string */ - coltype[i] = DB_C_TYPE_STRING; + if (coltype[i] != DB_C_TYPE_STRING) { + /* Only set type if not already set to store the field + * only once and to show the first encountered item. */ + coltype[i] = DB_C_TYPE_STRING; + G_free(colsample[i]); + colsample[i] = G_store(tokens[i]); + } if (len > collen[i]) collen[i] = len; } @@ -287,6 +315,7 @@ *ncolumns = ncols; *minncolumns = minncols; *column_type = coltype; + *column_sample = colsample; *column_length = collen; *nrows = row - 1; /* including skipped lines */ diff -Nru grass-7.6.1/vector/v.in.ascii/v.in.ascii.html grass-7.8.0/vector/v.in.ascii/v.in.ascii.html --- grass-7.6.1/vector/v.in.ascii/v.in.ascii.html 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.in.ascii/v.in.ascii.html 2019-07-30 08:32:08.000000000 +0000 @@ -103,7 +103,9 @@

    Example 1a) - standard format mode

    Sample ASCII polygon vector map for 'standard' format mode. -The two areas will be assigned categories 20 and 21. +The two areas will be assigned categories 20 and 21. For details on the structure of +standard format data files see the second reference at the bottom of this page. +

     echo "ORGANIZATION: GRASS Development Team
     DIGIT DATE:   1/9/2005
    @@ -306,4 +308,4 @@
     Research Laboratory
    Radim Blazek, ITC-Irst, Trento, Italy -

    Last changed: $Date: 2016-01-13 10:18:55 +0100 (Wed, 13 Jan 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.in.db/v.in.db.html grass-7.8.0/vector/v.in.db/v.in.db.html --- grass-7.6.1/vector/v.in.db/v.in.db.html 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.in.db/v.in.db.html 2019-05-18 15:50:05.000000000 +0000 @@ -150,4 +150,4 @@ Various updates for GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic

    -Last changed: $Date: 2017-01-02 12:33:18 +0100 (Mon, 02 Jan 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.in.dwg/v.in.dwg.html grass-7.8.0/vector/v.in.dwg/v.in.dwg.html --- grass-7.6.1/vector/v.in.dwg/v.in.dwg.html 2019-03-19 20:04:11.000000000 +0000 +++ grass-7.8.0/vector/v.in.dwg/v.in.dwg.html 2019-05-18 15:50:05.000000000 +0000 @@ -31,4 +31,4 @@ Radim Blazek, ITC-Irst, Trento, Italy -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.in.dxf/v.in.dxf.html grass-7.8.0/vector/v.in.dxf/v.in.dxf.html --- grass-7.6.1/vector/v.in.dxf/v.in.dxf.html 2019-03-19 20:04:02.000000000 +0000 +++ grass-7.8.0/vector/v.in.dxf/v.in.dxf.html 2019-05-18 15:50:05.000000000 +0000 @@ -69,4 +69,4 @@

    Updated for GRASS 6 and 3D support. Huidae Cho, 3/2006
    With minor additions by Benjamin Ducke (Oxford Archaeology), 4/2009 -

    Last changed: $Date: 2013-02-15 23:08:41 +0100 (Fri, 15 Feb 2013) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.info/v.info.html grass-7.8.0/vector/v.info/v.info.html --- grass-7.6.1/vector/v.info/v.info.html 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.info/v.info.html 2019-08-11 09:05:20.000000000 +0000 @@ -128,7 +128,7 @@

    PYTHON

    -See Python +See Python Scripting Library for more info.

    Note: The Python tab in the wxGUI can be used for entering the @@ -156,4 +156,4 @@ Level 1 support by Markus Metz
    Updated to GRASS 7 by Martin Landa, CTU in Prague, Czech Republic -

    Last changed: $Date: 2018-08-31 17:01:15 +0200 (Fri, 31 Aug 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.in.lidar/testsuite/basic_test.py grass-7.8.0/vector/v.in.lidar/testsuite/basic_test.py --- grass-7.6.1/vector/v.in.lidar/testsuite/basic_test.py 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.in.lidar/testsuite/basic_test.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -""" -Name: decimation_test -Purpose: v.in.lidar decimation test - -Author: Vaclav Petras -Copyright: (C) 2015 by Vaclav Petras and the GRASS Development Team -Licence: This program is free software under the GNU General Public - License (>=v2). Read the file COPYING that comes with GRASS - for details. -""" - -import os -from grass.gunittest.case import TestCase -from grass.gunittest.main import test - - -class BasicTest(TestCase): - """Test case for watershed module - - This tests expects v.random and v.out.lidar to work properly. - """ - - # Setup variables to be used for outputs - vector_points = 'vinlidar_basic_original' - imported_points = 'vinlidar_basic_imported' - las_file = 'vinlidar_basic_points.las' - npoints = 300 - - @classmethod - def setUpClass(cls): - """Ensures expected computational region and generated data""" - cls.use_temp_region() - cls.runModule('g.region', n=20, s=10, e=25, w=15, res=1) - cls.runModule('v.random', flags='zb', output=cls.vector_points, - npoints=cls.npoints, zmin=200, zmax=500, seed=100) - cls.runModule('v.out.lidar', input=cls.vector_points, - output=cls.las_file) - - @classmethod - def tearDownClass(cls): - """Remove the temporary region and generated data""" - cls.runModule('g.remove', flags='f', type='vector', - name=cls.vector_points) - if os.path.isfile(cls.las_file): - os.remove(cls.las_file) - cls.del_temp_region() - - def tearDown(self): - """Remove the outputs created by the import - - This is executed after each test run. - """ - self.runModule('g.remove', flags='f', type='vector', - name=self.imported_points) - - def test_output_identical(self): - """Test to see if the standard outputs are created""" - self.assertModule('v.in.lidar', input=self.las_file, - output=self.imported_points, flags='bt') - self.assertVectorExists(self.imported_points) - self.assertVectorEqualsVector( - actual=self.imported_points, - reference=self.vector_points, - digits=2, precision=.01) - - -if __name__ == '__main__': - test() diff -Nru grass-7.6.1/vector/v.in.lidar/testsuite/decimation_test.py grass-7.8.0/vector/v.in.lidar/testsuite/decimation_test.py --- grass-7.6.1/vector/v.in.lidar/testsuite/decimation_test.py 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.in.lidar/testsuite/decimation_test.py 2019-06-03 20:34:21.000000000 +0000 @@ -134,7 +134,7 @@ self.assertVectorExists(self.imported_points) self.assertVectorFitsTopoInfo( vector=self.imported_points, - reference=dict(points=(self.npoints - 105) / 10)) + reference=dict(points=int((self.npoints - 105) / 10))) def test_limit_skip(self): """Test to see if the outputs are created""" diff -Nru grass-7.6.1/vector/v.in.lidar/testsuite/filter_test.py grass-7.8.0/vector/v.in.lidar/testsuite/filter_test.py --- grass-7.6.1/vector/v.in.lidar/testsuite/filter_test.py 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.in.lidar/testsuite/filter_test.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,208 +0,0 @@ -""" -Name: decimation_test -Purpose: v.in.lidar decimation test - -Author: Vaclav Petras -Copyright: (C) 2015 by Vaclav Petras and the GRASS Development Team -Licence: This program is free software under the GNU General Public - License (>=v2). Read the file COPYING that comes with GRASS - for details. -""" - -import os -from grass.gunittest.case import TestCase -from grass.gunittest.main import test - - -POINTS = """\ -17.46938776,18.67346939,143,1,1,2 -20.93877551,17.44897959,125,1,1,2 -18.89795918,14.18367347,130,1,1,3 -15.91836735,10.67346939,126,1,1,3 -21.26530612,11.04081633,128,1,2,3 -22.24489796,13.89795918,123,2,2,3 -23.79591837,17.12244898,151,1,2,3 -17.2244898,16.34693878,124,2,2,4 -17.14285714,14.10204082,134,1,3,4 -19.87755102,11.81632653,146,2,3,4 -18.48979592,11.48979592,140.6,2,3,4 -21.26530612,15.73469388,147,3,3,5 -21.18367347,19.32653061,138,1,3,5 -23.91836735,18.83673469,144,2,3,5 -23.51020408,13.65306122,143,3,3,5 -23.55102041,11.32653061,123,1,4,5 -18.41009273,14.51618034,140.4,2,4,5 -22.13996161,17.2278263,147,3,4,5 -21.41013052,11.05432488,132,4,4,5 -""" - - -class FilterTest(TestCase): - """Test case for filter and selection options - - This tests expects v.random and v.out.lidar to work properly. - """ - - # Setup variables to be used for outputs - vector_points = 'vinlidar_filters_original' - imported_points = 'vinlidar_filters_imported' - las_file = 'vinlidar_filters_points.las' - npoints = 300 - - @classmethod - def setUpClass(cls): - """Ensures expected computational region and generated data""" - cls.use_temp_region() - cls.runModule('g.region', n=20, s=10, e=25, w=15, res=1) - cls.runModule('v.in.ascii', input='-', stdin_=POINTS, - flags='z', z=3, cat=0, separator='comma', - output=cls.vector_points, - columns="x double precision, y double precision," - " z double precision, return_n integer," - " n_returns integer, class_n integer") - cls.runModule('v.out.lidar', - input=cls.vector_points, layer=1, - output=cls.las_file, - return_column='return_n', - n_returns_column='n_returns', - class_column='class_n') - - @classmethod - def tearDownClass(cls): - """Remove the temporary region and generated data""" - cls.runModule('g.remove', flags='f', type='vector', - name=cls.vector_points) - if os.path.isfile(cls.las_file): - os.remove(cls.las_file) - cls.del_temp_region() - - def tearDown(self): - """Remove the outputs created by the import - - This is executed after each test run. - """ - self.runModule('g.remove', flags='f', type='vector', - name=self.imported_points) - - def test_no_filter(self): - """Test to see if the standard outputs are created - - This shows if the inpute data are as expected. - """ - self.assertModule('v.in.lidar', input=self.las_file, - output=self.imported_points, flags='bt') - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=19)) - - def return_filter(self, name, npoints): - """Mid return filter test""" - self.assertModule('v.in.lidar', input=self.las_file, - output=self.imported_points, flags='bt', - return_filter=name) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=npoints)) - - def test_first_return_filter(self): - """First return filter test""" - self.return_filter('first', 9) - - def test_mid_return_filter(self): - """Mid return filter test""" - self.return_filter('mid', 5) - - def test_last_return_filter(self): - """Last return filter test""" - self.return_filter('last', 5) - - def class_filter(self, class_n, npoints): - """Actual code for testing class filter""" - self.assertModule('v.in.lidar', input=self.las_file, - output=self.imported_points, flags='bt', - class_filter=class_n) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=npoints)) - - def test_class_2_filter(self): - """Test to filter classes""" - self.class_filter(2, 2) - - def test_class_3_filter(self): - """Test to filter classes""" - self.class_filter(3, 5) - - def test_class_4_filter(self): - """Test to filter classes""" - self.class_filter(4, 4) - - def test_class_5_filter(self): - """Test to filter classes""" - self.class_filter(5, 8) - - def return_and_class_filter(self, return_name, class_n, npoints): - """Return and class filter combined test code""" - self.assertModule('v.in.lidar', input=self.las_file, - output=self.imported_points, flags='bt', - return_filter=return_name, class_filter=class_n) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=npoints)) - - def test_first_return_and_class_filter(self): - """Combined test for return and class""" - self.return_and_class_filter('first', 2, 2) - - def test_last_return_and_class_filter(self): - """Combined test for return and class""" - self.return_and_class_filter('last', 5, 3) - - def zrange_filter(self, zrange, npoints): - """Actual code for zrange option test""" - self.assertModule('v.in.lidar', input=self.las_file, - output=self.imported_points, flags='bt', - zrange=zrange) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=npoints)) - - def test_zrange_filter(self): - """Test zrange option""" - self.zrange_filter((130.1, 139.9), 3) - - def test_non_int_zrange_filter(self): - """Test zrange option with float number - - One test point has z right under and one other right above the min. - """ - self.zrange_filter((140.5, 900), 8) - - def test_zrange_and_class_filter(self): - """zrange and class_filter option combined test""" - self.assertModule('v.in.lidar', input=self.las_file, - output=self.imported_points, flags='bt', - zrange=(141, 900), class_filter=5) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=4)) - - def test_zrange_and_return_filter(self): - """zrange and class_filter option combined test""" - self.assertModule('v.in.lidar', input=self.las_file, - output=self.imported_points, flags='bt', - zrange=(141, 900), return_filter='last') - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=2)) - - -if __name__ == '__main__': - test() diff -Nru grass-7.6.1/vector/v.in.lidar/testsuite/mask_test.py grass-7.8.0/vector/v.in.lidar/testsuite/mask_test.py --- grass-7.6.1/vector/v.in.lidar/testsuite/mask_test.py 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.in.lidar/testsuite/mask_test.py 2019-06-03 20:34:21.000000000 +0000 @@ -145,7 +145,7 @@ def test_inverted_mask(self): """Test to see if the standard outputs are created""" self.assertModule('v.in.lidar', input=self.las_file, - output=self.imported_points, flags='bti', + output=self.imported_points, flags='btu', mask=self.areas) self.assertVectorExists(self.imported_points) self.assertVectorFitsTopoInfo( diff -Nru grass-7.6.1/vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py grass-7.8.0/vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py --- grass-7.6.1/vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/vector/v.in.lidar/testsuite/test_v_in_lidar_basic.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,68 @@ +""" +Name: decimation_test +Purpose: v.in.lidar decimation test + +Author: Vaclav Petras +Copyright: (C) 2015 by Vaclav Petras and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" + +import os +from grass.gunittest.case import TestCase +from grass.gunittest.main import test + + +class BasicTest(TestCase): + """Test case for watershed module + + This tests expects v.random and v.out.lidar to work properly. + """ + + # Setup variables to be used for outputs + vector_points = 'vinlidar_basic_original' + imported_points = 'vinlidar_basic_imported' + las_file = 'vinlidar_basic_points.las' + npoints = 300 + + @classmethod + def setUpClass(cls): + """Ensures expected computational region and generated data""" + cls.use_temp_region() + cls.runModule('g.region', n=20, s=10, e=25, w=15, res=1) + cls.runModule('v.random', flags='zb', output=cls.vector_points, + npoints=cls.npoints, zmin=200, zmax=500, seed=100) + cls.runModule('v.out.lidar', input=cls.vector_points, + output=cls.las_file) + + @classmethod + def tearDownClass(cls): + """Remove the temporary region and generated data""" + cls.runModule('g.remove', flags='f', type='vector', + name=cls.vector_points) + if os.path.isfile(cls.las_file): + os.remove(cls.las_file) + cls.del_temp_region() + + def tearDown(self): + """Remove the outputs created by the import + + This is executed after each test run. + """ + self.runModule('g.remove', flags='f', type='vector', + name=self.imported_points) + + def test_output_identical(self): + """Test to see if the standard outputs are created""" + self.assertModule('v.in.lidar', input=self.las_file, + output=self.imported_points, flags='bt') + self.assertVectorExists(self.imported_points) + self.assertVectorEqualsVector( + actual=self.imported_points, + reference=self.vector_points, + digits=2, precision=.01) + + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py grass-7.8.0/vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py --- grass-7.6.1/vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/vector/v.in.lidar/testsuite/test_v_in_lidar_filter.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,208 @@ +""" +Name: decimation_test +Purpose: v.in.lidar decimation test + +Author: Vaclav Petras +Copyright: (C) 2015 by Vaclav Petras and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" + +import os +from grass.gunittest.case import TestCase +from grass.gunittest.main import test + + +POINTS = """\ +17.46938776,18.67346939,143,1,1,2 +20.93877551,17.44897959,125,1,1,2 +18.89795918,14.18367347,130,1,1,3 +15.91836735,10.67346939,126,1,1,3 +21.26530612,11.04081633,128,1,2,3 +22.24489796,13.89795918,123,2,2,3 +23.79591837,17.12244898,151,1,2,3 +17.2244898,16.34693878,124,2,2,4 +17.14285714,14.10204082,134,1,3,4 +19.87755102,11.81632653,146,2,3,4 +18.48979592,11.48979592,140.6,2,3,4 +21.26530612,15.73469388,147,3,3,5 +21.18367347,19.32653061,138,1,3,5 +23.91836735,18.83673469,144,2,3,5 +23.51020408,13.65306122,143,3,3,5 +23.55102041,11.32653061,123,1,4,5 +18.41009273,14.51618034,140.4,2,4,5 +22.13996161,17.2278263,147,3,4,5 +21.41013052,11.05432488,132,4,4,5 +""" + + +class FilterTest(TestCase): + """Test case for filter and selection options + + This tests expects v.random and v.out.lidar to work properly. + """ + + # Setup variables to be used for outputs + vector_points = 'vinlidar_filters_original' + imported_points = 'vinlidar_filters_imported' + las_file = 'vinlidar_filters_points.las' + npoints = 300 + + @classmethod + def setUpClass(cls): + """Ensures expected computational region and generated data""" + cls.use_temp_region() + cls.runModule('g.region', n=20, s=10, e=25, w=15, res=1) + cls.runModule('v.in.ascii', input='-', stdin_=POINTS, + flags='z', z=3, cat=0, separator='comma', + output=cls.vector_points, + columns="x double precision, y double precision," + " z double precision, return_n integer," + " n_returns integer, class_n integer") + cls.runModule('v.out.lidar', + input=cls.vector_points, layer=1, + output=cls.las_file, + return_column='return_n', + n_returns_column='n_returns', + class_column='class_n') + + @classmethod + def tearDownClass(cls): + """Remove the temporary region and generated data""" + cls.runModule('g.remove', flags='f', type='vector', + name=cls.vector_points) + if os.path.isfile(cls.las_file): + os.remove(cls.las_file) + cls.del_temp_region() + + def tearDown(self): + """Remove the outputs created by the import + + This is executed after each test run. + """ + self.runModule('g.remove', flags='f', type='vector', + name=self.imported_points) + + def test_no_filter(self): + """Test to see if the standard outputs are created + + This shows if the inpute data are as expected. + """ + self.assertModule('v.in.lidar', input=self.las_file, + output=self.imported_points, flags='bt') + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=19)) + + def return_filter(self, name, npoints): + """Mid return filter test""" + self.assertModule('v.in.lidar', input=self.las_file, + output=self.imported_points, flags='bt', + return_filter=name) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=npoints)) + + def test_first_return_filter(self): + """First return filter test""" + self.return_filter('first', 9) + + def test_mid_return_filter(self): + """Mid return filter test""" + self.return_filter('mid', 5) + + def test_last_return_filter(self): + """Last return filter test""" + self.return_filter('last', 5) + + def class_filter(self, class_n, npoints): + """Actual code for testing class filter""" + self.assertModule('v.in.lidar', input=self.las_file, + output=self.imported_points, flags='bt', + class_filter=class_n) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=npoints)) + + def test_class_2_filter(self): + """Test to filter classes""" + self.class_filter(2, 2) + + def test_class_3_filter(self): + """Test to filter classes""" + self.class_filter(3, 5) + + def test_class_4_filter(self): + """Test to filter classes""" + self.class_filter(4, 4) + + def test_class_5_filter(self): + """Test to filter classes""" + self.class_filter(5, 8) + + def return_and_class_filter(self, return_name, class_n, npoints): + """Return and class filter combined test code""" + self.assertModule('v.in.lidar', input=self.las_file, + output=self.imported_points, flags='bt', + return_filter=return_name, class_filter=class_n) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=npoints)) + + def test_first_return_and_class_filter(self): + """Combined test for return and class""" + self.return_and_class_filter('first', 2, 2) + + def test_last_return_and_class_filter(self): + """Combined test for return and class""" + self.return_and_class_filter('last', 5, 3) + + def zrange_filter(self, zrange, npoints): + """Actual code for zrange option test""" + self.assertModule('v.in.lidar', input=self.las_file, + output=self.imported_points, flags='bt', + zrange=zrange) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=npoints)) + + def test_zrange_filter(self): + """Test zrange option""" + self.zrange_filter((130.1, 139.9), 3) + + def test_non_int_zrange_filter(self): + """Test zrange option with float number + + One test point has z right under and one other right above the min. + """ + self.zrange_filter((140.5, 900), 8) + + def test_zrange_and_class_filter(self): + """zrange and class_filter option combined test""" + self.assertModule('v.in.lidar', input=self.las_file, + output=self.imported_points, flags='bt', + zrange=(141, 900), class_filter=5) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=4)) + + def test_zrange_and_return_filter(self): + """zrange and class_filter option combined test""" + self.assertModule('v.in.lidar', input=self.las_file, + output=self.imported_points, flags='bt', + zrange=(141, 900), return_filter='last') + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=2)) + + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/vector/v.in.lidar/v.in.lidar.html grass-7.8.0/vector/v.in.lidar/v.in.lidar.html --- grass-7.6.1/vector/v.in.lidar/v.in.lidar.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.in.lidar/v.in.lidar.html 2019-05-18 15:50:05.000000000 +0000 @@ -149,4 +149,4 @@
    based on v.in.ogr by various authors -

    Last changed: $Date: 2016-08-23 04:00:20 +0200 (Tue, 23 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.in.ogr/main.c grass-7.8.0/vector/v.in.ogr/main.c --- grass-7.6.1/vector/v.in.ogr/main.c 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.in.ogr/main.c 2019-05-22 21:47:51.000000000 +0000 @@ -2192,10 +2192,28 @@ yminl[layer] = oExt.MinY; ymaxl[layer] = oExt.MaxY; + /* OGR extents are unreliable, + * sometimes excluding valid features + * reason: converting double to float or %.6g and back + * -> expand a bit */ + G_debug(2, "xmin old: %.15g", xminl[layer]); + xminl[layer] = xminl[layer] - fabs(xminl[layer] * 2.0e-6); + G_debug(2, "xmin new: %.15g", xminl[layer]); + + G_debug(2, "xmax old: %.15g", xmaxl[layer]); + xmaxl[layer] = xmaxl[layer] + fabs(xmaxl[layer] * 2.0e-6); + G_debug(2, "xmax new: %.15g", xmaxl[layer]); + + G_debug(2, "ymin old: %.15g", yminl[layer]); + yminl[layer] = yminl[layer] - fabs(yminl[layer] * 2.0e-6); + G_debug(2, "ymin new: %.15g", yminl[layer]); + + G_debug(2, "ymax old: %.15g", ymaxl[layer]); + ymaxl[layer] = ymaxl[layer] + fabs(ymaxl[layer] * 2.0e-6); + G_debug(2, "ymax new: %.15g", ymaxl[layer]); + /* use OGR extents if possible, needed to skip corrupted data * in OGR dsn/layer */ - /* BUT: OGR extents are unreliable, - * sometimes excluding valid features */ have_ogr_extent[layer] = 1; } /* OGR_L_GetExtent(): diff -Nru grass-7.6.1/vector/v.in.ogr/v.in.ogr.html grass-7.8.0/vector/v.in.ogr/v.in.ogr.html --- grass-7.6.1/vector/v.in.ogr/v.in.ogr.html 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.in.ogr/v.in.ogr.html 2019-06-27 08:06:44.000000000 +0000 @@ -302,7 +302,7 @@

    OpenStreetMap (OSM)

    -OSM data are available in +OSM data are available in .osm (XML based) and .pbf (optimized binary) formats. The .pbf format is recommended because file sizes are smaller. The OSM driver will categorize features into 5 layers : @@ -344,7 +344,7 @@

    Import of OSM data requires a configuration file, defined with the OSM_CONFIG_FILE configuration option. In the data folder of the GDAL -distribution, you can find a osmconf.ini file +distribution, you can find a osmconf.ini file that can be customized to fit your needs. See OSM map features for keys and their values. You should set "other_tags=no" to @@ -494,4 +494,4 @@ Multiple geometry columns support by Martin Landa, OSGeoREL, Czech Technical University in Prague, Czech Republic

    -Last changed: $Date: 2018-10-14 13:08:03 +0200 (Sun, 14 Oct 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.in.pdal/main.cpp grass-7.8.0/vector/v.in.pdal/main.cpp --- grass-7.6.1/vector/v.in.pdal/main.cpp 2019-03-19 20:04:12.000000000 +0000 +++ grass-7.8.0/vector/v.in.pdal/main.cpp 2019-06-03 20:34:21.000000000 +0000 @@ -15,12 +15,13 @@ **************************************************************/ #include -#include +#include #include #include #include #include #include +#include extern "C" { @@ -73,7 +74,7 @@ void pdal_point_to_grass(struct Map_info *output_vector, struct line_pnts *points, struct line_cats *cats, - pdal::PointViewPtr point_view, pdal::PointId idx, + pdal::PointRef& point, struct GLidarLayers *layers, int cat, pdal::Dimension::Id dim_to_use_as_z) { @@ -81,9 +82,9 @@ Vect_reset_cats(cats); using namespace pdal::Dimension; - double x = point_view->getFieldAs(Id::X, idx); - double y = point_view->getFieldAs(Id::Y, idx); - double z = point_view->getFieldAs(dim_to_use_as_z, idx); + double x = point.getFieldAs(Id::X); + double y = point.getFieldAs(Id::Y); + double z = point.getFieldAs(dim_to_use_as_z); /* TODO: optimize for case with no layers, by adding * and if to skip all the other ifs */ @@ -91,19 +92,19 @@ Vect_cat_set(cats, layers->id_layer, cat); } if (layers->return_layer) { - int return_n = point_view->getFieldAs(Id::ReturnNumber, idx); - int n_returns = point_view->getFieldAs(Id::NumberOfReturns, idx); + int return_n = point.getFieldAs(Id::ReturnNumber); + int n_returns = point.getFieldAs(Id::NumberOfReturns); int return_c = return_to_cat(return_n, n_returns); Vect_cat_set(cats, layers->return_layer, return_c); } if (layers->class_layer) { Vect_cat_set(cats, layers->class_layer, - point_view->getFieldAs(Id::Classification, idx)); + point.getFieldAs(Id::Classification)); } if (layers->rgb_layer) { - int red = point_view->getFieldAs(Id::Red, idx); - int green = point_view->getFieldAs(Id::Green, idx); - int blue = point_view->getFieldAs(Id::Blue, idx); + int red = point.getFieldAs(Id::Red); + int green = point.getFieldAs(Id::Green); + int blue = point.getFieldAs(Id::Blue); int rgb = red; rgb = (rgb << 8) + green; rgb = (rgb << 8) + blue; @@ -402,9 +403,13 @@ G_fatal_error("Cannot determine input file type of <%s>", in_opt->answer); - pdal::Option las_opt("filename", in_opt->answer); pdal::Options las_opts; + pdal::Option las_opt("filename", in_opt->answer); las_opts.add(las_opt); + // if storing of cat is requested, limit the reader count + pdal::Option count_opt("count", GV_CAT_MAX); + if (layers.id_layer) + las_opts.add(count_opt); // TODO: free reader // using plain pointer because we need to keep the last stage pointer pdal::Stage * reader = factory.createStage(pdal_read_driver); @@ -466,7 +471,7 @@ } if (height_filter_flag->answer) { - // TODO: we should test with if (point_view->hasDim(Id::Classification)) + // TODO: we should test with if (point_layout->hasDim(Id::Classification)) // but we don't have the info yet // TODO: free this or change pointer type to shared pdal::Stage * height_stage(factory.createStage("filters.height")); @@ -477,8 +482,13 @@ last_stage = height_stage; } - pdal::PointTable point_table; - last_stage->prepare(point_table); + pdal::StreamCallbackFilter stream_filter; + stream_filter.setInput(*last_stage); + // there is no difference between 1 and 10k points in memory + // consumption, so using 10k in case it is faster for some cases + pdal::point_count_t point_table_capacity = 10000; + pdal::FixedPointTable point_table(point_table_capacity); + stream_filter.prepare(point_table); // getting projection is possible only after prepare if (over_flag->answer) { @@ -499,8 +509,9 @@ } G_important_message(_("Running PDAL algorithms...")); - pdal::PointViewSet point_view_set = last_stage->execute(point_table); - pdal::PointViewPtr point_view = *point_view_set.begin(); + + // get the layout to see the dimensions + pdal::PointLayoutPtr point_layout = point_table.layout(); // TODO: test also z // TODO: the falses for filters should be perhaps fatal error @@ -508,8 +519,8 @@ // update layers we are writing based on what is in the data // update usage of our filters as well - if (point_view->hasDim(pdal::Dimension::Id::ReturnNumber) && - point_view->hasDim(pdal::Dimension::Id::NumberOfReturns)) { + if (point_layout->hasDim(pdal::Dimension::Id::ReturnNumber) && + point_layout->hasDim(pdal::Dimension::Id::NumberOfReturns)) { use_return_filter = true; } else { @@ -521,7 +532,7 @@ use_return_filter = false; } - if (point_view->hasDim(pdal::Dimension::Id::Classification)) { + if (point_layout->hasDim(pdal::Dimension::Id::Classification)) { use_class_filter = true; } else { @@ -533,9 +544,9 @@ use_class_filter = false; } - if (!(point_view->hasDim(pdal::Dimension::Id::Red) && - point_view->hasDim(pdal::Dimension::Id::Green) && - point_view->hasDim(pdal::Dimension::Id::Blue))) { + if (!(point_layout->hasDim(pdal::Dimension::Id::Red) && + point_layout->hasDim(pdal::Dimension::Id::Green) && + point_layout->hasDim(pdal::Dimension::Id::Blue))) { if (layers.rgb_layer) { layers.rgb_layer = 0; G_warning(_("Cannot store RGB colors because the input" @@ -554,7 +565,8 @@ // height is stored as a new attribute if (height_filter_flag->answer) { - dim_to_use_as_z = point_view->layout()->findDim("Height"); + // TODO: This needs to be reviewed on Height vs Elevation + dim_to_use_as_z = point_layout->findDim("Height"); if (dim_to_use_as_z == pdal::Dimension::Id::Unknown) G_fatal_error(_("Cannot identify the height dimension" " (probably something changed in PDAL)")); @@ -562,7 +574,7 @@ // this is just for sure, we test the individual dimensions before // TODO: should we test Z explicitly as well? - if (!point_view->hasDim(dim_to_use_as_z)) + if (!point_layout->hasDim(dim_to_use_as_z)) G_fatal_error(_("Dataset doesn't have requested dimension '%s'" " with ID %d (possibly a programming error)"), pdal::Dimension::name(dim_to_use_as_z).c_str(), @@ -579,54 +591,68 @@ int cat = 1; bool cat_max_reached = false; - for (pdal::PointId idx = 0; idx < point_view->size(); ++idx) { + // define callback + // Capture all values for reading by value, except for the ones + // for writing which we capture by reference. + // False is the proper value to return as a PDAL filter when + // point is filtered out (and should not be used by next stage). + // Here the return value does not matter unless we split this into + // two or more stages. + auto cb = [=, &cat, &cat_max_reached, + &n_outside, &zrange_filtered, &n_filtered, + &n_class_filtered, &class_filter, &return_filter_struct, + &output_vector, &layers](pdal::PointRef& point) -> bool + { // TODO: avoid duplication of reading the attributes here and when writing if needed - double x = point_view->getFieldAs(pdal::Dimension::Id::X, idx); - double y = point_view->getFieldAs(pdal::Dimension::Id::Y, idx); - double z = point_view->getFieldAs(dim_to_use_as_z, idx); + double x = point.getFieldAs(pdal::Dimension::Id::X); + double y = point.getFieldAs(pdal::Dimension::Id::Y); + double z = point.getFieldAs(dim_to_use_as_z); if (use_spatial_filter) { if (x < xmin || x > xmax || y < ymin || y > ymax) { n_outside++; - continue; + return false; } } if (use_zrange) { if (z < zrange_min || z > zrange_max) { zrange_filtered++; - continue; + return false; } } if (use_return_filter) { int return_n = - point_view->getFieldAs(pdal::Dimension::Id::ReturnNumber, idx); + point.getFieldAs(pdal::Dimension::Id::ReturnNumber); int n_returns = - point_view->getFieldAs(pdal::Dimension::Id::NumberOfReturns, idx); + point.getFieldAs(pdal::Dimension::Id::NumberOfReturns); if (return_filter_is_out (&return_filter_struct, return_n, n_returns)) { n_filtered++; - continue; + return false; } } if (use_class_filter) { int point_class = - point_view->getFieldAs(pdal::Dimension::Id::Classification, idx); + point.getFieldAs(pdal::Dimension::Id::Classification); if (class_filter_is_out(&class_filter, point_class)) { n_class_filtered++; - continue; + return false; } } - pdal_point_to_grass(&output_vector, points, cats, point_view, - idx, &layers, cat, dim_to_use_as_z); + pdal_point_to_grass(&output_vector, points, cats, point, + &layers, cat, dim_to_use_as_z); if (layers.id_layer) { - // TODO: perhaps it would be better to use the max cat afterwards - if (cat == GV_CAT_MAX) { - cat_max_reached = true; - break; - } + // we limit the count of imported points, so we don't + // need to check if we reached GV_CAT_MAX cat++; } - } + return true; + }; + + // set the callback and run the actual processing + stream_filter.setCallback(cb); + stream_filter.execute(point_table); + // not building topology by default Vect_close(&output_vector); } diff -Nru grass-7.6.1/vector/v.in.pdal/testsuite/basic_test.py grass-7.8.0/vector/v.in.pdal/testsuite/basic_test.py --- grass-7.6.1/vector/v.in.pdal/testsuite/basic_test.py 2019-03-19 20:04:11.000000000 +0000 +++ grass-7.8.0/vector/v.in.pdal/testsuite/basic_test.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -""" -Name: basic_test -Purpose: v.in.pdal basic functionality test - -Author: Vaclav Petras -Copyright: (C) 2015 by Vaclav Petras and the GRASS Development Team -Licence: This program is free software under the GNU General Public - License (>=v2). Read the file COPYING that comes with GRASS - for details. -""" - -import os -from grass.gunittest.case import TestCase -from grass.gunittest.main import test - - -class BasicTest(TestCase): - """Test case for watershed module - - This tests expects v.random and v.out.lidar to work properly. - """ - - # Setup variables to be used for outputs - vector_generated = 'vinlidar_basic_generated' - vector_points = 'vinlidar_basic_original' - imported_points = 'vinlidar_basic_imported' - las_file = 'vinlidar_basic_points.las' - npoints = 300 - - @classmethod - def setUpClass(cls): - """Ensures expected computational region and generated data""" - cls.use_temp_region() - cls.runModule('g.region', n=20, s=10, e=25, w=15, res=1) - cls.runModule('v.random', flags='zb', output=cls.vector_generated, - npoints=cls.npoints, zmin=200, zmax=500, seed=100) - cls.runModule('v.category', input=cls.vector_generated, - output=cls.vector_points, option='del', cat=-1) - cls.runModule('v.out.lidar', input=cls.vector_points, - output=cls.las_file) - - @classmethod - def tearDownClass(cls): - """Remove the temporary region and generated data""" - cls.runModule('g.remove', flags='f', type='vector', - name=(cls.vector_points, cls.vector_generated)) - if os.path.isfile(cls.las_file): - os.remove(cls.las_file) - cls.del_temp_region() - - def tearDown(self): - """Remove the outputs created by the import - - This is executed after each test run. - """ - self.runModule('g.remove', flags='f', type='vector', - name=self.imported_points) - - def test_same_data(self): - """Test to see if the standard outputs are created""" - self.assertModule('v.in.pdal', input=self.las_file, flags='c', - output=self.imported_points) - self.assertVectorExists(self.imported_points) - self.assertVectorEqualsVector( - actual=self.imported_points, - reference=self.vector_points, - digits=2, precision=.01) - - -if __name__ == '__main__': - test() diff -Nru grass-7.6.1/vector/v.in.pdal/testsuite/filter_test.py grass-7.8.0/vector/v.in.pdal/testsuite/filter_test.py --- grass-7.6.1/vector/v.in.pdal/testsuite/filter_test.py 2019-03-19 20:04:11.000000000 +0000 +++ grass-7.8.0/vector/v.in.pdal/testsuite/filter_test.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,208 +0,0 @@ -""" -Name: filter_test -Purpose: v.in.pdal test if various filters and selections - -Author: Vaclav Petras -Copyright: (C) 2015 by Vaclav Petras and the GRASS Development Team -Licence: This program is free software under the GNU General Public - License (>=v2). Read the file COPYING that comes with GRASS - for details. -""" - -import os -from grass.gunittest.case import TestCase -from grass.gunittest.main import test - - -POINTS = """\ -17.46938776,18.67346939,143,1,1,2 -20.93877551,17.44897959,125,1,1,2 -18.89795918,14.18367347,130,1,1,3 -15.91836735,10.67346939,126,1,1,3 -21.26530612,11.04081633,128,1,2,3 -22.24489796,13.89795918,123,2,2,3 -23.79591837,17.12244898,151,1,2,3 -17.2244898,16.34693878,124,2,2,4 -17.14285714,14.10204082,134,1,3,4 -19.87755102,11.81632653,146,2,3,4 -18.48979592,11.48979592,140.6,2,3,4 -21.26530612,15.73469388,147,3,3,5 -21.18367347,19.32653061,138,1,3,5 -23.91836735,18.83673469,144,2,3,5 -23.51020408,13.65306122,143,3,3,5 -23.55102041,11.32653061,123,1,4,5 -18.41009273,14.51618034,140.4,2,4,5 -22.13996161,17.2278263,147,3,4,5 -21.41013052,11.05432488,132,4,4,5 -""" - - -class FilterTest(TestCase): - """Test case for filter and selection options - - This tests expects v.random and v.out.lidar to work properly. - """ - - # Setup variables to be used for outputs - vector_points = 'vinlidar_filters_original' - imported_points = 'vinlidar_filters_imported' - las_file = 'vinlidar_filters_points.las' - npoints = 300 - - @classmethod - def setUpClass(cls): - """Ensures expected computational region and generated data""" - cls.use_temp_region() - cls.runModule('g.region', n=20, s=10, e=25, w=15, res=1) - cls.runModule('v.in.ascii', input='-', stdin_=POINTS, - flags='z', z=3, cat=0, separator='comma', - output=cls.vector_points, - columns="x double precision, y double precision," - " z double precision, return_n integer," - " n_returns integer, class_n integer") - cls.runModule('v.out.lidar', - input=cls.vector_points, layer=1, - output=cls.las_file, - return_column='return_n', - n_returns_column='n_returns', - class_column='class_n') - - @classmethod - def tearDownClass(cls): - """Remove the temporary region and generated data""" - cls.runModule('g.remove', flags='f', type='vector', - name=cls.vector_points) - if os.path.isfile(cls.las_file): - os.remove(cls.las_file) - cls.del_temp_region() - - def tearDown(self): - """Remove the outputs created by the import - - This is executed after each test run. - """ - self.runModule('g.remove', flags='f', type='vector', - name=self.imported_points) - - def test_no_filter(self): - """Test to see if the standard outputs are created - - This shows if the inpute data are as expected. - """ - self.assertModule('v.in.pdal', input=self.las_file, - output=self.imported_points) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=19)) - - def return_filter(self, name, npoints): - """Mid return filter test""" - self.assertModule('v.in.pdal', input=self.las_file, - output=self.imported_points, - return_filter=name) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=npoints)) - - def test_first_return_filter(self): - """First return filter test""" - self.return_filter('first', 9) - - def test_mid_return_filter(self): - """Mid return filter test""" - self.return_filter('mid', 5) - - def test_last_return_filter(self): - """Last return filter test""" - self.return_filter('last', 5) - - def class_filter(self, class_n, npoints): - """Actual code for testing class filter""" - self.assertModule('v.in.pdal', input=self.las_file, - output=self.imported_points, - class_filter=class_n) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=npoints)) - - def test_class_2_filter(self): - """Test to filter classes""" - self.class_filter(2, 2) - - def test_class_3_filter(self): - """Test to filter classes""" - self.class_filter(3, 5) - - def test_class_4_filter(self): - """Test to filter classes""" - self.class_filter(4, 4) - - def test_class_5_filter(self): - """Test to filter classes""" - self.class_filter(5, 8) - - def return_and_class_filter(self, return_name, class_n, npoints): - """Return and class filter combined test code""" - self.assertModule('v.in.pdal', input=self.las_file, - output=self.imported_points, - return_filter=return_name, class_filter=class_n) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=npoints)) - - def test_first_return_and_class_filter(self): - """Combined test for return and class""" - self.return_and_class_filter('first', 2, 2) - - def test_last_return_and_class_filter(self): - """Combined test for return and class""" - self.return_and_class_filter('last', 5, 3) - - def zrange_filter(self, zrange, npoints): - """Actual code for zrange option test""" - self.assertModule('v.in.pdal', input=self.las_file, - output=self.imported_points, - zrange=zrange) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=npoints)) - - def test_zrange_filter(self): - """Test zrange option""" - self.zrange_filter((130.1, 139.9), 3) - - def test_non_int_zrange_filter(self): - """Test zrange option with float number - - One test point has z right under and one other right above the min. - """ - self.zrange_filter((140.5, 900), 8) - - def test_zrange_and_class_filter(self): - """zrange and class_filter option combined test""" - self.assertModule('v.in.pdal', input=self.las_file, - output=self.imported_points, - zrange=(141, 900), class_filter=5) - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=4)) - - def test_zrange_and_return_filter(self): - """zrange and class_filter option combined test""" - self.assertModule('v.in.pdal', input=self.las_file, - output=self.imported_points, - zrange=(141, 900), return_filter='last') - self.assertVectorExists(self.imported_points) - self.assertVectorFitsTopoInfo( - vector=self.imported_points, - reference=dict(points=2)) - - -if __name__ == '__main__': - test() diff -Nru grass-7.6.1/vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py grass-7.8.0/vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py --- grass-7.6.1/vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/vector/v.in.pdal/testsuite/test_v_in_pdal_basic.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,73 @@ +""" +Name: basic_test +Purpose: v.in.pdal basic functionality test + +Author: Vaclav Petras +Copyright: (C) 2015 by Vaclav Petras and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" + +import os +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +import unittest +from grass.script import shutil_which + +class BasicTest(TestCase): + """Test case for watershed module + + This tests expects v.random and v.out.lidar to work properly. + """ + + # Setup variables to be used for outputs + vector_generated = 'vinlidar_basic_generated' + vector_points = 'vinlidar_basic_original' + imported_points = 'vinlidar_basic_imported' + las_file = 'vinlidar_basic_points.las' + npoints = 300 + + @classmethod + def setUpClass(cls): + """Ensures expected computational region and generated data""" + cls.use_temp_region() + cls.runModule('g.region', n=20, s=10, e=25, w=15, res=1) + cls.runModule('v.random', flags='zb', output=cls.vector_generated, + npoints=cls.npoints, zmin=200, zmax=500, seed=100) + cls.runModule('v.category', input=cls.vector_generated, + output=cls.vector_points, option='del', cat=-1) + cls.runModule('v.out.lidar', input=cls.vector_points, + output=cls.las_file) + + @classmethod + def tearDownClass(cls): + """Remove the temporary region and generated data""" + cls.runModule('g.remove', flags='f', type='vector', + name=(cls.vector_points, cls.vector_generated)) + if os.path.isfile(cls.las_file): + os.remove(cls.las_file) + cls.del_temp_region() + + def tearDown(self): + """Remove the outputs created by the import + + This is executed after each test run. + """ + self.runModule('g.remove', flags='f', type='vector', + name=self.imported_points) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_same_data(self): + """Test to see if the standard outputs are created""" + self.assertModule('v.in.pdal', input=self.las_file, flags='c', + output=self.imported_points) + self.assertVectorExists(self.imported_points) + self.assertVectorEqualsVector( + actual=self.imported_points, + reference=self.vector_points, + digits=2, precision=.01) + + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py grass-7.8.0/vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py --- grass-7.6.1/vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py 1970-01-01 00:00:00.000000000 +0000 +++ grass-7.8.0/vector/v.in.pdal/testsuite/test_v_in_pdal_filter.py 2019-06-03 20:34:21.000000000 +0000 @@ -0,0 +1,227 @@ +""" +Name: filter_test +Purpose: v.in.pdal test if various filters and selections + +Author: Vaclav Petras +Copyright: (C) 2015 by Vaclav Petras and the GRASS Development Team +Licence: This program is free software under the GNU General Public + License (>=v2). Read the file COPYING that comes with GRASS + for details. +""" + +import os +from grass.gunittest.case import TestCase +from grass.gunittest.main import test +import unittest +from grass.script import shutil_which + +POINTS = """\ +17.46938776,18.67346939,143,1,1,2 +20.93877551,17.44897959,125,1,1,2 +18.89795918,14.18367347,130,1,1,3 +15.91836735,10.67346939,126,1,1,3 +21.26530612,11.04081633,128,1,2,3 +22.24489796,13.89795918,123,2,2,3 +23.79591837,17.12244898,151,1,2,3 +17.2244898,16.34693878,124,2,2,4 +17.14285714,14.10204082,134,1,3,4 +19.87755102,11.81632653,146,2,3,4 +18.48979592,11.48979592,140.6,2,3,4 +21.26530612,15.73469388,147,3,3,5 +21.18367347,19.32653061,138,1,3,5 +23.91836735,18.83673469,144,2,3,5 +23.51020408,13.65306122,143,3,3,5 +23.55102041,11.32653061,123,1,4,5 +18.41009273,14.51618034,140.4,2,4,5 +22.13996161,17.2278263,147,3,4,5 +21.41013052,11.05432488,132,4,4,5 +""" + + +class FilterTest(TestCase): + """Test case for filter and selection options + + This tests expects v.random and v.out.lidar to work properly. + """ + + # Setup variables to be used for outputs + vector_points = 'vinlidar_filters_original' + imported_points = 'vinlidar_filters_imported' + las_file = 'vinlidar_filters_points.las' + npoints = 300 + + @classmethod + def setUpClass(cls): + """Ensures expected computational region and generated data""" + cls.use_temp_region() + cls.runModule('g.region', n=20, s=10, e=25, w=15, res=1) + cls.runModule('v.in.ascii', input='-', stdin_=POINTS, + flags='z', z=3, cat=0, separator='comma', + output=cls.vector_points, + columns="x double precision, y double precision," + " z double precision, return_n integer," + " n_returns integer, class_n integer") + cls.runModule('v.out.lidar', + input=cls.vector_points, layer=1, + output=cls.las_file, + return_column='return_n', + n_returns_column='n_returns', + class_column='class_n') + + @classmethod + def tearDownClass(cls): + """Remove the temporary region and generated data""" + cls.runModule('g.remove', flags='f', type='vector', + name=cls.vector_points) + if os.path.isfile(cls.las_file): + os.remove(cls.las_file) + cls.del_temp_region() + + def tearDown(self): + """Remove the outputs created by the import + + This is executed after each test run. + """ + self.runModule('g.remove', flags='f', type='vector', + name=self.imported_points) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_no_filter(self): + """Test to see if the standard outputs are created + + This shows if the inpute data are as expected. + """ + self.assertModule('v.in.pdal', input=self.las_file, + output=self.imported_points) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=19)) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def return_filter(self, name, npoints): + """Mid return filter test""" + self.assertModule('v.in.pdal', input=self.las_file, + output=self.imported_points, + return_filter=name) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=npoints)) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_first_return_filter(self): + """First return filter test""" + self.return_filter('first', 9) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_mid_return_filter(self): + """Mid return filter test""" + self.return_filter('mid', 5) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_last_return_filter(self): + """Last return filter test""" + self.return_filter('last', 5) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def class_filter(self, class_n, npoints): + """Actual code for testing class filter""" + self.assertModule('v.in.pdal', input=self.las_file, + output=self.imported_points, + class_filter=class_n) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=npoints)) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_class_2_filter(self): + """Test to filter classes""" + self.class_filter(2, 2) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_class_3_filter(self): + """Test to filter classes""" + self.class_filter(3, 5) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_class_4_filter(self): + """Test to filter classes""" + self.class_filter(4, 4) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_class_5_filter(self): + """Test to filter classes""" + self.class_filter(5, 8) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def return_and_class_filter(self, return_name, class_n, npoints): + """Return and class filter combined test code""" + self.assertModule('v.in.pdal', input=self.las_file, + output=self.imported_points, + return_filter=return_name, class_filter=class_n) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=npoints)) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_first_return_and_class_filter(self): + """Combined test for return and class""" + self.return_and_class_filter('first', 2, 2) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_last_return_and_class_filter(self): + """Combined test for return and class""" + self.return_and_class_filter('last', 5, 3) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def zrange_filter(self, zrange, npoints): + """Actual code for zrange option test""" + self.assertModule('v.in.pdal', input=self.las_file, + output=self.imported_points, + zrange=zrange) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=npoints)) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_zrange_filter(self): + """Test zrange option""" + self.zrange_filter((130.1, 139.9), 3) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_non_int_zrange_filter(self): + """Test zrange option with float number + + One test point has z right under and one other right above the min. + """ + self.zrange_filter((140.5, 900), 8) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_zrange_and_class_filter(self): + """zrange and class_filter option combined test""" + self.assertModule('v.in.pdal', input=self.las_file, + output=self.imported_points, + zrange=(141, 900), class_filter=5) + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=4)) + + @unittest.skipIf(shutil_which('v.in.pdal') is None, "Cannot find v.in.pdal") + def test_zrange_and_return_filter(self): + """zrange and class_filter option combined test""" + self.assertModule('v.in.pdal', input=self.las_file, + output=self.imported_points, + zrange=(141, 900), return_filter='last') + self.assertVectorExists(self.imported_points) + self.assertVectorFitsTopoInfo( + vector=self.imported_points, + reference=dict(points=2)) + + +if __name__ == '__main__': + test() diff -Nru grass-7.6.1/vector/v.in.pdal/v.in.pdal.html grass-7.8.0/vector/v.in.pdal/v.in.pdal.html --- grass-7.6.1/vector/v.in.pdal/v.in.pdal.html 2019-03-19 20:04:11.000000000 +0000 +++ grass-7.8.0/vector/v.in.pdal/v.in.pdal.html 2019-05-18 15:50:05.000000000 +0000 @@ -58,4 +58,4 @@ Vaclav Petras, NCSU GeoForAll Lab -

    Last changed: $Date: 2016-08-23 04:00:20 +0200 (Tue, 23 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.in.region/v.in.region.html grass-7.8.0/vector/v.in.region/v.in.region.html --- grass-7.6.1/vector/v.in.region/v.in.region.html 2019-03-19 20:04:12.000000000 +0000 +++ grass-7.8.0/vector/v.in.region/v.in.region.html 2019-05-18 15:50:05.000000000 +0000 @@ -9,12 +9,30 @@ region to the raster map to be reprojected with r.proj. + +

    EXAMPLE

    + +The example is based on the North Carolina sample data location. +To create a bounding box vector map based on a raster map, the +computational region is first set to the raster map. Then a +vector bounding box is created based on the actual computational +region (in this case precisely reflecting the pixel geometry of +the raster map), resulting in a new vector polygon: + +
    +g.region raster=soils_Kfactor -p
    +v.in.region output=soils_Kfactor_bbox
    +v.info map=soils_Kfactor_bbox
    +
    + + +

    SEE ALSO

    - g.region, - d.vect, - r.proj +g.region, +r.proj, +v.info

    AUTHOR

    @@ -22,4 +40,4 @@ Radim Blazek

    -Last changed: $Date: 2013-08-11 23:34:24 +0200 (Sun, 11 Aug 2013) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.kcv/v.kcv.html grass-7.8.0/vector/v.kcv/v.kcv.html --- grass-7.6.1/vector/v.kcv/v.kcv.html 2019-03-19 20:04:02.000000000 +0000 +++ grass-7.8.0/vector/v.kcv/v.kcv.html 2019-05-18 15:50:05.000000000 +0000 @@ -67,4 +67,4 @@ Speed-up by Jan Vandrol and Jan Ruzicka (2013)

    -Last changed: $Date: 2014-11-28 17:22:17 +0100 (Fri, 28 Nov 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.kernel/main.c grass-7.8.0/vector/v.kernel/main.c --- grass-7.6.1/vector/v.kernel/main.c 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.kernel/main.c 2019-08-27 11:50:55.000000000 +0000 @@ -91,6 +91,7 @@ DCELL *output_cell = NULL; double sigma, dmax, segmax, netmax, multip; char *tmpstr1, *tmpstr2; + struct History history; double **coordinate; double sigmaOptimal; @@ -606,6 +607,10 @@ G_percent(1, 1, 1); Rast_close(fdout); + + Rast_short_history(out_opt->answer, "raster", &history); + Rast_command_history(&history); + Rast_write_history(out_opt->answer, &history); } G_done_msg(_("Maximum value in output: %e."), multip * gausmax); diff -Nru grass-7.6.1/vector/v.kernel/v.kernel.html grass-7.8.0/vector/v.kernel/v.kernel.html --- grass-7.6.1/vector/v.kernel/v.kernel.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.kernel/v.kernel.html 2019-05-18 15:50:05.000000000 +0000 @@ -69,4 +69,4 @@ Radim Blazek (additional kernel density functions and network part)

    -Last changed: $Date: 2017-04-24 05:25:59 +0200 (Mon, 24 Apr 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.label/v.label.html grass-7.8.0/vector/v.label/v.label.html --- grass-7.6.1/vector/v.label/v.label.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.label/v.label.html 2019-05-18 15:50:05.000000000 +0000 @@ -221,4 +221,4 @@ Radim Blazek (GRASS 6 port)
    Hamish Bowman (enhancements) -

    Last changed: $Date: 2014-12-12 00:12:46 +0100 (Fri, 12 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.label.sa/v.label.sa.html grass-7.8.0/vector/v.label.sa/v.label.sa.html --- grass-7.6.1/vector/v.label.sa/v.label.sa.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.label.sa/v.label.sa.html 2019-05-18 15:50:05.000000000 +0000 @@ -47,5 +47,5 @@

    AUTHOR

    Wolf Bergenheim
    -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.lidar.correction/v.lidar.correction.html grass-7.8.0/vector/v.lidar.correction/v.lidar.correction.html --- grass-7.6.1/vector/v.lidar.correction/v.lidar.correction.html 2019-03-19 20:04:06.000000000 +0000 +++ grass-7.8.0/vector/v.lidar.correction/v.lidar.correction.html 2019-05-18 15:50:05.000000000 +0000 @@ -117,5 +117,5 @@ ISPRS WG III/3 Comparison of Filters report by Sithole, G. and Vosselman, G., 2003. -

    Last changed: $Date: 2017-07-24 23:59:39 +0200 (Mon, 24 Jul 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.lidar.edgedetection/v.lidar.edgedetection.html grass-7.8.0/vector/v.lidar.edgedetection/v.lidar.edgedetection.html --- grass-7.6.1/vector/v.lidar.edgedetection/v.lidar.edgedetection.html 2019-03-19 20:04:12.000000000 +0000 +++ grass-7.8.0/vector/v.lidar.edgedetection/v.lidar.edgedetection.html 2019-05-22 21:47:51.000000000 +0000 @@ -168,4 +168,4 @@ Roberto Antolin and Gonzalo Moreno

    -Last changed: $Date: 2019-01-30 12:02:35 +0100 (Wed, 30 Jan 2019) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.lidar.growing/v.lidar.growing.html grass-7.8.0/vector/v.lidar.growing/v.lidar.growing.html --- grass-7.6.1/vector/v.lidar.growing/v.lidar.growing.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.lidar.growing/v.lidar.growing.html 2019-05-18 15:50:05.000000000 +0000 @@ -92,5 +92,5 @@ report by Sithole, G. and Vosselman, G., 2003.
    -

    Last changed: $Date: 2015-09-08 04:45:01 +0200 (Tue, 08 Sep 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.lrs/lrs.html grass-7.8.0/vector/v.lrs/lrs.html --- grass-7.6.1/vector/v.lrs/lrs.html 2019-03-19 20:04:06.000000000 +0000 +++ grass-7.8.0/vector/v.lrs/lrs.html 2019-05-18 15:50:05.000000000 +0000 @@ -181,4 +181,4 @@ Documentation update (based on above journal article and available fragments): Markus Neteler

    -Last changed: $Date: 2014-04-20 12:47:59 +0200 (Sun, 20 Apr 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.lrs/v.lrs.create/v.lrs.create.html grass-7.8.0/vector/v.lrs/v.lrs.create/v.lrs.create.html --- grass-7.6.1/vector/v.lrs/v.lrs.create/v.lrs.create.html 2019-03-19 20:04:06.000000000 +0000 +++ grass-7.8.0/vector/v.lrs/v.lrs.create/v.lrs.create.html 2019-05-18 15:50:05.000000000 +0000 @@ -154,4 +154,4 @@ Radim Blazek, ITC-irst/MPA Solutions
    Documentation update (based on above journal article and available fragments): Markus Neteler -

    Last changed: $Date: 2015-12-17 15:38:13 +0100 (Thu, 17 Dec 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.lrs/v.lrs.label/v.lrs.label.html grass-7.8.0/vector/v.lrs/v.lrs.label/v.lrs.label.html --- grass-7.6.1/vector/v.lrs/v.lrs.label/v.lrs.label.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.lrs/v.lrs.label/v.lrs.label.html 2019-05-18 15:50:05.000000000 +0000 @@ -33,4 +33,4 @@ Radim Blazek, ITC-irst/MPA Solutions
    Documentation update (based on above journal article and available fragments): Markus Neteler -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.lrs/v.lrs.segment/v.lrs.segment.html grass-7.8.0/vector/v.lrs/v.lrs.segment/v.lrs.segment.html --- grass-7.6.1/vector/v.lrs/v.lrs.segment/v.lrs.segment.html 2019-03-19 20:04:06.000000000 +0000 +++ grass-7.8.0/vector/v.lrs/v.lrs.segment/v.lrs.segment.html 2019-05-18 15:50:05.000000000 +0000 @@ -60,4 +60,4 @@ Radim Blazek

    -Last changed: $Date: 2015-12-17 15:38:13 +0100 (Thu, 17 Dec 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.lrs/v.lrs.where/v.lrs.where.html grass-7.8.0/vector/v.lrs/v.lrs.where/v.lrs.where.html --- grass-7.6.1/vector/v.lrs/v.lrs.where/v.lrs.where.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.lrs/v.lrs.where/v.lrs.where.html 2019-05-18 15:50:05.000000000 +0000 @@ -47,4 +47,4 @@ Radim Blazek, ITC-irst/MPA Solutions
    Documentation update (based on above journal article and available fragments): Markus Neteler -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.mkgrid/local_proto.h grass-7.8.0/vector/v.mkgrid/local_proto.h --- grass-7.6.1/vector/v.mkgrid/local_proto.h 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.mkgrid/local_proto.h 2019-06-03 20:34:21.000000000 +0000 @@ -3,7 +3,7 @@ void rotate(double *, double *, double, double, double); /* write_grid.c */ -int write_grid(struct grid_description *, struct Map_info *, int, int); +int write_grid(struct grid_description *, struct Map_info *, int, int, int); /* hexgrid.c */ int hexgrid(struct grid_description *, struct Map_info *, int, int); diff -Nru grass-7.6.1/vector/v.mkgrid/main.c grass-7.8.0/vector/v.mkgrid/main.c --- grass-7.6.1/vector/v.mkgrid/main.c 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.mkgrid/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -51,8 +51,8 @@ struct Option *vectname, *grid, *coord, *box, *angle, *position_opt, *breaks, *type_opt; struct GModule *module; - struct Flag *hex_flag, *ha_flag; - int otype, ptype, ltype; + struct Flag *hex_flag, *ha_flag, *diag_flag; + int otype, ptype, ltype, diag; char *desc; struct line_pnts *Points; @@ -145,6 +145,13 @@ ha_flag->description = _("Allow asymmetric hexagons"); + diag_flag = G_define_flag(); + diag_flag->key = 'd'; + diag_flag->label = + _("EXPERIMENTAL: Add diagonals to rectangular lines"); + diag_flag->description = + _("Applies only to lines for rectangles"); + if (G_parser(argc, argv)) exit(EXIT_FAILURE); @@ -164,7 +171,13 @@ ptype = (otype & GV_POINTS); ltype = (otype & GV_LINES); - + + diag = (otype == GV_LINE && !hex_flag->answer && diag_flag->answer); + if (diag) { + ptype = 0; + ltype = GV_LINE; + hex_flag->answer = 0; + } /* get the current window */ G_get_window(&window); @@ -366,6 +379,7 @@ db_get_string(&sql)); } } + db_commit_transaction(Driver); } else { if (grid_info.width != grid_info.height) { @@ -410,7 +424,7 @@ if (ltype) { /* create areas */ - write_grid(&grid_info, &Map, nbreaks, ltype); + write_grid(&grid_info, &Map, nbreaks, ltype, diag); } /* Create a grid of label points at the centres of the grid cells */ @@ -466,10 +480,10 @@ attCount++; } } + db_commit_transaction(Driver); G_percent(1, 1, 1); } } - db_commit_transaction(Driver); db_close_database_shutdown_driver(Driver); diff -Nru grass-7.6.1/vector/v.mkgrid/v.mkgrid.html grass-7.8.0/vector/v.mkgrid/v.mkgrid.html --- grass-7.6.1/vector/v.mkgrid/v.mkgrid.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.mkgrid/v.mkgrid.html 2019-05-18 15:50:05.000000000 +0000 @@ -191,4 +191,4 @@ Research Laboratory

    Update for new vectors Radim Blazek 10/2004 -

    Last changed: $Date: 2016-08-23 04:00:20 +0200 (Tue, 23 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.mkgrid/write_grid.c grass-7.8.0/vector/v.mkgrid/write_grid.c --- grass-7.6.1/vector/v.mkgrid/write_grid.c 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.mkgrid/write_grid.c 2019-06-03 20:34:21.000000000 +0000 @@ -31,7 +31,8 @@ return 0; } -int write_grid(struct grid_description *grid_info, struct Map_info *Map, int nbreaks, int out_type) +int write_grid(struct grid_description *grid_info, struct Map_info *Map, + int nbreaks, int out_type, int diag) { int i, k, j; @@ -42,6 +43,7 @@ double width, height; double next_x, next_y; double snext_x, snext_y; + double xdiag, ydiag; double angle, dum; struct line_pnts *Points; @@ -61,8 +63,8 @@ * to make sure that each section of the grid * line is less than half way around the globe */ - x_len = width / (1. * nbreaks + 1); - y_len = height / (1. * nbreaks + 1); + x_len = width / (1. * nbreaks + 1); + y_len = height / (1. * nbreaks + 1); /* write out all the vector lengths (x vectors) of the entire grid */ G_message(_("Writing out vector rows...")); @@ -92,6 +94,19 @@ rotate(&next_x, &dum, grid_info->xo, grid_info->yo, angle); write_vect(x, y, next_x, dum, Map, Points, out_type); + if (diag && i < num_v_rows - 1) { + xdiag = snext_x; + ydiag = sy + height; + rotate(&xdiag, &ydiag, grid_info->xo, grid_info->yo, + angle); + write_vect(x, y, xdiag, ydiag, Map, Points, out_type); + + xdiag = sx; + ydiag = sy + height; + rotate(&xdiag, &ydiag, grid_info->xo, grid_info->yo, + angle); + write_vect(xdiag, ydiag, next_x, dum, Map, Points, out_type); + } y = sy; x = next_x = snext_x; @@ -112,30 +127,30 @@ G_percent(i, num_v_cols, 2); for (k = 0; k < rows; k++) { - y = starty; - j = 0; - do { - if (j < nbreaks) - next_y = y + y_len; - else - next_y = starty + height; - - sx = x; - sy = y; - snext_y = next_y; - dum = x; - rotate(&x, &y, grid_info->xo, grid_info->yo, angle); - rotate(&dum, &next_y, grid_info->xo, grid_info->yo, + y = starty; + j = 0; + do { + if (j < nbreaks) + next_y = y + y_len; + else + next_y = starty + height; + + sx = x; + sy = y; + snext_y = next_y; + dum = x; + rotate(&x, &y, grid_info->xo, grid_info->yo, angle); + rotate(&dum, &next_y, grid_info->xo, grid_info->yo, angle); - write_vect(x, y, dum, next_y, Map, Points, out_type); + write_vect(x, y, dum, next_y, Map, Points, out_type); - x = sx; - y = next_y = snext_y; - j++; - } while (j <= nbreaks); - /* To get exactly the same coordinates as above, y+=width is wrong */ - starty += height; + x = sx; + y = next_y = snext_y; + j++; + } while (j <= nbreaks); + /* To get exactly the same coordinates as above, y+=width is wrong */ + starty += height; } x += width; } diff -Nru grass-7.6.1/vector/v.neighbors/v.neighbors.html grass-7.8.0/vector/v.neighbors/v.neighbors.html --- grass-7.6.1/vector/v.neighbors/v.neighbors.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.neighbors/v.neighbors.html 2019-05-18 15:50:05.000000000 +0000 @@ -32,4 +32,4 @@ Radim Blazek -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net/v.net.html grass-7.8.0/vector/v.net/v.net.html --- grass-7.6.1/vector/v.net/v.net.html 2019-03-19 20:04:01.000000000 +0000 +++ grass-7.8.0/vector/v.net/v.net.html 2019-05-18 15:50:05.000000000 +0000 @@ -253,4 +253,4 @@ Mentor: Martin Landa

    -Last changed: $Date: 2016-11-14 00:05:32 +0100 (Mon, 14 Nov 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.alloc/v.net.alloc.html grass-7.8.0/vector/v.net.alloc/v.net.alloc.html --- grass-7.6.1/vector/v.net.alloc/v.net.alloc.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.net.alloc/v.net.alloc.html 2019-05-18 15:50:05.000000000 +0000 @@ -223,4 +223,4 @@ Documentation: Lukas Bocan Mentor: Martin Landa -

    Last changed: $Date: 2017-06-23 08:55:26 +0200 (Fri, 23 Jun 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.allpairs/v.net.allpairs.html grass-7.8.0/vector/v.net.allpairs/v.net.allpairs.html --- grass-7.6.1/vector/v.net.allpairs/v.net.allpairs.html 2019-03-19 20:04:13.000000000 +0000 +++ grass-7.8.0/vector/v.net.allpairs/v.net.allpairs.html 2019-05-18 15:50:05.000000000 +0000 @@ -61,4 +61,4 @@ Wolf Bergenheim, Mentor
    Markus Metz -

    Last changed: $Date: 2014-12-24 15:11:14 +0100 (Wed, 24 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.bridge/v.net.bridge.html grass-7.8.0/vector/v.net.bridge/v.net.bridge.html --- grass-7.6.1/vector/v.net.bridge/v.net.bridge.html 2019-03-19 20:04:02.000000000 +0000 +++ grass-7.8.0/vector/v.net.bridge/v.net.bridge.html 2019-05-18 15:50:05.000000000 +0000 @@ -44,4 +44,4 @@ Daniel Bundala, Google Summer of Code 2009, Student
    Wolf Bergenheim, Mentor -

    Last changed: $Date: 2013-05-23 21:59:24 +0200 (Thu, 23 May 2013) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.centrality/v.net.centrality.html grass-7.8.0/vector/v.net.centrality/v.net.centrality.html --- grass-7.6.1/vector/v.net.centrality/v.net.centrality.html 2019-03-19 20:04:13.000000000 +0000 +++ grass-7.8.0/vector/v.net.centrality/v.net.centrality.html 2019-05-18 15:50:05.000000000 +0000 @@ -46,4 +46,4 @@ Daniel Bundala, Google Summer of Code 2009, Student
    Wolf Bergenheim, Mentor -

    Last changed: $Date: 2016-03-28 23:23:39 +0200 (Mon, 28 Mar 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.components/v.net.components.html grass-7.8.0/vector/v.net.components/v.net.components.html --- grass-7.6.1/vector/v.net.components/v.net.components.html 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.net.components/v.net.components.html 2019-05-18 15:50:05.000000000 +0000 @@ -48,4 +48,4 @@ Wolf Bergenheim, Mentor
    Markus Metz -

    Last changed: $Date: 2017-11-02 11:53:40 +0100 (Thu, 02 Nov 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.connectivity/v.net.connectivity.html grass-7.8.0/vector/v.net.connectivity/v.net.connectivity.html --- grass-7.6.1/vector/v.net.connectivity/v.net.connectivity.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.net.connectivity/v.net.connectivity.html 2019-05-18 15:50:05.000000000 +0000 @@ -41,4 +41,4 @@ Daniel Bundala, Google Summer of Code 2009, Student
    Wolf Bergenheim, Mentor -

    Last changed: $Date: 2014-12-24 14:28:25 +0100 (Wed, 24 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.distance/v.net.distance.html grass-7.8.0/vector/v.net.distance/v.net.distance.html --- grass-7.6.1/vector/v.net.distance/v.net.distance.html 2019-03-19 20:04:00.000000000 +0000 +++ grass-7.8.0/vector/v.net.distance/v.net.distance.html 2019-05-18 15:50:05.000000000 +0000 @@ -169,4 +169,4 @@ Wolf Bergenheim, Mentor
    Markus Metz -

    Last changed: $Date: 2017-01-15 16:02:25 +0100 (Sun, 15 Jan 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.flow/v.net.flow.html grass-7.8.0/vector/v.net.flow/v.net.flow.html --- grass-7.6.1/vector/v.net.flow/v.net.flow.html 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.net.flow/v.net.flow.html 2019-05-18 15:50:05.000000000 +0000 @@ -56,4 +56,4 @@ Daniel Bundala, Google Summer of Code 2009, Student
    Wolf Bergenheim, Mentor -

    Last changed: $Date: 2016-08-30 15:28:34 +0200 (Tue, 30 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.iso/v.net.iso.html grass-7.8.0/vector/v.net.iso/v.net.iso.html --- grass-7.6.1/vector/v.net.iso/v.net.iso.html 2019-03-19 20:04:10.000000000 +0000 +++ grass-7.8.0/vector/v.net.iso/v.net.iso.html 2019-05-18 15:50:05.000000000 +0000 @@ -206,4 +206,4 @@ Documentation: Lukas Bocan Mentor: Martin Landa -

    Last changed: $Date: 2017-06-23 08:55:26 +0200 (Fri, 23 Jun 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.path/v.net.path.html grass-7.8.0/vector/v.net.path/v.net.path.html --- grass-7.6.1/vector/v.net.path/v.net.path.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.net.path/v.net.path.html 2019-05-18 15:50:05.000000000 +0000 @@ -202,4 +202,4 @@ Mentor: Martin Landa

    -Last changed: $Date: 2016-11-14 00:05:32 +0100 (Mon, 14 Nov 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.salesman/v.net.salesman.html grass-7.8.0/vector/v.net.salesman/v.net.salesman.html --- grass-7.6.1/vector/v.net.salesman/v.net.salesman.html 2019-03-19 20:04:01.000000000 +0000 +++ grass-7.8.0/vector/v.net.salesman/v.net.salesman.html 2019-05-18 15:50:05.000000000 +0000 @@ -166,4 +166,4 @@ Documentation: Lukas Bocan Mentor: Martin Landa -

    Last changed: $Date: 2016-11-14 00:05:32 +0100 (Mon, 14 Nov 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.spanningtree/v.net.spanningtree.html grass-7.8.0/vector/v.net.spanningtree/v.net.spanningtree.html --- grass-7.6.1/vector/v.net.spanningtree/v.net.spanningtree.html 2019-03-19 20:04:01.000000000 +0000 +++ grass-7.8.0/vector/v.net.spanningtree/v.net.spanningtree.html 2019-05-18 15:50:05.000000000 +0000 @@ -34,4 +34,4 @@ Daniel Bundala, Google Summer of Code 2009, Student
    Wolf Bergenheim, Mentor -

    Last changed: $Date: 2016-03-08 22:04:56 +0100 (Tue, 08 Mar 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.steiner/v.net.steiner.html grass-7.8.0/vector/v.net.steiner/v.net.steiner.html --- grass-7.6.1/vector/v.net.steiner/v.net.steiner.html 2019-03-19 20:04:06.000000000 +0000 +++ grass-7.8.0/vector/v.net.steiner/v.net.steiner.html 2019-05-18 15:50:05.000000000 +0000 @@ -130,4 +130,4 @@ Documentation: Markus Neteler, Markus Metz -

    Last changed: $Date: 2016-03-08 08:50:26 +0100 (Tue, 08 Mar 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.timetable/v.net.timetable.html grass-7.8.0/vector/v.net.timetable/v.net.timetable.html --- grass-7.6.1/vector/v.net.timetable/v.net.timetable.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.net.timetable/v.net.timetable.html 2019-05-18 15:50:05.000000000 +0000 @@ -151,4 +151,4 @@ Daniel Bundala, Google Summer of Code 2009, Student
    Wolf Bergenheim, Mentor -

    Last changed: $Date: 2013-05-23 21:59:24 +0200 (Thu, 23 May 2013) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.net.visibility/v.net.visibility.html grass-7.8.0/vector/v.net.visibility/v.net.visibility.html --- grass-7.6.1/vector/v.net.visibility/v.net.visibility.html 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/vector/v.net.visibility/v.net.visibility.html 2019-05-18 15:50:05.000000000 +0000 @@ -213,4 +213,4 @@ Mentor: Wolf Bergenheim

    -Last changed: $Date: 2016-09-09 04:35:18 +0200 (Fri, 09 Sep 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.normal/v.normal.html grass-7.8.0/vector/v.normal/v.normal.html --- grass-7.6.1/vector/v.normal/v.normal.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.normal/v.normal.html 2019-05-18 15:50:05.000000000 +0000 @@ -61,4 +61,4 @@ Agricultural Engineering Purdue University -

    Last changed: $Date: 2016-11-14 00:05:32 +0100 (Mon, 14 Nov 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.out.ascii/main.c grass-7.8.0/vector/v.out.ascii/main.c --- grass-7.6.1/vector/v.out.ascii/main.c 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.out.ascii/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -46,6 +46,7 @@ module = G_define_module(); G_add_keyword(_("vector")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword("ASCII"); module->label = _("Exports a vector map to a GRASS ASCII vector representation."); diff -Nru grass-7.6.1/vector/v.out.ascii/v.out.ascii.html grass-7.8.0/vector/v.out.ascii/v.out.ascii.html --- grass-7.6.1/vector/v.out.ascii/v.out.ascii.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.out.ascii/v.out.ascii.html 2019-05-18 15:50:05.000000000 +0000 @@ -150,4 +150,4 @@ in Prague, Czech Republic (2008/12)

    -Last changed: $Date: 2014-05-13 17:16:33 +0200 (Tue, 13 May 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.out.dxf/main.c grass-7.8.0/vector/v.out.dxf/main.c --- grass-7.6.1/vector/v.out.dxf/main.c 2019-03-19 20:04:01.000000000 +0000 +++ grass-7.8.0/vector/v.out.dxf/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -55,6 +55,7 @@ module = G_define_module(); G_add_keyword(_("vector")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword(_("DXF")); module->description = _("Exports vector map to DXF file format."); diff -Nru grass-7.6.1/vector/v.out.dxf/v.out.dxf.html grass-7.8.0/vector/v.out.dxf/v.out.dxf.html --- grass-7.6.1/vector/v.out.dxf/v.out.dxf.html 2019-03-19 20:04:02.000000000 +0000 +++ grass-7.8.0/vector/v.out.dxf/v.out.dxf.html 2019-05-18 15:50:05.000000000 +0000 @@ -26,4 +26,4 @@

    Update to GRASS 5.7 Radim Blazek, 10/2004 -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.out.lidar/main.c grass-7.8.0/vector/v.out.lidar/main.c --- grass-7.6.1/vector/v.out.lidar/main.c 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.out.lidar/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -472,6 +472,7 @@ module = G_define_module(); G_add_keyword(_("vector")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword(_("LIDAR")); G_add_keyword(_("points")); module->label = _("Exports vector points as LAS point cloud"); diff -Nru grass-7.6.1/vector/v.out.lidar/v.out.lidar.html grass-7.8.0/vector/v.out.lidar/v.out.lidar.html --- grass-7.6.1/vector/v.out.lidar/v.out.lidar.html 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.out.lidar/v.out.lidar.html 2019-05-18 15:50:05.000000000 +0000 @@ -49,4 +49,4 @@ Vaclav Petras -

    Last changed: $Date: 2015-12-22 02:31:02 +0100 (Tue, 22 Dec 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.outlier/v.outlier.html grass-7.8.0/vector/v.outlier/v.outlier.html --- grass-7.6.1/vector/v.outlier/v.outlier.html 2019-03-19 20:04:10.000000000 +0000 +++ grass-7.8.0/vector/v.outlier/v.outlier.html 2019-05-18 15:50:05.000000000 +0000 @@ -68,4 +68,4 @@
    Roberto Antolin -

    Last changed: $Date: 2014-08-05 08:59:29 +0200 (Tue, 05 Aug 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.out.ogr/export_areas.c grass-7.8.0/vector/v.out.ogr/export_areas.c --- grass-7.6.1/vector/v.out.ogr/export_areas.c 2019-03-19 20:04:06.000000000 +0000 +++ grass-7.8.0/vector/v.out.ogr/export_areas.c 2019-07-28 20:17:50.000000000 +0000 @@ -123,7 +123,7 @@ mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat, Ogr_feature, n_noatt); if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) { - G_warning(_("Failed to create OGR feature")); + G_fatal_error(_("Failed to create OGR feature")); } else n_exported++; @@ -224,7 +224,7 @@ mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat, Ogr_feature, n_noatt); if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) { - G_warning(_("Failed to create OGR feature")); + G_fatal_error(_("Failed to create OGR feature")); } else n_exported++; @@ -275,7 +275,7 @@ mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat, Ogr_feature, n_noatt); if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) { - G_warning(_("Failed to create OGR feature")); + G_fatal_error(_("Failed to create OGR feature")); } else n_exported++; diff -Nru grass-7.6.1/vector/v.out.ogr/export_lines.c grass-7.8.0/vector/v.out.ogr/export_lines.c --- grass-7.6.1/vector/v.out.ogr/export_lines.c 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.out.ogr/export_lines.c 2019-07-28 20:17:50.000000000 +0000 @@ -132,7 +132,7 @@ mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat, Ogr_feature, n_noatt); if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) { - G_warning(_("Failed to create OGR feature")); + G_fatal_error(_("Failed to create OGR feature")); } else n_exported++; @@ -228,7 +228,7 @@ mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat, Ogr_feature, n_noatt); if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) { - G_warning(_("Failed to create OGR feature")); + G_fatal_error(_("Failed to create OGR feature")); } else n_exported++; @@ -277,7 +277,7 @@ mk_att(cat, Fi, driver, ncol, colctype, colname, doatt, nocat, Ogr_feature, n_noatt); if (OGR_L_CreateFeature(Ogr_layer, Ogr_feature) != OGRERR_NONE ) { - G_warning(_("Failed to create OGR feature")); + G_fatal_error(_("Failed to create OGR feature")); } else n_exported++; diff -Nru grass-7.6.1/vector/v.out.ogr/main.c grass-7.8.0/vector/v.out.ogr/main.c --- grass-7.6.1/vector/v.out.ogr/main.c 2019-03-19 20:04:06.000000000 +0000 +++ grass-7.8.0/vector/v.out.ogr/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -82,7 +82,9 @@ module = G_define_module(); G_add_keyword(_("vector")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword("OGR"); + G_add_keyword(_("output")); module->label = _("Exports a vector map layer to any of the supported OGR vector formats."); @@ -678,86 +680,90 @@ if (create_field) { Ogr_field = OGR_Fld_Create(GV_KEY_COLUMN, OFTInteger); - OGR_L_CreateField(Ogr_layer, Ogr_field, 0); + if (OGR_L_CreateField(Ogr_layer, Ogr_field, 0) != OGRERR_NONE) + G_fatal_error(_("Unable to create column <%s>"), + GV_KEY_COLUMN); OGR_Fld_Destroy(Ogr_field); } doatt = 0; - } - else { - Driver = db_start_driver_open_database(Fi->driver, Fi->database); - if (!Driver) - G_fatal_error(_("Unable to open database <%s> by driver <%s>"), + } + else { + Driver = db_start_driver_open_database(Fi->driver, Fi->database); + if (!Driver) + G_fatal_error(_("Unable to open database <%s> by driver <%s>"), Fi->database, Fi->driver); - db_set_string(&dbstring, Fi->table); - if (db_describe_table(Driver, &dbstring, &Table) != DB_OK) - G_fatal_error(_("Unable to describe table <%s>"), Fi->table); - - ncol = db_get_table_number_of_columns(Table); - G_debug(2, "ncol = %d", ncol); - colctype = G_malloc(ncol * sizeof(int)); - colname = G_malloc(ncol * sizeof(char *)); - keycol = -1; - for (i = 0; i < ncol; i++) { - Column = db_get_table_column(Table, i); - colname[i] = G_store(db_get_column_name(Column)); - colsqltype = db_get_column_sqltype(Column); - colctype[i] = db_sqltype_to_Ctype(colsqltype); - colwidth = db_get_column_length(Column); - G_debug(3, "col %d: %s sqltype=%d ctype=%d width=%d", - i, colname[i], colsqltype, colctype[i], colwidth); + db_set_string(&dbstring, Fi->table); + if (db_describe_table(Driver, &dbstring, &Table) != DB_OK) + G_fatal_error(_("Unable to describe table <%s>"), Fi->table); + + ncol = db_get_table_number_of_columns(Table); + G_debug(2, "ncol = %d", ncol); + colctype = G_malloc(ncol * sizeof(int)); + colname = G_malloc(ncol * sizeof(char *)); + keycol = -1; + for (i = 0; i < ncol; i++) { + Column = db_get_table_column(Table, i); + colname[i] = G_store(db_get_column_name(Column)); + colsqltype = db_get_column_sqltype(Column); + colctype[i] = db_sqltype_to_Ctype(colsqltype); + colwidth = db_get_column_length(Column); + G_debug(3, "col %d: %s sqltype=%d ctype=%d width=%d", + i, colname[i], colsqltype, colctype[i], colwidth); - switch (colctype[i]) { - case DB_C_TYPE_INT: - ogr_ftype = OFTInteger; - break; - case DB_C_TYPE_DOUBLE: - ogr_ftype = OFTReal; - break; - case DB_C_TYPE_STRING: - ogr_ftype = OFTString; - break; - case DB_C_TYPE_DATETIME: - ogr_ftype = OFTString; - break; - } - G_debug(2, "ogr_ftype = %d", ogr_ftype); - - strcpy(key1, Fi->key); - G_tolcase(key1); - strcpy(key2, colname[i]); - G_tolcase(key2); - if (strcmp(key1, key2) == 0) - keycol = i; - G_debug(2, "%s x %s -> %s x %s -> keycol = %d", Fi->key, - colname[i], key1, key2, keycol); - - if (flags.nocat->answer && - strcmp(Fi->key, colname[i]) == 0) - /* skip export of 'cat' field */ - continue; - - if (flags.append->answer) { - Ogr_field = OGR_L_GetLayerDefn(Ogr_layer); - if (OGR_FD_GetFieldIndex(Ogr_field, colname[i]) > -1) - /* skip existing fields */ - continue; - else - G_warning(_("New attribute column <%s> added to the table"), + switch (colctype[i]) { + case DB_C_TYPE_INT: + ogr_ftype = OFTInteger; + break; + case DB_C_TYPE_DOUBLE: + ogr_ftype = OFTReal; + break; + case DB_C_TYPE_STRING: + ogr_ftype = OFTString; + break; + case DB_C_TYPE_DATETIME: + ogr_ftype = OFTString; + break; + } + G_debug(2, "ogr_ftype = %d", ogr_ftype); + + strcpy(key1, Fi->key); + G_tolcase(key1); + strcpy(key2, colname[i]); + G_tolcase(key2); + if (strcmp(key1, key2) == 0) + keycol = i; + G_debug(2, "%s x %s -> %s x %s -> keycol = %d", Fi->key, + colname[i], key1, key2, keycol); + + if (flags.nocat->answer && + strcmp(Fi->key, colname[i]) == 0) + /* skip export of 'cat' field */ + continue; + + if (flags.append->answer) { + Ogr_field = OGR_L_GetLayerDefn(Ogr_layer); + if (OGR_FD_GetFieldIndex(Ogr_field, colname[i]) > -1) + /* skip existing fields */ + continue; + else + G_warning(_("New attribute column <%s> added to the table"), colname[i]); - } + } - Ogr_field = OGR_Fld_Create(colname[i], ogr_ftype); - if (ogr_ftype == OFTString && colwidth > 0) - OGR_Fld_SetWidth(Ogr_field, colwidth); - OGR_L_CreateField(Ogr_layer, Ogr_field, 0); + Ogr_field = OGR_Fld_Create(colname[i], ogr_ftype); + if (ogr_ftype == OFTString && colwidth > 0) + OGR_Fld_SetWidth(Ogr_field, colwidth); + if (OGR_L_CreateField(Ogr_layer, Ogr_field, 0) != OGRERR_NONE) + G_fatal_error(_("Unable to create column <%s>"), + colname[i]); - OGR_Fld_Destroy(Ogr_field); - } - if (keycol == -1) - G_fatal_error(_("Key column <%s> not found"), Fi->key); - } + OGR_Fld_Destroy(Ogr_field); + } + if (keycol == -1) + G_fatal_error(_("Key column <%s> not found"), Fi->key); + } } Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer); diff -Nru grass-7.6.1/vector/v.out.ogr/v.out.ogr.html grass-7.8.0/vector/v.out.ogr/v.out.ogr.html --- grass-7.6.1/vector/v.out.ogr/v.out.ogr.html 2019-03-19 20:04:06.000000000 +0000 +++ grass-7.8.0/vector/v.out.ogr/v.out.ogr.html 2019-06-03 20:34:21.000000000 +0000 @@ -61,6 +61,12 @@ ESRI Shapefile export: note that due to the DBF table specifications column names may not be longer than 10 characters. +

    +Performance: export to SQLite based formats including OGC GeoPackage may +become faster with the environmental variable OGR_SQLITE_CACHE=1024 +being set (value depends on available RAM, see +OGR ConfigOptions). +

    EXAMPLES

    Export to OGC GeoPackage

    @@ -210,5 +216,5 @@ Multi-feature support by Martin Landa, Czech Technical University in Prague, 2013

    -Last changed: $Date: 2017-10-25 23:32:54 +0200 (Wed, 25 Oct 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.out.postgis/main.c grass-7.8.0/vector/v.out.postgis/main.c --- grass-7.6.1/vector/v.out.postgis/main.c 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.out.postgis/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -43,6 +43,7 @@ module = G_define_module(); G_add_keyword(_("vector")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword(_("PostGIS")); G_add_keyword(_("simple features")); G_add_keyword(_("topology")); @@ -138,6 +139,9 @@ /* copy attributes (must be done before checking output type otherwise attributes are not copied) */ field = Vect_get_field_number(&In, params.layer->answer); + + /* BUG: this works only if the input vector uses for its attributes + * the same PG connection to be used for the output */ if (!flags.table->answer) Vect_copy_map_dblinks(&In, &Out, TRUE); diff -Nru grass-7.6.1/vector/v.out.postgis/v.out.postgis.html grass-7.8.0/vector/v.out.postgis/v.out.postgis.html --- grass-7.6.1/vector/v.out.postgis/v.out.postgis.html 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.out.postgis/v.out.postgis.html 2019-05-18 15:50:05.000000000 +0000 @@ -289,4 +289,4 @@ (development supported by Fondazione Edmund Mach and Comune di Trento, Italy)

    -Last changed: $Date: 2015-11-24 09:07:58 +0100 (Tue, 24 Nov 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.out.pov/main.c grass-7.8.0/vector/v.out.pov/main.c --- grass-7.6.1/vector/v.out.pov/main.c 2019-03-19 20:04:00.000000000 +0000 +++ grass-7.8.0/vector/v.out.pov/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -45,6 +45,7 @@ module = G_define_module(); G_add_keyword(_("vector")); G_add_keyword(_("export")); + G_add_keyword(_("output")); module->description = _("Converts GRASS x,y,z points to POV-Ray x,z,y format."); diff -Nru grass-7.6.1/vector/v.out.pov/v.out.pov.html grass-7.8.0/vector/v.out.pov/v.out.pov.html --- grass-7.6.1/vector/v.out.pov/v.out.pov.html 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/vector/v.out.pov/v.out.pov.html 2019-05-18 15:50:05.000000000 +0000 @@ -25,4 +25,4 @@ Radim Blazek, ITC-Irst, Trento, Italy -

    Last changed: $Date: 2011-09-29 21:18:47 +0200 (Thu, 29 Sep 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.out.svg/main.c grass-7.8.0/vector/v.out.svg/main.c --- grass-7.6.1/vector/v.out.svg/main.c 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.out.svg/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -76,6 +76,7 @@ module->description = _("Exports a vector map to SVG file."); G_add_keyword(_("vector")); G_add_keyword(_("export")); + G_add_keyword(_("output")); in_opt = G_define_standard_option(G_OPT_V_INPUT); diff -Nru grass-7.6.1/vector/v.out.svg/v.out.svg.html grass-7.8.0/vector/v.out.svg/v.out.svg.html --- grass-7.6.1/vector/v.out.svg/v.out.svg.html 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.out.svg/v.out.svg.html 2019-05-18 15:50:05.000000000 +0000 @@ -46,4 +46,4 @@ Klaus Foerster (klaus svg.cc), Innsbruck, Austria -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.out.vtk/main.c grass-7.8.0/vector/v.out.vtk/main.c --- grass-7.6.1/vector/v.out.vtk/main.c 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.out.vtk/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -46,6 +46,7 @@ module = G_define_module(); G_add_keyword(_("vector")); G_add_keyword(_("export")); + G_add_keyword(_("output")); G_add_keyword("VTK"); module->description = _("Converts a vector map to VTK ASCII output."); diff -Nru grass-7.6.1/vector/v.out.vtk/v.out.vtk.html grass-7.8.0/vector/v.out.vtk/v.out.vtk.html --- grass-7.6.1/vector/v.out.vtk/v.out.vtk.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.out.vtk/v.out.vtk.html 2019-05-18 15:50:05.000000000 +0000 @@ -87,4 +87,4 @@ Soeren Gebbert -

    Last changed: $Date: 2018-06-12 02:46:28 +0200 (Tue, 12 Jun 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.overlay/area_area.c grass-7.8.0/vector/v.overlay/area_area.c --- grass-7.6.1/vector/v.overlay/area_area.c 2019-03-19 20:04:00.000000000 +0000 +++ grass-7.8.0/vector/v.overlay/area_area.c 2019-06-03 20:34:21.000000000 +0000 @@ -93,9 +93,14 @@ /* snap bline to alines */ if (Vect_snap_line(Tmp, reflist, Points, snap, 0, NULL, NULL)) { /* rewrite bline*/ +#if 0 Vect_delete_line(Tmp, line); ret = Vect_write_line(Tmp, GV_BOUNDARY, Points, Cats); G_ilist_add(BList, ret); +#else + ret = Vect_rewrite_line(Tmp, line, GV_BOUNDARY, Points, Cats); +#endif + snapped_lines++; G_debug(3, "line %d snapped", line); } diff -Nru grass-7.6.1/vector/v.overlay/main.c grass-7.8.0/vector/v.overlay/main.c --- grass-7.6.1/vector/v.overlay/main.c 2019-03-19 20:04:02.000000000 +0000 +++ grass-7.8.0/vector/v.overlay/main.c 2019-08-27 11:50:55.000000000 +0000 @@ -47,7 +47,7 @@ struct line_cats *Cats; struct ilist *BList; char *desc; - int verbose; + int verbose, overwrite; struct field_info *Fi = NULL; int table_type; @@ -147,6 +147,8 @@ if (G_parser(argc, argv)) exit(EXIT_FAILURE); + overwrite = G_check_overwrite(argc, argv); + for (input = 0; input < 2; input++) { type[input] = Vect_option_to_types(type_opt[input]); } @@ -247,6 +249,20 @@ Fi->database, Fi->driver); } db_set_error_handler_driver(driver); + if (db_table_exists(Fi->driver, + Vect_subst_var(Fi->database, &Out), + Fi->table)) { + if (overwrite) { + G_warning(_("Table <%s> already exists and will be overwritten"), + Fi->table); + db_set_string(&stmt, Fi->table); + db_drop_table(driver, &stmt); + } + else { + G_fatal_error(_("Table <%s> already exists, use '%s'"), + Fi->table, "--overwrite"); + } + } } else { driver = NULL; diff -Nru grass-7.6.1/vector/v.overlay/v.overlay.html grass-7.8.0/vector/v.overlay/v.overlay.html --- grass-7.6.1/vector/v.overlay/v.overlay.html 2019-03-19 20:04:00.000000000 +0000 +++ grass-7.8.0/vector/v.overlay/v.overlay.html 2019-06-03 20:34:21.000000000 +0000 @@ -273,7 +273,8 @@

    AUTHORS

    Radim Blazek, ITC-Irst, Trento, Italy
    -Markus Metz +Markus Metz
    +Speedup for large, complex input areas sponsored by mundialis

    -Last changed: $Date: 2017-11-03 17:54:37 +0100 (Fri, 03 Nov 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.parallel/v.parallel.html grass-7.8.0/vector/v.parallel/v.parallel.html --- grass-7.6.1/vector/v.parallel/v.parallel.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.parallel/v.parallel.html 2019-05-18 15:50:05.000000000 +0000 @@ -22,4 +22,4 @@ Radim Blazek
    Rewritten by Rosen Matev (with support through the Google Summer of Code program 2008) -

    Last changed: $Date: 2015-05-11 02:11:34 +0200 (Mon, 11 May 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.patch/main.c grass-7.8.0/vector/v.patch/main.c --- grass-7.6.1/vector/v.patch/main.c 2019-03-19 20:04:13.000000000 +0000 +++ grass-7.8.0/vector/v.patch/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -64,6 +65,7 @@ int maxcat = 0; int out_is_3d = WITHOUT_Z; char colnames[4096]; + double snap = -1; G_gisinit(argv[0]); @@ -457,6 +459,108 @@ if (!no_topo->answer) { if (append->answer) Vect_build_partial(&OutMap, GV_BUILD_NONE); + + Vect_build_partial(&OutMap, GV_BUILD_BASE); + + if (Vect_get_num_primitives(&OutMap, GV_BOUNDARY) > 0) { + int nmodif; + struct bound_box box; + double xmax, ymax, min_snap, max_snap; + int exp; + char *separator = "-----------------------------------------------------"; + + Vect_get_map_box(&OutMap, &box); + + if (abs(box.E) > abs(box.W)) + xmax = abs(box.E); + else + xmax = abs(box.W); + if (abs(box.N) > abs(box.S)) + ymax = abs(box.N); + else + ymax = abs(box.S); + + if (xmax < ymax) + xmax = ymax; + + /* double precision ULP */ + min_snap = frexp(xmax, &exp); + exp -= 52; + min_snap = ldexp(min_snap, exp); + /* human readable */ + min_snap = log10(min_snap); + if (min_snap < 0) + min_snap = (int)min_snap; + else + min_snap = (int)min_snap + 1; + + /* single precision ULP */ + max_snap = frexp(xmax, &exp); + exp -= 23; + max_snap = ldexp(max_snap, exp); + /* human readable */ + max_snap = log10(max_snap); + if (max_snap < 0) + max_snap = (int)max_snap; + else + max_snap = (int)max_snap + 1; + + snap = (min_snap + max_snap) / 2 - 1.5; + snap = pow(10, snap); + + if (snap >= 0) { + G_message("%s", separator); + G_message(_("Snapping boundaries (threshold = %.3e)..."), snap); + Vect_snap_lines(&OutMap, GV_BOUNDARY, snap, NULL); + } + + G_message("%s", separator); + G_message(_("Breaking polygons...")); + Vect_break_polygons(&OutMap, GV_BOUNDARY, NULL); + + G_message("%s", separator); + G_message(_("Removing duplicates...")); + Vect_remove_duplicates(&OutMap, GV_BOUNDARY, NULL); + + /* in non-pathological cases, the bulk of the cleaning is now done */ + + /* Vect_clean_small_angles_at_nodes() can change the geometry so that new intersections + * are created. We must call Vect_break_lines(), Vect_remove_duplicates() + * and Vect_clean_small_angles_at_nodes() until no more small angles are found */ + do { + G_message("%s", separator); + G_message(_("Breaking boundaries...")); + Vect_break_lines(&OutMap, GV_BOUNDARY, NULL); + + G_message("%s", separator); + G_message(_("Removing duplicates...")); + Vect_remove_duplicates(&OutMap, GV_BOUNDARY, NULL); + + G_message("%s", separator); + G_message(_("Cleaning boundaries at nodes...")); + nmodif = + Vect_clean_small_angles_at_nodes(&OutMap, GV_BOUNDARY, NULL); + } while (nmodif > 0); + + /* merge boundaries */ + G_message("%s", separator); + G_message(_("Merging boundaries...")); + Vect_merge_lines(&OutMap, GV_BOUNDARY, NULL, NULL); + + G_message("%s", separator); + G_message(_("Removing dangles...")); + Vect_remove_dangles(&OutMap, GV_BOUNDARY, -1.0, NULL); + + G_message("%s", separator); + Vect_build_partial(&OutMap, GV_BUILD_ALL); + + G_message(_("Removing bridges...")); + Vect_remove_bridges(&OutMap, NULL, &nmodif, NULL); + + /* Boundaries are hopefully clean, build areas */ + G_message("%s", separator); + Vect_build_partial(&OutMap, GV_BUILD_NONE); + } Vect_build(&OutMap); } Vect_close(&OutMap); diff -Nru grass-7.6.1/vector/v.patch/v.patch.html grass-7.8.0/vector/v.patch/v.patch.html --- grass-7.6.1/vector/v.patch/v.patch.html 2019-03-19 20:04:22.000000000 +0000 +++ grass-7.8.0/vector/v.patch/v.patch.html 2019-05-22 21:47:51.000000000 +0000 @@ -68,4 +68,4 @@
    Radim Blazek, ITC-Irst, Trento, Italy -

    Last changed: $Date: 2018-11-01 08:54:25 +0100 (Thu, 01 Nov 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.perturb/v.perturb.html grass-7.8.0/vector/v.perturb/v.perturb.html --- grass-7.6.1/vector/v.perturb/v.perturb.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.perturb/v.perturb.html 2019-05-18 15:50:05.000000000 +0000 @@ -86,4 +86,4 @@

    Random number generators originally written in FORTRAN by Wes Peterson and translated to C using f2c. -

    Last changed: $Date: 2018-01-07 16:11:10 +0100 (Sun, 07 Jan 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.profile/testsuite/test_v_profile.py grass-7.8.0/vector/v.profile/testsuite/test_v_profile.py --- grass-7.6.1/vector/v.profile/testsuite/test_v_profile.py 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.profile/testsuite/test_v_profile.py 2019-06-03 20:34:21.000000000 +0000 @@ -18,30 +18,30 @@ from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule -output_full = """Number|Distance|cat|feature_id|featurenam|class|st_alpha|st_num|county|county_num|primlat_dm|primlon_dm|primlatdec|primlondec|srclat_dms|srclon_dms|srclatdec|srclondec|elev_m|map_name +output_full = u"""Number|Distance|cat|feature_id|featurenam|class|st_alpha|st_num|county|county_num|primlat_dm|primlon_dm|primlatdec|primlondec|srclat_dms|srclon_dms|srclatdec|srclondec|elev_m|map_name 1|19537.97|572|986138|"Greshams Lake"|"Reservoir"|"NC"|37|"Wake"|183|"078:34:31W"|"35:52:43N"|35.878484|-78.57528|""|""|""|""|77|"Wake Forest" 2|19537.97|1029|999647|"Greshams Lake Dam"|"Dam"|"NC"|37|"Wake"|183|"078:34:31W"|"35:52:43N"|35.878484|-78.57528|""|""|""|""|77|"Wake Forest" """ -output_nocols = """1|19537.97|572|986138|"Greshams Lake"|"Reservoir"|"NC"|37|"Wake"|183|"078:34:31W"|"35:52:43N"|35.878484|-78.57528|""|""|""|""|77|"Wake Forest" +output_nocols = u"""1|19537.97|572|986138|"Greshams Lake"|"Reservoir"|"NC"|37|"Wake"|183|"078:34:31W"|"35:52:43N"|35.878484|-78.57528|""|""|""|""|77|"Wake Forest" 2|19537.97|1029|999647|"Greshams Lake Dam"|"Dam"|"NC"|37|"Wake"|183|"078:34:31W"|"35:52:43N"|35.878484|-78.57528|""|""|""|""|77|"Wake Forest" """ -output_filtered = """Number|Distance|cat|feature_id|featurenam|class|st_alpha|st_num|county|county_num|primlat_dm|primlon_dm|primlatdec|primlondec|srclat_dms|srclon_dms|srclatdec|srclondec|elev_m|map_name +output_filtered = u"""Number|Distance|cat|feature_id|featurenam|class|st_alpha|st_num|county|county_num|primlat_dm|primlon_dm|primlatdec|primlondec|srclat_dms|srclon_dms|srclatdec|srclondec|elev_m|map_name 1|19537.97|1029|999647|"Greshams Lake Dam"|"Dam"|"NC"|37|"Wake"|183|"078:34:31W"|"35:52:43N"|35.878484|-78.57528|""|""|""|""|77|"Wake Forest" """ -output_coords = """Number|Distance|cat|feature_id|featurenam|class|st_alpha|st_num|county|county_num|primlat_dm|primlon_dm|primlatdec|primlondec|srclat_dms|srclon_dms|srclatdec|srclondec|elev_m|map_name +output_coords = u"""Number|Distance|cat|feature_id|featurenam|class|st_alpha|st_num|county|county_num|primlat_dm|primlon_dm|primlatdec|primlondec|srclat_dms|srclon_dms|srclatdec|srclondec|elev_m|map_name 1|24.34|572|986138|"Greshams Lake"|"Reservoir"|"NC"|37|"Wake"|183|"078:34:31W"|"35:52:43N"|35.878484|-78.57528|""|""|""|""|77|"Wake Forest" 2|24.34|1029|999647|"Greshams Lake Dam"|"Dam"|"NC"|37|"Wake"|183|"078:34:31W"|"35:52:43N"|35.878484|-78.57528|""|""|""|""|77|"Wake Forest" """ -buf_points = """\ +buf_points = u"""\ 626382.68026139|228917.44816672|1 626643.91393428|228738.2879083|2 626907.14939778|228529.10079092|3 """ -buf_output = """\ +buf_output = u"""\ Number,Distance,cat,dbl_1,dbl_2,int_1 1,2102.114,3,626907.14939778,228529.10079092,3 2,2854.300,2,626643.91393428,228738.2879083,2 @@ -51,7 +51,7 @@ class TestProfiling(TestCase): to_remove = [] points = 'test_v_profile_points' - in_points = 'points_of_interest' + in_points = 'poi_names_wake' in_map = 'roadsmajor' where = "cat='354'" prof_ponts = (647952, 236176, 647950, 236217) @@ -130,7 +130,7 @@ def testBuffering(self): """Test against errors in buffering implementation""" vpro = SimpleModule('v.profile', input=self.points, separator='comma', dp=3, - buffer=500, profile_map='roadsmajor@PERMANENT', profile_where='cat=193') + buffer=500, profile_map=self.in_map, profile_where='cat=193') vpro.run() diff -Nru grass-7.6.1/vector/v.profile/v.profile.html grass-7.8.0/vector/v.profile/v.profile.html --- grass-7.6.1/vector/v.profile/v.profile.html 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.profile/v.profile.html 2019-05-18 15:50:05.000000000 +0000 @@ -91,4 +91,4 @@ Maris Nartiss -

    Last changed: $Date: 2017-11-19 00:37:09 +0100 (Sun, 19 Nov 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.proj/main.c grass-7.8.0/vector/v.proj/main.c --- grass-7.6.1/vector/v.proj/main.c 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/vector/v.proj/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -136,7 +136,7 @@ flag.wrap->description = _("Latlon output only, default is -180,180"); flag.wrap->label = _("Disable wrapping to -180,180 for latlon output"); - flag.transformz->guisection = _("Target"); + flag.wrap->guisection = _("Target"); flag.no_topol = G_define_flag(); flag.no_topol->key = 'b'; diff -Nru grass-7.6.1/vector/v.proj/v.proj.html grass-7.8.0/vector/v.proj/v.proj.html --- grass-7.6.1/vector/v.proj/v.proj.html 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/vector/v.proj/v.proj.html 2019-05-18 15:50:05.000000000 +0000 @@ -101,4 +101,4 @@
    R.L. Glenn, USDA, SCS, NHQ-CGIS -

    Last changed: $Date: 2016-12-01 12:04:19 +0100 (Thu, 01 Dec 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.qcount/v.qcount.html grass-7.8.0/vector/v.qcount/v.qcount.html --- grass-7.6.1/vector/v.qcount/v.qcount.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.qcount/v.qcount.html 2019-06-27 08:06:44.000000000 +0000 @@ -10,7 +10,7 @@ of a complete random, regular and a clustered pattern.

    @@ -105,7 +105,7 @@ A more detailed background is given in the tutorial:

    [8] James Darrell McCauley 1993. Complete Spatial Randomness and Quadrat Methods - @@ -128,4 +128,4 @@
    Modified for GRASS 5.7 by R. Blazek (2004-10-14) -

    Last changed: $Date: 2018-09-30 18:55:29 +0200 (Sun, 30 Sep 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.random/v.random.html grass-7.8.0/vector/v.random/v.random.html --- grass-7.6.1/vector/v.random/v.random.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.random/v.random.html 2019-05-22 21:47:51.000000000 +0000 @@ -281,4 +281,4 @@ Engineering Purdue University -

    Last changed: $Date: 2018-10-18 21:05:15 +0200 (Thu, 18 Oct 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.reclass/v.reclass.html grass-7.8.0/vector/v.reclass/v.reclass.html --- grass-7.6.1/vector/v.reclass/v.reclass.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.reclass/v.reclass.html 2019-05-18 15:50:05.000000000 +0000 @@ -96,4 +96,4 @@ from v.reclass to v.db.reclass and later to v.reclass in 5.7 rewritten by Radim Blazek -

    Last changed: $Date: 2015-05-11 02:11:34 +0200 (Mon, 11 May 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.rectify/v.rectify.html grass-7.8.0/vector/v.rectify/v.rectify.html --- grass-7.6.1/vector/v.rectify/v.rectify.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.rectify/v.rectify.html 2019-05-18 15:50:05.000000000 +0000 @@ -128,4 +128,4 @@ based on i.rectify -

    Last changed: $Date: 2016-01-29 10:29:57 +0100 (Fri, 29 Jan 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.sample/v.sample.html grass-7.8.0/vector/v.sample/v.sample.html --- grass-7.6.1/vector/v.sample/v.sample.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.sample/v.sample.html 2019-05-18 15:50:05.000000000 +0000 @@ -79,4 +79,4 @@
    Updated for GRASS 5.7 by Radim Blazek -

    Last changed: $Date: 2014-12-19 22:17:36 +0100 (Fri, 19 Dec 2014) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.segment/v.segment.html grass-7.8.0/vector/v.segment/v.segment.html --- grass-7.6.1/vector/v.segment/v.segment.html 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.segment/v.segment.html 2019-05-18 15:50:05.000000000 +0000 @@ -180,4 +180,4 @@ Radim Blazek, ITC-Irst, Trento, Italy -

    Last changed: $Date: 2015-05-11 02:11:34 +0200 (Mon, 11 May 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.select/main.c grass-7.8.0/vector/v.select/main.c --- grass-7.6.1/vector/v.select/main.c 2019-03-19 20:04:13.000000000 +0000 +++ grass-7.8.0/vector/v.select/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -6,8 +6,9 @@ * Glynn Clements * Markus Neteler * Martin Landa (GEOS support) + * Huidae Cho (reverse flag fix) * PURPOSE: Select features from one map by features in another map. - * COPYRIGHT: (C) 2003-2017 by the GRASS Development Team + * COPYRIGHT: (C) 2003-2017, 2019 by the GRASS Development Team * * This program is free software under the GNU General * Public License (>=v2). Read the file COPYING that @@ -41,6 +42,7 @@ struct GFlag flag; struct Map_info In[2], Out; struct field_info *IFi; + int nlines, nareas; G_gisinit(argv[0]); @@ -112,8 +114,11 @@ } /* Alloc space for input lines array */ - ALines = (int *)G_calloc(Vect_get_num_lines(&(In[0])) + 1, sizeof(int)); - AAreas = (int *)G_calloc(Vect_get_num_areas(&(In[0])) + 1, sizeof(int)); + nlines = Vect_get_num_lines(&(In[0])); + nareas = Vect_get_num_areas(&(In[0])); + + ALines = (int *)G_calloc(nlines + 1, sizeof(int)); + AAreas = (int *)G_calloc(nareas + 1, sizeof(int)); /* Read field info */ IFi = Vect_get_field(&(In[0]), ifield[0]); @@ -143,7 +148,8 @@ } - if (nfound != 0) { + if ((!flag.reverse->answer && nfound > 0) || + (flag.reverse->answer && nlines + nareas - nfound > 0)) { /* Open output */ if (Vect_open_new(&Out, parm.output->answer, Vect_is_3d(&(In[0]))) < 0) G_fatal_error(_("Unable to create vector map <%s>"), @@ -184,15 +190,20 @@ G_warning(_("%d features from <%s> without category skipped"), nskipped[iopt], Vect_get_full_name(&(In[iopt]))); } + Vect_set_release_support(&In[iopt]); Vect_close(&(In[iopt])); } Vect_build(&Out); + nfound = Vect_get_num_lines(&Out); + Vect_set_release_support(&Out); Vect_close(&Out); - G_done_msg(_("%d features written to output."), Vect_get_num_lines(&Out)); + G_done_msg(_("%d features written to output."), nfound); } else { + Vect_set_release_support(&In[0]); + Vect_set_release_support(&In[1]); Vect_close(&In[0]); Vect_close(&In[1]); G_done_msg(_("No features found !")); diff -Nru grass-7.6.1/vector/v.select/v.select.html grass-7.8.0/vector/v.select/v.select.html --- grass-7.6.1/vector/v.select/v.select.html 2019-03-19 20:04:10.000000000 +0000 +++ grass-7.8.0/vector/v.select/v.select.html 2019-07-09 12:41:38.000000000 +0000 @@ -62,12 +62,12 @@ d.vect map=boxgrid fill_color=85:130:176 v.select ainput=boxgrid binput=zipcodes_wake output=v_select_OVERLAP operator=overlap d.vect map=v_select_OVERLAP -d.vect map=zipcodes_wake type=boundary color=50:50:50 +d.vect map=zipcodes_wake type=boundary color=255:255:50

    v.select with OVERLAP operator
    -v.select with OVERLAP operator: selected grid boxes shown in grey +v.select with OVERLAP operator: selected grid boxes shown in yellow (using GRASS method)

    OVERLAPS features spatially overlap (using GEOS)

    @@ -79,11 +79,11 @@ d.vect map=boxgrid fill_color=85:130:176 v.select ainput=boxgrid binput=zipcodes_wake output=v_select_OVERLAPS operator=overlaps d.vect map=v_select_OVERLAPS -d.vect map=zipcodes_wake type=boundary color=50:50:50 +d.vect map=zipcodes_wake type=boundary color=255:255:50
    v.select with OVERLAPS operator
    -v.select with OVERLAPS operator: selected grid boxes shown in grey +v.select with OVERLAPS operator: selected grid boxes shown in yellow (using GEOS method)
    @@ -96,12 +96,12 @@ d.vect map=boxgrid fill_color=85:130:176 v.select ainput=boxgrid binput=zipcodes_wake output=v_select_DISJOINT operator=disjoint d.vect map=v_select_DISJOINT -d.vect map=zipcodes_wake type=boundary color=50:50:50 +d.vect map=zipcodes_wake type=boundary color=255:255:50
    v.select with DISJOINT operator
    -v.select with DISJOINT operator: selected grid boxes shown in grey +v.select with DISJOINT operator: selected grid boxes shown in yellow
    @@ -114,12 +114,12 @@ v.extract input=zipcodes_wake where=ZIPCODE_ID=35 output=zipcodeID35 v.select ainput=zipcodes_wake binput=zipcodeID35 output=v_select_EQUALS operator=equals d.vect map=v_select_EQUALS -d.vect map=zipcodes_wake type=boundary color=50:50:50 +d.vect map=zipcodes_wake type=boundary color=255:255:50
    v.select with EQUALS operator
    -v.select with EQUALS operator: selected grid boxes shown in grey +v.select with EQUALS operator: selected grid boxes shown in yellow
    @@ -132,12 +132,12 @@ d.vect map=boxgrid fill_color=85:130:176 v.select ainput=zipcodes_wake binput=boxgrid output=v_select_INTERSECTS operator=intersects d.vect map=v_select_INTERSECTS -d.vect map=boxgrid type=boundary color=50:50:50 +d.vect map=boxgrid type=boundary color=255:255:50
    v.select with INTERSECTS operator
    -v.select with INTERSECTS operator: selected grid boxes shown in grey +v.select with INTERSECTS operator: selected grid boxes shown in yellow
    @@ -150,12 +150,12 @@ d.vect map=zipcodeID35 fill_color=85:130:176 v.select ainput=zipcodes_wake binput=zipcodeID35 output=v_select_TOUCHES operator=touches d.vect map=v_select_TOUCHES -d.vect map=zipcodes_wake type=boundary color=50:50:50 +d.vect map=zipcodes_wake type=boundary color=255:255:50
    v.select with TOUCHES operator
    -v.select with TOUCHES operator: selected polygons shown in grey (blue: input polygon) +v.select with TOUCHES operator: selected polygons shown in yellow (blue: input polygon)
    @@ -168,13 +168,13 @@ d.vect map=busroute1 color=200:27:27 width=3 v.select ainput=zipcodes_wake binput=busroute1 output=v_select_CROSSES operator=crosses d.vect map=v_select_CROSSES -d.vect map=zipcodes_wake type=boundary color=50:50:50 +d.vect map=zipcodes_wake type=boundary color=255:255:50 d.vect map=busroute1 color=200:27:27 width=3
    v.select with CROSSES operator
    -v.select with CROSSES operator: selected polygons shown in grey (red: input lines) +v.select with CROSSES operator: selected polygons shown in yellow (red: input lines)
    @@ -191,7 +191,7 @@
    v.select with WITHIN operator
    -v.select with WITHIN operator: selected polygons shown in grey (blue: input polygons) +v.select with WITHIN operator: selected polygons shown in yellow (blue: input polygons)
    @@ -211,7 +211,7 @@
    v.select with CONTAINS operator
    -v.select with CONTAINS operator: selected polygon shown in grey (blue: input polygon, not visible) +v.select with CONTAINS operator: selected polygon shown in yellow (blue: input polygon, not visible)

    CONTAINS with points

    @@ -227,7 +227,7 @@
    v.select with CONTAINS operator
    -v.select with CONTAINS operator: selected polygons shown in grey (red: input points) +v.select with CONTAINS operator: selected polygons shown in yellow (red: input points)
    @@ -320,4 +320,4 @@ ZIP code examples by Carol X. Garzon-Lopez, Trento, Italy

    -Last changed: $Date: 2018-03-19 21:41:47 +0100 (Mon, 19 Mar 2018) $ +Last changed: $Date$ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/vector/v.select/v_select_op_contains_pnts.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/vector/v.select/v_select_op_contains_pnts.png differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/vector/v.select/v_select_op_contains_pol.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/vector/v.select/v_select_op_contains_pol.png differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/vector/v.select/v_select_op_crosses.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/vector/v.select/v_select_op_crosses.png differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/vector/v.select/v_select_op_disjoint.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/vector/v.select/v_select_op_disjoint.png differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/vector/v.select/v_select_op_equals.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/vector/v.select/v_select_op_equals.png differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/vector/v.select/v_select_op_intersects.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/vector/v.select/v_select_op_intersects.png differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/vector/v.select/v_select_op_overlap.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/vector/v.select/v_select_op_overlap.png differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/vector/v.select/v_select_op_overlaps.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/vector/v.select/v_select_op_overlaps.png differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/vector/v.select/v_select_op_touches.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/vector/v.select/v_select_op_touches.png differ Binary files /tmp/tmp_fWAbr/wHV3KQiUym/grass-7.6.1/vector/v.select/v_select_op_within.png and /tmp/tmp_fWAbr/gaXWnOlIN6/grass-7.8.0/vector/v.select/v_select_op_within.png differ diff -Nru grass-7.6.1/vector/v.split/v.split.html grass-7.8.0/vector/v.split/v.split.html --- grass-7.6.1/vector/v.split/v.split.html 2019-03-19 20:04:13.000000000 +0000 +++ grass-7.8.0/vector/v.split/v.split.html 2019-05-22 21:47:51.000000000 +0000 @@ -103,4 +103,4 @@ Radim Blazek -

    Last changed: $Date: 2018-12-10 20:21:47 +0100 (Mon, 10 Dec 2018) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.support/v.support.html grass-7.8.0/vector/v.support/v.support.html --- grass-7.6.1/vector/v.support/v.support.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.support/v.support.html 2019-05-18 15:50:05.000000000 +0000 @@ -24,4 +24,4 @@ Markus Neteler, Trento -

    Last changed: $Date: 2011-11-08 22:24:20 +0100 (Tue, 08 Nov 2011) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.surf.bspline/main.c grass-7.8.0/vector/v.surf.bspline/main.c --- grass-7.6.1/vector/v.surf.bspline/main.c 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/vector/v.surf.bspline/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -55,8 +55,7 @@ double **N, **obsVect; /* Interpolation and least-square matrix */ SEGMENT out_seg, mask_seg; - const char *out_file, *mask_file; - int out_fd, mask_fd; + char *out_file, *mask_file; double seg_size; int seg_mb, segments_in_memory; int have_mask; @@ -451,7 +450,6 @@ /* Alloc raster matrix */ have_mask = 0; out_file = mask_file = NULL; - out_fd = mask_fd = -1; if (grid == TRUE) { int row; DCELL *drastbuf; @@ -470,14 +468,9 @@ G_debug(1, "%d %dx%d segments held in memory", segments_in_memory, SEGSIZE, SEGSIZE); out_file = G_tempfile(); - out_fd = creat(out_file, 0666); - if (Segment_format(out_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(double)) != 1) + if (Segment_open(&out_seg, out_file, nrows, ncols, SEGSIZE, + SEGSIZE, sizeof(double), segments_in_memory) != 1) G_fatal_error(_("Can not create temporary file")); - close(out_fd); - - out_fd = open(out_file, 2); - if (Segment_init(&out_seg, out_fd, segments_in_memory) != 1) - G_fatal_error(_("Can not initialize temporary file")); /* initialize output */ G_message(_("Initializing output...")); @@ -498,14 +491,9 @@ G_message(_("Load masking map")); mask_file = G_tempfile(); - mask_fd = creat(mask_file, 0666); - if (Segment_format(mask_fd, nrows, ncols, SEGSIZE, SEGSIZE, sizeof(char)) != 1) + if (Segment_open(&mask_seg, mask_file, nrows, ncols, SEGSIZE, + SEGSIZE, sizeof(char), segments_in_memory) != 1) G_fatal_error(_("Can not create temporary file")); - close(mask_fd); - - mask_fd = open(mask_file, 2); - if (Segment_init(&mask_seg, mask_fd, segments_in_memory) != 1) - G_fatal_error(_("Can not initialize temporary file")); maskfd = Rast_open_old(mask_opt->answer, ""); @@ -904,9 +892,7 @@ if (have_mask) { - Segment_release(&mask_seg); /* release memory */ - close(mask_fd); - unlink(mask_file); + Segment_close(&mask_seg); /* close segment structure */ } drastbuf = Rast_allocate_buf(DCELL_TYPE); @@ -921,9 +907,7 @@ Rast_close(raster); - Segment_release(&out_seg); /* release memory */ - close(out_fd); - unlink(out_file); + Segment_close(&out_seg); /* close segment structure */ /* set map title */ sprintf(title, "%s interpolation with Tykhonov regularization", type_opt->answer); diff -Nru grass-7.6.1/vector/v.surf.bspline/v.surf.bspline.html grass-7.8.0/vector/v.surf.bspline/v.surf.bspline.html --- grass-7.6.1/vector/v.surf.bspline/v.surf.bspline.html 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/vector/v.surf.bspline/v.surf.bspline.html 2019-05-18 15:50:05.000000000 +0000 @@ -191,4 +191,4 @@ Update for GRASS 6 and improvements: Roberto Antolin

    -Last changed: $Date: 2017-07-24 23:59:39 +0200 (Mon, 24 Jul 2017) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.surf.idw/v.surf.idw.html grass-7.8.0/vector/v.surf.idw/v.surf.idw.html --- grass-7.6.1/vector/v.surf.idw/v.surf.idw.html 2019-03-19 20:04:07.000000000 +0000 +++ grass-7.8.0/vector/v.surf.idw/v.surf.idw.html 2019-05-18 15:50:05.000000000 +0000 @@ -101,4 +101,4 @@ points outside current region) by Paul Kelly

    -Last changed: $Date: 2016-08-03 13:50:26 +0200 (Wed, 03 Aug 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.surf.rst/main.c grass-7.8.0/vector/v.surf.rst/main.c --- grass-7.6.1/vector/v.surf.rst/main.c 2019-03-19 20:04:12.000000000 +0000 +++ grass-7.8.0/vector/v.surf.rst/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -695,8 +695,21 @@ if (mcurv != NULL) ddisk += disk; ddisk += sddisk; - G_verbose_message(_("Processing all selected output files " - "will require %d bytes of disk space for temp files"), ddisk); + + G_message(_("Processing all selected output files will require")); + if (ddisk > 1024) { + if (ddisk > 1024 * 1024) { + if (ddisk > 1024 * 1024 * 1024) { + G_message(_("%.2f GB of disk space for temp files."), ddisk / (1024. * 1024. * 1024.)); + } + else + G_message(_("%.2f MB of disk space for temp files."), ddisk / (1024. * 1024.)); + } + else + G_message(_("%.2f KB of disk space for temp files."), ddisk / 1024.); + } + else + G_message(_("%d bytes of disk space for temp files."), (int)ddisk); deltx = xmax - xmin; delty = ymax - ymin; diff -Nru grass-7.6.1/vector/v.surf.rst/testsuite/test_vsurfrst.py grass-7.8.0/vector/v.surf.rst/testsuite/test_vsurfrst.py --- grass-7.6.1/vector/v.surf.rst/testsuite/test_vsurfrst.py 2019-03-19 20:04:12.000000000 +0000 +++ grass-7.8.0/vector/v.surf.rst/testsuite/test_vsurfrst.py 2019-06-03 20:34:21.000000000 +0000 @@ -22,8 +22,8 @@ @classmethod def setUpClass(cls): cls.use_temp_region() - cls.runModule('g.region', vector='elev_points', res=1) - cls.runModule('v.to.3d', input='elev_points', type='point', + cls.runModule('g.region', vector='elev_lid792_randpts', res=1) + cls.runModule('v.to.3d', input='elev_lid792_randpts', type='point', output='elev_points3d', column='value', overwrite=True) @classmethod diff -Nru grass-7.6.1/vector/v.surf.rst/v.surf.rst.html grass-7.8.0/vector/v.surf.rst/v.surf.rst.html --- grass-7.6.1/vector/v.surf.rst/v.surf.rst.html 2019-03-19 20:04:11.000000000 +0000 +++ grass-7.8.0/vector/v.surf.rst/v.surf.rst.html 2019-06-03 20:34:21.000000000 +0000 @@ -295,6 +295,19 @@

    EXAMPLE

    +

    Setting for lidar point cloud

    + +Lidar point clouds as well as UAS SfM-based (phodar) point clouds tend +to be dense in relation to the desired raster resolution and thus a +different set of parameters is more advantageous, e.g. in comparison to +a typical temperature data interpolation. + +
    +v.surf.rst input=points elevation=elevation npmin=100
    +
    + +

    Usage of the where parameter

    + Using the where parameter, the interpolation can be limited to use only a subset of the input vectors. @@ -404,4 +417,4 @@
    Michal Lacko, Pavol Jozef Safarik University in Kosice

    -Last changed: $Date: 2018-08-27 17:17:20 +0200 (Mon, 27 Aug 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.timestamp/v.timestamp.html grass-7.8.0/vector/v.timestamp/v.timestamp.html --- grass-7.6.1/vector/v.timestamp/v.timestamp.html 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.timestamp/v.timestamp.html 2019-05-18 15:50:05.000000000 +0000 @@ -62,4 +62,4 @@ Michael Shapiro, U.S.Army Construction Engineering Research Laboratory -

    Last changed: $Date: 2016-08-22 15:22:27 +0200 (Mon, 22 Aug 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.to.3d/v.to.3d.html grass-7.8.0/vector/v.to.3d/v.to.3d.html --- grass-7.6.1/vector/v.to.3d/v.to.3d.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.to.3d/v.to.3d.html 2019-05-18 15:50:05.000000000 +0000 @@ -53,4 +53,4 @@ Martin Landa, Czech Technical University in Prague, Czech Republic

    -Last changed: $Date: 2015-06-17 04:29:17 +0200 (Wed, 17 Jun 2015) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.to.db/main.c grass-7.8.0/vector/v.to.db/main.c --- grass-7.6.1/vector/v.to.db/main.c 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.to.db/main.c 2019-07-09 11:04:06.000000000 +0000 @@ -39,11 +39,17 @@ G_add_keyword(_("attribute table")); G_add_keyword(_("database")); G_add_keyword(_("area")); - G_add_keyword(_("length")); - G_add_keyword(_("perimeter")); - G_add_keyword(_("coordinates")); + G_add_keyword(_("azimuth")); G_add_keyword(_("bounding box")); G_add_keyword(_("category")); + G_add_keyword(_("compactness")); + G_add_keyword(_("coordinates")); + G_add_keyword(_("fractal")); + G_add_keyword(_("length")); + G_add_keyword(_("perimeter")); + G_add_keyword(_("sides")); + G_add_keyword(_("sinuous")); + G_add_keyword(_("slope")); module->description = _("Populates attribute values from vector features."); parse_command_line(argc, argv); diff -Nru grass-7.6.1/vector/v.to.db/v.to.db.html grass-7.8.0/vector/v.to.db/v.to.db.html --- grass-7.6.1/vector/v.to.db/v.to.db.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.to.db/v.to.db.html 2019-05-18 15:50:05.000000000 +0000 @@ -170,4 +170,4 @@ Radim Blazek, ITC-irst, Trento, Italy
    Line sinuousity implemented by Wolf Bergenheim -

    Last changed: $Date: 2017-01-29 15:04:26 +0100 (Sun, 29 Jan 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.to.points/local_proto.h grass-7.8.0/vector/v.to.points/local_proto.h --- grass-7.6.1/vector/v.to.points/local_proto.h 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.to.points/local_proto.h 2019-06-03 20:34:21.000000000 +0000 @@ -1,6 +1,8 @@ #ifndef __LOCAL_PROTO_H #define GV_NODE 1 #define GV_VERTEX 2 +#define GV_START 3 +#define GV_END 4 void write_point(struct Map_info *, double, double, double, int, double, dbDriver *, struct field_info *); diff -Nru grass-7.6.1/vector/v.to.points/main.c grass-7.8.0/vector/v.to.points/main.c --- grass-7.6.1/vector/v.to.points/main.c 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.to.points/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -8,7 +8,7 @@ * * PURPOSE: Create points along lines * - * COPYRIGHT: (C) 2002-2017 by the GRASS Development Team + * COPYRIGHT: (C) 2002-2019 by the GRASS Development Team * * This program is free software under the GNU General * Public License (>=v2). Read the file COPYING that @@ -76,8 +76,8 @@ opt.use->key = "use"; opt.use->type = TYPE_STRING; opt.use->required = NO; - opt.use->description = _("Use line nodes or vertices only"); - opt.use->options = "node,vertex"; + opt.use->description = _("Use line nodes (start/end) or vertices only"); + opt.use->options = "node,start,end,vertex"; opt.dmax = G_define_option(); opt.dmax->key = "dmax"; @@ -114,12 +114,32 @@ vertex_type = 0; if (opt.use->answer) { - if (opt.use->answer[0] == 'n') + switch (opt.use->answer[0]) { + case 'n': vertex_type = GV_NODE; - else + break; + case 's': + vertex_type = GV_START; + break; + case 'e': + vertex_type = GV_END; + break; + default: vertex_type = GV_VERTEX; + break; + } + } + + if (flag.inter->answer && vertex_type != GV_VERTEX) { + G_warning(_("Flag -%c ignored (requires %s=%s)"), flag.inter->key, + opt.use->key, "vertex"); + flag.inter->answer = FALSE; + } + if (flag.reverse->answer && (vertex_type == GV_START || vertex_type == GV_END)) { + G_warning(_("Flag -%c ignored (reason %s=%s)"), flag.reverse->key, + opt.use->key, opt.use->answer); + flag.reverse->answer = FALSE; } - Vect_check_input_output_name(opt.input->answer, opt.output->answer, G_FATAL_EXIT); diff -Nru grass-7.6.1/vector/v.to.points/v.to.points.html grass-7.8.0/vector/v.to.points/v.to.points.html --- grass-7.6.1/vector/v.to.points/v.to.points.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.to.points/v.to.points.html 2019-06-03 20:34:21.000000000 +0000 @@ -67,7 +67,7 @@ The use=vertex option is used to digitize points that fall on the line's vertices only. Parameter dmax is ignored in this case. Similarly to use=node when only line's node are -used. +used. To filter only starting/ending nodes use use=start/end.

    If the -i flag is used in conjunction with the use=vertex option, @@ -91,21 +91,36 @@

    Use the -r flag to create points starting from the end node. -

    EXAMPLE

    +

    EXAMPLES

    +

    Points along the input lines

    In this example, the 'railroads' vector lines map of the North Carolina sample dataset is used to create points along the input lines:
     # The North Carolina data are metric.
    -# 200m distance for nodes (maximum limit but not an exact distance)
    -v.to.points railroads output=railroads_nodes use=node dmax=200
    +# 200m distance for points (maximum limit but not an exact distance)
    +v.to.points input=railroads output=railroads_points dmax=200
     
     # verify the two layers in the resulting map
    -v.category railroads_nodes option=report
    +v.category map=railroads_points option=report
     
     # vector info
    -v.info railroads_nodes
    +v.info map=railroads_points
    +
    + +

    Extract nodes as points

    + +
    +v.to.points input=railroads output=railroads_nodes use=node
    +
    + +

    Extract starting/ending nodes as points

    + +
    +v.to.points input=railroads output=railroads_start use=start
    +
    +v.to.points input=railroads output=railroads_end use=end    
     

    SEE ALSO

    @@ -124,4 +139,4 @@ Prague, Czech Republic

    -Last changed: $Date: 2017-02-16 06:09:41 +0100 (Thu, 16 Feb 2017) $

    +Last changed: $Date$

    diff -Nru grass-7.6.1/vector/v.to.points/write.c grass-7.8.0/vector/v.to.points/write.c --- grass-7.6.1/vector/v.to.points/write.c 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.to.points/write.c 2019-06-03 20:34:21.000000000 +0000 @@ -78,7 +78,7 @@ double dmax, dbDriver *driver, struct field_info *Fi) { - if (vertex == GV_VERTEX || vertex == GV_NODE) { /* use line vertices */ + if (vertex != 0) { /* use line vertices */ double along; int vert; @@ -86,14 +86,17 @@ for (vert = 0; vert < LPoints->n_points; vert++) { G_debug(3, "vert = %d", vert); - if (vertex == GV_VERTEX || - (vertex == GV_NODE && - (vert == 0 || vert == LPoints->n_points - 1))) { - if (vert == LPoints->n_points - 1) - along = Vect_line_length(LPoints); - write_point(Out, LPoints->x[vert], LPoints->y[vert], - LPoints->z[vert], cat, along, driver, Fi); - } + if (vertex == GV_NODE && (vert > 0 && vert < LPoints->n_points - 1)) + continue; + if (vertex == GV_START && vert > 0) + return; + if (vertex == GV_END && vert < LPoints->n_points - 1) + continue; + + if (vert == LPoints->n_points - 1) + along = Vect_line_length(LPoints); + write_point(Out, LPoints->x[vert], LPoints->y[vert], + LPoints->z[vert], cat, along, driver, Fi); if (vert < LPoints->n_points - 1) { double dx, dy, dz, len; diff -Nru grass-7.6.1/vector/v.to.rast/support.c grass-7.8.0/vector/v.to.rast/support.c --- grass-7.6.1/vector/v.to.rast/support.c 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.to.rast/support.c 2019-06-03 20:34:21.000000000 +0000 @@ -226,7 +226,10 @@ struct My_labels_rule *al = (struct My_labels_rule *) a; struct My_labels_rule *bl = (struct My_labels_rule *) b; - return (al->i - bl->i); + if (al->i < bl->i) + return -1; + + return (al->i > bl->i); } /* add labels to raster cells */ @@ -587,13 +590,20 @@ } /* for each value in database */ } else { - fd = Rast_open_old(rast_name, G_mapset()); + Rast_set_cats_title("Rasterized vector map from categories", &rast_cats); - rowbuf = Rast_allocate_buf(map_type); + /* Rast_set_cat() is terribly slow for many categories, + * and the added labels are not really informative: + * 1:Category 1 + * 2:Category 2 + * ... + * 100000:Category 100000 + * -> skip */ +#if 0 + fd = Rast_open_old(rast_name, G_mapset()); + rowbuf = Rast_allocate_buf(map_type); Rast_init_cell_stats(&stats); - Rast_set_cats_title("Rasterized vector map from categories", &rast_cats); - rows = Rast_window_rows(); for (row = 0; row < rows; row++) { @@ -609,9 +619,9 @@ sprintf(msg, "Category %d", n); Rast_set_cat(&n, &n, msg, &rast_cats, map_type); } - Rast_close(fd); G_free(rowbuf); +#endif } } break; @@ -619,7 +629,6 @@ { DCELL fmin, fmax; RASTER_MAP_TYPE map_type; - int i; char msg[64]; map_type = Rast_map_type(rast_name, G_mapset()); diff -Nru grass-7.6.1/vector/v.to.rast/v.to.rast.html grass-7.8.0/vector/v.to.rast/v.to.rast.html --- grass-7.6.1/vector/v.to.rast/v.to.rast.html 2019-03-19 20:04:05.000000000 +0000 +++ grass-7.8.0/vector/v.to.rast/v.to.rast.html 2019-05-18 15:50:05.000000000 +0000 @@ -168,6 +168,6 @@ Stream directions: Jaro Hofierka and Helena Mitasova
    GRASS 6.3 code cleanup and label support: Brad Douglas -

    Last changed: $Date: 2017-03-16 04:03:42 +0100 (Thu, 16 Mar 2017) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.to.rast3/v.to.rast3.html grass-7.8.0/vector/v.to.rast3/v.to.rast3.html --- grass-7.6.1/vector/v.to.rast3/v.to.rast3.html 2019-03-19 20:03:59.000000000 +0000 +++ grass-7.8.0/vector/v.to.rast3/v.to.rast3.html 2019-05-18 15:50:05.000000000 +0000 @@ -31,4 +31,4 @@ Original s.to.rast3: Jaro Hofierka, Geomodel s.r.o.
    Updated by Radim Blazek -

    Last changed: $Date: 2015-08-24 05:56:52 +0200 (Mon, 24 Aug 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.transform/v.transform.html grass-7.8.0/vector/v.transform/v.transform.html --- grass-7.6.1/vector/v.transform/v.transform.html 2019-03-19 20:04:00.000000000 +0000 +++ grass-7.8.0/vector/v.transform/v.transform.html 2019-05-18 15:50:05.000000000 +0000 @@ -89,4 +89,4 @@ Radim Blazek, ITC-irst, Trento, Italy,
    Column support added by Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy (2007/09) -

    Last changed: $Date: 2015-08-07 05:24:55 +0200 (Fri, 07 Aug 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.type/v.type.html grass-7.8.0/vector/v.type/v.type.html --- grass-7.6.1/vector/v.type/v.type.html 2019-03-19 20:04:11.000000000 +0000 +++ grass-7.8.0/vector/v.type/v.type.html 2019-05-18 15:50:05.000000000 +0000 @@ -22,4 +22,4 @@ Radim Blazek, ITC-Irst, Trento, Italy -

    Last changed: $Date: 2019-01-14 12:13:25 +0100 (Mon, 14 Jan 2019) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.univar/testsuite/v_univar_test.py grass-7.8.0/vector/v.univar/testsuite/v_univar_test.py --- grass-7.6.1/vector/v.univar/testsuite/v_univar_test.py 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.univar/testsuite/v_univar_test.py 2019-06-03 20:34:21.000000000 +0000 @@ -15,47 +15,93 @@ class TestProfiling(TestCase): def test_flagg(self): - """Testing flag g with map bridges""" - output_str="""n=2537 - nmissing=0 - nnull=0 - min=1 - max=2537 - range=2536 - sum=3.21945e+06 - mean=1269 - mean_abs=1269 - population_stddev=732.369 - population_variance=536364 - population_coeff_variation=0.577123 - sample_stddev=732.513 - sample_variance=536576 - kurtosis=-1.20142 - skewness=0""" - v_univar = SimpleModule("v.univar", flags="g", map='census', column='cat') - self.assertModuleKeyValue(module='v.univar', map='census', column='cat', flags='g', reference=output_str, - precision=2, sep="=") + """Testing flag g with map lakes""" + output_str = u"""n=15279 +nmissing=0 +nnull=0 +min=1 +max=15279 +range=15278 +sum=1.16732e+08 +mean=7640 +mean_abs=7640 +population_stddev=4410.67 +population_variance=1.9454e+07 +population_coeff_variation=0.577312 +sample_stddev=4410.81 +sample_variance=1.94553e+07 +kurtosis=-1.20024 +skewness=-2.41826e-14""" + v_univar = SimpleModule("v.univar", flags="g", map='lakes', column='cat') + v_univar.run() + self.assertLooksLike(actual=v_univar.outputs.stdout, + reference=output_str) def test_flage(self): """Testing flag e with map geology""" - self.assertModule('v.univar', map='geology', column='PERIMETER', flags='e') + output_str = u"""number of features with non NULL attribute: 1832 +number of missing attributes: 0 +number of NULL attributes: 0 +minimum: 166.947 +maximum: 2.72948e+06 +range: 2.72932e+06 +sum: 7.88761e+07 +mean: 43054.7 +mean of absolute values: 43054.7 +population standard deviation: 132689 +population variance: 1.76064e+10 +population coefficient of variation: 3.08187 +sample standard deviation: 132725 +sample variance: 1.7616e+10 +kurtosis: 139.157 +skewness: 9.7065 +1st quartile: 3699.32 +median (even number of cells): 10308.4 +3rd quartile: 29259.1 +90th percentile: 86449.7""" + v_univar = SimpleModule('v.univar', map='geology', column='PERIMETER', flags='e') + v_univar.run() + self.assertLooksLike(actual=v_univar.outputs.stdout, + reference=output_str) def test_flagw(self): """Testing flag w with map lakes""" - self.assertModule('v.univar', map='hospitals', column='cat', flags='w') + output_str = u"""number of features with non NULL attribute: 15279 +number of missing attributes: 0 +number of NULL attributes: 0 +minimum: 2 +maximum: 15280 +range: 15278 +sum: 5.76349e+11 +mean: 6190.76 +mean of absolute values: 6190.76""" + v_univar = SimpleModule('v.univar', map='lakes', column='FULL_HYDRO', flags='w') + v_univar.run() + self.assertLooksLike(actual=v_univar.outputs.stdout, + reference=output_str) def test_flagd(self): """Testing flag d with map hospitals""" - univar_string="""n=160 - nmissing=0 - nnull=0 - min=1 - max=160 - range=159 - sum=12880 - mean=80.5 - mean_abs=80.5""" - self.assertModule('v.univar', map='hospitals', column='CITY', flags='d') + univar_string = u"""number of primitives: 160 +number of non zero distances: 12561 +number of zero distances: 0 +minimum: 9.16773 +maximum: 760776 +range: 760767 +sum: 2.69047e+09 +mean: 214193 +mean of absolute values: 214193 +population standard deviation: 128505 +population variance: 1.65136e+10 +population coefficient of variation: 0.599953 +sample standard deviation: 128511 +sample variance: 1.6515e+10 +kurtosis: 0.277564 +skewness: 0.801646""" + v_univar = SimpleModule('v.univar', map='hospitals', column='CITY', flags='d') + v_univar.run() + self.assertLooksLike(actual=v_univar.outputs.stdout, + reference=univar_string) def test_output(self): """Testing output of v.univar""" diff -Nru grass-7.6.1/vector/v.univar/v.univar.html grass-7.8.0/vector/v.univar/v.univar.html --- grass-7.6.1/vector/v.univar/v.univar.html 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.univar/v.univar.html 2019-05-18 15:50:05.000000000 +0000 @@ -142,4 +142,4 @@ Martin Landa

    -Last changed: $Date: 2018-09-30 18:55:29 +0200 (Sun, 30 Sep 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.vect.stats/main.c grass-7.8.0/vector/v.vect.stats/main.c --- grass-7.6.1/vector/v.vect.stats/main.c 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.vect.stats/main.c 2019-06-03 20:34:21.000000000 +0000 @@ -68,7 +68,10 @@ AREA_CAT *p1 = (AREA_CAT *) pa; AREA_CAT *p2 = (AREA_CAT *) pb; - return (p1->area_cat - p2->area_cat); + if (p1->area_cat < p2->area_cat) + return -1; + + return (p1->area_cat > p2->area_cat); } int main(int argc, char *argv[]) diff -Nru grass-7.6.1/vector/v.vect.stats/v.vect.stats.html grass-7.8.0/vector/v.vect.stats/v.vect.stats.html --- grass-7.6.1/vector/v.vect.stats/v.vect.stats.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.vect.stats/v.vect.stats.html 2019-05-18 15:50:05.000000000 +0000 @@ -254,4 +254,4 @@ Markus Metz

    -Last changed: $Date: 2019-03-06 23:31:36 +0100 (Wed, 06 Mar 2019) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.vol.rst/v.vol.rst.html grass-7.8.0/vector/v.vol.rst/v.vol.rst.html --- grass-7.6.1/vector/v.vol.rst/v.vol.rst.html 2019-03-19 20:04:13.000000000 +0000 +++ grass-7.8.0/vector/v.vol.rst/v.vol.rst.html 2019-05-18 15:50:05.000000000 +0000 @@ -306,4 +306,4 @@ hofierka@fhpv.unipo.sk, http://www.geomodel.sk -

    Last changed: $Date: 2016-11-14 00:05:32 +0100 (Mon, 14 Nov 2016) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.voronoi/defs.h grass-7.8.0/vector/v.voronoi/defs.h --- grass-7.6.1/vector/v.voronoi/defs.h 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.voronoi/defs.h 2019-06-11 07:26:20.000000000 +0000 @@ -1,7 +1,7 @@ extern struct Cell_head Window; extern struct bound_box Box; -extern struct Map_info In, Out; +extern struct Map_info In, Out, Out2; extern int Type; extern int Field; extern int in_area; diff -Nru grass-7.6.1/vector/v.voronoi/main.c grass-7.8.0/vector/v.voronoi/main.c --- grass-7.6.1/vector/v.voronoi/main.c 2019-03-19 20:04:02.000000000 +0000 +++ grass-7.8.0/vector/v.voronoi/main.c 2019-06-11 07:26:20.000000000 +0000 @@ -202,6 +202,8 @@ Vect_region_box(&Window, &Box); Box.T = 0.5; Box.B = -0.5; + xcenter = (Box.W + Box.E) / 2.0; + ycenter = (Box.S + Box.N) / 2.0; freeinit(&sfl, sizeof(struct Site)); @@ -211,8 +213,17 @@ else readsites(); - if (Vect_open_new(&Out, opt.out->answer, 0) < 0) - G_fatal_error(_("Unable to create vector map <%s>"), opt.out->answer); + if (in_area) { + if (Vect_open_tmp_new(&Out, NULL, 0) < 0) + G_fatal_error(_("Unable to create temporary vector map")); + + if (Vect_open_new(&Out2, opt.out->answer, 0) < 0) + G_fatal_error(_("Unable to create vector map <%s>"), opt.out->answer); + } + else { + if (Vect_open_new(&Out, opt.out->answer, 0) < 0) + G_fatal_error(_("Unable to create vector map <%s>"), opt.out->answer); + } Vect_hist_copy(&In, &Out); Vect_hist_command(&Out); @@ -299,6 +310,103 @@ G_free(coor); } + if (in_area) { + int ltype; + + /* Voronoi diagrams for areas */ + /* write input boundaries with an area on both sides to output */ + if (copybounds() > 0) { + int cat; + double x, y; + double snap_thresh; + int nmod; + + /* snap Voronoi edges to boundaries */ + snap_thresh = fabs(Box.W); + if (snap_thresh < fabs(Box.E)) + snap_thresh = fabs(Box.E); + if (snap_thresh < fabs(Box.N)) + snap_thresh = fabs(Box.N); + if (snap_thresh < fabs(Box.S)) + snap_thresh = fabs(Box.S); + snap_thresh = 2 * d_ulp(snap_thresh); + + /* TODO: snap only Voronoi edges */ + Vect_snap_lines(&Out, GV_BOUNDARY, snap_thresh, NULL); + do { + Vect_break_lines(&Out, GV_BOUNDARY, NULL); + Vect_remove_duplicates(&Out, GV_BOUNDARY, NULL); + nmod = + Vect_clean_small_angles_at_nodes(&Out, GV_BOUNDARY, NULL); + } while (nmod > 0); + + /* break lines */ + Vect_break_lines(&Out, GV_BOUNDARY, NULL); + + /* remove edge parts that are within an input area */ + nlines = Vect_get_num_lines(&Out); + for (line = 1; line <= nlines; line++) { + if (!Vect_line_alive(&Out, line)) + continue; + + ltype = Vect_get_line_type(&Out, line); + if (!(ltype & GV_BOUNDARY)) + continue; + + Vect_read_line(&Out, Points, Cats, line); + cat = 0; + Vect_cat_get(Cats, 1, &cat); + if (cat != 1) + continue; + + Vect_line_prune(Points); + if (Points->n_points == 2) { + x = (Points->x[0] + Points->x[1]) / 2.0; + y = (Points->y[0] + Points->y[1]) / 2.0; + } + else { + i = 1; + while (Points->x[0] == Points->x[i] && + Points->y[0] == Points->y[i] && + i < Points->n_points - 1) { + i++; + } + i = Points->n_points / 2.; + x = Points->x[i]; + y = Points->y[i]; + } + if (Vect_find_area(&In, x, y) > 0) + Vect_delete_line(&Out, line); + } + } + + /* copy result to final output */ + Vect_reset_cats(Cats); + + nlines = Vect_get_num_lines(&Out); + + for (line = 1; line <= nlines; line++) { + + if (!Vect_line_alive(&Out, line)) + continue; + + ltype = Vect_get_line_type(&Out, line); + if (!(ltype & GV_BOUNDARY)) + continue; + + Vect_read_line(&Out, Points, NULL, line); + Vect_line_prune(Points); + + Vect_write_line(&Out2, GV_BOUNDARY, Points, Cats); + } + + /* close temporary vector */ + Vect_close(&Out); + /* is this a dirty hack ? */ + Out = Out2; + Vect_build_partial(&Out, GV_BUILD_BASE); + } + nfields = Vect_cidx_get_num_fields(&In); cats = (int **)G_malloc(nfields * sizeof(int *)); ncats = (int *)G_malloc(nfields * sizeof(int)); diff -Nru grass-7.6.1/vector/v.voronoi/sw_defs.h grass-7.8.0/vector/v.voronoi/sw_defs.h --- grass-7.6.1/vector/v.voronoi/sw_defs.h 2019-03-19 20:04:02.000000000 +0000 +++ grass-7.8.0/vector/v.voronoi/sw_defs.h 2019-06-11 07:26:20.000000000 +0000 @@ -57,6 +57,7 @@ extern int nedges; extern struct Freelist efl; extern double xmin, xmax, ymin, ymax, deltax, deltay; +extern double xcenter, ycenter; extern struct Freelist hfl; extern struct Halfedge *ELleftend, *ELrightend; extern int ELhashsize; @@ -111,6 +112,7 @@ struct Site *nextone(void); int readsites(void); int readbounds(void); +int copybounds(void); /* sw_memory.c */ int freeinit(struct Freelist *, int); diff -Nru grass-7.6.1/vector/v.voronoi/sw_main.c grass-7.8.0/vector/v.voronoi/sw_main.c --- grass-7.6.1/vector/v.voronoi/sw_main.c 2019-03-19 20:04:04.000000000 +0000 +++ grass-7.8.0/vector/v.voronoi/sw_main.c 2019-06-11 07:26:20.000000000 +0000 @@ -19,6 +19,7 @@ int nedges; struct Freelist efl; double xmin, xmax, ymin, ymax, deltax, deltay; +double xcenter, ycenter; struct Freelist hfl; struct Halfedge *ELleftend, *ELrightend; int ELhashsize; @@ -30,7 +31,7 @@ struct Cell_head Window; struct bound_box Box; -struct Map_info In, Out; +struct Map_info In, Out, Out2; int Type; int Field; int in_area; @@ -138,6 +139,9 @@ ymin = ymax = sites[nsites].coord.y; } + sites[nsites].coord.x -= xcenter; + sites[nsites].coord.y -= ycenter; + nsites++; return nsites; @@ -259,7 +263,7 @@ Vect_set_constraint_type(&In, GV_BOUNDARY); Vect_set_constraint_field(&In, Field); - + l = 0; maxdist = 0; for (line = 1; line <= nlines; line++) { @@ -272,7 +276,7 @@ continue; area_id = 0; - if (n_areas(line, &area_id) != 1) + if (n_areas(line, &area_id) < 1) continue; Vect_read_line(&In, Points, Cats, line); @@ -299,8 +303,14 @@ continue; area_id = 0; - if (n_areas(line, &area_id) != 1) - continue; + if (skeleton) { + if (n_areas(line, &area_id) < 1) + continue; + } + else { + if (n_areas(line, &area_id) != 1) + continue; + } Vect_read_line(&In, Points, Cats, line); Vect_line_prune(Points); @@ -484,3 +494,44 @@ return 0; } + +int copybounds(void) +{ + int line, nlines, ltype; + int area_id; + int ncopied; + struct line_pnts *Points; + struct line_cats *Cats; + + Points = Vect_new_line_struct(); + Cats = Vect_new_cats_struct(); + + nlines = Vect_get_num_lines(&In); + ncopied = 0; + + for (line = 1; line <= nlines; line++) { + + if (!Vect_line_alive(&In, line)) + continue; + ltype = Vect_get_line_type(&In, line); + + if (!(ltype & GV_BOUNDARY)) + continue; + + if (n_areas(line, &area_id) != 2) + continue; + + Vect_read_line(&In, Points, Cats, line); + Vect_line_prune(Points); + + Vect_reset_cats(Cats); + Vect_cat_set(Cats, 1, 2); + Vect_write_line(&Out, GV_BOUNDARY, Points, Cats); + ncopied++; + } + + Vect_destroy_line_struct(Points); + Vect_destroy_cats_struct(Cats); + + return ncopied; +} diff -Nru grass-7.6.1/vector/v.voronoi/vo_extend.c grass-7.8.0/vector/v.voronoi/vo_extend.c --- grass-7.6.1/vector/v.voronoi/vo_extend.c 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.voronoi/vo_extend.c 2019-06-11 07:26:20.000000000 +0000 @@ -48,7 +48,7 @@ } /* south */ - nx = (c - b * s) / a; + nx = (c - b * (s - ycenter)) / a + xcenter; if (Vect_point_in_box(nx, s, 0.0, &Box) && ((nx > x && knownPointAtLeft) || (nx <= x && !knownPointAtLeft))) { @@ -58,7 +58,7 @@ } /* north */ - nx = (c - b * n) / a; + nx = (c - b * (n - ycenter)) / a + xcenter; if (Vect_point_in_box(nx, n, 0.0, &Box) && ((nx > x && knownPointAtLeft) || (nx <= x && !knownPointAtLeft))) { @@ -69,7 +69,7 @@ if (knownPointAtLeft) { /* east */ - ny = (c - a * e) / b; + ny = (c - a * (e - xcenter)) / b + ycenter; if (Vect_point_in_box(e, ny, 0.0, &Box)) { *c_x = e; *c_y = ny; @@ -78,7 +78,7 @@ } else { /* west */ - ny = (c - a * w) / b; + ny = (c - a * (w - xcenter)) / b + ycenter; if (Vect_point_in_box(w, ny, 0.0, &Box)) { *c_x = w; *c_y = ny; diff -Nru grass-7.6.1/vector/v.voronoi/vo_write.c grass-7.8.0/vector/v.voronoi/vo_write.c --- grass-7.6.1/vector/v.voronoi/vo_write.c 2019-03-19 20:04:03.000000000 +0000 +++ grass-7.8.0/vector/v.voronoi/vo_write.c 2019-06-11 07:26:20.000000000 +0000 @@ -12,6 +12,7 @@ int i, area1, area2; static struct line_pnts *APoints = NULL; static struct line_cats *Cats = NULL; + int ret; if (!APoints) { APoints = Vect_new_line_struct(); @@ -22,21 +23,51 @@ return 0; if ((area2 = Vect_find_area(&In, Points->x[1], Points->y[1])) == 0) return 0; - if (area1 != area2) - return 0; + ret = 1; if (!Vect_get_area_centroid(&In, area1)) - return 0; - Vect_get_area_points(&In, area1, APoints); - if (Vect_line_check_intersection(Points, APoints, 0)) - return 0; + ret = 0; - for (i = 0; i < Vect_get_area_num_isles(&In, area1); i++) { - Vect_get_isle_points(&In, Vect_get_area_isle(&In, area1, i), APoints); + if (ret) { + Vect_get_area_points(&In, area1, APoints); if (Vect_line_check_intersection(Points, APoints, 0)) - return 0; + ret = 0; + } + + if (ret) { + for (i = 0; i < Vect_get_area_num_isles(&In, area1); i++) { + Vect_get_isle_points(&In, Vect_get_area_isle(&In, area1, i), APoints); + if (Vect_line_check_intersection(Points, APoints, 0)) { + ret = 0; + break; + } + } } + + if (!ret && area1 != area2) { + ret = 1; + if (!Vect_get_area_centroid(&In, area2)) + ret = 0; + if (ret) { + Vect_get_area_points(&In, area2, APoints); + if (Vect_line_check_intersection(Points, APoints, 0)) + ret = 0; + } + + if (ret) { + for (i = 0; i < Vect_get_area_num_isles(&In, area2); i++) { + Vect_get_isle_points(&In, Vect_get_area_isle(&In, area2, i), APoints); + if (Vect_line_check_intersection(Points, APoints, 0)) { + ret = 0; + break; + } + } + } + } + if (!ret) + return 0; + Vect_get_area_cats(&In, area1, Cats); Vect_write_line(&Out, GV_LINE, Points, Cats); @@ -66,16 +97,18 @@ if (!Points) { Points = Vect_new_line_struct(); Cats = Vect_new_cats_struct(); + if (in_area) + Vect_cat_set(Cats, 1, 1); } if (in_area && e->reg[le]->sitenbr == e->reg[re]->sitenbr) return 0; if (e->ep[le] != NULL && e->ep[re] != NULL) { /* both end defined */ - x1 = e->ep[le]->coord.x; - y1 = e->ep[le]->coord.y; - x2 = e->ep[re]->coord.x; - y2 = e->ep[re]->coord.y; + x1 = e->ep[le]->coord.x + xcenter; + y1 = e->ep[le]->coord.y + ycenter; + x2 = e->ep[re]->coord.x + xcenter; + y2 = e->ep[re]->coord.y + ycenter; if (!Vect_point_in_box(x1, y1, 0.0, &Box) || !Vect_point_in_box(x2, y2, 0.0, &Box)) { @@ -98,19 +131,19 @@ int knownPointAtLeft = -1; if (e->ep[le] != NULL) { - x1 = e->ep[le]->coord.x; - y1 = e->ep[le]->coord.y; + x1 = e->ep[le]->coord.x + xcenter; + y1 = e->ep[le]->coord.y + ycenter; knownPointAtLeft = 1; } else if (e->ep[re] != NULL) { - x1 = e->ep[re]->coord.x; - y1 = e->ep[re]->coord.y; + x1 = e->ep[re]->coord.x + xcenter; + y1 = e->ep[re]->coord.y + ycenter; knownPointAtLeft = 0; } if (knownPointAtLeft == -1) { - x2 = (e->reg[le]->coord.x + e->reg[re]->coord.x) / 2.0; - y2 = (e->reg[le]->coord.y + e->reg[re]->coord.y) / 2.0; + x2 = (e->reg[le]->coord.x + e->reg[re]->coord.x) / 2.0 + xcenter; + y2 = (e->reg[le]->coord.y + e->reg[re]->coord.y) / 2.0 + ycenter; knownPointAtLeft = 0; if (!extend_line(Box.S, Box.N, Box.W, Box.E, e->a, e->b, e->c, x2, y2, &x1, &y1, diff -Nru grass-7.6.1/vector/v.voronoi/v.voronoi.html grass-7.8.0/vector/v.voronoi/v.voronoi.html --- grass-7.6.1/vector/v.voronoi/v.voronoi.html 2019-03-19 20:04:02.000000000 +0000 +++ grass-7.8.0/vector/v.voronoi/v.voronoi.html 2019-06-11 07:26:20.000000000 +0000 @@ -16,6 +16,12 @@

    NOTES

    +v.voronoi suffers from numerical instability, results can +sometimes contain many artefacts. When creating Voronoi diagrams for areas +or skeletons for areas, it is highly recommended to simplify the areas first +with v.generalize. + +

    Voronoi diagrams may be used for nearest-neighbor flood filling. Give the centroids attributes (start with v.db.addcolumn), @@ -92,4 +98,4 @@ GRASS 5.7 update: Radim Blazek
    Markus Metz -

    Last changed: $Date: 2015-06-08 09:20:07 +0200 (Mon, 08 Jun 2015) $ +

    Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.what/testsuite/test_vwhat_layers.py grass-7.8.0/vector/v.what/testsuite/test_vwhat_layers.py --- grass-7.6.1/vector/v.what/testsuite/test_vwhat_layers.py 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.what/testsuite/test_vwhat_layers.py 2019-06-03 20:34:21.000000000 +0000 @@ -3,7 +3,7 @@ from grass.gunittest.main import test from grass.gunittest.gmodules import SimpleModule -out1 = """East: 634243 +out1 = u"""East: 634243 North: 226193 ------------------------------------------------------------------ Map: test_vector @@ -24,7 +24,7 @@ """ -out2 = """East: 634243 +out2 = u"""East: 634243 North: 226193 ------------------------------------------------------------------ Map: test_vector @@ -70,7 +70,7 @@ number : 8.09 """ -out3 = """East=634243 +out3 = u"""East=634243 North=226193 Map=test_vector @@ -112,7 +112,7 @@ number=8.09 """ -out4 = """East=634243 +out4 = u"""East=634243 North=226193 Map=test_vector @@ -139,7 +139,7 @@ number=6 """ -out5 = """East=634243 +out5 = u"""East=634243 North=226193 Map=test_vector @@ -195,7 +195,7 @@ self.vwhat.flags['a'].value = True self.assertModule(self.vwhat) try: - json.loads(self.vwhat.outputs.stdout, encoding='utf-8') + json.loads(self.vwhat.outputs.stdout) except ValueError: self.fail(msg="No JSON object could be decoded:\n" + self.vwhat.outputs.stdout) diff -Nru grass-7.6.1/vector/v.what/testsuite/test_vwhat_ncspm.py grass-7.8.0/vector/v.what/testsuite/test_vwhat_ncspm.py --- grass-7.6.1/vector/v.what/testsuite/test_vwhat_ncspm.py 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.what/testsuite/test_vwhat_ncspm.py 2019-06-03 20:34:21.000000000 +0000 @@ -7,7 +7,7 @@ # v.what map=schools,roadsmajor,elev_points,geology layer=-1,-1,-1,-1 coordinates=636661,226489 distance=1000 -out1 = """East: 636661 +out1 = u"""East: 636661 North: 226489 ------------------------------------------------------------------ Map: schools @@ -38,7 +38,7 @@ """ # v.what map=schools,roadsmajor,elev_points,geology layer=-1,-1,-1,-1 coordinates=636661,226489 distance=1000 -ag -out2 = """East: 636661 +out2 = u"""East: 636661 North: 226489 ------------------------------------------------------------------ Map: schools @@ -94,7 +94,7 @@ """ # v.what map=schools,roadsmajor,elev_points,geology layer=-1,-1,-1,-1 coordinates=636661,226489 distance=1000 -ag -out3 = """East=636661 +out3 = u"""East=636661 North=226489 Map=schools @@ -146,7 +146,7 @@ """ # v.what map=schools,roadsmajor,elev_points,geology layer=-1,-1,-1,-1 coordinates=636661,226489 distance=100 -out4 = """East: 636661 +out4 = u"""East: 636661 North: 226489 ------------------------------------------------------------------ Map: schools diff -Nru grass-7.6.1/vector/v.what/v.what.html grass-7.8.0/vector/v.what/v.what.html --- grass-7.6.1/vector/v.what/v.what.html 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.what/v.what.html 2019-05-18 15:50:05.000000000 +0000 @@ -42,4 +42,4 @@ Edmonton, Alberta, Canada

    -Last changed: $Date: 2014-10-22 12:22:22 +0200 (Wed, 22 Oct 2014) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.what/what.c grass-7.8.0/vector/v.what/what.c --- grass-7.6.1/vector/v.what/what.c 2019-03-19 20:04:09.000000000 +0000 +++ grass-7.8.0/vector/v.what/what.c 2019-05-22 21:47:51.000000000 +0000 @@ -73,7 +73,7 @@ G_fatal_error(_("Cannot fetch next record")); if (!more) { - G_warning(_("No database record")); + G_verbose_message(_("No database record")); *form = G_store("No record selected."); } else { @@ -91,6 +91,7 @@ switch (output) { case OUTPUT_JSON: formbuf = G_str_replace(db_get_string(&str), "\\", "\\\\"); + formbuf = G_str_replace(formbuf, "\"", "\\\""); sprintf(buf, "%s\"%s\": \"%s\"", col == 0 ? "" : ",\n", colname, formbuf); G_free(formbuf); diff -Nru grass-7.6.1/vector/v.what.rast/search.c grass-7.8.0/vector/v.what.rast/search.c --- grass-7.6.1/vector/v.what.rast/search.c 2019-03-19 20:04:10.000000000 +0000 +++ grass-7.8.0/vector/v.what.rast/search.c 2019-06-03 20:34:21.000000000 +0000 @@ -5,7 +5,10 @@ { const struct order *i = ii, *j = jj; - return i->row - j->row; + if (i->row < j->row) + return -1; + + return (i->row > j->row); } /* for qsort, order list by cat */ @@ -13,7 +16,10 @@ { const struct order *i = ii, *j = jj; - return i->cat - j->cat; + if (i->cat < j->cat) + return -1; + + return (i->cat > j->cat); } /* for bsearch, find cat */ diff -Nru grass-7.6.1/vector/v.what.rast/v.what.rast.html grass-7.8.0/vector/v.what.rast/v.what.rast.html --- grass-7.6.1/vector/v.what.rast/v.what.rast.html 2019-03-19 20:04:10.000000000 +0000 +++ grass-7.8.0/vector/v.what.rast/v.what.rast.html 2019-05-18 15:50:05.000000000 +0000 @@ -117,4 +117,4 @@ Hamish Bowman (interpolation)

    -Last changed: $Date: 2016-04-09 18:43:25 +0200 (Sat, 09 Apr 2016) $ +Last changed: $Date$ diff -Nru grass-7.6.1/vector/v.what.rast3/search.c grass-7.8.0/vector/v.what.rast3/search.c --- grass-7.6.1/vector/v.what.rast3/search.c 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.what.rast3/search.c 2019-06-03 20:34:21.000000000 +0000 @@ -5,7 +5,10 @@ { const struct order *i = ii, *j = jj; - return i->cat - j->cat; + if (i->cat < j->cat) + return -1; + + return (i->cat > j->cat); } /* for bsearch, find cat */ diff -Nru grass-7.6.1/vector/v.what.rast3/v.what.rast3.html grass-7.8.0/vector/v.what.rast3/v.what.rast3.html --- grass-7.6.1/vector/v.what.rast3/v.what.rast3.html 2019-03-19 20:04:08.000000000 +0000 +++ grass-7.8.0/vector/v.what.rast3/v.what.rast3.html 2019-05-18 15:50:05.000000000 +0000 @@ -55,4 +55,4 @@ Soeren Gebbert, heavily based on v.what.rast by Radim Blazek

    -Last changed: $Date: 2018-06-12 00:50:44 +0200 (Tue, 12 Jun 2018) $ +Last changed: $Date$ diff -Nru grass-7.6.1/visualization/ximgview/ximgview.html grass-7.8.0/visualization/ximgview/ximgview.html --- grass-7.6.1/visualization/ximgview/ximgview.html 2019-03-19 20:03:58.000000000 +0000 +++ grass-7.8.0/visualization/ximgview/ximgview.html 2019-05-18 15:50:05.000000000 +0000 @@ -42,4 +42,4 @@

    AUTHOR

    Glynn Clements -

    Last changed: $Date: 2014-10-27 18:15:56 +0100 (Mon, 27 Oct 2014) $ +

    Last changed: $Date$