From 728fffc062e9b2590f94dcfbb16ad3506d2ce385 Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Thu, 3 Oct 2024 14:55:52 -0400 Subject: [PATCH] fixed f841 and e266 --- .flake8 | 5 ++--- gui/wxpython/lmgr/frame.py | 2 +- gui/wxpython/lmgr/layertree.py | 2 +- gui/wxpython/lmgr/workspace.py | 11 ++++++++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.flake8 b/.flake8 index 0a48712c808..4ced7c7dbfa 100644 --- a/.flake8 +++ b/.flake8 @@ -28,10 +28,9 @@ per-file-ignores = gui/wxpython/image2target/*: F841, E722 gui/wxpython/image2target/g.gui.image2target.py: E501, F841 gui/wxpython/iscatt/*: 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 diff --git a/gui/wxpython/lmgr/frame.py b/gui/wxpython/lmgr/frame.py index 4eae371f68b..f9ce45c813b 100644 --- a/gui/wxpython/lmgr/frame.py +++ b/gui/wxpython/lmgr/frame.py @@ -1950,7 +1950,7 @@ def AddMaps(self, mapLayers, ltype, check=False): ) return - newItem = maptree.AddLayer( + maptree.AddLayer( ltype=ltype, lname=layerName, lchecked=check, diff --git a/gui/wxpython/lmgr/layertree.py b/gui/wxpython/lmgr/layertree.py index 4779a40db9b..52dc0115480 100644 --- a/gui/wxpython/lmgr/layertree.py +++ b/gui/wxpython/lmgr/layertree.py @@ -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") diff --git a/gui/wxpython/lmgr/workspace.py b/gui/wxpython/lmgr/workspace.py index a593c19b19c..774c22bf4ed 100644 --- a/gui/wxpython/lmgr/workspace.py +++ b/gui/wxpython/lmgr/workspace.py @@ -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 @@ -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