From 91a5a7aa8424fe97b41212242ee5fab1f07769c3 Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Mon, 25 Nov 2024 12:56:46 -0500 Subject: [PATCH 1/2] update --- .flake8 | 1 - python/grass/pygrass/utils.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 1e8a6f880d7..e1aab97b662 100644 --- a/.flake8 +++ b/.flake8 @@ -53,7 +53,6 @@ per-file-ignores = python/grass/pygrass/raster/__init__.py: E402 python/grass/pygrass/vector/__init__.py: E402 python/grass/pygrass/raster/category.py: E721 - python/grass/pygrass/utils.py: E402 python/grass/temporal/abstract_space_time_dataset.py: E722 python/grass/temporal/c_libraries_interface.py: E722 python/grass/temporal/core.py: E722 diff --git a/python/grass/pygrass/utils.py b/python/grass/pygrass/utils.py index d8804665b1e..e2582d45db9 100644 --- a/python/grass/pygrass/utils.py +++ b/python/grass/pygrass/utils.py @@ -5,6 +5,7 @@ import grass.lib.gis as libgis +# flake8: noqa: E402 libgis.G_gisinit("") import grass.lib.raster as libraster @@ -12,6 +13,8 @@ from grass.script import core as grasscore from grass.script import utils as grassutils +# flake8: qa + from grass.pygrass.errors import GrassError From e1eb5dfcc1c2f7e2dc5602f366f07af08ba5fabb Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Thu, 5 Dec 2024 18:00:47 -0500 Subject: [PATCH 2/2] update --- python/grass/pygrass/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/grass/pygrass/utils.py b/python/grass/pygrass/utils.py index e2582d45db9..2d6a2498848 100644 --- a/python/grass/pygrass/utils.py +++ b/python/grass/pygrass/utils.py @@ -1,22 +1,21 @@ -import itertools import fnmatch +import itertools import os from sqlite3 import OperationalError import grass.lib.gis as libgis +from grass.script import core as grasscore +from grass.script import utils as grassutils # flake8: noqa: E402 libgis.G_gisinit("") import grass.lib.raster as libraster from grass.lib.ctypes_preamble import String -from grass.script import core as grasscore -from grass.script import utils as grassutils +from grass.pygrass.errors import GrassError # flake8: qa -from grass.pygrass.errors import GrassError - test_vector_name = "Utils_test_vector" test_raster_name = "Utils_test_raster" @@ -464,7 +463,7 @@ def create_test_vector_map(map_name="test_vector"): """ from grass.pygrass.vector import VectorTopo - from grass.pygrass.vector.geometry import Point, Line, Centroid, Boundary + from grass.pygrass.vector.geometry import Boundary, Centroid, Line, Point cols = [ ("cat", "INTEGER PRIMARY KEY"), @@ -592,6 +591,7 @@ def create_test_stream_network_map(map_name="streams"): if __name__ == "__main__": import doctest + from grass.script.core import run_command create_test_vector_map(test_vector_name)