Skip to content
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.

Commit

Permalink
Fix Python 3.7 compatility
Browse files Browse the repository at this point in the history
Signed-off-by: Mattias Andrée <[email protected]>
  • Loading branch information
maandree committed Aug 9, 2018
1 parent f56c89e commit c49204d
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 150 deletions.
76 changes: 38 additions & 38 deletions src/libcoopgamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ def flush(self):
Send all pending outbound data
If this function or another function that sends a request to the server fails
with EINTR, call this function to complete the transfer. The `async` parameter
with EINTR, call this function to complete the transfer. The `async_ctx` parameter
will always be in a properly configured state if a function fails with EINTR.
'''
error = libcoopgamma_native.libcoopgamma_native_flush(self.address)
Expand Down Expand Up @@ -906,28 +906,28 @@ def skip_message(self):
'''
libcoopgamma_native.libcoopgamma_native_skip_message(self.address)

def get_crtcs_send(self, async):
def get_crtcs_send(self, async_ctx):
'''
List all available CRTC:s, send request part
@param async:AsyncContext Slot for information about the request that is
needed to identify and parse the response
@param async_ctx:AsyncContext Slot for information about the request that is
needed to identify and parse the response
'''

error = libcoopgamma_native.libcoopgamma_native_get_crtcs_send(self.address, async.address)
error = libcoopgamma_native.libcoopgamma_native_get_crtcs_send(self.address, async_ctx.address)
if error != 0:
raise ErrorReport.create_error(error)

def get_crtcs_recv(self, async):
def get_crtcs_recv(self, async_ctx):
'''
List all available CRTC:s, receive response part
@param async:AsyncContext Information about the request
@return :list<str> A list of names. You should only free the outer
pointer, inner pointers are subpointers of the
outer pointer and cannot be freed.
@param async_ctx:AsyncContext Information about the request
@return :list<str> A list of names. You should only free the outer
pointer, inner pointers are subpointers of the
outer pointer and cannot be freed.
'''
ret = libcoopgamma_native.libcoopgamma_native_get_crtcs_recv(self.address, async.address)
ret = libcoopgamma_native.libcoopgamma_native_get_crtcs_recv(self.address, async_ctx.address)
if isinstance(ret, int):
raise ErrorReport.create_error(ret)
return ret
Expand All @@ -949,26 +949,26 @@ def get_crtcs_sync(self):
raise ErrorReport.create_error(ret)
return ret

def get_gamma_info_send(self, crtc, async):
def get_gamma_info_send(self, crtc, async_ctx):
'''
Retrieve information about a CRTC:s gamma ramps, send request part
@param crtc:str The name of the CRT
@param async:AsyncContext Slot for information about the request that is
needed to identify and parse the response
@param crtc:str The name of the CRT
@param async_ctx:AsyncContext Slot for information about the request that is
needed to identify and parse the response
'''
error = libcoopgamma_native.libcoopgamma_native_get_gamma_info_send(crtc, self.address, async.address)
error = libcoopgamma_native.libcoopgamma_native_get_gamma_info_send(crtc, self.address, async_ctx.address)
if error != 0:
raise ErrorReport.create_error(error)

def get_gamma_info_recv(self, async):
def get_gamma_info_recv(self, async_ctx):
'''
Retrieve information about a CRTC:s gamma ramps, receive response part
@param async:AsyncContext Information about the request
@return :CRTCInfo Information about the CRTC
@param async_ctx:AsyncContext Information about the request
@return :CRTCInfo Information about the CRTC
'''
value = libcoopgamma_native.libcoopgamma_native_get_gamma_info_recv(self.address, async.address)
value = libcoopgamma_native.libcoopgamma_native_get_gamma_info_recv(self.address, async_ctx.address)
if isinstance(value, int):
raise ErrorReport.create_error(value)
(successful, value) = value
Expand Down Expand Up @@ -996,27 +996,27 @@ def get_gamma_info_sync(self, crtc):
raise ErrorReport.create_error(value)
return CRTCInfo(*value)

def get_gamma_send(self, query, async):
def get_gamma_send(self, query, async_ctx):
'''
Retrieve the current gamma ramp adjustments, send request part
@param query:FilterQuery The query to send
@param async:AsyncContext Slot for information about the request that is
needed to identify and parse the response
@param query:FilterQuery The query to send
@param async_ctx:AsyncContext Slot for information about the request that is
needed to identify and parse the response
'''
error = libcoopgamma_native.libcoopgamma_native_get_gamma_send(
query, self.address, async.address)
query, self.address, async_ctx.address)
if error != 0:
raise ErrorReport.create_error(error)

def get_gamma_recv(self, async):
def get_gamma_recv(self, async_ctx):
'''
Retrieve the current gamma ramp adjustments, receive response part
@param async:AsyncContext Information about the request
@return :FilterTable Filter table
@param async_ctx:AsyncContext Information about the request
@return :FilterTable Filter table
'''
value = libcoopgamma_native.libcoopgamma_native_get_gamma_recv(self.address, async.address)
value = libcoopgamma_native.libcoopgamma_native_get_gamma_recv(self.address, async_ctx.address)
if isinstance(value, int):
raise ErrorReport.create_error(value)
(successful, value) = value
Expand Down Expand Up @@ -1044,26 +1044,26 @@ def get_gamma_sync(self, query):
raise ErrorReport.create_error(value)
return FilterTable(*value)

def set_gamma_send(self, filtr, async):
def set_gamma_send(self, filtr, async_ctx):
'''
Apply, update, or remove a gamma ramp adjustment, send request part
@param filtr:Filter The filter to apply, update, or remove, gamma ramp
meta-data must match the CRTC's
@param async:AsyncContext Slot for information about the request that is
needed to identify and parse the response
@param filtr:Filter The filter to apply, update, or remove, gamma ramp
meta-data must match the CRTC's
@param async_ctx:AsyncContext Slot for information about the request that is
needed to identify and parse the response
'''
error = libcoopgamma_native.libcoopgamma_native_set_gamma_send(filtr, self.address, async.address)
error = libcoopgamma_native.libcoopgamma_native_set_gamma_send(filtr, self.address, async_ctx.address)
if error != 0:
raise ErrorReport.create_error(error)

def set_gamma_recv(self, async):
def set_gamma_recv(self, async_ctx):
'''
Apply, update, or remove a gamma ramp adjustment, receive response part
@param async:AsyncContext Information about the request
@param async_ctx:AsyncContext Information about the request
'''
error = libcoopgamma_native.libcoopgamma_native_set_gamma_recv(self.address, async.address)
error = libcoopgamma_native.libcoopgamma_native_set_gamma_recv(self.address, async_ctx.address)
if error is not None:
raise ErrorReport.create_error(error)

Expand Down
Loading

0 comments on commit c49204d

Please sign in to comment.