summaryrefslogtreecommitdiffstats
path: root/cython/imobiledevice.pyx
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-02-27 15:09:04 +0100
committerGravatar Martin Szulecki2013-02-27 15:09:04 +0100
commit12754fa1c93d810f408b2de291b44e39eaee7ee5 (patch)
tree8335afd95f9f672656027e9d04a2b4b91e1ce34e /cython/imobiledevice.pyx
parent86cc3f0d16643a04e40c14de3f8b7aab2222b3fc (diff)
downloadlibimobiledevice-12754fa1c93d810f408b2de291b44e39eaee7ee5.tar.gz
libimobiledevice-12754fa1c93d810f408b2de291b44e39eaee7ee5.tar.bz2
cython: Add support for receive_with_timeout() method on PropertyListService
Diffstat (limited to 'cython/imobiledevice.pyx')
-rw-r--r--cython/imobiledevice.pyx17
1 files changed, 17 insertions, 0 deletions
diff --git a/cython/imobiledevice.pyx b/cython/imobiledevice.pyx
index 9d2e13d..cdb9978 100644
--- a/cython/imobiledevice.pyx
+++ b/cython/imobiledevice.pyx
@@ -210,12 +210,29 @@ cdef class PropertyListService(BaseService):
210 plist.plist_free(c_node) 210 plist.plist_free(c_node)
211 raise 211 raise
212 212
213 cpdef object receive_with_timeout(self, int timeout_ms):
214 cdef:
215 plist.plist_t c_node = NULL
216 int16_t err
217 err = self._receive_with_timeout(&c_node, timeout_ms)
218 try:
219 self.handle_error(err)
220
221 return plist.plist_t_to_node(c_node)
222 except BaseError, e:
223 if c_node != NULL:
224 plist.plist_free(c_node)
225 raise
226
213 cdef int16_t _send(self, plist.plist_t node): 227 cdef int16_t _send(self, plist.plist_t node):
214 raise NotImplementedError("send is not implemented") 228 raise NotImplementedError("send is not implemented")
215 229
216 cdef int16_t _receive(self, plist.plist_t* c_node): 230 cdef int16_t _receive(self, plist.plist_t* c_node):
217 raise NotImplementedError("receive is not implemented") 231 raise NotImplementedError("receive is not implemented")
218 232
233 cdef int16_t _receive_with_timeout(self, plist.plist_t* c_node, int timeout_ms):
234 raise NotImplementedError("receive_with_timeout is not implemented")
235
219cdef class DeviceLinkService(PropertyListService): 236cdef class DeviceLinkService(PropertyListService):
220 pass 237 pass
221 238