diff options
author | Bryan Forbes | 2010-04-09 16:52:30 -0500 |
---|---|---|
committer | Martin Szulecki | 2012-03-20 23:25:55 +0100 |
commit | bea5efe442daeab05d5d7a2e9d9e7b934ba6e684 (patch) | |
tree | 0346eebd799517c0976e640db7241d0c72cf7d95 /cython/sbservices.pxi | |
parent | acac4f819ccafa6f6bb945626f2e21ec2b75074b (diff) | |
download | libimobiledevice-bea5efe442daeab05d5d7a2e9d9e7b934ba6e684.tar.gz libimobiledevice-bea5efe442daeab05d5d7a2e9d9e7b934ba6e684.tar.bz2 |
Implemented hierarchy suggested by Martin S.
Implemented new BaseService constructors.
Moved LockdownClient to lockdown.pxi.
Implemented more of the afc interface.
Diffstat (limited to 'cython/sbservices.pxi')
-rw-r--r-- | cython/sbservices.pxi | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/cython/sbservices.pxi b/cython/sbservices.pxi index 6eece0a..28aa5a5 100644 --- a/cython/sbservices.pxi +++ b/cython/sbservices.pxi @@ -26,19 +26,13 @@ cdef class SpringboardServicesError(BaseError): BaseError.__init__(self, *args, **kwargs) cdef class SpringboardServicesClient(Base): + __service_name__ = "com.apple.springboardservices" cdef sbservices_client_t _c_client - def __cinit__(self, iDevice device not None, LockdownClient lockdown=None, *args, **kwargs): + def __cinit__(self, iDevice device not None, int port, *args, **kwargs): cdef: iDevice dev = device - LockdownClient lckd - if lockdown is None: - lckd = LockdownClient(dev) - else: - lckd = lockdown - port = lckd.start_service("com.apple.springboardservices") - err = SpringboardServicesError(sbservices_client_new(dev._c_dev, port, &(self._c_client))) - if err: raise err + self.handle_error(sbservices_client_new(dev._c_dev, port, &self._c_client)) def __dealloc__(self): if self._c_client is not NULL: @@ -52,7 +46,6 @@ cdef class SpringboardServicesClient(Base): def __get__(self): cdef: plist.plist_t c_node = NULL - plist.Node node sbservices_error_t err err = sbservices_get_icon_state(self._c_client, &c_node) try: @@ -61,11 +54,9 @@ cdef class SpringboardServicesClient(Base): if c_node != NULL: plist_free(c_node) raise - node = plist.plist_t_to_node(c_node) - return node + return plist.plist_t_to_node(c_node) def __set__(self, plist.Node newstate not None): - cdef plist.Node node = newstate - self.handle_error(sbservices_set_icon_state(self._c_client, node._c_node)) + self.handle_error(sbservices_set_icon_state(self._c_client, newstate._c_node)) cpdef bytes get_pngdata(self, bytes bundleId): cdef: |