Merge lp://qastaging/~dobey/ubuntuone-client/kde-dbus-fail into lp://qastaging/ubuntuone-client

Proposed by dobey
Status: Superseded
Proposed branch: lp://qastaging/~dobey/ubuntuone-client/kde-dbus-fail
Merge into: lp://qastaging/ubuntuone-client
Diff against target: None lines
To merge this branch: bzr merge lp://qastaging/~dobey/ubuntuone-client/kde-dbus-fail
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Abstain
Rick McBride (community) Approve
Review via email: mp+6551@code.qastaging.launchpad.net

This proposal has been superseded by a proposal from 2009-05-18.

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

Add a separate error handler for async dbus errors

Revision history for this message
Rick McBride (rmcbride) wrote :

Looks good! I'm setting up a more permanent kubuntu environment for future such branches.

review: Approve
9. By dobey

 Merged from trunk

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Now that each dbus call have an error handler, it would be nice that to handle the errors at least a log with the error and possibly the traceback?

review: Abstain
10. By dobey

 Merged from trunk
 Update the generic dbus handlers to be global functions

11. By dobey

 Log dbus errors as per suggestion from Guillermo

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubuntuone-client-applet'
2--- bin/ubuntuone-client-applet 2009-05-12 13:36:05 +0000
3+++ bin/ubuntuone-client-applet 2009-05-13 19:53:17 +0000
4@@ -114,13 +114,17 @@
5 return False
6
7 iface = dbus.Interface(client, "com.ubuntuone.Authentication")
8+ def errors(error):
9+ """Got an error."""
10+ raise error
11+
12 def handler():
13 """Simple handler to make dbus do stuff async."""
14 pass
15
16 iface.maybe_login("https://ubuntuone.com", "ubuntuone",
17 self.__signup,
18- reply_handler=handler, error_handler=handler)
19+ reply_handler=handler, error_handler=errors)
20 return False
21
22 def __start_storage_daemon_maybe(self):
23@@ -131,11 +135,15 @@
24 return False
25
26 iface = dbus.Interface(client, DBUS_IFACE_SYNC_NAME)
27+ def errors(error):
28+ """Got an error."""
29+ raise error
30+
31 def handler(data):
32 """Simple handler to make dbus to stuff async."""
33 pass
34
35- iface.get_rootdir(reply_handler=handler, error_handler=handler)
36+ iface.get_rootdir(reply_handler=handler, error_handler=errors)
37 return False
38
39 def __start_storage_daemon(self):
40@@ -282,6 +290,10 @@
41 "/")
42 iface = dbus.Interface(client,
43 "com.ubuntuone.Authentication")
44+ def errors(error):
45+ """Got an error."""
46+ raise error
47+
48 def handler():
49 """Simple handler to make dbus do stuff async."""
50 return
51@@ -290,7 +302,7 @@
52 "ubuntuone",
53 True,
54 reply_handler=handler,
55- error_handler=handler)
56+ error_handler=errors)
57
58 except DBusException, e:
59 raise e
60@@ -479,6 +491,10 @@
61
62 def __quit_applet(self, menuitem, data=None):
63 """Disconnects the daemon and closes the applet."""
64+ def errors(error):
65+ """Got an error."""
66+ raise error
67+
68 def handler():
69 """Simple handler to make dbus do stuff async."""
70 pass
71@@ -486,7 +502,7 @@
72 try:
73 client = self.__bus.get_object(DBUS_IFACE_NAME, "/")
74 iface = dbus.Interface(client, DBUS_IFACE_SYNC_NAME)
75- iface.disconnect(reply_handler=handler, error_handler=handler)
76+ iface.disconnect(reply_handler=handler, error_handler=errors)
77 except DBusException:
78 pass
79
80@@ -495,6 +511,10 @@
81
82 def __toggle_state(self, menuitem, data=None):
83 """Connects or disconnects the storage sync process."""
84+ def errors(error):
85+ """Got an error."""
86+ raise error
87+
88 def handler():
89 """Simple handler to make dbus do stuff async."""
90 pass
91@@ -506,9 +526,9 @@
92
93 iface = dbus.Interface(client, DBUS_IFACE_SYNC_NAME)
94 if self.__connected:
95- iface.disconnect(reply_handler=handler, error_handler=handler)
96+ iface.disconnect(reply_handler=handler, error_handler=errors)
97 else:
98- iface.connect(reply_handler=handler, error_handler=handler)
99+ iface.connect(reply_handler=handler, error_handler=errors)
100
101 def __open_folder(self, data=None):
102 """Opens the storage folder in the file manager."""

Subscribers

People subscribed via source and target branches