summaryrefslogtreecommitdiffstats
path: root/cython/lockdown.pxi
diff options
context:
space:
mode:
authorGravatar Bryan Forbes2010-05-13 09:41:12 -0500
committerGravatar Martin Szulecki2012-03-20 23:25:55 +0100
commit7d4a26663a812c383738fc6390759266851cf953 (patch)
treec765b16c60909f49d935f0705049e6ab155cb9e7 /cython/lockdown.pxi
parent3877711296cbfa4a0bcafc3c5560609a1ce2d079 (diff)
downloadlibimobiledevice-7d4a26663a812c383738fc6390759266851cf953.tar.gz
libimobiledevice-7d4a26663a812c383738fc6390759266851cf953.tar.bz2
Python bindings for new sync interface.
Diffstat (limited to 'cython/lockdown.pxi')
-rw-r--r--cython/lockdown.pxi23
1 files changed, 23 insertions, 0 deletions
diff --git a/cython/lockdown.pxi b/cython/lockdown.pxi
index a904d12..8463738 100644
--- a/cython/lockdown.pxi
+++ b/cython/lockdown.pxi
@@ -41,6 +41,8 @@ cdef extern from "libimobiledevice/lockdown.h":
lockdownd_error_t lockdownd_deactivate(lockdownd_client_t client)
lockdownd_error_t lockdownd_enter_recovery(lockdownd_client_t client)
lockdownd_error_t lockdownd_goodbye(lockdownd_client_t client)
+ lockdownd_error_t lockdownd_get_sync_data_classes(lockdownd_client_t client, char ***classes, int *count)
+ lockdownd_error_t lockdownd_data_classes_free(char **classes)
cdef class LockdownError(BaseError):
def __init__(self, *args, **kwargs):
@@ -245,6 +247,27 @@ cdef class LockdownClient(PropertyListService):
cpdef goodbye(self):
self.handle_error(lockdownd_goodbye(self._c_client))
+ cpdef list get_sync_data_classes(self):
+ cdef:
+ char **classes = NULL
+ int count = 0
+ list result = []
+ bytes data_class
+
+ try:
+ self.handle_error(lockdownd_get_sync_data_classes(self._c_client, &classes, &count))
+
+ for i from 0 <= i < count:
+ data_class = classes[i]
+ result.append(data_class)
+
+ return result
+ except Exception, e:
+ raise
+ finally:
+ if classes != NULL:
+ lockdownd_data_classes_free(classes)
+
cdef inline int16_t _send(self, plist.plist_t node):
return lockdownd_send(self._c_client, node)