diff -Nru ubuntuone-client-2.99.4/configure ubuntuone-client-2.99.5/configure --- ubuntuone-client-2.99.4/configure 2012-02-16 14:41:45.000000000 +0000 +++ ubuntuone-client-2.99.5/configure 2012-02-23 16:53:01.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for ubuntuone-client 2.99.4. +# Generated by GNU Autoconf 2.68 for ubuntuone-client 2.99.5. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -627,8 +627,8 @@ # Identity of this package. PACKAGE_NAME='ubuntuone-client' PACKAGE_TARNAME='ubuntuone-client' -PACKAGE_VERSION='2.99.4' -PACKAGE_STRING='ubuntuone-client 2.99.4' +PACKAGE_VERSION='2.99.5' +PACKAGE_STRING='ubuntuone-client 2.99.5' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -673,6 +673,7 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +REACTOR SSO_PING_URL SSO_TC_URL SSO_APP_NAME @@ -1467,7 +1468,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ubuntuone-client 2.99.4 to adapt to many kinds of systems. +\`configure' configures ubuntuone-client 2.99.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1538,7 +1539,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ubuntuone-client 2.99.4:";; + short | recursive ) echo "Configuration of ubuntuone-client 2.99.5:";; esac cat <<\_ACEOF @@ -1667,7 +1668,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ubuntuone-client configure 2.99.4 +ubuntuone-client configure 2.99.5 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1945,7 +1946,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ubuntuone-client $as_me 2.99.4, which was +It was created by ubuntuone-client $as_me 2.99.5, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2762,7 +2763,7 @@ # Define the identity of the package. PACKAGE='ubuntuone-client' - VERSION='2.99.4' + VERSION='2.99.5' cat >>confdefs.h <<_ACEOF @@ -14041,6 +14042,13 @@ ac_config_files="$ac_config_files Makefile data/Makefile libsyncdaemon/Makefile libsyncdaemon/libsyncdaemon-1.0.pc po/Makefile.in docs/Makefile docs/reference/Makefile" +if [ -n "$(lsb_release -r | grep -v '1[2-9].[0-9][0-9]')" ]; then + REACTOR="glib"; +else + REACTOR="gi" +fi + + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -14619,7 +14627,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ubuntuone-client $as_me 2.99.4, which was +This file was extended by ubuntuone-client $as_me 2.99.5, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14685,7 +14693,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ubuntuone-client config.status 2.99.4 +ubuntuone-client config.status 2.99.5 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -Nru ubuntuone-client-2.99.4/configure.ac ubuntuone-client-2.99.5/configure.ac --- ubuntuone-client-2.99.4/configure.ac 2012-02-16 14:41:19.000000000 +0000 +++ ubuntuone-client-2.99.5/configure.ac 2012-02-22 19:16:03.000000000 +0000 @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.53) -AC_INIT([ubuntuone-client], [2.99.4]) +AC_INIT([ubuntuone-client], [2.99.5]) AC_CONFIG_SRCDIR([config.h.in]) AM_INIT_AUTOMAKE([1.10 foreign]) @@ -219,4 +219,11 @@ docs/reference/Makefile ]) +if [[ -n "$(lsb_release -r | grep -v '1[2-9].[0-9][0-9]')" ]]; then + REACTOR="glib"; +else + REACTOR="gi" +fi +AC_SUBST(REACTOR) + AC_OUTPUT diff -Nru ubuntuone-client-2.99.4/data/Makefile.in ubuntuone-client-2.99.5/data/Makefile.in --- ubuntuone-client-2.99.4/data/Makefile.in 2012-02-16 14:41:46.000000000 +0000 +++ ubuntuone-client-2.99.5/data/Makefile.in 2012-02-23 16:53:02.000000000 +0000 @@ -193,6 +193,7 @@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ +REACTOR = @REACTOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ diff -Nru ubuntuone-client-2.99.4/debian/changelog ubuntuone-client-2.99.5/debian/changelog --- ubuntuone-client-2.99.4/debian/changelog 2012-02-20 16:18:06.000000000 +0000 +++ ubuntuone-client-2.99.5/debian/changelog 2012-02-23 17:04:54.000000000 +0000 @@ -1,3 +1,14 @@ +ubuntuone-client (2.99.5-0ubuntu1) precise; urgency=low + + * New upstream release. + - Call network_connected properly on all platforms. (LP: #885292) + - Check whether to call handle_dir_delete in a better place. + - Use glib reactor to run tests if release is < 12.04. + * debian/watch: + - Update watch file for new release. + + -- Rodney Dawes Thu, 23 Feb 2012 12:02:01 -0500 + ubuntuone-client (2.99.4-0ubuntu2) precise; urgency=low * debian/control: diff -Nru ubuntuone-client-2.99.4/debian/watch ubuntuone-client-2.99.5/debian/watch --- ubuntuone-client-2.99.4/debian/watch 2012-02-20 16:15:25.000000000 +0000 +++ ubuntuone-client-2.99.5/debian/watch 2012-02-23 17:00:25.000000000 +0000 @@ -1,3 +1,3 @@ version=3 -http://launchpad.net/ubuntuone-client/stable-3-0/2.99.4 .*/ubuntuone-client-([0-9.]+)\.tar\.gz +http://launchpad.net/ubuntuone-client/stable-3-0/2.99.5 .*/ubuntuone-client-([0-9.]+)\.tar\.gz diff -Nru ubuntuone-client-2.99.4/docs/Makefile.in ubuntuone-client-2.99.5/docs/Makefile.in --- ubuntuone-client-2.99.4/docs/Makefile.in 2012-02-16 14:41:47.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/Makefile.in 2012-02-23 16:53:02.000000000 +0000 @@ -230,6 +230,7 @@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ +REACTOR = @REACTOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ diff -Nru ubuntuone-client-2.99.4/docs/reference/Makefile.in ubuntuone-client-2.99.5/docs/reference/Makefile.in --- ubuntuone-client-2.99.4/docs/reference/Makefile.in 2012-02-16 14:41:47.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/Makefile.in 2012-02-23 16:53:02.000000000 +0000 @@ -167,6 +167,7 @@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ +REACTOR = @REACTOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/libsyncdaemon.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/libsyncdaemon.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/libsyncdaemon.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/libsyncdaemon.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-authentication.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-authentication.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-authentication.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-authentication.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-config-interface.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-config-interface.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-config-interface.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-config-interface.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-credentials.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-credentials.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-credentials.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-credentials.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-daemon.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-daemon.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-daemon.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-daemon.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-events-interface.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-events-interface.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-events-interface.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-events-interface.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-file-info.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-file-info.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-file-info.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-file-info.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-filesystem-interface.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-filesystem-interface.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-filesystem-interface.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-filesystem-interface.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-folder-info.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-folder-info.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-folder-info.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-folder-info.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-folders-interface.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-folders-interface.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-folders-interface.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-folders-interface.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-interface.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-interface.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-interface.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-interface.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-marshal.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-marshal.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-marshal.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-marshal.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-metadata.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-metadata.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-metadata.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-metadata.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-publicfiles-interface.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-publicfiles-interface.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-publicfiles-interface.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-publicfiles-interface.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-share-info.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-share-info.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-share-info.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-share-info.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-shares-interface.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-shares-interface.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-shares-interface.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-shares-interface.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-status-info.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-status-info.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-status-info.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-status-info.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-status-interface.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-status-interface.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-status-interface.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-status-interface.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-transfer-info.sgml ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-transfer-info.sgml --- ubuntuone-client-2.99.4/docs/reference/tmpl/syncdaemon-transfer-info.sgml 2012-02-16 14:42:12.000000000 +0000 +++ ubuntuone-client-2.99.5/docs/reference/tmpl/syncdaemon-transfer-info.sgml 2012-02-23 16:54:33.000000000 +0000 @@ -9,13 +9,11 @@ - - diff -Nru ubuntuone-client-2.99.4/libsyncdaemon/Makefile.in ubuntuone-client-2.99.5/libsyncdaemon/Makefile.in --- ubuntuone-client-2.99.4/libsyncdaemon/Makefile.in 2012-02-16 14:41:47.000000000 +0000 +++ ubuntuone-client-2.99.5/libsyncdaemon/Makefile.in 2012-02-23 16:53:02.000000000 +0000 @@ -273,6 +273,7 @@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ +REACTOR = @REACTOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ diff -Nru ubuntuone-client-2.99.4/libsyncdaemon/test_libsyncdaemon_vala.stamp ubuntuone-client-2.99.5/libsyncdaemon/test_libsyncdaemon_vala.stamp --- ubuntuone-client-2.99.4/libsyncdaemon/test_libsyncdaemon_vala.stamp 2012-02-02 16:54:19.000000000 +0000 +++ ubuntuone-client-2.99.5/libsyncdaemon/test_libsyncdaemon_vala.stamp 2012-02-23 16:53:41.000000000 +0000 @@ -0,0 +1 @@ +stamp diff -Nru ubuntuone-client-2.99.4/libsyncdaemon/test-libsyncdaemon-vapi.c ubuntuone-client-2.99.5/libsyncdaemon/test-libsyncdaemon-vapi.c --- ubuntuone-client-2.99.4/libsyncdaemon/test-libsyncdaemon-vapi.c 2012-02-02 16:54:18.000000000 +0000 +++ ubuntuone-client-2.99.5/libsyncdaemon/test-libsyncdaemon-vapi.c 2012-02-23 16:53:19.000000000 +0000 @@ -1,4 +1,4 @@ -/* test-libsyncdaemon-vapi.c generated by valac 0.14.1, the Vala compiler +/* test-libsyncdaemon-vapi.c generated by valac 0.14.2, the Vala compiler * generated from test-libsyncdaemon-vapi.vala, do not modify */ /* diff -Nru ubuntuone-client-2.99.4/libsyncdaemon/test_libsyncdaemon_vapi_vala.stamp ubuntuone-client-2.99.5/libsyncdaemon/test_libsyncdaemon_vapi_vala.stamp --- ubuntuone-client-2.99.4/libsyncdaemon/test_libsyncdaemon_vapi_vala.stamp 2012-02-02 16:54:18.000000000 +0000 +++ ubuntuone-client-2.99.5/libsyncdaemon/test_libsyncdaemon_vapi_vala.stamp 2012-02-23 16:53:19.000000000 +0000 @@ -0,0 +1 @@ +stamp diff -Nru ubuntuone-client-2.99.4/Makefile.am ubuntuone-client-2.99.5/Makefile.am --- ubuntuone-client-2.99.4/Makefile.am 2012-02-16 14:41:07.000000000 +0000 +++ ubuntuone-client-2.99.5/Makefile.am 2012-02-22 19:11:58.000000000 +0000 @@ -53,13 +53,13 @@ test: logging.conf $(clientdefs_DATA) Makefile echo "$(PYTHONPATH)" if test "x$(builddir)" == "x$(srcdir)"; then \ - PYTHONPATH="$(PYTHONPATH)" u1trial -r gi -p tests/platform/windows tests; \ + PYTHONPATH="$(PYTHONPATH)" u1trial -r $(REACTOR) -p tests/platform/windows tests; \ fi rm -rf _trial_temp test-coverage: logging.conf $(clientdefs_DATA) Makefile if test "x$(builddir)" == "x$(srcdir)"; then \ - PYTHONPATH="$(PYTHONPATH)" u1trial -r gi -c -p tests/platform/windows tests; \ + PYTHONPATH="$(PYTHONPATH)" u1trial -r $(REACTOR) -c -p tests/platform/windows tests; \ fi rm -rf _trial_temp diff -Nru ubuntuone-client-2.99.4/Makefile.in ubuntuone-client-2.99.5/Makefile.in --- ubuntuone-client-2.99.4/Makefile.in 2012-02-16 14:41:47.000000000 +0000 +++ ubuntuone-client-2.99.5/Makefile.in 2012-02-23 16:53:02.000000000 +0000 @@ -254,6 +254,7 @@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ +REACTOR = @REACTOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -1012,13 +1013,13 @@ test: logging.conf $(clientdefs_DATA) Makefile echo "$(PYTHONPATH)" if test "x$(builddir)" == "x$(srcdir)"; then \ - PYTHONPATH="$(PYTHONPATH)" u1trial -r gi -p tests/platform/windows tests; \ + PYTHONPATH="$(PYTHONPATH)" u1trial -r $(REACTOR) -p tests/platform/windows tests; \ fi rm -rf _trial_temp test-coverage: logging.conf $(clientdefs_DATA) Makefile if test "x$(builddir)" == "x$(srcdir)"; then \ - PYTHONPATH="$(PYTHONPATH)" u1trial -r gi -c -p tests/platform/windows tests; \ + PYTHONPATH="$(PYTHONPATH)" u1trial -r $(REACTOR) -c -p tests/platform/windows tests; \ fi rm -rf _trial_temp diff -Nru ubuntuone-client-2.99.4/tests/platform/linux/test_dbus.py ubuntuone-client-2.99.5/tests/platform/linux/test_dbus.py --- ubuntuone-client-2.99.4/tests/platform/linux/test_dbus.py 2012-02-02 16:38:19.000000000 +0000 +++ ubuntuone-client-2.99.5/tests/platform/linux/test_dbus.py 2012-02-22 19:11:58.000000000 +0000 @@ -39,8 +39,8 @@ DBUS_IFACE_FOLDERS_NAME, DBUS_IFACE_PUBLIC_FILES_NAME, DBUS_IFACE_LAUNCHER_NAME, - NM_STATE_CONNECTED_GLOBAL, - NM_STATE_DISCONNECTED, +# NM_STATE_CONNECTED_GLOBAL, +# NM_STATE_DISCONNECTED, ) from ubuntuone.platform.tools.linux import DBusClient @@ -76,11 +76,11 @@ def emit_connected(self): """ Emits the signal StateCganged(3). """ - self.StateChanged(NM_STATE_CONNECTED_GLOBAL) + self.StateChanged(70) def emit_disconnected(self): """ Emits the signal StateCganged(4). """ - self.StateChanged(NM_STATE_DISCONNECTED) + self.StateChanged(20) @dbus.service.method(dbus.PROPERTIES_IFACE, in_signature='ss', out_signature='v', @@ -95,7 +95,7 @@ @dbus.service.method('org.freedesktop.NetworkManager') def state(self): """Fake the state.""" - return NM_STATE_CONNECTED_GLOBAL + return 70 # pylint: enable-msg=C0103 @@ -208,40 +208,6 @@ DBusTwistedTestCase = IPCTestCase # API compatibility -class NetworkManagerIntegrationTests(IPCTestCase): - """Test case for our NetworkManager integration.""" - - def test_nm_signals(self): - """Test that NM signals are received and handled properly.""" - result = None - d = defer.Deferred() - - class Listener(object): - """Helper class.""" - - # class-closure, cannot use self, pylint: disable=E0213 - def handle_SYS_NET_CONNECTED(innerself): - self.nm.emit_disconnected() - - def handle_SYS_NET_DISCONNECTED(innerself): - self.assertTrue(result) - - listener = Listener() - self.event_q.subscribe(listener) - - def empty_queue_cb(): - d.callback(True) - - def callback(result): - self.event_q.unsubscribe(listener) - self.event_q.remove_empty_event_queue_callback(empty_queue_cb) - d.addCallback(callback) - - self.nm.emit_connected() - self.event_q.add_empty_event_queue_callback(empty_queue_cb) - return d - - class StatusTestCase(IPCTestCase): """Tests for the Status exposed object.""" diff -Nru ubuntuone-client-2.99.4/tests/platform/windows/test_ipc.py ubuntuone-client-2.99.5/tests/platform/windows/test_ipc.py --- ubuntuone-client-2.99.4/tests/platform/windows/test_ipc.py 2012-02-02 16:38:19.000000000 +0000 +++ ubuntuone-client-2.99.5/tests/platform/windows/test_ipc.py 2012-02-22 19:11:58.000000000 +0000 @@ -652,10 +652,6 @@ 'Remote object should not be None') self.assertIsInstance(remote, RemoteReference) - def test_daemonized(self): - """Check that the NM thread won't block the process.""" - self.assertTrue(self.interface.network_manager_thread.daemon) - class IPCPortTestCase(TestCase): """Tests for the ipc port setup.""" diff -Nru ubuntuone-client-2.99.4/tests/platform/windows/test_network_manager.py ubuntuone-client-2.99.5/tests/platform/windows/test_network_manager.py --- ubuntuone-client-2.99.4/tests/platform/windows/test_network_manager.py 2012-02-02 16:38:19.000000000 +0000 +++ ubuntuone-client-2.99.5/tests/platform/windows/test_network_manager.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Author: Manuel de la Pena -# -# Copyright 2011 Canonical Ltd. -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 3, as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranties of -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . - -"""Tests for the network manager.""" - -from mocker import MockerTestCase - -from ubuntuone.platform.windows.network_manager import NetworkManager - - -class TestNetworkManager(MockerTestCase): - """Test he Network Manager.""" - - def setUp(self): - super(TestNetworkManager, self).setUp() - self.connection_info = self.mocker.mock() - self.connection_no_info = self.mocker.mock() - self.disconnected = self.mocker.mock() - self.manager = NetworkManager(self.connection_no_info, - self.connection_info, self.disconnected) - - def test_connection_made(self): - """Ensure db is called.""" - self.connection_info() - self.mocker.replay() - self.manager.ConnectionMade() - - def test_connection_made_no_cb(self): - """Ensure db is called.""" - self.manager.connected_cb_info = None - self.mocker.replay() - self.manager.ConnectionMade() - - def test_connection_made_no_info(self): - """Ensure db is called.""" - self.connection_no_info() - self.mocker.replay() - self.manager.ConnectionMadeNoQOCInfo() - - def test_connection_made_no_info_no_cb(self): - """Ensure db is called.""" - self.manager.connected_cb = None - self.mocker.replay() - self.manager.ConnectionMadeNoQOCInfo() - - def test_disconnection(self): - """Ensure db is called.""" - self.disconnected() - self.mocker.replay() - self.manager.ConnectionLost() - - def test_disconnection_no_cb(self): - """Ensure db is called.""" - self.manager.disconnected_cb = None - self.mocker.replay() - self.manager.ConnectionLost() diff -Nru ubuntuone-client-2.99.4/tests/syncdaemon/test_action_queue.py ubuntuone-client-2.99.5/tests/syncdaemon/test_action_queue.py --- ubuntuone-client-2.99.4/tests/syncdaemon/test_action_queue.py 2012-02-16 14:41:07.000000000 +0000 +++ ubuntuone-client-2.99.5/tests/syncdaemon/test_action_queue.py 2012-02-22 19:11:58.000000000 +0000 @@ -58,7 +58,7 @@ protocol_pb2, request, ) -from ubuntuone.syncdaemon import states, interfaces, config +from ubuntuone.syncdaemon import interfaces, config from ubuntuone.syncdaemon import action_queue from ubuntuone.syncdaemon.action_queue import ( ActionQueue, ActionQueueCommand, ChangePublicAccess, CreateUDF, @@ -1295,109 +1295,6 @@ "host 1.2.3.4", "port 4321")) -class NetworkmanagerTestCase(FactoryBaseTestCase): - """Base test case generating a connected factory.""" - - timeout = 15 - - @defer.inlineCallbacks - def setUp(self): - """Init.""" - yield super(NetworkmanagerTestCase, self).setUp() - self.action_queue.event_queue.push('SYS_NET_CONNECTED') - self.main.start() - - @defer.inlineCallbacks - def test_wrong_disconnect(self): - """Test factory's connection when SYS_NET_DISCONNECTED.""" - - d1 = self.main.wait_for('SYS_CONNECTION_MADE') - d2 = self.main.wait_for('SYS_CONNECTION_LOST') - - self.server = self._start_sample_webserver() - self.user_connect() - yield d1 - - self.action_queue.event_queue.push('SYS_NET_DISCONNECTED') - yield d2 - - @defer.inlineCallbacks - def test_disconnect_twice(self): - """Test connection when SYS_NET_DISCONNECTED is received twice.""" - - d1 = self.main.wait_for('SYS_CONNECTION_MADE') - d2 = self.main.wait_for('SYS_CONNECTION_LOST') - - self.server = self._start_sample_webserver() - self.user_connect() - yield d1 - - self.action_queue.event_queue.push('SYS_NET_DISCONNECTED') - yield d2 - - self.action_queue.event_queue.events = [] - self.action_queue.event_queue.push('SYS_NET_DISCONNECTED') - self.assertEqual([('SYS_NET_DISCONNECTED', {})], - self.action_queue.event_queue.events, - 'No new events after a misplaced SYS_NET_DISCONNECTED') - - @defer.inlineCallbacks - def test_net_connected_if_already_connected(self): - """Test connection when SYS_NET_CONNECTED is received twice.""" - - d1 = self.main.wait_for('SYS_CONNECTION_MADE') - - self.server = self._start_sample_webserver() - self.user_connect() - yield d1 - - self.action_queue.event_queue.events = [] - self.action_queue.event_queue.push('SYS_NET_CONNECTED') - self.assertEqual([('SYS_NET_CONNECTED', {})], - self.action_queue.event_queue.events, - 'No new events after a misplaced SYS_NET_CONNECTED') - - @defer.inlineCallbacks - def test_messy_mix(self): - """Test connection when a messy mix of events is received.""" - orig_waiting = states.MAX_WAITING - states.MAX_WAITING = 1 - - self.action_queue.event_queue.events = [] - self.server = self._start_sample_webserver() - - conn_made = self.main.wait_for('SYS_CONNECTION_MADE') - self.user_connect() - yield conn_made - - events = ['SYS_NET_CONNECTED', 'SYS_NET_DISCONNECTED', - 'SYS_NET_CONNECTED', 'SYS_NET_CONNECTED', - 'SYS_NET_DISCONNECTED', 'SYS_NET_DISCONNECTED', - 'SYS_NET_CONNECTED'] - - for i in events: - self.action_queue.event_queue.push(i) - - yield self.main.wait_for_nirvana() - - expected = ['SYS_NET_CONNECTED', # from the DBus fake NetworkManager - 'SYS_NET_CONNECTED', 'SYS_NET_DISCONNECTED', - 'SYS_CONNECTION_LOST', 'SYS_CONNECTION_RETRY', - 'SYS_NET_CONNECTED', 'SYS_NET_CONNECTED', - 'SYS_CONNECTION_MADE', 'SYS_NET_DISCONNECTED', - 'SYS_NET_DISCONNECTED'] - - avoid = ('SYS_STATE_CHANGED', 'SYS_LOCAL_RESCAN_DONE', - 'SYS_PROTOCOL_VERSION_OK', 'SYS_SET_CAPABILITIES_OK', - 'SYS_AUTH_OK', 'SYS_SERVER_RESCAN_DONE') - actual = [event for (event, kwargs) in - self.action_queue.event_queue.events - if event not in avoid] - self.assertEqual(sorted(expected), sorted(actual)) - - states.MAX_WAITING = orig_waiting - - class ConnectedBaseTestCase(FactoryBaseTestCase): """Base test case generating a connected factory.""" diff -Nru ubuntuone-client-2.99.4/tests/syncdaemon/test_eq_inotify.py ubuntuone-client-2.99.5/tests/syncdaemon/test_eq_inotify.py --- ubuntuone-client-2.99.4/tests/syncdaemon/test_eq_inotify.py 2012-02-02 16:38:19.000000000 +0000 +++ ubuntuone-client-2.99.5/tests/syncdaemon/test_eq_inotify.py 2012-02-22 19:11:58.000000000 +0000 @@ -1375,6 +1375,9 @@ if path != fromdir: self.finished_error("received a wrong path") else: + # file deletion should remove its watch + self.assertNotIn(path, self.eq.monitor._general_watchs) + remove_dir(todir) remove_dir(helpdir) self.finished_ok() @@ -1467,6 +1470,11 @@ todir = os.path.join(self.root_dir, "bar") make_dir(fromdir) + # patch to check proper dir deletion is handled + called = [] + self.patch(self.eq.monitor._processor.general_processor, + 'handle_dir_delete', lambda p: called.append(p)) + # patch the general processor to ignore all that ends with bar self.patch(self.eq.monitor._processor.general_processor, "is_ignored", lambda path: path.endswith("bar")) @@ -1479,6 +1487,7 @@ # generate the event rename(fromdir, todir) yield self._deferred + self.assertEqual(called, [fromdir]) @defer.inlineCallbacks def test_file_moved_from_ignored(self): @@ -1971,6 +1980,11 @@ yield self._create_udf('vol2', base2) self.fs.create(path=base2, share_id='vol2', is_dir=True) + # patch to check proper dir deletion is handled + called = [] + self.patch(self.eq.monitor._processor.general_processor, + 'handle_dir_delete', lambda p: called.append(p)) + # working stuff moving1 = os.path.join(base1, "test") moving2 = os.path.join(base2, "test") @@ -1987,6 +2001,7 @@ # generate the event rename(moving1, moving2) yield self._deferred + self.assertEqual(called, [moving1]) @defer.inlineCallbacks def test_move_file_across_volumes(self): diff -Nru ubuntuone-client-2.99.4/tests/syncdaemon/test_interaction_interfaces.py ubuntuone-client-2.99.5/tests/syncdaemon/test_interaction_interfaces.py --- ubuntuone-client-2.99.4/tests/syncdaemon/test_interaction_interfaces.py 2012-02-16 14:41:07.000000000 +0000 +++ ubuntuone-client-2.99.5/tests/syncdaemon/test_interaction_interfaces.py 2012-02-22 19:11:58.000000000 +0000 @@ -21,6 +21,7 @@ from twisted.internet import defer from ubuntuone.devtools.handlers import MementoHandler +from ubuntu_sso.networkstate import ONLINE from contrib.testing.testcase import ( FakeCommand, @@ -2218,7 +2219,21 @@ def test_rescan_from_scratch_missing_volume(self): """Test for rescan_from_scratch with a non-existing volume.""" volume_id = object() - self.assertRaises(ValueError, self.sd_obj.rescan_from_scratch, volume_id) + self.assertRaises(ValueError, + self.sd_obj.rescan_from_scratch, volume_id) + + def test_network_state_changed_with_connection(self): + """Test the network_state changed method with a connection.""" + self.sd_obj.network_state_changed(ONLINE) + + self.assertEqual(self.events, [('SYS_NET_CONNECTED', {})]) + + def test_network_state_changed_without_connection(self): + """Test the network_state changed method without a connection.""" + # Sending anything instead of ONLINE should be interpreted as OFFLINE + self.sd_obj.network_state_changed(object()) + + self.assertEqual(self.events, [('SYS_NET_DISCONNECTED', {})]) def test_network_connected(self): """Test the network_connected method.""" diff -Nru ubuntuone-client-2.99.4/tests/syncdaemon/test_states.py ubuntuone-client-2.99.5/tests/syncdaemon/test_states.py --- ubuntuone-client-2.99.4/tests/syncdaemon/test_states.py 2012-02-02 16:38:19.000000000 +0000 +++ ubuntuone-client-2.99.5/tests/syncdaemon/test_states.py 2012-02-22 19:11:58.000000000 +0000 @@ -847,58 +847,6 @@ self.assertFalse(self.aq.queue.active) -class TestStateManagerPassToNetworkManager(Base): - """All network events should go to NetworkManager.""" - - @defer.inlineCallbacks - def setUp(self): - yield super(TestStateManagerPassToNetworkManager, - self).setUp() - - # put a function in the middle to log calls - self.called_events = [] - orig_on_event = self.sm.connection.on_event - def fake_on_event(event): - """Log the call and call original.""" - self.called_events.append(event) - orig_on_event(event) - self.sm.connection.on_event = fake_on_event - - def _test(self, event): - """Generic test method.""" - cnt = 0 - for node in self.sm_nodes_ok: - cnt += 1 - self.sm.state = node - self.sm.handle_default(event) - self.assertEqual(self.called_events, [event]*cnt) - - def test_net_connected(self): - """SYS_NET_CONNECTED should go to Connection no matter where.""" - self._test('SYS_NET_CONNECTED') - - def test_user_connect(self): - """SYS_USER_CONNECT should go to Connection no matter where.""" - self._test('SYS_USER_CONNECT') - - def test_net_disconnected(self): - """SYS_NET_DISCONNECTED should go to Connection no matter where.""" - self._test('SYS_NET_DISCONNECTED') - - def test_user_disconnect(self): - """SYS_USER_DISCONNECT should go to Connection no matter where.""" - self._test('SYS_USER_DISCONNECT') - - def test_connection_lost(self): - """SYS_CONNECTION_LOST should go to Connection no matter where.""" - self._test('SYS_CONNECTION_LOST') - - def test_handshake_timeout(self): - """SYS_HANDSHAKE_TIMEOUT should go to Connection no matter where.""" - self._test('SYS_HANDSHAKE_TIMEOUT') - - - class TestStateManagerPassToQueueManager(Base): """All queue events should go to QueueManager.""" diff -Nru ubuntuone-client-2.99.4/ubuntuone/platform/__init__.py ubuntuone-client-2.99.5/ubuntuone/platform/__init__.py --- ubuntuone-client-2.99.4/ubuntuone/platform/__init__.py 2012-02-02 16:38:19.000000000 +0000 +++ ubuntuone-client-2.99.5/ubuntuone/platform/__init__.py 2012-02-22 19:11:58.000000000 +0000 @@ -31,6 +31,7 @@ from ubuntuone.platform import linux source = linux +# This imports needs to be here in order to belongs to this namespace from ubuntuone.platform import credentials from ubuntuone.platform import tools diff -Nru ubuntuone-client-2.99.4/ubuntuone/platform/linux/dbus_interface.py ubuntuone-client-2.99.5/ubuntuone/platform/linux/dbus_interface.py --- ubuntuone-client-2.99.4/ubuntuone/platform/linux/dbus_interface.py 2012-02-16 14:41:07.000000000 +0000 +++ ubuntuone-client-2.99.5/ubuntuone/platform/linux/dbus_interface.py 2012-02-22 19:11:58.000000000 +0000 @@ -41,28 +41,6 @@ DBUS_IFACE_PUBLIC_FILES_NAME = DBUS_IFACE_NAME + '.PublicFiles' DBUS_IFACE_LAUNCHER_NAME = DBUS_IFACE_NAME + '.Launcher' -# NetworkManager State constants -NM_STATE_UNKNOWN = 0 -NM_STATE_ASLEEP_OLD = 1 -NM_STATE_ASLEEP = 10 -NM_STATE_CONNECTING_OLD = 2 -NM_STATE_CONNECTING = 40 -NM_STATE_CONNECTED_OLD = 3 -NM_STATE_CONNECTED_LOCAL = 50 -NM_STATE_CONNECTED_SITE = 60 -NM_STATE_CONNECTED_GLOBAL = 70 -NM_STATE_DISCONNECTED_OLD = 4 -NM_STATE_DISCONNECTED = 20 - -# NM state -> online/offline mapping -# Note that the LOCAL and SITE mappings are *not* a typo. Local and site links -# are not enough to connect to one.ubuntu.com, so we treat them as if we were -# not connected. -NM_STATE_ONLINE_EVENTS = [ - NM_STATE_CONNECTED_OLD, - NM_STATE_CONNECTED_GLOBAL, -] - logger = logging.getLogger("ubuntuone.SyncDaemon.DBus") @@ -865,39 +843,6 @@ self.config = Config(self.busName, service) self.service = service - def error_handler(error): - """Handle errors from NM.""" - logger.error("Error while getting the NetworkManager state %s", - error) - # If we get an error back from NetworkManager, we should - # just try to connect anyway; it probably means that - # NetworkManager is down or broken or something. - self.connection_state_changed(NM_STATE_CONNECTED_GLOBAL) - try: - nm = self.system_bus.get_object( - 'org.freedesktop.NetworkManager', - '/org/freedesktop/NetworkManager', - follow_name_owner_changes=True) - iface = dbus.Interface(nm, 'org.freedesktop.NetworkManager') - except dbus.DBusException, e: - if e.get_dbus_name() == \ - 'org.freedesktop.DBus.Error.ServiceUnknown': - # NetworkManager isn't running. - logger.warn("Unable to connect to NetworkManager. " - "Assuming we have network.") - self.connection_state_changed(NM_STATE_CONNECTED_GLOBAL) - else: - raise - else: - iface.state(reply_handler=self.connection_state_changed, - error_handler=error_handler) - - # register a handler to NM StateChanged signal - self.system_bus.add_signal_receiver(self.connection_state_changed, - signal_name='StateChanged', - dbus_interface='org.freedesktop.NetworkManager', - path='/org/freedesktop/NetworkManager') - logger.info('DBusInterface initialized.') def shutdown(self, with_restart=False): @@ -911,11 +856,6 @@ self.config.remove_from_connection() self.folders.remove_from_connection() self.launcher.remove_from_connection() - # remove the NM's StateChanged signal receiver - self.system_bus.remove_signal_receiver(self.connection_state_changed, - signal_name='StateChanged', - dbus_interface='org.freedesktop.NetworkManager', - path='/org/freedesktop/NetworkManager') self.bus.release_name(self.busName.get_name()) if with_restart: # this is what activate_name_owner boils down to, except that @@ -937,10 +877,3 @@ not: there is nothing we can do about it. """ _restart_error_handler = _restart_reply_handler - - def connection_state_changed(self, state): - """Push a connection state changed event to the Event Queue.""" - if state in NM_STATE_ONLINE_EVENTS: - self.service.network_connected() - else: - self.service.network_disconnected() diff -Nru ubuntuone-client-2.99.4/ubuntuone/platform/windows/ipc.py ubuntuone-client-2.99.5/ubuntuone/platform/windows/ipc.py --- ubuntuone-client-2.99.4/ubuntuone/platform/windows/ipc.py 2012-02-16 14:41:07.000000000 +0000 +++ ubuntuone-client-2.99.5/ubuntuone/platform/windows/ipc.py 2012-02-22 19:11:58.000000000 +0000 @@ -21,7 +21,6 @@ from functools import wraps from collections import defaultdict -from threading import Thread from twisted.internet import defer, reactor from twisted.spread.pb import ( @@ -38,7 +37,6 @@ ActivationInstance, AlreadyStartedError, ) -from ubuntuone.platform.windows.network_manager import NetworkManager logger = logging.getLogger("ubuntuone.SyncDaemon.Pb") LOCALHOST = "127.0.0.1" @@ -938,19 +936,6 @@ self.factory = PBServerFactory(self) self.listener = ipc_server_listen(self.factory) - # register to future network changes - self.network_manager = NetworkManager( - connected_cb=service.network_connected, - disconnected_cb=service.network_disconnected) - self.network_manager_thread = Thread( - target=self.network_manager.register, name='Network changes') - self.network_manager_thread.daemon = True - self.network_manager_thread.start() - - # XXX: the current network manager is not calling network_connected - # for now, let's fake it - service.network_connected() - logger.info('IPC initialized.') def shutdown(self, with_restart=False): diff -Nru ubuntuone-client-2.99.4/ubuntuone/platform/windows/network_manager.py ubuntuone-client-2.99.5/ubuntuone/platform/windows/network_manager.py --- ubuntuone-client-2.99.4/ubuntuone/platform/windows/network_manager.py 2012-02-02 16:38:19.000000000 +0000 +++ ubuntuone-client-2.99.5/ubuntuone/platform/windows/network_manager.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Author: Manuel de la Pena -# -# Copyright 2011 Canonical Ltd. -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 3, as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranties of -# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -"""Implementation of a Network Mnager using ISesNework in Python.""" -import logging - -import pythoncom - -from win32com.server.policy import DesignatedWrapPolicy -from win32com.client import Dispatch - -# set te logging to store the data in the ubuntuone folder -logger = logging.getLogger('ubuntuone.platform.windows.NetworkManager') - -## from EventSys.h -PROGID_EventSystem = "EventSystem.EventSystem" -PROGID_EventSubscription = "EventSystem.EventSubscription" - -# SENS (System Event Notification Service) values for the events, -# this events contain the uuid of the event, the name of the event to be used -# as well as the method name of the method in the ISesNetwork interface that -# will be executed for the event. -# For more ingo look at: -# http://msdn.microsoft.com/en-us/library/aa377384(v=vs.85).aspx - -SUBSCRIPTION_NETALIVE = ('{cd1dcbd6-a14d-4823-a0d2-8473afde360f}', - 'UbuntuOne Network Alive', - 'ConnectionMade') - -SUBSCRIPTION_NETALIVE_NOQOC = ('{a82f0e80-1305-400c-ba56-375ae04264a1}', - 'UbuntuOne Net Alive No Info', - 'ConnectionMadeNoQOCInfo') - -SUBSCRIPTION_NETLOST = ('{45233130-b6c3-44fb-a6af-487c47cee611}', - 'UbuntuOne Network Lost', - 'ConnectionLost') - -SUBSCRIPTION_REACH = ('{4c6b2afa-3235-4185-8558-57a7a922ac7b}', - 'UbuntuOne Network Reach', - 'ConnectionMade') - -SUBSCRIPTION_REACH_NOQOC = ('{db62fa23-4c3e-47a3-aef2-b843016177cf}', - 'UbuntuOne Network Reach No Info', - 'ConnectionMadeNoQOCInfo') - -SUBSCRIPTION_REACH_NOQOC2 = ('{d4d8097a-60c6-440d-a6da-918b619ae4b7}', - 'UbuntuOne Network Reach No Info 2', - 'ConnectionMadeNoQOCInfo') - -SUBSCRIPTIONS = [SUBSCRIPTION_NETALIVE, - SUBSCRIPTION_NETALIVE_NOQOC, - SUBSCRIPTION_NETLOST, - SUBSCRIPTION_REACH, - SUBSCRIPTION_REACH_NOQOC, - SUBSCRIPTION_REACH_NOQOC2] - -SENSGUID_EVENTCLASS_NETWORK = '{d5978620-5b9f-11d1-8dd2-00aa004abd5e}' -SENSGUID_PUBLISHER = "{5fee1bd6-5b9b-11d1-8dd2-00aa004abd5e}" - -# uuid of the implemented com interface -IID_ISesNetwork = '{d597bab1-5b9f-11d1-8dd2-00aa004abd5e}' - - -class NetworkManager(DesignatedWrapPolicy): - """Implement ISesNetwork to know about the network status.""" - - _com_interfaces_ = [IID_ISesNetwork] - _public_methods_ = ['ConnectionMade', - 'ConnectionMadeNoQOCInfo', - 'ConnectionLost'] - _reg_clsid_ = '{41B032DA-86B5-4907-A7F7-958E59333010}' - _reg_progid_ = "UbuntuOne.NetworkManager" - - def __init__(self, connected_cb=None, connected_cb_info=None, - disconnected_cb=None): - self._wrap_(self) - self.connected_cb = connected_cb - self.connected_cb_info = connected_cb_info - self.disconnected_cb = disconnected_cb - - def ConnectionMade(self, *args): - """Tell that the connection is up again.""" - logger.info('Connection was made.') - if self.connected_cb_info: - self.connected_cb_info() - - def ConnectionMadeNoQOCInfo(self, *args): - """Tell that the connection is up again.""" - logger.info('Connection was made no info.') - if self.connected_cb: - self.connected_cb() - - def ConnectionLost(self, *args): - """Tell the connection was lost.""" - logger.info('Connection was lost.') - if self.disconnected_cb: - self.disconnected_cb() - - def register(self): - """Register to listen to network events.""" - # call the CoInitialize to allow the registration to run in an other - # thread - pythoncom.CoInitialize() - # interface to be used by com - manager_interface = pythoncom.WrapObject(self) - event_system = Dispatch(PROGID_EventSystem) - # register to listent to each of the events to make sure that - # the code will work on all platforms. - for current_event in SUBSCRIPTIONS: - # create an event subscription and add it to the event - # service - event_subscription = Dispatch(PROGID_EventSubscription) - event_subscription.EventClassId = SENSGUID_EVENTCLASS_NETWORK - event_subscription.PublisherID = SENSGUID_PUBLISHER - event_subscription.SubscriptionID = current_event[0] - event_subscription.SubscriptionName = current_event[1] - event_subscription.MethodName = current_event[2] - event_subscription.SubscriberInterface = manager_interface - event_subscription.PerUser = True - # store the event - try: - event_system.Store(PROGID_EventSubscription, - event_subscription) - except pythoncom.com_error as e: - logger.error( - 'Error registering %s to event %s', e, current_event[1]) - - pythoncom.PumpMessages() - -if __name__ == '__main__': - # Run an expample of the code so that the user can test the code in - # real life. - from threading import Thread - - def connected(): - print 'Connected' - - def connected_info(): - print 'Connected' - - def disconnected(): - print 'Disconnected' - - manager = NetworkManager(connected, connected_info, disconnected) - p = Thread(target=manager.register) - p.start() diff -Nru ubuntuone-client-2.99.4/ubuntuone/syncdaemon/filesystem_notifications.py ubuntuone-client-2.99.5/ubuntuone/syncdaemon/filesystem_notifications.py --- ubuntuone-client-2.99.4/ubuntuone/syncdaemon/filesystem_notifications.py 2012-02-02 16:38:19.000000000 +0000 +++ ubuntuone-client-2.99.5/ubuntuone/syncdaemon/filesystem_notifications.py 2012-02-22 19:11:58.000000000 +0000 @@ -125,6 +125,8 @@ def eq_push(self, event_name, **event_data): """Sends to EQ the event data, maybe filtering it.""" + if event_name == 'FS_DIR_DELETE': + self.handle_dir_delete(event_data['path']) if not self._to_mute.pop(event_name, **event_data): self.monitor.eq.push(event_name, **event_data) @@ -149,8 +151,6 @@ return if not self.is_ignored(event.pathname): - if evt_name == 'FS_DIR_DELETE': - self.handle_dir_delete(event.pathname) self.eq_push(evt_name, path=event.pathname) def freeze_begin(self, path): diff -Nru ubuntuone-client-2.99.4/ubuntuone/syncdaemon/interaction_interfaces.py ubuntuone-client-2.99.5/ubuntuone/syncdaemon/interaction_interfaces.py --- ubuntuone-client-2.99.4/ubuntuone/syncdaemon/interaction_interfaces.py 2012-02-16 14:41:07.000000000 +0000 +++ ubuntuone-client-2.99.5/ubuntuone/syncdaemon/interaction_interfaces.py 2012-02-22 19:11:58.000000000 +0000 @@ -36,6 +36,8 @@ from twisted.internet import defer +from ubuntu_sso.networkstate import NetworkManagerState, ONLINE + from ubuntuone.logger import log_call from ubuntuone.platform import credentials, ExternalInterface from ubuntuone.storageprotocol import request @@ -1157,6 +1159,9 @@ super(SyncdaemonService, self).__init__(main, interface) self.send_events = send_events + self.network_manager = NetworkManagerState( + result_cb=self.network_state_changed) + self.network_manager.find_online_state() if interface is None: self.interface = ExternalInterface(service=self) @@ -1290,6 +1295,14 @@ self.main.action_q.rescan_from_scratch(volume.volume_id) @log_call(logger.debug) + def network_state_changed(self, state): + """Receive the connection state and call the proper function.""" + if state == ONLINE: + self.network_connected() + else: + self.network_disconnected() + + @log_call(logger.debug) def network_connected(self): """Push the connected event.""" self.main.event_q.push('SYS_NET_CONNECTED') diff -Nru ubuntuone-client-2.99.4/ubuntuone/syncdaemon/states.py ubuntuone-client-2.99.5/ubuntuone/syncdaemon/states.py --- ubuntuone-client-2.99.4/ubuntuone/syncdaemon/states.py 2012-02-02 16:38:19.000000000 +0000 +++ ubuntuone-client-2.99.5/ubuntuone/syncdaemon/states.py 2012-02-22 19:11:58.000000000 +0000 @@ -400,7 +400,7 @@ self._state_changed() return - # NetworkManager and User events + # User events if event in ('SYS_NET_CONNECTED', 'SYS_USER_CONNECT', 'SYS_NET_DISCONNECTED', 'SYS_USER_DISCONNECT', 'SYS_CONNECTION_LOST', 'SYS_HANDSHAKE_TIMEOUT'):