Merge lp:~ken-vandine/gwibber/gwibber-follow-dbus-name-changes into lp:~gwibber-committers/gwibber/trunk.merge.backup

Proposed by Ken VanDine
Status: Merged
Merged at revision: not available
Proposed branch: lp:~ken-vandine/gwibber/gwibber-follow-dbus-name-changes
Merge into: lp:~gwibber-committers/gwibber/trunk.merge.backup
Diff against target: 78 lines
3 files modified
gwibber/client.py (+8/-3)
gwibber/microblog/__init__.py (+4/-1)
gwibber/server.py (+4/-1)
To merge this branch: bzr merge lp:~ken-vandine/gwibber/gwibber-follow-dbus-name-changes
Reviewer Review Type Date Requested Status
gwibber-committers Pending
Review via email: mp+12845@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ken VanDine (ken-vandine) wrote :

This makes both the client and the server follow name changes. Therefore if either restarts the other can still communicate with it. This should make it far more robust.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gwibber/client.py'
2--- gwibber/client.py 2009-09-25 12:57:19 +0000
3+++ gwibber/client.py 2009-10-04 16:25:18 +0000
4@@ -143,10 +143,14 @@
5 self.connect("focus-in-event", self.on_focus)
6 self.connect("delete-event", self.on_delete)
7
8+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
9 bus = dbus.SessionBus()
10- db_mb_obj = bus.get_object("com.Gwibber", "/com/gwibber/Microblog")
11- db_msg_obj = bus.get_object("com.Gwibber", "/com/gwibber/Messages")
12
13+ db_mb_obj = bus.get_object("com.Gwibber", "/com/gwibber/Microblog",
14+ follow_name_owner_changes = True, introspect = False)
15+ db_msg_obj = bus.get_object("com.Gwibber", "/com/gwibber/Messages",
16+ follow_name_owner_changes = True, introspect = False)
17+
18 self.microblog = dbus.Interface(db_mb_obj, "com.Gwibber")
19 self.messages = dbus.Interface(db_msg_obj, "com.Gwibber")
20 self.messages.connect_to_signal("operations_started", self.on_operation_started)
21@@ -154,6 +158,7 @@
22 self.messages.connect_to_signal("finish_loading", self.on_finish_loading)
23 self.messages.connect_to_signal("error", self.on_error)
24
25+
26 self.protocols = self.microblog.protocols()
27 self.features = self.microblog.features()
28
29@@ -187,7 +192,6 @@
30 self.apply_ui_element_settings)
31
32 self.apply_ui_element_settings()
33- self.register_operations()
34
35 # Set the starting path
36 # TODO: load the user's path from the previous session
37@@ -749,6 +753,7 @@
38 return feature in self.protocols[protocol]["features"]
39
40 def refresh(self):
41+ self.register_operations()
42 self.microblog.perform_scheduled_operations()
43
44 def register_operations(self):
45
46=== modified file 'gwibber/microblog/__init__.py'
47--- gwibber/microblog/__init__.py 2009-09-21 22:12:49 +0000
48+++ gwibber/microblog/__init__.py 2009-10-04 16:25:18 +0000
49@@ -244,7 +244,10 @@
50 del self.scheduled_operations[i]
51
52 def perform_scheduled_operations(self):
53- for o in list(self.scheduled_operations.values()):
54+ operations = list(self.scheduled_operations.values())
55+ if len(operations) == 0:
56+ logger.debug("No operations scheduled")
57+ for o in operations:
58 self.perform_scheduled_operation(o)
59
60 def perform_scheduled_operation(self, o):
61
62=== modified file 'gwibber/server.py'
63--- gwibber/server.py 2009-09-24 14:03:18 +0000
64+++ gwibber/server.py 2009-10-04 16:25:18 +0000
65@@ -215,9 +215,12 @@
66 self.show_notification_bubble(message)
67
68 def on_indicator_activate(self, indicator):
69+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
70 client_bus = dbus.SessionBus()
71 try:
72- client_obj = client_bus.get_object("com.GwibberClient", "/com/GwibberClient")
73+ client_obj = client_bus.get_object("com.GwibberClient",
74+ "/com/GwibberClient", follow_name_owner_changes = True,
75+ introspect = False)
76 gw = dbus.Interface(client_obj, "com.GwibberClient")
77 gw.focus_client(reply_handler=self.handle_focus_reply,
78 error_handler=self.handle_focus_error)

Subscribers

People subscribed via source and target branches

to all changes: