summaryrefslogtreecommitdiffstats
path: root/cython
diff options
context:
space:
mode:
authorGravatar Hao Zhou2014-12-09 11:35:04 +0800
committerGravatar Hao Zhou2014-12-09 11:35:04 +0800
commit05fa8d0a048cc92048a03eb06dd8883f9c76a632 (patch)
treed7a3051bbb01998bbf10033120860f99cea4fd59 /cython
parentc86c7b572949af76becd113230bc1784aadb1eb0 (diff)
downloadlibimobiledevice-05fa8d0a048cc92048a03eb06dd8883f9c76a632.tar.gz
libimobiledevice-05fa8d0a048cc92048a03eb06dd8883f9c76a632.tar.bz2
cython: Add get_path_for_bundle_identifier() method to InstallationProxyClient
Diffstat (limited to 'cython')
-rw-r--r--cython/installation_proxy.pxi19
1 files changed, 19 insertions, 0 deletions
diff --git a/cython/installation_proxy.pxi b/cython/installation_proxy.pxi
index ff541df..d2d9b38 100644
--- a/cython/installation_proxy.pxi
+++ b/cython/installation_proxy.pxi
@@ -15,6 +15,7 @@ cdef extern from "libimobiledevice/installation_proxy.h":
instproxy_error_t instproxy_client_new(idevice_t device, lockdownd_service_descriptor_t descriptor, instproxy_client_t *client)
instproxy_error_t instproxy_client_free(instproxy_client_t client)
+ instproxy_error_t instproxy_client_get_path_for_bundle_identifier(instproxy_client_t client, const char* bundle_id, char** path)
instproxy_error_t instproxy_browse(instproxy_client_t client, plist.plist_t client_options, plist.plist_t *result)
instproxy_error_t instproxy_install(instproxy_client_t client, char *pkg_path, plist.plist_t client_options, instproxy_status_cb_t status_cb, void *user_data)
@@ -59,6 +60,24 @@ cdef class InstallationProxyClient(PropertyListService):
err = instproxy_client_free(self._c_client)
self.handle_error(err)
+ cpdef get_path_for_bundle_identifier(self, bytes bundle_id):
+ cdef:
+ char* c_bundle_id = bundle_id
+ char* c_path = NULL
+ bytes result
+
+ try:
+ self.handle_error(instproxy_client_get_path_for_bundle_identifier(self._c_client, c_bundle_id, &c_path))
+ if c_path != NULL:
+ result = c_path
+ return result
+ else:
+ return None
+ except BaseError, e:
+ raise
+ finally:
+ free(c_path)
+
cpdef plist.Node browse(self, object client_options):
cdef:
plist.Node options