Merge lp:~nataliabidart/ubuntuone-control-panel/more-logging-and-ids into lp:ubuntuone-control-panel
- more-logging-and-ids
- Merge into trunk
Proposed by
Natalia Bidart
Status: | Merged |
---|---|
Approved by: | Natalia Bidart |
Approved revision: | 36 |
Merged at revision: | 35 |
Proposed branch: | lp:~nataliabidart/ubuntuone-control-panel/more-logging-and-ids |
Merge into: | lp:ubuntuone-control-panel |
Diff against target: |
330 lines (+69/-24) 5 files modified
bin/ubuntuone-control-panel-backend (+2/-0) bin/ubuntuone-control-panel-gtk (+4/-3) ubuntuone/controlpanel/backend.py (+9/-1) ubuntuone/controlpanel/dbus_service.py (+47/-19) ubuntuone/controlpanel/integrationtests/test_dbus_service.py (+7/-1) |
To merge this branch: | bzr merge lp:~nataliabidart/ubuntuone-control-panel/more-logging-and-ids |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Roman Yepishev (community) | code | Approve | |
Martin Albisetti (community) | Approve | ||
Review via email: mp+43974@code.launchpad.net |
Commit message
* Added logging to dbus_service and backend.
* Error signals now sent the object id when available (LP: #691292).
Description of the change
Run the tests with:
./run-tests
To post a comment you must log in.
Revision history for this message
Martin Albisetti (beuno) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/ubuntuone-control-panel-backend' | |||
2 | --- bin/ubuntuone-control-panel-backend 2010-09-25 06:20:41 +0000 | |||
3 | +++ bin/ubuntuone-control-panel-backend 2010-12-16 21:10:31 +0000 | |||
4 | @@ -18,6 +18,8 @@ | |||
5 | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
6 | 19 | """Execute the DBus backend for the Ubuntu One control panel.""" | 19 | """Execute the DBus backend for the Ubuntu One control panel.""" |
7 | 20 | 20 | ||
8 | 21 | # Invalid name "ubuntuone-control-panel-backend", pylint: disable=C0103 | ||
9 | 22 | |||
10 | 21 | 23 | ||
11 | 22 | from ubuntuone.controlpanel import dbus_service | 24 | from ubuntuone.controlpanel import dbus_service |
12 | 23 | 25 | ||
13 | 24 | 26 | ||
14 | === modified file 'bin/ubuntuone-control-panel-gtk' | |||
15 | --- bin/ubuntuone-control-panel-gtk 2010-11-10 15:55:33 +0000 | |||
16 | +++ bin/ubuntuone-control-panel-gtk 2010-12-16 21:10:31 +0000 | |||
17 | @@ -18,7 +18,7 @@ | |||
18 | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 | """Execute the graphical interface for the Ubuntu One control panel.""" | 19 | """Execute the graphical interface for the Ubuntu One control panel.""" |
20 | 20 | 20 | ||
22 | 21 | import gtk | 21 | # Invalid name "ubuntuone-control-panel-gtk", pylint: disable=C0103 |
23 | 22 | 22 | ||
24 | 23 | import dbus.mainloop.glib | 23 | import dbus.mainloop.glib |
25 | 24 | 24 | ||
26 | @@ -26,6 +26,7 @@ | |||
27 | 26 | 26 | ||
28 | 27 | dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) | 27 | dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) |
29 | 28 | 28 | ||
30 | 29 | |||
31 | 29 | if __name__ == "__main__": | 30 | if __name__ == "__main__": |
34 | 30 | ui = ubuntuone.controlpanel.gtk.gui.ControlPanelWindow() | 31 | gui = ubuntuone.controlpanel.gtk.gui.ControlPanelWindow() |
35 | 31 | ui.main() | 32 | gui.main() |
36 | 32 | 33 | ||
37 | === modified file 'ubuntuone/controlpanel/backend.py' | |||
38 | --- ubuntuone/controlpanel/backend.py 2010-12-13 22:13:05 +0000 | |||
39 | +++ ubuntuone/controlpanel/backend.py 2010-12-16 21:10:31 +0000 | |||
40 | @@ -124,6 +124,7 @@ | |||
41 | 124 | credentials = yield dbus_client.get_credentials() | 124 | credentials = yield dbus_client.get_credentials() |
42 | 125 | returnValue(credentials["token"]) | 125 | returnValue(credentials["token"]) |
43 | 126 | 126 | ||
44 | 127 | @log_call(logger.debug) | ||
45 | 127 | @inlineCallbacks | 128 | @inlineCallbacks |
46 | 128 | def account_info(self): | 129 | def account_info(self): |
47 | 129 | """Get the user account info.""" | 130 | """Get the user account info.""" |
48 | @@ -140,6 +141,7 @@ | |||
49 | 140 | 141 | ||
50 | 141 | returnValue(result) | 142 | returnValue(result) |
51 | 142 | 143 | ||
52 | 144 | @log_call(logger.debug) | ||
53 | 143 | @inlineCallbacks | 145 | @inlineCallbacks |
54 | 144 | def devices_info(self): | 146 | def devices_info(self): |
55 | 145 | """Get the user devices info.""" | 147 | """Get the user devices info.""" |
56 | @@ -184,6 +186,7 @@ | |||
57 | 184 | return DEVICE_TYPE_PHONE, device_id[5:] | 186 | return DEVICE_TYPE_PHONE, device_id[5:] |
58 | 185 | return "No device", device_id | 187 | return "No device", device_id |
59 | 186 | 188 | ||
60 | 189 | @log_call(logger.info) | ||
61 | 187 | @inlineCallbacks | 190 | @inlineCallbacks |
62 | 188 | def change_device_settings(self, device_id, settings): | 191 | def change_device_settings(self, device_id, settings): |
63 | 189 | """Change the settings for the given device.""" | 192 | """Change the settings for the given device.""" |
64 | @@ -214,6 +217,7 @@ | |||
65 | 214 | # still pending: more work on the settings dict (LP: #673674) | 217 | # still pending: more work on the settings dict (LP: #673674) |
66 | 215 | returnValue(device_id) | 218 | returnValue(device_id) |
67 | 216 | 219 | ||
68 | 220 | @log_call(logger.warning) | ||
69 | 217 | @inlineCallbacks | 221 | @inlineCallbacks |
70 | 218 | def remove_device(self, device_id): | 222 | def remove_device(self, device_id): |
71 | 219 | """Remove a device's tokens from the sso server.""" | 223 | """Remove a device's tokens from the sso server.""" |
72 | @@ -222,7 +226,7 @@ | |||
73 | 222 | yield self.wc.call_api(api) | 226 | yield self.wc.call_api(api) |
74 | 223 | returnValue(device_id) | 227 | returnValue(device_id) |
75 | 224 | 228 | ||
77 | 225 | @log_call(logger.info) | 229 | @log_call(logger.debug) |
78 | 226 | @inlineCallbacks | 230 | @inlineCallbacks |
79 | 227 | def file_sync_status(self): | 231 | def file_sync_status(self): |
80 | 228 | """Return the status of the file sync service.""" | 232 | """Return the status of the file sync service.""" |
81 | @@ -233,6 +237,7 @@ | |||
82 | 233 | status = {} | 237 | status = {} |
83 | 234 | returnValue(self._process_file_sync_status(status)) | 238 | returnValue(self._process_file_sync_status(status)) |
84 | 235 | 239 | ||
85 | 240 | @log_call(logger.debug) | ||
86 | 236 | @inlineCallbacks | 241 | @inlineCallbacks |
87 | 237 | def volumes_info(self): | 242 | def volumes_info(self): |
88 | 238 | """Get the volumes info.""" | 243 | """Get the volumes info.""" |
89 | @@ -240,6 +245,7 @@ | |||
90 | 240 | # later, we may request shares info as well | 245 | # later, we may request shares info as well |
91 | 241 | returnValue(result) | 246 | returnValue(result) |
92 | 242 | 247 | ||
93 | 248 | @log_call(logger.debug) | ||
94 | 243 | @inlineCallbacks | 249 | @inlineCallbacks |
95 | 244 | def change_volume_settings(self, volume_id, settings): | 250 | def change_volume_settings(self, volume_id, settings): |
96 | 245 | """Change settings for 'volume_id'. | 251 | """Change settings for 'volume_id'. |
97 | @@ -268,11 +274,13 @@ | |||
98 | 268 | # is a folder or a share | 274 | # is a folder or a share |
99 | 269 | yield dbus_client.unsubscribe_folder(volume_id) | 275 | yield dbus_client.unsubscribe_folder(volume_id) |
100 | 270 | 276 | ||
101 | 277 | @log_call(logger.debug) | ||
102 | 271 | def query_bookmark_extension(self): | 278 | def query_bookmark_extension(self): |
103 | 272 | """True if the bookmark extension has been installed.""" | 279 | """True if the bookmark extension has been installed.""" |
104 | 273 | # still pending (LP: #673672) | 280 | # still pending (LP: #673672) |
105 | 274 | returnValue(False) | 281 | returnValue(False) |
106 | 275 | 282 | ||
107 | 283 | @log_call(logger.debug) | ||
108 | 276 | def install_bookmarks_extension(self): | 284 | def install_bookmarks_extension(self): |
109 | 277 | """Install the extension to sync bookmarks.""" | 285 | """Install the extension to sync bookmarks.""" |
110 | 278 | # still pending (LP: #673673) | 286 | # still pending (LP: #673673) |
111 | 279 | 287 | ||
112 | === modified file 'ubuntuone/controlpanel/dbus_service.py' | |||
113 | --- ubuntuone/controlpanel/dbus_service.py 2010-12-13 20:20:51 +0000 | |||
114 | +++ ubuntuone/controlpanel/dbus_service.py 2010-12-16 21:10:31 +0000 | |||
115 | @@ -80,10 +80,14 @@ | |||
116 | 80 | With this call, a Failure is transformed into a string-string dict. | 80 | With this call, a Failure is transformed into a string-string dict. |
117 | 81 | 81 | ||
118 | 82 | """ | 82 | """ |
120 | 83 | def inner(error, *a): | 83 | def inner(error, _=None): |
121 | 84 | """Do the Failure transformation.""" | 84 | """Do the Failure transformation.""" |
122 | 85 | error_dict = error_handler(error) | 85 | error_dict = error_handler(error) |
124 | 86 | return f(error_dict) | 86 | if _ is not None: |
125 | 87 | result = f(_, error_dict) | ||
126 | 88 | else: | ||
127 | 89 | result = f(error_dict) | ||
128 | 90 | return result | ||
129 | 87 | 91 | ||
130 | 88 | return inner | 92 | return inner |
131 | 89 | 93 | ||
132 | @@ -102,6 +106,7 @@ | |||
133 | 102 | 106 | ||
134 | 103 | # pylint: disable=C0103 | 107 | # pylint: disable=C0103 |
135 | 104 | 108 | ||
136 | 109 | @log_call(logger.debug) | ||
137 | 105 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") | 110 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") |
138 | 106 | def account_info(self): | 111 | def account_info(self): |
139 | 107 | """Find out the account info for the current logged in user.""" | 112 | """Find out the account info for the current logged in user.""" |
140 | @@ -109,16 +114,19 @@ | |||
141 | 109 | d.addCallback(self.AccountInfoReady) | 114 | d.addCallback(self.AccountInfoReady) |
142 | 110 | d.addErrback(transform_failure(self.AccountInfoError)) | 115 | d.addErrback(transform_failure(self.AccountInfoError)) |
143 | 111 | 116 | ||
144 | 117 | @log_call(logger.debug) | ||
145 | 112 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") | 118 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") |
146 | 113 | def AccountInfoReady(self, info): | 119 | def AccountInfoReady(self, info): |
147 | 114 | """The info for the current user is available right now.""" | 120 | """The info for the current user is available right now.""" |
148 | 115 | 121 | ||
149 | 122 | @log_call(logger.error) | ||
150 | 116 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") | 123 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") |
151 | 117 | def AccountInfoError(self, error): | 124 | def AccountInfoError(self, error): |
152 | 118 | """The info for the current user is currently unavailable.""" | 125 | """The info for the current user is currently unavailable.""" |
153 | 119 | 126 | ||
154 | 120 | #--- | 127 | #--- |
155 | 121 | 128 | ||
156 | 129 | @log_call(logger.debug) | ||
157 | 122 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") | 130 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") |
158 | 123 | def devices_info(self): | 131 | def devices_info(self): |
159 | 124 | """Find out the devices info for the logged in user.""" | 132 | """Find out the devices info for the logged in user.""" |
160 | @@ -126,46 +134,55 @@ | |||
161 | 126 | d.addCallback(self.DevicesInfoReady) | 134 | d.addCallback(self.DevicesInfoReady) |
162 | 127 | d.addErrback(transform_failure(self.DevicesInfoError)) | 135 | d.addErrback(transform_failure(self.DevicesInfoError)) |
163 | 128 | 136 | ||
164 | 137 | @log_call(logger.debug) | ||
165 | 129 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="aa{ss}") | 138 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="aa{ss}") |
166 | 130 | def DevicesInfoReady(self, info): | 139 | def DevicesInfoReady(self, info): |
167 | 131 | """The info for the devices is available right now.""" | 140 | """The info for the devices is available right now.""" |
168 | 132 | 141 | ||
169 | 142 | @log_call(logger.error) | ||
170 | 133 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") | 143 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") |
171 | 134 | def DevicesInfoError(self, error): | 144 | def DevicesInfoError(self, error): |
172 | 135 | """The info for the devices is currently unavailable.""" | 145 | """The info for the devices is currently unavailable.""" |
173 | 136 | 146 | ||
174 | 137 | #--- | 147 | #--- |
175 | 138 | 148 | ||
176 | 149 | @log_call(logger.info) | ||
177 | 139 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="sa{ss}") | 150 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="sa{ss}") |
179 | 140 | def change_device_settings(self, token, settings): | 151 | def change_device_settings(self, device_id, settings): |
180 | 141 | """Configure a given device.""" | 152 | """Configure a given device.""" |
182 | 142 | d = self.backend.change_device_settings(token, settings) | 153 | d = self.backend.change_device_settings(device_id, settings) |
183 | 143 | d.addCallback(self.DeviceSettingsChanged) | 154 | d.addCallback(self.DeviceSettingsChanged) |
185 | 144 | d.addErrback(transform_failure(self.DeviceSettingsChangeError)) | 155 | d.addErrback(transform_failure(self.DeviceSettingsChangeError), |
186 | 156 | device_id) | ||
187 | 145 | 157 | ||
188 | 158 | @log_call(logger.info) | ||
189 | 146 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="s") | 159 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="s") |
191 | 147 | def DeviceSettingsChanged(self, token): | 160 | def DeviceSettingsChanged(self, device_id): |
192 | 148 | """The settings for the device were changed.""" | 161 | """The settings for the device were changed.""" |
193 | 149 | 162 | ||
196 | 150 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") | 163 | @log_call(logger.error) |
197 | 151 | def DeviceSettingsChangeError(self, error): | 164 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="sa{ss}") |
198 | 165 | def DeviceSettingsChangeError(self, device_id, error): | ||
199 | 152 | """Problem changing settings for the device.""" | 166 | """Problem changing settings for the device.""" |
200 | 153 | 167 | ||
201 | 154 | #--- | 168 | #--- |
202 | 155 | 169 | ||
203 | 170 | @log_call(logger.warning) | ||
204 | 156 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="s") | 171 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="s") |
206 | 157 | def remove_device(self, token): | 172 | def remove_device(self, device_id): |
207 | 158 | """Remove a given device.""" | 173 | """Remove a given device.""" |
209 | 159 | d = self.backend.remove_device(token) | 174 | d = self.backend.remove_device(device_id) |
210 | 160 | d.addCallback(self.DeviceRemoved) | 175 | d.addCallback(self.DeviceRemoved) |
212 | 161 | d.addErrback(transform_failure(self.DeviceRemovalError)) | 176 | d.addErrback(transform_failure(self.DeviceRemovalError), device_id) |
213 | 162 | 177 | ||
214 | 178 | @log_call(logger.warning) | ||
215 | 163 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="s") | 179 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="s") |
217 | 164 | def DeviceRemoved(self, token): | 180 | def DeviceRemoved(self, device_id): |
218 | 165 | """The removal for the device was completed.""" | 181 | """The removal for the device was completed.""" |
219 | 166 | 182 | ||
222 | 167 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") | 183 | @log_call(logger.error) |
223 | 168 | def DeviceRemovalError(self, error): | 184 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="sa{ss}") |
224 | 185 | def DeviceRemovalError(self, device_id, error): | ||
225 | 169 | """Problem removing the device.""" | 186 | """Problem removing the device.""" |
226 | 170 | 187 | ||
227 | 171 | #--- | 188 | #--- |
228 | @@ -192,7 +209,7 @@ | |||
229 | 192 | else: | 209 | else: |
230 | 193 | self.FileSyncStatusError(error_handler(status_dict)) | 210 | self.FileSyncStatusError(error_handler(status_dict)) |
231 | 194 | 211 | ||
233 | 195 | @log_call(logger.info) | 212 | @log_call(logger.debug) |
234 | 196 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") | 213 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") |
235 | 197 | def file_sync_status(self): | 214 | def file_sync_status(self): |
236 | 198 | """Get the status of the file sync service.""" | 215 | """Get the status of the file sync service.""" |
237 | @@ -232,6 +249,7 @@ | |||
238 | 232 | 249 | ||
239 | 233 | #--- | 250 | #--- |
240 | 234 | 251 | ||
241 | 252 | @log_call(logger.debug) | ||
242 | 235 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") | 253 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") |
243 | 236 | def volumes_info(self): | 254 | def volumes_info(self): |
244 | 237 | """Find out the volumes info for the logged in user.""" | 255 | """Find out the volumes info for the logged in user.""" |
245 | @@ -251,23 +269,28 @@ | |||
246 | 251 | 269 | ||
247 | 252 | #--- | 270 | #--- |
248 | 253 | 271 | ||
249 | 272 | @log_call(logger.info) | ||
250 | 254 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="sa{ss}") | 273 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="sa{ss}") |
251 | 255 | def change_volume_settings(self, volume_id, settings): | 274 | def change_volume_settings(self, volume_id, settings): |
252 | 256 | """Configure a given volume.""" | 275 | """Configure a given volume.""" |
253 | 257 | d = self.backend.change_volume_settings(volume_id, settings) | 276 | d = self.backend.change_volume_settings(volume_id, settings) |
254 | 258 | d.addCallback(self.VolumeSettingsChanged) | 277 | d.addCallback(self.VolumeSettingsChanged) |
256 | 259 | d.addErrback(transform_failure(self.VolumeSettingsChangeError)) | 278 | d.addErrback(transform_failure(self.VolumeSettingsChangeError), |
257 | 279 | volume_id) | ||
258 | 260 | 280 | ||
259 | 281 | @log_call(logger.info) | ||
260 | 261 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="s") | 282 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="s") |
262 | 262 | def VolumeSettingsChanged(self, token): | 283 | def VolumeSettingsChanged(self, volume_id): |
263 | 263 | """The settings for the volume were changed.""" | 284 | """The settings for the volume were changed.""" |
264 | 264 | 285 | ||
267 | 265 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") | 286 | @log_call(logger.error) |
268 | 266 | def VolumeSettingsChangeError(self, error): | 287 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="sa{ss}") |
269 | 288 | def VolumeSettingsChangeError(self, volume_id, error): | ||
270 | 267 | """Problem changing settings for the volume.""" | 289 | """Problem changing settings for the volume.""" |
271 | 268 | 290 | ||
272 | 269 | #--- | 291 | #--- |
273 | 270 | 292 | ||
274 | 293 | @log_call(logger.debug) | ||
275 | 271 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") | 294 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") |
276 | 272 | def query_bookmark_extension(self): | 295 | def query_bookmark_extension(self): |
277 | 273 | """Check if the extension to sync bookmarks is installed.""" | 296 | """Check if the extension to sync bookmarks is installed.""" |
278 | @@ -275,16 +298,19 @@ | |||
279 | 275 | d.addCallback(self.QueryBookmarksResult) | 298 | d.addCallback(self.QueryBookmarksResult) |
280 | 276 | d.addErrback(transform_failure(self.QueryBookmarksError)) | 299 | d.addErrback(transform_failure(self.QueryBookmarksError)) |
281 | 277 | 300 | ||
282 | 301 | @log_call(logger.debug) | ||
283 | 278 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="b") | 302 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="b") |
284 | 279 | def QueryBookmarksResult(self, enabled): | 303 | def QueryBookmarksResult(self, enabled): |
285 | 280 | """The bookmark extension is or is not installed.""" | 304 | """The bookmark extension is or is not installed.""" |
286 | 281 | 305 | ||
287 | 306 | @log_call(logger.error) | ||
288 | 282 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") | 307 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") |
289 | 283 | def QueryBookmarksError(self, error): | 308 | def QueryBookmarksError(self, error): |
290 | 284 | """Problem getting the status of the extension.""" | 309 | """Problem getting the status of the extension.""" |
291 | 285 | 310 | ||
292 | 286 | #--- | 311 | #--- |
293 | 287 | 312 | ||
294 | 313 | @log_call(logger.info) | ||
295 | 288 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") | 314 | @method(dbus_interface=DBUS_PREFERENCES_IFACE, in_signature="") |
296 | 289 | def install_bookmarks_extension(self): | 315 | def install_bookmarks_extension(self): |
297 | 290 | """Install the extension to sync bookmarks.""" | 316 | """Install the extension to sync bookmarks.""" |
298 | @@ -292,10 +318,12 @@ | |||
299 | 292 | d.addCallback(lambda _: self.InstallBookmarksSuccess()) | 318 | d.addCallback(lambda _: self.InstallBookmarksSuccess()) |
300 | 293 | d.addErrback(transform_failure(self.InstallBookmarksError)) | 319 | d.addErrback(transform_failure(self.InstallBookmarksError)) |
301 | 294 | 320 | ||
302 | 321 | @log_call(logger.info) | ||
303 | 295 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="") | 322 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="") |
304 | 296 | def InstallBookmarksSuccess(self): | 323 | def InstallBookmarksSuccess(self): |
305 | 297 | """The extension to sync bookmarks has been installed.""" | 324 | """The extension to sync bookmarks has been installed.""" |
306 | 298 | 325 | ||
307 | 326 | @log_call(logger.error) | ||
308 | 299 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") | 327 | @signal(dbus_interface=DBUS_PREFERENCES_IFACE, signature="a{ss}") |
309 | 300 | def InstallBookmarksError(self, error): | 328 | def InstallBookmarksError(self, error): |
310 | 301 | """Problem installing the extension to sync bookmarks.""" | 329 | """Problem installing the extension to sync bookmarks.""" |
311 | 302 | 330 | ||
312 | === modified file 'ubuntuone/controlpanel/integrationtests/test_dbus_service.py' | |||
313 | --- ubuntuone/controlpanel/integrationtests/test_dbus_service.py 2010-12-13 22:13:05 +0000 | |||
314 | +++ ubuntuone/controlpanel/integrationtests/test_dbus_service.py 2010-12-16 21:10:31 +0000 | |||
315 | @@ -449,8 +449,14 @@ | |||
316 | 449 | 449 | ||
317 | 450 | """ | 450 | """ |
318 | 451 | 451 | ||
320 | 452 | def got_error_signal(error_dict): | 452 | def got_error_signal(*a): |
321 | 453 | """The error signal was received.""" | 453 | """The error signal was received.""" |
322 | 454 | if len(a) == 1: | ||
323 | 455 | error_dict = a[0] | ||
324 | 456 | else: | ||
325 | 457 | an_id, error_dict = a | ||
326 | 458 | self.assertEqual(an_id, args[0]) | ||
327 | 459 | |||
328 | 454 | self.assertEqual(error_dict[dbus_service.ERROR_TYPE], | 460 | self.assertEqual(error_dict[dbus_service.ERROR_TYPE], |
329 | 455 | 'AssertionError') | 461 | 'AssertionError') |
330 | 456 | self.deferred.callback("success") | 462 | self.deferred.callback("success") |
Looks ok. Tested by running it and finding nothing broken.