diff options
| author | 2014-01-21 15:30:05 -0800 | |
|---|---|---|
| committer | 2014-03-12 19:23:48 +0100 | |
| commit | 2636941a177dcbbb0fc1d00fd3213632b55c9b7d (patch) | |
| tree | 6e1371e08dc6f322b127689900e9fdb473d69d7d | |
| parent | 6c905358d5f6f73120369891b5c28b26fd6feb29 (diff) | |
| download | libimobiledevice-2636941a177dcbbb0fc1d00fd3213632b55c9b7d.tar.gz libimobiledevice-2636941a177dcbbb0fc1d00fd3213632b55c9b7d.tar.bz2 | |
Changes to make cython HouseArrestClient functional.
Allow HouseArrestClient to initialize the AfcClient without running afc's
normal __cinit__ body, and expose send_command and send_request methods to
python.
Signed-off-by: Martin Szulecki <m.szulecki@libimobiledevice.org>
| -rw-r--r-- | cython/afc.pxi | 5 | ||||
| -rw-r--r-- | cython/house_arrest.pxi | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/cython/afc.pxi b/cython/afc.pxi index abc1180..e34588f 100644 --- a/cython/afc.pxi +++ b/cython/afc.pxi | |||
| @@ -171,8 +171,9 @@ cdef class AfcClient(BaseService): | |||
| 171 | __service_name__ = "com.apple.afc" | 171 | __service_name__ = "com.apple.afc" |
| 172 | cdef afc_client_t _c_client | 172 | cdef afc_client_t _c_client |
| 173 | 173 | ||
| 174 | def __cinit__(self, iDevice device not None, LockdownServiceDescriptor descriptor, *args, **kwargs): | 174 | def __cinit__(self, iDevice device = None, LockdownServiceDescriptor descriptor = None, *args, **kwargs): |
| 175 | self.handle_error(afc_client_new(device._c_dev, descriptor._c_service_descriptor, &(self._c_client))) | 175 | if (device is not None and descriptor is not None): |
| 176 | self.handle_error(afc_client_new(device._c_dev, descriptor._c_service_descriptor, &(self._c_client))) | ||
| 176 | 177 | ||
| 177 | def __dealloc__(self): | 178 | def __dealloc__(self): |
| 178 | cdef afc_error_t err | 179 | cdef afc_error_t err |
diff --git a/cython/house_arrest.pxi b/cython/house_arrest.pxi index 2a81213..54eebc1 100644 --- a/cython/house_arrest.pxi +++ b/cython/house_arrest.pxi | |||
| @@ -48,10 +48,10 @@ cdef class HouseArrestClient(PropertyListService): | |||
| 48 | cdef inline BaseError _error(self, int16_t ret): | 48 | cdef inline BaseError _error(self, int16_t ret): |
| 49 | return HouseArrestError(ret) | 49 | return HouseArrestError(ret) |
| 50 | 50 | ||
| 51 | cdef send_request(self, plist.Node message): | 51 | cpdef send_request(self, plist.Node message): |
| 52 | self.handle_error(house_arrest_send_request(self._c_client, message._c_node)) | 52 | self.handle_error(house_arrest_send_request(self._c_client, message._c_node)) |
| 53 | 53 | ||
| 54 | cdef send_command(self, bytes command, bytes appid): | 54 | cpdef send_command(self, bytes command, bytes appid): |
| 55 | self.handle_error(house_arrest_send_command(self._c_client, command, appid)) | 55 | self.handle_error(house_arrest_send_command(self._c_client, command, appid)) |
| 56 | 56 | ||
| 57 | cpdef plist.Node get_result(self): | 57 | cpdef plist.Node get_result(self): |
