* event.py: Make EventType a string descendent, it is now IDL
authoreitani <eitani@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Fri, 24 Aug 2007 18:15:30 +0000 (18:15 +0000)
committereitani <eitani@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Fri, 24 Aug 2007 18:15:30 +0000 (18:15 +0000)
compatable. Bug #467366.

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@943 e2bd861d-eb25-0410-b326-f6ed22b6b98c

pyatspi/ChangeLog
pyatspi/event.py

index 05521d5..e3da84a 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-24  Eitan Isaacson  <eitan@ascender.com>
+
+       * event.py: Make EventType a string descendent, it is now IDL
+       compatable. Bug #467366.
+
 2007-07-25  Eitan Isaacson  <eitan@ascender.com>
 
        * utils.py: Fixed typo in call for _findAllDescendants (bug #454090).
index 9b9295f..fef76aa 100644 (file)
@@ -178,7 +178,7 @@ class Event(object):
            (self.type, self.detail1, self.detail2, self.any_data,
             self.source, self.host_application)
   
-class EventType(object):
+class EventType(str):
   '''
   Wraps the AT-SPI event type string so its components can be accessed 
   individually as klass (can't use the keyword class), major, minor, and detail 
@@ -212,23 +212,17 @@ class EventType(object):
     @raise AttributeError: When the given event name is not a valid string 
     '''
     # get rid of any leading and trailing ':' separators
-    self.name = name.strip(':')
+    self.value = name.strip(':')
+    self.name = self.value # Backward compatability
     self.klass = None
     self.major = None
     self.minor = None
     self.detail = None
     
     # split type according to delimiters
-    split = self.name.split(':')
+    split = self.value.split(':')
     # loop over all the components
     for i in xrange(len(split)):
       # store values of attributes in this object
       setattr(self, self.format[i], split[i])
       
-  def __str__(self):
-    '''
-    @return: Full event name as human readable representation of this event 
-      type
-    @rtype: string
-    '''
-    return self.name