[Dextrose] [PATCH] Prevent multiple XS icon when re register

Martin Abente mabente at paraguayeduca.org
Sat Aug 7 20:16:30 EDT 2010


On Fri, 06 Aug 2010 21:18:37 -0400, Bernie Innocenti <bernie at codewiz.org>
wrote:
> El Fri, 06-08-2010 a las 14:59 -0400, Martin Abente escribió:
>> @@ -122,7 +127,7 @@ class VolumesToolbar(gtk.Toolbar):
>>      def _get_button_for_mount(self, mount):
>>          mount_point = mount.get_root().get_path()
>>          for button in self.get_children():
>> -            if type(button) == VolumeButton and \
>> +            if button.__class__ == VolumeButton and \
> 
> I do not understand why this change was necessary: doesn't type(obj)
> always return obj.__class__?
> 

type does not work for custom classes.

> Maybe isinstance() would be more appropriate here.

Ops, forgot about that, we could change it directly into the patch maybe?


More information about the Dextrose mailing list