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

wxGUI: Fixed E722 in modules/ #4546

Merged
merged 5 commits into from
Oct 21, 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
3 changes: 1 addition & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ per-file-ignores =
doc/python/m.distance.py: E501
gui/scripts/d.wms.py: E501
gui/wxpython/image2target/g.gui.image2target.py: E501
gui/wxpython/modules/*: F841, E722
gui/wxpython/nviz/*: E722, F403, F405
gui/wxpython/nviz/*: E266, E722, F403, F405
gui/wxpython/photo2image/*: F841, E722, E265
gui/wxpython/photo2image/g.gui.photo2image.py: E501, F841
gui/wxpython/psmap/*: F841, E266, E722
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/modules/colorrules.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def LoadRules(self):
else:
value = float(self.ruleslines[item][self.attributeType])
self.mainPanel.FindWindowById(item + 2000).SetValue(value)
except:
except Exception:
continue

if message:
Expand Down Expand Up @@ -407,7 +407,7 @@ def _initLayer(self):
layer = sel
else:
layer = self.layerTree.FindItemByData(key="type", value=self.mapType)
except:
except (AttributeError, TypeError):
layer = None
if layer:
mapLayer = self.layerTree.GetLayerInfo(layer, key="maplayer")
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/modules/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def UpdateHistDone(self):
return
try:
id = self.imagedict[self.img]
except:
except KeyError:
return

# paint images to PseudoDC
Expand Down Expand Up @@ -524,7 +524,7 @@ def OnCloseWindow(self, event):
"""
try:
self.propwin.Close(True)
except:
except Exception:
pass
self.Map.Clean()
self.Destroy()
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/modules/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def OnRun(self, event):
if nBandsStr:
try:
nBands = int(nBandsStr.rstrip("\n"))
except:
except ValueError:
pass
if nBands < 0:
GWarning(_("Unable to determine number of raster bands"), parent=self)
Expand Down
6 changes: 3 additions & 3 deletions gui/wxpython/modules/mcalc_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def _addSomething(self, what):
if newmcalcstr[-1] != " ":
newmcalcstr += " "
position_offset += 1
except:
except IndexError:
pass

newmcalcstr += what
Expand All @@ -617,7 +617,7 @@ def _addSomething(self, what):
try:
if newmcalcstr[-1] != " " and mcalcstr[position] != " ":
newmcalcstr += " "
except:
except IndexError:
newmcalcstr += " "

newmcalcstr += mcalcstr[position:]
Expand All @@ -632,7 +632,7 @@ def _addSomething(self, what):
try:
if newmcalcstr[position + position_offset] == " ":
position_offset += 1
except:
except IndexError:
pass

self.text_mcalc.SetInsertionPoint(position + position_offset)
Expand Down
Loading