Merge lp:~dobey/ubuntu/lucid/ubuntuone-client/trunk into lp:ubuntu/lucid/ubuntuone-client
- Lucid (10.04)
- trunk
- Merge into lucid
Proposed by
dobey
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~dobey/ubuntu/lucid/ubuntuone-client/trunk |
Merge into: | lp:ubuntu/lucid/ubuntuone-client |
Diff against target: |
28479 lines (+12474/-8183) 92 files modified
Makefile.am (+15/-6) Makefile.in (+26/-14) aclocal.m4 (+21/-5) bin/u1sdtool (+133/-57) bin/ubuntuone-client-applet (+0/-1063) bin/ubuntuone-client-preferences (+0/-360) bin/ubuntuone-login (+226/-0) bin/ubuntuone-preferences (+549/-0) bin/ubuntuone-syncdaemon (+6/-5) config.guess (+21/-49) config.sub (+11/-4) configure (+198/-115) configure.ac (+28/-2) contrib/dbus-docs (+196/-0) contrib/dbus_util.py (+72/-0) contrib/test (+16/-36) contrib/testing/testcase.py (+181/-48) data/Makefile.am (+19/-4) data/Makefile.in (+57/-20) data/com.ubuntuone.Authentication.service.in (+1/-1) data/logging.conf (+13/-0) data/logging.conf.in (+13/-0) data/syncdaemon.conf (+8/-8) data/ubuntuone-client-applet.desktop.in (+0/-9) data/ubuntuone-icons.rendercache (+1/-2) data/ubuntuone-icons.svg (+1017/-5096) data/ubuntuone-preferences.desktop.in (+14/-0) data/ubuntuone.menu.in (+1/-0) debian/changelog (+6/-0) debian/control (+7/-4) debian/python-ubuntuone-client.install (+1/-0) debian/ubuntuone-client-gnome.install (+4/-5) debian/ubuntuone-client.install (+1/-3) docs/man/u1sdtool.1 (+109/-15) docs/man/ubuntuone-client-applet.1 (+0/-16) docs/man/ubuntuone-client-preferences.1 (+0/-16) docs/man/ubuntuone-preferences.1 (+16/-0) docs/syncdaemon_dbus_api.txt (+280/-0) ltmain.sh (+4/-4) m4/libtool.m4 (+7/-6) m4/ltversion.m4 (+5/-5) nautilus/Makefile.am (+28/-0) nautilus/Makefile.in (+148/-19) nautilus/contacts-view.c (+507/-0) nautilus/contacts-view.h (+66/-0) nautilus/test-contacts-picker.c (+98/-0) nautilus/u1-contacts-picker.c (+170/-0) nautilus/u1-contacts-picker.h (+58/-0) nautilus/ubuntuone-marshallers.c (+123/-0) nautilus/ubuntuone-marshallers.list (+4/-0) nautilus/ubuntuone-nautilus.c (+147/-28) po/POTFILES.in (+4/-3) po/POTFILES.skip (+1/-0) tests/oauthdesktop/test_auth.py (+7/-1) tests/syncdaemon/test_action_predicates.py (+10/-5) tests/syncdaemon/test_action_queue.py (+487/-7) tests/syncdaemon/test_config.py (+154/-39) tests/syncdaemon/test_dbus.py (+689/-60) tests/syncdaemon/test_eq_inotify.py (+528/-19) tests/syncdaemon/test_eventqueue.py (+13/-1) tests/syncdaemon/test_fileshelf.py (+30/-1) tests/syncdaemon/test_fsm.py (+86/-58) tests/syncdaemon/test_hashqueue.py (+49/-9) tests/syncdaemon/test_localrescan.py (+415/-79) tests/syncdaemon/test_logger.py (+77/-0) tests/syncdaemon/test_sync.py (+46/-4) tests/syncdaemon/test_tools.py (+201/-8) tests/syncdaemon/test_u1sdtool.py (+102/-3) tests/syncdaemon/test_vm.py (+1763/-249) tests/test_login.py (+187/-0) tests/test_preferences.py (+247/-0) ubuntuone/oauthdesktop/auth.py (+6/-4) ubuntuone/oauthdesktop/main.py (+2/-2) ubuntuone/syncdaemon/__init__.py (+1/-0) ubuntuone/syncdaemon/action_queue.py (+298/-127) ubuntuone/syncdaemon/config.py (+180/-24) ubuntuone/syncdaemon/dbus_interface.py (+442/-31) ubuntuone/syncdaemon/event_queue.py (+161/-25) ubuntuone/syncdaemon/events_nanny.py (+7/-7) ubuntuone/syncdaemon/file_shelf.py (+19/-3) ubuntuone/syncdaemon/filesystem_manager.py (+51/-35) ubuntuone/syncdaemon/fsm/fsm.py (+3/-3) ubuntuone/syncdaemon/local_rescan.py (+88/-30) ubuntuone/syncdaemon/logger.py (+70/-15) ubuntuone/syncdaemon/main.py (+53/-58) ubuntuone/syncdaemon/marker.py (+3/-0) ubuntuone/syncdaemon/sync.py (+42/-16) ubuntuone/syncdaemon/tools.py (+244/-8) ubuntuone/syncdaemon/u1fsfsm.py (+77/-12) ubuntuone/syncdaemon/volume_manager.py (+973/-191) ubuntuone/u1sync/client.py (+23/-18) ubuntuone/u1sync/main.py (+3/-3) |
To merge this branch: | bzr merge lp:~dobey/ubuntu/lucid/ubuntuone-client/trunk |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu branches | Pending | ||
Review via email: mp+19557@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Makefile.am' | |||
2 | --- Makefile.am 2009-09-28 18:15:00 +0000 | |||
3 | +++ Makefile.am 2010-02-18 00:10:25 +0000 | |||
4 | @@ -18,17 +18,17 @@ | |||
5 | 18 | 18 | ||
6 | 19 | # Install our scripts and extra data here | 19 | # Install our scripts and extra data here |
7 | 20 | bin_SCRIPTS = \ | 20 | bin_SCRIPTS = \ |
10 | 21 | bin/ubuntuone-client-applet \ | 21 | bin/ubuntuone-preferences \ |
9 | 22 | bin/ubuntuone-client-preferences \ | ||
11 | 23 | bin/u1sdtool \ | 22 | bin/u1sdtool \ |
12 | 24 | bin/u1sync | 23 | bin/u1sync |
13 | 25 | 24 | ||
15 | 26 | libexec_SCRIPTS = bin/ubuntuone-syncdaemon | 25 | libexec_SCRIPTS = \ |
16 | 26 | bin/ubuntuone-login \ | ||
17 | 27 | bin/ubuntuone-syncdaemon | ||
18 | 27 | 28 | ||
19 | 28 | manfilesdir = $(mandir)/man1 | 29 | manfilesdir = $(mandir)/man1 |
20 | 29 | manfiles_DATA = \ | 30 | manfiles_DATA = \ |
23 | 30 | docs/man/ubuntuone-client-preferences.1 \ | 31 | docs/man/ubuntuone-preferences.1 \ |
22 | 31 | docs/man/ubuntuone-client-applet.1 \ | ||
24 | 32 | docs/man/u1sdtool.1 \ | 32 | docs/man/u1sdtool.1 \ |
25 | 33 | docs/man/u1sync.1 | 33 | docs/man/u1sync.1 |
26 | 34 | 34 | ||
27 | @@ -52,16 +52,25 @@ | |||
28 | 52 | fi; \ | 52 | fi; \ |
29 | 53 | fi | 53 | fi |
30 | 54 | 54 | ||
31 | 55 | logging.conf: data/logging.conf.in Makefile | ||
32 | 56 | $(MAKE) -C data logging.conf | ||
33 | 57 | |||
34 | 55 | lint: protocol pylintrc Makefile | 58 | lint: protocol pylintrc Makefile |
35 | 56 | PYTHONPATH="$(PYTHONPATH)" SRCDIR="$(srcdir)" USE_PYFLAKES="true" \ | 59 | PYTHONPATH="$(PYTHONPATH)" SRCDIR="$(srcdir)" USE_PYFLAKES="true" \ |
36 | 57 | $(PYTHON) $(srcdir)/contrib/pylint-wrapper | 60 | $(PYTHON) $(srcdir)/contrib/pylint-wrapper |
37 | 58 | 61 | ||
39 | 59 | check: lint Makefile | 62 | test: protocol logging.conf $(clientdefs_DATA) Makefile |
40 | 60 | if test "x$(builddir)" == "x$(srcdir)"; then \ | 63 | if test "x$(builddir)" == "x$(srcdir)"; then \ |
41 | 61 | PYTHONPATH="$(PYTHONPATH)" $(PYTHON) $(srcdir)/contrib/test; \ | 64 | PYTHONPATH="$(PYTHONPATH)" $(PYTHON) $(srcdir)/contrib/test; \ |
42 | 62 | fi | 65 | fi |
43 | 63 | rm -rf _trial_temp | 66 | rm -rf _trial_temp |
44 | 64 | 67 | ||
45 | 68 | check: lint test Makefile | ||
46 | 69 | |||
47 | 70 | docs: protocol Makefile | ||
48 | 71 | PYTHONPATH="$(PYTHONPATH)" $(PYTHON) $(srcdir)/contrib/dbus-docs | ||
49 | 72 | |||
50 | 73 | |||
51 | 65 | protocol: ubuntuone Makefile | 74 | protocol: ubuntuone Makefile |
52 | 66 | PROTOCOL="ubuntuone/storageprotocol"; \ | 75 | PROTOCOL="ubuntuone/storageprotocol"; \ |
53 | 67 | if [ ! -d $(USP_PATH) ]; then \ | 76 | if [ ! -d $(USP_PATH) ]; then \ |
54 | 68 | 77 | ||
55 | === modified file 'Makefile.in' | |||
56 | --- Makefile.in 2009-09-28 18:15:00 +0000 | |||
57 | +++ Makefile.in 2010-02-18 00:10:25 +0000 | |||
58 | @@ -1,4 +1,4 @@ | |||
60 | 1 | # Makefile.in generated by automake 1.11 from Makefile.am. | 1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. |
61 | 2 | # @configure_input@ | 2 | # @configure_input@ |
62 | 3 | 3 | ||
63 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
64 | @@ -183,6 +183,8 @@ | |||
65 | 183 | LIPO = @LIPO@ | 183 | LIPO = @LIPO@ |
66 | 184 | LNDIR = @LNDIR@ | 184 | LNDIR = @LNDIR@ |
67 | 185 | LN_S = @LN_S@ | 185 | LN_S = @LN_S@ |
68 | 186 | LOG_FILE_SIZE = @LOG_FILE_SIZE@ | ||
69 | 187 | LOG_LEVEL = @LOG_LEVEL@ | ||
70 | 186 | LTLIBOBJS = @LTLIBOBJS@ | 188 | LTLIBOBJS = @LTLIBOBJS@ |
71 | 187 | MAKEINFO = @MAKEINFO@ | 189 | MAKEINFO = @MAKEINFO@ |
72 | 188 | MKDIR_P = @MKDIR_P@ | 190 | MKDIR_P = @MKDIR_P@ |
73 | @@ -293,16 +295,17 @@ | |||
74 | 293 | 295 | ||
75 | 294 | # Install our scripts and extra data here | 296 | # Install our scripts and extra data here |
76 | 295 | bin_SCRIPTS = \ | 297 | bin_SCRIPTS = \ |
79 | 296 | bin/ubuntuone-client-applet \ | 298 | bin/ubuntuone-preferences \ |
78 | 297 | bin/ubuntuone-client-preferences \ | ||
80 | 298 | bin/u1sdtool \ | 299 | bin/u1sdtool \ |
81 | 299 | bin/u1sync | 300 | bin/u1sync |
82 | 300 | 301 | ||
84 | 301 | libexec_SCRIPTS = bin/ubuntuone-syncdaemon | 302 | libexec_SCRIPTS = \ |
85 | 303 | bin/ubuntuone-login \ | ||
86 | 304 | bin/ubuntuone-syncdaemon | ||
87 | 305 | |||
88 | 302 | manfilesdir = $(mandir)/man1 | 306 | manfilesdir = $(mandir)/man1 |
89 | 303 | manfiles_DATA = \ | 307 | manfiles_DATA = \ |
92 | 304 | docs/man/ubuntuone-client-preferences.1 \ | 308 | docs/man/ubuntuone-preferences.1 \ |
91 | 305 | docs/man/ubuntuone-client-applet.1 \ | ||
93 | 306 | docs/man/u1sdtool.1 \ | 309 | docs/man/u1sdtool.1 \ |
94 | 307 | docs/man/u1sync.1 | 310 | docs/man/u1sync.1 |
95 | 308 | 311 | ||
96 | @@ -522,7 +525,7 @@ | |||
97 | 522 | # (which will cause the Makefiles to be regenerated when you run `make'); | 525 | # (which will cause the Makefiles to be regenerated when you run `make'); |
98 | 523 | # (2) otherwise, pass the desired values on the `make' command line. | 526 | # (2) otherwise, pass the desired values on the `make' command line. |
99 | 524 | $(RECURSIVE_TARGETS): | 527 | $(RECURSIVE_TARGETS): |
101 | 525 | @failcom='exit 1'; \ | 528 | @fail= failcom='exit 1'; \ |
102 | 526 | for f in x $$MAKEFLAGS; do \ | 529 | for f in x $$MAKEFLAGS; do \ |
103 | 527 | case $$f in \ | 530 | case $$f in \ |
104 | 528 | *=* | --[!k]*);; \ | 531 | *=* | --[!k]*);; \ |
105 | @@ -547,7 +550,7 @@ | |||
106 | 547 | fi; test -z "$$fail" | 550 | fi; test -z "$$fail" |
107 | 548 | 551 | ||
108 | 549 | $(RECURSIVE_CLEAN_TARGETS): | 552 | $(RECURSIVE_CLEAN_TARGETS): |
110 | 550 | @failcom='exit 1'; \ | 553 | @fail= failcom='exit 1'; \ |
111 | 551 | for f in x $$MAKEFLAGS; do \ | 554 | for f in x $$MAKEFLAGS; do \ |
112 | 552 | case $$f in \ | 555 | case $$f in \ |
113 | 553 | *=* | --[!k]*);; \ | 556 | *=* | --[!k]*);; \ |
114 | @@ -711,7 +714,8 @@ | |||
115 | 711 | fi; \ | 714 | fi; \ |
116 | 712 | done | 715 | done |
117 | 713 | -test -n "$(am__skip_mode_fix)" \ | 716 | -test -n "$(am__skip_mode_fix)" \ |
119 | 714 | || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ | 717 | || find "$(distdir)" -type d ! -perm -755 \ |
120 | 718 | -exec chmod u+rwx,go+rx {} \; -o \ | ||
121 | 715 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ | 719 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ |
122 | 716 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ | 720 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ |
123 | 717 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ | 721 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ |
124 | @@ -755,17 +759,17 @@ | |||
125 | 755 | distcheck: dist | 759 | distcheck: dist |
126 | 756 | case '$(DIST_ARCHIVES)' in \ | 760 | case '$(DIST_ARCHIVES)' in \ |
127 | 757 | *.tar.gz*) \ | 761 | *.tar.gz*) \ |
129 | 758 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ | 762 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ |
130 | 759 | *.tar.bz2*) \ | 763 | *.tar.bz2*) \ |
132 | 760 | bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ | 764 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ |
133 | 761 | *.tar.lzma*) \ | 765 | *.tar.lzma*) \ |
135 | 762 | unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ | 766 | lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ |
136 | 763 | *.tar.xz*) \ | 767 | *.tar.xz*) \ |
137 | 764 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ | 768 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ |
138 | 765 | *.tar.Z*) \ | 769 | *.tar.Z*) \ |
139 | 766 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ | 770 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ |
140 | 767 | *.shar.gz*) \ | 771 | *.shar.gz*) \ |
142 | 768 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ | 772 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ |
143 | 769 | *.zip*) \ | 773 | *.zip*) \ |
144 | 770 | unzip $(distdir).zip ;;\ | 774 | unzip $(distdir).zip ;;\ |
145 | 771 | esac | 775 | esac |
146 | @@ -970,16 +974,24 @@ | |||
147 | 970 | fi; \ | 974 | fi; \ |
148 | 971 | fi | 975 | fi |
149 | 972 | 976 | ||
150 | 977 | logging.conf: data/logging.conf.in Makefile | ||
151 | 978 | $(MAKE) -C data logging.conf | ||
152 | 979 | |||
153 | 973 | lint: protocol pylintrc Makefile | 980 | lint: protocol pylintrc Makefile |
154 | 974 | PYTHONPATH="$(PYTHONPATH)" SRCDIR="$(srcdir)" USE_PYFLAKES="true" \ | 981 | PYTHONPATH="$(PYTHONPATH)" SRCDIR="$(srcdir)" USE_PYFLAKES="true" \ |
155 | 975 | $(PYTHON) $(srcdir)/contrib/pylint-wrapper | 982 | $(PYTHON) $(srcdir)/contrib/pylint-wrapper |
156 | 976 | 983 | ||
158 | 977 | check: lint Makefile | 984 | test: protocol logging.conf $(clientdefs_DATA) Makefile |
159 | 978 | if test "x$(builddir)" == "x$(srcdir)"; then \ | 985 | if test "x$(builddir)" == "x$(srcdir)"; then \ |
160 | 979 | PYTHONPATH="$(PYTHONPATH)" $(PYTHON) $(srcdir)/contrib/test; \ | 986 | PYTHONPATH="$(PYTHONPATH)" $(PYTHON) $(srcdir)/contrib/test; \ |
161 | 980 | fi | 987 | fi |
162 | 981 | rm -rf _trial_temp | 988 | rm -rf _trial_temp |
163 | 982 | 989 | ||
164 | 990 | check: lint test Makefile | ||
165 | 991 | |||
166 | 992 | docs: protocol Makefile | ||
167 | 993 | PYTHONPATH="$(PYTHONPATH)" $(PYTHON) $(srcdir)/contrib/dbus-docs | ||
168 | 994 | |||
169 | 983 | protocol: ubuntuone Makefile | 995 | protocol: ubuntuone Makefile |
170 | 984 | PROTOCOL="ubuntuone/storageprotocol"; \ | 996 | PROTOCOL="ubuntuone/storageprotocol"; \ |
171 | 985 | if [ ! -d $(USP_PATH) ]; then \ | 997 | if [ ! -d $(USP_PATH) ]; then \ |
172 | 986 | 998 | ||
173 | === modified file 'aclocal.m4' | |||
174 | --- aclocal.m4 2009-08-26 12:15:00 +0000 | |||
175 | +++ aclocal.m4 2010-02-18 00:10:25 +0000 | |||
176 | @@ -1,4 +1,4 @@ | |||
178 | 1 | # generated automatically by aclocal 1.11 -*- Autoconf -*- | 1 | # generated automatically by aclocal 1.11.1 -*- Autoconf -*- |
179 | 2 | 2 | ||
180 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
181 | 4 | # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. | 4 | # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. |
182 | @@ -13,8 +13,8 @@ | |||
183 | 13 | 13 | ||
184 | 14 | m4_ifndef([AC_AUTOCONF_VERSION], | 14 | m4_ifndef([AC_AUTOCONF_VERSION], |
185 | 15 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl | 15 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
188 | 16 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],, | 16 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, |
189 | 17 | [m4_warning([this file was generated for autoconf 2.64. | 17 | [m4_warning([this file was generated for autoconf 2.65. |
190 | 18 | You have another version of autoconf. It may work, but is not guaranteed to. | 18 | You have another version of autoconf. It may work, but is not guaranteed to. |
191 | 19 | If you have problems, you may need to regenerate the build system entirely. | 19 | If you have problems, you may need to regenerate the build system entirely. |
192 | 20 | To do so, use the procedure documented by the package, typically `autoreconf'.])]) | 20 | To do so, use the procedure documented by the package, typically `autoreconf'.])]) |
193 | @@ -224,7 +224,7 @@ | |||
194 | 224 | [am__api_version='1.11' | 224 | [am__api_version='1.11' |
195 | 225 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to | 225 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to |
196 | 226 | dnl require some minimum version. Point them to the right macro. | 226 | dnl require some minimum version. Point them to the right macro. |
198 | 227 | m4_if([$1], [1.11], [], | 227 | m4_if([$1], [1.11.1], [], |
199 | 228 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl | 228 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl |
200 | 229 | ]) | 229 | ]) |
201 | 230 | 230 | ||
202 | @@ -240,7 +240,7 @@ | |||
203 | 240 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. | 240 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. |
204 | 241 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. | 241 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
205 | 242 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], | 242 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
207 | 243 | [AM_AUTOMAKE_VERSION([1.11])dnl | 243 | [AM_AUTOMAKE_VERSION([1.11.1])dnl |
208 | 244 | m4_ifndef([AC_AUTOCONF_VERSION], | 244 | m4_ifndef([AC_AUTOCONF_VERSION], |
209 | 245 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl | 245 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
210 | 246 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) | 246 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
211 | @@ -1068,6 +1068,14 @@ | |||
212 | 1068 | am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` | 1068 | am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` |
213 | 1069 | am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` | 1069 | am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` |
214 | 1070 | ;; | 1070 | ;; |
215 | 1071 | *) | ||
216 | 1072 | case $am_py_prefix in | ||
217 | 1073 | /usr|/System*) ;; | ||
218 | 1074 | *) | ||
219 | 1075 | am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages | ||
220 | 1076 | ;; | ||
221 | 1077 | esac | ||
222 | 1078 | ;; | ||
223 | 1071 | esac | 1079 | esac |
224 | 1072 | ]) | 1080 | ]) |
225 | 1073 | AC_SUBST([pythondir], [$am_cv_python_pythondir]) | 1081 | AC_SUBST([pythondir], [$am_cv_python_pythondir]) |
226 | @@ -1098,6 +1106,14 @@ | |||
227 | 1098 | am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` | 1106 | am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` |
228 | 1099 | am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` | 1107 | am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` |
229 | 1100 | ;; | 1108 | ;; |
230 | 1109 | *) | ||
231 | 1110 | case $am_py_exec_prefix in | ||
232 | 1111 | /usr|/System*) ;; | ||
233 | 1112 | *) | ||
234 | 1113 | am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages | ||
235 | 1114 | ;; | ||
236 | 1115 | esac | ||
237 | 1116 | ;; | ||
238 | 1101 | esac | 1117 | esac |
239 | 1102 | ]) | 1118 | ]) |
240 | 1103 | AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) | 1119 | AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) |
241 | 1104 | 1120 | ||
242 | === modified file 'bin/u1sdtool' | |||
243 | --- bin/u1sdtool 2009-12-07 17:35:00 +0000 | |||
244 | +++ bin/u1sdtool 2010-02-18 00:10:25 +0000 | |||
245 | @@ -28,7 +28,7 @@ | |||
246 | 28 | 28 | ||
247 | 29 | from dbus.mainloop.glib import DBusGMainLoop | 29 | from dbus.mainloop.glib import DBusGMainLoop |
248 | 30 | from optparse import OptionParser | 30 | from optparse import OptionParser |
250 | 31 | from twisted.internet import reactor | 31 | from twisted.internet import reactor, defer |
251 | 32 | 32 | ||
252 | 33 | from ubuntuone.syncdaemon.tools import SyncDaemonTool | 33 | from ubuntuone.syncdaemon.tools import SyncDaemonTool |
253 | 34 | from ubuntuone.syncdaemon.dbus_interface import DBUS_IFACE_NAME | 34 | from ubuntuone.syncdaemon.dbus_interface import DBUS_IFACE_NAME |
254 | @@ -38,45 +38,16 @@ | |||
255 | 38 | show_downloads, | 38 | show_downloads, |
256 | 39 | show_shares, | 39 | show_shares, |
257 | 40 | show_shared, | 40 | show_shared, |
258 | 41 | show_folders, | ||
259 | 42 | show_error, | ||
260 | 43 | show_state, | ||
261 | 44 | show_waiting_content, | ||
262 | 45 | is_running, | ||
263 | 41 | ) | 46 | ) |
264 | 42 | 47 | ||
265 | 43 | 48 | ||
302 | 44 | def main(argv, stdout): | 49 | def main(options, args, stdout): |
303 | 45 | usage = "Usage: %prog [option]" | 50 | """entry point""" |
268 | 46 | parser = OptionParser(usage=usage) | ||
269 | 47 | parser.add_option("-w", "--wait", dest="wait", action="store_true", | ||
270 | 48 | help="Wait until ubuntuone-syncdaemon reaches nirvana") | ||
271 | 49 | parser.add_option("", "--accept-share", dest="accept_share", | ||
272 | 50 | metavar="SHARE_ID", | ||
273 | 51 | help="accept the share with the specified id") | ||
274 | 52 | parser.add_option("", "--reject-share", dest="reject_share", | ||
275 | 53 | metavar="SHARE_ID", | ||
276 | 54 | help="reject the share with the specified id") | ||
277 | 55 | parser.add_option("", "--list-shares", dest="list_shares", | ||
278 | 56 | action="store_true", | ||
279 | 57 | help=" get the list of shares") | ||
280 | 58 | parser.add_option("", "--refresh-shares", dest="refresh_shares", | ||
281 | 59 | action="store_true", | ||
282 | 60 | help=" request a refresh of the list of shares to" | ||
283 | 61 | " the server") | ||
284 | 62 | parser.add_option("", "--offer-share", dest="offer_share", | ||
285 | 63 | metavar="PATH USER SHARE_NAME ACCESS_LEVEL", | ||
286 | 64 | help=" share PATH to USER. ") | ||
287 | 65 | parser.add_option("", "--list-shared", dest="list_shared", | ||
288 | 66 | action="store_true", | ||
289 | 67 | help=" list the shared path's/shares offered. ") | ||
290 | 68 | parser.add_option("", "--refresh", dest="refresh_path", | ||
291 | 69 | metavar="PATH", help=" request a refresh of PATH") | ||
292 | 70 | parser.add_option("", "--info", dest="path_info", | ||
293 | 71 | metavar="PATH", help=" request the metadata of PATH") | ||
294 | 72 | parser.add_option("", "--current-transfers", dest="current_transfers", | ||
295 | 73 | action="store_true", | ||
296 | 74 | help=" show the current uploads and downloads") | ||
297 | 75 | parser.add_option("-q", "--quit", dest="quit", action='store_true', | ||
298 | 76 | help="shutdown the syncdaemon") | ||
299 | 77 | |||
300 | 78 | (options, args) = parser.parse_args(argv) | ||
301 | 79 | |||
304 | 80 | loop = DBusGMainLoop(set_as_default=True) | 51 | loop = DBusGMainLoop(set_as_default=True) |
305 | 81 | bus = dbus.SessionBus(mainloop=loop) | 52 | bus = dbus.SessionBus(mainloop=loop) |
306 | 82 | sync_daemon_tool = SyncDaemonTool(bus) | 53 | sync_daemon_tool = SyncDaemonTool(bus) |
307 | @@ -86,6 +57,28 @@ | |||
308 | 86 | if out_encoding is None: | 57 | if out_encoding is None: |
309 | 87 | out_encoding = 'utf-8' | 58 | out_encoding = 'utf-8' |
310 | 88 | out = codecs.getwriter(out_encoding)(stdout, errors='replace') | 59 | out = codecs.getwriter(out_encoding)(stdout, errors='replace') |
311 | 60 | # start syncdaemon if it's required | ||
312 | 61 | if not is_running() and not options.quit and not options.start: | ||
313 | 62 | d = sync_daemon_tool.start() | ||
314 | 63 | d.addBoth(lambda _: run(options, sync_daemon_tool, out)) | ||
315 | 64 | else: | ||
316 | 65 | d = run(options, sync_daemon_tool, out) | ||
317 | 66 | |||
318 | 67 | def default_errback(error): | ||
319 | 68 | """ default error handler. """ | ||
320 | 69 | out.write("\nOops, an error ocurred:\n") | ||
321 | 70 | error.printTraceback() | ||
322 | 71 | |||
323 | 72 | def stop_reactor(result): | ||
324 | 73 | """ stop the reactor. """ | ||
325 | 74 | if reactor.running: | ||
326 | 75 | reactor.stop() | ||
327 | 76 | d.addErrback(default_errback) | ||
328 | 77 | d.addCallback(stop_reactor) | ||
329 | 78 | return d | ||
330 | 79 | |||
331 | 80 | |||
332 | 81 | def run(options, sync_daemon_tool, out): | ||
333 | 89 | if options.wait: | 82 | if options.wait: |
334 | 90 | def callback(result): | 83 | def callback(result): |
335 | 91 | """ wait_for_nirvana callback (stop the reactor and exit)""" | 84 | """ wait_for_nirvana callback (stop the reactor and exit)""" |
336 | @@ -104,12 +97,29 @@ | |||
337 | 104 | elif options.refresh_shares: | 97 | elif options.refresh_shares: |
338 | 105 | d = sync_daemon_tool.refresh_shares() | 98 | d = sync_daemon_tool.refresh_shares() |
339 | 106 | elif options.offer_share: | 99 | elif options.offer_share: |
343 | 107 | if len(args) != 4: | 100 | path, username, name, access_level = options.offer_share |
344 | 108 | parser.error('--offer-share requires 4 arguments') | 101 | d = sync_daemon_tool.offer_share(path, username, name, access_level) |
342 | 109 | d = sync_daemon_tool.offer_share(options.offer_share, *args[1:]) | ||
345 | 110 | elif options.list_shared: | 102 | elif options.list_shared: |
346 | 111 | d = sync_daemon_tool.list_shared() | 103 | d = sync_daemon_tool.list_shared() |
347 | 112 | d.addCallback(lambda r: show_shared(r, out)) | 104 | d.addCallback(lambda r: show_shared(r, out)) |
348 | 105 | elif options.create_folder: | ||
349 | 106 | if not os.path.exists(options.create_folder): | ||
350 | 107 | parser.error("PATH: '%s' don't exists" % \ | ||
351 | 108 | options.create_folder) | ||
352 | 109 | d = sync_daemon_tool.create_folder(options.create_folder) | ||
353 | 110 | d.addErrback(lambda r: show_error(r, out)) | ||
354 | 111 | elif options.delete_folder: | ||
355 | 112 | d = sync_daemon_tool.delete_folder(options.delete_folder) | ||
356 | 113 | d.addErrback(lambda r: show_error(r, out)) | ||
357 | 114 | elif options.list_folders: | ||
358 | 115 | d = sync_daemon_tool.get_folders() | ||
359 | 116 | d.addCallback(lambda r: show_folders(r, out)) | ||
360 | 117 | elif options.subscribe_folder: | ||
361 | 118 | d = sync_daemon_tool.subscribe_folder(options.subscribe_folder) | ||
362 | 119 | d.addErrback(lambda r: show_error(r, out)) | ||
363 | 120 | elif options.unsubscribe_folder: | ||
364 | 121 | d = sync_daemon_tool.unsubscribe_folder(options.unsubscribe_folder) | ||
365 | 122 | d.addErrback(lambda r: show_error(r, out)) | ||
366 | 113 | elif options.refresh_path: | 123 | elif options.refresh_path: |
367 | 114 | if not os.path.exists(options.refresh_path): | 124 | if not os.path.exists(options.refresh_path): |
368 | 115 | parser.error("PATH: '%s' don't exists" % \ | 125 | parser.error("PATH: '%s' don't exists" % \ |
369 | @@ -129,32 +139,98 @@ | |||
370 | 129 | elif options.quit: | 139 | elif options.quit: |
371 | 130 | d = sync_daemon_tool.quit() | 140 | d = sync_daemon_tool.quit() |
372 | 131 | def shutdown_check(result): | 141 | def shutdown_check(result): |
375 | 132 | if result is None and \ | 142 | if result is None and not is_running(): |
374 | 133 | DBUS_IFACE_NAME in bus.list_names(): | ||
376 | 134 | out.write("ubuntuone-syncdaemon stopped.\n") | 143 | out.write("ubuntuone-syncdaemon stopped.\n") |
377 | 135 | else: | 144 | else: |
378 | 136 | out.write("ubuntuone-syncdaemon still running.\n") | 145 | out.write("ubuntuone-syncdaemon still running.\n") |
379 | 137 | d.addBoth(shutdown_check) | 146 | d.addBoth(shutdown_check) |
380 | 147 | elif options.connect: | ||
381 | 148 | d = sync_daemon_tool.connect() | ||
382 | 149 | elif options.disconnect: | ||
383 | 150 | d = sync_daemon_tool.disconnect() | ||
384 | 151 | elif options.status: | ||
385 | 152 | d = sync_daemon_tool.get_status() | ||
386 | 153 | d.addCallback(lambda r: show_state(r, out)) | ||
387 | 154 | elif options.waiting_content: | ||
388 | 155 | d = sync_daemon_tool.waiting_content() | ||
389 | 156 | d.addCallback(lambda r: show_waiting_content(r, out)) | ||
390 | 157 | elif options.schedule_next: | ||
391 | 158 | share_id, node_id = options.schedule_next | ||
392 | 159 | d = sync_daemon_tool.schedule_next(share_id, node_id) | ||
393 | 160 | elif options.start: | ||
394 | 161 | d = sync_daemon_tool.start() | ||
395 | 138 | else: | 162 | else: |
396 | 139 | parser.print_help() | 163 | parser.print_help() |
411 | 140 | sys.exit(1) | 164 | d = defer.succeed(None) |
412 | 141 | 165 | return d | |
399 | 142 | def default_errback(error): | ||
400 | 143 | """ default error handler. """ | ||
401 | 144 | out.write("\nOops, an error ocurred:\n") | ||
402 | 145 | error.printTraceback() | ||
403 | 146 | |||
404 | 147 | def stop_reactor(result): | ||
405 | 148 | """ stop the reactor. """ | ||
406 | 149 | if reactor.running: | ||
407 | 150 | reactor.stop() | ||
408 | 151 | d.addErrback(default_errback) | ||
409 | 152 | d.addCallback(stop_reactor) | ||
410 | 153 | reactor.run() | ||
413 | 154 | 166 | ||
414 | 155 | 167 | ||
415 | 156 | if __name__ == '__main__': | 168 | if __name__ == '__main__': |
416 | 157 | # disable the dbus warnings | 169 | # disable the dbus warnings |
417 | 158 | warnings.filterwarnings('ignore', module='dbus') | 170 | warnings.filterwarnings('ignore', module='dbus') |
419 | 159 | main(sys.argv, sys.stdout) | 171 | usage = "Usage: %prog [option]" |
420 | 172 | parser = OptionParser(usage=usage) | ||
421 | 173 | parser.add_option("-w", "--wait", dest="wait", action="store_true", | ||
422 | 174 | help="Wait until ubuntuone-syncdaemon reaches nirvana") | ||
423 | 175 | parser.add_option("", "--accept-share", dest="accept_share", | ||
424 | 176 | metavar="SHARE_ID", | ||
425 | 177 | help="Accept the share with the specified id") | ||
426 | 178 | parser.add_option("", "--reject-share", dest="reject_share", | ||
427 | 179 | metavar="SHARE_ID", | ||
428 | 180 | help="Reject the share with the specified id") | ||
429 | 181 | parser.add_option("", "--list-shares", dest="list_shares", | ||
430 | 182 | action="store_true", | ||
431 | 183 | help="Get the list of shares") | ||
432 | 184 | parser.add_option("", "--refresh-shares", dest="refresh_shares", | ||
433 | 185 | action="store_true", | ||
434 | 186 | help="Request a refresh of the list of shares to" | ||
435 | 187 | " the server") | ||
436 | 188 | parser.add_option("", "--offer-share", dest="offer_share", type="string", | ||
437 | 189 | nargs=4, metavar="PATH USER SHARE_NAME ACCESS_LEVEL", | ||
438 | 190 | help="Share PATH to USER. ") | ||
439 | 191 | parser.add_option("", "--list-shared", dest="list_shared", | ||
440 | 192 | action="store_true", | ||
441 | 193 | help="List the shared path's/shares offered. ") | ||
442 | 194 | parser.add_option("", "--create-folder", dest="create_folder", | ||
443 | 195 | metavar="PATH", | ||
444 | 196 | help="Create user defined folder in the specified path") | ||
445 | 197 | parser.add_option("", "--delete-folder", dest="delete_folder", | ||
446 | 198 | metavar="FOLDER_ID", | ||
447 | 199 | help="Delete user defined folder in the specified path") | ||
448 | 200 | parser.add_option("", "--list-folders", dest="list_folders", | ||
449 | 201 | action="store_true", | ||
450 | 202 | help="List all the user defined folders") | ||
451 | 203 | parser.add_option("", "--subscribe-folder", dest="subscribe_folder", | ||
452 | 204 | metavar="FOLDER_ID", | ||
453 | 205 | help="Subscribe to the folder specified by id") | ||
454 | 206 | parser.add_option("", "--unsubscribe-folder", dest="unsubscribe_folder", | ||
455 | 207 | metavar="FOLDER_ID", | ||
456 | 208 | help="Unsubscribe from the folder specified by id") | ||
457 | 209 | parser.add_option("", "--refresh", dest="refresh_path", | ||
458 | 210 | metavar="PATH", help="Request a refresh of PATH") | ||
459 | 211 | parser.add_option("", "--info", dest="path_info", | ||
460 | 212 | metavar="PATH", help="Request the metadata of PATH") | ||
461 | 213 | parser.add_option("", "--current-transfers", dest="current_transfers", | ||
462 | 214 | action="store_true", | ||
463 | 215 | help=" show the current uploads and downloads") | ||
464 | 216 | parser.add_option("-q", "--quit", dest="quit", action='store_true', | ||
465 | 217 | help="Shutdown the syncdaemon") | ||
466 | 218 | parser.add_option("-c", "--connect", dest="connect", action='store_true', | ||
467 | 219 | help="Connect the syncdaemon") | ||
468 | 220 | parser.add_option("-d", "--disconnect", dest="disconnect", | ||
469 | 221 | action='store_true', help="Disconnect the syncdaemon") | ||
470 | 222 | parser.add_option("-s", "--status", dest="status", action='store_true', | ||
471 | 223 | help="Get the current status of syncdaemon") | ||
472 | 224 | parser.add_option("", "--waiting-content", dest="waiting_content", | ||
473 | 225 | action='store_true', help="Get the waiting content list") | ||
474 | 226 | parser.add_option("", "--schedule-next", dest="schedule_next", | ||
475 | 227 | metavar="SHARE_ID NODE_ID", nargs=2, type='string', | ||
476 | 228 | help="Move the node to be the next in the queue of " | ||
477 | 229 | "waiting commands") | ||
478 | 230 | parser.add_option("", "--start", dest="start", action='store_true', | ||
479 | 231 | help="Start syncdaemon if it's not running") | ||
480 | 232 | |||
481 | 233 | (options, args) = parser.parse_args(sys.argv) | ||
482 | 234 | reactor.callWhenRunning(main, options, args, sys.stdout) | ||
483 | 235 | reactor.run() | ||
484 | 160 | 236 | ||
485 | 161 | 237 | ||
486 | === removed file 'bin/ubuntuone-client-applet' | |||
487 | --- bin/ubuntuone-client-applet 2009-12-07 17:35:00 +0000 | |||
488 | +++ bin/ubuntuone-client-applet 1970-01-01 00:00:00 +0000 | |||
489 | @@ -1,1063 +0,0 @@ | |||
490 | 1 | #!/usr/bin/python | ||
491 | 2 | |||
492 | 3 | # ubuntuone-client-applet - Tray icon applet for managing Ubuntu One | ||
493 | 4 | # | ||
494 | 5 | # Author: Rodney Dawes <rodney.dawes@canonical.com> | ||
495 | 6 | # | ||
496 | 7 | # Copyright 2009 Canonical Ltd. | ||
497 | 8 | # | ||
498 | 9 | # This program is free software: you can redistribute it and/or modify it | ||
499 | 10 | # under the terms of the GNU General Public License version 3, as published | ||
500 | 11 | # by the Free Software Foundation. | ||
501 | 12 | # | ||
502 | 13 | # This program is distributed in the hope that it will be useful, but | ||
503 | 14 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
504 | 15 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
505 | 16 | # PURPOSE. See the GNU General Public License for more details. | ||
506 | 17 | # | ||
507 | 18 | # You should have received a copy of the GNU General Public License along | ||
508 | 19 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
509 | 20 | |||
510 | 21 | from __future__ import with_statement | ||
511 | 22 | |||
512 | 23 | import pygtk | ||
513 | 24 | pygtk.require('2.0') | ||
514 | 25 | import gobject | ||
515 | 26 | import gtk | ||
516 | 27 | import pango | ||
517 | 28 | import os | ||
518 | 29 | import subprocess | ||
519 | 30 | import sys | ||
520 | 31 | import gettext | ||
521 | 32 | from ubuntuone import clientdefs | ||
522 | 33 | |||
523 | 34 | import dbus.service | ||
524 | 35 | |||
525 | 36 | # pylint: disable-msg=F0401 | ||
526 | 37 | import pynotify | ||
527 | 38 | |||
528 | 39 | from ConfigParser import ConfigParser | ||
529 | 40 | from dbus.exceptions import DBusException | ||
530 | 41 | from dbus.mainloop.glib import DBusGMainLoop | ||
531 | 42 | from ubuntuone.oauthdesktop.main import Login | ||
532 | 43 | from xdg.BaseDirectory import xdg_config_home | ||
533 | 44 | from threading import Lock, Thread | ||
534 | 45 | from urllib import quote | ||
535 | 46 | |||
536 | 47 | from ubuntuone.oauthdesktop.logger import setupLogging | ||
537 | 48 | logger = setupLogging("UbuntuOne.Client.Applet") | ||
538 | 49 | |||
539 | 50 | DBusGMainLoop(set_as_default=True) | ||
540 | 51 | |||
541 | 52 | _ = gettext.gettext | ||
542 | 53 | ngettext = gettext.ngettext | ||
543 | 54 | |||
544 | 55 | APPLET_BUS_NAME = "com.ubuntuone.ClientApplet" | ||
545 | 56 | APPLET_CONFIG_NAME = APPLET_BUS_NAME + ".Config" | ||
546 | 57 | |||
547 | 58 | DBUS_IFACE_NAME = "com.ubuntuone.SyncDaemon" | ||
548 | 59 | DBUS_IFACE_SYNC_NAME = "com.ubuntuone.SyncDaemon.SyncDaemon" | ||
549 | 60 | DBUS_IFACE_STATUS_NAME = "com.ubuntuone.SyncDaemon.Status" | ||
550 | 61 | DBUS_IFACE_CONFIG_NAME = "com.ubuntuone.SyncDaemon.Config" | ||
551 | 62 | |||
552 | 63 | DBUS_IFACE_AUTH_NAME = "com.ubuntuone.Authentication" | ||
553 | 64 | |||
554 | 65 | OAUTH_REALM = "https://ubuntuone.com" | ||
555 | 66 | OAUTH_CONSUMER = "ubuntuone" | ||
556 | 67 | BOOKMARK_NAME = "Ubuntu One" | ||
557 | 68 | |||
558 | 69 | NOTIFY_ICON_SIZE = 48 | ||
559 | 70 | |||
560 | 71 | # Why thank you GTK+ for enforcing style-set and breaking API | ||
561 | 72 | RCSTYLE = """ | ||
562 | 73 | style 'dialogs' { | ||
563 | 74 | GtkDialog::action-area-border = 12 | ||
564 | 75 | GtkDialog::button-spacing = 6 | ||
565 | 76 | GtkDialog::content-area-border = 0 | ||
566 | 77 | } | ||
567 | 78 | widget_class '*Dialog*' style 'dialogs' | ||
568 | 79 | """ | ||
569 | 80 | |||
570 | 81 | CONF_FILE = os.path.join(xdg_config_home, "ubuntuone", "ubuntuone-client.conf") | ||
571 | 82 | |||
572 | 83 | |||
573 | 84 | def dbus_async(*args): | ||
574 | 85 | """Simple handler to make dbus do stuff async.""" | ||
575 | 86 | pass | ||
576 | 87 | |||
577 | 88 | class AppletMain(object): | ||
578 | 89 | """Main applet process class.""" | ||
579 | 90 | |||
580 | 91 | def __init__(self, *args, **kw): | ||
581 | 92 | """Initializes the child threads and dbus monitor.""" | ||
582 | 93 | from twisted.internet import gtk2reactor | ||
583 | 94 | gtk2reactor.install() | ||
584 | 95 | login = Login(dbus.service.BusName(DBUS_IFACE_AUTH_NAME, | ||
585 | 96 | bus=dbus.SessionBus())) | ||
586 | 97 | |||
587 | 98 | logger.info(_("Starting Ubuntu One client version %s") % | ||
588 | 99 | clientdefs.VERSION) | ||
589 | 100 | |||
590 | 101 | # Whether or not we are authorized | ||
591 | 102 | self.is_authorized = False | ||
592 | 103 | |||
593 | 104 | # Load the config, with some defaults if it doesn't exist yet | ||
594 | 105 | if not os.path.isdir(os.path.dirname(CONF_FILE)): | ||
595 | 106 | os.makedirs(os.path.dirname(CONF_FILE)) | ||
596 | 107 | |||
597 | 108 | self.config = ConfigParser() | ||
598 | 109 | self.config.read(CONF_FILE) | ||
599 | 110 | |||
600 | 111 | if not self.config.has_section("ubuntuone"): | ||
601 | 112 | self.config.add_section("ubuntuone") | ||
602 | 113 | |||
603 | 114 | if not self.config.has_option("ubuntuone", "show_applet"): | ||
604 | 115 | self.config.set("ubuntuone", "show_applet", "1") | ||
605 | 116 | |||
606 | 117 | if not self.config.has_option("ubuntuone", "connect"): | ||
607 | 118 | self.config.set("ubuntuone", "connect", "0") | ||
608 | 119 | |||
609 | 120 | if not self.config.has_option("ubuntuone", "connected"): | ||
610 | 121 | self.config.set("ubuntuone", "connected", "False") | ||
611 | 122 | |||
612 | 123 | if not self.config.has_option("ubuntuone", "bookmarked"): | ||
613 | 124 | self.config.set("ubuntuone", "bookmarked", "False") | ||
614 | 125 | |||
615 | 126 | self.show_applet = self.config.getint("ubuntuone", "show_applet") | ||
616 | 127 | self.connect = self.config.getint("ubuntuone", "connect") | ||
617 | 128 | self.connected = self.config.getboolean("ubuntuone", "connected") | ||
618 | 129 | |||
619 | 130 | if not os.path.exists(CONF_FILE): | ||
620 | 131 | with open(CONF_FILE, "w+b") as f: | ||
621 | 132 | self.config.write(f) | ||
622 | 133 | |||
623 | 134 | # Handle some DBus signals | ||
624 | 135 | self.__bus = dbus.SessionBus() | ||
625 | 136 | self.__bus.add_signal_receiver( | ||
626 | 137 | handler_function=self.__new_credentials, | ||
627 | 138 | signal_name="NewCredentials", | ||
628 | 139 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
629 | 140 | self.__bus.add_signal_receiver( | ||
630 | 141 | handler_function=self.__auth_denied, | ||
631 | 142 | signal_name="AuthorizationDenied", | ||
632 | 143 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
633 | 144 | self.__bus.add_signal_receiver( | ||
634 | 145 | handler_function=self.__no_credentials, | ||
635 | 146 | signal_name="NoCredentials", | ||
636 | 147 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
637 | 148 | self.__bus.add_signal_receiver( | ||
638 | 149 | handler_function=self.__got_oauth_error, | ||
639 | 150 | signal_name="OAuthError", | ||
640 | 151 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
641 | 152 | |||
642 | 153 | self.__icon = AppletIcon(main=self, config=self.config) | ||
643 | 154 | |||
644 | 155 | def __new_credentials(self, realm=None, consumer_key=None, sender=None): | ||
645 | 156 | """Signal callback for when we get new credentials.""" | ||
646 | 157 | self.is_authorized = True | ||
647 | 158 | |||
648 | 159 | self.__start_storage_daemon() | ||
649 | 160 | self.add_to_autostart() | ||
650 | 161 | |||
651 | 162 | self.set_up_desktopcouch_pairing(consumer_key) | ||
652 | 163 | |||
653 | 164 | if self.connect == 2: | ||
654 | 165 | return | ||
655 | 166 | |||
656 | 167 | if self.connect == 1 and not self.connected: | ||
657 | 168 | return | ||
658 | 169 | |||
659 | 170 | try: | ||
660 | 171 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/", | ||
661 | 172 | follow_name_owner_changes=True) | ||
662 | 173 | iface = dbus.Interface(client, DBUS_IFACE_SYNC_NAME) | ||
663 | 174 | iface.connect(reply_handler=dbus_async, | ||
664 | 175 | error_handler=self.sd_dbus_error) | ||
665 | 176 | except DBusException, e: | ||
666 | 177 | self.sd_dbus_error(e) | ||
667 | 178 | |||
668 | 179 | def __auth_denied(self): | ||
669 | 180 | """Signal callback for when auth was denied by user.""" | ||
670 | 181 | self.is_authorized = False | ||
671 | 182 | self.remove_from_autostart() | ||
672 | 183 | |||
673 | 184 | def quit_error(e): | ||
674 | 185 | """Only log when quit fails.""" | ||
675 | 186 | logger.error(_("Quit Error: %s") % e.get_dbus_message()) | ||
676 | 187 | |||
677 | 188 | try: | ||
678 | 189 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/", | ||
679 | 190 | follow_name_owner_changes=True) | ||
680 | 191 | iface = dbus.Interface(client, DBUS_IFACE_SYNC_NAME) | ||
681 | 192 | iface.quit(reply_handler=dbus_async, | ||
682 | 193 | error_handler=quit_error) | ||
683 | 194 | except DBusException, e: | ||
684 | 195 | quit_error(e) | ||
685 | 196 | |||
686 | 197 | from twisted.internet import reactor | ||
687 | 198 | reactor.stop() | ||
688 | 199 | |||
689 | 200 | def __no_credentials(self): | ||
690 | 201 | """Signal callback for when no credentials exist in the keyring.""" | ||
691 | 202 | self.is_authorized = False | ||
692 | 203 | |||
693 | 204 | def __got_oauth_error(self, message=None): | ||
694 | 205 | """Signal callback for when an OAuth error occured.""" | ||
695 | 206 | def dialog_response(dialog, response): | ||
696 | 207 | """Handle the dialog closing.""" | ||
697 | 208 | dialog.destroy() | ||
698 | 209 | |||
699 | 210 | if message: | ||
700 | 211 | logger.error(message) | ||
701 | 212 | dialog = gtk.Dialog(title=_("Ubuntu One: Error"), | ||
702 | 213 | flags=gtk.DIALOG_NO_SEPARATOR, | ||
703 | 214 | buttons=(gtk.STOCK_CLOSE, | ||
704 | 215 | gtk.RESPONSE_CLOSE)) | ||
705 | 216 | dialog.set_default_response(gtk.RESPONSE_CLOSE) | ||
706 | 217 | dialog.set_icon_name("ubuntuone-client") | ||
707 | 218 | |||
708 | 219 | area = dialog.get_content_area() | ||
709 | 220 | |||
710 | 221 | hbox = gtk.HBox(spacing=12) | ||
711 | 222 | hbox.set_border_width(12) | ||
712 | 223 | area.pack_start(hbox) | ||
713 | 224 | hbox.show() | ||
714 | 225 | |||
715 | 226 | image = gtk.Image() | ||
716 | 227 | image.set_from_icon_name("dialog-error", gtk.ICON_SIZE_DIALOG) | ||
717 | 228 | image.set_alignment(0.5, 0.0) | ||
718 | 229 | image.show() | ||
719 | 230 | hbox.pack_start(image, False, False) | ||
720 | 231 | |||
721 | 232 | vbox = gtk.VBox(spacing=12) | ||
722 | 233 | vbox.show() | ||
723 | 234 | hbox.pack_start(vbox) | ||
724 | 235 | |||
725 | 236 | label = gtk.Label("<b>%s</b>" % _("Authorization Error")) | ||
726 | 237 | label.set_use_markup(True) | ||
727 | 238 | label.set_alignment(0.0, 0.5) | ||
728 | 239 | label.show() | ||
729 | 240 | vbox.pack_start(label, False, False) | ||
730 | 241 | |||
731 | 242 | label = gtk.Label(message) | ||
732 | 243 | label.set_line_wrap(True) | ||
733 | 244 | label.set_max_width_chars(64) | ||
734 | 245 | label.set_ellipsize(pango.ELLIPSIZE_MIDDLE) | ||
735 | 246 | label.set_alignment(0.0, 0.0) | ||
736 | 247 | label.show() | ||
737 | 248 | vbox.pack_start(label, True, True) | ||
738 | 249 | |||
739 | 250 | dialog.connect('close', dialog_response, gtk.RESPONSE_CLOSE) | ||
740 | 251 | dialog.connect('response', dialog_response) | ||
741 | 252 | |||
742 | 253 | dialog.show() | ||
743 | 254 | else: | ||
744 | 255 | logger.error(_("Got an OAuth error with no message.")) | ||
745 | 256 | |||
746 | 257 | def check_for_token(self, do_login=False): | ||
747 | 258 | """Method to check for an existing token.""" | ||
748 | 259 | def local_dbus_error(e): | ||
749 | 260 | """Can't talk to ourself?""" | ||
750 | 261 | logger.error(_("Internal Error: %s") % e.get_dbus_message()) | ||
751 | 262 | |||
752 | 263 | try: | ||
753 | 264 | client = self.__bus.get_object(DBUS_IFACE_AUTH_NAME, "/", | ||
754 | 265 | follow_name_owner_changes=True) | ||
755 | 266 | iface = dbus.Interface(client, DBUS_IFACE_AUTH_NAME) | ||
756 | 267 | iface.maybe_login(OAUTH_REALM, OAUTH_CONSUMER, | ||
757 | 268 | do_login, | ||
758 | 269 | reply_handler=dbus_async, | ||
759 | 270 | error_handler=local_dbus_error) | ||
760 | 271 | except DBusException, e: | ||
761 | 272 | local_dbus_error(e) | ||
762 | 273 | return False | ||
763 | 274 | |||
764 | 275 | return False | ||
765 | 276 | |||
766 | 277 | def __start_storage_daemon_maybe(self): | ||
767 | 278 | """Start the storage daemon.""" | ||
768 | 279 | try: | ||
769 | 280 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/", | ||
770 | 281 | follow_name_owner_changes=True) | ||
771 | 282 | iface = dbus.Interface(client, DBUS_IFACE_SYNC_NAME) | ||
772 | 283 | iface.get_rootdir(reply_handler=dbus_async, | ||
773 | 284 | error_handler=self.sd_dbus_error) | ||
774 | 285 | except DBusException, e: | ||
775 | 286 | self.sd_dbus_error(e) | ||
776 | 287 | return False | ||
777 | 288 | |||
778 | 289 | return False | ||
779 | 290 | |||
780 | 291 | def __start_storage_daemon(self): | ||
781 | 292 | """Need to call dbus from a idle callback""" | ||
782 | 293 | gobject.idle_add(self.__start_storage_daemon_maybe) | ||
783 | 294 | |||
784 | 295 | def add_to_autostart(self): | ||
785 | 296 | """Add ourself to the autostart config.""" | ||
786 | 297 | autostart_entry = """[Desktop Entry] | ||
787 | 298 | Name=Ubuntu One | ||
788 | 299 | Exec=ubuntuone-client-applet | ||
789 | 300 | Icon=ubuntuone-client | ||
790 | 301 | Terminal=false | ||
791 | 302 | Type=Application | ||
792 | 303 | X-Ubuntu-Gettext-Domain=ubuntuone-client | ||
793 | 304 | X-KDE-autostart-after=panel | ||
794 | 305 | X-GNOME-Autostart-enabled=true | ||
795 | 306 | """ | ||
796 | 307 | if not os.path.exists(os.path.join(xdg_config_home, "autostart")): | ||
797 | 308 | os.makedirs(os.path.join(xdg_config_home, "autostart")) | ||
798 | 309 | |||
799 | 310 | file_path = os.path.join(xdg_config_home, "autostart", | ||
800 | 311 | "ubuntuone-client-applet.desktop") | ||
801 | 312 | if not os.path.exists(file_path): | ||
802 | 313 | with open(file_path, "w+") as f: | ||
803 | 314 | f.write(autostart_entry) | ||
804 | 315 | |||
805 | 316 | def remove_from_autostart(self): | ||
806 | 317 | """Remove ourself from the autostart config.""" | ||
807 | 318 | path = os.path.join(xdg_config_home, "autostart", | ||
808 | 319 | "ubuntuone-client-applet.desktop") | ||
809 | 320 | try: | ||
810 | 321 | os.unlink(path) | ||
811 | 322 | except OSError: | ||
812 | 323 | pass | ||
813 | 324 | |||
814 | 325 | def set_up_desktopcouch_pairing(self, consumer_key): | ||
815 | 326 | """Add a pairing record between desktopcouch and Ubuntu One""" | ||
816 | 327 | try: | ||
817 | 328 | from desktopcouch.pair.couchdb_pairing.couchdb_io import \ | ||
818 | 329 | put_static_paired_service, PAIRED_SERVER_RECORD_TYPE | ||
819 | 330 | from desktopcouch.records.server import CouchDatabase | ||
820 | 331 | except ImportError: | ||
821 | 332 | # desktopcouch is not installed | ||
822 | 333 | logger.debug(_("Not adding desktopcouch pairing since" | ||
823 | 334 | " desktopcouch is not installed")) | ||
824 | 335 | return | ||
825 | 336 | # Check whether there is already a record of the Ubuntu One service | ||
826 | 337 | db = CouchDatabase("management", create=True) | ||
827 | 338 | if not db.view_exists("ubuntu_one_pair_record","ubuntu_one_pair_record"): | ||
828 | 339 | map_js = """function(doc) { | ||
829 | 340 | if (doc.service_name == "ubuntuone") { | ||
830 | 341 | if (doc.application_annotations && | ||
831 | 342 | doc.application_annotations["Ubuntu One"] && | ||
832 | 343 | doc.application_annotations["Ubuntu One"]["private_application_annotations"] && | ||
833 | 344 | doc.application_annotations["Ubuntu One"]["private_application_annotations"]["deleted"]) { | ||
834 | 345 | emit(doc._id, 1); | ||
835 | 346 | } else { | ||
836 | 347 | emit(doc._id, 0) | ||
837 | 348 | } | ||
838 | 349 | } | ||
839 | 350 | }""" | ||
840 | 351 | db.add_view("ubuntu_one_pair_record", map_js, None, | ||
841 | 352 | "ubuntu_one_pair_record") | ||
842 | 353 | results = db.execute_view("ubuntu_one_pair_record", | ||
843 | 354 | "ubuntu_one_pair_record") | ||
844 | 355 | found = False | ||
845 | 356 | deleted = False | ||
846 | 357 | # Results should contain either one row or no rows | ||
847 | 358 | # If there is one row, its value will be 0, meaning that there is | ||
848 | 359 | # already an Ubuntu One pairing record, or 1, meaning that there | ||
849 | 360 | # was an Ubuntu One pairing record but it has since been unpaired | ||
850 | 361 | # Only create a new record if there is not one already. Specifically, | ||
851 | 362 | # do not add the record if there is a deleted one, as this means | ||
852 | 363 | # that the user explicitly unpaired it! | ||
853 | 364 | for row in results: | ||
854 | 365 | found = True | ||
855 | 366 | if row.value == 1: | ||
856 | 367 | deleted = True | ||
857 | 368 | logger.debug(_("Not adding desktopcouch pairing since" | ||
858 | 369 | " the user has explicitly unpaired with Ubuntu One")) | ||
859 | 370 | else: | ||
860 | 371 | logger.debug(_("Not adding desktopcouch pairing since" | ||
861 | 372 | " we are already paired")) | ||
862 | 373 | if not found: | ||
863 | 374 | put_static_paired_service(None, "ubuntuone") | ||
864 | 375 | logger.debug(_("Pairing desktopcouch with Ubuntu One")) | ||
865 | 376 | |||
866 | 377 | def main(self): | ||
867 | 378 | """Starts the gtk main loop.""" | ||
868 | 379 | from twisted.internet import reactor | ||
869 | 380 | if self.connect != 2 or (self.connect == 1 and self.connected): | ||
870 | 381 | gobject.idle_add(self.check_for_token, True) | ||
871 | 382 | |||
872 | 383 | reactor.run() | ||
873 | 384 | |||
874 | 385 | @property | ||
875 | 386 | def authorized(self): | ||
876 | 387 | """Are we authorized?""" | ||
877 | 388 | return self.is_authorized | ||
878 | 389 | |||
879 | 390 | def sd_dbus_error(self, error): | ||
880 | 391 | """Got an error from DBus.""" | ||
881 | 392 | self.__icon.sd_dbus_error(error) | ||
882 | 393 | |||
883 | 394 | |||
884 | 395 | |||
885 | 396 | def do_config_open_real(): | ||
886 | 397 | """Opens the preferences dialog.""" | ||
887 | 398 | paths = os.environ["PATH"].split(":") | ||
888 | 399 | dirpath = os.path.join(os.getcwd(), "bin") | ||
889 | 400 | if os.path.isdir(dirpath): | ||
890 | 401 | paths.insert(0, dirpath) | ||
891 | 402 | os.environ["PATH"] = ":".join(paths) | ||
892 | 403 | try: | ||
893 | 404 | ret = subprocess.call(["ubuntuone-client-preferences"], | ||
894 | 405 | env=os.environ) | ||
895 | 406 | except OSError: | ||
896 | 407 | ret = -1 | ||
897 | 408 | if ret != 0: | ||
898 | 409 | logger.error(_("Failed to open Ubuntu One preferences")) | ||
899 | 410 | |||
900 | 411 | def do_config_open(): | ||
901 | 412 | """Do the preferences opening in a thread.""" | ||
902 | 413 | Thread(target=do_config_open_real, name="preferences").start() | ||
903 | 414 | |||
904 | 415 | def do_xdg_open_real(path_or_url): | ||
905 | 416 | """Utility method to run xdg-open with path_or_url.""" | ||
906 | 417 | ret = subprocess.call(["xdg-open", path_or_url], env=os.environ) | ||
907 | 418 | if ret != 0: | ||
908 | 419 | logger.error(_("Failed to run 'xdg-open %s'") % path_or_url) | ||
909 | 420 | |||
910 | 421 | def do_xdg_open(path_or_url): | ||
911 | 422 | """Do the xdg-open in a thread.""" | ||
912 | 423 | Thread(target=do_xdg_open_real, name="xdg", args=(path_or_url,)).start() | ||
913 | 424 | |||
914 | 425 | |||
915 | 426 | class AppletIcon(gtk.StatusIcon): | ||
916 | 427 | """ | ||
917 | 428 | Custom StatusIcon derived from gtk.StatusIcon which supports | ||
918 | 429 | animated icons and a few other nice things. | ||
919 | 430 | """ | ||
920 | 431 | |||
921 | 432 | def __init__(self, main=None, config=None, *args, **kw): | ||
922 | 433 | """Initializes our custom StatusIcon based widget.""" | ||
923 | 434 | super(AppletIcon, self).__init__(*args, **kw) | ||
924 | 435 | # Hide until we get status, to avoid flickering | ||
925 | 436 | self.set_visible(False) | ||
926 | 437 | |||
927 | 438 | # The AppletMain object | ||
928 | 439 | self.__main = main | ||
929 | 440 | |||
930 | 441 | # A ConfigParser object that we can poke at | ||
931 | 442 | self.__config = config | ||
932 | 443 | self.__show_when = self.__config.getint("ubuntuone", "show_applet") | ||
933 | 444 | |||
934 | 445 | self.__managed_dir = None | ||
935 | 446 | |||
936 | 447 | self.__size = 24 | ||
937 | 448 | self.__theme = gtk.icon_theme_get_default() | ||
938 | 449 | iconpath = os.path.abspath(os.path.join( | ||
939 | 450 | os.path.split(os.path.dirname(__file__))[0], | ||
940 | 451 | "data")) | ||
941 | 452 | self.__theme.append_search_path(iconpath) | ||
942 | 453 | |||
943 | 454 | self.__theme.append_search_path(os.path.sep + os.path.join( | ||
944 | 455 | "usr", "share", "ubuntuone-client", "icons")) | ||
945 | 456 | self.__theme.append_search_path(os.path.sep + os.path.join( | ||
946 | 457 | "usr", "local", "share", "ubuntuone-client", "icons")) | ||
947 | 458 | |||
948 | 459 | self.set_from_icon_name('ubuntuone-client-offline') | ||
949 | 460 | self.set_tooltip(_("Disconnected")) | ||
950 | 461 | self.connect("popup-menu", self.__popup_menu) | ||
951 | 462 | self.connect("activate", self.__do_action) | ||
952 | 463 | |||
953 | 464 | self.__size_changed(self, self.__size) | ||
954 | 465 | |||
955 | 466 | self.__litems = {} | ||
956 | 467 | self.__ritems = {} | ||
957 | 468 | self.__status_menu, self.__config_menu = self.__build_menus() | ||
958 | 469 | |||
959 | 470 | self.__connected = False | ||
960 | 471 | self.__need_update = False | ||
961 | 472 | self.__fatal_error = False | ||
962 | 473 | |||
963 | 474 | pynotify.init("Ubuntu One") | ||
964 | 475 | |||
965 | 476 | # Managing applet visibility | ||
966 | 477 | self.__visible = True | ||
967 | 478 | self.__visible_id = 0 | ||
968 | 479 | |||
969 | 480 | # Up/Dn status | ||
970 | 481 | self.__lock = Lock() | ||
971 | 482 | self.__updating = 0 | ||
972 | 483 | self.__total = 0 | ||
973 | 484 | self.__last_id = 0 | ||
974 | 485 | |||
975 | 486 | self.__bus = dbus.SessionBus() | ||
976 | 487 | |||
977 | 488 | # Our own DBus service, for the config to deal with | ||
978 | 489 | self.__service = AppletConfig(icon=self) | ||
979 | 490 | |||
980 | 491 | # DBus signal handling | ||
981 | 492 | self.__bus.add_signal_receiver( | ||
982 | 493 | handler_function=self.__status_changed, | ||
983 | 494 | signal_name="StatusChanged", | ||
984 | 495 | dbus_interface=DBUS_IFACE_STATUS_NAME) | ||
985 | 496 | |||
986 | 497 | self.__bus.add_signal_receiver( | ||
987 | 498 | handler_function=self.__queue_changed, | ||
988 | 499 | signal_name="ContentQueueChanged", | ||
989 | 500 | dbus_interface=DBUS_IFACE_STATUS_NAME) | ||
990 | 501 | self.__bus.add_signal_receiver( | ||
991 | 502 | handler_function=self.__transfer_started, | ||
992 | 503 | signal_name="UploadStarted", | ||
993 | 504 | dbus_interface=DBUS_IFACE_STATUS_NAME) | ||
994 | 505 | self.__bus.add_signal_receiver( | ||
995 | 506 | handler_function=self.__transfer_started, | ||
996 | 507 | signal_name="DownloadStarted", | ||
997 | 508 | dbus_interface=DBUS_IFACE_STATUS_NAME) | ||
998 | 509 | |||
999 | 510 | gobject.idle_add(self.__get_root) | ||
1000 | 511 | |||
1001 | 512 | def set_from_icon_name(self, icon): | ||
1002 | 513 | """Handle fallbacks for setting our icon.""" | ||
1003 | 514 | pixbuf = self.__theme.load_icon(icon, self.__size, | ||
1004 | 515 | gtk.ICON_LOOKUP_GENERIC_FALLBACK) | ||
1005 | 516 | self.set_from_pixbuf(pixbuf) | ||
1006 | 517 | |||
1007 | 518 | def set_visibility_config(self, visibility): | ||
1008 | 519 | """Update the visibility configuration.""" | ||
1009 | 520 | self.__show_when = int(visibility) | ||
1010 | 521 | self.__config.set("ubuntuone", "show_applet", str(self.__show_when)) | ||
1011 | 522 | self.update_visibility() | ||
1012 | 523 | |||
1013 | 524 | def set_connection_config(self, connect): | ||
1014 | 525 | """Update the connection config.""" | ||
1015 | 526 | self.__config.set("ubuntuone", "connect", str(connect)) | ||
1016 | 527 | |||
1017 | 528 | def __update_transfer_status(self, done=False): | ||
1018 | 529 | """Update the status display.""" | ||
1019 | 530 | with self.__lock: | ||
1020 | 531 | text = _("Updating file %(transfers)d of %(total)d...") % \ | ||
1021 | 532 | dict(transfers=self.__updating, total=self.__total) | ||
1022 | 533 | label = self.__litems["status"].get_child() | ||
1023 | 534 | if done: | ||
1024 | 535 | self.set_tooltip(_("Files updated.")) | ||
1025 | 536 | self.set_from_icon_name("ubuntuone-client-idle") | ||
1026 | 537 | label.set_text(_("Your files are up to date.")) | ||
1027 | 538 | else: | ||
1028 | 539 | label.set_markup("<i>%s</i>" % text) | ||
1029 | 540 | |||
1030 | 541 | def __queue_changed(self, queue): | ||
1031 | 542 | """Handle ContentQueueChanged.""" | ||
1032 | 543 | total = 0 | ||
1033 | 544 | d = queue.get('Download', None) | ||
1034 | 545 | if d is not None: | ||
1035 | 546 | total += int(d.get('count', 0)) | ||
1036 | 547 | d = queue.get('Upload', None) | ||
1037 | 548 | if d is not None: | ||
1038 | 549 | total += int(d.get('count', 0)) | ||
1039 | 550 | first = False | ||
1040 | 551 | last = False | ||
1041 | 552 | self.__visible = True | ||
1042 | 553 | self.set_tooltip(_("Updating files...")) | ||
1043 | 554 | self.update_visibility() | ||
1044 | 555 | with self.__lock: | ||
1045 | 556 | if self.__total == 0: | ||
1046 | 557 | first = True | ||
1047 | 558 | last = False | ||
1048 | 559 | if self.__total != 0 and total == 0: | ||
1049 | 560 | first = False | ||
1050 | 561 | last = True | ||
1051 | 562 | self.__total = total + self.__updating | ||
1052 | 563 | if first: | ||
1053 | 564 | self.set_from_icon_name("ubuntuone-client-updating") | ||
1054 | 565 | n = pynotify.Notification( | ||
1055 | 566 | _("Updating files..."), | ||
1056 | 567 | _("Ubuntu One is now updating your files.")) | ||
1057 | 568 | pixbuf = self.__theme.load_icon( | ||
1058 | 569 | "ubuntuone-client-updating", NOTIFY_ICON_SIZE, | ||
1059 | 570 | gtk.ICON_LOOKUP_GENERIC_FALLBACK) | ||
1060 | 571 | n.set_icon_from_pixbuf(pixbuf) | ||
1061 | 572 | n.show() | ||
1062 | 573 | if last: | ||
1063 | 574 | if self.__last_id != 0: | ||
1064 | 575 | gobject.source_remove(self.__last_id) | ||
1065 | 576 | self.__last_id = 0 | ||
1066 | 577 | self.__last_id = gobject.timeout_add_seconds( | ||
1067 | 578 | 15, self.__updating_completed) | ||
1068 | 579 | |||
1069 | 580 | def __updating_completed(self): | ||
1070 | 581 | """Timeout to avoid multiple started/finished notifications.""" | ||
1071 | 582 | really_last = False | ||
1072 | 583 | n = None | ||
1073 | 584 | with self.__lock: | ||
1074 | 585 | done = self.__total - self.__updating | ||
1075 | 586 | if done == 0: | ||
1076 | 587 | really_last = True | ||
1077 | 588 | if not really_last: | ||
1078 | 589 | return False | ||
1079 | 590 | |||
1080 | 591 | with self.__lock: | ||
1081 | 592 | n = pynotify.Notification( | ||
1082 | 593 | _("Updating Finished"), | ||
1083 | 594 | ngettext("Ubuntu One finished updating %(total)d file.", | ||
1084 | 595 | "Ubuntu One finished updating %(total)d files.", | ||
1085 | 596 | self.__total) % { 'total' : self.__total }) | ||
1086 | 597 | self.__total = 0 | ||
1087 | 598 | self.__updating = 0 | ||
1088 | 599 | pixbuf = self.__theme.load_icon( | ||
1089 | 600 | "ubuntuone-client-updating", NOTIFY_ICON_SIZE, | ||
1090 | 601 | gtk.ICON_LOOKUP_GENERIC_FALLBACK) | ||
1091 | 602 | n.set_icon_from_pixbuf(pixbuf) | ||
1092 | 603 | n.show() | ||
1093 | 604 | self.__update_transfer_status(True) | ||
1094 | 605 | return False | ||
1095 | 606 | |||
1096 | 607 | def __transfer_started(self, path): | ||
1097 | 608 | """Handle the started signals.""" | ||
1098 | 609 | with self.__lock: | ||
1099 | 610 | self.__updating += 1 | ||
1100 | 611 | self.__update_transfer_status() | ||
1101 | 612 | |||
1102 | 613 | def update_visibility(self): | ||
1103 | 614 | """Update the icon's visibility.""" | ||
1104 | 615 | if self.__visible_id != 0: | ||
1105 | 616 | gobject.source_remove(self.__visible_id) | ||
1106 | 617 | self.__visible_id = 0 | ||
1107 | 618 | |||
1108 | 619 | if (self.__visible and self.__show_when != 2) or self.__fatal_error: | ||
1109 | 620 | self.set_visible(True) | ||
1110 | 621 | return | ||
1111 | 622 | |||
1112 | 623 | if self.__show_when == 2 and not self.__fatal_error: | ||
1113 | 624 | self.set_visible(False) | ||
1114 | 625 | return | ||
1115 | 626 | |||
1116 | 627 | # If the icon is shown, set up a timeout to hide it | ||
1117 | 628 | if self.get_visible(): | ||
1118 | 629 | self.__visible_id = gobject.timeout_add_seconds( | ||
1119 | 630 | 30, self.__hide_icon) | ||
1120 | 631 | |||
1121 | 632 | def __status_changed(self, status): | ||
1122 | 633 | """The sync daemon status changed.""" | ||
1123 | 634 | if self.__managed_dir is None: | ||
1124 | 635 | gobject.idle_add(self.__get_root) | ||
1125 | 636 | |||
1126 | 637 | if self.__show_when != 0: | ||
1127 | 638 | self.__visible = False | ||
1128 | 639 | |||
1129 | 640 | state = status['name'] | ||
1130 | 641 | |||
1131 | 642 | self.set_tooltip("Ubuntu One") | ||
1132 | 643 | |||
1133 | 644 | if self.__fatal_error and state != "UNKNOWN_ERROR": | ||
1134 | 645 | # Just blow your nose, and it's fixed, isn't it. | ||
1135 | 646 | self.__fatal_error = False | ||
1136 | 647 | self.__litems["connect"].set_sensitive(True) | ||
1137 | 648 | self.__litems["disconnect"].set_sensitive(True) | ||
1138 | 649 | |||
1139 | 650 | if state == "OFFLINE" or state.startswith("INIT") or \ | ||
1140 | 651 | state.startswith("READY"): | ||
1141 | 652 | self.set_from_icon_name("ubuntuone-client-offline") | ||
1142 | 653 | self.set_tooltip(_("Disconnected")) | ||
1143 | 654 | self.__connected = False | ||
1144 | 655 | self.__visible = True | ||
1145 | 656 | |||
1146 | 657 | elif state == "CAPABILITIES_MISMATCH": | ||
1147 | 658 | self.__connected = False | ||
1148 | 659 | self.__visible = True | ||
1149 | 660 | # Pop up a notification | ||
1150 | 661 | n = pynotify.Notification( | ||
1151 | 662 | _("Capabilities Mismatch"), | ||
1152 | 663 | _("There was a capabilities mismatch while attempting " | ||
1153 | 664 | "to connect to the Ubuntu One server. You may " | ||
1154 | 665 | "have installed a newer version of the client, for " | ||
1155 | 666 | "which the server does not yet provide support. " | ||
1156 | 667 | "A new version of the server should be accessible " | ||
1157 | 668 | "soon. Please be patient while we update.")) | ||
1158 | 669 | pixbuf = self.__theme.load_icon( | ||
1159 | 670 | "ubuntuone-client-error", NOTIFY_ICON_SIZE, | ||
1160 | 671 | gtk.ICON_LOOKUP_GENERIC_FALLBACK) | ||
1161 | 672 | n.set_icon_from_pixbuf(pixbuf) | ||
1162 | 673 | n.set_urgency(pynotify.URGENCY_CRITICAL) | ||
1163 | 674 | n.show() | ||
1164 | 675 | # Set the tooltip and icon on the applet | ||
1165 | 676 | self.set_tooltip(_("Capabilities mismatch with server.")) | ||
1166 | 677 | self.set_from_icon_name("ubuntuone-client-error") | ||
1167 | 678 | |||
1168 | 679 | elif state == "IDLE" or state.startswith("READING") or \ | ||
1169 | 680 | state.startswith("SCANNING"): | ||
1170 | 681 | self.__connected = True | ||
1171 | 682 | if self.__show_when != 0: | ||
1172 | 683 | self.__visible = False | ||
1173 | 684 | |||
1174 | 685 | elif state == "AUTH_FAILED": | ||
1175 | 686 | self.__stop_syncdaemon() | ||
1176 | 687 | self.set_from_icon_name("ubuntuone-client-error") | ||
1177 | 688 | self.set_tooltip(_("Authentication failed")) | ||
1178 | 689 | self.__connected = False | ||
1179 | 690 | self.__visible = True | ||
1180 | 691 | |||
1181 | 692 | def reauthorize_error(e): | ||
1182 | 693 | """Simple dbus error handler.""" | ||
1183 | 694 | logger.error(_("Error clearing token: %s") % str(e)) | ||
1184 | 695 | |||
1185 | 696 | try: | ||
1186 | 697 | def token_cleared(): | ||
1187 | 698 | """Do the next step.""" | ||
1188 | 699 | if self.__main: | ||
1189 | 700 | self.__main.check_for_token(True) | ||
1190 | 701 | |||
1191 | 702 | client = self.__bus.get_object(DBUS_IFACE_AUTH_NAME, | ||
1192 | 703 | "/", follow_name_owner_changes=True) | ||
1193 | 704 | iface = dbus.Interface(client, DBUS_IFACE_AUTH_NAME) | ||
1194 | 705 | iface.clear_token(OAUTH_REALM, OAUTH_CONSUMER, | ||
1195 | 706 | reply_handler=token_cleared, | ||
1196 | 707 | error_handler=reauthorize_error) | ||
1197 | 708 | except DBusException, e: | ||
1198 | 709 | reauthorize_error(e) | ||
1199 | 710 | |||
1200 | 711 | elif state == "UNKNOWN_ERROR": | ||
1201 | 712 | # Disable some menu items | ||
1202 | 713 | self.__litems["connect"].set_sensitive(False) | ||
1203 | 714 | self.__litems["disconnect"].set_sensitive(False) | ||
1204 | 715 | # Change the behavior to file a bug | ||
1205 | 716 | if self.__fatal_error: | ||
1206 | 717 | return | ||
1207 | 718 | |||
1208 | 719 | self.__fatal_error = True | ||
1209 | 720 | self.__visible = True | ||
1210 | 721 | |||
1211 | 722 | # Pop up a notification | ||
1212 | 723 | n = pynotify.Notification( | ||
1213 | 724 | "Ubuntu One", | ||
1214 | 725 | _("There was a fatal error in Ubuntu One. " + | ||
1215 | 726 | "This may be a bug in the software. " | ||
1216 | 727 | "Please click on the Ubuntu One icon " + | ||
1217 | 728 | "in your panel to report a bug.")) | ||
1218 | 729 | pixbuf = self.__theme.load_icon( | ||
1219 | 730 | "ubuntuone-client-error", NOTIFY_ICON_SIZE, | ||
1220 | 731 | gtk.ICON_LOOKUP_GENERIC_FALLBACK) | ||
1221 | 732 | n.set_icon_from_pixbuf(pixbuf) | ||
1222 | 733 | n.set_urgency(pynotify.URGENCY_CRITICAL) | ||
1223 | 734 | n.show() | ||
1224 | 735 | # Set the tooltip and icon on the applet | ||
1225 | 736 | self.set_tooltip(_("Fatal Error")) | ||
1226 | 737 | self.set_from_icon_name("ubuntuone-client-error") | ||
1227 | 738 | |||
1228 | 739 | else: | ||
1229 | 740 | self.__connected = True | ||
1230 | 741 | self.set_from_icon_name("ubuntuone-client-idle") | ||
1231 | 742 | if state.startswith("CONNECTING") or \ | ||
1232 | 743 | state.startswith("START_CONNECTING") or \ | ||
1233 | 744 | state.startswith("AUTHENTICATING") or \ | ||
1234 | 745 | state.startswith("CONNECTED") or \ | ||
1235 | 746 | state.startswith("START_CONNECTED"): | ||
1236 | 747 | self.set_from_icon_name("ubuntuone-client-idle") | ||
1237 | 748 | self.set_tooltip(_("Connecting")) | ||
1238 | 749 | self.__visible = True | ||
1239 | 750 | |||
1240 | 751 | self.update_visibility() | ||
1241 | 752 | |||
1242 | 753 | if self.__connected: | ||
1243 | 754 | self.__litems["connect"].hide() | ||
1244 | 755 | self.__litems["disconnect"].show() | ||
1245 | 756 | else: | ||
1246 | 757 | self.__litems["connect"].show() | ||
1247 | 758 | self.__litems["disconnect"].hide() | ||
1248 | 759 | self.__config.set("ubuntuone", "connected", self.__connected) | ||
1249 | 760 | |||
1250 | 761 | def __hide_icon(self): | ||
1251 | 762 | """Timeout to hide tray icon after a period of inactivity.""" | ||
1252 | 763 | if self.__show_when == 0: | ||
1253 | 764 | return False | ||
1254 | 765 | |||
1255 | 766 | self.__visible = False | ||
1256 | 767 | self.__visible_id = 0 | ||
1257 | 768 | self.set_visible(False) | ||
1258 | 769 | return False | ||
1259 | 770 | |||
1260 | 771 | def __get_root(self): | ||
1261 | 772 | """Method to get the rootdir from the sync daemon.""" | ||
1262 | 773 | # Get the managed root directory | ||
1263 | 774 | try: | ||
1264 | 775 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/", | ||
1265 | 776 | follow_name_owner_changes=True) | ||
1266 | 777 | except DBusException: | ||
1267 | 778 | return False | ||
1268 | 779 | |||
1269 | 780 | iface = dbus.Interface(client, DBUS_IFACE_SYNC_NAME) | ||
1270 | 781 | def got_root(root): | ||
1271 | 782 | """We got the root dir.""" | ||
1272 | 783 | self.__managed_dir = root | ||
1273 | 784 | if os.path.isdir(self.__managed_dir) and \ | ||
1274 | 785 | os.access(self.__managed_dir, | ||
1275 | 786 | os.F_OK | os.R_OK): | ||
1276 | 787 | self.__ritems["open"].set_sensitive(True) | ||
1277 | 788 | self.__add_to_places() | ||
1278 | 789 | else: | ||
1279 | 790 | self.__ritems["open"].set_sensitive(False) | ||
1280 | 791 | |||
1281 | 792 | def got_err(error): | ||
1282 | 793 | """Handle error from the dbus callback.""" | ||
1283 | 794 | self.sd_dbus_error(error) | ||
1284 | 795 | self.__managed_dir = None | ||
1285 | 796 | self.__ritems["open"].set_sensitive(False) | ||
1286 | 797 | |||
1287 | 798 | iface.get_rootdir(reply_handler=got_root, error_handler=got_err) | ||
1288 | 799 | |||
1289 | 800 | # Now get the current status | ||
1290 | 801 | try: | ||
1291 | 802 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/status", | ||
1292 | 803 | follow_name_owner_changes=True) | ||
1293 | 804 | iface = dbus.Interface(client, DBUS_IFACE_STATUS_NAME) | ||
1294 | 805 | iface.current_status(reply_handler=self.__status_changed, | ||
1295 | 806 | error_handler=self.sd_dbus_error) | ||
1296 | 807 | except DBusException, e: | ||
1297 | 808 | self.sd_dbus_error(e) | ||
1298 | 809 | return False | ||
1299 | 810 | |||
1300 | 811 | return False | ||
1301 | 812 | |||
1302 | 813 | def __build_menus(self): | ||
1303 | 814 | """Create the pop-up menu items.""" | ||
1304 | 815 | # Create the left-click menu | ||
1305 | 816 | lmenu = gtk.Menu() | ||
1306 | 817 | |||
1307 | 818 | self.__litems["status"] = gtk.MenuItem( | ||
1308 | 819 | label=_("Your files are up to date.")) | ||
1309 | 820 | lmenu.append(self.__litems["status"]) | ||
1310 | 821 | self.__litems["status"].set_sensitive(False) | ||
1311 | 822 | self.__litems["status"].show() | ||
1312 | 823 | |||
1313 | 824 | sep = gtk.SeparatorMenuItem() | ||
1314 | 825 | lmenu.append(sep) | ||
1315 | 826 | sep.show() | ||
1316 | 827 | |||
1317 | 828 | self.__litems["connect"] = gtk.ImageMenuItem( | ||
1318 | 829 | stock_id=gtk.STOCK_CONNECT) | ||
1319 | 830 | lmenu.append(self.__litems["connect"]) | ||
1320 | 831 | self.__litems["connect"].connect("activate", self.__toggle_state) | ||
1321 | 832 | self.__litems["connect"].show() | ||
1322 | 833 | |||
1323 | 834 | self.__litems["disconnect"] = gtk.ImageMenuItem( | ||
1324 | 835 | stock_id=gtk.STOCK_DISCONNECT) | ||
1325 | 836 | lmenu.append(self.__litems["disconnect"]) | ||
1326 | 837 | self.__litems["disconnect"].connect("activate", self.__toggle_state) | ||
1327 | 838 | |||
1328 | 839 | lmenu.show() | ||
1329 | 840 | |||
1330 | 841 | # Create the right-click menu | ||
1331 | 842 | rmenu = gtk.Menu() | ||
1332 | 843 | |||
1333 | 844 | self.__ritems["bug"] = gtk.MenuItem(label=_("_Report a Problem")) | ||
1334 | 845 | rmenu.append(self.__ritems["bug"]) | ||
1335 | 846 | self.__ritems["bug"].connect("activate", self.__report_problem) | ||
1336 | 847 | self.__ritems["bug"].show() | ||
1337 | 848 | |||
1338 | 849 | self.__ritems["open"] = gtk.MenuItem(label=_("_Open Folder")) | ||
1339 | 850 | rmenu.append(self.__ritems["open"]) | ||
1340 | 851 | self.__ritems["open"].connect("activate", self.__open_folder) | ||
1341 | 852 | self.__ritems["open"].set_sensitive(False) | ||
1342 | 853 | self.__ritems["open"].show() | ||
1343 | 854 | |||
1344 | 855 | self.__ritems["web"] = gtk.MenuItem(label=_("_Go to Web")) | ||
1345 | 856 | rmenu.append(self.__ritems["web"]) | ||
1346 | 857 | self.__ritems["web"].connect("activate", self.__open_website) | ||
1347 | 858 | self.__ritems["web"].show() | ||
1348 | 859 | |||
1349 | 860 | self.__ritems["config"] = gtk.ImageMenuItem( | ||
1350 | 861 | stock_id=gtk.STOCK_PREFERENCES) | ||
1351 | 862 | rmenu.append(self.__ritems["config"]) | ||
1352 | 863 | self.__ritems["config"].connect("activate", self.__open_config) | ||
1353 | 864 | self.__ritems["config"].show() | ||
1354 | 865 | |||
1355 | 866 | sep = gtk.SeparatorMenuItem() | ||
1356 | 867 | rmenu.append(sep) | ||
1357 | 868 | sep.show() | ||
1358 | 869 | |||
1359 | 870 | self.__ritems["quit"] = gtk.ImageMenuItem(stock_id=gtk.STOCK_QUIT) | ||
1360 | 871 | rmenu.append(self.__ritems["quit"]) | ||
1361 | 872 | self.__ritems["quit"].connect("activate", self.__quit_applet) | ||
1362 | 873 | self.__ritems["quit"].show() | ||
1363 | 874 | |||
1364 | 875 | rmenu.show() | ||
1365 | 876 | |||
1366 | 877 | return lmenu, rmenu | ||
1367 | 878 | |||
1368 | 879 | def __size_changed(self, icon, size, data=None): | ||
1369 | 880 | """Callback for when the size changes.""" | ||
1370 | 881 | if size < 24: | ||
1371 | 882 | self.__size = 16 | ||
1372 | 883 | elif size >= 24 and size < 32: | ||
1373 | 884 | self.__size = 24 | ||
1374 | 885 | elif size >= 32 and size < 48: | ||
1375 | 886 | self.__size = 32 | ||
1376 | 887 | elif size >= 48 and size < 64: | ||
1377 | 888 | self.__size = 48 | ||
1378 | 889 | else: | ||
1379 | 890 | self.__size = size | ||
1380 | 891 | |||
1381 | 892 | def __popup_menu(self, icon, button, timestamp, data=None): | ||
1382 | 893 | """Pops up the context menu for the tray icon.""" | ||
1383 | 894 | if button == 0: | ||
1384 | 895 | self.__status_menu.popup(None, None, | ||
1385 | 896 | gtk.status_icon_position_menu, | ||
1386 | 897 | button, timestamp, icon) | ||
1387 | 898 | else: | ||
1388 | 899 | self.__config_menu.popup(None, None, | ||
1389 | 900 | gtk.status_icon_position_menu, | ||
1390 | 901 | button, timestamp, icon) | ||
1391 | 902 | |||
1392 | 903 | def __stop_syncdaemon(self): | ||
1393 | 904 | """Tell the syncdaemon to quit.""" | ||
1394 | 905 | def quit_error(e): | ||
1395 | 906 | """Just log and ignore.""" | ||
1396 | 907 | logger.error(_("Quit Error: %s") % e.get_dbus_message()) | ||
1397 | 908 | |||
1398 | 909 | try: | ||
1399 | 910 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/", | ||
1400 | 911 | follow_name_owner_changes=True) | ||
1401 | 912 | iface = dbus.Interface(client, DBUS_IFACE_SYNC_NAME) | ||
1402 | 913 | iface.quit(reply_handler=dbus_async, | ||
1403 | 914 | error_handler=quit_error) | ||
1404 | 915 | except DBusException, e: | ||
1405 | 916 | quit_error(e) | ||
1406 | 917 | |||
1407 | 918 | def __quit_applet(self, menuitem, data=None): | ||
1408 | 919 | """Quit the daemon and closes the applet.""" | ||
1409 | 920 | self.__stop_syncdaemon() | ||
1410 | 921 | |||
1411 | 922 | from twisted.internet import reactor | ||
1412 | 923 | reactor.stop() | ||
1413 | 924 | |||
1414 | 925 | def __toggle_state(self, menuitem, data=None): | ||
1415 | 926 | """Connects or disconnects the storage sync process.""" | ||
1416 | 927 | try: | ||
1417 | 928 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/", | ||
1418 | 929 | follow_name_owner_changes=True) | ||
1419 | 930 | iface = dbus.Interface(client, DBUS_IFACE_SYNC_NAME) | ||
1420 | 931 | if self.__connected: | ||
1421 | 932 | iface.disconnect(reply_handler=dbus_async, | ||
1422 | 933 | error_handler=self.sd_dbus_error) | ||
1423 | 934 | else: | ||
1424 | 935 | if self.__main and self.__main.authorized is False: | ||
1425 | 936 | self.__main.check_for_token(do_login=True) | ||
1426 | 937 | iface.connect(reply_handler=dbus_async, | ||
1427 | 938 | error_handler=self.sd_dbus_error) | ||
1428 | 939 | except DBusException, e: | ||
1429 | 940 | self.sd_dbus_error(e) | ||
1430 | 941 | |||
1431 | 942 | self.__config.set("ubuntuone", "connected", not self.__connected) | ||
1432 | 943 | with open(CONF_FILE, "w+b") as f: | ||
1433 | 944 | self.__config.write(f) | ||
1434 | 945 | |||
1435 | 946 | def __open_folder(self, data=None): | ||
1436 | 947 | """Opens the storage folder in the file manager.""" | ||
1437 | 948 | if not self.__managed_dir or not os.path.isdir(self.__managed_dir): | ||
1438 | 949 | return | ||
1439 | 950 | |||
1440 | 951 | folder = "file://%s" % quote(self.__managed_dir) | ||
1441 | 952 | do_xdg_open(folder) | ||
1442 | 953 | |||
1443 | 954 | def __do_action(self, data=None): | ||
1444 | 955 | """Handles the most appropriate action when the icon is clicked.""" | ||
1445 | 956 | if self.__fatal_error: | ||
1446 | 957 | self.__report_problem() | ||
1447 | 958 | self.__quit_applet(None) | ||
1448 | 959 | return | ||
1449 | 960 | |||
1450 | 961 | if self.__need_update: | ||
1451 | 962 | do_xdg_open("apt:ubuntuone-storage-protocol?refresh=yes") | ||
1452 | 963 | return | ||
1453 | 964 | |||
1454 | 965 | # Popup the status menu | ||
1455 | 966 | self.emit("popup-menu", 0, gtk.get_current_event_time()) | ||
1456 | 967 | |||
1457 | 968 | def __report_problem_real(self): | ||
1458 | 969 | """Runs apport to report a problem against our code.""" | ||
1459 | 970 | args = ["ubuntu-bug", "ubuntuone-client"] | ||
1460 | 971 | ret = subprocess.call(args, env=os.environ) | ||
1461 | 972 | if ret != 0: | ||
1462 | 973 | logger.error(_("Failed to run 'ubuntu-bug'")) | ||
1463 | 974 | |||
1464 | 975 | def __report_problem(self, data=None): | ||
1465 | 976 | """Pops another thread to run apport in.""" | ||
1466 | 977 | Thread(target=self.__report_problem_real, name="apport").start() | ||
1467 | 978 | |||
1468 | 979 | def __open_website(self, data=None, url=None): | ||
1469 | 980 | """Opens the one.ubuntu.com web site.""" | ||
1470 | 981 | if url: | ||
1471 | 982 | do_xdg_open(url) | ||
1472 | 983 | else: | ||
1473 | 984 | do_xdg_open("https://one.ubuntu.com/") | ||
1474 | 985 | |||
1475 | 986 | |||
1476 | 987 | def __open_config(self, data=None): | ||
1477 | 988 | """Opens the preferences dialog.""" | ||
1478 | 989 | do_config_open() | ||
1479 | 990 | |||
1480 | 991 | def __add_to_places(self): | ||
1481 | 992 | """Add the managed directory to the .gtk-bookmarks file.""" | ||
1482 | 993 | # Only add once | ||
1483 | 994 | if self.__config.getboolean("ubuntuone", "bookmarked"): | ||
1484 | 995 | return | ||
1485 | 996 | |||
1486 | 997 | path = os.path.join(os.path.expanduser("~"), ".gtk-bookmarks") | ||
1487 | 998 | with open(path, "a+") as f: | ||
1488 | 999 | bookmarks_entry = "file://%s %s\n" % ( | ||
1489 | 1000 | quote(self.__managed_dir), BOOKMARK_NAME) | ||
1490 | 1001 | in_file = False | ||
1491 | 1002 | for line in f: | ||
1492 | 1003 | if line == bookmarks_entry: | ||
1493 | 1004 | in_file = True | ||
1494 | 1005 | if not in_file: | ||
1495 | 1006 | f.write(bookmarks_entry) | ||
1496 | 1007 | |||
1497 | 1008 | self.__config.set("ubuntuone", "bookmarked", "True") | ||
1498 | 1009 | with open(CONF_FILE, "w+b") as f: | ||
1499 | 1010 | self.__config.write(f) | ||
1500 | 1011 | |||
1501 | 1012 | def sd_dbus_error(self, error): | ||
1502 | 1013 | """ | ||
1503 | 1014 | Handle DBus errors for crucial syncdaemon calls, | ||
1504 | 1015 | and change the applet behavior slightly. | ||
1505 | 1016 | """ | ||
1506 | 1017 | logger.error(_("DBus Error: %s") % error.get_dbus_message()) | ||
1507 | 1018 | if self.__fatal_error: | ||
1508 | 1019 | return | ||
1509 | 1020 | |||
1510 | 1021 | self.__fatal_error = True | ||
1511 | 1022 | self.__status_changed({'name' : 'UNKNOWN_ERROR'}) | ||
1512 | 1023 | |||
1513 | 1024 | |||
1514 | 1025 | class AppletConfig(dbus.service.Object): | ||
1515 | 1026 | """DBus Service object""" | ||
1516 | 1027 | |||
1517 | 1028 | def __init__(self, icon, *args, **kwargs): | ||
1518 | 1029 | """Initialize our magic.""" | ||
1519 | 1030 | self.icon = icon | ||
1520 | 1031 | self.path = "/config" | ||
1521 | 1032 | self.bus = dbus.SessionBus() | ||
1522 | 1033 | bus_name = dbus.service.BusName(APPLET_BUS_NAME, | ||
1523 | 1034 | bus=self.bus) | ||
1524 | 1035 | dbus.service.Object.__init__(self, bus_name=bus_name, | ||
1525 | 1036 | object_path=self.path) | ||
1526 | 1037 | |||
1527 | 1038 | @dbus.service.method(APPLET_CONFIG_NAME, | ||
1528 | 1039 | in_signature='i', out_signature='') | ||
1529 | 1040 | def set_visibility_config(self, visibility): | ||
1530 | 1041 | self.icon.set_visibility_config(visibility) | ||
1531 | 1042 | |||
1532 | 1043 | @dbus.service.method(APPLET_CONFIG_NAME, | ||
1533 | 1044 | in_signature='i', out_signature='') | ||
1534 | 1045 | def set_connection_config(self, connect): | ||
1535 | 1046 | self.icon.set_connection_config(connect) | ||
1536 | 1047 | |||
1537 | 1048 | |||
1538 | 1049 | if __name__ == "__main__": | ||
1539 | 1050 | gettext.bindtextdomain(clientdefs.GETTEXT_PACKAGE, clientdefs.LOCALEDIR) | ||
1540 | 1051 | gettext.textdomain(clientdefs.GETTEXT_PACKAGE) | ||
1541 | 1052 | |||
1542 | 1053 | # Register DBus service for making sure we run only one instance | ||
1543 | 1054 | bus = dbus.SessionBus() | ||
1544 | 1055 | if bus.request_name(APPLET_BUS_NAME, dbus.bus.NAME_FLAG_DO_NOT_QUEUE) == dbus.bus.REQUEST_NAME_REPLY_EXISTS: | ||
1545 | 1056 | print _("Ubuntu One client applet already running, quitting") | ||
1546 | 1057 | do_config_open() | ||
1547 | 1058 | sys.exit(0) | ||
1548 | 1059 | |||
1549 | 1060 | gtk.rc_parse_string(RCSTYLE) | ||
1550 | 1061 | |||
1551 | 1062 | icon = AppletMain() | ||
1552 | 1063 | icon.main() | ||
1553 | 1064 | 0 | ||
1554 | === removed file 'bin/ubuntuone-client-preferences' | |||
1555 | --- bin/ubuntuone-client-preferences 2009-12-07 17:35:00 +0000 | |||
1556 | +++ bin/ubuntuone-client-preferences 1970-01-01 00:00:00 +0000 | |||
1557 | @@ -1,360 +0,0 @@ | |||
1558 | 1 | #!/usr/bin/python | ||
1559 | 2 | |||
1560 | 3 | # ubuntuone-client-applet - Tray icon applet for managing Ubuntu One | ||
1561 | 4 | # | ||
1562 | 5 | # Author: Rodney Dawes <rodney.dawes@canonical.com> | ||
1563 | 6 | # | ||
1564 | 7 | # Copyright 2009 Canonical Ltd. | ||
1565 | 8 | # | ||
1566 | 9 | # This program is free software: you can redistribute it and/or modify it | ||
1567 | 10 | # under the terms of the GNU General Public License version 3, as published | ||
1568 | 11 | # by the Free Software Foundation. | ||
1569 | 12 | # | ||
1570 | 13 | # This program is distributed in the hope that it will be useful, but | ||
1571 | 14 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
1572 | 15 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
1573 | 16 | # PURPOSE. See the GNU General Public License for more details. | ||
1574 | 17 | # | ||
1575 | 18 | # You should have received a copy of the GNU General Public License along | ||
1576 | 19 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1577 | 20 | |||
1578 | 21 | from __future__ import with_statement | ||
1579 | 22 | |||
1580 | 23 | import pygtk | ||
1581 | 24 | pygtk.require('2.0') | ||
1582 | 25 | import gobject | ||
1583 | 26 | import gtk | ||
1584 | 27 | import os | ||
1585 | 28 | import gettext | ||
1586 | 29 | from ubuntuone import clientdefs | ||
1587 | 30 | |||
1588 | 31 | import dbus.service | ||
1589 | 32 | from ConfigParser import ConfigParser | ||
1590 | 33 | from dbus.exceptions import DBusException | ||
1591 | 34 | from dbus.mainloop.glib import DBusGMainLoop | ||
1592 | 35 | from xdg.BaseDirectory import xdg_config_home | ||
1593 | 36 | |||
1594 | 37 | DBusGMainLoop(set_as_default=True) | ||
1595 | 38 | |||
1596 | 39 | _ = gettext.gettext | ||
1597 | 40 | |||
1598 | 41 | APPLET_IFACE_NAME = "com.ubuntuone.ClientApplet" | ||
1599 | 42 | APPLET_IFACE_CONFIG_NAME = APPLET_IFACE_NAME + ".Config" | ||
1600 | 43 | |||
1601 | 44 | DBUS_IFACE_NAME = "com.ubuntuone.SyncDaemon" | ||
1602 | 45 | DBUS_IFACE_CONFIG_NAME = DBUS_IFACE_NAME + ".Config" | ||
1603 | 46 | |||
1604 | 47 | # Why thank you GTK+ for enforcing style-set and breaking API | ||
1605 | 48 | RCSTYLE = """ | ||
1606 | 49 | style 'dialogs' { | ||
1607 | 50 | GtkDialog::action-area-border = 12 | ||
1608 | 51 | GtkDialog::button-spacing = 6 | ||
1609 | 52 | GtkDialog::content-area-border = 0 | ||
1610 | 53 | } | ||
1611 | 54 | widget_class '*Dialog*' style 'dialogs' | ||
1612 | 55 | """ | ||
1613 | 56 | |||
1614 | 57 | CONF_FILE = os.path.join(xdg_config_home, "ubuntuone", "ubuntuone-client.conf") | ||
1615 | 58 | |||
1616 | 59 | def dbus_async(*args): | ||
1617 | 60 | """Simple handler to make dbus do stuff async.""" | ||
1618 | 61 | pass | ||
1619 | 62 | |||
1620 | 63 | |||
1621 | 64 | class AppletConfigDialog(gtk.Dialog): | ||
1622 | 65 | """Preferences dialog.""" | ||
1623 | 66 | |||
1624 | 67 | def __init__(self, config=None, *args, **kw): | ||
1625 | 68 | """Initializes our config dialog.""" | ||
1626 | 69 | super(AppletConfigDialog, self).__init__(*args, **kw) | ||
1627 | 70 | self.set_title(_("Ubuntu One Preferences")) | ||
1628 | 71 | self.set_has_separator(False) | ||
1629 | 72 | self.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) | ||
1630 | 73 | self.set_default_response(gtk.RESPONSE_CLOSE) | ||
1631 | 74 | self.set_icon_name("ubuntuone-client") | ||
1632 | 75 | |||
1633 | 76 | self.connect("close", self.__handle_response, gtk.RESPONSE_CLOSE) | ||
1634 | 77 | self.connect("response", self.__handle_response) | ||
1635 | 78 | |||
1636 | 79 | self.config = config | ||
1637 | 80 | |||
1638 | 81 | self.bw_enabled = False | ||
1639 | 82 | self.up_limit = 2097152 | ||
1640 | 83 | self.dn_limit = 2097152 | ||
1641 | 84 | |||
1642 | 85 | self.__bus = dbus.SessionBus() | ||
1643 | 86 | |||
1644 | 87 | try: | ||
1645 | 88 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/config", | ||
1646 | 89 | follow_name_owner_changes=True) | ||
1647 | 90 | iface = dbus.Interface(client, DBUS_IFACE_CONFIG_NAME) | ||
1648 | 91 | iface.get_throttling_limits( | ||
1649 | 92 | reply_handler=self.__got_limits, | ||
1650 | 93 | error_handler=self.__dbus_error) | ||
1651 | 94 | iface.bandwidth_throttling_enabled( | ||
1652 | 95 | reply_handler=self.__got_enabled, | ||
1653 | 96 | error_handler=self.__dbus_error) | ||
1654 | 97 | except DBusException, e: | ||
1655 | 98 | self.__dbus_error(e) | ||
1656 | 99 | |||
1657 | 100 | # Timeout ID to avoid spamming DBus from spinbutton changes | ||
1658 | 101 | self.__update_id = 0 | ||
1659 | 102 | |||
1660 | 103 | self.load_config() | ||
1661 | 104 | |||
1662 | 105 | self.__construct() | ||
1663 | 106 | |||
1664 | 107 | def load_config(self): | ||
1665 | 108 | """Load the configuration, and initilize if empty.""" | ||
1666 | 109 | if not os.path.isdir(os.path.dirname(CONF_FILE)): | ||
1667 | 110 | os.makedirs(os.path.dirname(CONF_FILE)) | ||
1668 | 111 | |||
1669 | 112 | self.config = ConfigParser() | ||
1670 | 113 | self.config.read(CONF_FILE) | ||
1671 | 114 | |||
1672 | 115 | if not self.config.has_section("ubuntuone"): | ||
1673 | 116 | self.config.add_section("ubuntuone") | ||
1674 | 117 | |||
1675 | 118 | if not self.config.has_option("ubuntuone", "show_applet"): | ||
1676 | 119 | self.config.set("ubuntuone", "show_applet", "1") | ||
1677 | 120 | |||
1678 | 121 | if not self.config.has_option("ubuntuone", "connect"): | ||
1679 | 122 | self.config.set("ubuntuone", "connect", "0") | ||
1680 | 123 | |||
1681 | 124 | if not self.config.has_option("ubuntuone", "connected"): | ||
1682 | 125 | self.config.set("ubuntuone", "connected", "False") | ||
1683 | 126 | |||
1684 | 127 | if not os.path.exists(CONF_FILE): | ||
1685 | 128 | self.save_config() | ||
1686 | 129 | |||
1687 | 130 | def save_config(self): | ||
1688 | 131 | """Write the configuration back to a file.""" | ||
1689 | 132 | with open(CONF_FILE, "w+b") as f: | ||
1690 | 133 | self.config.write(f) | ||
1691 | 134 | |||
1692 | 135 | def quit(self): | ||
1693 | 136 | """Exit the main loop.""" | ||
1694 | 137 | gtk.main_quit() | ||
1695 | 138 | |||
1696 | 139 | def __dbus_error(self, error): | ||
1697 | 140 | """Error getting throttling config.""" | ||
1698 | 141 | print repr(error) | ||
1699 | 142 | |||
1700 | 143 | def __got_limits(self, limits): | ||
1701 | 144 | """Got the throttling limits.""" | ||
1702 | 145 | self.up_limit = int(limits['upload']) | ||
1703 | 146 | self.dn_limit = int(limits['download']) | ||
1704 | 147 | self.up_spin.set_value(self.up_limit / 1024) | ||
1705 | 148 | self.dn_spin.set_value(self.dn_limit / 1024) | ||
1706 | 149 | |||
1707 | 150 | def __got_enabled(self, enabled): | ||
1708 | 151 | """Got the throttling enabled config.""" | ||
1709 | 152 | self.bw_enabled = bool(enabled) | ||
1710 | 153 | self.limit_check.set_active(self.bw_enabled) | ||
1711 | 154 | |||
1712 | 155 | def __update_bw_settings(self): | ||
1713 | 156 | """Update the bandwidth throttling config in syncdaemon.""" | ||
1714 | 157 | self.bw_enabled = self.limit_check.get_active() | ||
1715 | 158 | self.up_limit = self.up_spin.get_value_as_int() * 1024 | ||
1716 | 159 | self.dn_limit = self.dn_spin.get_value_as_int() * 1024 | ||
1717 | 160 | |||
1718 | 161 | try: | ||
1719 | 162 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/config", | ||
1720 | 163 | follow_name_owner_changes=True) | ||
1721 | 164 | iface = dbus.Interface(client, DBUS_IFACE_CONFIG_NAME) | ||
1722 | 165 | iface.set_throttling_limits(self.dn_limit, self.up_limit, | ||
1723 | 166 | reply_handler=dbus_async, | ||
1724 | 167 | error_handler=self.__dbus_error) | ||
1725 | 168 | if self.bw_enabled: | ||
1726 | 169 | iface.enable_bandwidth_throttling( | ||
1727 | 170 | reply_handler=dbus_async, | ||
1728 | 171 | error_handler=self.__dbus_error) | ||
1729 | 172 | else: | ||
1730 | 173 | iface.disable_bandwidth_throttling( | ||
1731 | 174 | reply_handler=dbus_async, | ||
1732 | 175 | error_handler=self.__dbus_error) | ||
1733 | 176 | except DBusException, e: | ||
1734 | 177 | self.__dbus_error(e) | ||
1735 | 178 | |||
1736 | 179 | def __handle_response(self, dialog, response): | ||
1737 | 180 | """Handle the dialog's response.""" | ||
1738 | 181 | self.hide() | ||
1739 | 182 | self.config.set("ubuntuone", "show_applet", | ||
1740 | 183 | self.show_menu.get_active()) | ||
1741 | 184 | self.config.set("ubuntuone", "connect", | ||
1742 | 185 | self.conn_menu.get_active()) | ||
1743 | 186 | |||
1744 | 187 | self.__update_bw_settings() | ||
1745 | 188 | self.save_config() | ||
1746 | 189 | gtk.main_quit() | ||
1747 | 190 | |||
1748 | 191 | def __show_menu_changed(self, menu, data=None): | ||
1749 | 192 | """Update the config for showing the applet.""" | ||
1750 | 193 | value = menu.get_active() | ||
1751 | 194 | self.config.set("ubuntuone", "show_applet", str(value)) | ||
1752 | 195 | try: | ||
1753 | 196 | client = self.__bus.get_object(APPLET_IFACE_NAME, "/config", | ||
1754 | 197 | follow_name_owner_changes=True) | ||
1755 | 198 | iface = dbus.Interface(client, APPLET_IFACE_CONFIG_NAME) | ||
1756 | 199 | iface.set_visibility_config(value, reply_handler=dbus_async, | ||
1757 | 200 | error_handler=self.__dbus_error) | ||
1758 | 201 | except DBusException, e: | ||
1759 | 202 | self.__dbus_error(e) | ||
1760 | 203 | |||
1761 | 204 | def __conn_menu_changed(self, menu, data=None): | ||
1762 | 205 | """Update the config for showing the applet.""" | ||
1763 | 206 | value = menu.get_active() | ||
1764 | 207 | self.config.set("ubuntuone", "connect", str(value)) | ||
1765 | 208 | try: | ||
1766 | 209 | client = self.__bus.get_object(APPLET_IFACE_NAME, "/config", | ||
1767 | 210 | follow_name_owner_changes=True) | ||
1768 | 211 | iface = dbus.Interface(client, APPLET_IFACE_CONFIG_NAME) | ||
1769 | 212 | iface.set_connection_config(value, reply_handler=dbus_async, | ||
1770 | 213 | error_handler=self.__dbus_error) | ||
1771 | 214 | except DBusException, e: | ||
1772 | 215 | self.__dbus_error(e) | ||
1773 | 216 | |||
1774 | 217 | def __bw_limit_toggled(self, button, data=None): | ||
1775 | 218 | """Toggle the bw limit panel.""" | ||
1776 | 219 | self.bw_enabled = self.limit_check.get_active() | ||
1777 | 220 | self.bw_table.set_sensitive(self.bw_enabled) | ||
1778 | 221 | try: | ||
1779 | 222 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/config", | ||
1780 | 223 | follow_name_owner_changes=True) | ||
1781 | 224 | iface = dbus.Interface(client, DBUS_IFACE_CONFIG_NAME) | ||
1782 | 225 | iface.set_throttling_limits(self.dn_limit, self.up_limit, | ||
1783 | 226 | reply_handler=dbus_async, | ||
1784 | 227 | error_handler=self.__dbus_error) | ||
1785 | 228 | if self.bw_enabled: | ||
1786 | 229 | iface.enable_bandwidth_throttling( | ||
1787 | 230 | reply_handler=dbus_async, | ||
1788 | 231 | error_handler=self.__dbus_error) | ||
1789 | 232 | else: | ||
1790 | 233 | iface.disable_bandwidth_throttling( | ||
1791 | 234 | reply_handler=dbus_async, | ||
1792 | 235 | error_handler=self.__dbus_error) | ||
1793 | 236 | except DBusException, e: | ||
1794 | 237 | self.__dbus_error(e) | ||
1795 | 238 | |||
1796 | 239 | def __spinner_changed(self, button, data=None): | ||
1797 | 240 | """Remove timeout and add anew.""" | ||
1798 | 241 | if self.__update_id != 0: | ||
1799 | 242 | gobject.source_remove(self.__update_id) | ||
1800 | 243 | |||
1801 | 244 | self.__update_id = gobject.timeout_add_seconds( | ||
1802 | 245 | 1, self.__update_bw_settings) | ||
1803 | 246 | |||
1804 | 247 | def __construct(self): | ||
1805 | 248 | """Construct the dialog's layout.""" | ||
1806 | 249 | area = self.get_content_area() | ||
1807 | 250 | |||
1808 | 251 | vbox = gtk.VBox(spacing=12) | ||
1809 | 252 | vbox.set_border_width(12) | ||
1810 | 253 | area.add(vbox) | ||
1811 | 254 | vbox.show() | ||
1812 | 255 | |||
1813 | 256 | # Put the first set of options in a table. | ||
1814 | 257 | table = gtk.Table(rows=2, columns=2) | ||
1815 | 258 | table.set_row_spacings(12) | ||
1816 | 259 | table.set_col_spacings(6) | ||
1817 | 260 | vbox.add(table) | ||
1818 | 261 | table.show() | ||
1819 | 262 | |||
1820 | 263 | label = gtk.Label(_("_Show icon:")) | ||
1821 | 264 | label.set_use_underline(True) | ||
1822 | 265 | label.set_alignment(0, 0.5) | ||
1823 | 266 | table.attach(label, 0, 1, 0, 1) | ||
1824 | 267 | label.show() | ||
1825 | 268 | |||
1826 | 269 | self.show_menu = gtk.combo_box_new_text() | ||
1827 | 270 | self.show_menu.connect("changed", self.__show_menu_changed) | ||
1828 | 271 | label.set_mnemonic_widget(self.show_menu) | ||
1829 | 272 | self.show_menu.append_text(_("Always")) | ||
1830 | 273 | self.show_menu.append_text(_("When updating")) | ||
1831 | 274 | self.show_menu.append_text(_("Never")) | ||
1832 | 275 | self.show_menu.set_active(self.config.getint("ubuntuone", | ||
1833 | 276 | "show_applet")) | ||
1834 | 277 | table.attach(self.show_menu, 1, 2, 0, 1) | ||
1835 | 278 | self.show_menu.show() | ||
1836 | 279 | |||
1837 | 280 | label = gtk.Label(_("Connect on start:")) | ||
1838 | 281 | label.set_use_underline(True) | ||
1839 | 282 | label.set_alignment(0, 0.5) | ||
1840 | 283 | table.attach(label, 0, 1, 1, 2) | ||
1841 | 284 | label.show() | ||
1842 | 285 | |||
1843 | 286 | self.conn_menu = gtk.combo_box_new_text() | ||
1844 | 287 | self.conn_menu.connect("changed", self.__conn_menu_changed) | ||
1845 | 288 | label.set_mnemonic_widget(self.conn_menu) | ||
1846 | 289 | self.conn_menu.append_text(_("Automatically")) | ||
1847 | 290 | self.conn_menu.append_text(_("Remember last")) | ||
1848 | 291 | self.conn_menu.append_text(_("Never")) | ||
1849 | 292 | self.conn_menu.set_active(self.config.getint("ubuntuone", | ||
1850 | 293 | "connect")) | ||
1851 | 294 | table.attach(self.conn_menu, 1, 2, 1, 2) | ||
1852 | 295 | self.conn_menu.show() | ||
1853 | 296 | |||
1854 | 297 | # Bandwidth limiting | ||
1855 | 298 | self.limit_check = gtk.CheckButton(_("_Limit Bandwidth Usage")) | ||
1856 | 299 | self.limit_check.connect("toggled", self.__bw_limit_toggled) | ||
1857 | 300 | vbox.add(self.limit_check) | ||
1858 | 301 | self.limit_check.show() | ||
1859 | 302 | |||
1860 | 303 | hbox = gtk.HBox(spacing=12) | ||
1861 | 304 | vbox.add(hbox) | ||
1862 | 305 | hbox.show() | ||
1863 | 306 | |||
1864 | 307 | label = gtk.Label() | ||
1865 | 308 | hbox.add(label) | ||
1866 | 309 | label.show() | ||
1867 | 310 | |||
1868 | 311 | # Now put the bw limit bits in a table too | ||
1869 | 312 | self.bw_table = gtk.Table(rows=2, columns=2) | ||
1870 | 313 | self.bw_table.set_row_spacings(6) | ||
1871 | 314 | self.bw_table.set_col_spacings(6) | ||
1872 | 315 | self.bw_table.set_sensitive(False) | ||
1873 | 316 | hbox.add(self.bw_table) | ||
1874 | 317 | self.bw_table.show() | ||
1875 | 318 | |||
1876 | 319 | # Upload speed | ||
1877 | 320 | label = gtk.Label(_("Maximum _upload speed (KB/s):")) | ||
1878 | 321 | label.set_use_underline(True) | ||
1879 | 322 | label.set_alignment(0, 0.5) | ||
1880 | 323 | self.bw_table.attach(label, 0, 1, 0, 1) | ||
1881 | 324 | label.show() | ||
1882 | 325 | |||
1883 | 326 | adjustment = gtk.Adjustment(value=2048.0, lower=0.0, upper=4096.0, | ||
1884 | 327 | step_incr=64.0, page_incr=128.0) | ||
1885 | 328 | self.up_spin = gtk.SpinButton(adjustment) | ||
1886 | 329 | self.up_spin.connect("value-changed", self.__spinner_changed) | ||
1887 | 330 | label.set_mnemonic_widget(self.up_spin) | ||
1888 | 331 | self.bw_table.attach(self.up_spin, 1, 2, 0, 1) | ||
1889 | 332 | self.up_spin.show() | ||
1890 | 333 | |||
1891 | 334 | # Download speed | ||
1892 | 335 | label = gtk.Label(_("Maximum _download speed (KB/s):")) | ||
1893 | 336 | label.set_use_underline(True) | ||
1894 | 337 | label.set_alignment(0, 0.5) | ||
1895 | 338 | self.bw_table.attach(label, 0, 1, 1, 2) | ||
1896 | 339 | label.show() | ||
1897 | 340 | adjustment = gtk.Adjustment(value=2048.0, lower=0.0, upper=4096.0, | ||
1898 | 341 | step_incr=64.0, page_incr=128.0) | ||
1899 | 342 | self.dn_spin = gtk.SpinButton(adjustment) | ||
1900 | 343 | self.dn_spin.connect("value-changed", self.__spinner_changed) | ||
1901 | 344 | label.set_mnemonic_widget(self.dn_spin) | ||
1902 | 345 | self.bw_table.attach(self.dn_spin, 1, 2, 1, 2) | ||
1903 | 346 | self.dn_spin.show() | ||
1904 | 347 | |||
1905 | 348 | |||
1906 | 349 | if __name__ == "__main__": | ||
1907 | 350 | gettext.bindtextdomain(clientdefs.GETTEXT_PACKAGE, clientdefs.LOCALEDIR) | ||
1908 | 351 | gettext.textdomain(clientdefs.GETTEXT_PACKAGE) | ||
1909 | 352 | |||
1910 | 353 | gtk.rc_parse_string(RCSTYLE) | ||
1911 | 354 | |||
1912 | 355 | try: | ||
1913 | 356 | dialog = AppletConfigDialog() | ||
1914 | 357 | dialog.show() | ||
1915 | 358 | gtk.main() | ||
1916 | 359 | except KeyboardInterrupt: | ||
1917 | 360 | pass | ||
1918 | 361 | 0 | ||
1919 | === added file 'bin/ubuntuone-login' | |||
1920 | --- bin/ubuntuone-login 1970-01-01 00:00:00 +0000 | |||
1921 | +++ bin/ubuntuone-login 2010-02-18 00:10:25 +0000 | |||
1922 | @@ -0,0 +1,226 @@ | |||
1923 | 1 | #!/usr/bin/python | ||
1924 | 2 | |||
1925 | 3 | # ubuntuone-login - Client side log-in utility for Ubuntu One | ||
1926 | 4 | # | ||
1927 | 5 | # Author: Rodney Dawes <rodney.dawes@canonical.com> | ||
1928 | 6 | # | ||
1929 | 7 | # Copyright 2009 Canonical Ltd. | ||
1930 | 8 | # | ||
1931 | 9 | # This program is free software: you can redistribute it and/or modify it | ||
1932 | 10 | # under the terms of the GNU General Public License version 3, as published | ||
1933 | 11 | # by the Free Software Foundation. | ||
1934 | 12 | # | ||
1935 | 13 | # This program is distributed in the hope that it will be useful, but | ||
1936 | 14 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
1937 | 15 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
1938 | 16 | # PURPOSE. See the GNU General Public License for more details. | ||
1939 | 17 | # | ||
1940 | 18 | # You should have received a copy of the GNU General Public License along | ||
1941 | 19 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1942 | 20 | |||
1943 | 21 | import pygtk | ||
1944 | 22 | pygtk.require('2.0') | ||
1945 | 23 | import gtk | ||
1946 | 24 | import pango | ||
1947 | 25 | import sys | ||
1948 | 26 | import gettext | ||
1949 | 27 | from ubuntuone import clientdefs | ||
1950 | 28 | |||
1951 | 29 | import dbus.service | ||
1952 | 30 | |||
1953 | 31 | from dbus.mainloop.glib import DBusGMainLoop | ||
1954 | 32 | from ubuntuone.oauthdesktop.main import Login | ||
1955 | 33 | |||
1956 | 34 | from ubuntuone.oauthdesktop.logger import setupLogging | ||
1957 | 35 | logger = setupLogging("ubuntuone-login") | ||
1958 | 36 | |||
1959 | 37 | DBusGMainLoop(set_as_default=True) | ||
1960 | 38 | |||
1961 | 39 | _ = gettext.gettext | ||
1962 | 40 | ngettext = gettext.ngettext | ||
1963 | 41 | |||
1964 | 42 | DBUS_IFACE_AUTH_NAME = "com.ubuntuone.Authentication" | ||
1965 | 43 | |||
1966 | 44 | OAUTH_REALM = "https://ubuntuone.com" | ||
1967 | 45 | OAUTH_CONSUMER = "ubuntuone" | ||
1968 | 46 | |||
1969 | 47 | NOTIFY_ICON_SIZE = 48 | ||
1970 | 48 | |||
1971 | 49 | # Why thank you GTK+ for enforcing style-set and breaking API | ||
1972 | 50 | RCSTYLE = """ | ||
1973 | 51 | style 'dialogs' { | ||
1974 | 52 | GtkDialog::action-area-border = 12 | ||
1975 | 53 | GtkDialog::button-spacing = 6 | ||
1976 | 54 | GtkDialog::content-area-border = 0 | ||
1977 | 55 | } | ||
1978 | 56 | widget_class '*Dialog*' style 'dialogs' | ||
1979 | 57 | """ | ||
1980 | 58 | |||
1981 | 59 | |||
1982 | 60 | class LoginMain(object): | ||
1983 | 61 | """Main login manager process class.""" | ||
1984 | 62 | |||
1985 | 63 | def __init__(self, *args, **kw): | ||
1986 | 64 | """Initializes the child threads and dbus monitor.""" | ||
1987 | 65 | gtk.rc_parse_string(RCSTYLE) | ||
1988 | 66 | |||
1989 | 67 | logger.info(_("Starting Ubuntu One login manager version %s") % | ||
1990 | 68 | clientdefs.VERSION) | ||
1991 | 69 | |||
1992 | 70 | self.__bus = dbus.SessionBus() | ||
1993 | 71 | |||
1994 | 72 | def _connect_dbus_signals(self): | ||
1995 | 73 | """Set up some signal handlers for DBus signals.""" | ||
1996 | 74 | self.__bus.add_signal_receiver( | ||
1997 | 75 | handler_function=self.new_credentials, | ||
1998 | 76 | signal_name="NewCredentials", | ||
1999 | 77 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
2000 | 78 | self.__bus.add_signal_receiver( | ||
2001 | 79 | handler_function=self.auth_denied, | ||
2002 | 80 | signal_name="AuthorizationDenied", | ||
2003 | 81 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
2004 | 82 | self.__bus.add_signal_receiver( | ||
2005 | 83 | handler_function=self.got_oauth_error, | ||
2006 | 84 | signal_name="OAuthError", | ||
2007 | 85 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
2008 | 86 | |||
2009 | 87 | |||
2010 | 88 | def new_credentials(self, realm=None, consumer_key=None, sender=None): | ||
2011 | 89 | """Signal callback for when we get new credentials.""" | ||
2012 | 90 | self.set_up_desktopcouch_pairing(consumer_key) | ||
2013 | 91 | |||
2014 | 92 | def auth_denied(self): | ||
2015 | 93 | """Signal callback for when auth was denied by user.""" | ||
2016 | 94 | logger.info(_("Access to Ubuntu One was denied.")) | ||
2017 | 95 | |||
2018 | 96 | from twisted.internet import reactor | ||
2019 | 97 | reactor.stop() | ||
2020 | 98 | |||
2021 | 99 | def got_oauth_error(self, message=None): | ||
2022 | 100 | """Signal callback for when an OAuth error occured.""" | ||
2023 | 101 | def dialog_response(dialog, response): | ||
2024 | 102 | """Handle the dialog closing.""" | ||
2025 | 103 | dialog.destroy() | ||
2026 | 104 | |||
2027 | 105 | if message: | ||
2028 | 106 | logger.error(message) | ||
2029 | 107 | dialog = gtk.Dialog(title=_("Ubuntu One: Error"), | ||
2030 | 108 | flags=gtk.DIALOG_NO_SEPARATOR, | ||
2031 | 109 | buttons=(gtk.STOCK_CLOSE, | ||
2032 | 110 | gtk.RESPONSE_CLOSE)) | ||
2033 | 111 | dialog.set_default_response(gtk.RESPONSE_CLOSE) | ||
2034 | 112 | dialog.set_icon_name("ubuntuone-client") | ||
2035 | 113 | |||
2036 | 114 | area = dialog.get_content_area() | ||
2037 | 115 | |||
2038 | 116 | hbox = gtk.HBox(spacing=12) | ||
2039 | 117 | hbox.set_border_width(12) | ||
2040 | 118 | area.pack_start(hbox) | ||
2041 | 119 | hbox.show() | ||
2042 | 120 | |||
2043 | 121 | image = gtk.Image() | ||
2044 | 122 | image.set_from_icon_name("dialog-error", gtk.ICON_SIZE_DIALOG) | ||
2045 | 123 | image.set_alignment(0.5, 0.0) | ||
2046 | 124 | image.show() | ||
2047 | 125 | hbox.pack_start(image, False, False) | ||
2048 | 126 | |||
2049 | 127 | vbox = gtk.VBox(spacing=12) | ||
2050 | 128 | vbox.show() | ||
2051 | 129 | hbox.pack_start(vbox) | ||
2052 | 130 | |||
2053 | 131 | label = gtk.Label("<b>%s</b>" % _("Authorization Error")) | ||
2054 | 132 | label.set_use_markup(True) | ||
2055 | 133 | label.set_alignment(0.0, 0.5) | ||
2056 | 134 | label.show() | ||
2057 | 135 | vbox.pack_start(label, False, False) | ||
2058 | 136 | |||
2059 | 137 | label = gtk.Label(message) | ||
2060 | 138 | label.set_line_wrap(True) | ||
2061 | 139 | label.set_max_width_chars(64) | ||
2062 | 140 | label.set_ellipsize(pango.ELLIPSIZE_MIDDLE) | ||
2063 | 141 | label.set_alignment(0.0, 0.0) | ||
2064 | 142 | label.show() | ||
2065 | 143 | vbox.pack_start(label, True, True) | ||
2066 | 144 | |||
2067 | 145 | dialog.connect('close', dialog_response, gtk.RESPONSE_CLOSE) | ||
2068 | 146 | dialog.connect('response', dialog_response) | ||
2069 | 147 | |||
2070 | 148 | dialog.show() | ||
2071 | 149 | else: | ||
2072 | 150 | logger.error(_("Got an OAuth error with no message.")) | ||
2073 | 151 | |||
2074 | 152 | def set_up_desktopcouch_pairing(self, consumer_key): | ||
2075 | 153 | """Add a pairing record between desktopcouch and Ubuntu One""" | ||
2076 | 154 | try: | ||
2077 | 155 | from desktopcouch.pair.couchdb_pairing.couchdb_io import \ | ||
2078 | 156 | put_static_paired_service | ||
2079 | 157 | from desktopcouch.records.server import CouchDatabase | ||
2080 | 158 | except ImportError: | ||
2081 | 159 | # desktopcouch is not installed | ||
2082 | 160 | logger.debug(_("Not adding desktopcouch pairing since" | ||
2083 | 161 | " desktopcouch is not installed")) | ||
2084 | 162 | return | ||
2085 | 163 | # Check whether there is already a record of the Ubuntu One service | ||
2086 | 164 | db = CouchDatabase("management", create=True) | ||
2087 | 165 | if not db.view_exists("ubuntu_one_pair_record","ubuntu_one_pair_record"): | ||
2088 | 166 | map_js = """function(doc) { | ||
2089 | 167 | if (doc.service_name == "ubuntuone") { | ||
2090 | 168 | if (doc.application_annotations && | ||
2091 | 169 | doc.application_annotations["Ubuntu One"] && | ||
2092 | 170 | doc.application_annotations["Ubuntu One"]["private_application_annotations"] && | ||
2093 | 171 | doc.application_annotations["Ubuntu One"]["private_application_annotations"]["deleted"]) { | ||
2094 | 172 | emit(doc._id, 1); | ||
2095 | 173 | } else { | ||
2096 | 174 | emit(doc._id, 0) | ||
2097 | 175 | } | ||
2098 | 176 | } | ||
2099 | 177 | }""" | ||
2100 | 178 | db.add_view("ubuntu_one_pair_record", map_js, None, | ||
2101 | 179 | "ubuntu_one_pair_record") | ||
2102 | 180 | results = db.execute_view("ubuntu_one_pair_record", | ||
2103 | 181 | "ubuntu_one_pair_record") | ||
2104 | 182 | found = False | ||
2105 | 183 | # Results should contain either one row or no rows | ||
2106 | 184 | # If there is one row, its value will be 0, meaning that there is | ||
2107 | 185 | # already an Ubuntu One pairing record, or 1, meaning that there | ||
2108 | 186 | # was an Ubuntu One pairing record but it has since been unpaired | ||
2109 | 187 | # Only create a new record if there is not one already. Specifically, | ||
2110 | 188 | # do not add the record if there is a deleted one, as this means | ||
2111 | 189 | # that the user explicitly unpaired it! | ||
2112 | 190 | for row in results: | ||
2113 | 191 | found = True | ||
2114 | 192 | if row.value == 1: | ||
2115 | 193 | logger.debug(_("Not adding desktopcouch pairing since" | ||
2116 | 194 | " the user has explicitly unpaired with Ubuntu One")) | ||
2117 | 195 | else: | ||
2118 | 196 | logger.debug(_("Not adding desktopcouch pairing since" | ||
2119 | 197 | " we are already paired")) | ||
2120 | 198 | if not found: | ||
2121 | 199 | put_static_paired_service(None, "ubuntuone") | ||
2122 | 200 | logger.debug(_("Pairing desktopcouch with Ubuntu One")) | ||
2123 | 201 | |||
2124 | 202 | def main(self): | ||
2125 | 203 | """Starts the gtk main loop.""" | ||
2126 | 204 | self._connect_dbus_signals() | ||
2127 | 205 | |||
2128 | 206 | from twisted.internet import reactor | ||
2129 | 207 | reactor.run() | ||
2130 | 208 | |||
2131 | 209 | |||
2132 | 210 | if __name__ == "__main__": | ||
2133 | 211 | gettext.bindtextdomain(clientdefs.GETTEXT_PACKAGE, clientdefs.LOCALEDIR) | ||
2134 | 212 | gettext.textdomain(clientdefs.GETTEXT_PACKAGE) | ||
2135 | 213 | |||
2136 | 214 | # Register DBus service for making sure we run only one instance | ||
2137 | 215 | bus = dbus.SessionBus() | ||
2138 | 216 | if bus.request_name(DBUS_IFACE_AUTH_NAME, dbus.bus.NAME_FLAG_DO_NOT_QUEUE) == dbus.bus.REQUEST_NAME_REPLY_EXISTS: | ||
2139 | 217 | print _("Ubuntu One login manager already running, quitting") | ||
2140 | 218 | sys.exit(0) | ||
2141 | 219 | |||
2142 | 220 | from twisted.internet import gtk2reactor | ||
2143 | 221 | gtk2reactor.install() | ||
2144 | 222 | |||
2145 | 223 | login = Login(dbus.service.BusName(DBUS_IFACE_AUTH_NAME, | ||
2146 | 224 | bus=dbus.SessionBus())) | ||
2147 | 225 | manager = LoginMain() | ||
2148 | 226 | manager.main() | ||
2149 | 0 | 227 | ||
2150 | === added file 'bin/ubuntuone-preferences' | |||
2151 | --- bin/ubuntuone-preferences 1970-01-01 00:00:00 +0000 | |||
2152 | +++ bin/ubuntuone-preferences 2010-02-18 00:10:25 +0000 | |||
2153 | @@ -0,0 +1,549 @@ | |||
2154 | 1 | #!/usr/bin/python | ||
2155 | 2 | |||
2156 | 3 | # ubuntuone-client-applet - Tray icon applet for managing Ubuntu One | ||
2157 | 4 | # | ||
2158 | 5 | # Author: Rodney Dawes <rodney.dawes@canonical.com> | ||
2159 | 6 | # | ||
2160 | 7 | # Copyright 2009 Canonical Ltd. | ||
2161 | 8 | # | ||
2162 | 9 | # This program is free software: you can redistribute it and/or modify it | ||
2163 | 10 | # under the terms of the GNU General Public License version 3, as published | ||
2164 | 11 | # by the Free Software Foundation. | ||
2165 | 12 | # | ||
2166 | 13 | # This program is distributed in the hope that it will be useful, but | ||
2167 | 14 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
2168 | 15 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
2169 | 16 | # PURPOSE. See the GNU General Public License for more details. | ||
2170 | 17 | # | ||
2171 | 18 | # You should have received a copy of the GNU General Public License along | ||
2172 | 19 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2173 | 20 | |||
2174 | 21 | from __future__ import division | ||
2175 | 22 | |||
2176 | 23 | import pygtk | ||
2177 | 24 | pygtk.require('2.0') | ||
2178 | 25 | import gobject | ||
2179 | 26 | import gtk | ||
2180 | 27 | import os | ||
2181 | 28 | import gettext | ||
2182 | 29 | import gnomekeyring | ||
2183 | 30 | import httplib2 | ||
2184 | 31 | import simplejson | ||
2185 | 32 | from oauth import oauth | ||
2186 | 33 | from ubuntuone import clientdefs | ||
2187 | 34 | |||
2188 | 35 | import dbus.service | ||
2189 | 36 | from ConfigParser import ConfigParser | ||
2190 | 37 | from dbus.exceptions import DBusException | ||
2191 | 38 | from dbus.mainloop.glib import DBusGMainLoop | ||
2192 | 39 | from xdg.BaseDirectory import xdg_config_home | ||
2193 | 40 | |||
2194 | 41 | DBusGMainLoop(set_as_default=True) | ||
2195 | 42 | |||
2196 | 43 | _ = gettext.gettext | ||
2197 | 44 | |||
2198 | 45 | DBUS_IFACE_NAME = "com.ubuntuone.SyncDaemon" | ||
2199 | 46 | DBUS_IFACE_CONFIG_NAME = DBUS_IFACE_NAME + ".Config" | ||
2200 | 47 | |||
2201 | 48 | DBUS_IFACE_AUTH_NAME = "com.ubuntuone.Authentication" | ||
2202 | 49 | DBUS_IFACE_AUTH_PATH = "/" | ||
2203 | 50 | |||
2204 | 51 | # Why thank you GTK+ for enforcing style-set and breaking API | ||
2205 | 52 | RCSTYLE = """ | ||
2206 | 53 | style 'dialogs' { | ||
2207 | 54 | GtkDialog::action-area-border = 12 | ||
2208 | 55 | GtkDialog::button-spacing = 6 | ||
2209 | 56 | GtkDialog::content-area-border = 0 | ||
2210 | 57 | } | ||
2211 | 58 | widget_class '*Dialog*' style 'dialogs' | ||
2212 | 59 | """ | ||
2213 | 60 | |||
2214 | 61 | def dbus_async(*args): | ||
2215 | 62 | """Simple handler to make dbus do stuff async.""" | ||
2216 | 63 | pass | ||
2217 | 64 | |||
2218 | 65 | |||
2219 | 66 | class UbuntuOneDialog(gtk.Dialog): | ||
2220 | 67 | """Preferences dialog.""" | ||
2221 | 68 | |||
2222 | 69 | def __init__(self, config=None, *args, **kw): | ||
2223 | 70 | """Initializes our config dialog.""" | ||
2224 | 71 | super(UbuntuOneDialog, self).__init__(*args, **kw) | ||
2225 | 72 | self.set_title(_("Ubuntu One Preferences")) | ||
2226 | 73 | self.set_has_separator(False) | ||
2227 | 74 | self.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) | ||
2228 | 75 | self.set_default_response(gtk.RESPONSE_CLOSE) | ||
2229 | 76 | self.set_icon_name("ubuntuone") | ||
2230 | 77 | |||
2231 | 78 | self.connect("close", self.__handle_response, gtk.RESPONSE_CLOSE) | ||
2232 | 79 | self.connect("response", self.__handle_response) | ||
2233 | 80 | |||
2234 | 81 | self.bw_enabled = False | ||
2235 | 82 | self.up_limit = 2097152 | ||
2236 | 83 | self.dn_limit = 2097152 | ||
2237 | 84 | |||
2238 | 85 | self.__bus = dbus.SessionBus() | ||
2239 | 86 | self.keyring = gnomekeyring | ||
2240 | 87 | |||
2241 | 88 | try: | ||
2242 | 89 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/config", | ||
2243 | 90 | follow_name_owner_changes=True) | ||
2244 | 91 | iface = dbus.Interface(client, DBUS_IFACE_CONFIG_NAME) | ||
2245 | 92 | iface.get_throttling_limits( | ||
2246 | 93 | reply_handler=self.__got_limits, | ||
2247 | 94 | error_handler=self.__dbus_error) | ||
2248 | 95 | iface.bandwidth_throttling_enabled( | ||
2249 | 96 | reply_handler=self.__got_enabled, | ||
2250 | 97 | error_handler=self.__dbus_error) | ||
2251 | 98 | except DBusException, e: | ||
2252 | 99 | self.__dbus_error(e) | ||
2253 | 100 | |||
2254 | 101 | # Timeout ID to avoid spamming DBus from spinbutton changes | ||
2255 | 102 | self.__update_id = 0 | ||
2256 | 103 | |||
2257 | 104 | self.__construct() | ||
2258 | 105 | |||
2259 | 106 | def quit(self): | ||
2260 | 107 | """Exit the main loop.""" | ||
2261 | 108 | gtk.main_quit() | ||
2262 | 109 | |||
2263 | 110 | def __dbus_error(self, error): | ||
2264 | 111 | """Error getting throttling config.""" | ||
2265 | 112 | print repr(error) | ||
2266 | 113 | |||
2267 | 114 | def __got_limits(self, limits): | ||
2268 | 115 | """Got the throttling limits.""" | ||
2269 | 116 | self.up_limit = int(limits['upload']) | ||
2270 | 117 | self.dn_limit = int(limits['download']) | ||
2271 | 118 | self.up_spin.set_value(self.up_limit / 1024) | ||
2272 | 119 | self.dn_spin.set_value(self.dn_limit / 1024) | ||
2273 | 120 | |||
2274 | 121 | def __got_enabled(self, enabled): | ||
2275 | 122 | """Got the throttling enabled config.""" | ||
2276 | 123 | self.bw_enabled = bool(enabled) | ||
2277 | 124 | self.limit_check.set_active(self.bw_enabled) | ||
2278 | 125 | |||
2279 | 126 | def __update_bw_settings(self): | ||
2280 | 127 | """Update the bandwidth throttling config in syncdaemon.""" | ||
2281 | 128 | self.bw_enabled = self.limit_check.get_active() | ||
2282 | 129 | self.up_limit = self.up_spin.get_value_as_int() * 1024 | ||
2283 | 130 | self.dn_limit = self.dn_spin.get_value_as_int() * 1024 | ||
2284 | 131 | |||
2285 | 132 | try: | ||
2286 | 133 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/config", | ||
2287 | 134 | follow_name_owner_changes=True) | ||
2288 | 135 | iface = dbus.Interface(client, DBUS_IFACE_CONFIG_NAME) | ||
2289 | 136 | iface.set_throttling_limits(self.dn_limit, self.up_limit, | ||
2290 | 137 | reply_handler=dbus_async, | ||
2291 | 138 | error_handler=self.__dbus_error) | ||
2292 | 139 | if self.bw_enabled: | ||
2293 | 140 | iface.enable_bandwidth_throttling( | ||
2294 | 141 | reply_handler=dbus_async, | ||
2295 | 142 | error_handler=self.__dbus_error) | ||
2296 | 143 | else: | ||
2297 | 144 | iface.disable_bandwidth_throttling( | ||
2298 | 145 | reply_handler=dbus_async, | ||
2299 | 146 | error_handler=self.__dbus_error) | ||
2300 | 147 | except DBusException, e: | ||
2301 | 148 | self.__dbus_error(e) | ||
2302 | 149 | |||
2303 | 150 | def __handle_response(self, dialog, response): | ||
2304 | 151 | """Handle the dialog's response.""" | ||
2305 | 152 | self.hide() | ||
2306 | 153 | self.__update_bw_settings() | ||
2307 | 154 | gtk.main_quit() | ||
2308 | 155 | |||
2309 | 156 | def __bw_limit_toggled(self, button, data=None): | ||
2310 | 157 | """Toggle the bw limit panel.""" | ||
2311 | 158 | self.bw_enabled = self.limit_check.get_active() | ||
2312 | 159 | self.bw_table.set_sensitive(self.bw_enabled) | ||
2313 | 160 | try: | ||
2314 | 161 | client = self.__bus.get_object(DBUS_IFACE_NAME, "/config", | ||
2315 | 162 | follow_name_owner_changes=True) | ||
2316 | 163 | iface = dbus.Interface(client, DBUS_IFACE_CONFIG_NAME) | ||
2317 | 164 | iface.set_throttling_limits(self.dn_limit, self.up_limit, | ||
2318 | 165 | reply_handler=dbus_async, | ||
2319 | 166 | error_handler=self.__dbus_error) | ||
2320 | 167 | if self.bw_enabled: | ||
2321 | 168 | iface.enable_bandwidth_throttling( | ||
2322 | 169 | reply_handler=dbus_async, | ||
2323 | 170 | error_handler=self.__dbus_error) | ||
2324 | 171 | else: | ||
2325 | 172 | iface.disable_bandwidth_throttling( | ||
2326 | 173 | reply_handler=dbus_async, | ||
2327 | 174 | error_handler=self.__dbus_error) | ||
2328 | 175 | except DBusException, e: | ||
2329 | 176 | self.__dbus_error(e) | ||
2330 | 177 | |||
2331 | 178 | def __spinner_changed(self, button, data=None): | ||
2332 | 179 | """Remove timeout and add anew.""" | ||
2333 | 180 | if self.__update_id != 0: | ||
2334 | 181 | gobject.source_remove(self.__update_id) | ||
2335 | 182 | |||
2336 | 183 | self.__update_id = gobject.timeout_add_seconds( | ||
2337 | 184 | 1, self.__update_bw_settings) | ||
2338 | 185 | |||
2339 | 186 | def _format_for_gb_display(self, bytes): | ||
2340 | 187 | """Format bytes into reasonable gb display.""" | ||
2341 | 188 | gb = bytes / 1024 / 1024 / 1024 | ||
2342 | 189 | if gb < 1.0: | ||
2343 | 190 | mb = bytes / 1024 / 1024 | ||
2344 | 191 | if mb < 1.0: | ||
2345 | 192 | return (bytes / 1024, 'KB') | ||
2346 | 193 | return (mb, 'MB') | ||
2347 | 194 | return (gb, 'GB') | ||
2348 | 195 | |||
2349 | 196 | def update_quota_display(self, used, total): | ||
2350 | 197 | """Update the quota display.""" | ||
2351 | 198 | percent = (float(used) / float(total)) * 100 | ||
2352 | 199 | real_used, real_type = self._format_for_gb_display(used) | ||
2353 | 200 | self.usage_label.set_text( | ||
2354 | 201 | _("%(used)0.1f %(type)s Used (%(percent)0.1f%%)") % { | ||
2355 | 202 | 'used' : real_used, | ||
2356 | 203 | 'type' : real_type, | ||
2357 | 204 | 'percent' : percent }) | ||
2358 | 205 | self.usage_graph.set_fraction(percent / 100) | ||
2359 | 206 | |||
2360 | 207 | def request_REST_info(self, url, method): | ||
2361 | 208 | """Make a REST request and return the resulting dict, or None.""" | ||
2362 | 209 | consumer = oauth.OAuthConsumer("ubuntuone", "hammertime") | ||
2363 | 210 | items = [] | ||
2364 | 211 | items = self.keyring.find_items_sync( | ||
2365 | 212 | gnomekeyring.ITEM_GENERIC_SECRET, | ||
2366 | 213 | {'ubuntuone-realm': "https://ubuntuone.com", | ||
2367 | 214 | 'oauth-consumer-key': consumer.key}) | ||
2368 | 215 | token = oauth.OAuthToken.from_string(items[0].secret) | ||
2369 | 216 | request = oauth.OAuthRequest.from_consumer_and_token( | ||
2370 | 217 | http_url=url, http_method=method, oauth_consumer=consumer, | ||
2371 | 218 | token=token) | ||
2372 | 219 | request.sign_request(oauth.OAuthSignatureMethod_HMAC_SHA1(), | ||
2373 | 220 | consumer, token) | ||
2374 | 221 | client = httplib2.Http() | ||
2375 | 222 | headers = {} | ||
2376 | 223 | headers.update(request.to_header()) | ||
2377 | 224 | resp, content = client.request(url, method, headers=headers) | ||
2378 | 225 | if resp['status'] == '200': | ||
2379 | 226 | return simplejson.loads(content) | ||
2380 | 227 | # FIXME: Log json parsing failures | ||
2381 | 228 | else: | ||
2382 | 229 | # FIXME: Log errors | ||
2383 | 230 | return None | ||
2384 | 231 | |||
2385 | 232 | def request_quota_info(self): | ||
2386 | 233 | """Request new quota info from server, and update display.""" | ||
2387 | 234 | quota = self.request_REST_info('https://one.ubuntu.com/api/quota/', | ||
2388 | 235 | 'GET') | ||
2389 | 236 | if quota: | ||
2390 | 237 | self.update_quota_display(quota['used'], quota['total']) | ||
2391 | 238 | |||
2392 | 239 | def request_account_info(self): | ||
2393 | 240 | """Request account info from server, and update display.""" | ||
2394 | 241 | user = self.request_REST_info('https://one.ubuntu.com/api/account/', | ||
2395 | 242 | 'GET') | ||
2396 | 243 | if user: | ||
2397 | 244 | self.name_label.set_text(user['nickname']) | ||
2398 | 245 | self.user_label.set_text(user['username']) | ||
2399 | 246 | self.mail_label.set_text(user['email']) | ||
2400 | 247 | |||
2401 | 248 | def toggle_db_sync(self, dbname, disable=False): | ||
2402 | 249 | """ | ||
2403 | 250 | Toggle whether a db in desktopcouch is synchronized to the | ||
2404 | 251 | Ubuntu One couchdb server. | ||
2405 | 252 | """ | ||
2406 | 253 | # FIXME: Actually enable/disable the dbs if desktopcouch exists | ||
2407 | 254 | |||
2408 | 255 | def __db_check_toggled(self, checkbutton): | ||
2409 | 256 | """Handle toggling a desktopcouch service toggling.""" | ||
2410 | 257 | dbname = checkbutton.get_data('dbname') | ||
2411 | 258 | self.toggle_db_sync(dbname, not checkbutton.get_active()) | ||
2412 | 259 | |||
2413 | 260 | def __files_check_toggled(self, checkbutton): | ||
2414 | 261 | """Handle toggling the files service.""" | ||
2415 | 262 | enable = checkbutton.get_active() | ||
2416 | 263 | if enable: | ||
2417 | 264 | self.music_check.set_sensitive(True) | ||
2418 | 265 | if self.music_check.get_active(): | ||
2419 | 266 | self.__music_check_toggled(self.music_check) | ||
2420 | 267 | else: | ||
2421 | 268 | self.music_check.set_sensitive(False) | ||
2422 | 269 | # FIXME: Actually stop or start ubuntuone-syncdaemon | ||
2423 | 270 | |||
2424 | 271 | def __music_check_toggled(self, checkbutton): | ||
2425 | 272 | """Handle toggling the music download service.""" | ||
2426 | 273 | if not self.files_check.get_active(): | ||
2427 | 274 | return | ||
2428 | 275 | # FIXME: Actually subscribe or unsubscribe to the UDF | ||
2429 | 276 | |||
2430 | 277 | def __construct(self): | ||
2431 | 278 | """Construct the dialog's layout.""" | ||
2432 | 279 | area = self.get_content_area() | ||
2433 | 280 | |||
2434 | 281 | vbox = gtk.VBox(spacing=12) | ||
2435 | 282 | vbox.set_border_width(12) | ||
2436 | 283 | area.add(vbox) | ||
2437 | 284 | vbox.show() | ||
2438 | 285 | |||
2439 | 286 | # Usage text/progress bar | ||
2440 | 287 | hbox = gtk.HBox(homogeneous=True) | ||
2441 | 288 | vbox.pack_start(hbox, False, False) | ||
2442 | 289 | hbox.show() | ||
2443 | 290 | |||
2444 | 291 | label = gtk.Label("") | ||
2445 | 292 | hbox.add(label) | ||
2446 | 293 | label.show() | ||
2447 | 294 | |||
2448 | 295 | rbox = gtk.VBox(spacing=2) | ||
2449 | 296 | hbox.pack_end(rbox) | ||
2450 | 297 | rbox.show() | ||
2451 | 298 | |||
2452 | 299 | self.usage_label = gtk.Label("") | ||
2453 | 300 | self.usage_label.set_alignment(0.5, 0.5) | ||
2454 | 301 | rbox.add(self.usage_label) | ||
2455 | 302 | self.usage_label.show() | ||
2456 | 303 | |||
2457 | 304 | self.usage_graph = gtk.ProgressBar() | ||
2458 | 305 | rbox.add(self.usage_graph) | ||
2459 | 306 | self.usage_graph.show() | ||
2460 | 307 | |||
2461 | 308 | self.update_quota_display(0, 2) | ||
2462 | 309 | |||
2463 | 310 | # Notebook | ||
2464 | 311 | self.notebook = gtk.Notebook() | ||
2465 | 312 | vbox.add(self.notebook) | ||
2466 | 313 | self.notebook.show() | ||
2467 | 314 | |||
2468 | 315 | # Account tab | ||
2469 | 316 | account = gtk.VBox(spacing=12) | ||
2470 | 317 | account.set_border_width(6) | ||
2471 | 318 | self.notebook.append_page(account) | ||
2472 | 319 | self.notebook.set_tab_label_text(account, _("Account")) | ||
2473 | 320 | account.show() | ||
2474 | 321 | |||
2475 | 322 | # User info in account tab | ||
2476 | 323 | table = gtk.Table(rows=3, columns=2) | ||
2477 | 324 | table.set_row_spacings(6) | ||
2478 | 325 | table.set_col_spacings(6) | ||
2479 | 326 | account.pack_start(table, False, False) | ||
2480 | 327 | table.show() | ||
2481 | 328 | |||
2482 | 329 | label = gtk.Label(_("_Name:")) | ||
2483 | 330 | label.set_use_underline(True) | ||
2484 | 331 | label.set_alignment(0.0, 0.5) | ||
2485 | 332 | table.attach(label, 0, 1, 0, 1) | ||
2486 | 333 | label.show() | ||
2487 | 334 | |||
2488 | 335 | self.name_label = gtk.Label("") | ||
2489 | 336 | self.name_label.set_use_underline(True) | ||
2490 | 337 | self.name_label.set_alignment(0.0, 0.5) | ||
2491 | 338 | table.attach(self.name_label, 1, 2, 0, 1) | ||
2492 | 339 | self.name_label.show() | ||
2493 | 340 | |||
2494 | 341 | label = gtk.Label(_("_Username:")) | ||
2495 | 342 | label.set_use_underline(True) | ||
2496 | 343 | label.set_alignment(0.0, 0.5) | ||
2497 | 344 | table.attach(label, 0, 1, 1, 2) | ||
2498 | 345 | label.show() | ||
2499 | 346 | |||
2500 | 347 | self.user_label = gtk.Label("") | ||
2501 | 348 | self.user_label.set_use_underline(True) | ||
2502 | 349 | self.user_label.set_alignment(0.0, 0.5) | ||
2503 | 350 | table.attach(self.user_label, 1, 2, 1, 2) | ||
2504 | 351 | self.user_label.show() | ||
2505 | 352 | |||
2506 | 353 | label = gtk.Label(_("_E-mail:")) | ||
2507 | 354 | label.set_use_underline(True) | ||
2508 | 355 | label.set_alignment(0.0, 0.5) | ||
2509 | 356 | table.attach(label, 0, 1, 2, 3) | ||
2510 | 357 | label.show() | ||
2511 | 358 | |||
2512 | 359 | self.mail_label = gtk.Label("") | ||
2513 | 360 | self.mail_label.set_use_underline(True) | ||
2514 | 361 | self.mail_label.set_alignment(0.0, 0.5) | ||
2515 | 362 | table.attach(self.mail_label, 1, 2, 2, 3) | ||
2516 | 363 | self.mail_label.show() | ||
2517 | 364 | |||
2518 | 365 | # Devices tab | ||
2519 | 366 | devices = gtk.VBox(spacing=12) | ||
2520 | 367 | devices.set_border_width(6) | ||
2521 | 368 | self.notebook.append_page(devices) | ||
2522 | 369 | self.notebook.set_tab_label_text(devices, _("Devices")) | ||
2523 | 370 | devices.show() | ||
2524 | 371 | |||
2525 | 372 | # Bandwidth limiting | ||
2526 | 373 | self.limit_check = gtk.CheckButton(_("_Limit Bandwidth Usage")) | ||
2527 | 374 | self.limit_check.connect("toggled", self.__bw_limit_toggled) | ||
2528 | 375 | devices.pack_start(self.limit_check, False, False) | ||
2529 | 376 | self.limit_check.show() | ||
2530 | 377 | |||
2531 | 378 | hbox = gtk.HBox(spacing=12) | ||
2532 | 379 | devices.pack_start(hbox, False, False) | ||
2533 | 380 | hbox.show() | ||
2534 | 381 | |||
2535 | 382 | label = gtk.Label() | ||
2536 | 383 | hbox.pack_start(label, False, False) | ||
2537 | 384 | label.show() | ||
2538 | 385 | |||
2539 | 386 | # Now put the bw limit bits in a table too | ||
2540 | 387 | self.bw_table = gtk.Table(rows=2, columns=2) | ||
2541 | 388 | self.bw_table.set_row_spacings(6) | ||
2542 | 389 | self.bw_table.set_col_spacings(6) | ||
2543 | 390 | self.bw_table.set_sensitive(False) | ||
2544 | 391 | hbox.pack_start(self.bw_table, False, False) | ||
2545 | 392 | self.bw_table.show() | ||
2546 | 393 | |||
2547 | 394 | # Upload speed | ||
2548 | 395 | label = gtk.Label(_("Maximum _upload speed (KB/s):")) | ||
2549 | 396 | label.set_use_underline(True) | ||
2550 | 397 | label.set_alignment(0, 0.5) | ||
2551 | 398 | self.bw_table.attach(label, 0, 1, 0, 1) | ||
2552 | 399 | label.show() | ||
2553 | 400 | |||
2554 | 401 | adjustment = gtk.Adjustment(value=2048.0, lower=0.0, upper=4096.0, | ||
2555 | 402 | step_incr=64.0, page_incr=128.0) | ||
2556 | 403 | self.up_spin = gtk.SpinButton(adjustment) | ||
2557 | 404 | self.up_spin.connect("value-changed", self.__spinner_changed) | ||
2558 | 405 | label.set_mnemonic_widget(self.up_spin) | ||
2559 | 406 | self.bw_table.attach(self.up_spin, 1, 2, 0, 1) | ||
2560 | 407 | self.up_spin.show() | ||
2561 | 408 | |||
2562 | 409 | # Download speed | ||
2563 | 410 | label = gtk.Label(_("Maximum _download speed (KB/s):")) | ||
2564 | 411 | label.set_use_underline(True) | ||
2565 | 412 | label.set_alignment(0, 0.5) | ||
2566 | 413 | self.bw_table.attach(label, 0, 1, 1, 2) | ||
2567 | 414 | label.show() | ||
2568 | 415 | adjustment = gtk.Adjustment(value=2048.0, lower=0.0, upper=4096.0, | ||
2569 | 416 | step_incr=64.0, page_incr=128.0) | ||
2570 | 417 | self.dn_spin = gtk.SpinButton(adjustment) | ||
2571 | 418 | self.dn_spin.connect("value-changed", self.__spinner_changed) | ||
2572 | 419 | label.set_mnemonic_widget(self.dn_spin) | ||
2573 | 420 | self.bw_table.attach(self.dn_spin, 1, 2, 1, 2) | ||
2574 | 421 | self.dn_spin.show() | ||
2575 | 422 | |||
2576 | 423 | # Services tab | ||
2577 | 424 | services = gtk.VBox(spacing=12) | ||
2578 | 425 | services.set_border_width(6) | ||
2579 | 426 | self.notebook.append_page(services) | ||
2580 | 427 | self.notebook.set_tab_label_text(services, _("Services")) | ||
2581 | 428 | # FIXME: These are all disabled for the moment | ||
2582 | 429 | services.set_sensitive(False) | ||
2583 | 430 | services.show() | ||
2584 | 431 | |||
2585 | 432 | self.bookmarks_check = gtk.CheckButton(_("_Bookmarks")) | ||
2586 | 433 | self.bookmarks_check.set_data('dbname', 'bookmarks') | ||
2587 | 434 | self.bookmarks_check.connect('toggled', self.__db_check_toggled) | ||
2588 | 435 | services.pack_start(self.bookmarks_check, False, False) | ||
2589 | 436 | self.bookmarks_check.show() | ||
2590 | 437 | |||
2591 | 438 | self.abook_check = gtk.CheckButton(_("C_ontacts")) | ||
2592 | 439 | self.abook_check.set_data('dbname', 'contacts') | ||
2593 | 440 | self.abook_check.connect('toggled', self.__db_check_toggled) | ||
2594 | 441 | services.pack_start(self.abook_check, False, False) | ||
2595 | 442 | self.abook_check.show() | ||
2596 | 443 | |||
2597 | 444 | fbox = gtk.VBox(spacing=6) | ||
2598 | 445 | services.pack_start(fbox, False, False) | ||
2599 | 446 | fbox.show() | ||
2600 | 447 | |||
2601 | 448 | self.files_check = gtk.CheckButton(_("_File Synchronization")) | ||
2602 | 449 | self.files_check.set_active(True) | ||
2603 | 450 | self.files_check.connect('toggled', self.__files_check_toggled) | ||
2604 | 451 | fbox.pack_start(self.files_check, False, False) | ||
2605 | 452 | self.files_check.show() | ||
2606 | 453 | |||
2607 | 454 | alignment = gtk.Alignment(0.0, 0.5) | ||
2608 | 455 | alignment.set_padding(0, 0, 12, 0) | ||
2609 | 456 | fbox.pack_start(alignment, False, False) | ||
2610 | 457 | alignment.show() | ||
2611 | 458 | |||
2612 | 459 | self.music_check = gtk.CheckButton(_("_Music Download")) | ||
2613 | 460 | self.music_check.set_active(True) | ||
2614 | 461 | self.music_check.connect('toggled', self.__music_check_toggled) | ||
2615 | 462 | alignment.add(self.music_check) | ||
2616 | 463 | self.music_check.show() | ||
2617 | 464 | |||
2618 | 465 | class UbuntuoneLoginHandler(object): | ||
2619 | 466 | """Class to handle registration/login, in case we aren't already.""" | ||
2620 | 467 | |||
2621 | 468 | def __init__(self, *args, **kw): | ||
2622 | 469 | self.bus = dbus.SessionBus() | ||
2623 | 470 | |||
2624 | 471 | self.newcreds = None | ||
2625 | 472 | self.oautherr = None | ||
2626 | 473 | self.authdeny = None | ||
2627 | 474 | |||
2628 | 475 | def got_newcredentials(self, realm, consumer_key): | ||
2629 | 476 | """Show our dialog, since we can do stuff now.""" | ||
2630 | 477 | self.disconnect_signal_handlers() | ||
2631 | 478 | dialog = UbuntuOneDialog() | ||
2632 | 479 | dialog.request_quota_info() | ||
2633 | 480 | dialog.request_account_info() | ||
2634 | 481 | dialog.show() | ||
2635 | 482 | |||
2636 | 483 | def got_oautherror(self, message=None): | ||
2637 | 484 | """Got an error during oauth.""" | ||
2638 | 485 | gtk.main_quit() | ||
2639 | 486 | |||
2640 | 487 | def got_authdenied(self): | ||
2641 | 488 | """User denied access.""" | ||
2642 | 489 | gtk.main_quit() | ||
2643 | 490 | |||
2644 | 491 | def got_dbus_error(self, error): | ||
2645 | 492 | """Got a DBusError.""" | ||
2646 | 493 | gtk.main_quit() | ||
2647 | 494 | |||
2648 | 495 | def register_signal_handlers(self): | ||
2649 | 496 | """Register the dbus signal handlers.""" | ||
2650 | 497 | self.newcreds = self.bus.add_signal_receiver( | ||
2651 | 498 | handler_function=self.got_newcredentials, | ||
2652 | 499 | signal_name='NewCredentials', | ||
2653 | 500 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
2654 | 501 | self.oautherr = self.bus.add_signal_receiver( | ||
2655 | 502 | handler_function=self.got_oautherror, | ||
2656 | 503 | signal_name='OAuthError', | ||
2657 | 504 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
2658 | 505 | self.authdeny = self.bus.add_signal_receiver( | ||
2659 | 506 | handler_function=self.got_authdenied, | ||
2660 | 507 | signal_name='AuthorizationDenied', | ||
2661 | 508 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
2662 | 509 | |||
2663 | 510 | def disconnect_signal_handlers(self): | ||
2664 | 511 | """Disconnect the dbus signal handlers, so we don't break.""" | ||
2665 | 512 | self.bus.remove_signal_receiver( | ||
2666 | 513 | self.newcreds, | ||
2667 | 514 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
2668 | 515 | self.bus.remove_signal_receiver( | ||
2669 | 516 | self.oautherr, | ||
2670 | 517 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
2671 | 518 | self.bus.remove_signal_receiver( | ||
2672 | 519 | self.authdeny, | ||
2673 | 520 | dbus_interface=DBUS_IFACE_AUTH_NAME) | ||
2674 | 521 | |||
2675 | 522 | def do_login_check(self): | ||
2676 | 523 | """Log in to U1 or validate that we already are.""" | ||
2677 | 524 | try: | ||
2678 | 525 | client = self.bus.get_object(DBUS_IFACE_AUTH_NAME, | ||
2679 | 526 | DBUS_IFACE_AUTH_PATH, | ||
2680 | 527 | follow_name_owner_changes=True) | ||
2681 | 528 | iface = dbus.Interface(client, DBUS_IFACE_AUTH_NAME) | ||
2682 | 529 | iface.login('https://ubuntuone.com', 'ubuntuone', | ||
2683 | 530 | reply_handler=dbus_async, | ||
2684 | 531 | error_handler=self.got_dbus_error) | ||
2685 | 532 | except DBusException, e: | ||
2686 | 533 | self.got_dbus_error(e) | ||
2687 | 534 | |||
2688 | 535 | |||
2689 | 536 | if __name__ == "__main__": | ||
2690 | 537 | gettext.bindtextdomain(clientdefs.GETTEXT_PACKAGE, clientdefs.LOCALEDIR) | ||
2691 | 538 | gettext.textdomain(clientdefs.GETTEXT_PACKAGE) | ||
2692 | 539 | |||
2693 | 540 | gtk.rc_parse_string(RCSTYLE) | ||
2694 | 541 | gobject.set_application_name("Ubuntu One") | ||
2695 | 542 | |||
2696 | 543 | try: | ||
2697 | 544 | login = UbuntuoneLoginHandler() | ||
2698 | 545 | login.register_signal_handlers() | ||
2699 | 546 | login.do_login_check() | ||
2700 | 547 | gtk.main() | ||
2701 | 548 | except KeyboardInterrupt: | ||
2702 | 549 | pass | ||
2703 | 0 | 550 | ||
2704 | === modified file 'bin/ubuntuone-syncdaemon' | |||
2705 | --- bin/ubuntuone-syncdaemon 2009-09-28 18:15:00 +0000 | |||
2706 | +++ bin/ubuntuone-syncdaemon 2010-02-18 00:10:25 +0000 | |||
2707 | @@ -31,7 +31,7 @@ | |||
2708 | 31 | import sys | 31 | import sys |
2709 | 32 | import shutil | 32 | import shutil |
2710 | 33 | 33 | ||
2712 | 34 | from ubuntuone.syncdaemon import dbus_interface, logger | 34 | from ubuntuone.syncdaemon import dbus_interface, logger, config |
2713 | 35 | from ubuntuone.syncdaemon.config import ( | 35 | from ubuntuone.syncdaemon.config import ( |
2714 | 36 | get_config_files, | 36 | get_config_files, |
2715 | 37 | get_parsers, | 37 | get_parsers, |
2716 | @@ -75,14 +75,15 @@ | |||
2717 | 75 | configs.append(args.pop(0)) | 75 | configs.append(args.pop(0)) |
2718 | 76 | if len(configs) == 0: | 76 | if len(configs) == 0: |
2719 | 77 | configs.extend(get_config_files()) | 77 | configs.extend(get_config_files()) |
2723 | 78 | (parser, options, argv) = configglue(file(configs[0]), *configs[1:], | 78 | (parser, options, argv) = config.configglue(file(configs[0]), *configs[1:], |
2724 | 79 | args=args, usage=usage, | 79 | args=args, usage=usage) |
2722 | 80 | extra_parsers=get_parsers()) | ||
2725 | 81 | 80 | ||
2726 | 82 | if options.debug: | 81 | if options.debug: |
2727 | 83 | logger.set_debug('stdout file') | 82 | logger.set_debug('stdout file') |
2728 | 84 | else: | 83 | else: |
2730 | 85 | logger.set_level(options.log_level) | 84 | logger.configure_logging(options.logging_level, |
2731 | 85 | options.logging_file_size, | ||
2732 | 86 | options.logging_backup_count) | ||
2733 | 86 | 87 | ||
2734 | 87 | # check we're not running as root, or have explicitely and in | 88 | # check we're not running as root, or have explicitely and in |
2735 | 88 | # length expressed our desire to do so | 89 | # length expressed our desire to do so |
2736 | 89 | 90 | ||
2737 | === modified file 'config.guess' | |||
2738 | --- config.guess 2009-07-27 16:00:00 +0000 | |||
2739 | +++ config.guess 2010-02-18 00:10:25 +0000 | |||
2740 | @@ -1,10 +1,10 @@ | |||
2741 | 1 | #! /bin/sh | 1 | #! /bin/sh |
2742 | 2 | # Attempt to guess a canonical system name. | 2 | # Attempt to guess a canonical system name. |
2743 | 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
2745 | 4 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 | 4 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
2746 | 5 | # Free Software Foundation, Inc. | 5 | # Free Software Foundation, Inc. |
2747 | 6 | 6 | ||
2749 | 7 | timestamp='2009-04-27' | 7 | timestamp='2009-06-10' |
2750 | 8 | 8 | ||
2751 | 9 | # This file is free software; you can redistribute it and/or modify it | 9 | # This file is free software; you can redistribute it and/or modify it |
2752 | 10 | # under the terms of the GNU General Public License as published by | 10 | # under the terms of the GNU General Public License as published by |
2753 | @@ -170,7 +170,7 @@ | |||
2754 | 170 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) | 170 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) |
2755 | 171 | eval $set_cc_for_build | 171 | eval $set_cc_for_build |
2756 | 172 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | 172 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
2758 | 173 | | grep __ELF__ >/dev/null | 173 | | grep -q __ELF__ |
2759 | 174 | then | 174 | then |
2760 | 175 | # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). | 175 | # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). |
2761 | 176 | # Return netbsd for either. FIX? | 176 | # Return netbsd for either. FIX? |
2762 | @@ -656,7 +656,7 @@ | |||
2763 | 656 | # => hppa64-hp-hpux11.23 | 656 | # => hppa64-hp-hpux11.23 |
2764 | 657 | 657 | ||
2765 | 658 | if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | | 658 | if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | |
2767 | 659 | grep __LP64__ >/dev/null | 659 | grep -q __LP64__ |
2768 | 660 | then | 660 | then |
2769 | 661 | HP_ARCH="hppa2.0w" | 661 | HP_ARCH="hppa2.0w" |
2770 | 662 | else | 662 | else |
2771 | @@ -822,6 +822,9 @@ | |||
2772 | 822 | [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) | 822 | [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) |
2773 | 823 | echo i${UNAME_MACHINE}-pc-mks | 823 | echo i${UNAME_MACHINE}-pc-mks |
2774 | 824 | exit ;; | 824 | exit ;; |
2775 | 825 | 8664:Windows_NT:*) | ||
2776 | 826 | echo x86_64-pc-mks | ||
2777 | 827 | exit ;; | ||
2778 | 825 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) | 828 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) |
2779 | 826 | # How do we know it's Interix rather than the generic POSIX subsystem? | 829 | # How do we know it's Interix rather than the generic POSIX subsystem? |
2780 | 827 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we | 830 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we |
2781 | @@ -882,40 +885,17 @@ | |||
2782 | 882 | m68*:Linux:*:*) | 885 | m68*:Linux:*:*) |
2783 | 883 | echo ${UNAME_MACHINE}-unknown-linux-gnu | 886 | echo ${UNAME_MACHINE}-unknown-linux-gnu |
2784 | 884 | exit ;; | 887 | exit ;; |
2819 | 885 | mips:Linux:*:*) | 888 | mips:Linux:*:* | mips64:Linux:*:*) |
2820 | 886 | eval $set_cc_for_build | 889 | eval $set_cc_for_build |
2821 | 887 | sed 's/^ //' << EOF >$dummy.c | 890 | sed 's/^ //' << EOF >$dummy.c |
2822 | 888 | #undef CPU | 891 | #undef CPU |
2823 | 889 | #undef mips | 892 | #undef ${UNAME_MACHINE} |
2824 | 890 | #undef mipsel | 893 | #undef ${UNAME_MACHINE}el |
2825 | 891 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) | 894 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) |
2826 | 892 | CPU=mipsel | 895 | CPU=${UNAME_MACHINE}el |
2827 | 893 | #else | 896 | #else |
2828 | 894 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) | 897 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) |
2829 | 895 | CPU=mips | 898 | CPU=${UNAME_MACHINE} |
2796 | 896 | #else | ||
2797 | 897 | CPU= | ||
2798 | 898 | #endif | ||
2799 | 899 | #endif | ||
2800 | 900 | EOF | ||
2801 | 901 | eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' | ||
2802 | 902 | /^CPU/{ | ||
2803 | 903 | s: ::g | ||
2804 | 904 | p | ||
2805 | 905 | }'`" | ||
2806 | 906 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } | ||
2807 | 907 | ;; | ||
2808 | 908 | mips64:Linux:*:*) | ||
2809 | 909 | eval $set_cc_for_build | ||
2810 | 910 | sed 's/^ //' << EOF >$dummy.c | ||
2811 | 911 | #undef CPU | ||
2812 | 912 | #undef mips64 | ||
2813 | 913 | #undef mips64el | ||
2814 | 914 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) | ||
2815 | 915 | CPU=mips64el | ||
2816 | 916 | #else | ||
2817 | 917 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) | ||
2818 | 918 | CPU=mips64 | ||
2830 | 919 | #else | 899 | #else |
2831 | 920 | CPU= | 900 | CPU= |
2832 | 921 | #endif | 901 | #endif |
2833 | @@ -947,7 +927,7 @@ | |||
2834 | 947 | EV67) UNAME_MACHINE=alphaev67 ;; | 927 | EV67) UNAME_MACHINE=alphaev67 ;; |
2835 | 948 | EV68*) UNAME_MACHINE=alphaev68 ;; | 928 | EV68*) UNAME_MACHINE=alphaev68 ;; |
2836 | 949 | esac | 929 | esac |
2838 | 950 | objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null | 930 | objdump --private-headers /bin/sh | grep -q ld.so.1 |
2839 | 951 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi | 931 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi |
2840 | 952 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} | 932 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} |
2841 | 953 | exit ;; | 933 | exit ;; |
2842 | @@ -1001,14 +981,6 @@ | |||
2843 | 1001 | elf32-i386) | 981 | elf32-i386) |
2844 | 1002 | TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" | 982 | TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" |
2845 | 1003 | ;; | 983 | ;; |
2846 | 1004 | a.out-i386-linux) | ||
2847 | 1005 | echo "${UNAME_MACHINE}-pc-linux-gnuaout" | ||
2848 | 1006 | exit ;; | ||
2849 | 1007 | "") | ||
2850 | 1008 | # Either a pre-BFD a.out linker (linux-gnuoldld) or | ||
2851 | 1009 | # one that does not give us useful --help. | ||
2852 | 1010 | echo "${UNAME_MACHINE}-pc-linux-gnuoldld" | ||
2853 | 1011 | exit ;; | ||
2854 | 1012 | esac | 984 | esac |
2855 | 1013 | # Determine whether the default compiler is a.out or elf | 985 | # Determine whether the default compiler is a.out or elf |
2856 | 1014 | eval $set_cc_for_build | 986 | eval $set_cc_for_build |
2857 | @@ -1074,7 +1046,7 @@ | |||
2858 | 1074 | i*86:syllable:*:*) | 1046 | i*86:syllable:*:*) |
2859 | 1075 | echo ${UNAME_MACHINE}-pc-syllable | 1047 | echo ${UNAME_MACHINE}-pc-syllable |
2860 | 1076 | exit ;; | 1048 | exit ;; |
2862 | 1077 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) | 1049 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) |
2863 | 1078 | echo i386-unknown-lynxos${UNAME_RELEASE} | 1050 | echo i386-unknown-lynxos${UNAME_RELEASE} |
2864 | 1079 | exit ;; | 1051 | exit ;; |
2865 | 1080 | i*86:*DOS:*:*) | 1052 | i*86:*DOS:*:*) |
2866 | @@ -1182,7 +1154,7 @@ | |||
2867 | 1182 | rs6000:LynxOS:2.*:*) | 1154 | rs6000:LynxOS:2.*:*) |
2868 | 1183 | echo rs6000-unknown-lynxos${UNAME_RELEASE} | 1155 | echo rs6000-unknown-lynxos${UNAME_RELEASE} |
2869 | 1184 | exit ;; | 1156 | exit ;; |
2871 | 1185 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) | 1157 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) |
2872 | 1186 | echo powerpc-unknown-lynxos${UNAME_RELEASE} | 1158 | echo powerpc-unknown-lynxos${UNAME_RELEASE} |
2873 | 1187 | exit ;; | 1159 | exit ;; |
2874 | 1188 | SM[BE]S:UNIX_SV:*:*) | 1160 | SM[BE]S:UNIX_SV:*:*) |
2875 | 1189 | 1161 | ||
2876 | === modified file 'config.sub' | |||
2877 | --- config.sub 2009-07-27 16:00:00 +0000 | |||
2878 | +++ config.sub 2010-02-18 00:10:25 +0000 | |||
2879 | @@ -1,10 +1,10 @@ | |||
2880 | 1 | #! /bin/sh | 1 | #! /bin/sh |
2881 | 2 | # Configuration validation subroutine script. | 2 | # Configuration validation subroutine script. |
2882 | 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
2884 | 4 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 | 4 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
2885 | 5 | # Free Software Foundation, Inc. | 5 | # Free Software Foundation, Inc. |
2886 | 6 | 6 | ||
2888 | 7 | timestamp='2009-04-17' | 7 | timestamp='2009-06-11' |
2889 | 8 | 8 | ||
2890 | 9 | # This file is (in principle) common to ALL GNU software. | 9 | # This file is (in principle) common to ALL GNU software. |
2891 | 10 | # The presence of a machine in this file suggests that SOME GNU software | 10 | # The presence of a machine in this file suggests that SOME GNU software |
2892 | @@ -153,6 +153,9 @@ | |||
2893 | 153 | os= | 153 | os= |
2894 | 154 | basic_machine=$1 | 154 | basic_machine=$1 |
2895 | 155 | ;; | 155 | ;; |
2896 | 156 | -bluegene*) | ||
2897 | 157 | os=-cnk | ||
2898 | 158 | ;; | ||
2899 | 156 | -sim | -cisco | -oki | -wec | -winbond) | 159 | -sim | -cisco | -oki | -wec | -winbond) |
2900 | 157 | os= | 160 | os= |
2901 | 158 | basic_machine=$1 | 161 | basic_machine=$1 |
2902 | @@ -467,6 +470,10 @@ | |||
2903 | 467 | basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` | 470 | basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` |
2904 | 468 | os=-linux | 471 | os=-linux |
2905 | 469 | ;; | 472 | ;; |
2906 | 473 | bluegene*) | ||
2907 | 474 | basic_machine=powerpc-ibm | ||
2908 | 475 | os=-cnk | ||
2909 | 476 | ;; | ||
2910 | 470 | c90) | 477 | c90) |
2911 | 471 | basic_machine=c90-cray | 478 | basic_machine=c90-cray |
2912 | 472 | os=-unicos | 479 | os=-unicos |
2913 | @@ -1260,7 +1267,7 @@ | |||
2914 | 1260 | # Each alternative MUST END IN A *, to match a version number. | 1267 | # Each alternative MUST END IN A *, to match a version number. |
2915 | 1261 | # -sysv* is not here because it comes later, after sysvr4. | 1268 | # -sysv* is not here because it comes later, after sysvr4. |
2916 | 1262 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | 1269 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ |
2918 | 1263 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | 1270 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ |
2919 | 1264 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | 1271 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ |
2920 | 1265 | | -kopensolaris* \ | 1272 | | -kopensolaris* \ |
2921 | 1266 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | 1273 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ |
2922 | @@ -1613,7 +1620,7 @@ | |||
2923 | 1613 | -sunos*) | 1620 | -sunos*) |
2924 | 1614 | vendor=sun | 1621 | vendor=sun |
2925 | 1615 | ;; | 1622 | ;; |
2927 | 1616 | -aix*) | 1623 | -cnk*|-aix*) |
2928 | 1617 | vendor=ibm | 1624 | vendor=ibm |
2929 | 1618 | ;; | 1625 | ;; |
2930 | 1619 | -beos*) | 1626 | -beos*) |
2931 | 1620 | 1627 | ||
2932 | === modified file 'configure' | |||
2933 | --- configure 2009-12-07 17:35:00 +0000 | |||
2934 | +++ configure 2010-02-18 00:10:25 +0000 | |||
2935 | @@ -1,10 +1,12 @@ | |||
2936 | 1 | #! /bin/sh | 1 | #! /bin/sh |
2937 | 2 | # Guess values for system-dependent variables and create Makefiles. | 2 | # Guess values for system-dependent variables and create Makefiles. |
2939 | 3 | # Generated by GNU Autoconf 2.64 for ubuntuone-client 1.1.0. | 3 | # Generated by GNU Autoconf 2.65 for ubuntuone-client 1.1.2. |
2940 | 4 | # | ||
2941 | 4 | # | 5 | # |
2942 | 5 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, | 6 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
2945 | 6 | # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software | 7 | # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, |
2946 | 7 | # Foundation, Inc. | 8 | # Inc. |
2947 | 9 | # | ||
2948 | 8 | # | 10 | # |
2949 | 9 | # This configure script is free software; the Free Software Foundation | 11 | # This configure script is free software; the Free Software Foundation |
2950 | 10 | # gives unlimited permission to copy, distribute and modify it. | 12 | # gives unlimited permission to copy, distribute and modify it. |
2951 | @@ -673,7 +675,8 @@ | |||
2952 | 673 | 675 | ||
2953 | 674 | 676 | ||
2954 | 675 | 677 | ||
2956 | 676 | exec 7<&0 </dev/null 6>&1 | 678 | test -n "$DJDIR" || exec 7<&0 </dev/null |
2957 | 679 | exec 6>&1 | ||
2958 | 677 | 680 | ||
2959 | 678 | # Name of the host. | 681 | # Name of the host. |
2960 | 679 | # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, | 682 | # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, |
2961 | @@ -695,8 +698,8 @@ | |||
2962 | 695 | # Identity of this package. | 698 | # Identity of this package. |
2963 | 696 | PACKAGE_NAME='ubuntuone-client' | 699 | PACKAGE_NAME='ubuntuone-client' |
2964 | 697 | PACKAGE_TARNAME='ubuntuone-client' | 700 | PACKAGE_TARNAME='ubuntuone-client' |
2967 | 698 | PACKAGE_VERSION='1.1.0' | 701 | PACKAGE_VERSION='1.1.2' |
2968 | 699 | PACKAGE_STRING='ubuntuone-client 1.1.0' | 702 | PACKAGE_STRING='ubuntuone-client 1.1.2' |
2969 | 700 | PACKAGE_BUGREPORT='' | 703 | PACKAGE_BUGREPORT='' |
2970 | 701 | PACKAGE_URL='' | 704 | PACKAGE_URL='' |
2971 | 702 | 705 | ||
2972 | @@ -756,6 +759,8 @@ | |||
2973 | 756 | PYTHON_PREFIX | 759 | PYTHON_PREFIX |
2974 | 757 | PYTHON_VERSION | 760 | PYTHON_VERSION |
2975 | 758 | PYTHON | 761 | PYTHON |
2976 | 762 | LOG_FILE_SIZE | ||
2977 | 763 | LOG_LEVEL | ||
2978 | 759 | ENABLE_RENDERING_FALSE | 764 | ENABLE_RENDERING_FALSE |
2979 | 760 | ENABLE_RENDERING_TRUE | 765 | ENABLE_RENDERING_TRUE |
2980 | 761 | ICONTOOL_RENDER | 766 | ICONTOOL_RENDER |
2981 | @@ -911,6 +916,7 @@ | |||
2982 | 911 | enable_libtool_lock | 916 | enable_libtool_lock |
2983 | 912 | enable_nls | 917 | enable_nls |
2984 | 913 | enable_rendering | 918 | enable_rendering |
2985 | 919 | enable_debug | ||
2986 | 914 | enable_pycentral | 920 | enable_pycentral |
2987 | 915 | with_protocol | 921 | with_protocol |
2988 | 916 | with_dbus_services | 922 | with_dbus_services |
2989 | @@ -1470,7 +1476,7 @@ | |||
2990 | 1470 | # Omit some internal or obsolete options to make the list less imposing. | 1476 | # Omit some internal or obsolete options to make the list less imposing. |
2991 | 1471 | # This message is too long to be a string in the A/UX 3.1 sh. | 1477 | # This message is too long to be a string in the A/UX 3.1 sh. |
2992 | 1472 | cat <<_ACEOF | 1478 | cat <<_ACEOF |
2994 | 1473 | \`configure' configures ubuntuone-client 1.1.0 to adapt to many kinds of systems. | 1479 | \`configure' configures ubuntuone-client 1.1.2 to adapt to many kinds of systems. |
2995 | 1474 | 1480 | ||
2996 | 1475 | Usage: $0 [OPTION]... [VAR=VALUE]... | 1481 | Usage: $0 [OPTION]... [VAR=VALUE]... |
2997 | 1476 | 1482 | ||
2998 | @@ -1541,7 +1547,7 @@ | |||
2999 | 1541 | 1547 | ||
3000 | 1542 | if test -n "$ac_init_help"; then | 1548 | if test -n "$ac_init_help"; then |
3001 | 1543 | case $ac_init_help in | 1549 | case $ac_init_help in |
3003 | 1544 | short | recursive ) echo "Configuration of ubuntuone-client 1.1.0:";; | 1550 | short | recursive ) echo "Configuration of ubuntuone-client 1.1.2:";; |
3004 | 1545 | esac | 1551 | esac |
3005 | 1546 | cat <<\_ACEOF | 1552 | cat <<\_ACEOF |
3006 | 1547 | 1553 | ||
3007 | @@ -1557,8 +1563,9 @@ | |||
3008 | 1557 | optimize for fast installation [default=yes] | 1563 | optimize for fast installation [default=yes] |
3009 | 1558 | --disable-libtool-lock avoid locking (might break parallel builds) | 1564 | --disable-libtool-lock avoid locking (might break parallel builds) |
3010 | 1559 | --disable-nls do not use Native Language Support | 1565 | --disable-nls do not use Native Language Support |
3013 | 1560 | --enable-rendering Enable icon rendering default=auto | 1566 | --enable-rendering Enable icon rendering [default=auto] |
3014 | 1561 | --enable-pycentral Enable usage of pycentral default=disabled | 1567 | --enable-debug Enable debug logging by default [default=auto] |
3015 | 1568 | --enable-pycentral Enable usage of pycentral [default=disabled] | ||
3016 | 1562 | 1569 | ||
3017 | 1563 | Optional Packages: | 1570 | Optional Packages: |
3018 | 1564 | --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] | 1571 | --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] |
3019 | @@ -1566,7 +1573,7 @@ | |||
3020 | 1566 | --with-pic try to use only PIC/non-PIC objects [default=use | 1573 | --with-pic try to use only PIC/non-PIC objects [default=use |
3021 | 1567 | both] | 1574 | both] |
3022 | 1568 | --with-gnu-ld assume the C compiler uses GNU ld [default=no] | 1575 | --with-gnu-ld assume the C compiler uses GNU ld [default=no] |
3024 | 1569 | --with-protocol Specify path to storage protocol default=auto | 1576 | --with-protocol Specify path to storage protocol [default=auto] |
3025 | 1570 | --with-dbus-services=<dir> | 1577 | --with-dbus-services=<dir> |
3026 | 1571 | where D-BUS services directory is | 1578 | where D-BUS services directory is |
3027 | 1572 | 1579 | ||
3028 | @@ -1576,7 +1583,7 @@ | |||
3029 | 1576 | LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a | 1583 | LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a |
3030 | 1577 | nonstandard directory <lib dir> | 1584 | nonstandard directory <lib dir> |
3031 | 1578 | LIBS libraries to pass to the linker, e.g. -l<library> | 1585 | LIBS libraries to pass to the linker, e.g. -l<library> |
3033 | 1579 | CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if | 1586 | CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if |
3034 | 1580 | you have headers in a nonstandard directory <include dir> | 1587 | you have headers in a nonstandard directory <include dir> |
3035 | 1581 | CPP C preprocessor | 1588 | CPP C preprocessor |
3036 | 1582 | PKG_CONFIG path to pkg-config utility | 1589 | PKG_CONFIG path to pkg-config utility |
3037 | @@ -1653,8 +1660,8 @@ | |||
3038 | 1653 | test -n "$ac_init_help" && exit $ac_status | 1660 | test -n "$ac_init_help" && exit $ac_status |
3039 | 1654 | if $ac_init_version; then | 1661 | if $ac_init_version; then |
3040 | 1655 | cat <<\_ACEOF | 1662 | cat <<\_ACEOF |
3043 | 1656 | ubuntuone-client configure 1.1.0 | 1663 | ubuntuone-client configure 1.1.2 |
3044 | 1657 | generated by GNU Autoconf 2.64 | 1664 | generated by GNU Autoconf 2.65 |
3045 | 1658 | 1665 | ||
3046 | 1659 | Copyright (C) 2009 Free Software Foundation, Inc. | 1666 | Copyright (C) 2009 Free Software Foundation, Inc. |
3047 | 1660 | This configure script is free software; the Free Software Foundation | 1667 | This configure script is free software; the Free Software Foundation |
3048 | @@ -1701,7 +1708,7 @@ | |||
3049 | 1701 | ac_retval=1 | 1708 | ac_retval=1 |
3050 | 1702 | fi | 1709 | fi |
3051 | 1703 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | 1710 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} |
3053 | 1704 | return $ac_retval | 1711 | as_fn_set_status $ac_retval |
3054 | 1705 | 1712 | ||
3055 | 1706 | } # ac_fn_c_try_compile | 1713 | } # ac_fn_c_try_compile |
3056 | 1707 | 1714 | ||
3057 | @@ -1747,7 +1754,7 @@ | |||
3058 | 1747 | # left behind by Apple's compiler. We do this before executing the actions. | 1754 | # left behind by Apple's compiler. We do this before executing the actions. |
3059 | 1748 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo | 1755 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo |
3060 | 1749 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | 1756 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} |
3062 | 1750 | return $ac_retval | 1757 | as_fn_set_status $ac_retval |
3063 | 1751 | 1758 | ||
3064 | 1752 | } # ac_fn_c_try_link | 1759 | } # ac_fn_c_try_link |
3065 | 1753 | 1760 | ||
3066 | @@ -1815,7 +1822,7 @@ | |||
3067 | 1815 | ac_retval=1 | 1822 | ac_retval=1 |
3068 | 1816 | fi | 1823 | fi |
3069 | 1817 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | 1824 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} |
3071 | 1818 | return $ac_retval | 1825 | as_fn_set_status $ac_retval |
3072 | 1819 | 1826 | ||
3073 | 1820 | } # ac_fn_c_try_cpp | 1827 | } # ac_fn_c_try_cpp |
3074 | 1821 | 1828 | ||
3075 | @@ -1857,7 +1864,7 @@ | |||
3076 | 1857 | fi | 1864 | fi |
3077 | 1858 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo | 1865 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo |
3078 | 1859 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | 1866 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} |
3080 | 1860 | return $ac_retval | 1867 | as_fn_set_status $ac_retval |
3081 | 1861 | 1868 | ||
3082 | 1862 | } # ac_fn_c_try_run | 1869 | } # ac_fn_c_try_run |
3083 | 1863 | 1870 | ||
3084 | @@ -1931,8 +1938,8 @@ | |||
3085 | 1931 | This file contains any messages produced by compilers while | 1938 | This file contains any messages produced by compilers while |
3086 | 1932 | running configure, to aid debugging if configure makes a mistake. | 1939 | running configure, to aid debugging if configure makes a mistake. |
3087 | 1933 | 1940 | ||
3090 | 1934 | It was created by ubuntuone-client $as_me 1.1.0, which was | 1941 | It was created by ubuntuone-client $as_me 1.1.2, which was |
3091 | 1935 | generated by GNU Autoconf 2.64. Invocation command line was | 1942 | generated by GNU Autoconf 2.65. Invocation command line was |
3092 | 1936 | 1943 | ||
3093 | 1937 | $ $0 $@ | 1944 | $ $0 $@ |
3094 | 1938 | 1945 | ||
3095 | @@ -2185,7 +2192,7 @@ | |||
3096 | 2185 | for ac_site_file in "$ac_site_file1" "$ac_site_file2" | 2192 | for ac_site_file in "$ac_site_file1" "$ac_site_file2" |
3097 | 2186 | do | 2193 | do |
3098 | 2187 | test "x$ac_site_file" = xNONE && continue | 2194 | test "x$ac_site_file" = xNONE && continue |
3100 | 2188 | if test -r "$ac_site_file"; then | 2195 | if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then |
3101 | 2189 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 | 2196 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 |
3102 | 2190 | $as_echo "$as_me: loading site script $ac_site_file" >&6;} | 2197 | $as_echo "$as_me: loading site script $ac_site_file" >&6;} |
3103 | 2191 | sed 's/^/| /' "$ac_site_file" >&5 | 2198 | sed 's/^/| /' "$ac_site_file" >&5 |
3104 | @@ -2194,9 +2201,9 @@ | |||
3105 | 2194 | done | 2201 | done |
3106 | 2195 | 2202 | ||
3107 | 2196 | if test -r "$cache_file"; then | 2203 | if test -r "$cache_file"; then |
3111 | 2197 | # Some versions of bash will fail to source /dev/null (special | 2204 | # Some versions of bash will fail to source /dev/null (special files |
3112 | 2198 | # files actually), so we avoid doing that. | 2205 | # actually), so we avoid doing that. DJGPP emulates it as a regular file. |
3113 | 2199 | if test -f "$cache_file"; then | 2206 | if test /dev/null != "$cache_file" && test -f "$cache_file"; then |
3114 | 2200 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 | 2207 | { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 |
3115 | 2201 | $as_echo "$as_me: loading cache $cache_file" >&6;} | 2208 | $as_echo "$as_me: loading cache $cache_file" >&6;} |
3116 | 2202 | case $cache_file in | 2209 | case $cache_file in |
3117 | @@ -2617,6 +2624,7 @@ | |||
3118 | 2617 | 2624 | ||
3119 | 2618 | fi | 2625 | fi |
3120 | 2619 | 2626 | ||
3121 | 2627 | test -d ./--version && rmdir ./--version | ||
3122 | 2620 | if test "${ac_cv_path_mkdir+set}" = set; then | 2628 | if test "${ac_cv_path_mkdir+set}" = set; then |
3123 | 2621 | MKDIR_P="$ac_cv_path_mkdir -p" | 2629 | MKDIR_P="$ac_cv_path_mkdir -p" |
3124 | 2622 | else | 2630 | else |
3125 | @@ -2624,7 +2632,6 @@ | |||
3126 | 2624 | # value for MKDIR_P within a source directory, because that will | 2632 | # value for MKDIR_P within a source directory, because that will |
3127 | 2625 | # break other packages using the cache if that directory is | 2633 | # break other packages using the cache if that directory is |
3128 | 2626 | # removed, or if the value is a relative name. | 2634 | # removed, or if the value is a relative name. |
3129 | 2627 | test -d ./--version && rmdir ./--version | ||
3130 | 2628 | MKDIR_P="$ac_install_sh -d" | 2635 | MKDIR_P="$ac_install_sh -d" |
3131 | 2629 | fi | 2636 | fi |
3132 | 2630 | fi | 2637 | fi |
3133 | @@ -2741,7 +2748,7 @@ | |||
3134 | 2741 | 2748 | ||
3135 | 2742 | # Define the identity of the package. | 2749 | # Define the identity of the package. |
3136 | 2743 | PACKAGE='ubuntuone-client' | 2750 | PACKAGE='ubuntuone-client' |
3138 | 2744 | VERSION='1.1.0' | 2751 | VERSION='1.1.2' |
3139 | 2745 | 2752 | ||
3140 | 2746 | 2753 | ||
3141 | 2747 | cat >>confdefs.h <<_ACEOF | 2754 | cat >>confdefs.h <<_ACEOF |
3142 | @@ -3168,32 +3175,30 @@ | |||
3143 | 3168 | ... rest of stderr output deleted ... | 3175 | ... rest of stderr output deleted ... |
3144 | 3169 | 10q' conftest.err >conftest.er1 | 3176 | 10q' conftest.err >conftest.er1 |
3145 | 3170 | cat conftest.er1 >&5 | 3177 | cat conftest.er1 >&5 |
3146 | 3171 | rm -f conftest.er1 conftest.err | ||
3147 | 3172 | fi | 3178 | fi |
3148 | 3179 | rm -f conftest.er1 conftest.err | ||
3149 | 3173 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | 3180 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
3150 | 3174 | test $ac_status = 0; } | 3181 | test $ac_status = 0; } |
3151 | 3175 | done | 3182 | done |
3152 | 3176 | 3183 | ||
3153 | 3177 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | 3184 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
3154 | 3178 | /* end confdefs.h. */ | 3185 | /* end confdefs.h. */ |
3156 | 3179 | #include <stdio.h> | 3186 | |
3157 | 3180 | int | 3187 | int |
3158 | 3181 | main () | 3188 | main () |
3159 | 3182 | { | 3189 | { |
3160 | 3183 | FILE *f = fopen ("conftest.out", "w"); | ||
3161 | 3184 | return ferror (f) || fclose (f) != 0; | ||
3162 | 3185 | 3190 | ||
3163 | 3186 | ; | 3191 | ; |
3164 | 3187 | return 0; | 3192 | return 0; |
3165 | 3188 | } | 3193 | } |
3166 | 3189 | _ACEOF | 3194 | _ACEOF |
3167 | 3190 | ac_clean_files_save=$ac_clean_files | 3195 | ac_clean_files_save=$ac_clean_files |
3169 | 3191 | ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" | 3196 | ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" |
3170 | 3192 | # Try to create an executable without -o first, disregard a.out. | 3197 | # Try to create an executable without -o first, disregard a.out. |
3171 | 3193 | # It will help us diagnose broken compilers, and finding out an intuition | 3198 | # It will help us diagnose broken compilers, and finding out an intuition |
3172 | 3194 | # of exeext. | 3199 | # of exeext. |
3175 | 3195 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 | 3200 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 |
3176 | 3196 | $as_echo_n "checking for C compiler default output file name... " >&6; } | 3201 | $as_echo_n "checking whether the C compiler works... " >&6; } |
3177 | 3197 | ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` | 3202 | ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` |
3178 | 3198 | 3203 | ||
3179 | 3199 | # The possible output files: | 3204 | # The possible output files: |
3180 | @@ -3255,10 +3260,10 @@ | |||
3181 | 3255 | else | 3260 | else |
3182 | 3256 | ac_file='' | 3261 | ac_file='' |
3183 | 3257 | fi | 3262 | fi |
3184 | 3258 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 | ||
3185 | 3259 | $as_echo "$ac_file" >&6; } | ||
3186 | 3260 | if test -z "$ac_file"; then : | 3263 | if test -z "$ac_file"; then : |
3188 | 3261 | $as_echo "$as_me: failed program was:" >&5 | 3264 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
3189 | 3265 | $as_echo "no" >&6; } | ||
3190 | 3266 | $as_echo "$as_me: failed program was:" >&5 | ||
3191 | 3262 | sed 's/^/| /' conftest.$ac_ext >&5 | 3267 | sed 's/^/| /' conftest.$ac_ext >&5 |
3192 | 3263 | 3268 | ||
3193 | 3264 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | 3269 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
3194 | @@ -3266,51 +3271,18 @@ | |||
3195 | 3266 | { as_fn_set_status 77 | 3271 | { as_fn_set_status 77 |
3196 | 3267 | as_fn_error "C compiler cannot create executables | 3272 | as_fn_error "C compiler cannot create executables |
3197 | 3268 | See \`config.log' for more details." "$LINENO" 5; }; } | 3273 | See \`config.log' for more details." "$LINENO" 5; }; } |
3198 | 3274 | else | ||
3199 | 3275 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
3200 | 3276 | $as_echo "yes" >&6; } | ||
3201 | 3269 | fi | 3277 | fi |
3202 | 3278 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 | ||
3203 | 3279 | $as_echo_n "checking for C compiler default output file name... " >&6; } | ||
3204 | 3280 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 | ||
3205 | 3281 | $as_echo "$ac_file" >&6; } | ||
3206 | 3270 | ac_exeext=$ac_cv_exeext | 3282 | ac_exeext=$ac_cv_exeext |
3207 | 3271 | 3283 | ||
3242 | 3272 | # Check that the compiler produces executables we can run. If not, either | 3284 | rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out |
3209 | 3273 | # the compiler is broken, or we cross compile. | ||
3210 | 3274 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 | ||
3211 | 3275 | $as_echo_n "checking whether the C compiler works... " >&6; } | ||
3212 | 3276 | # If not cross compiling, check that we can run a simple program. | ||
3213 | 3277 | if test "$cross_compiling" != yes; then | ||
3214 | 3278 | if { ac_try='./$ac_file' | ||
3215 | 3279 | { { case "(($ac_try" in | ||
3216 | 3280 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | ||
3217 | 3281 | *) ac_try_echo=$ac_try;; | ||
3218 | 3282 | esac | ||
3219 | 3283 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | ||
3220 | 3284 | $as_echo "$ac_try_echo"; } >&5 | ||
3221 | 3285 | (eval "$ac_try") 2>&5 | ||
3222 | 3286 | ac_status=$? | ||
3223 | 3287 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | ||
3224 | 3288 | test $ac_status = 0; }; }; then | ||
3225 | 3289 | cross_compiling=no | ||
3226 | 3290 | else | ||
3227 | 3291 | if test "$cross_compiling" = maybe; then | ||
3228 | 3292 | cross_compiling=yes | ||
3229 | 3293 | else | ||
3230 | 3294 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | ||
3231 | 3295 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | ||
3232 | 3296 | as_fn_error "cannot run C compiled programs. | ||
3233 | 3297 | If you meant to cross compile, use \`--host'. | ||
3234 | 3298 | See \`config.log' for more details." "$LINENO" 5; } | ||
3235 | 3299 | fi | ||
3236 | 3300 | fi | ||
3237 | 3301 | fi | ||
3238 | 3302 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
3239 | 3303 | $as_echo "yes" >&6; } | ||
3240 | 3304 | |||
3241 | 3305 | rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out | ||
3243 | 3306 | ac_clean_files=$ac_clean_files_save | 3285 | ac_clean_files=$ac_clean_files_save |
3244 | 3307 | # Check that the compiler produces executables we can run. If not, either | ||
3245 | 3308 | # the compiler is broken, or we cross compile. | ||
3246 | 3309 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 | ||
3247 | 3310 | $as_echo_n "checking whether we are cross compiling... " >&6; } | ||
3248 | 3311 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 | ||
3249 | 3312 | $as_echo "$cross_compiling" >&6; } | ||
3250 | 3313 | |||
3251 | 3314 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 | 3286 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 |
3252 | 3315 | $as_echo_n "checking for suffix of executables... " >&6; } | 3287 | $as_echo_n "checking for suffix of executables... " >&6; } |
3253 | 3316 | if { { ac_try="$ac_link" | 3288 | if { { ac_try="$ac_link" |
3254 | @@ -3343,13 +3315,72 @@ | |||
3255 | 3343 | as_fn_error "cannot compute suffix of executables: cannot compile and link | 3315 | as_fn_error "cannot compute suffix of executables: cannot compile and link |
3256 | 3344 | See \`config.log' for more details." "$LINENO" 5; } | 3316 | See \`config.log' for more details." "$LINENO" 5; } |
3257 | 3345 | fi | 3317 | fi |
3259 | 3346 | rm -f conftest$ac_cv_exeext | 3318 | rm -f conftest conftest$ac_cv_exeext |
3260 | 3347 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 | 3319 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 |
3261 | 3348 | $as_echo "$ac_cv_exeext" >&6; } | 3320 | $as_echo "$ac_cv_exeext" >&6; } |
3262 | 3349 | 3321 | ||
3263 | 3350 | rm -f conftest.$ac_ext | 3322 | rm -f conftest.$ac_ext |
3264 | 3351 | EXEEXT=$ac_cv_exeext | 3323 | EXEEXT=$ac_cv_exeext |
3265 | 3352 | ac_exeext=$EXEEXT | 3324 | ac_exeext=$EXEEXT |
3266 | 3325 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
3267 | 3326 | /* end confdefs.h. */ | ||
3268 | 3327 | #include <stdio.h> | ||
3269 | 3328 | int | ||
3270 | 3329 | main () | ||
3271 | 3330 | { | ||
3272 | 3331 | FILE *f = fopen ("conftest.out", "w"); | ||
3273 | 3332 | return ferror (f) || fclose (f) != 0; | ||
3274 | 3333 | |||
3275 | 3334 | ; | ||
3276 | 3335 | return 0; | ||
3277 | 3336 | } | ||
3278 | 3337 | _ACEOF | ||
3279 | 3338 | ac_clean_files="$ac_clean_files conftest.out" | ||
3280 | 3339 | # Check that the compiler produces executables we can run. If not, either | ||
3281 | 3340 | # the compiler is broken, or we cross compile. | ||
3282 | 3341 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 | ||
3283 | 3342 | $as_echo_n "checking whether we are cross compiling... " >&6; } | ||
3284 | 3343 | if test "$cross_compiling" != yes; then | ||
3285 | 3344 | { { ac_try="$ac_link" | ||
3286 | 3345 | case "(($ac_try" in | ||
3287 | 3346 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | ||
3288 | 3347 | *) ac_try_echo=$ac_try;; | ||
3289 | 3348 | esac | ||
3290 | 3349 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | ||
3291 | 3350 | $as_echo "$ac_try_echo"; } >&5 | ||
3292 | 3351 | (eval "$ac_link") 2>&5 | ||
3293 | 3352 | ac_status=$? | ||
3294 | 3353 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | ||
3295 | 3354 | test $ac_status = 0; } | ||
3296 | 3355 | if { ac_try='./conftest$ac_cv_exeext' | ||
3297 | 3356 | { { case "(($ac_try" in | ||
3298 | 3357 | *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; | ||
3299 | 3358 | *) ac_try_echo=$ac_try;; | ||
3300 | 3359 | esac | ||
3301 | 3360 | eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" | ||
3302 | 3361 | $as_echo "$ac_try_echo"; } >&5 | ||
3303 | 3362 | (eval "$ac_try") 2>&5 | ||
3304 | 3363 | ac_status=$? | ||
3305 | 3364 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | ||
3306 | 3365 | test $ac_status = 0; }; }; then | ||
3307 | 3366 | cross_compiling=no | ||
3308 | 3367 | else | ||
3309 | 3368 | if test "$cross_compiling" = maybe; then | ||
3310 | 3369 | cross_compiling=yes | ||
3311 | 3370 | else | ||
3312 | 3371 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | ||
3313 | 3372 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | ||
3314 | 3373 | as_fn_error "cannot run C compiled programs. | ||
3315 | 3374 | If you meant to cross compile, use \`--host'. | ||
3316 | 3375 | See \`config.log' for more details." "$LINENO" 5; } | ||
3317 | 3376 | fi | ||
3318 | 3377 | fi | ||
3319 | 3378 | fi | ||
3320 | 3379 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 | ||
3321 | 3380 | $as_echo "$cross_compiling" >&6; } | ||
3322 | 3381 | |||
3323 | 3382 | rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out | ||
3324 | 3383 | ac_clean_files=$ac_clean_files_save | ||
3325 | 3353 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 | 3384 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 |
3326 | 3354 | $as_echo_n "checking for suffix of object files... " >&6; } | 3385 | $as_echo_n "checking for suffix of object files... " >&6; } |
3327 | 3355 | if test "${ac_cv_objext+set}" = set; then : | 3386 | if test "${ac_cv_objext+set}" = set; then : |
3328 | @@ -4119,8 +4150,8 @@ | |||
3329 | 4119 | ... rest of stderr output deleted ... | 4150 | ... rest of stderr output deleted ... |
3330 | 4120 | 10q' conftest.err >conftest.er1 | 4151 | 10q' conftest.err >conftest.er1 |
3331 | 4121 | cat conftest.er1 >&5 | 4152 | cat conftest.er1 >&5 |
3332 | 4122 | rm -f conftest.er1 conftest.err | ||
3333 | 4123 | fi | 4153 | fi |
3334 | 4154 | rm -f conftest.er1 conftest.err | ||
3335 | 4124 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | 4155 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
3336 | 4125 | test $ac_status = 0; } | 4156 | test $ac_status = 0; } |
3337 | 4126 | done | 4157 | done |
3338 | @@ -4472,8 +4503,8 @@ | |||
3339 | 4472 | 4503 | ||
3340 | 4473 | 4504 | ||
3341 | 4474 | 4505 | ||
3344 | 4475 | macro_version='2.2.6' | 4506 | macro_version='2.2.6b' |
3345 | 4476 | macro_revision='1.3012' | 4507 | macro_revision='1.3017' |
3346 | 4477 | 4508 | ||
3347 | 4478 | 4509 | ||
3348 | 4479 | 4510 | ||
3349 | @@ -5144,13 +5175,13 @@ | |||
3350 | 5144 | else | 5175 | else |
3351 | 5145 | lt_cv_nm_interface="BSD nm" | 5176 | lt_cv_nm_interface="BSD nm" |
3352 | 5146 | echo "int some_variable = 0;" > conftest.$ac_ext | 5177 | echo "int some_variable = 0;" > conftest.$ac_ext |
3354 | 5147 | (eval echo "\"\$as_me:5147: $ac_compile\"" >&5) | 5178 | (eval echo "\"\$as_me:5178: $ac_compile\"" >&5) |
3355 | 5148 | (eval "$ac_compile" 2>conftest.err) | 5179 | (eval "$ac_compile" 2>conftest.err) |
3356 | 5149 | cat conftest.err >&5 | 5180 | cat conftest.err >&5 |
3358 | 5150 | (eval echo "\"\$as_me:5150: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | 5181 | (eval echo "\"\$as_me:5181: $NM \\\"conftest.$ac_objext\\\"\"" >&5) |
3359 | 5151 | (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) | 5182 | (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) |
3360 | 5152 | cat conftest.err >&5 | 5183 | cat conftest.err >&5 |
3362 | 5153 | (eval echo "\"\$as_me:5153: output\"" >&5) | 5184 | (eval echo "\"\$as_me:5184: output\"" >&5) |
3363 | 5154 | cat conftest.out >&5 | 5185 | cat conftest.out >&5 |
3364 | 5155 | if $GREP 'External.*some_variable' conftest.out > /dev/null; then | 5186 | if $GREP 'External.*some_variable' conftest.out > /dev/null; then |
3365 | 5156 | lt_cv_nm_interface="MS dumpbin" | 5187 | lt_cv_nm_interface="MS dumpbin" |
3366 | @@ -5616,7 +5647,7 @@ | |||
3367 | 5616 | ;; | 5647 | ;; |
3368 | 5617 | 5648 | ||
3369 | 5618 | # This must be Linux ELF. | 5649 | # This must be Linux ELF. |
3371 | 5619 | linux* | k*bsd*-gnu) | 5650 | linux* | k*bsd*-gnu | kopensolaris*-gnu) |
3372 | 5620 | lt_cv_deplibs_check_method=pass_all | 5651 | lt_cv_deplibs_check_method=pass_all |
3373 | 5621 | ;; | 5652 | ;; |
3374 | 5622 | 5653 | ||
3375 | @@ -6355,7 +6386,7 @@ | |||
3376 | 6355 | ;; | 6386 | ;; |
3377 | 6356 | *-*-irix6*) | 6387 | *-*-irix6*) |
3378 | 6357 | # Find out which ABI we are using. | 6388 | # Find out which ABI we are using. |
3380 | 6358 | echo '#line 6358 "configure"' > conftest.$ac_ext | 6389 | echo '#line 6389 "configure"' > conftest.$ac_ext |
3381 | 6359 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 | 6390 | if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 |
3382 | 6360 | (eval $ac_compile) 2>&5 | 6391 | (eval $ac_compile) 2>&5 |
3383 | 6361 | ac_status=$? | 6392 | ac_status=$? |
3384 | @@ -7885,11 +7916,11 @@ | |||
3385 | 7885 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | 7916 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
3386 | 7886 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | 7917 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
3387 | 7887 | -e 's:$: $lt_compiler_flag:'` | 7918 | -e 's:$: $lt_compiler_flag:'` |
3389 | 7888 | (eval echo "\"\$as_me:7888: $lt_compile\"" >&5) | 7919 | (eval echo "\"\$as_me:7919: $lt_compile\"" >&5) |
3390 | 7889 | (eval "$lt_compile" 2>conftest.err) | 7920 | (eval "$lt_compile" 2>conftest.err) |
3391 | 7890 | ac_status=$? | 7921 | ac_status=$? |
3392 | 7891 | cat conftest.err >&5 | 7922 | cat conftest.err >&5 |
3394 | 7892 | echo "$as_me:7892: \$? = $ac_status" >&5 | 7923 | echo "$as_me:7923: \$? = $ac_status" >&5 |
3395 | 7893 | if (exit $ac_status) && test -s "$ac_outfile"; then | 7924 | if (exit $ac_status) && test -s "$ac_outfile"; then |
3396 | 7894 | # The compiler can only warn and ignore the option if not recognized | 7925 | # The compiler can only warn and ignore the option if not recognized |
3397 | 7895 | # So say no if there are warnings other than the usual output. | 7926 | # So say no if there are warnings other than the usual output. |
3398 | @@ -8054,7 +8085,7 @@ | |||
3399 | 8054 | lt_prog_compiler_static='-non_shared' | 8085 | lt_prog_compiler_static='-non_shared' |
3400 | 8055 | ;; | 8086 | ;; |
3401 | 8056 | 8087 | ||
3403 | 8057 | linux* | k*bsd*-gnu) | 8088 | linux* | k*bsd*-gnu | kopensolaris*-gnu) |
3404 | 8058 | case $cc_basename in | 8089 | case $cc_basename in |
3405 | 8059 | # old Intel for x86_64 which still supported -KPIC. | 8090 | # old Intel for x86_64 which still supported -KPIC. |
3406 | 8060 | ecc*) | 8091 | ecc*) |
3407 | @@ -8224,11 +8255,11 @@ | |||
3408 | 8224 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | 8255 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
3409 | 8225 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | 8256 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
3410 | 8226 | -e 's:$: $lt_compiler_flag:'` | 8257 | -e 's:$: $lt_compiler_flag:'` |
3412 | 8227 | (eval echo "\"\$as_me:8227: $lt_compile\"" >&5) | 8258 | (eval echo "\"\$as_me:8258: $lt_compile\"" >&5) |
3413 | 8228 | (eval "$lt_compile" 2>conftest.err) | 8259 | (eval "$lt_compile" 2>conftest.err) |
3414 | 8229 | ac_status=$? | 8260 | ac_status=$? |
3415 | 8230 | cat conftest.err >&5 | 8261 | cat conftest.err >&5 |
3417 | 8231 | echo "$as_me:8231: \$? = $ac_status" >&5 | 8262 | echo "$as_me:8262: \$? = $ac_status" >&5 |
3418 | 8232 | if (exit $ac_status) && test -s "$ac_outfile"; then | 8263 | if (exit $ac_status) && test -s "$ac_outfile"; then |
3419 | 8233 | # The compiler can only warn and ignore the option if not recognized | 8264 | # The compiler can only warn and ignore the option if not recognized |
3420 | 8234 | # So say no if there are warnings other than the usual output. | 8265 | # So say no if there are warnings other than the usual output. |
3421 | @@ -8329,11 +8360,11 @@ | |||
3422 | 8329 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | 8360 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
3423 | 8330 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | 8361 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
3424 | 8331 | -e 's:$: $lt_compiler_flag:'` | 8362 | -e 's:$: $lt_compiler_flag:'` |
3426 | 8332 | (eval echo "\"\$as_me:8332: $lt_compile\"" >&5) | 8363 | (eval echo "\"\$as_me:8363: $lt_compile\"" >&5) |
3427 | 8333 | (eval "$lt_compile" 2>out/conftest.err) | 8364 | (eval "$lt_compile" 2>out/conftest.err) |
3428 | 8334 | ac_status=$? | 8365 | ac_status=$? |
3429 | 8335 | cat out/conftest.err >&5 | 8366 | cat out/conftest.err >&5 |
3431 | 8336 | echo "$as_me:8336: \$? = $ac_status" >&5 | 8367 | echo "$as_me:8367: \$? = $ac_status" >&5 |
3432 | 8337 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | 8368 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
3433 | 8338 | then | 8369 | then |
3434 | 8339 | # The compiler can only warn and ignore the option if not recognized | 8370 | # The compiler can only warn and ignore the option if not recognized |
3435 | @@ -8384,11 +8415,11 @@ | |||
3436 | 8384 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | 8415 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
3437 | 8385 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | 8416 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
3438 | 8386 | -e 's:$: $lt_compiler_flag:'` | 8417 | -e 's:$: $lt_compiler_flag:'` |
3440 | 8387 | (eval echo "\"\$as_me:8387: $lt_compile\"" >&5) | 8418 | (eval echo "\"\$as_me:8418: $lt_compile\"" >&5) |
3441 | 8388 | (eval "$lt_compile" 2>out/conftest.err) | 8419 | (eval "$lt_compile" 2>out/conftest.err) |
3442 | 8389 | ac_status=$? | 8420 | ac_status=$? |
3443 | 8390 | cat out/conftest.err >&5 | 8421 | cat out/conftest.err >&5 |
3445 | 8391 | echo "$as_me:8391: \$? = $ac_status" >&5 | 8422 | echo "$as_me:8422: \$? = $ac_status" >&5 |
3446 | 8392 | if (exit $ac_status) && test -s out/conftest2.$ac_objext | 8423 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
3447 | 8393 | then | 8424 | then |
3448 | 8394 | # The compiler can only warn and ignore the option if not recognized | 8425 | # The compiler can only warn and ignore the option if not recognized |
3449 | @@ -8527,6 +8558,7 @@ | |||
3450 | 8527 | fi | 8558 | fi |
3451 | 8528 | supports_anon_versioning=no | 8559 | supports_anon_versioning=no |
3452 | 8529 | case `$LD -v 2>&1` in | 8560 | case `$LD -v 2>&1` in |
3453 | 8561 | *GNU\ gold*) supports_anon_versioning=yes ;; | ||
3454 | 8530 | *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 | 8562 | *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 |
3455 | 8531 | *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... | 8563 | *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... |
3456 | 8532 | *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... | 8564 | *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... |
3457 | @@ -8618,7 +8650,7 @@ | |||
3458 | 8618 | archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' | 8650 | archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' |
3459 | 8619 | ;; | 8651 | ;; |
3460 | 8620 | 8652 | ||
3462 | 8621 | gnu* | linux* | tpf* | k*bsd*-gnu) | 8653 | gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) |
3463 | 8622 | tmp_diet=no | 8654 | tmp_diet=no |
3464 | 8623 | if test "$host_os" = linux-dietlibc; then | 8655 | if test "$host_os" = linux-dietlibc; then |
3465 | 8624 | case $cc_basename in | 8656 | case $cc_basename in |
3466 | @@ -10080,7 +10112,7 @@ | |||
3467 | 10080 | ;; | 10112 | ;; |
3468 | 10081 | 10113 | ||
3469 | 10082 | # This must be Linux ELF. | 10114 | # This must be Linux ELF. |
3471 | 10083 | linux* | k*bsd*-gnu) | 10115 | linux* | k*bsd*-gnu | kopensolaris*-gnu) |
3472 | 10084 | version_type=linux | 10116 | version_type=linux |
3473 | 10085 | need_lib_prefix=no | 10117 | need_lib_prefix=no |
3474 | 10086 | need_version=no | 10118 | need_version=no |
3475 | @@ -10767,7 +10799,7 @@ | |||
3476 | 10767 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | 10799 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
3477 | 10768 | lt_status=$lt_dlunknown | 10800 | lt_status=$lt_dlunknown |
3478 | 10769 | cat > conftest.$ac_ext <<_LT_EOF | 10801 | cat > conftest.$ac_ext <<_LT_EOF |
3480 | 10770 | #line 10770 "configure" | 10802 | #line 10802 "configure" |
3481 | 10771 | #include "confdefs.h" | 10803 | #include "confdefs.h" |
3482 | 10772 | 10804 | ||
3483 | 10773 | #if HAVE_DLFCN_H | 10805 | #if HAVE_DLFCN_H |
3484 | @@ -10863,7 +10895,7 @@ | |||
3485 | 10863 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | 10895 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
3486 | 10864 | lt_status=$lt_dlunknown | 10896 | lt_status=$lt_dlunknown |
3487 | 10865 | cat > conftest.$ac_ext <<_LT_EOF | 10897 | cat > conftest.$ac_ext <<_LT_EOF |
3489 | 10866 | #line 10866 "configure" | 10898 | #line 10898 "configure" |
3490 | 10867 | #include "confdefs.h" | 10899 | #include "confdefs.h" |
3491 | 10868 | 10900 | ||
3492 | 10869 | #if HAVE_DLFCN_H | 10901 | #if HAVE_DLFCN_H |
3493 | @@ -11893,6 +11925,37 @@ | |||
3494 | 11893 | fi | 11925 | fi |
3495 | 11894 | 11926 | ||
3496 | 11895 | 11927 | ||
3497 | 11928 | # Alter default logging if we're development vs. stable | ||
3498 | 11929 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking development series build" >&5 | ||
3499 | 11930 | $as_echo_n "checking development series build... " >&6; } | ||
3500 | 11931 | DEVVERSION="`echo $PACKAGE_VERSION|cut -d. -f2`" | ||
3501 | 11932 | if expr $DEVVERSION % 2 > /dev/null != "0"; then | ||
3502 | 11933 | debugging=yes | ||
3503 | 11934 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
3504 | 11935 | $as_echo "yes" >&6; } | ||
3505 | 11936 | else | ||
3506 | 11937 | debugging=no | ||
3507 | 11938 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
3508 | 11939 | $as_echo "no" >&6; } | ||
3509 | 11940 | fi | ||
3510 | 11941 | |||
3511 | 11942 | # Check whether --enable-debug was given. | ||
3512 | 11943 | if test "${enable_debug+set}" = set; then : | ||
3513 | 11944 | enableval=$enable_debug; enable_debug=$enableval | ||
3514 | 11945 | else | ||
3515 | 11946 | enable_debug=$debugging | ||
3516 | 11947 | fi | ||
3517 | 11948 | |||
3518 | 11949 | if test "x$enable_debug" != "xno"; then | ||
3519 | 11950 | LOG_LEVEL="DEBUG" | ||
3520 | 11951 | LOG_FILE_SIZE="10485760" | ||
3521 | 11952 | else | ||
3522 | 11953 | LOG_LEVEL="INFO" | ||
3523 | 11954 | LOG_FILE_SIZE="1048576" | ||
3524 | 11955 | fi | ||
3525 | 11956 | |||
3526 | 11957 | |||
3527 | 11958 | |||
3528 | 11896 | # Check for python 2.5 | 11959 | # Check for python 2.5 |
3529 | 11897 | 11960 | ||
3530 | 11898 | 11961 | ||
3531 | @@ -12058,6 +12121,14 @@ | |||
3532 | 12058 | am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` | 12121 | am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` |
3533 | 12059 | am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` | 12122 | am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` |
3534 | 12060 | ;; | 12123 | ;; |
3535 | 12124 | *) | ||
3536 | 12125 | case $am_py_prefix in | ||
3537 | 12126 | /usr|/System*) ;; | ||
3538 | 12127 | *) | ||
3539 | 12128 | am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages | ||
3540 | 12129 | ;; | ||
3541 | 12130 | esac | ||
3542 | 12131 | ;; | ||
3543 | 12061 | esac | 12132 | esac |
3544 | 12062 | 12133 | ||
3545 | 12063 | fi | 12134 | fi |
3546 | @@ -12088,6 +12159,14 @@ | |||
3547 | 12088 | am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` | 12159 | am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` |
3548 | 12089 | am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` | 12160 | am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` |
3549 | 12090 | ;; | 12161 | ;; |
3550 | 12162 | *) | ||
3551 | 12163 | case $am_py_exec_prefix in | ||
3552 | 12164 | /usr|/System*) ;; | ||
3553 | 12165 | *) | ||
3554 | 12166 | am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages | ||
3555 | 12167 | ;; | ||
3556 | 12168 | esac | ||
3557 | 12169 | ;; | ||
3558 | 12091 | esac | 12170 | esac |
3559 | 12092 | 12171 | ||
3560 | 12093 | fi | 12172 | fi |
3561 | @@ -12167,12 +12246,12 @@ | |||
3562 | 12167 | pkg_cv_NAUTILUS_CFLAGS="$NAUTILUS_CFLAGS" | 12246 | pkg_cv_NAUTILUS_CFLAGS="$NAUTILUS_CFLAGS" |
3563 | 12168 | else | 12247 | else |
3564 | 12169 | if test -n "$PKG_CONFIG" && \ | 12248 | if test -n "$PKG_CONFIG" && \ |
3567 | 12170 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnautilus-extension >= 2.6.0\""; } >&5 | 12249 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnautilus-extension >= 2.6.0 libebook-1.2 gconf-2.0\""; } >&5 |
3568 | 12171 | ($PKG_CONFIG --exists --print-errors "libnautilus-extension >= 2.6.0") 2>&5 | 12250 | ($PKG_CONFIG --exists --print-errors "libnautilus-extension >= 2.6.0 libebook-1.2 gconf-2.0") 2>&5 |
3569 | 12172 | ac_status=$? | 12251 | ac_status=$? |
3570 | 12173 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | 12252 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
3571 | 12174 | test $ac_status = 0; }; then | 12253 | test $ac_status = 0; }; then |
3573 | 12175 | pkg_cv_NAUTILUS_CFLAGS=`$PKG_CONFIG --cflags "libnautilus-extension >= 2.6.0" 2>/dev/null` | 12254 | pkg_cv_NAUTILUS_CFLAGS=`$PKG_CONFIG --cflags "libnautilus-extension >= 2.6.0 libebook-1.2 gconf-2.0" 2>/dev/null` |
3574 | 12176 | else | 12255 | else |
3575 | 12177 | pkg_failed=yes | 12256 | pkg_failed=yes |
3576 | 12178 | fi | 12257 | fi |
3577 | @@ -12185,12 +12264,12 @@ | |||
3578 | 12185 | pkg_cv_NAUTILUS_LIBS="$NAUTILUS_LIBS" | 12264 | pkg_cv_NAUTILUS_LIBS="$NAUTILUS_LIBS" |
3579 | 12186 | else | 12265 | else |
3580 | 12187 | if test -n "$PKG_CONFIG" && \ | 12266 | if test -n "$PKG_CONFIG" && \ |
3583 | 12188 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnautilus-extension >= 2.6.0\""; } >&5 | 12267 | { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnautilus-extension >= 2.6.0 libebook-1.2 gconf-2.0\""; } >&5 |
3584 | 12189 | ($PKG_CONFIG --exists --print-errors "libnautilus-extension >= 2.6.0") 2>&5 | 12268 | ($PKG_CONFIG --exists --print-errors "libnautilus-extension >= 2.6.0 libebook-1.2 gconf-2.0") 2>&5 |
3585 | 12190 | ac_status=$? | 12269 | ac_status=$? |
3586 | 12191 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 | 12270 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
3587 | 12192 | test $ac_status = 0; }; then | 12271 | test $ac_status = 0; }; then |
3589 | 12193 | pkg_cv_NAUTILUS_LIBS=`$PKG_CONFIG --libs "libnautilus-extension >= 2.6.0" 2>/dev/null` | 12272 | pkg_cv_NAUTILUS_LIBS=`$PKG_CONFIG --libs "libnautilus-extension >= 2.6.0 libebook-1.2 gconf-2.0" 2>/dev/null` |
3590 | 12194 | else | 12273 | else |
3591 | 12195 | pkg_failed=yes | 12274 | pkg_failed=yes |
3592 | 12196 | fi | 12275 | fi |
3593 | @@ -12209,14 +12288,14 @@ | |||
3594 | 12209 | _pkg_short_errors_supported=no | 12288 | _pkg_short_errors_supported=no |
3595 | 12210 | fi | 12289 | fi |
3596 | 12211 | if test $_pkg_short_errors_supported = yes; then | 12290 | if test $_pkg_short_errors_supported = yes; then |
3598 | 12212 | NAUTILUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libnautilus-extension >= 2.6.0"` | 12291 | NAUTILUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libnautilus-extension >= 2.6.0 libebook-1.2 gconf-2.0"` |
3599 | 12213 | else | 12292 | else |
3601 | 12214 | NAUTILUS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libnautilus-extension >= 2.6.0"` | 12293 | NAUTILUS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libnautilus-extension >= 2.6.0 libebook-1.2 gconf-2.0"` |
3602 | 12215 | fi | 12294 | fi |
3603 | 12216 | # Put the nasty error message in config.log where it belongs | 12295 | # Put the nasty error message in config.log where it belongs |
3604 | 12217 | echo "$NAUTILUS_PKG_ERRORS" >&5 | 12296 | echo "$NAUTILUS_PKG_ERRORS" >&5 |
3605 | 12218 | 12297 | ||
3607 | 12219 | as_fn_error "Package requirements (libnautilus-extension >= 2.6.0) were not met: | 12298 | as_fn_error "Package requirements (libnautilus-extension >= 2.6.0 libebook-1.2 gconf-2.0) were not met: |
3608 | 12220 | 12299 | ||
3609 | 12221 | $NAUTILUS_PKG_ERRORS | 12300 | $NAUTILUS_PKG_ERRORS |
3610 | 12222 | 12301 | ||
3611 | @@ -12893,8 +12972,8 @@ | |||
3612 | 12893 | # report actual input values of CONFIG_FILES etc. instead of their | 12972 | # report actual input values of CONFIG_FILES etc. instead of their |
3613 | 12894 | # values after options handling. | 12973 | # values after options handling. |
3614 | 12895 | ac_log=" | 12974 | ac_log=" |
3617 | 12896 | This file was extended by ubuntuone-client $as_me 1.1.0, which was | 12975 | This file was extended by ubuntuone-client $as_me 1.1.2, which was |
3618 | 12897 | generated by GNU Autoconf 2.64. Invocation command line was | 12976 | generated by GNU Autoconf 2.65. Invocation command line was |
3619 | 12898 | 12977 | ||
3620 | 12899 | CONFIG_FILES = $CONFIG_FILES | 12978 | CONFIG_FILES = $CONFIG_FILES |
3621 | 12900 | CONFIG_HEADERS = $CONFIG_HEADERS | 12979 | CONFIG_HEADERS = $CONFIG_HEADERS |
3622 | @@ -12934,6 +13013,7 @@ | |||
3623 | 12934 | 13013 | ||
3624 | 12935 | -h, --help print this help, then exit | 13014 | -h, --help print this help, then exit |
3625 | 12936 | -V, --version print version number and configuration settings, then exit | 13015 | -V, --version print version number and configuration settings, then exit |
3626 | 13016 | --config print configuration, then exit | ||
3627 | 12937 | -q, --quiet, --silent | 13017 | -q, --quiet, --silent |
3628 | 12938 | do not print progress messages | 13018 | do not print progress messages |
3629 | 12939 | -d, --debug don't remove temporary files | 13019 | -d, --debug don't remove temporary files |
3630 | @@ -12956,10 +13036,11 @@ | |||
3631 | 12956 | 13036 | ||
3632 | 12957 | _ACEOF | 13037 | _ACEOF |
3633 | 12958 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | 13038 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
3634 | 13039 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" | ||
3635 | 12959 | ac_cs_version="\\ | 13040 | ac_cs_version="\\ |
3639 | 12960 | ubuntuone-client config.status 1.1.0 | 13041 | ubuntuone-client config.status 1.1.2 |
3640 | 12961 | configured by $0, generated by GNU Autoconf 2.64, | 13042 | configured by $0, generated by GNU Autoconf 2.65, |
3641 | 12962 | with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" | 13043 | with options \\"\$ac_cs_config\\" |
3642 | 12963 | 13044 | ||
3643 | 12964 | Copyright (C) 2009 Free Software Foundation, Inc. | 13045 | Copyright (C) 2009 Free Software Foundation, Inc. |
3644 | 12965 | This config.status script is free software; the Free Software Foundation | 13046 | This config.status script is free software; the Free Software Foundation |
3645 | @@ -12997,6 +13078,8 @@ | |||
3646 | 12997 | ac_cs_recheck=: ;; | 13078 | ac_cs_recheck=: ;; |
3647 | 12998 | --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) | 13079 | --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) |
3648 | 12999 | $as_echo "$ac_cs_version"; exit ;; | 13080 | $as_echo "$ac_cs_version"; exit ;; |
3649 | 13081 | --config | --confi | --conf | --con | --co | --c ) | ||
3650 | 13082 | $as_echo "$ac_cs_config"; exit ;; | ||
3651 | 13000 | --debug | --debu | --deb | --de | --d | -d ) | 13083 | --debug | --debu | --deb | --de | --d | -d ) |
3652 | 13001 | debug=: ;; | 13084 | debug=: ;; |
3653 | 13002 | --file | --fil | --fi | --f ) | 13085 | --file | --fil | --fi | --f ) |
3654 | @@ -13444,7 +13527,7 @@ | |||
3655 | 13444 | t delim | 13527 | t delim |
3656 | 13445 | :nl | 13528 | :nl |
3657 | 13446 | h | 13529 | h |
3659 | 13447 | s/\(.\{148\}\).*/\1/ | 13530 | s/\(.\{148\}\)..*/\1/ |
3660 | 13448 | t more1 | 13531 | t more1 |
3661 | 13449 | s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ | 13532 | s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ |
3662 | 13450 | p | 13533 | p |
3663 | @@ -13458,7 +13541,7 @@ | |||
3664 | 13458 | t nl | 13541 | t nl |
3665 | 13459 | :delim | 13542 | :delim |
3666 | 13460 | h | 13543 | h |
3668 | 13461 | s/\(.\{148\}\).*/\1/ | 13544 | s/\(.\{148\}\)..*/\1/ |
3669 | 13462 | t more2 | 13545 | t more2 |
3670 | 13463 | s/["\\]/\\&/g; s/^/"/; s/$/"/ | 13546 | s/["\\]/\\&/g; s/^/"/; s/$/"/ |
3671 | 13464 | p | 13547 | p |
3672 | 13465 | 13548 | ||
3673 | === modified file 'configure.ac' | |||
3674 | --- configure.ac 2009-12-07 17:35:00 +0000 | |||
3675 | +++ configure.ac 2010-02-18 00:10:25 +0000 | |||
3676 | @@ -1,7 +1,7 @@ | |||
3677 | 1 | dnl Process this file with autoconf to produce a configure script. | 1 | dnl Process this file with autoconf to produce a configure script. |
3678 | 2 | AC_PREREQ(2.53) | 2 | AC_PREREQ(2.53) |
3679 | 3 | 3 | ||
3681 | 4 | AC_INIT([ubuntuone-client], [1.1.0]) | 4 | AC_INIT([ubuntuone-client], [1.1.2]) |
3682 | 5 | AC_CONFIG_SRCDIR([config.h.in]) | 5 | AC_CONFIG_SRCDIR([config.h.in]) |
3683 | 6 | 6 | ||
3684 | 7 | AM_INIT_AUTOMAKE([1.10 foreign]) | 7 | AM_INIT_AUTOMAKE([1.10 foreign]) |
3685 | @@ -46,6 +46,32 @@ | |||
3686 | 46 | fi | 46 | fi |
3687 | 47 | AM_CONDITIONAL(ENABLE_RENDERING, test "x$enable_rendering" = "xyes") | 47 | AM_CONDITIONAL(ENABLE_RENDERING, test "x$enable_rendering" = "xyes") |
3688 | 48 | 48 | ||
3689 | 49 | # Alter default logging if we're development vs. stable | ||
3690 | 50 | AC_MSG_CHECKING([development series build]) | ||
3691 | 51 | DEVVERSION="`echo $PACKAGE_VERSION|cut -d. -f2`" | ||
3692 | 52 | if expr $DEVVERSION % 2 > /dev/null != "0"; then | ||
3693 | 53 | debugging=yes | ||
3694 | 54 | AC_MSG_RESULT([yes]) | ||
3695 | 55 | else | ||
3696 | 56 | debugging=no | ||
3697 | 57 | AC_MSG_RESULT([no]) | ||
3698 | 58 | fi | ||
3699 | 59 | |||
3700 | 60 | AC_ARG_ENABLE([debug], | ||
3701 | 61 | AC_HELP_STRING([--enable-debug], | ||
3702 | 62 | [Enable debug logging by default [default=auto]]), | ||
3703 | 63 | enable_debug=$enableval, | ||
3704 | 64 | enable_debug=$debugging) | ||
3705 | 65 | if test "x$enable_debug" != "xno"; then | ||
3706 | 66 | LOG_LEVEL="DEBUG" | ||
3707 | 67 | LOG_FILE_SIZE="10485760" | ||
3708 | 68 | else | ||
3709 | 69 | LOG_LEVEL="INFO" | ||
3710 | 70 | LOG_FILE_SIZE="1048576" | ||
3711 | 71 | fi | ||
3712 | 72 | AC_SUBST(LOG_LEVEL) | ||
3713 | 73 | AC_SUBST(LOG_FILE_SIZE) | ||
3714 | 74 | |||
3715 | 49 | # Check for python 2.5 | 75 | # Check for python 2.5 |
3716 | 50 | AM_PATH_PYTHON([2.5]) | 76 | AM_PATH_PYTHON([2.5]) |
3717 | 51 | 77 | ||
3718 | @@ -90,7 +116,7 @@ | |||
3719 | 90 | AC_SUBST(USP_PATH) | 116 | AC_SUBST(USP_PATH) |
3720 | 91 | 117 | ||
3721 | 92 | # Stuff we need to build the extension shlib | 118 | # Stuff we need to build the extension shlib |
3723 | 93 | PKG_CHECK_MODULES(NAUTILUS, [libnautilus-extension >= 2.6.0]) | 119 | PKG_CHECK_MODULES(NAUTILUS, [libnautilus-extension >= 2.6.0 libebook-1.2 gconf-2.0]) |
3724 | 94 | AC_SUBST(NAUTILUS_CFLAGS) | 120 | AC_SUBST(NAUTILUS_CFLAGS) |
3725 | 95 | AC_SUBST(NAUTILUS_LIBS) | 121 | AC_SUBST(NAUTILUS_LIBS) |
3726 | 96 | 122 | ||
3727 | 97 | 123 | ||
3728 | === modified file 'contrib/__init__.pyc' | |||
3729 | 98 | Binary files contrib/__init__.pyc 2009-12-07 17:35:00 +0000 and contrib/__init__.pyc 2010-02-18 00:10:25 +0000 differ | 124 | Binary files contrib/__init__.pyc 2009-12-07 17:35:00 +0000 and contrib/__init__.pyc 2010-02-18 00:10:25 +0000 differ |
3730 | === added file 'contrib/dbus-docs' | |||
3731 | --- contrib/dbus-docs 1970-01-01 00:00:00 +0000 | |||
3732 | +++ contrib/dbus-docs 2010-02-18 00:10:25 +0000 | |||
3733 | @@ -0,0 +1,196 @@ | |||
3734 | 1 | #!/usr/bin/env python | ||
3735 | 2 | # | ||
3736 | 3 | # Author: Guillermo Gonzalez <guillermo.gonzalez@canonical.com> | ||
3737 | 4 | # | ||
3738 | 5 | # Copyright 2009 Canonical Ltd. | ||
3739 | 6 | # | ||
3740 | 7 | # This program is free software: you can redistribute it and/or modify it | ||
3741 | 8 | # under the terms of the GNU General Public License version 3, as published | ||
3742 | 9 | # by the Free Software Foundation. | ||
3743 | 10 | # | ||
3744 | 11 | # This program is distributed in the hope that it will be useful, but | ||
3745 | 12 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
3746 | 13 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
3747 | 14 | # PURPOSE. See the GNU General Public License for more details. | ||
3748 | 15 | # | ||
3749 | 16 | # You should have received a copy of the GNU General Public License along | ||
3750 | 17 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3751 | 18 | |||
3752 | 19 | from twisted.internet import glib2reactor | ||
3753 | 20 | glib2reactor.install() | ||
3754 | 21 | |||
3755 | 22 | import sys | ||
3756 | 23 | import os | ||
3757 | 24 | import signal | ||
3758 | 25 | import dbus | ||
3759 | 26 | import subprocess | ||
3760 | 27 | import shutil | ||
3761 | 28 | |||
3762 | 29 | from xml.etree import ElementTree | ||
3763 | 30 | |||
3764 | 31 | sys.path.insert(0, os.path.abspath(".")) | ||
3765 | 32 | |||
3766 | 33 | from contrib.dbus_util import DBusRunner | ||
3767 | 34 | from contrib.testing.testcase import ( | ||
3768 | 35 | FakeMain, | ||
3769 | 36 | DBusGMainLoop, | ||
3770 | 37 | DBusInterface, | ||
3771 | 38 | FakeNetworkManager, | ||
3772 | 39 | ) | ||
3773 | 40 | |||
3774 | 41 | from ubuntuone.syncdaemon.dbus_interface import ( | ||
3775 | 42 | DBUS_IFACE_SYNC_NAME, | ||
3776 | 43 | DBUS_IFACE_STATUS_NAME, | ||
3777 | 44 | DBUS_IFACE_EVENTS_NAME, | ||
3778 | 45 | DBUS_IFACE_FS_NAME, | ||
3779 | 46 | DBUS_IFACE_SHARES_NAME, | ||
3780 | 47 | DBUS_IFACE_CONFIG_NAME, | ||
3781 | 48 | DBUS_IFACE_FOLDERS_NAME, | ||
3782 | 49 | ) | ||
3783 | 50 | from ubuntuone.syncdaemon.tools import DBusClient | ||
3784 | 51 | from twisted.internet import reactor, defer | ||
3785 | 52 | |||
3786 | 53 | |||
3787 | 54 | iface_path = ((DBUS_IFACE_SYNC_NAME, '/'), (DBUS_IFACE_CONFIG_NAME, '/config'), | ||
3788 | 55 | (DBUS_IFACE_EVENTS_NAME, '/events'), | ||
3789 | 56 | (DBUS_IFACE_FS_NAME, '/filesystem'), | ||
3790 | 57 | (DBUS_IFACE_SHARES_NAME, '/shares'), | ||
3791 | 58 | (DBUS_IFACE_STATUS_NAME, '/status'), | ||
3792 | 59 | (DBUS_IFACE_FOLDERS_NAME, '/folders'), | ||
3793 | 60 | ) | ||
3794 | 61 | |||
3795 | 62 | |||
3796 | 63 | def parse_introspect_data(xml): | ||
3797 | 64 | """Parse the xml returned by Introspect and returns a dict""" | ||
3798 | 65 | info = dict() | ||
3799 | 66 | e = ElementTree.fromstring(xml) | ||
3800 | 67 | for c in e.findall('interface'): | ||
3801 | 68 | # ignore other interfaces | ||
3802 | 69 | if not c.attrib['name'].startswith('com.ubuntuone'): | ||
3803 | 70 | continue | ||
3804 | 71 | iface_name = c.attrib['name'] | ||
3805 | 72 | info[iface_name] = dict() | ||
3806 | 73 | # methods | ||
3807 | 74 | methods = dict() | ||
3808 | 75 | for method in c.findall('method'): | ||
3809 | 76 | meth_name = method.attrib['name'] | ||
3810 | 77 | args = [] | ||
3811 | 78 | for arg in method.findall('arg'): | ||
3812 | 79 | dir = arg.attrib['direction'] | ||
3813 | 80 | type = arg.attrib['type'] | ||
3814 | 81 | if 'name' in arg.attrib: | ||
3815 | 82 | name = arg.attrib['name'] | ||
3816 | 83 | args.append((type, dir, name)) | ||
3817 | 84 | else: | ||
3818 | 85 | args.append((type, dir)) | ||
3819 | 86 | docstrings = method.findall('docstring') | ||
3820 | 87 | docstring = docstrings[0].text if docstrings else 'No docstring' | ||
3821 | 88 | methods[meth_name] = dict(args=args, docstring=docstring) | ||
3822 | 89 | info[iface_name]['methods'] = methods | ||
3823 | 90 | # signals | ||
3824 | 91 | signals = dict() | ||
3825 | 92 | for signal in c.findall('signal'): | ||
3826 | 93 | sig_name = signal.attrib['name'] | ||
3827 | 94 | args = [] | ||
3828 | 95 | for arg in signal.findall('arg'): | ||
3829 | 96 | type = arg.attrib['type'] | ||
3830 | 97 | name = arg.attrib['name'] | ||
3831 | 98 | args.append((type, name)) | ||
3832 | 99 | docstrings = signal.findall('docstring') | ||
3833 | 100 | docstring = docstrings[0].text if docstrings else 'No docstring' | ||
3834 | 101 | signals[sig_name] = dict(args=args, docstring=docstring) | ||
3835 | 102 | info[iface_name]['signals'] = signals | ||
3836 | 103 | return info | ||
3837 | 104 | |||
3838 | 105 | |||
3839 | 106 | def get_info(path): | ||
3840 | 107 | """Get all the introspectable info from 'path'""" | ||
3841 | 108 | d = defer.Deferred() | ||
3842 | 109 | client = DBusClient(bus, path, 'org.freedesktop.DBus.Introspectable') | ||
3843 | 110 | client.call_method('Introspect', reply_handler=d.callback, | ||
3844 | 111 | error_handler=d.errback) | ||
3845 | 112 | return d | ||
3846 | 113 | |||
3847 | 114 | |||
3848 | 115 | def dump_to_stream(info_by_path, stream): | ||
3849 | 116 | print >>stream, "SyncDaemon DBus API\n" | ||
3850 | 117 | for path, interfaces in info_by_path.items(): | ||
3851 | 118 | print >>stream, "Object path: %s" % path | ||
3852 | 119 | for iface_name, kinds in interfaces.items(): | ||
3853 | 120 | print >>stream, " Interface: %s" % iface_name | ||
3854 | 121 | print >>stream, " Methods:" | ||
3855 | 122 | for meth_name, val in kinds['methods'].items(): | ||
3856 | 123 | in_args = ','.join([arg[2] + '=' + arg[0] for arg in | ||
3857 | 124 | val['args'] if arg[1] == 'in']) | ||
3858 | 125 | out_args = ','.join([arg[0] for arg in val['args'] | ||
3859 | 126 | if arg[1] == 'out']) | ||
3860 | 127 | if out_args and in_args: | ||
3861 | 128 | print >>stream, " %s(%s) -> %s" % (meth_name, in_args, | ||
3862 | 129 | out_args) | ||
3863 | 130 | elif in_args: | ||
3864 | 131 | print >>stream, " %s(%s)" % (meth_name, in_args) | ||
3865 | 132 | else: | ||
3866 | 133 | print >>stream, " %s()" % meth_name | ||
3867 | 134 | print >>stream, " %s\n" % val['docstring'] | ||
3868 | 135 | print >>stream, " Signals:" | ||
3869 | 136 | for signal_name, val in kinds['signals'].items(): | ||
3870 | 137 | in_args = ','.join([arg[1] + '=' + arg[0] \ | ||
3871 | 138 | for arg in val['args']]) | ||
3872 | 139 | if in_args: | ||
3873 | 140 | print >>stream, " %s(%s)" % (signal_name, in_args) | ||
3874 | 141 | else: | ||
3875 | 142 | print >>stream, " %s(%s)" % signal_name | ||
3876 | 143 | print >>stream, " %s\n" % val['docstring'] | ||
3877 | 144 | |||
3878 | 145 | |||
3879 | 146 | @defer.inlineCallbacks | ||
3880 | 147 | def main(bus): | ||
3881 | 148 | """Entry point""" | ||
3882 | 149 | info_by_path = dict() | ||
3883 | 150 | for iface, path in iface_path: | ||
3884 | 151 | xml = yield get_info(path) | ||
3885 | 152 | obj_info = parse_introspect_data(xml) | ||
3886 | 153 | info_by_path[path] = obj_info | ||
3887 | 154 | dest_file = os.path.join(os.getcwd(), 'docs', 'syncdaemon_dbus_api.txt') | ||
3888 | 155 | with open(dest_file, 'w') as f: | ||
3889 | 156 | dump_to_stream(info_by_path, f) | ||
3890 | 157 | reactor.stop() | ||
3891 | 158 | |||
3892 | 159 | |||
3893 | 160 | def start_syncdaemon(tmp_dir): | ||
3894 | 161 | """Starts a syncdaemon instance just like the one used in the test suite""" | ||
3895 | 162 | xdg_cache = os.path.join(tmp_dir, 'xdg_cache') | ||
3896 | 163 | data_dir = os.path.join(xdg_cache, 'data') | ||
3897 | 164 | partials_dir = os.path.join(xdg_cache, 'partials') | ||
3898 | 165 | root_dir = os.path.join(tmp_dir, 'root') | ||
3899 | 166 | shares_dir = os.path.join(tmp_dir, 'shares') | ||
3900 | 167 | main = FakeMain(root_dir, shares_dir, data_dir, partials_dir) | ||
3901 | 168 | loop = DBusGMainLoop(set_as_default=True) | ||
3902 | 169 | bus = dbus.bus.BusConnection(mainloop=loop) | ||
3903 | 170 | nm = FakeNetworkManager(bus) | ||
3904 | 171 | dbus_iface = DBusInterface(bus, main, system_bus=bus) | ||
3905 | 172 | main.dbus_iface = dbus_iface | ||
3906 | 173 | return main, bus | ||
3907 | 174 | |||
3908 | 175 | |||
3909 | 176 | if __name__ == '__main__': | ||
3910 | 177 | dbus_runner = DBusRunner() | ||
3911 | 178 | dbus_runner.startDBus() | ||
3912 | 179 | tmp_dir = os.path.join(os.getcwd(), 'tmp') | ||
3913 | 180 | try: | ||
3914 | 181 | |||
3915 | 182 | m, bus = start_syncdaemon(tmp_dir) | ||
3916 | 183 | try: | ||
3917 | 184 | reactor.callWhenRunning(main, bus) | ||
3918 | 185 | reactor.run() | ||
3919 | 186 | finally: | ||
3920 | 187 | m.quit() | ||
3921 | 188 | finally: | ||
3922 | 189 | dbus_runner.stopDBus() | ||
3923 | 190 | # remove the tmp dir | ||
3924 | 191 | os.chmod(tmp_dir, 0777) | ||
3925 | 192 | for dirpath, dirs, _ in os.walk(tmp_dir): | ||
3926 | 193 | for dir in dirs: | ||
3927 | 194 | os.chmod(os.path.join(dirpath, dir), 0777) | ||
3928 | 195 | shutil.rmtree(tmp_dir) | ||
3929 | 196 | |||
3930 | 0 | 197 | ||
3931 | === added file 'contrib/dbus_util.py' | |||
3932 | --- contrib/dbus_util.py 1970-01-01 00:00:00 +0000 | |||
3933 | +++ contrib/dbus_util.py 2010-02-18 00:10:25 +0000 | |||
3934 | @@ -0,0 +1,72 @@ | |||
3935 | 1 | # | ||
3936 | 2 | # Author: Guillermo Gonzalez <guillermo.gonzalez@canonical.com> | ||
3937 | 3 | # | ||
3938 | 4 | # Copyright 2009 Canonical Ltd. | ||
3939 | 5 | # | ||
3940 | 6 | # This program is free software: you can redistribute it and/or modify it | ||
3941 | 7 | # under the terms of the GNU General Public License version 3, as published | ||
3942 | 8 | # by the Free Software Foundation. | ||
3943 | 9 | # | ||
3944 | 10 | # This program is distributed in the hope that it will be useful, but | ||
3945 | 11 | # WITHOUT ANY WARRANTY; without even the implied warranties of | ||
3946 | 12 | # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
3947 | 13 | # PURPOSE. See the GNU General Public License for more details. | ||
3948 | 14 | # | ||
3949 | 15 | # You should have received a copy of the GNU General Public License along | ||
3950 | 16 | # with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3951 | 17 | |||
3952 | 18 | import os | ||
3953 | 19 | import signal | ||
3954 | 20 | import subprocess | ||
3955 | 21 | |||
3956 | 22 | from distutils.spawn import find_executable | ||
3957 | 23 | |||
3958 | 24 | |||
3959 | 25 | class DBusLaunchError(Exception): | ||
3960 | 26 | """Error while launching dbus-daemon""" | ||
3961 | 27 | pass | ||
3962 | 28 | |||
3963 | 29 | class NotFoundError(Exception): | ||
3964 | 30 | """Not found error""" | ||
3965 | 31 | pass | ||
3966 | 32 | |||
3967 | 33 | |||
3968 | 34 | class DBusRunner(object): | ||
3969 | 35 | |||
3970 | 36 | def __init__(self): | ||
3971 | 37 | self.dbus_address = None | ||
3972 | 38 | self.dbus_pid = None | ||
3973 | 39 | self.running = False | ||
3974 | 40 | |||
3975 | 41 | def startDBus(self): | ||
3976 | 42 | """Start our own session bus daemon for testing.""" | ||
3977 | 43 | dbus = find_executable("dbus-daemon") | ||
3978 | 44 | if not dbus: | ||
3979 | 45 | raise NotFoundError("dbus-daemon was not found.") | ||
3980 | 46 | |||
3981 | 47 | config_file = os.path.join(os.getcwd(), "contrib", "testing", | ||
3982 | 48 | "dbus-session.conf") | ||
3983 | 49 | dbus_args = ["--fork", | ||
3984 | 50 | "--config-file=" + config_file, | ||
3985 | 51 | "--print-address=1", | ||
3986 | 52 | "--print-pid=2"] | ||
3987 | 53 | p = subprocess.Popen([dbus] + dbus_args, | ||
3988 | 54 | bufsize=4096, stdout=subprocess.PIPE, | ||
3989 | 55 | stderr=subprocess.PIPE) | ||
3990 | 56 | |||
3991 | 57 | self.dbus_address = "".join(p.stdout.readlines()).strip() | ||
3992 | 58 | self.dbus_pid = int("".join(p.stderr.readlines()).strip()) | ||
3993 | 59 | |||
3994 | 60 | if self.dbus_address != "": | ||
3995 | 61 | os.environ["DBUS_SESSION_BUS_ADDRESS"] = self.dbus_address | ||
3996 | 62 | else: | ||
3997 | 63 | os.kill(self.dbus_pid, signal.SIGKILL) | ||
3998 | 64 | raise DBusLaunchError("There was a problem launching dbus-daemon.") | ||
3999 | 65 | self.running = True | ||
4000 | 66 | |||
4001 | 67 | def stopDBus(self): | ||
4002 | 68 | """Stop our DBus session bus daemon.""" | ||
4003 | 69 | del os.environ["DBUS_SESSION_BUS_ADDRESS"] | ||
4004 | 70 | os.kill(self.dbus_pid, signal.SIGKILL) | ||
4005 | 71 | self.running = False | ||
4006 | 72 | |||
4007 | 0 | 73 | ||
4008 | === added file 'contrib/dbus_util.pyc' | |||
4009 | 1 | Binary files contrib/dbus_util.pyc 1970-01-01 00:00:00 +0000 and contrib/dbus_util.pyc 2010-02-18 00:10:25 +0000 differ | 74 | Binary files contrib/dbus_util.pyc 1970-01-01 00:00:00 +0000 and contrib/dbus_util.pyc 2010-02-18 00:10:25 +0000 differ |
4010 | === modified file 'contrib/mocker.pyc' | |||
4011 | 2 | Binary files contrib/mocker.pyc 2009-12-07 17:35:00 +0000 and contrib/mocker.pyc 2010-02-18 00:10:25 +0000 differ | 75 | Binary files contrib/mocker.pyc 2009-12-07 17:35:00 +0000 and contrib/mocker.pyc 2010-02-18 00:10:25 +0000 differ |
4012 | === modified file 'contrib/test' | |||
4013 | --- contrib/test 2009-12-07 17:35:00 +0000 | |||
4014 | +++ contrib/test 2010-02-18 00:10:25 +0000 | |||
4015 | @@ -66,37 +66,7 @@ | |||
4016 | 66 | suite.addTests(module_suite) | 66 | suite.addTests(module_suite) |
4017 | 67 | return suite | 67 | return suite |
4018 | 68 | 68 | ||
4050 | 69 | def startDBus(self): | 69 | def run(self, testpath, test_pattern=None, loops=None): |
4020 | 70 | """Start our own session bus daemon for testing.""" | ||
4021 | 71 | dbus = find_executable("dbus-daemon") | ||
4022 | 72 | if not dbus: | ||
4023 | 73 | raise NotFoundError("dbus-daemon was not found.") | ||
4024 | 74 | |||
4025 | 75 | config_file = os.path.join(os.getcwd(), "contrib", "testing", | ||
4026 | 76 | "dbus-session.conf") | ||
4027 | 77 | dbus_args = ["--fork", | ||
4028 | 78 | "--config-file=" + config_file, | ||
4029 | 79 | "--print-address=1", | ||
4030 | 80 | "--print-pid=2"] | ||
4031 | 81 | p = subprocess.Popen([dbus] + dbus_args, | ||
4032 | 82 | bufsize=4096, stdout=subprocess.PIPE, | ||
4033 | 83 | stderr=subprocess.PIPE) | ||
4034 | 84 | |||
4035 | 85 | self.dbus_address = "".join(p.stdout.readlines()).strip() | ||
4036 | 86 | self.dbus_pid = int("".join(p.stderr.readlines()).strip()) | ||
4037 | 87 | |||
4038 | 88 | if self.dbus_address != "": | ||
4039 | 89 | os.environ["DBUS_SESSION_BUS_ADDRESS"] = self.dbus_address | ||
4040 | 90 | else: | ||
4041 | 91 | os.kill(self.dbus_pid, signal.SIGKILL) | ||
4042 | 92 | raise DBusLaunchError("There was a problem launching dbus-daemon.") | ||
4043 | 93 | |||
4044 | 94 | def stopDBus(self): | ||
4045 | 95 | """Stop our DBus session bus daemon.""" | ||
4046 | 96 | del os.environ["DBUS_SESSION_BUS_ADDRESS"] | ||
4047 | 97 | os.kill(self.dbus_pid, signal.SIGKILL) | ||
4048 | 98 | |||
4049 | 99 | def run(self, testpath, test_pattern=None): | ||
4051 | 100 | """run the tests. """ | 70 | """run the tests. """ |
4052 | 101 | # install the glib2reactor before any import of the reactor to avoid | 71 | # install the glib2reactor before any import of the reactor to avoid |
4053 | 102 | # using the default SelectReactor and be able to run the dbus tests | 72 | # using the default SelectReactor and be able to run the dbus tests |
4054 | @@ -106,7 +76,9 @@ | |||
4055 | 106 | from twisted.trial.reporter import TreeReporter | 76 | from twisted.trial.reporter import TreeReporter |
4056 | 107 | from twisted.trial.runner import TrialRunner | 77 | from twisted.trial.runner import TrialRunner |
4057 | 108 | 78 | ||
4059 | 109 | self.startDBus() | 79 | from contrib.dbus_util import DBusRunner |
4060 | 80 | dbus_runner = DBusRunner() | ||
4061 | 81 | dbus_runner.startDBus() | ||
4062 | 110 | 82 | ||
4063 | 111 | workingDirectory = os.path.join(os.getcwd(), "_trial_temp", "tmp") | 83 | workingDirectory = os.path.join(os.getcwd(), "_trial_temp", "tmp") |
4064 | 112 | runner = TrialRunner(reporterFactory=TreeReporter, realTimeErrors=True, | 84 | runner = TrialRunner(reporterFactory=TreeReporter, realTimeErrors=True, |
4065 | @@ -115,17 +87,22 @@ | |||
4066 | 115 | # setup a custom XDG_CACHE_HOME and create the logs directory | 87 | # setup a custom XDG_CACHE_HOME and create the logs directory |
4067 | 116 | xdg_cache = os.path.join(os.getcwd(), "_trial_temp", "xdg_cache") | 88 | xdg_cache = os.path.join(os.getcwd(), "_trial_temp", "xdg_cache") |
4068 | 117 | os.environ["XDG_CACHE_HOME"] = xdg_cache | 89 | os.environ["XDG_CACHE_HOME"] = xdg_cache |
4071 | 118 | # setup the ROOT_DIR env var | 90 | # setup the ROOTDIR env var |
4072 | 119 | os.environ['ROOT_DIR'] = os.getcwd() | 91 | os.environ['ROOTDIR'] = os.getcwd() |
4073 | 120 | if not os.path.exists(xdg_cache): | 92 | if not os.path.exists(xdg_cache): |
4074 | 121 | os.makedirs(xdg_cache) | 93 | os.makedirs(xdg_cache) |
4075 | 122 | success = 0 | 94 | success = 0 |
4076 | 123 | try: | 95 | try: |
4077 | 124 | suite = self._collect_tests(testpath, test_pattern) | 96 | suite = self._collect_tests(testpath, test_pattern) |
4078 | 97 | if loops: | ||
4079 | 98 | old_suite = suite | ||
4080 | 99 | suite = unittest.TestSuite() | ||
4081 | 100 | for x in xrange(loops): | ||
4082 | 101 | suite.addTest(old_suite) | ||
4083 | 125 | result = runner.run(suite) | 102 | result = runner.run(suite) |
4084 | 126 | success = result.wasSuccessful() | 103 | success = result.wasSuccessful() |
4085 | 127 | finally: | 104 | finally: |
4087 | 128 | self.stopDBus() | 105 | dbus_runner.stopDBus() |
4088 | 129 | if not success: | 106 | if not success: |
4089 | 130 | sys.exit(1) | 107 | sys.exit(1) |
4090 | 131 | else: | 108 | else: |
4091 | @@ -138,6 +115,9 @@ | |||
4092 | 138 | parser = OptionParser(usage=usage) | 115 | parser = OptionParser(usage=usage) |
4093 | 139 | parser.add_option("-t", "--test", dest="test", | 116 | parser.add_option("-t", "--test", dest="test", |
4094 | 140 | help = "run specific tests, e.g: className.methodName") | 117 | help = "run specific tests, e.g: className.methodName") |
4095 | 118 | parser.add_option("-l", "--loop", dest="loops", type="int", default=1, | ||
4096 | 119 | help = "loop selected tests LOOPS number of times", | ||
4097 | 120 | metavar="LOOPS") | ||
4098 | 141 | 121 | ||
4099 | 142 | (options, args) = parser.parse_args() | 122 | (options, args) = parser.parse_args() |
4100 | 143 | if args: | 123 | if args: |
4101 | @@ -147,4 +127,4 @@ | |||
4102 | 147 | sys.exit() | 127 | sys.exit() |
4103 | 148 | else: | 128 | else: |
4104 | 149 | testpath = None | 129 | testpath = None |
4106 | 150 | TestRunner().run(testpath, options.test) | 130 | TestRunner().run(testpath, options.test, options.loops) |
4107 | 151 | 131 | ||
4108 | === modified file 'contrib/testing/__init__.pyc' | |||
4109 | 152 | Binary files contrib/testing/__init__.pyc 2009-12-07 17:35:00 +0000 and contrib/testing/__init__.pyc 2010-02-18 00:10:25 +0000 differ | 132 | Binary files contrib/testing/__init__.pyc 2009-12-07 17:35:00 +0000 and contrib/testing/__init__.pyc 2010-02-18 00:10:25 +0000 differ |
4110 | === modified file 'contrib/testing/testcase.py' | |||
4111 | --- contrib/testing/testcase.py 2009-10-16 13:35:00 +0000 | |||
4112 | +++ contrib/testing/testcase.py 2010-02-18 00:10:25 +0000 | |||
4113 | @@ -19,11 +19,12 @@ | |||
4114 | 19 | 19 | ||
4115 | 20 | import dbus | 20 | import dbus |
4116 | 21 | from dbus.mainloop.glib import DBusGMainLoop | 21 | from dbus.mainloop.glib import DBusGMainLoop |
4117 | 22 | import contextlib | ||
4118 | 22 | import logging | 23 | import logging |
4119 | 23 | import os | 24 | import os |
4120 | 24 | import shutil | 25 | import shutil |
4121 | 25 | 26 | ||
4123 | 26 | 27 | from ubuntuone.oauthdesktop.main import Login, LoginProcessor | |
4124 | 27 | from ubuntuone.syncdaemon import ( | 28 | from ubuntuone.syncdaemon import ( |
4125 | 28 | config, | 29 | config, |
4126 | 29 | action_queue, | 30 | action_queue, |
4127 | @@ -32,16 +33,33 @@ | |||
4128 | 32 | interfaces, | 33 | interfaces, |
4129 | 33 | volume_manager, | 34 | volume_manager, |
4130 | 34 | main, | 35 | main, |
4131 | 36 | local_rescan, | ||
4132 | 35 | ) | 37 | ) |
4133 | 36 | from ubuntuone.syncdaemon.dbus_interface import ( | 38 | from ubuntuone.syncdaemon.dbus_interface import ( |
4134 | 37 | DBusInterface, | 39 | DBusInterface, |
4135 | 38 | DBusExposedObject, | 40 | DBusExposedObject, |
4136 | 39 | NM_STATE_CONNECTED, | 41 | NM_STATE_CONNECTED, |
4137 | 40 | NM_STATE_DISCONNECTED, | 42 | NM_STATE_DISCONNECTED, |
4138 | 43 | DBUS_IFACE_AUTH_NAME, | ||
4139 | 41 | ) | 44 | ) |
4140 | 42 | from twisted.internet import defer | 45 | from twisted.internet import defer |
4141 | 46 | from twisted.python import failure | ||
4142 | 43 | from twisted.trial.unittest import TestCase as TwistedTestCase | 47 | from twisted.trial.unittest import TestCase as TwistedTestCase |
4143 | 44 | from zope.interface import implements | 48 | from zope.interface import implements |
4144 | 49 | from oauth import oauth | ||
4145 | 50 | |||
4146 | 51 | |||
4147 | 52 | @contextlib.contextmanager | ||
4148 | 53 | def environ(env_var, new_value): | ||
4149 | 54 | """context manager to replace/add an environ value""" | ||
4150 | 55 | old_value = os.environ.get(env_var, None) | ||
4151 | 56 | os.environ[env_var] = new_value | ||
4152 | 57 | yield | ||
4153 | 58 | if old_value is None: | ||
4154 | 59 | os.environ.pop(env_var) | ||
4155 | 60 | else: | ||
4156 | 61 | os.environ[env_var] = old_value | ||
4157 | 62 | |||
4158 | 45 | 63 | ||
4159 | 46 | class FakeOAuthClient(object): | 64 | class FakeOAuthClient(object): |
4160 | 47 | """ Fake OAuthClient""" | 65 | """ Fake OAuthClient""" |
4161 | @@ -49,7 +67,7 @@ | |||
4162 | 49 | def __init__(self, realm): | 67 | def __init__(self, realm): |
4163 | 50 | """ create the instance. """ | 68 | """ create the instance. """ |
4164 | 51 | self.realm = realm | 69 | self.realm = realm |
4166 | 52 | self.consumer = 'ubuntuone' | 70 | self.consumer = oauth.OAuthConsumer('ubuntuone', 'hammertime') |
4167 | 53 | 71 | ||
4168 | 54 | def get_access_token(self): | 72 | def get_access_token(self): |
4169 | 55 | """ returns a Token""" | 73 | """ returns a Token""" |
4170 | @@ -103,13 +121,15 @@ | |||
4171 | 103 | self.partials_dir, self.vm) | 121 | self.partials_dir, self.vm) |
4172 | 104 | self.event_q = event_queue.EventQueue(self.fs) | 122 | self.event_q = event_queue.EventQueue(self.fs) |
4173 | 105 | self.fs.register_eq(self.event_q) | 123 | self.fs.register_eq(self.event_q) |
4175 | 106 | self.action_q = FakeActionQueue(self.event_q) | 124 | self.action_q = FakeActionQueue(self.event_q, main=self) |
4176 | 107 | self.state = main.SyncDaemonStateManager(self, 2, 0) | 125 | self.state = main.SyncDaemonStateManager(self, 2, 0) |
4177 | 108 | self.event_q.subscribe(self.vm) | 126 | self.event_q.subscribe(self.vm) |
4178 | 109 | self.vm.init_root() | 127 | self.vm.init_root() |
4179 | 110 | self.hash_q = FakeHashQueue() | 128 | self.hash_q = FakeHashQueue() |
4180 | 111 | self.mark = FakeMark() | 129 | self.mark = FakeMark() |
4181 | 112 | self.dbus_iface = FakeDBusInterface() | 130 | self.dbus_iface = FakeDBusInterface() |
4182 | 131 | self.lr = local_rescan.LocalRescan(self.vm, self.fs, | ||
4183 | 132 | self.event_q, self.action_q) | ||
4184 | 113 | 133 | ||
4185 | 114 | def _connect_aq(self, token): | 134 | def _connect_aq(self, token): |
4186 | 115 | """ Connect the fake action queue """ | 135 | """ Connect the fake action queue """ |
4187 | @@ -193,14 +213,18 @@ | |||
4188 | 193 | 213 | ||
4189 | 194 | def setUp(self): | 214 | def setUp(self): |
4190 | 195 | TwistedTestCase.setUp(self) | 215 | TwistedTestCase.setUp(self) |
4192 | 196 | # invalidate the current config | 216 | # use the config from the branch |
4193 | 217 | self.old_get_config_files = config.get_config_files | ||
4194 | 218 | config.get_config_files = lambda: [os.path.join(os.environ['ROOTDIR'], | ||
4195 | 219 | 'data', 'syncdaemon.conf')] | ||
4196 | 220 | # fake a very basic config file with sane defaults for the tests | ||
4197 | 197 | config_file = os.path.join(self.mktemp('config'), 'syncdaemon.conf') | 221 | config_file = os.path.join(self.mktemp('config'), 'syncdaemon.conf') |
4198 | 198 | # fake a very basic config file with sane defaults for the tests | ||
4199 | 199 | with open(config_file, 'w') as fp: | 222 | with open(config_file, 'w') as fp: |
4200 | 200 | fp.write('[bandwidth_throttling]\n') | 223 | fp.write('[bandwidth_throttling]\n') |
4201 | 201 | fp.write('on = False\n') | 224 | fp.write('on = False\n') |
4202 | 202 | fp.write('read_limit = -1\n') | 225 | fp.write('read_limit = -1\n') |
4203 | 203 | fp.write('write_limit = -1\n') | 226 | fp.write('write_limit = -1\n') |
4204 | 227 | # invalidate the current config | ||
4205 | 204 | config._user_config = None | 228 | config._user_config = None |
4206 | 205 | config.get_user_config(config_file=config_file) | 229 | config.get_user_config(config_file=config_file) |
4207 | 206 | 230 | ||
4208 | @@ -208,7 +232,8 @@ | |||
4209 | 208 | """ cleanup the temp dir. """ | 232 | """ cleanup the temp dir. """ |
4210 | 209 | # invalidate the current config | 233 | # invalidate the current config |
4211 | 210 | config._user_config = None | 234 | config._user_config = None |
4213 | 211 | config.get_user_config() | 235 | # restore the old get_config_files |
4214 | 236 | config.get_config_files = self.old_get_config_files | ||
4215 | 212 | if hasattr(self, '__root'): | 237 | if hasattr(self, '__root'): |
4216 | 213 | self.rmtree(self.__root) | 238 | self.rmtree(self.__root) |
4217 | 214 | return TwistedTestCase.tearDown(self) | 239 | return TwistedTestCase.tearDown(self) |
4218 | @@ -253,7 +278,7 @@ | |||
4219 | 253 | 278 | ||
4220 | 254 | def tearDown(self): | 279 | def tearDown(self): |
4221 | 255 | """ Cleanup the test. """ | 280 | """ Cleanup the test. """ |
4223 | 256 | d = self.cleanup_signal_receivers() | 281 | d = self.cleanup_signal_receivers(self.signal_receivers) |
4224 | 257 | d.addBoth(self._tearDown) | 282 | d.addBoth(self._tearDown) |
4225 | 258 | d.addBoth(lambda _: BaseTwistedTestCase.tearDown(self)) | 283 | d.addBoth(lambda _: BaseTwistedTestCase.tearDown(self)) |
4226 | 259 | return d | 284 | return d |
4227 | @@ -272,18 +297,22 @@ | |||
4228 | 272 | self.log.info("finished test %s.%s", self.__class__.__name__, | 297 | self.log.info("finished test %s.%s", self.__class__.__name__, |
4229 | 273 | self._testMethodName) | 298 | self._testMethodName) |
4230 | 274 | 299 | ||
4232 | 275 | def error_handler(self, *error): | 300 | def error_handler(self, error): |
4233 | 276 | """ default error handler for DBus calls. """ | 301 | """ default error handler for DBus calls. """ |
4235 | 277 | self.fail(error) | 302 | if isinstance(error, failure.Failure): |
4236 | 303 | self.fail(error.getErrorMessage()) | ||
4237 | 304 | else: | ||
4238 | 305 | self.fail(str(error)) | ||
4239 | 278 | 306 | ||
4241 | 279 | def cleanup_signal_receivers(self): | 307 | def cleanup_signal_receivers(self, signal_receivers): |
4242 | 280 | """ cleanup self.signal_receivers and returns a deferred """ | 308 | """ cleanup self.signal_receivers and returns a deferred """ |
4243 | 281 | deferreds = [] | 309 | deferreds = [] |
4245 | 282 | for match in self.signal_receivers: | 310 | for match in signal_receivers: |
4246 | 283 | d = defer.Deferred() | 311 | d = defer.Deferred() |
4247 | 284 | def callback(*args): | 312 | def callback(*args): |
4248 | 285 | """ callback that accepts *args. """ | 313 | """ callback that accepts *args. """ |
4250 | 286 | d.callback(args) | 314 | if not d.called: |
4251 | 315 | d.callback(args) | ||
4252 | 287 | self.bus.call_async(dbus.bus.BUS_DAEMON_NAME, | 316 | self.bus.call_async(dbus.bus.BUS_DAEMON_NAME, |
4253 | 288 | dbus.bus.BUS_DAEMON_PATH, | 317 | dbus.bus.BUS_DAEMON_PATH, |
4254 | 289 | dbus.bus.BUS_DAEMON_IFACE, 'RemoveMatch', 's', | 318 | dbus.bus.BUS_DAEMON_IFACE, 'RemoveMatch', 's', |
4255 | @@ -297,14 +326,15 @@ | |||
4256 | 297 | 326 | ||
4257 | 298 | 327 | ||
4258 | 299 | class FakeActionQueue(object): | 328 | class FakeActionQueue(object): |
4260 | 300 | """ stub implementation """ | 329 | """Stub implementation.""" |
4261 | 301 | 330 | ||
4262 | 302 | implements(interfaces.IActionQueue) | 331 | implements(interfaces.IActionQueue) |
4263 | 303 | 332 | ||
4264 | 304 | def __init__(self, eq, *args, **kwargs): | 333 | def __init__(self, eq, *args, **kwargs): |
4265 | 305 | """ Creates the instance """ | 334 | """ Creates the instance """ |
4266 | 306 | self.eq = self.event_queue = eq | 335 | self.eq = self.event_queue = eq |
4268 | 307 | self.client = action_queue.ActionQueueProtocol() | 336 | self.client = action_queue.ActionQueue.protocol() |
4269 | 337 | self.client.disconnect = lambda: None | ||
4270 | 308 | self.uploading = {} | 338 | self.uploading = {} |
4271 | 309 | self.downloading = {} | 339 | self.downloading = {} |
4272 | 310 | # pylint: disable-msg=C0103 | 340 | # pylint: disable-msg=C0103 |
4273 | @@ -324,76 +354,68 @@ | |||
4274 | 324 | self.throttling = False | 354 | self.throttling = False |
4275 | 325 | 355 | ||
4276 | 326 | def connect(self, host=None, port=None, user_ssl=False): | 356 | def connect(self, host=None, port=None, user_ssl=False): |
4278 | 327 | """ stub implementation """ | 357 | """Stub implementation.""" |
4279 | 328 | self.eq.push('SYS_CONNECTION_MADE') | 358 | self.eq.push('SYS_CONNECTION_MADE') |
4280 | 329 | 359 | ||
4281 | 330 | def disconnect(self): | 360 | def disconnect(self): |
4284 | 331 | """ stub implementation """ | 361 | """Stub implementation.""" |
4283 | 332 | pass | ||
4285 | 333 | 362 | ||
4286 | 334 | def enable_throttling(self, value): | 363 | def enable_throttling(self, value): |
4287 | 335 | self.throttling = value | 364 | self.throttling = value |
4288 | 336 | 365 | ||
4289 | 337 | def cancel_download(self, share_id, node_id): | 366 | def cancel_download(self, share_id, node_id): |
4292 | 338 | """ stub implementation """ | 367 | """Stub implementation.""" |
4291 | 339 | pass | ||
4293 | 340 | 368 | ||
4294 | 341 | def cancel_upload(self, share_id, node_id): | 369 | def cancel_upload(self, share_id, node_id): |
4297 | 342 | """ stub implementation """ | 370 | """Stub implementation.""" |
4296 | 343 | pass | ||
4298 | 344 | 371 | ||
4299 | 345 | def download(self, share_id, node_id, server_hash, fileobj): | 372 | def download(self, share_id, node_id, server_hash, fileobj): |
4302 | 346 | """ stub implementation """ | 373 | """Stub implementation.""" |
4301 | 347 | pass | ||
4303 | 348 | 374 | ||
4304 | 349 | def upload(self, share_id, node_id, previous_hash, hash, crc32, | 375 | def upload(self, share_id, node_id, previous_hash, hash, crc32, |
4305 | 350 | size, deflated_size, fileobj): | 376 | size, deflated_size, fileobj): |
4308 | 351 | """ stub implementation """ | 377 | """Stub implementation.""" |
4307 | 352 | pass | ||
4309 | 353 | 378 | ||
4310 | 354 | def make_file(self, share_id, parent_id, name, marker): | 379 | def make_file(self, share_id, parent_id, name, marker): |
4313 | 355 | """ stub implementation """ | 380 | """Stub implementation.""" |
4312 | 356 | pass | ||
4314 | 357 | 381 | ||
4315 | 358 | def make_dir(self, share_id, parent_id, name, marker): | 382 | def make_dir(self, share_id, parent_id, name, marker): |
4318 | 359 | """ stub implementation """ | 383 | """Stub implementation.""" |
4317 | 360 | pass | ||
4319 | 361 | 384 | ||
4320 | 362 | def move(self, share_id, node_id, old_parent_id, new_parent_id, new_name): | 385 | def move(self, share_id, node_id, old_parent_id, new_parent_id, new_name): |
4323 | 363 | """ stub implementation """ | 386 | """Stub implementation.""" |
4322 | 364 | pass | ||
4324 | 365 | 387 | ||
4325 | 366 | def unlink(self, share_id, node_id): | 388 | def unlink(self, share_id, node_id): |
4328 | 367 | """ stub implementation """ | 389 | """Stub implementation.""" |
4327 | 368 | pass | ||
4329 | 369 | 390 | ||
4330 | 370 | def query(self, items): | 391 | def query(self, items): |
4333 | 371 | """ stub implementation """ | 392 | """Stub implementation.""" |
4332 | 372 | pass | ||
4334 | 373 | 393 | ||
4335 | 374 | def listdir(self, share_id, node_id, server_hash, fileobj): | 394 | def listdir(self, share_id, node_id, server_hash, fileobj): |
4338 | 375 | """ stub implementation """ | 395 | """Stub implementation.""" |
4337 | 376 | pass | ||
4339 | 377 | 396 | ||
4340 | 378 | def list_shares(self): | 397 | def list_shares(self): |
4341 | 398 | """Stub implementation.""" | ||
4342 | 399 | |||
4343 | 400 | def list_volumes(self): | ||
4344 | 379 | """ stub implementation """ | 401 | """ stub implementation """ |
4345 | 380 | pass | 402 | pass |
4346 | 381 | 403 | ||
4347 | 382 | def answer_share(self, share_id, answer): | 404 | def answer_share(self, share_id, answer): |
4349 | 383 | """ stub implementation """ | 405 | """Stub implementation.""" |
4350 | 384 | self.eq.push('AQ_ANSWER_SHARE_OK', share_id, answer) | 406 | self.eq.push('AQ_ANSWER_SHARE_OK', share_id, answer) |
4351 | 385 | 407 | ||
4352 | 386 | def create_share(self, *args): | 408 | def create_share(self, *args): |
4353 | 387 | """ sutb implementation """ | 409 | """ sutb implementation """ |
4354 | 388 | pass | ||
4355 | 389 | 410 | ||
4356 | 390 | def inquire_free_space(self, share_id): | 411 | def inquire_free_space(self, share_id): |
4359 | 391 | """ stub implementation """ | 412 | """Stub implementation.""" |
4358 | 392 | pass | ||
4360 | 393 | 413 | ||
4361 | 394 | def inquire_account_info(self): | 414 | def inquire_account_info(self): |
4364 | 395 | """ stub implementation """ | 415 | """Stub implementation.""" |
4365 | 396 | pass | 416 | |
4366 | 417 | def delete_volume(self, volume_id): | ||
4367 | 418 | """Stub implementation.""" | ||
4368 | 397 | 419 | ||
4369 | 398 | 420 | ||
4370 | 399 | class MementoHandler(logging.Handler): | 421 | class MementoHandler(logging.Handler): |
4371 | @@ -464,12 +486,13 @@ | |||
4372 | 464 | 486 | ||
4373 | 465 | def __init__(self, root_path): | 487 | def __init__(self, root_path): |
4374 | 466 | """ Creates the instance""" | 488 | """ Creates the instance""" |
4376 | 467 | self.root = volume_manager.Share(root_path, access_level='Modify') | 489 | self.root = volume_manager.Share(path=root_path, access_level='Modify') |
4377 | 468 | self.shares = {'':self.root} | 490 | self.shares = {'':self.root} |
4378 | 491 | self.udfs = {} | ||
4379 | 469 | self.log = logging.getLogger('ubuntuone.SyncDaemon.VM-test') | 492 | self.log = logging.getLogger('ubuntuone.SyncDaemon.VM-test') |
4380 | 470 | 493 | ||
4381 | 471 | def add_share(self, share): | 494 | def add_share(self, share): |
4383 | 472 | """ Adss share to the shares dict """ | 495 | """Add share to the shares dict.""" |
4384 | 473 | self.shares[share.id] = share | 496 | self.shares[share.id] = share |
4385 | 474 | # if the share don't exists, create it | 497 | # if the share don't exists, create it |
4386 | 475 | if not os.path.exists(share.path): | 498 | if not os.path.exists(share.path): |
4387 | @@ -478,7 +501,117 @@ | |||
4388 | 478 | if not share.can_write(): | 501 | if not share.can_write(): |
4389 | 479 | os.chmod(share.path, 0555) | 502 | os.chmod(share.path, 0555) |
4390 | 480 | 503 | ||
4391 | 504 | def add_udf(self, udf): | ||
4392 | 505 | """Add udf to the udfs dict.""" | ||
4393 | 506 | self.udfs[udf.id] = udf | ||
4394 | 507 | |||
4395 | 481 | def on_server_root(self, _): | 508 | def on_server_root(self, _): |
4399 | 482 | """ | 509 | """Do nothing.""" |
4400 | 483 | Do nothing | 510 | |
4401 | 484 | """ | 511 | def share_deleted(self, _): |
4402 | 512 | """Do nothing.""" | ||
4403 | 513 | |||
4404 | 514 | def get_volume(self, id): | ||
4405 | 515 | """Returns a share or a UDF.""" | ||
4406 | 516 | try: | ||
4407 | 517 | return self.shares[id] | ||
4408 | 518 | except KeyError: | ||
4409 | 519 | return self.udfs[id] | ||
4410 | 520 | |||
4411 | 521 | def get_volumes(self, access_level='Modify', all_volumes=False): | ||
4412 | 522 | """Simple get_volumes for FakeVolumeManager.""" | ||
4413 | 523 | for share in self.shares.values(): | ||
4414 | 524 | if all_volumes or share.access_level == access_level: | ||
4415 | 525 | yield share | ||
4416 | 526 | for udf in self.udfs.values(): | ||
4417 | 527 | if all_volumes or udf.subscribed: | ||
4418 | 528 | yield udf | ||
4419 | 529 | |||
4420 | 530 | def unsubscribe_udf(self, udf_id): | ||
4421 | 531 | """Mark the UDF with udf_id as unsubscribed.""" | ||
4422 | 532 | udf = self.udfs[udf_id] | ||
4423 | 533 | udf.subscribed = False | ||
4424 | 534 | self.udfs[udf_id] = udf | ||
4425 | 535 | |||
4426 | 536 | def delete_volume(self, volume_id): | ||
4427 | 537 | """Request the deletion of a volume.""" | ||
4428 | 538 | |||
4429 | 539 | # OAuth stubs | ||
4430 | 540 | class FakeLoginProcessor(LoginProcessor): | ||
4431 | 541 | """Stub login processor.""" | ||
4432 | 542 | |||
4433 | 543 | def __init__(self, dbus_object): | ||
4434 | 544 | """Initialize the login processor.""" | ||
4435 | 545 | LoginProcessor.__init__(self, dbus_object, use_libnotify=False) | ||
4436 | 546 | self.next_login_cb = None | ||
4437 | 547 | |||
4438 | 548 | def login(self, realm, consumer_key, error_handler=None, | ||
4439 | 549 | reply_handler=None, do_login=True): | ||
4440 | 550 | """Stub, call self.next_login_cb or send NewCredentials if | ||
4441 | 551 | self.next_login_cb isn't defined. | ||
4442 | 552 | """ | ||
4443 | 553 | self.realm = str(realm) | ||
4444 | 554 | self.consumer_key = str(consumer_key) | ||
4445 | 555 | if self.next_login_cb: | ||
4446 | 556 | cb = self.next_login_cb[0] | ||
4447 | 557 | args = self.next_login_cb[1] | ||
4448 | 558 | self.next_login_cb = None | ||
4449 | 559 | return cb(*args) | ||
4450 | 560 | else: | ||
4451 | 561 | self.dbus_object.NewCredentials(realm, consumer_key) | ||
4452 | 562 | |||
4453 | 563 | def clear_token(self, realm, consumer_key): | ||
4454 | 564 | """Stub, do nothing""" | ||
4455 | 565 | pass | ||
4456 | 566 | |||
4457 | 567 | def next_login_with(self, callback, args=tuple()): | ||
4458 | 568 | """shortcircuit the next call to login and call the specified callback. | ||
4459 | 569 | callback is usually one of: self.got_token, self.got_no_token, | ||
4460 | 570 | self.got_denial or self.got_error. | ||
4461 | 571 | """ | ||
4462 | 572 | self.next_login_cb = (callback, args) | ||
4463 | 573 | |||
4464 | 574 | |||
4465 | 575 | class FakeLogin(Login): | ||
4466 | 576 | """Stub Object which listens for D-Bus OAuth requests""" | ||
4467 | 577 | |||
4468 | 578 | def __init__(self, bus): | ||
4469 | 579 | """Initiate the object.""" | ||
4470 | 580 | self.bus = bus | ||
4471 | 581 | self.busName = dbus.service.BusName(DBUS_IFACE_AUTH_NAME, bus=self.bus) | ||
4472 | 582 | # bypass the parent class __init__ as it has the path hardcoded | ||
4473 | 583 | # and we can't use '/' as the path, as we are already using it | ||
4474 | 584 | # for syncdaemon. pylint: disable-msg=W0233,W0231 | ||
4475 | 585 | dbus.service.Object.__init__(self, object_path="/oauthdesktop", | ||
4476 | 586 | bus_name=self.busName) | ||
4477 | 587 | self.processor = FakeLoginProcessor(self) | ||
4478 | 588 | self.currently_authing = False | ||
4479 | 589 | |||
4480 | 590 | def shutdown(self): | ||
4481 | 591 | """Shutdown and remove any trace from the bus""" | ||
4482 | 592 | self.busName.get_bus().release_name(self.busName.get_name()) | ||
4483 | 593 | self.remove_from_connection() | ||
4484 | 594 | |||
4485 | 595 | |||
4486 | 596 | class Listener(object): | ||
4487 | 597 | """Helper class to gather events.""" | ||
4488 | 598 | |||
4489 | 599 | def __init__(self): | ||
4490 | 600 | self.events = [] | ||
4491 | 601 | |||
4492 | 602 | def handle_default(self, event_name, *args, **kwargs): | ||
4493 | 603 | """Keep record of every event.""" | ||
4494 | 604 | self.events.append((event_name, args, kwargs)) | ||
4495 | 605 | |||
4496 | 606 | |||
4497 | 607 | def noop(*args, **kwargs): | ||
4498 | 608 | """No op.""" | ||
4499 | 609 | |||
4500 | 610 | |||
4501 | 611 | class DummyClass(object): | ||
4502 | 612 | """Dummy class, does nothing.""" | ||
4503 | 613 | |||
4504 | 614 | def __getattribute__(self, name): | ||
4505 | 615 | """Any attribute is a no-op.""" | ||
4506 | 616 | return noop | ||
4507 | 617 | |||
4508 | 485 | 618 | ||
4509 | === modified file 'contrib/testing/testcase.pyc' | |||
4510 | 486 | Binary files contrib/testing/testcase.pyc 2009-12-07 17:35:00 +0000 and contrib/testing/testcase.pyc 2010-02-18 00:10:25 +0000 differ | 619 | Binary files contrib/testing/testcase.pyc 2009-12-07 17:35:00 +0000 and contrib/testing/testcase.pyc 2010-02-18 00:10:25 +0000 differ |
4511 | === modified file 'data/Makefile.am' | |||
4512 | --- data/Makefile.am 2009-09-28 18:15:00 +0000 | |||
4513 | +++ data/Makefile.am 2010-02-18 00:10:25 +0000 | |||
4514 | @@ -6,17 +6,29 @@ | |||
4515 | 6 | crashdb_DATA = ubuntuone-client-crashdb.conf | 6 | crashdb_DATA = ubuntuone-client-crashdb.conf |
4516 | 7 | 7 | ||
4517 | 8 | configdir = $(sysconfdir)/xdg/ubuntuone | 8 | configdir = $(sysconfdir)/xdg/ubuntuone |
4519 | 9 | config_DATA = oauth_urls syncdaemon.conf | 9 | config_in_files = logging.conf.in |
4520 | 10 | config_DATA = oauth_urls syncdaemon.conf $(config_in_files:.conf.in=.conf) | ||
4521 | 10 | 11 | ||
4522 | 11 | oauthdir = $(configdir)/oauth_registration.d | 12 | oauthdir = $(configdir)/oauth_registration.d |
4523 | 12 | oauth_DATA = oauth_registration.d/ubuntuone | 13 | oauth_DATA = oauth_registration.d/ubuntuone |
4524 | 13 | 14 | ||
4525 | 15 | memenudir = $(datadir)/indicators/me | ||
4526 | 16 | memenu_in_files = ubuntuone.menu.in | ||
4527 | 17 | memenu_DATA = $(memenu_in_files:.menu.in=.menu) | ||
4528 | 18 | |||
4529 | 19 | %.menu: %.menu.in | ||
4530 | 20 | @sed -e "s|\@DATADIR\@|$(datadir)|" $< > $@ | ||
4531 | 21 | |||
4532 | 14 | desktopdir = $(datadir)/applications | 22 | desktopdir = $(datadir)/applications |
4534 | 15 | desktop_in_files = ubuntuone-client-applet.desktop.in | 23 | desktop_in_files = ubuntuone-preferences.desktop.in |
4535 | 16 | desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) | 24 | desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) |
4536 | 17 | 25 | ||
4537 | 18 | @INTLTOOL_DESKTOP_RULE@ | 26 | @INTLTOOL_DESKTOP_RULE@ |
4538 | 19 | 27 | ||
4539 | 28 | %.conf: %.conf.in | ||
4540 | 29 | @sed -e "s|\@LOG_LEVEL\@|$(LOG_LEVEL)|" \ | ||
4541 | 30 | -e "s|\@LOG_FILE_SIZE\@|$(LOG_FILE_SIZE)|" $< > $@ | ||
4542 | 31 | |||
4543 | 20 | hicolordir = $(datadir)/icons/hicolor | 32 | hicolordir = $(datadir)/icons/hicolor |
4544 | 21 | privateiconsdir = $(pkgdatadir)/icons/hicolor | 33 | privateiconsdir = $(pkgdatadir)/icons/hicolor |
4545 | 22 | emblem_in_files = \ | 34 | emblem_in_files = \ |
4546 | @@ -117,7 +129,9 @@ | |||
4547 | 117 | rm -rf icons | 129 | rm -rf icons |
4548 | 118 | 130 | ||
4549 | 119 | EXTRA_DIST = \ | 131 | EXTRA_DIST = \ |
4551 | 120 | $(desktop_in_files) \ | 132 | $(config_in_files) \ |
4552 | 133 | $(memenu_in_files) \ | ||
4553 | 134 | $(desktop_in_files) \ | ||
4554 | 121 | $(service_in_files) \ | 135 | $(service_in_files) \ |
4555 | 122 | $(emblem_in_files) \ | 136 | $(emblem_in_files) \ |
4556 | 123 | $(icon_in_files) \ | 137 | $(icon_in_files) \ |
4557 | @@ -128,7 +142,8 @@ | |||
4558 | 128 | oauth_registration.d | 142 | oauth_registration.d |
4559 | 129 | 143 | ||
4560 | 130 | CLEANFILES = \ | 144 | CLEANFILES = \ |
4562 | 131 | $(desktop_DATA) \ | 145 | $(memenu_DATA) \ |
4563 | 146 | $(desktop_DATA) \ | ||
4564 | 132 | $(service_DATA) \ | 147 | $(service_DATA) \ |
4565 | 133 | $(emblem_files) \ | 148 | $(emblem_files) \ |
4566 | 134 | hicolor | 149 | hicolor |
4567 | 135 | 150 | ||
4568 | === modified file 'data/Makefile.in' | |||
4569 | --- data/Makefile.in 2009-09-28 18:15:00 +0000 | |||
4570 | +++ data/Makefile.in 2010-02-18 00:10:25 +0000 | |||
4571 | @@ -1,4 +1,4 @@ | |||
4573 | 1 | # Makefile.in generated by automake 1.11 from Makefile.am. | 1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. |
4574 | 2 | # @configure_input@ | 2 | # @configure_input@ |
4575 | 3 | 3 | ||
4576 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
4577 | @@ -72,9 +72,10 @@ | |||
4578 | 72 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | 72 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' |
4579 | 73 | am__installdirs = "$(DESTDIR)$(apportdir)" "$(DESTDIR)$(configdir)" \ | 73 | am__installdirs = "$(DESTDIR)$(apportdir)" "$(DESTDIR)$(configdir)" \ |
4580 | 74 | "$(DESTDIR)$(crashdbdir)" "$(DESTDIR)$(desktopdir)" \ | 74 | "$(DESTDIR)$(crashdbdir)" "$(DESTDIR)$(desktopdir)" \ |
4582 | 75 | "$(DESTDIR)$(oauthdir)" "$(DESTDIR)$(servicedir)" | 75 | "$(DESTDIR)$(memenudir)" "$(DESTDIR)$(oauthdir)" \ |
4583 | 76 | "$(DESTDIR)$(servicedir)" | ||
4584 | 76 | DATA = $(apport_DATA) $(config_DATA) $(crashdb_DATA) $(desktop_DATA) \ | 77 | DATA = $(apport_DATA) $(config_DATA) $(crashdb_DATA) $(desktop_DATA) \ |
4586 | 77 | $(oauth_DATA) $(service_DATA) | 78 | $(memenu_DATA) $(oauth_DATA) $(service_DATA) |
4587 | 78 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | 79 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
4588 | 79 | ACLOCAL = @ACLOCAL@ | 80 | ACLOCAL = @ACLOCAL@ |
4589 | 80 | ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ | 81 | ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ |
4590 | @@ -126,6 +127,8 @@ | |||
4591 | 126 | LIPO = @LIPO@ | 127 | LIPO = @LIPO@ |
4592 | 127 | LNDIR = @LNDIR@ | 128 | LNDIR = @LNDIR@ |
4593 | 128 | LN_S = @LN_S@ | 129 | LN_S = @LN_S@ |
4594 | 130 | LOG_FILE_SIZE = @LOG_FILE_SIZE@ | ||
4595 | 131 | LOG_LEVEL = @LOG_LEVEL@ | ||
4596 | 129 | LTLIBOBJS = @LTLIBOBJS@ | 132 | LTLIBOBJS = @LTLIBOBJS@ |
4597 | 130 | MAKEINFO = @MAKEINFO@ | 133 | MAKEINFO = @MAKEINFO@ |
4598 | 131 | MKDIR_P = @MKDIR_P@ | 134 | MKDIR_P = @MKDIR_P@ |
4599 | @@ -224,11 +227,15 @@ | |||
4600 | 224 | crashdbdir = $(sysconfdir)/apport/crashdb.conf.d | 227 | crashdbdir = $(sysconfdir)/apport/crashdb.conf.d |
4601 | 225 | crashdb_DATA = ubuntuone-client-crashdb.conf | 228 | crashdb_DATA = ubuntuone-client-crashdb.conf |
4602 | 226 | configdir = $(sysconfdir)/xdg/ubuntuone | 229 | configdir = $(sysconfdir)/xdg/ubuntuone |
4604 | 227 | config_DATA = oauth_urls syncdaemon.conf | 230 | config_in_files = logging.conf.in |
4605 | 231 | config_DATA = oauth_urls syncdaemon.conf $(config_in_files:.conf.in=.conf) | ||
4606 | 228 | oauthdir = $(configdir)/oauth_registration.d | 232 | oauthdir = $(configdir)/oauth_registration.d |
4607 | 229 | oauth_DATA = oauth_registration.d/ubuntuone | 233 | oauth_DATA = oauth_registration.d/ubuntuone |
4608 | 234 | memenudir = $(datadir)/indicators/me | ||
4609 | 235 | memenu_in_files = ubuntuone.menu.in | ||
4610 | 236 | memenu_DATA = $(memenu_in_files:.menu.in=.menu) | ||
4611 | 230 | desktopdir = $(datadir)/applications | 237 | desktopdir = $(datadir)/applications |
4613 | 231 | desktop_in_files = ubuntuone-client-applet.desktop.in | 238 | desktop_in_files = ubuntuone-preferences.desktop.in |
4614 | 232 | desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) | 239 | desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) |
4615 | 233 | hicolordir = $(datadir)/icons/hicolor | 240 | hicolordir = $(datadir)/icons/hicolor |
4616 | 234 | privateiconsdir = $(pkgdatadir)/icons/hicolor | 241 | privateiconsdir = $(pkgdatadir)/icons/hicolor |
4617 | @@ -248,7 +255,9 @@ | |||
4618 | 248 | icon_cache = $(icon_in_files:.svg=.rendercache) | 255 | icon_cache = $(icon_in_files:.svg=.rendercache) |
4619 | 249 | icon_files = $(shell BUILDDIR="$(builddir)"; for i in `find $$BUILDDIR -name "*.rendercache"`; do cat $$i|sort|uniq; done) | 256 | icon_files = $(shell BUILDDIR="$(builddir)"; for i in `find $$BUILDDIR -name "*.rendercache"`; do cat $$i|sort|uniq; done) |
4620 | 250 | EXTRA_DIST = \ | 257 | EXTRA_DIST = \ |
4622 | 251 | $(desktop_in_files) \ | 258 | $(config_in_files) \ |
4623 | 259 | $(memenu_in_files) \ | ||
4624 | 260 | $(desktop_in_files) \ | ||
4625 | 252 | $(service_in_files) \ | 261 | $(service_in_files) \ |
4626 | 253 | $(emblem_in_files) \ | 262 | $(emblem_in_files) \ |
4627 | 254 | $(icon_in_files) \ | 263 | $(icon_in_files) \ |
4628 | @@ -259,7 +268,8 @@ | |||
4629 | 259 | oauth_registration.d | 268 | oauth_registration.d |
4630 | 260 | 269 | ||
4631 | 261 | CLEANFILES = \ | 270 | CLEANFILES = \ |
4633 | 262 | $(desktop_DATA) \ | 271 | $(memenu_DATA) \ |
4634 | 272 | $(desktop_DATA) \ | ||
4635 | 263 | $(service_DATA) \ | 273 | $(service_DATA) \ |
4636 | 264 | $(emblem_files) \ | 274 | $(emblem_files) \ |
4637 | 265 | hicolor | 275 | hicolor |
4638 | @@ -387,6 +397,26 @@ | |||
4639 | 387 | test -n "$$files" || exit 0; \ | 397 | test -n "$$files" || exit 0; \ |
4640 | 388 | echo " ( cd '$(DESTDIR)$(desktopdir)' && rm -f" $$files ")"; \ | 398 | echo " ( cd '$(DESTDIR)$(desktopdir)' && rm -f" $$files ")"; \ |
4641 | 389 | cd "$(DESTDIR)$(desktopdir)" && rm -f $$files | 399 | cd "$(DESTDIR)$(desktopdir)" && rm -f $$files |
4642 | 400 | install-memenuDATA: $(memenu_DATA) | ||
4643 | 401 | @$(NORMAL_INSTALL) | ||
4644 | 402 | test -z "$(memenudir)" || $(MKDIR_P) "$(DESTDIR)$(memenudir)" | ||
4645 | 403 | @list='$(memenu_DATA)'; test -n "$(memenudir)" || list=; \ | ||
4646 | 404 | for p in $$list; do \ | ||
4647 | 405 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | ||
4648 | 406 | echo "$$d$$p"; \ | ||
4649 | 407 | done | $(am__base_list) | \ | ||
4650 | 408 | while read files; do \ | ||
4651 | 409 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(memenudir)'"; \ | ||
4652 | 410 | $(INSTALL_DATA) $$files "$(DESTDIR)$(memenudir)" || exit $$?; \ | ||
4653 | 411 | done | ||
4654 | 412 | |||
4655 | 413 | uninstall-memenuDATA: | ||
4656 | 414 | @$(NORMAL_UNINSTALL) | ||
4657 | 415 | @list='$(memenu_DATA)'; test -n "$(memenudir)" || list=; \ | ||
4658 | 416 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ | ||
4659 | 417 | test -n "$$files" || exit 0; \ | ||
4660 | 418 | echo " ( cd '$(DESTDIR)$(memenudir)' && rm -f" $$files ")"; \ | ||
4661 | 419 | cd "$(DESTDIR)$(memenudir)" && rm -f $$files | ||
4662 | 390 | install-oauthDATA: $(oauth_DATA) | 420 | install-oauthDATA: $(oauth_DATA) |
4663 | 391 | @$(NORMAL_INSTALL) | 421 | @$(NORMAL_INSTALL) |
4664 | 392 | test -z "$(oauthdir)" || $(MKDIR_P) "$(DESTDIR)$(oauthdir)" | 422 | test -z "$(oauthdir)" || $(MKDIR_P) "$(DESTDIR)$(oauthdir)" |
4665 | @@ -471,7 +501,7 @@ | |||
4666 | 471 | check: check-am | 501 | check: check-am |
4667 | 472 | all-am: Makefile $(DATA) | 502 | all-am: Makefile $(DATA) |
4668 | 473 | installdirs: | 503 | installdirs: |
4670 | 474 | for dir in "$(DESTDIR)$(apportdir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(crashdbdir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(oauthdir)" "$(DESTDIR)$(servicedir)"; do \ | 504 | for dir in "$(DESTDIR)$(apportdir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(crashdbdir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(memenudir)" "$(DESTDIR)$(oauthdir)" "$(DESTDIR)$(servicedir)"; do \ |
4671 | 475 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | 505 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ |
4672 | 476 | done | 506 | done |
4673 | 477 | install: install-am | 507 | install: install-am |
4674 | @@ -523,7 +553,7 @@ | |||
4675 | 523 | 553 | ||
4676 | 524 | install-data-am: install-apportDATA install-configDATA \ | 554 | install-data-am: install-apportDATA install-configDATA \ |
4677 | 525 | install-crashdbDATA install-data-local install-desktopDATA \ | 555 | install-crashdbDATA install-data-local install-desktopDATA \ |
4679 | 526 | install-oauthDATA install-serviceDATA | 556 | install-memenuDATA install-oauthDATA install-serviceDATA |
4680 | 527 | 557 | ||
4681 | 528 | install-dvi: install-dvi-am | 558 | install-dvi: install-dvi-am |
4682 | 529 | 559 | ||
4683 | @@ -570,7 +600,7 @@ | |||
4684 | 570 | 600 | ||
4685 | 571 | uninstall-am: uninstall-apportDATA uninstall-configDATA \ | 601 | uninstall-am: uninstall-apportDATA uninstall-configDATA \ |
4686 | 572 | uninstall-crashdbDATA uninstall-desktopDATA uninstall-local \ | 602 | uninstall-crashdbDATA uninstall-desktopDATA uninstall-local \ |
4688 | 573 | uninstall-oauthDATA uninstall-serviceDATA | 603 | uninstall-memenuDATA uninstall-oauthDATA uninstall-serviceDATA |
4689 | 574 | 604 | ||
4690 | 575 | .MAKE: install-am install-strip | 605 | .MAKE: install-am install-strip |
4691 | 576 | 606 | ||
4692 | @@ -582,19 +612,26 @@ | |||
4693 | 582 | install-data-local install-desktopDATA install-dvi \ | 612 | install-data-local install-desktopDATA install-dvi \ |
4694 | 583 | install-dvi-am install-exec install-exec-am install-html \ | 613 | install-dvi-am install-exec install-exec-am install-html \ |
4695 | 584 | install-html-am install-info install-info-am install-man \ | 614 | install-html-am install-info install-info-am install-man \ |
4706 | 585 | install-oauthDATA install-pdf install-pdf-am install-ps \ | 615 | install-memenuDATA install-oauthDATA install-pdf \ |
4707 | 586 | install-ps-am install-serviceDATA install-strip installcheck \ | 616 | install-pdf-am install-ps install-ps-am install-serviceDATA \ |
4708 | 587 | installcheck-am installdirs maintainer-clean \ | 617 | install-strip installcheck installcheck-am installdirs \ |
4709 | 588 | maintainer-clean-generic maintainer-clean-local mostlyclean \ | 618 | maintainer-clean maintainer-clean-generic \ |
4710 | 589 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | 619 | maintainer-clean-local mostlyclean mostlyclean-generic \ |
4711 | 590 | uninstall uninstall-am uninstall-apportDATA \ | 620 | mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ |
4712 | 591 | uninstall-configDATA uninstall-crashdbDATA \ | 621 | uninstall-apportDATA uninstall-configDATA \ |
4713 | 592 | uninstall-desktopDATA uninstall-local uninstall-oauthDATA \ | 622 | uninstall-crashdbDATA uninstall-desktopDATA uninstall-local \ |
4714 | 593 | uninstall-serviceDATA | 623 | uninstall-memenuDATA uninstall-oauthDATA uninstall-serviceDATA |
4715 | 594 | 624 | ||
4716 | 625 | |||
4717 | 626 | %.menu: %.menu.in | ||
4718 | 627 | @sed -e "s|\@DATADIR\@|$(datadir)|" $< > $@ | ||
4719 | 595 | 628 | ||
4720 | 596 | @INTLTOOL_DESKTOP_RULE@ | 629 | @INTLTOOL_DESKTOP_RULE@ |
4721 | 597 | 630 | ||
4722 | 631 | %.conf: %.conf.in | ||
4723 | 632 | @sed -e "s|\@LOG_LEVEL\@|$(LOG_LEVEL)|" \ | ||
4724 | 633 | -e "s|\@LOG_FILE_SIZE\@|$(LOG_FILE_SIZE)|" $< > $@ | ||
4725 | 634 | |||
4726 | 598 | %.icon: %.icon.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache | 635 | %.icon: %.icon.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache |
4727 | 599 | 636 | ||
4728 | 600 | %.service: %.service.in | 637 | %.service: %.service.in |
4729 | 601 | 638 | ||
4730 | === modified file 'data/com.ubuntuone.Authentication.service.in' | |||
4731 | --- data/com.ubuntuone.Authentication.service.in 2009-06-30 12:00:00 +0000 | |||
4732 | +++ data/com.ubuntuone.Authentication.service.in 2010-02-18 00:10:25 +0000 | |||
4733 | @@ -1,3 +1,3 @@ | |||
4734 | 1 | [D-BUS Service] | 1 | [D-BUS Service] |
4735 | 2 | Name=com.ubuntuone.Authentication | 2 | Name=com.ubuntuone.Authentication |
4737 | 3 | Exec=@bindir@/ubuntuone-client-applet | 3 | Exec=@libexecdir@/ubuntuone-login |
4738 | 4 | 4 | ||
4739 | === removed file 'data/icons/16x16/apps/ubuntuone-client.png' | |||
4740 | 5 | Binary files data/icons/16x16/apps/ubuntuone-client.png 2009-09-28 18:15:00 +0000 and data/icons/16x16/apps/ubuntuone-client.png 1970-01-01 00:00:00 +0000 differ | 5 | Binary files data/icons/16x16/apps/ubuntuone-client.png 2009-09-28 18:15:00 +0000 and data/icons/16x16/apps/ubuntuone-client.png 1970-01-01 00:00:00 +0000 differ |
4741 | === added file 'data/icons/16x16/apps/ubuntuone.png' | |||
4742 | 6 | Binary files data/icons/16x16/apps/ubuntuone.png 1970-01-01 00:00:00 +0000 and data/icons/16x16/apps/ubuntuone.png 2010-02-18 00:10:25 +0000 differ | 6 | Binary files data/icons/16x16/apps/ubuntuone.png 1970-01-01 00:00:00 +0000 and data/icons/16x16/apps/ubuntuone.png 2010-02-18 00:10:25 +0000 differ |
4743 | === removed file 'data/icons/16x16/status/ubuntuone-client-offline.png' | |||
4744 | 7 | Binary files data/icons/16x16/status/ubuntuone-client-offline.png 2009-09-28 18:15:00 +0000 and data/icons/16x16/status/ubuntuone-client-offline.png 1970-01-01 00:00:00 +0000 differ | 7 | Binary files data/icons/16x16/status/ubuntuone-client-offline.png 2009-09-28 18:15:00 +0000 and data/icons/16x16/status/ubuntuone-client-offline.png 1970-01-01 00:00:00 +0000 differ |
4745 | === removed file 'data/icons/24x24/apps/ubuntuone-client.png' | |||
4746 | 8 | Binary files data/icons/24x24/apps/ubuntuone-client.png 2009-09-28 18:15:00 +0000 and data/icons/24x24/apps/ubuntuone-client.png 1970-01-01 00:00:00 +0000 differ | 8 | Binary files data/icons/24x24/apps/ubuntuone-client.png 2009-09-28 18:15:00 +0000 and data/icons/24x24/apps/ubuntuone-client.png 1970-01-01 00:00:00 +0000 differ |
4747 | === added file 'data/icons/24x24/apps/ubuntuone.png' | |||
4748 | 9 | Binary files data/icons/24x24/apps/ubuntuone.png 1970-01-01 00:00:00 +0000 and data/icons/24x24/apps/ubuntuone.png 2010-02-18 00:10:25 +0000 differ | 9 | Binary files data/icons/24x24/apps/ubuntuone.png 1970-01-01 00:00:00 +0000 and data/icons/24x24/apps/ubuntuone.png 2010-02-18 00:10:25 +0000 differ |
4749 | === removed file 'data/icons/24x24/status/ubuntuone-client-offline.png' | |||
4750 | 10 | Binary files data/icons/24x24/status/ubuntuone-client-offline.png 2009-09-28 18:15:00 +0000 and data/icons/24x24/status/ubuntuone-client-offline.png 1970-01-01 00:00:00 +0000 differ | 10 | Binary files data/icons/24x24/status/ubuntuone-client-offline.png 2009-09-28 18:15:00 +0000 and data/icons/24x24/status/ubuntuone-client-offline.png 1970-01-01 00:00:00 +0000 differ |
4751 | === removed file 'data/icons/32x32/apps/ubuntuone-client.png' | |||
4752 | 11 | Binary files data/icons/32x32/apps/ubuntuone-client.png 2009-09-28 18:15:00 +0000 and data/icons/32x32/apps/ubuntuone-client.png 1970-01-01 00:00:00 +0000 differ | 11 | Binary files data/icons/32x32/apps/ubuntuone-client.png 2009-09-28 18:15:00 +0000 and data/icons/32x32/apps/ubuntuone-client.png 1970-01-01 00:00:00 +0000 differ |
4753 | === added file 'data/icons/32x32/apps/ubuntuone.png' | |||
4754 | 12 | Binary files data/icons/32x32/apps/ubuntuone.png 1970-01-01 00:00:00 +0000 and data/icons/32x32/apps/ubuntuone.png 2010-02-18 00:10:25 +0000 differ | 12 | Binary files data/icons/32x32/apps/ubuntuone.png 1970-01-01 00:00:00 +0000 and data/icons/32x32/apps/ubuntuone.png 2010-02-18 00:10:25 +0000 differ |
4755 | === removed file 'data/icons/32x32/status/ubuntuone-client-offline.png' | |||
4756 | 13 | Binary files data/icons/32x32/status/ubuntuone-client-offline.png 2009-09-28 18:15:00 +0000 and data/icons/32x32/status/ubuntuone-client-offline.png 1970-01-01 00:00:00 +0000 differ | 13 | Binary files data/icons/32x32/status/ubuntuone-client-offline.png 2009-09-28 18:15:00 +0000 and data/icons/32x32/status/ubuntuone-client-offline.png 1970-01-01 00:00:00 +0000 differ |
4757 | === removed file 'data/icons/48x48/apps/ubuntuone-client.png' | |||
4758 | 14 | Binary files data/icons/48x48/apps/ubuntuone-client.png 2009-09-28 18:15:00 +0000 and data/icons/48x48/apps/ubuntuone-client.png 1970-01-01 00:00:00 +0000 differ | 14 | Binary files data/icons/48x48/apps/ubuntuone-client.png 2009-09-28 18:15:00 +0000 and data/icons/48x48/apps/ubuntuone-client.png 1970-01-01 00:00:00 +0000 differ |
4759 | === added file 'data/icons/48x48/apps/ubuntuone.png' | |||
4760 | 15 | Binary files data/icons/48x48/apps/ubuntuone.png 1970-01-01 00:00:00 +0000 and data/icons/48x48/apps/ubuntuone.png 2010-02-18 00:10:25 +0000 differ | 15 | Binary files data/icons/48x48/apps/ubuntuone.png 1970-01-01 00:00:00 +0000 and data/icons/48x48/apps/ubuntuone.png 2010-02-18 00:10:25 +0000 differ |
4761 | === removed file 'data/icons/48x48/status/ubuntuone-client-offline.png' | |||
4762 | 16 | Binary files data/icons/48x48/status/ubuntuone-client-offline.png 2009-09-28 18:15:00 +0000 and data/icons/48x48/status/ubuntuone-client-offline.png 1970-01-01 00:00:00 +0000 differ | 16 | Binary files data/icons/48x48/status/ubuntuone-client-offline.png 2009-09-28 18:15:00 +0000 and data/icons/48x48/status/ubuntuone-client-offline.png 1970-01-01 00:00:00 +0000 differ |
4763 | === added file 'data/logging.conf' | |||
4764 | --- data/logging.conf 1970-01-01 00:00:00 +0000 | |||
4765 | +++ data/logging.conf 2010-02-18 00:10:25 +0000 | |||
4766 | @@ -0,0 +1,13 @@ | |||
4767 | 1 | [logging] | ||
4768 | 2 | level.default = DEBUG | ||
4769 | 3 | level.parser = log_level | ||
4770 | 4 | level.help = Set the log level (TRACE, DEBUG, INFO, WARNING, ERROR, NOTE | ||
4771 | 5 | CRITICAL, FATAL) | ||
4772 | 6 | |||
4773 | 7 | file_size.default = 10485760 | ||
4774 | 8 | file_size.parser = int | ||
4775 | 9 | file_size.help = max file size (the file will be rotated) | ||
4776 | 10 | |||
4777 | 11 | backup_count.default = 5 | ||
4778 | 12 | backup_count.parser = int | ||
4779 | 13 | backup_count.help = number of rotated log files to keep around. | ||
4780 | 0 | 14 | ||
4781 | === added file 'data/logging.conf.in' | |||
4782 | --- data/logging.conf.in 1970-01-01 00:00:00 +0000 | |||
4783 | +++ data/logging.conf.in 2010-02-18 00:10:25 +0000 | |||
4784 | @@ -0,0 +1,13 @@ | |||
4785 | 1 | [logging] | ||
4786 | 2 | level.default = @LOG_LEVEL@ | ||
4787 | 3 | level.parser = log_level | ||
4788 | 4 | level.help = Set the log level (TRACE, DEBUG, INFO, WARNING, ERROR, NOTE | ||
4789 | 5 | CRITICAL, FATAL) | ||
4790 | 6 | |||
4791 | 7 | file_size.default = @LOG_FILE_SIZE@ | ||
4792 | 8 | file_size.parser = int | ||
4793 | 9 | file_size.help = max file size (the file will be rotated) | ||
4794 | 10 | |||
4795 | 11 | backup_count.default = 5 | ||
4796 | 12 | backup_count.parser = int | ||
4797 | 13 | backup_count.help = number of rotated log files to keep around. | ||
4798 | 0 | 14 | ||
4799 | === modified file 'data/syncdaemon.conf' | |||
4800 | --- data/syncdaemon.conf 2009-09-28 18:15:00 +0000 | |||
4801 | +++ data/syncdaemon.conf 2010-02-18 00:10:25 +0000 | |||
4802 | @@ -47,18 +47,13 @@ | |||
4803 | 47 | im_ok_with_being_root_pretty_please_let_me_be_root.help = Allows the syncdaemon | 47 | im_ok_with_being_root_pretty_please_let_me_be_root.help = Allows the syncdaemon |
4804 | 48 | to run as root. Please don't use this option. | 48 | to run as root. Please don't use this option. |
4805 | 49 | 49 | ||
4806 | 50 | log_level.default = INFO | ||
4807 | 51 | log_level.parser = log_level | ||
4808 | 52 | log_level.help = Set the log level (TRACE, DEBUG, INFO, WARNING, ERROR, NOTE | ||
4809 | 53 | CRITICAL, FATAL) | ||
4810 | 54 | |||
4811 | 55 | send_events_over_dbus.default = False | 50 | send_events_over_dbus.default = False |
4812 | 56 | send_events_over_dbus.parser = bool | 51 | send_events_over_dbus.parser = bool |
4813 | 57 | send_events_over_dbus.action = store_true | 52 | send_events_over_dbus.action = store_true |
4814 | 58 | send_events_over_dbus.help = Enable sending "Event" singals for each internal | 53 | send_events_over_dbus.help = Enable sending "Event" singals for each internal |
4815 | 59 | event | 54 | event |
4816 | 60 | 55 | ||
4818 | 61 | handshake_timeout.default = 30 | 56 | handshake_timeout.default = 50 |
4819 | 62 | handshake_timeout.parser = int | 57 | handshake_timeout.parser = int |
4820 | 63 | handshake_timeout.help = The timeout for the connection and related states, in seconds | 58 | handshake_timeout.help = The timeout for the connection and related states, in seconds |
4821 | 64 | 59 | ||
4822 | @@ -67,18 +62,23 @@ | |||
4823 | 67 | max_handshake_timeouts.help = The number of consecutive handshake timeouts | 62 | max_handshake_timeouts.help = The number of consecutive handshake timeouts |
4824 | 68 | before we give up | 63 | before we give up |
4825 | 69 | 64 | ||
4826 | 65 | udf_autosubscribe.default = True | ||
4827 | 66 | udf_autosubscribe.parser = bool | ||
4828 | 67 | udf_autosubscribe.help = Autosubsribe to new User Defined Folders, 'on' by default. | ||
4829 | 68 | (accepted values: 1/0, on/off, true/false and yes/no) | ||
4830 | 69 | |||
4831 | 70 | [bandwidth_throttling] | 70 | [bandwidth_throttling] |
4832 | 71 | on.default = False | 71 | on.default = False |
4833 | 72 | on.parser = bool | 72 | on.parser = bool |
4834 | 73 | on.action = store_true | 73 | on.action = store_true |
4835 | 74 | on.help = Enable bandwidth throttling | 74 | on.help = Enable bandwidth throttling |
4836 | 75 | 75 | ||
4838 | 76 | read_limit.default = -1 | 76 | read_limit.default = 2097152 |
4839 | 77 | read_limit.parser = throttling_limit | 77 | read_limit.parser = throttling_limit |
4840 | 78 | read_limit.metavar = DOWNLOAD_LIMIT | 78 | read_limit.metavar = DOWNLOAD_LIMIT |
4841 | 79 | read_limit.help = Set the download limit (bytes/sec). | 79 | read_limit.help = Set the download limit (bytes/sec). |
4842 | 80 | 80 | ||
4844 | 81 | write_limit.default = -1 | 81 | write_limit.default = 2097152 |
4845 | 82 | write_limit.parser = throttling_limit | 82 | write_limit.parser = throttling_limit |
4846 | 83 | write_limit.metavar = UPLOAD_LIMIT | 83 | write_limit.metavar = UPLOAD_LIMIT |
4847 | 84 | write_limit.help = Set the upload limit (bytes/sec). | 84 | write_limit.help = Set the upload limit (bytes/sec). |
4848 | 85 | 85 | ||
4849 | === removed file 'data/ubuntuone-client-applet.desktop.in' | |||
4850 | --- data/ubuntuone-client-applet.desktop.in 2009-08-11 16:45:00 +0000 | |||
4851 | +++ data/ubuntuone-client-applet.desktop.in 1970-01-01 00:00:00 +0000 | |||
4852 | @@ -1,9 +0,0 @@ | |||
4853 | 1 | [Desktop Entry] | ||
4854 | 2 | Name=Ubuntu One | ||
4855 | 3 | _Comment=Access and manage your Ubuntu One account | ||
4856 | 4 | Exec=ubuntuone-client-applet | ||
4857 | 5 | Icon=ubuntuone-client | ||
4858 | 6 | Terminal=false | ||
4859 | 7 | Type=Application | ||
4860 | 8 | Categories=GTK;Network;TrayIcon; | ||
4861 | 9 | X-Ubuntu-Gettext-Domain=ubuntuone-client | ||
4862 | 10 | 0 | ||
4863 | === modified file 'data/ubuntuone-icons.rendercache' | |||
4864 | --- data/ubuntuone-icons.rendercache 2009-09-28 18:15:00 +0000 | |||
4865 | +++ data/ubuntuone-icons.rendercache 2010-02-18 00:10:25 +0000 | |||
4866 | @@ -1,6 +1,5 @@ | |||
4867 | 1 | status/ubuntuone-client-error.png | 1 | status/ubuntuone-client-error.png |
4868 | 2 | status/ubuntuone-client-offline.png | ||
4869 | 3 | emblems/emblem-ubuntuone-unsynchronized.png | 2 | emblems/emblem-ubuntuone-unsynchronized.png |
4870 | 4 | status/ubuntuone-client-updating.png | 3 | status/ubuntuone-client-updating.png |
4871 | 5 | emblems/emblem-ubuntuone-updating.png | 4 | emblems/emblem-ubuntuone-updating.png |
4873 | 6 | apps/ubuntuone-client.png | 5 | apps/ubuntuone.png |
4874 | 7 | 6 | ||
4875 | === modified file 'data/ubuntuone-icons.svg' | |||
4876 | --- data/ubuntuone-icons.svg 2009-09-28 18:15:00 +0000 | |||
4877 | +++ data/ubuntuone-icons.svg 2010-02-18 00:10:25 +0000 | |||
4878 | @@ -17,7 +17,7 @@ | |||
4879 | 17 | height="600" | 17 | height="600" |
4880 | 18 | id="svg11300" | 18 | id="svg11300" |
4881 | 19 | sodipodi:version="0.32" | 19 | sodipodi:version="0.32" |
4883 | 20 | inkscape:version="0.47pre1 r21720" | 20 | inkscape:version="0.47 r22583" |
4884 | 21 | sodipodi:docname="ubuntuone-icons.svg" | 21 | sodipodi:docname="ubuntuone-icons.svg" |
4885 | 22 | inkscape:output_extension="org.inkscape.output.svg.inkscape" | 22 | inkscape:output_extension="org.inkscape.output.svg.inkscape" |
4886 | 23 | version="1.0" | 23 | version="1.0" |
4887 | @@ -1522,16 +1522,6 @@ | |||
4888 | 1522 | inkscape:vp_x="0 : 0.5 : 1" | 1522 | inkscape:vp_x="0 : 0.5 : 1" |
4889 | 1523 | sodipodi:type="inkscape:persp3d" /> | 1523 | sodipodi:type="inkscape:persp3d" /> |
4890 | 1524 | <linearGradient | 1524 | <linearGradient |
4891 | 1525 | inkscape:collect="always" | ||
4892 | 1526 | xlink:href="#XMLID_63_" | ||
4893 | 1527 | id="linearGradient6446" | ||
4894 | 1528 | gradientUnits="userSpaceOnUse" | ||
4895 | 1529 | gradientTransform="matrix(2.4956521,0,0,2.4956521,-223.97574,-53.226089)" | ||
4896 | 1530 | x1="113.0654" | ||
4897 | 1531 | y1="100.6621" | ||
4898 | 1532 | x2="113.0654" | ||
4899 | 1533 | y2="94.512703" /> | ||
4900 | 1534 | <linearGradient | ||
4901 | 1535 | x1="113.0654" | 1525 | x1="113.0654" |
4902 | 1536 | y1="100.6621" | 1526 | y1="100.6621" |
4903 | 1537 | x2="113.0654" | 1527 | x2="113.0654" |
4904 | @@ -1552,17 +1542,6 @@ | |||
4905 | 1552 | id="stop500" /> | 1542 | id="stop500" /> |
4906 | 1553 | </linearGradient> | 1543 | </linearGradient> |
4907 | 1554 | <radialGradient | 1544 | <radialGradient |
4908 | 1555 | inkscape:collect="always" | ||
4909 | 1556 | xlink:href="#XMLID_64_" | ||
4910 | 1557 | id="radialGradient6448" | ||
4911 | 1558 | gradientUnits="userSpaceOnUse" | ||
4912 | 1559 | gradientTransform="matrix(2.4956521,0,0,2.4956521,-223.97574,-53.226089)" | ||
4913 | 1560 | cx="113.0654" | ||
4914 | 1561 | cy="97.587898" | ||
4915 | 1562 | fx="113.667" | ||
4916 | 1563 | fy="98" | ||
4917 | 1564 | r="2.5631001" /> | ||
4918 | 1565 | <radialGradient | ||
4919 | 1566 | cx="113.0654" | 1545 | cx="113.0654" |
4920 | 1567 | cy="97.587898" | 1546 | cy="97.587898" |
4921 | 1568 | r="2.5631001" | 1547 | r="2.5631001" |
4922 | @@ -1588,16 +1567,6 @@ | |||
4923 | 1588 | id="stop511" /> | 1567 | id="stop511" /> |
4924 | 1589 | </radialGradient> | 1568 | </radialGradient> |
4925 | 1590 | <linearGradient | 1569 | <linearGradient |
4926 | 1591 | inkscape:collect="always" | ||
4927 | 1592 | xlink:href="#linearGradient4120" | ||
4928 | 1593 | id="linearGradient6430" | ||
4929 | 1594 | gradientUnits="userSpaceOnUse" | ||
4930 | 1595 | gradientTransform="matrix(0.3024372,0,0,0.3560377,303.56427,209.43456)" | ||
4931 | 1596 | x1="7.6046205" | ||
4932 | 1597 | y1="28.481176" | ||
4933 | 1598 | x2="36.183067" | ||
4934 | 1599 | y2="40.943935" /> | ||
4935 | 1600 | <linearGradient | ||
4936 | 1601 | id="linearGradient4120"> | 1570 | id="linearGradient4120"> |
4937 | 1602 | <stop | 1571 | <stop |
4938 | 1603 | style="stop-color:#555753;stop-opacity:1" | 1572 | style="stop-color:#555753;stop-opacity:1" |
4939 | @@ -1608,17 +1577,6 @@ | |||
4940 | 1608 | offset="1.0000000" | 1577 | offset="1.0000000" |
4941 | 1609 | id="stop4124" /> | 1578 | id="stop4124" /> |
4942 | 1610 | </linearGradient> | 1579 | </linearGradient> |
4943 | 1611 | <radialGradient | ||
4944 | 1612 | inkscape:collect="always" | ||
4945 | 1613 | xlink:href="#linearGradient4244" | ||
4946 | 1614 | id="radialGradient6427" | ||
4947 | 1615 | gradientUnits="userSpaceOnUse" | ||
4948 | 1616 | gradientTransform="matrix(0.4569434,0.4167071,-0.2525086,0.6234641,302.55498,203.55522)" | ||
4949 | 1617 | cx="15.571491" | ||
4950 | 1618 | cy="2.958519" | ||
4951 | 1619 | fx="15.571491" | ||
4952 | 1620 | fy="2.958519" | ||
4953 | 1621 | r="20.935818" /> | ||
4954 | 1622 | <linearGradient | 1580 | <linearGradient |
4955 | 1623 | id="linearGradient4244"> | 1581 | id="linearGradient4244"> |
4956 | 1624 | <stop | 1582 | <stop |
4957 | @@ -1634,39 +1592,6 @@ | |||
4958 | 1634 | offset="1.0000000" | 1592 | offset="1.0000000" |
4959 | 1635 | id="stop4248" /> | 1593 | id="stop4248" /> |
4960 | 1636 | </linearGradient> | 1594 | </linearGradient> |
4961 | 1637 | <radialGradient | ||
4962 | 1638 | inkscape:collect="always" | ||
4963 | 1639 | xlink:href="#linearGradient7497" | ||
4964 | 1640 | id="radialGradient6424" | ||
4965 | 1641 | gradientUnits="userSpaceOnUse" | ||
4966 | 1642 | gradientTransform="matrix(0.05803462,0.01454178,-0.00385459,0.0639583,303.56081,200.28873)" | ||
4967 | 1643 | cx="150.17931" | ||
4968 | 1644 | cy="301.80243" | ||
4969 | 1645 | fx="150.17931" | ||
4970 | 1646 | fy="301.80243" | ||
4971 | 1647 | r="106.18474" /> | ||
4972 | 1648 | <linearGradient | ||
4973 | 1649 | inkscape:collect="always" | ||
4974 | 1650 | id="linearGradient7497"> | ||
4975 | 1651 | <stop | ||
4976 | 1652 | style="stop-color:#ffffff;stop-opacity:1;" | ||
4977 | 1653 | offset="0" | ||
4978 | 1654 | id="stop7499" /> | ||
4979 | 1655 | <stop | ||
4980 | 1656 | style="stop-color:#ffffff;stop-opacity:0;" | ||
4981 | 1657 | offset="1" | ||
4982 | 1658 | id="stop7501" /> | ||
4983 | 1659 | </linearGradient> | ||
4984 | 1660 | <linearGradient | ||
4985 | 1661 | inkscape:collect="always" | ||
4986 | 1662 | xlink:href="#linearGradient7243" | ||
4987 | 1663 | id="linearGradient6442" | ||
4988 | 1664 | gradientUnits="userSpaceOnUse" | ||
4989 | 1665 | gradientTransform="matrix(5.0962816,0,0,5.0962816,25.377261,30.286921)" | ||
4990 | 1666 | x1="7.0625" | ||
4991 | 1667 | y1="35.28125" | ||
4992 | 1668 | x2="24.6875" | ||
4993 | 1669 | y2="35.28125" /> | ||
4994 | 1670 | <linearGradient | 1595 | <linearGradient |
4995 | 1671 | id="linearGradient7243"> | 1596 | id="linearGradient7243"> |
4996 | 1672 | <stop | 1597 | <stop |
4997 | @@ -1679,39 +1604,6 @@ | |||
4998 | 1679 | style="stop-color:#bbbbbb;stop-opacity:0.0000000;" /> | 1604 | style="stop-color:#bbbbbb;stop-opacity:0.0000000;" /> |
4999 | 1680 | </linearGradient> | 1605 | </linearGradient> |
5000 | 1681 | <linearGradient | 1606 | <linearGradient |
The diff has been truncated for viewing.