Skip to content

Commit

Permalink
wxGUI: Fixed unused variable and bare 'except' in frame.py (#4655)
Browse files Browse the repository at this point in the history
  • Loading branch information
arohanajit authored Nov 13, 2024
1 parent 9f7c863 commit 7ab4fde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ per-file-ignores =
gui/wxpython/psmap/*: E501
gui/wxpython/vdigit/*: F841, E722, F405, F403
gui/wxpython/animation/g.gui.animation.py: E501
gui/wxpython/tplot/frame.py: F841, E722
gui/wxpython/tplot/g.gui.tplot.py: E501
gui/wxpython/iclass/frame.py: F405, F403
gui/wxpython/iclass/g.gui.iclass.py: E501
Expand Down
14 changes: 7 additions & 7 deletions gui/wxpython/tplot/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def _layout(self):
self.coorval = gselect.CoordinatesSelect(
parent=self.controlPanelRaster, giface=self._giface
)
except:
except NotImplementedError:
self.coorval = TextCtrl(
parent=self.controlPanelRaster,
id=wx.ID_ANY,
Expand Down Expand Up @@ -281,7 +281,7 @@ def _layout(self):
self.cats = gselect.VectorCategorySelect(
parent=self.controlPanelVector, giface=self._giface
)
except:
except NotImplementedError:
self.cats = TextCtrl(
parent=self.controlPanelVector,
id=wx.ID_ANY,
Expand Down Expand Up @@ -1029,10 +1029,10 @@ def OnRedraw(self, event=None):

try:
getcoors = self.coorval.coordsField.GetValue()
except:
except AttributeError:
try:
getcoors = self.coorval.GetValue()
except:
except AttributeError:
getcoors = None
if getcoors and getcoors != "":
try:
Expand Down Expand Up @@ -1257,7 +1257,7 @@ def SetDatasets(
return
try:
self.coorval.coordsField.SetValue(",".join(coors))
except:
except AttributeError:
self.coorval.SetValue(",".join(coors))
if self.datasetsV:
vdatas = ",".join(f"{x[0]}@{x[1]}" for x in self.datasetsV)
Expand Down Expand Up @@ -1448,7 +1448,7 @@ def __call__(self, event):
"""Intended to be called through "mpl_connect"."""
# Rather than trying to interpolate, just display the clicked coords
# This will only be called if it's within "tolerance", anyway.
x, y = event.mouseevent.xdata, event.mouseevent.ydata
x = event.mouseevent.xdata
annotation = self.annotations[event.artist.axes]
if x is not None:
if not self.display_all:
Expand All @@ -1460,7 +1460,7 @@ def __call__(self, event):
for a in event.artist.get_xdata():
try:
d = self.convert(a)
except:
except (IndexError, ValueError):
d = a
xData.append(d)
x = xData[np.argmin(abs(xData - x))]
Expand Down

0 comments on commit 7ab4fde

Please sign in to comment.