2008-12-17 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / pyatspi / desktop.py
index a75cf92..1ab2019 100644 (file)
@@ -12,7 +12,7 @@
 #along with this program; if not, write to the Free Software
 #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-import interfaces
+from interfaces import *
 from base import BaseProxyMeta
 from accessible import BoundingBox
 from state import StateSet
@@ -166,6 +166,12 @@ class Desktop(object):
                 self._app_name = ':'
                 self._acc_path = '/'
 
+        def __str__(self):
+                    try:
+                              return '[%s | %s]' % (self.getRoleName(), self.name)
+                    except Exception:
+                              return '[DEAD]'
+
         def __nonzero__(self):
                         return True
 
@@ -339,7 +345,7 @@ class Desktop(object):
 
         @property
         def interfaces(self):
-                return [interfaces.ATSPI_ACCESSIBLE, interfaces.ATSPI_COMPONENT]
+                return [ATSPI_ACCESSIBLE, ATSPI_COMPONENT]
 
         def queryInterface(self, interface):
                 """
@@ -347,9 +353,9 @@ class Desktop(object):
                 or raises a NotImplemented error if the given interface
                 is not supported.
                 """
-                if interface == interfaces.ATSPI_ACCESSIBLE:
+                if interface == ATSPI_ACCESSIBLE:
                                 return self
-                elif interface == interfaces.ATSPI_COMPONENT:
+                elif interface == ATSPI_COMPONENT:
                                 return DesktopComponent()
                 else:
                                 raise NotImplementedError(