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 wxpython directory part 2 #4253

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 3 additions & 4 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ per-file-ignores =
gui/wxpython/core/settings.py: E722
gui/wxpython/core/watchdog.py: E402
gui/wxpython/datacatalog/tree.py: E731, E402
gui/wxpython/dbmgr/base.py: E722, F841
gui/wxpython/dbmgr/dialogs.py: F841, E722
gui/wxpython/dbmgr/sqlbuilder.py: E722, F841
gui/wxpython/dbmgr/base.py: E722
gui/wxpython/dbmgr/dialogs.py: E722
gui/wxpython/dbmgr/sqlbuilder.py: E722
gui/wxpython/dbmgr/manager.py: E722
gui/wxpython/dbmgr/vinfo.py: F841
gui/wxpython/docs/wxgui_sphinx/conf.py: E402, W291
gui/wxpython/gcp/g.gui.gcp.py: F841
gui/wxpython/gcp/manager.py: F841, E722
Expand Down
9 changes: 4 additions & 5 deletions gui/wxpython/dbmgr/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def LoadData(self, layer, columns=None, where=None, sql=None):

if sql:
cmdParams.update({"sql": sql, "output": outFile.name, "overwrite": True})
ret = RunCommand("db.select", **cmdParams)
RunCommand("db.select", **cmdParams)
self.sqlFilter = {"sql": sql}
else:
cmdParams.update(
Expand All @@ -246,7 +246,7 @@ def LoadData(self, layer, columns=None, where=None, sql=None):
# Enclose column name with SQL standard double quotes
cmdParams.update({"columns": ",".join([f'"{col}"' for col in columns])})

ret = RunCommand("v.db.select", **cmdParams)
RunCommand("v.db.select", **cmdParams)

# These two should probably be passed to init more cleanly
# setting the numbers of items = number of elements in the dictionary
Expand Down Expand Up @@ -296,7 +296,7 @@ def LoadData(self, layer, columns=None, where=None, sql=None):
record = (
decode(outFile.readline(), encoding=enc).strip().replace("\n", "")
)
except UnicodeDecodeError as e:
except UnicodeDecodeError:
record = (
outFile.readline()
.decode(encoding=enc, errors="replace")
Expand Down Expand Up @@ -965,7 +965,7 @@ def OnLayerPageChanged(self, event):
pass

if idCol:
winCol = self.FindWindowById(idCol)
petrasovaa marked this conversation as resolved.
Show resolved Hide resolved
self.FindWindowById(idCol)
petrasovaa marked this conversation as resolved.
Show resolved Hide resolved
table = self.dbMgrData["mapDBInfo"].layers[self.selLayer]["table"]
self.dbMgrData["mapDBInfo"].GetColumns(table)

Expand Down Expand Up @@ -2687,7 +2687,6 @@ def OnTableItemDelete(self, event):
tlist = self.FindWindowById(self.layerPage[self.selLayer]["tableData"])

item = tlist.GetFirstSelected()
countSelected = tlist.GetSelectedItemCount()
if UserSettings.Get(group="atm", key="askOnDeleteRec", subkey="enabled"):
# if the user select more columns to delete, all the columns name
# will appear the the warning dialog
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/dbmgr/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ def OnReset(self, event=None):
columns = self.mapDBInfo.tables[table]
for idx in range(len(columns[key]["values"])):
for name in columns.keys():
type = columns[name]["type"]
value = columns[name]["values"][idx]
if value is None:
value = ""
Expand Down
5 changes: 1 addition & 4 deletions gui/wxpython/dbmgr/sqlbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ def _doLayout(self, modeChoices, showDbInfo=False):

def OnUniqueValues(self, event, justsample=False):
"""Get unique values"""
vals = []
try:
idx = self.list_columns.GetSelections()[0]
column = self.list_columns.GetString(idx)
Expand Down Expand Up @@ -418,9 +417,7 @@ def OnAddValue(self, event):
idx = self.list_columns.GetSelections()[0]
column = self.list_columns.GetString(idx)

ctype = self.dbInfo.GetTableDesc(self.dbInfo.GetTable(self.layer))[column][
petrasovaa marked this conversation as resolved.
Show resolved Hide resolved
"type"
]
self.dbInfo.GetTableDesc(self.dbInfo.GetTable(self.layer))[column]["type"]

self._add(element="value", value=value)

Expand Down
3 changes: 0 additions & 3 deletions gui/wxpython/dbmgr/vinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ def SelectByPoint(self, queryCoords, qdist):
"""Get attributes by coordinates (all available layers)
Return line id or None if no line is found"""
line = None
nselected = 0

try:
data = gs.vector_what(
map=self.map,
Expand Down
Loading