Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Arohan Ajit authored and Arohan Ajit committed Oct 29, 2024
1 parent cfcf714 commit fd5d79a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 39 deletions.
2 changes: 1 addition & 1 deletion gui/wxpython/nviz/mapwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ def LoadDataLayers(self):
GError(parent=self, message=e.value)
# when nviz.tools is not yet ready
# during opening 3D view 2nd time
except (AttributeError, TypeError):
except Exception:
pass

stop = gs.clock()
Expand Down
52 changes: 14 additions & 38 deletions gui/wxpython/nviz/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def SetInitialMaps(self):
else:
try:
selection = layers[0].GetName()
except AttributeError:
except (AttributeError, IndexError):
continue
if ltype == "raster":
self.FindWindowById(self.win["surface"]["map"]).SetValue(selection)
Expand Down Expand Up @@ -734,24 +734,12 @@ def _createDataPage(self):
self.mainPanelData = SP.ScrolledPanel(parent=self)
self.mainPanelData.SetupScrolling(scroll_x=False)
self.mainPanelData.AlwaysShowScrollbars(hflag=False)
try: # wxpython <= 2.8.10
self.foldpanelData = fpb.FoldPanelBar(
parent=self.mainPanelData,
id=wx.ID_ANY,
style=fpb.FPB_DEFAULT_STYLE,
extraStyle=fpb.FPB_SINGLE_FOLD,
)
except (AttributeError, TypeError):
try: # wxpython >= 2.8.11
self.foldpanelData = fpb.FoldPanelBar(
parent=self.mainPanelData,
id=wx.ID_ANY,
agwStyle=fpb.FPB_SINGLE_FOLD,
)
except TypeError: # to be sure
self.foldpanelData = fpb.FoldPanelBar(
parent=self.mainPanelData, id=wx.ID_ANY, style=fpb.FPB_SINGLE_FOLD
)
self.foldpanelData = fpb.FoldPanelBar(
parent=self.mainPanelData,
id=wx.ID_ANY,
style=fpb.FPB_SINGLE_FOLD,
agwStyle=fpb.FPB_SINGLE_FOLD,
)

self.foldpanelData.Bind(fpb.EVT_CAPTIONBAR, self.OnPressCaption)

Expand Down Expand Up @@ -814,24 +802,12 @@ def _createAppearancePage(self):
self.mainPanelAppear = SP.ScrolledPanel(parent=self)
self.mainPanelAppear.SetupScrolling(scroll_x=False)
self.mainPanelAppear.AlwaysShowScrollbars(hflag=False)
try: # wxpython <= 2.8.10
self.foldpanelAppear = fpb.FoldPanelBar(
parent=self.mainPanelAppear,
id=wx.ID_ANY,
style=fpb.FPB_DEFAULT_STYLE,
extraStyle=fpb.FPB_SINGLE_FOLD,
)
except (AttributeError, TypeError):
try: # wxpython >= 2.8.11
self.foldpanelAppear = fpb.FoldPanelBar(
parent=self.mainPanelAppear,
id=wx.ID_ANY,
agwStyle=fpb.FPB_SINGLE_FOLD,
)
except (AttributeError, TypeError): # to be sure
self.foldpanelAppear = fpb.FoldPanelBar(
parent=self.mainPanelAppear, id=wx.ID_ANY, style=fpb.FPB_SINGLE_FOLD
)
self.foldpanelAppear = fpb.FoldPanelBar(
parent=self.mainPanelAppear,
id=wx.ID_ANY,
style=fpb.FPB_SINGLE_FOLD,
extraStyle=fpb.FPB_SINGLE_FOLD,
)

self.foldpanelAppear.Bind(fpb.EVT_CAPTIONBAR, self.OnPressCaption)
# light page
Expand Down Expand Up @@ -3384,7 +3360,7 @@ def OnSetVector(self, event):
name = event.GetString()
try:
data = self._getLayerPropertiesByName(name, mapType="vector")["vector"]
except (AttributeError, TypeError):
except (AttributeError, TypeError, KeyError):
self.EnablePage("vector", False)
return
layer = self._getMapLayerByName(name, mapType="vector")
Expand Down

0 comments on commit fd5d79a

Please sign in to comment.