2007-05-03 Peter Parente <parente@cs.unc.edu>
+ * accessible.py:
+ Fixed bug #435504, Add ignore flag to _mixClass
+
+2007-05-03 Peter Parente <parente@cs.unc.edu>
+
Patch from Eitan.
* registry.py:
Fixed bug #435284, Wrong params to deregister keystrokes
setter = None
setattr(cls, name, property(getter, setter))
-def _mixClass(cls, new_cls):
+def _mixClass(cls, new_cls, ignore=[]):
'''
Adds the methods in new_cls to cls. After mixing, all instances of cls will
have the new methods. If there is a method name clash, the method already in
@type cls: class
@param new_cls: Class containing features to add
@type new_cls: class
+ @param ignore: Ignore these methods from the mixin
+ @type ignore: iterable
'''
# loop over all names in the new class
for name, func in new_cls.__dict__.items():
- if name in ['_get_name', '_get_description']:
+ if name in ignore:
continue
if isinstance(func, types.FunctionType):
# build a new function that is a clone of the one from new_cls
# 2. mix the exception handlers into other Accessibility objects
map(_mixExceptions, [Accessibility.StateSet])
# 3. mix the new functions
-_mixClass(Accessibility.Accessible, _AccessibleMixin)
+_mixClass(Accessibility.Accessible, _AccessibleMixin,
+ ['_get_name', '_get_description'])
# 4. mix queryInterface convenience methods
_mixInterfaces(Accessibility.Accessible, constants.ALL_INTERFACES)