diff options
author | Mattias Andrée <maandree@kth.se> | 2016-08-19 18:36:24 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-08-19 18:36:24 +0200 |
commit | d72dcb6fd886d1a5a869d0ae0ae391889af5cb2d (patch) | |
tree | 3f3b4f6135fff7267b7ffb91760b43cc59e1905e /src/libcoopgamma.py | |
parent | _send functions have async parameter rather than creating their instance (diff) | |
download | pylibcoopgamma-d72dcb6fd886d1a5a869d0ae0ae391889af5cb2d.tar.gz pylibcoopgamma-d72dcb6fd886d1a5a869d0ae0ae391889af5cb2d.tar.bz2 pylibcoopgamma-d72dcb6fd886d1a5a869d0ae0ae391889af5cb2d.tar.xz |
work on test + fix errors
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/libcoopgamma.py')
-rw-r--r-- | src/libcoopgamma.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libcoopgamma.py b/src/libcoopgamma.py index 21843f6..7d561db 100644 --- a/src/libcoopgamma.py +++ b/src/libcoopgamma.py @@ -891,7 +891,7 @@ class Context: corresponding AsyncContext is not listed. ''' pending = [p.address for p in pending] - (successful, value) = libcoopgamma_native.libcoopgamma_native_flush(self.address, pending) + (successful, value) = libcoopgamma_native.libcoopgamma_native_synchronise(self.address, pending) if not successful: if value == 0: return None @@ -957,10 +957,9 @@ class Context: @param async:AsyncContext Slot for information about the request that is needed to identify and parse the response ''' - (successful, value) = libcoopgamma_native.libcoopgamma_native_get_gamma_info_send( - crtc, self.address, async.address) - if not successful: - raise ErrorReport.create_error(value) + error = libcoopgamma_native.libcoopgamma_native_get_gamma_info_send(crtc, self.address, async.address) + if error != 0: + raise ErrorReport.create_error(error) def get_gamma_info_recv(self, async): ''' @@ -969,7 +968,7 @@ class Context: @param async:AsyncContext Information about the request @return :CRTCInfo Information about the CRTC ''' - value = libcoopgamma_native.libcoopgamma_native_get_gamma_info_send(self.address, async.address) + value = libcoopgamma_native.libcoopgamma_native_get_gamma_info_recv(self.address, async.address) if isinstance(value, int): raise ErrorReport.create_error(value) (successful, value) = value @@ -1017,7 +1016,7 @@ class Context: @param async:AsyncContext Information about the request @return :FilterTable Filter table ''' - value = libcoopgamma_native.libcoopgamma_native_get_gamma_send(self.address, async.address) + value = libcoopgamma_native.libcoopgamma_native_get_gamma_recv(self.address, async.address) if isinstance(value, int): raise ErrorReport.create_error(value) (successful, value) = value @@ -1095,6 +1094,7 @@ class AsyncContext: @param buf:bytes? Buffer to unmarshal ''' + self.address = None if buf is None: (successful, value) = libcoopgamma_native.libcoopgamma_native_async_context_create() if not successful: @@ -1113,7 +1113,8 @@ class AsyncContext: ''' Destructor ''' - libcoopgamma_native.libcoopgamma_native_async_context_free(self.address) + if self.address is not None: + libcoopgamma_native.libcoopgamma_native_async_context_free(self.address) def __repr__(self): ''' |