DevTray bug, can't call static methods via dbus

Stephen Watson <[email protected]> Sat, 22 Nov 2008 15:15:53 +0000
Newsgroups gmane.comp.desktop.rox.devel
Message-ID <[email protected]>
At some point recently something changed on this machine and DevTray stopped
handling media being removed.  The attached BugReport gives the gory
details, but the error was basically "TypeError: 'staticmethod' object is
not callable".

The attached patch fixes the error by connecting a conventional function to
the DeviceRemoved signal and having that call a classmethod instead.

-- 
Stephen Watson     http://www.kerofin.demon.co.uk/

"I'm the Doctor, and you're in the biggest Library in the universe. Look me
up!"

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
rox-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rox-devel
BugReport (application/octet-stream, 2 KB) - not displayed
devtray-staticmethod.patch (application/octet-stream, 718 B)
--- /home/stephen/.cache/0install.net/implementations/sha1new=598fc63e479e0b5a5d7a2717b1bc61d357f1b599/DevTray/device.py	2008-04-08 08:58:17.000000000 +0100
+++ device.py	2008-11-09 13:06:27.000000000 +0000
@@ -1,13 +1,15 @@
 from devtray_globals import *
 
+def __removed(udi):
+	Device._removed(udi)
+hal_manager.connect_to_signal('DeviceRemoved', __removed)
 
 class Device(object):
 	__devices = {}
 	
-	@staticmethod
-	def __removed(udi):
-		del __devices[udi]
-	hal_manager.connect_to_signal('DeviceRemoved', __removed)
+	@classmethod
+	def _removed(cls, udi):
+		del cls.__devices[udi]	
 	
 	def __new__(cls, udi, interface = 'org.freedesktop.Hal.Device'):
 		device = cls.__devices.get(udi, {}).get(interface)