Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checks: Flake8 F841 fixes in the scripts directory part 2 #4241

Merged
merged 3 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ per-file-ignores =
scripts/r.in.wms/wms_cap_parsers.py: F841
scripts/r.in.wms/wms_drv.py: E402, E722
scripts/r.in.wms/srs.py: E722
scripts/r.semantic.label/r.semantic.label.py: F841, E501
scripts/v.report/v.report.py: F841, E721
scripts/r.semantic.label/r.semantic.label.py: E501
scripts/v.report/v.report.py: E721
scripts/db.out.ogr/db.out.ogr.py: F841
scripts/g.extension/g.extension.py: F841, E722, E501
scripts/v.unpack/v.unpack.py: F841, E722, E501
scripts/v.import/v.import.py: F841, E722, E501
scripts/v.unpack/v.unpack.py: E722, E501
scripts/v.import/v.import.py: E722, E501
scripts/db.univar/db.univar.py: E501
scripts/d.frame/d.frame.py: E722
scripts/i.pansharpen/i.pansharpen.py: E722, E501
Expand Down
4 changes: 2 additions & 2 deletions scripts/r.semantic.label/r.semantic.label.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def print_map_semantic_label(name, label_reader):
label_reader.print_info(semantic_label=semantic_label)
else:
gs.info(_("No semantic label assigned to <{}>").format(name))
except OpenError as e:
except OpenError:
gs.error(_("Map <{}> not found").format(name))


Expand Down Expand Up @@ -94,7 +94,7 @@ def manage_map_semantic_label(name, semantic_label):
except GrassError as e:
gs.error(_("Unable to assign/dissociate semantic label. {}").format(e))
return 1
except OpenError as e:
except OpenError:
gs.error(_("Map <{}> not found in current mapset").format(name))
return 1

Expand Down
2 changes: 0 additions & 2 deletions scripts/v.import/v.import.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ def main():
f.write("GUI: text\n")
f.close()

tgtsrs = gs.read_command("g.proj", flags="j", quiet=True)
petrasovaa marked this conversation as resolved.
Show resolved Hide resolved

# create temp location from input without import
gs.verbose(_("Creating temporary project for <%s>...") % OGRdatasource)
try:
Expand Down
3 changes: 0 additions & 3 deletions scripts/v.report/v.report.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@ def main():
if not flags["c"]:
sys.stdout.write(fs.join(colnames + extracolnames) + "\n")

# make and print the table:
numcols = len(colnames) + len(extracolnames)

# calculate percents if requested
if units == "percent" and option != "coor":
# calculate total value
Expand Down
4 changes: 0 additions & 4 deletions scripts/v.unpack/v.unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,6 @@ def main():
# the db connection in the output mapset
dbconn = grassdb.db_connection(force=True)
todb = dbconn["database"]
# return all tables
list_fromtable = grass.read_command(
"db.tables", driver="sqlite", database=fromdb
).splitlines()

# return the list of old connection for extract layer number and key
dbln = open(os.path.join(new_dir, "dbln"), "r")
Expand Down
Loading