diff options
| author | 2010-03-17 10:27:44 -0500 | |
|---|---|---|
| committer | 2012-03-20 23:25:54 +0100 | |
| commit | 68c63cc1382326e7f0cb4e6bd863427f9069ca05 (patch) | |
| tree | d4094cb7f98cdb081e614c519f6cf8d0f9080c18 /cython/imobiledevice.pxd | |
| parent | cfe6244f8954efce4ef12b9b4338cc0d41a9ff40 (diff) | |
| download | libimobiledevice-68c63cc1382326e7f0cb4e6bd863427f9069ca05.tar.gz libimobiledevice-68c63cc1382326e7f0cb4e6bd863427f9069ca05.tar.bz2 | |
Added base class for more efficient error handling.
Diffstat (limited to 'cython/imobiledevice.pxd')
| -rw-r--r-- | cython/imobiledevice.pxd | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cython/imobiledevice.pxd b/cython/imobiledevice.pxd index bdebe33..0557d37 100644 --- a/cython/imobiledevice.pxd +++ b/cython/imobiledevice.pxd | |||
| @@ -10,6 +10,10 @@ cdef class BaseError(Exception): | |||
| 10 | cdef dict _lookup_table | 10 | cdef dict _lookup_table |
| 11 | cdef int16_t _c_errcode | 11 | cdef int16_t _c_errcode |
| 12 | 12 | ||
| 13 | cdef class Base: | ||
| 14 | cdef inline int handle_error(self, int16_t ret) except -1 | ||
| 15 | cdef inline BaseError _error(self, int16_t ret) | ||
| 16 | |||
| 13 | cdef class iDeviceError(BaseError): pass | 17 | cdef class iDeviceError(BaseError): pass |
| 14 | 18 | ||
| 15 | cdef extern from "libimobiledevice/libimobiledevice.h": | 19 | cdef extern from "libimobiledevice/libimobiledevice.h": |
| @@ -29,7 +33,7 @@ cdef extern from "libimobiledevice/libimobiledevice.h": | |||
| 29 | cdef class iDeviceEvent: | 33 | cdef class iDeviceEvent: |
| 30 | cdef const_idevice_event_t _c_event | 34 | cdef const_idevice_event_t _c_event |
| 31 | 35 | ||
| 32 | cdef class iDevice: | 36 | cdef class iDevice(Base): |
| 33 | cdef idevice_t _c_dev | 37 | cdef idevice_t _c_dev |
| 34 | 38 | ||
| 35 | cdef class LockdownError(BaseError): pass | 39 | cdef class LockdownError(BaseError): pass |
| @@ -39,7 +43,7 @@ cdef extern from "libimobiledevice/lockdown.h": | |||
| 39 | pass | 43 | pass |
| 40 | ctypedef lockdownd_client_int *lockdownd_client_t | 44 | ctypedef lockdownd_client_int *lockdownd_client_t |
| 41 | 45 | ||
| 42 | cdef class LockdownClient: | 46 | cdef class LockdownClient(Base): |
| 43 | cdef lockdownd_client_t _c_client | 47 | cdef lockdownd_client_t _c_client |
| 44 | cpdef int start_service(self, service) | 48 | cpdef int start_service(self, service) |
| 45 | cpdef goodbye(self) | 49 | cpdef goodbye(self) |
