Skip to content

Commit

Permalink
wxGUI: Fixed F841 and E266 in lmgr/ (#4439)
Browse files Browse the repository at this point in the history
fixed f841 and e266
  • Loading branch information
arohanajit authored Oct 4, 2024
1 parent 1e86629 commit eebf369
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 2 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ per-file-ignores =
gui/scripts/d.wms.py: E501
gui/wxpython/image2target/*: F841, E722
gui/wxpython/image2target/g.gui.image2target.py: E501, F841
gui/wxpython/lmgr/frame.py: F841, E722
gui/wxpython/lmgr/frame.py: E722
# layertree still includes some formatting issues (it is ignored by Black)
gui/wxpython/lmgr/layertree.py: E722, E266, W504, E225
gui/wxpython/lmgr/workspace.py: F841
gui/wxpython/lmgr/layertree.py: E722
gui/wxpython/modules/*: F841, E722
gui/wxpython/nviz/*: F841, E266, E722, F403, F405
gui/wxpython/photo2image/*: F841, E722, E265
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/lmgr/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ def AddMaps(self, mapLayers, ltype, check=False):
)
return

newItem = maptree.AddLayer(
maptree.AddLayer(
ltype=ltype,
lname=layerName,
lchecked=check,
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/lmgr/layertree.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ def OnLayerContextMenu(self, event):
# self.popupMenu.Enable(self.popupID['bgmap'], False)
self.popupMenu.Enable(self.popupID["topo"], False)
# else:
### self.popupMenu.Enable(self.popupID['bgmap'], True)
# self.popupMenu.Enable(self.popupID['bgmap'], True)

item = wx.MenuItem(
self.popupMenu, id=self.popupID["meta"], text=_("Metadata")
Expand Down
11 changes: 8 additions & 3 deletions gui/wxpython/lmgr/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,10 @@ def Load(self, filename):
parent=self.lmgr,
message=_(
"Reading workspace file <%s> failed.\n"
"Invalid file, unable to parse XML document."
"Invalid file, unable to parse XML document.\n"
"Error details: %s"
)
% filename,
% (filename, str(e)),
)
return False

Expand Down Expand Up @@ -436,7 +437,11 @@ def SaveToFile(self, filename):
except Exception as e:
GError(
parent=self.lmgr,
message=_("Writing current settings to workspace file failed."),
message=_(
"Writing current settings to workspace file <%s> failed.\n"
"Error details: %s"
)
% (tmpfile, str(e)),
)
return False

Expand Down

0 comments on commit eebf369

Please sign in to comment.