From fd4b7f92836e288a841d51a72cb43dcd655ebedf Mon Sep 17 00:00:00 2001 From: ShubhamSwati Date: Mon, 31 May 2021 18:22:23 +0530 Subject: [PATCH 1/3] scripts/v.report/v.report.py:fixed F841 local variable 'numcols' is assigned to but never used --- scripts/.flake8 | 2 +- scripts/v.report/v.report.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/.flake8 b/scripts/.flake8 index 87c27e2a455..a64a03178ad 100644 --- a/scripts/.flake8 +++ b/scripts/.flake8 @@ -16,7 +16,7 @@ per-file-ignores = r.in.wms/wms_drv.py: E402, E722 r.in.wms/srs.py: E722 i.band/i.band.py: F841 - v.report/v.report.py: F841 + db.out.ogr/db.out.ogr.py: F841 g.extension/g.extension.py: F841, E722 r.unpack/r.unpack.py: E722 diff --git a/scripts/v.report/v.report.py b/scripts/v.report/v.report.py index f5284f97bf7..38e675660ae 100755 --- a/scripts/v.report/v.report.py +++ b/scripts/v.report/v.report.py @@ -217,7 +217,7 @@ def main(): sys.stdout.write(fs.join(colnames + extracolnames) + "\n") # make and print the table: - numcols = len(colnames) + len(extracolnames) + numcols = len(colnames) + len(extracolnames) # noqa: F841 # calculate percents if requested if units == "percent" and option != "coor": From 3a0e3708b4e0db32cadffc96c500961f8b175603 Mon Sep 17 00:00:00 2001 From: ShubhamSwati Date: Mon, 31 May 2021 18:31:29 +0530 Subject: [PATCH 2/3] scripts/i.band/i.band.py:F841 local variable is assigned to but never used --- scripts/.flake8 | 2 +- scripts/i.band/i.band.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/.flake8 b/scripts/.flake8 index a64a03178ad..9a69b1acc2c 100644 --- a/scripts/.flake8 +++ b/scripts/.flake8 @@ -15,7 +15,7 @@ per-file-ignores = r.in.wms/wms_cap_parsers.py: F841, E741 r.in.wms/wms_drv.py: E402, E722 r.in.wms/srs.py: E722 - i.band/i.band.py: F841 + db.out.ogr/db.out.ogr.py: F841 g.extension/g.extension.py: F841, E722 diff --git a/scripts/i.band/i.band.py b/scripts/i.band/i.band.py index a66da1dc806..bd283045c10 100644 --- a/scripts/i.band/i.band.py +++ b/scripts/i.band/i.band.py @@ -63,7 +63,7 @@ def print_map_band_reference(name, band_reader): band_reader.print_info(shortcut, band) else: gs.info(_("No band reference assigned to <{}>").format(name)) - except OpenError as e: + except OpenError as e: # noqa: F841 gs.error(_("Map <{}> not found").format(name)) @@ -95,7 +95,7 @@ def manage_map_band_reference(name, band_ref): except GrassError as e: gs.error(_("Unable to assign/dissociate band reference. {}").format(e)) return 1 - except OpenError as e: + except OpenError as e: # noqa: F841 gs.error(_("Map <{}> not found in current mapset").format(name)) return 1 From 1cb7fce046dc2d23afbff6c71c45c95ca8ab9d30 Mon Sep 17 00:00:00 2001 From: ShubhamSwati Date: Mon, 31 May 2021 18:38:55 +0530 Subject: [PATCH 3/3] scripts/db.out.ogr/db.out.ogr.py:fixed F841 local variable 'table' is assigned to but never used --- scripts/.flake8 | 2 +- scripts/db.out.ogr/db.out.ogr.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/.flake8 b/scripts/.flake8 index 9a69b1acc2c..f38af764498 100644 --- a/scripts/.flake8 +++ b/scripts/.flake8 @@ -17,7 +17,7 @@ per-file-ignores = r.in.wms/srs.py: E722 - db.out.ogr/db.out.ogr.py: F841 + g.extension/g.extension.py: F841, E722 r.unpack/r.unpack.py: E722 v.unpack/v.unpack.py: F841, E722 diff --git a/scripts/db.out.ogr/db.out.ogr.py b/scripts/db.out.ogr/db.out.ogr.py index 4a840755b20..6b4f2b3d232 100755 --- a/scripts/db.out.ogr/db.out.ogr.py +++ b/scripts/db.out.ogr/db.out.ogr.py @@ -67,7 +67,7 @@ def main(): layer = options["layer"] format = options["format"] output = options["output"] - table = options["table"] + table = options["table"] # noqa: F841 if format.lower() == "dbf": format = "ESRI_Shapefile"