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 F841 in tools.py #4539

Merged
merged 4 commits into from
Oct 17, 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
4 changes: 2 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ 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/*: E722
gui/wxpython/nviz/*: F841, E266, E722, F403, F405
gui/wxpython/modules/*: F841, E722
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, F405, F403
Expand Down
21 changes: 3 additions & 18 deletions gui/wxpython/nviz/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,6 @@ def _createAnimationPage(self):
parent=panel, id=wx.ID_ANY, label=" %s " % (_("Save image sequence"))
)
boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
vSizer = wx.BoxSizer(wx.VERTICAL)
gridSizer = wx.GridBagSizer(vgap=5, hgap=10)

pwd = str(Path.cwd())
Expand Down Expand Up @@ -2817,7 +2816,6 @@ def OnAnimationFinished(self, mode):
self.UpdateFrameIndex(index=0)

slider = self.FindWindowById(self.win["anim"]["frameIndex"]["slider"])
text = self.FindWindowById(self.win["anim"]["frameIndex"]["text"])

if mode == "record":
count = anim.GetFrameCount()
Expand Down Expand Up @@ -2922,7 +2920,7 @@ def OnConstantSelection(self, event):
layerIdx = self.FindWindowById(self.win["constant"]["surface"]).GetSelection()
if layerIdx == wx.NOT_FOUND:
return
name = _("constant#") + str(layerIdx + 1)

data = self.mapWindow.constants[layerIdx]
for attr, value in data["constant"].items():
if attr == "color":
Expand Down Expand Up @@ -3123,8 +3121,6 @@ def _createIsosurfacePanel(self, parent):
def _createSlicePanel(self, parent):
panel = wx.Panel(parent=parent, id=wx.ID_ANY)

vSizer = wx.BoxSizer(wx.HORIZONTAL)

box = StaticBox(
parent=panel, id=wx.ID_ANY, label=" %s " % (_("Slice attributes"))
)
Expand Down Expand Up @@ -3412,20 +3408,19 @@ def OnSetSurface(self, event):
"""Surface selected, currently used for fringes"""
name = event.GetString()
try:
data = self._getLayerPropertiesByName(name, mapType="raster")["surface"]
self._getLayerPropertiesByName(name, mapType="raster")["surface"]
except:
self.EnablePage("fringe", False)
return

layer = self._getMapLayerByName(name, mapType="raster")
self.EnablePage("fringe", True)

def OnSetRaster(self, event):
"""Raster map selected, update surface page"""
name = event.GetString()
try:
data = self._getLayerPropertiesByName(name, mapType="raster")["surface"]
except TypeError as e:
except TypeError:
self.EnablePage("surface", False)
return

Expand Down Expand Up @@ -4590,10 +4585,6 @@ def OnVolumeSelect(self, event):
if not winUp.IsEnabled():
winUp.Enable()

# update dialog
name = self.FindWindowById(self.win["volume"]["map"]).GetValue()
layer = self._getMapLayerByName(name, mapType="raster_3d")

if mode == "isosurf":
data = self.GetLayerData("volume")["volume"]["isosurface"][selection]
self.UpdateVolumeIsosurfPage(data)
Expand Down Expand Up @@ -4694,8 +4685,6 @@ def OnVolumeDelete(self, event):
if list.GetCount() > 0:
list.SetSelection(list.GetCount() - 1)

name = self.FindWindowById(self.win["volume"]["map"]).GetValue()
layer = self._getMapLayerByName(name, mapType="raster_3d")
data = self.GetLayerData("volume")["volume"]

vid = data["object"]["id"]
Expand Down Expand Up @@ -4736,8 +4725,6 @@ def OnVolumeMoveUp(self, event):
if sel < 1:
return # this should not happen

name = self.FindWindowById(self.win["volume"]["map"]).GetValue()
layer = self._getMapLayerByName(name, mapType="raster_3d")
data = self.GetLayerData("volume")["volume"]

id = data["object"]["id"]
Expand Down Expand Up @@ -4776,8 +4763,6 @@ def OnVolumeMoveDown(self, event):
if sel >= list.GetCount() - 1:
return # this should not happen

name = self.FindWindowById(self.win["volume"]["map"]).GetValue()
layer = self._getMapLayerByName(name, mapType="raster_3d")
data = self.GetLayerData("volume")["volume"]

id = data["object"]["id"]
Expand Down
Loading