Can't access the properties of a custom emulator

Bug #1191164 reported by Leo Arias
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Autopilot
Fix Released
Undecided
Christopher Lee
autopilot (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I have created a custom emulator that inherits from CustomEmulatorBase, and I'm using it while launching the application.
When I try to access a property from one of the classes that inherit from that emulator, I get

AttributeError: 'NoneType' object has no attribute 'introspection_iface'

This is because the class used as an introspection object has no _Backend.

We should copy the _Backend from the default introspection object, or create a new one for this custom one. I'm not sure how to do this.

Related branches

Revision history for this message
Leo Arias (elopio) wrote :

I've linked a branch with the test that throws this error.

Changed in autopilot:
status: New → Confirmed
Revision history for this message
Leo Arias (elopio) wrote :

With this I can make the test pass:

=== modified file 'autopilot/introspection/dbus.py'
--- autopilot/introspection/dbus.py 2013-05-23 23:09:52 +0000
+++ autopilot/introspection/dbus.py 2013-06-14 21:43:14 +0000
@@ -475,6 +475,8 @@
         name = get_classname_from_path(path)
         try:
             class_type = _object_registry[cls._id][name]
+ class_type = type(
+ str(name), (class_type,), {'_Backend': cls._Backend})
         except KeyError:
             logger.warning("Generating introspection instance for type '%s' based on generic class.", name)
             # override the _id attr from cls, since we don't want generated types

But it makes the other two fail, so I left it worse than before :D

Changed in autopilot:
assignee: nobody → Christopher Lee (veebers)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:autopilot at revision None, scheduled for release in autopilot, milestone 1.3.2

Changed in autopilot:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autopilot - 1.3.1+13.10.20130712-0ubuntu1

---------------
autopilot (1.3.1+13.10.20130712-0ubuntu1) saucy; urgency=low

  [ Łukasz 'sil2100' Zemczak ]
  * I don't like it, but it's the easiest way - make autopilot-touch
    Arch: any and make the python-ubuntu-platform-api [armhf] dependent.

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 265
 -- Ubuntu daily release <email address hidden> Fri, 12 Jul 2013 00:02:34 +0000

Changed in autopilot (Ubuntu):
status: New → Fix Released
Changed in autopilot:
milestone: none → 1.4
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.