From 371953b3b4a8d9f60d7ac43d4beb947c9674ea63 Mon Sep 17 00:00:00 2001
From: Arohan Ajit <arohanajit@Mac-257.lan>
Date: Wed, 22 Jan 2025 08:48:37 -0500
Subject: [PATCH 1/5] update

---
 gui/wxpython/vdigit/wxdisplay.py | 99 ++++++++++++++++++++++++++++----
 1 file changed, 89 insertions(+), 10 deletions(-)

diff --git a/gui/wxpython/vdigit/wxdisplay.py b/gui/wxpython/vdigit/wxdisplay.py
index 6679e5c5814..3b670296ecb 100644
--- a/gui/wxpython/vdigit/wxdisplay.py
+++ b/gui/wxpython/vdigit/wxdisplay.py
@@ -18,23 +18,102 @@
 """
 
 import locale
-
 import os
 import sys
-import wx
+from ctypes import CFUNCTYPE, UNCHECKED, String, byref, c_double, c_int, pointer
 
+import wx
 from core.debug import Debug
-from core.settings import UserSettings
 from core.gcmd import DecodeString
+from core.settings import UserSettings
+from grass.lib.gis import (
+    PORT_DOUBLE_MAX,
+    G_gisinit,
+    G_set_error_routine,
+    G_set_percent_routine,
+    G_unset_error_routine,
+    G_unset_percent_routine,
+)
+from grass.lib.vector import (
+    GV_BOUNDARY,
+    GV_BUILD_NONE,
+    GV_CENTROID,
+    GV_LINE,
+    GV_LINES,
+    GV_MODE_RW,
+    GV_POINT,
+    GV_POINTS,
+    WITHOUT_Z,
+    Map_info,
+    Vect_append_point,
+    Vect_box_copy,
+    Vect_box_extend,
+    Vect_build,
+    Vect_build_partial,
+    Vect_close,
+    Vect_destroy_cats_struct,
+    Vect_destroy_line_struct,
+    Vect_destroy_list,
+    Vect_find_line_list,
+    Vect_get_area_box,
+    Vect_get_area_centroid,
+    Vect_get_centroid_area,
+    Vect_get_line_box,
+    Vect_get_map_box,
+    Vect_get_num_areas,
+    Vect_get_num_lines,
+    Vect_is_3d,
+    Vect_line_alive,
+    Vect_line_check_duplicate,
+    Vect_line_distance,
+    Vect_list_append,
+    Vect_new_cats_struct,
+    Vect_new_line_struct,
+    Vect_new_list,
+    Vect_open_old,
+    Vect_open_tmp_old,
+    Vect_open_tmp_update,
+    Vect_open_update,
+    Vect_point_in_area,
+    Vect_point_in_poly,
+    Vect_points_distance,
+    Vect_read_line,
+    Vect_select_lines_by_polygon,
+    Vect_set_updated,
+    bound_box,
+)
+from grass.lib.vedit import (
+    DRAW_AREA,
+    DRAW_BOUNDARYNO,
+    DRAW_BOUNDARYONE,
+    DRAW_BOUNDARYTWO,
+    DRAW_CENTROIDDUP,
+    DRAW_CENTROIDIN,
+    DRAW_CENTROIDOUT,
+    DRAW_DIRECTION,
+    DRAW_LINE,
+    DRAW_NODEONE,
+    DRAW_NODETWO,
+    DRAW_POINT,
+    DRAW_VERTEX,
+    TYPE_AREA,
+    TYPE_BOUNDARYNO,
+    TYPE_BOUNDARYONE,
+    TYPE_BOUNDARYTWO,
+    TYPE_CENTROIDDUP,
+    TYPE_CENTROIDIN,
+    TYPE_CENTROIDOUT,
+    TYPE_DIRECTION,
+    TYPE_ISLE,
+    TYPE_LINE,
+    TYPE_NODEONE,
+    TYPE_NODETWO,
+    TYPE_POINT,
+    TYPE_VERTEX,
+    Vedit_render_map,
+)
 from gui_core.wrap import Rect
 
-try:
-    from grass.lib.gis import *
-    from grass.lib.vector import *
-    from grass.lib.vedit import *
-except (ImportError, OSError, TypeError) as e:
-    print("wxdigit.py: {}".format(e), file=sys.stderr)
-
 log = None
 progress = None
 last_error = ""

From 5cbaf73d94ee1183b906f2ecfeb894c63ee502e0 Mon Sep 17 00:00:00 2001
From: Arohan Ajit <arohanajit@Mac-257.lan>
Date: Wed, 22 Jan 2025 08:51:51 -0500
Subject: [PATCH 2/5] update

---
 .flake8                          | 1 -
 gui/wxpython/vdigit/wxdisplay.py | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/.flake8 b/.flake8
index 99c6e425717..c1e09d417a1 100644
--- a/.flake8
+++ b/.flake8
@@ -25,7 +25,6 @@ per-file-ignores =
     gui/wxpython/image2target/g.gui.image2target.py: E501
     gui/wxpython/photo2image/g.gui.photo2image.py: E501
     gui/wxpython/psmap/*: E501
-    gui/wxpython/vdigit/*: E722, F405, F403
     gui/wxpython/animation/g.gui.animation.py: E501
     gui/wxpython/tplot/g.gui.tplot.py: E501
     gui/wxpython/iclass/g.gui.iclass.py: E501
diff --git a/gui/wxpython/vdigit/wxdisplay.py b/gui/wxpython/vdigit/wxdisplay.py
index 3b670296ecb..544095ad9da 100644
--- a/gui/wxpython/vdigit/wxdisplay.py
+++ b/gui/wxpython/vdigit/wxdisplay.py
@@ -34,7 +34,7 @@
     G_unset_error_routine,
     G_unset_percent_routine,
 )
-from grass.lib.vector import (
+from grass.lib.vector import (  # Types; Functions; Classes
     GV_BOUNDARY,
     GV_BUILD_NONE,
     GV_CENTROID,
@@ -82,7 +82,7 @@
     Vect_set_updated,
     bound_box,
 )
-from grass.lib.vedit import (
+from grass.lib.vedit import (  # Types; Draw flags; Functions
     DRAW_AREA,
     DRAW_BOUNDARYNO,
     DRAW_BOUNDARYONE,

From 4521f5375011d42ddbfaa8a482af6deeddafc2ff Mon Sep 17 00:00:00 2001
From: Arohan Ajit <arohanajit@Mac-257.lan>
Date: Wed, 22 Jan 2025 08:53:21 -0500
Subject: [PATCH 3/5] update

---
 gui/wxpython/vdigit/wxdisplay.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gui/wxpython/vdigit/wxdisplay.py b/gui/wxpython/vdigit/wxdisplay.py
index 544095ad9da..e435f4e5284 100644
--- a/gui/wxpython/vdigit/wxdisplay.py
+++ b/gui/wxpython/vdigit/wxdisplay.py
@@ -27,7 +27,6 @@
 from core.gcmd import DecodeString
 from core.settings import UserSettings
 from grass.lib.gis import (
-    PORT_DOUBLE_MAX,
     G_gisinit,
     G_set_error_routine,
     G_set_percent_routine,
@@ -81,6 +80,7 @@
     Vect_select_lines_by_polygon,
     Vect_set_updated,
     bound_box,
+    PORT_DOUBLE_MAX,
 )
 from grass.lib.vedit import (  # Types; Draw flags; Functions
     DRAW_AREA,

From ffbcd4c8609a6ddb6f20986e1ac470ada97d5044 Mon Sep 17 00:00:00 2001
From: Arohan Ajit <arohanajit@Mac-268.lan>
Date: Thu, 23 Jan 2025 17:30:07 -0500
Subject: [PATCH 4/5] update

---
 gui/wxpython/vdigit/wxdisplay.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gui/wxpython/vdigit/wxdisplay.py b/gui/wxpython/vdigit/wxdisplay.py
index e435f4e5284..24ed0fd5c44 100644
--- a/gui/wxpython/vdigit/wxdisplay.py
+++ b/gui/wxpython/vdigit/wxdisplay.py
@@ -20,7 +20,8 @@
 import locale
 import os
 import sys
-from ctypes import CFUNCTYPE, UNCHECKED, String, byref, c_double, c_int, pointer
+from ctypes import CFUNCTYPE, byref, c_double, c_int, pointer
+from grass.lib.ctypes_preamble import UNCHECKED, String
 
 import wx
 from core.debug import Debug

From d8f59505d987800f6bec8a9fc54fb50c2bf4e669 Mon Sep 17 00:00:00 2001
From: Arohan Ajit <arohanajit@arohan-8.local>
Date: Fri, 24 Jan 2025 15:24:36 -0500
Subject: [PATCH 5/5] update

---
 gui/wxpython/vdigit/wxdisplay.py | 176 ++++++++++++++++---------------
 1 file changed, 90 insertions(+), 86 deletions(-)

diff --git a/gui/wxpython/vdigit/wxdisplay.py b/gui/wxpython/vdigit/wxdisplay.py
index 24ed0fd5c44..f7381fe763f 100644
--- a/gui/wxpython/vdigit/wxdisplay.py
+++ b/gui/wxpython/vdigit/wxdisplay.py
@@ -27,92 +27,96 @@
 from core.debug import Debug
 from core.gcmd import DecodeString
 from core.settings import UserSettings
-from grass.lib.gis import (
-    G_gisinit,
-    G_set_error_routine,
-    G_set_percent_routine,
-    G_unset_error_routine,
-    G_unset_percent_routine,
-)
-from grass.lib.vector import (  # Types; Functions; Classes
-    GV_BOUNDARY,
-    GV_BUILD_NONE,
-    GV_CENTROID,
-    GV_LINE,
-    GV_LINES,
-    GV_MODE_RW,
-    GV_POINT,
-    GV_POINTS,
-    WITHOUT_Z,
-    Map_info,
-    Vect_append_point,
-    Vect_box_copy,
-    Vect_box_extend,
-    Vect_build,
-    Vect_build_partial,
-    Vect_close,
-    Vect_destroy_cats_struct,
-    Vect_destroy_line_struct,
-    Vect_destroy_list,
-    Vect_find_line_list,
-    Vect_get_area_box,
-    Vect_get_area_centroid,
-    Vect_get_centroid_area,
-    Vect_get_line_box,
-    Vect_get_map_box,
-    Vect_get_num_areas,
-    Vect_get_num_lines,
-    Vect_is_3d,
-    Vect_line_alive,
-    Vect_line_check_duplicate,
-    Vect_line_distance,
-    Vect_list_append,
-    Vect_new_cats_struct,
-    Vect_new_line_struct,
-    Vect_new_list,
-    Vect_open_old,
-    Vect_open_tmp_old,
-    Vect_open_tmp_update,
-    Vect_open_update,
-    Vect_point_in_area,
-    Vect_point_in_poly,
-    Vect_points_distance,
-    Vect_read_line,
-    Vect_select_lines_by_polygon,
-    Vect_set_updated,
-    bound_box,
-    PORT_DOUBLE_MAX,
-)
-from grass.lib.vedit import (  # Types; Draw flags; Functions
-    DRAW_AREA,
-    DRAW_BOUNDARYNO,
-    DRAW_BOUNDARYONE,
-    DRAW_BOUNDARYTWO,
-    DRAW_CENTROIDDUP,
-    DRAW_CENTROIDIN,
-    DRAW_CENTROIDOUT,
-    DRAW_DIRECTION,
-    DRAW_LINE,
-    DRAW_NODEONE,
-    DRAW_NODETWO,
-    DRAW_POINT,
-    DRAW_VERTEX,
-    TYPE_AREA,
-    TYPE_BOUNDARYNO,
-    TYPE_BOUNDARYONE,
-    TYPE_BOUNDARYTWO,
-    TYPE_CENTROIDDUP,
-    TYPE_CENTROIDIN,
-    TYPE_CENTROIDOUT,
-    TYPE_DIRECTION,
-    TYPE_ISLE,
-    TYPE_LINE,
-    TYPE_NODEONE,
-    TYPE_NODETWO,
-    TYPE_POINT,
-    TYPE_VERTEX,
-    Vedit_render_map,
-)
+
+try:
+    from grass.lib.gis import (
+        G_gisinit,
+        G_set_error_routine,
+        G_set_percent_routine,
+        G_unset_error_routine,
+        G_unset_percent_routine,
+    )
+    from grass.lib.vector import (  # Types; Functions; Classes
+        GV_BOUNDARY,
+        GV_BUILD_NONE,
+        GV_CENTROID,
+        GV_LINE,
+        GV_LINES,
+        GV_MODE_RW,
+        GV_POINT,
+        GV_POINTS,
+        WITHOUT_Z,
+        Map_info,
+        Vect_append_point,
+        Vect_box_copy,
+        Vect_box_extend,
+        Vect_build,
+        Vect_build_partial,
+        Vect_close,
+        Vect_destroy_cats_struct,
+        Vect_destroy_line_struct,
+        Vect_destroy_list,
+        Vect_find_line_list,
+        Vect_get_area_box,
+        Vect_get_area_centroid,
+        Vect_get_centroid_area,
+        Vect_get_line_box,
+        Vect_get_map_box,
+        Vect_get_num_areas,
+        Vect_get_num_lines,
+        Vect_is_3d,
+        Vect_line_alive,
+        Vect_line_check_duplicate,
+        Vect_line_distance,
+        Vect_list_append,
+        Vect_new_cats_struct,
+        Vect_new_line_struct,
+        Vect_new_list,
+        Vect_open_old,
+        Vect_open_tmp_old,
+        Vect_open_tmp_update,
+        Vect_open_update,
+        Vect_point_in_area,
+        Vect_point_in_poly,
+        Vect_points_distance,
+        Vect_read_line,
+        Vect_select_lines_by_polygon,
+        Vect_set_updated,
+        bound_box,
+        PORT_DOUBLE_MAX,
+    )
+    from grass.lib.vedit import (  # Types; Draw flags; Functions
+        DRAW_AREA,
+        DRAW_BOUNDARYNO,
+        DRAW_BOUNDARYONE,
+        DRAW_BOUNDARYTWO,
+        DRAW_CENTROIDDUP,
+        DRAW_CENTROIDIN,
+        DRAW_CENTROIDOUT,
+        DRAW_DIRECTION,
+        DRAW_LINE,
+        DRAW_NODEONE,
+        DRAW_NODETWO,
+        DRAW_POINT,
+        DRAW_VERTEX,
+        TYPE_AREA,
+        TYPE_BOUNDARYNO,
+        TYPE_BOUNDARYONE,
+        TYPE_BOUNDARYTWO,
+        TYPE_CENTROIDDUP,
+        TYPE_CENTROIDIN,
+        TYPE_CENTROIDOUT,
+        TYPE_DIRECTION,
+        TYPE_ISLE,
+        TYPE_LINE,
+        TYPE_NODEONE,
+        TYPE_NODETWO,
+        TYPE_POINT,
+        TYPE_VERTEX,
+        Vedit_render_map,
+    )
+except (ImportError, OSError, TypeError) as e:
+    print("wxdisplay.py: {}".format(e), file=sys.stderr)
 from gui_core.wrap import Rect
 
 log = None