Pep8 work. #90

This commit is contained in:
John Evans 2013-07-29 11:40:47 -04:00
commit 8120c21299
7 changed files with 18 additions and 17 deletions

View file

@ -8,6 +8,7 @@ import ctypes.util
libc_path = ctypes.util.find_library('c')
C_LIB = ctypes.CDLL(libc_path)
def fopen(filename, mode):
"""Opens the file with the specified mode.
@ -29,6 +30,7 @@ def fopen(filename, mode):
ctypes.c_char_p(mode.encode()))
return fptr
def fclose(fptr):
"""Closes a file stream.
@ -42,4 +44,3 @@ def fclose(fptr):
status = C_LIB.fclose(fptr)
if status != 0:
raise IOError("Unable to close file.")

View file

@ -145,7 +145,7 @@ def get_configdir():
if 'HOME' in os.environ and os.name != 'nt':
# HOME is set by WinPython to something unusual, so we don't
# necessarily want that.
# necessarily want that.
return os.path.join(os.environ['HOME'], '.config', 'glymur')
# Last stand. Should handle windows... others?

View file

@ -1384,6 +1384,7 @@ def set_error_message(msg):
global ERROR_MSG_LST
ERROR_MSG_LST.append(msg)
def version():
"""Wrapper for opj_version library routine."""
OPENJP2.opj_version.restype = ctypes.c_char_p
@ -1392,4 +1393,3 @@ def version():
return library_version.decode('utf-8')
else:
return library_version

View file

@ -16,10 +16,12 @@ import numpy as np
import glymur
OPENJP2_IS_V2_OFFICIAL=False
OPENJP2_IS_V2_OFFICIAL = False
if glymur.lib.openjp2.OPENJP2 is not None:
if not hasattr(glymur.lib.openjp2.OPENJP2, 'opj_stream_create_default_file_stream_v3'):
OPENJP2_IS_V2_OFFICIAL=True
if not hasattr(glymur.lib.openjp2.OPENJP2,
'opj_stream_create_default_file_stream_v3'):
OPENJP2_IS_V2_OFFICIAL = True
@unittest.skipIf(os.name == "nt", "Temporary file issue on window.")
@unittest.skipIf(glymur.lib.openjp2.OPENJP2 is None,