attached patch pulled from upstream SVN
(http://svn.gnome.org/viewvc/pyspi?view=revision&revision=79, except for
ChangeLog) and successfully built in lenny/testing pbuilder chroot.

corey
-- 
[EMAIL PROTECTED]
diff -urNpd pyspi-0.6.1.orig/cspi.pxd pyspi-0.6.1/cspi.pxd
--- pyspi-0.6.1.orig/cspi.pxd	2006-08-03 20:27:10.000000000 +0000
+++ pyspi-0.6.1/cspi.pxd	2007-11-06 13:54:36.000000000 +0000
@@ -14,9 +14,7 @@ cdef extern from "cspi/spi.h":
 
 	ctypedef struct AccessibleTextRange
 	ctypedef struct AccessibleKeySet
-	ctypedef enum SPIBoolean:
-		FALSE = 0,
-		TRUE
+	ctypedef unsigned int SPIBoolean
 
 	ctypedef struct AccessibleEvent:
 		char  *type
diff -urNpd pyspi-0.6.1.orig/pyspi.pyx pyspi-0.6.1/pyspi.pyx
--- pyspi-0.6.1.orig/pyspi.pyx	2006-10-02 16:46:41.000000000 +0000
+++ pyspi-0.6.1/pyspi.pyx	2007-11-06 13:54:36.000000000 +0000
@@ -25,9 +25,15 @@ cdef class Table (Base)
 cdef class Event (EventBase)
 cdef class DeviceEvent
 
-ctypedef enum bool:
+ctypedef unsigned int bool
+
+import __builtin__
+try:
+	False = __builtin__.False
+	True = __builtin__.True
+except AttributeError:
 	False = 0
-	True
+	True = 1
 
 # SPIExceptionCode values:
 (SPI_EXCEPTION_UNSPECIFIED, SPI_EXCEPTION_DISCONNECT, SPI_EXCEPTION_NO_IMPL, SPI_EXCEPTION_IO, SPI_EXCEPTION_BAD_DATA)=range(5) 
@@ -991,11 +997,11 @@ cdef class Hyperlink (Base):
 		Wraps cspi.AccessibleHyperlink_getObject
 		"""
 		self.__checkSelf ()
-		cdef Accessible object
-		object = Accessible ()
-		object.__setItem (cspi.AccessibleHyperlink_getObject (self.__item, i))
-		object.__checkSelf ()
-		return object
+		cdef Accessible obj
+		obj = Accessible ()
+		obj.__setItem (cspi.AccessibleHyperlink_getObject (self.__item, i))
+		obj.__checkSelf ()
+		return obj
 
 	def getURI (self, i):
 		"""
@@ -1551,7 +1557,7 @@ cdef class DeviceListener:
 	cdef cspi.AccessibleDeviceListener *__item
 	cdef public object modMasks
 
-	def __init__ (self, callback, eventMask = cspi.SPI_KEY_PRESSED | cspi.SPI_KEY_RELEASED):
+	def __init__ (self, callback, eventMask = <int> cspi.SPI_KEY_PRESSED | <int> cspi.SPI_KEY_RELEASED):
 		"""
 		Registers a python callback function to be called.
 

Reply via email to