diff options
Diffstat (limited to 'cython/imobiledevice.pyx')
| -rw-r--r-- | cython/imobiledevice.pyx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/cython/imobiledevice.pyx b/cython/imobiledevice.pyx index 654288e..ffaa3c1 100644 --- a/cython/imobiledevice.pyx +++ b/cython/imobiledevice.pyx | |||
| @@ -44,9 +44,9 @@ cdef extern from "libimobiledevice/libimobiledevice.h": | |||
| 44 | idevice_error_t idevice_get_device_list(char ***devices, int *count) | 44 | idevice_error_t idevice_get_device_list(char ***devices, int *count) |
| 45 | idevice_error_t idevice_device_list_free(char **devices) | 45 | idevice_error_t idevice_device_list_free(char **devices) |
| 46 | void idevice_set_debug_level(int level) | 46 | void idevice_set_debug_level(int level) |
| 47 | idevice_error_t idevice_new(idevice_t *device, char *uuid) | 47 | idevice_error_t idevice_new(idevice_t *device, char *udid) |
| 48 | idevice_error_t idevice_free(idevice_t device) | 48 | idevice_error_t idevice_free(idevice_t device) |
| 49 | idevice_error_t idevice_get_uuid(idevice_t device, char** uuid) | 49 | idevice_error_t idevice_get_udid(idevice_t device, char** udid) |
| 50 | idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle) | 50 | idevice_error_t idevice_get_handle(idevice_t device, uint32_t *handle) |
| 51 | idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection) | 51 | idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connection_t *connection) |
| 52 | idevice_error_t idevice_disconnect(idevice_connection_t connection) | 52 | idevice_error_t idevice_disconnect(idevice_connection_t connection) |
| @@ -75,14 +75,14 @@ cdef class iDeviceEvent: | |||
| 75 | raise TypeError("iDeviceEvent cannot be instantiated") | 75 | raise TypeError("iDeviceEvent cannot be instantiated") |
| 76 | 76 | ||
| 77 | def __str__(self): | 77 | def __str__(self): |
| 78 | return 'iDeviceEvent: %s (%s)' % (self.event == IDEVICE_DEVICE_ADD and 'Add' or 'Remove', self.uuid) | 78 | return 'iDeviceEvent: %s (%s)' % (self.event == IDEVICE_DEVICE_ADD and 'Add' or 'Remove', self.udid) |
| 79 | 79 | ||
| 80 | property event: | 80 | property event: |
| 81 | def __get__(self): | 81 | def __get__(self): |
| 82 | return self._c_event.event | 82 | return self._c_event.event |
| 83 | property uuid: | 83 | property udid: |
| 84 | def __get__(self): | 84 | def __get__(self): |
| 85 | return self._c_event.uuid | 85 | return self._c_event.udid |
| 86 | property conn_type: | 86 | property conn_type: |
| 87 | def __get__(self): | 87 | def __get__(self): |
| 88 | return self._c_event.conn_type | 88 | return self._c_event.conn_type |
| @@ -137,13 +137,13 @@ cdef class iDeviceConnection(Base): | |||
| 137 | from libc.stdlib cimport * | 137 | from libc.stdlib cimport * |
| 138 | 138 | ||
| 139 | cdef class iDevice(Base): | 139 | cdef class iDevice(Base): |
| 140 | def __cinit__(self, object uuid=None, *args, **kwargs): | 140 | def __cinit__(self, object udid=None, *args, **kwargs): |
| 141 | cdef char* c_uuid = NULL | 141 | cdef char* c_udid = NULL |
| 142 | if isinstance(uuid, basestring): | 142 | if isinstance(udid, basestring): |
| 143 | c_uuid = <bytes>uuid | 143 | c_udid = <bytes>udid |
| 144 | elif uuid is not None: | 144 | elif udid is not None: |
| 145 | raise TypeError("iDevice's constructor takes a string or None as the uuid argument") | 145 | raise TypeError("iDevice's constructor takes a string or None as the udid argument") |
| 146 | self.handle_error(idevice_new(&self._c_dev, c_uuid)) | 146 | self.handle_error(idevice_new(&self._c_dev, c_udid)) |
| 147 | 147 | ||
| 148 | def __dealloc__(self): | 148 | def __dealloc__(self): |
| 149 | if self._c_dev is not NULL: | 149 | if self._c_dev is not NULL: |
| @@ -169,18 +169,18 @@ cdef class iDevice(Base): | |||
| 169 | if c_conn != NULL: | 169 | if c_conn != NULL: |
| 170 | idevice_disconnect(c_conn) | 170 | idevice_disconnect(c_conn) |
| 171 | 171 | ||
| 172 | property uuid: | 172 | property udid: |
| 173 | def __get__(self): | 173 | def __get__(self): |
| 174 | cdef: | 174 | cdef: |
| 175 | char* uuid | 175 | char* udid |
| 176 | idevice_error_t err | 176 | idevice_error_t err |
| 177 | err = idevice_get_uuid(self._c_dev, &uuid) | 177 | err = idevice_get_udid(self._c_dev, &udid) |
| 178 | try: | 178 | try: |
| 179 | self.handle_error(err) | 179 | self.handle_error(err) |
| 180 | return uuid | 180 | return udid |
| 181 | except Exception, e: | 181 | except Exception, e: |
| 182 | if uuid != NULL: | 182 | if udid != NULL: |
| 183 | free(uuid) | 183 | free(udid) |
| 184 | property handle: | 184 | property handle: |
| 185 | def __get__(self): | 185 | def __get__(self): |
| 186 | cdef uint32_t handle | 186 | cdef uint32_t handle |
