diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-09-02 09:47:48 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-09-02 09:47:48 +0200 |
commit | 19241f627259fef20231a505230c19e63ae807a0 (patch) | |
tree | a91dba6b4808e754d63b34b12d287ee7e694f7d9 /src/libgamma_facade.py | |
parent | misc (diff) | |
download | pylibgamma-19241f627259fef20231a505230c19e63ae807a0.tar.gz pylibgamma-19241f627259fef20231a505230c19e63ae807a0.tar.bz2 pylibgamma-19241f627259fef20231a505230c19e63ae807a0.tar.xz |
fix misc errors + write test
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/libgamma_facade.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/libgamma_facade.py b/src/libgamma_facade.py index 830a0b9..5920a5b 100644 --- a/src/libgamma_facade.py +++ b/src/libgamma_facade.py @@ -22,7 +22,7 @@ from libgamma_method import MethodCapabilities -def list_methods(operation : int) -> list +def list_methods(operation : int) -> list: ''' List available adjustment methods by their order of preference based on the environment. @@ -35,8 +35,8 @@ def list_methods(operation : int) -> list Other values invoke undefined behaviour. @return :list<int> A list of available adjustment methods. ''' - from libgamma_native_method import libgamma_native_list_methods - return libgamma_native_list_methods(method) + from libgamma_native_facade import libgamma_native_list_methods + return libgamma_native_list_methods(operation) def is_method_available(method : int) -> bool: @@ -47,7 +47,7 @@ def is_method_available(method : int) -> bool: @param method The adjustment method. @return Whether the adjustment method is available. ''' - from libgamma_native_method import libgamma_native_is_method_available + from libgamma_native_facade import libgamma_native_is_method_available return not libgamma_native_is_method_available(method) == 0 @@ -58,34 +58,35 @@ def method_capabilities(method : int) -> MethodCapabilities: @param this The data structure to fill with the method's capabilities @param method The adjustment method (display server and protocol). ''' - from libgamma_native_method import libgamma_native_method_capabilities + from libgamma_native_facade import libgamma_native_method_capabilities caps = libgamma_native_method_capabilities(method) - MethodCapabilities(*caps) + return MethodCapabilities(*caps) def method_default_site(method : int) -> str: ''' - Return the capabilities of an adjustment method. + Return the default site for an adjustment method. @param method The adjustment method (display server and protocol.) @return The default site, `None` if it cannot be determined or if multiple sites are not supported by the adjustment method. ''' - from libgamma_native_method import libgamma_native_method_default_site + from libgamma_native_facade import libgamma_native_method_default_site return libgamma_native_method_default_site(method) def method_default_site_variable(method : int) -> str: ''' - Return the capabilities of an adjustment method. + Return the default variable that determines + the default site for an adjustment method. @param method The adjustment method (display server and protocol.) @return The environ variables that is used to determine the default site. `None` if there is none, that is, if the method does not support multiple sites. ''' - from libgamma_native_method import libgamma_native_method_default_site_variable + from libgamma_native_facade import libgamma_native_method_default_site_variable return libgamma_native_method_default_site_variable(method) @@ -136,7 +137,7 @@ def unhex_edid(edid : str) -> bytes: @return The EDID in raw representation. ''' rc = [] - edid = edid.lowercase() + edid = edid.lower() for i in range(0, len(edid), 2): a, b = edid[i + 0], edid[i + 1] a = '0123456789abcdef'.find(a) << 4 |