diff --git a/.flake8 b/.flake8 index 32b0191e00c..09706c297d9 100644 --- a/.flake8 +++ b/.flake8 @@ -27,7 +27,7 @@ per-file-ignores = gui/scripts/d.wms.py: E501 gui/wxpython/image2target/*: F841, E722 gui/wxpython/image2target/g.gui.image2target.py: E501, F841 - gui/wxpython/iscatt/*: F841, F405, F403 + gui/wxpython/iscatt/*: F841, E722 gui/wxpython/lmgr/frame.py: F841, E722 # layertree still includes some formatting issues (it is ignored by Black) gui/wxpython/lmgr/layertree.py: E722, E266, W504, E225 diff --git a/gui/wxpython/iscatt/core_c.py b/gui/wxpython/iscatt/core_c.py index a2a3d5da9da..4678d2654b1 100644 --- a/gui/wxpython/iscatt/core_c.py +++ b/gui/wxpython/iscatt/core_c.py @@ -11,15 +11,34 @@ @author Stepan Turek (mentor: Martin Landa) """ +import ctypes import sys -import numpy as np +from ctypes import POINTER, c_char_p, c_double, c_int, c_uint8, pointer from multiprocessing import Process, Queue -from ctypes import * +import numpy as np try: - from grass.lib.imagery import * from grass.lib.gis import G_get_window + from grass.lib.imagery import ( + SC_SCATT_CONDITIONS, + SC_SCATT_DATA, + I_apply_colormap, + I_compute_scatts, + I_create_cat_rast, + I_insert_patch_to_cat_rast, + I_merge_arrays, + I_rasterize, + I_sc_add_cat, + I_sc_free_cats, + I_sc_init_cats, + I_sc_insert_scatt_data, + I_scd_init_scatt_data, + scdScattData, + struct_Cell_head, + struct_Range, + struct_scCats, + ) except ImportError as e: sys.stderr.write(_("Loading ctypes libs failed")) @@ -238,7 +257,7 @@ def _getComputationStruct(cats, cats_rasts, cats_type, n_bands): scatt_vals = scdScattData() - c_void_p = ctypes.POINTER(ctypes.c_void_p) + c_void_p = POINTER(ctypes.c_void_p) if cats_type == SC_SCATT_DATA: vals[:] = 0