Merge lp:~thomir-deactivatedaccount/autopilot/workaround-null-signals-and-methods into lp:autopilot

Proposed by Thomi Richards
Status: Merged
Approved by: Christopher Lee
Approved revision: 150
Merged at revision: 150
Proposed branch: lp:~thomir-deactivatedaccount/autopilot/workaround-null-signals-and-methods
Merge into: lp:autopilot
Diff against target: 24 lines (+8/-2)
1 file modified
autopilot/introspection/qt.py (+8/-2)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/autopilot/workaround-null-signals-and-methods
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Christopher Lee (community) Approve
Review via email: mp+153468@code.launchpad.net

Commit message

Autopilot now handles empty replies from listMethods and listSignals methods on Qt applications.

Description of the change

Problem:

There's an issue in autopilot-qt that means that the signal and slot extension methods no longer function correctly. This isn't so bad, except it causes autopilot to crash inside the vis tool (not fatally however).

Solution:

This branch makes autopilot aware of the possibility that the remote app may send back an empty reply, instead of the list it was expecting.

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

Good catch

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/introspection/qt.py'
2--- autopilot/introspection/qt.py 2012-12-03 01:57:49 +0000
3+++ autopilot/introspection/qt.py 2013-03-14 21:40:28 +0000
4@@ -154,12 +154,18 @@
5 def get_signals(self):
6 """Get a list of the signals available on this object."""
7 dbus_signal_list = self._get_qt_iface().ListSignals(self.id)
8- return [str(sig) for sig in dbus_signal_list]
9+ if dbus_signal_list is not None:
10+ return [str(sig) for sig in dbus_signal_list]
11+ else:
12+ return []
13
14 def get_slots(self):
15 """Get a list of the slots available on this object."""
16 dbus_slot_list = self._get_qt_iface().ListMethods(self.id)
17- return [str(sig) for sig in dbus_slot_list]
18+ if dbus_slot_list is not None:
19+ return [str(sig) for sig in dbus_slot_list]
20+ else:
21+ return []
22
23
24 class QtSlotProxy(object):

Subscribers

People subscribed via source and target branches