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 ii2t_manager.py #4418

Merged
merged 6 commits into from
Oct 1, 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
62 changes: 27 additions & 35 deletions gui/wxpython/image2target/ii2t_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1781,22 +1781,20 @@ def OnGeorect(self, event):
else:
flags = "a"

busy = wx.BusyInfo(_("Rectifying images, please wait..."), parent=self)
wx.GetApp().Yield()

ret, msg = RunCommand(
"i.ortho.rectify",
parent=self,
getErrorMsg=True,
quiet=True,
group=self.xygroup,
extension=self.extension,
method=self.gr_method,
angle=self.grwiz.cam_angle,
flags=flags,
)
with wx.BusyInfo(_("Rectifying images, please wait..."), parent=self):
wx.GetApp().Yield()

del busy
ret, msg = RunCommand(
"i.ortho.rectify",
parent=self,
getErrorMsg=True,
quiet=True,
group=self.xygroup,
extension=self.extension,
method=self.gr_method,
angle=self.grwiz.cam_angle,
flags=flags,
)

# provide feedback on failure
if ret != 0:
Expand Down Expand Up @@ -1828,23 +1826,21 @@ def OnGeorect(self, event):
)
ret = msg = ""

busy = wx.BusyInfo(
with wx.BusyInfo(
_("Rectifying vector map <%s>, please wait...") % vect, parent=self
)
wx.GetApp().Yield()

ret, msg = RunCommand(
"v.rectify",
parent=self,
getErrorMsg=True,
quiet=True,
input=vect,
output=self.outname,
group=self.xygroup,
order=self.gr_order,
)

del busy
):
wx.GetApp().Yield()

ret, msg = RunCommand(
"v.rectify",
parent=self,
getErrorMsg=True,
quiet=True,
input=vect,
output=self.outname,
group=self.xygroup,
order=self.gr_order,
)

# provide feedback on failure
if ret != 0:
Expand Down Expand Up @@ -1971,7 +1967,6 @@ def OnGROrder(self, event):

elif self.gr_order == 2:
minNumOfItems = 6
diff = 6 - numOfItems
# self.SetStatusText(_(
# "Insufficient points, 6+ points needed for 2nd order"))

Expand Down Expand Up @@ -2270,7 +2265,6 @@ def OnZoomToTarget(self, event):

def OnZoomMenuGCP(self, event):
"""Popup Zoom menu"""
point = wx.GetMousePosition()
zoommenu = Menu()
# Add items to the menu

Expand Down Expand Up @@ -3376,7 +3370,6 @@ def UpdateSettings(self):
srcrenderVector = False
tgtrender = False
tgtrenderVector = False
reload_target = False
if self.new_src_map != src_map:
# remove old layer
layers = self.parent.grwiz.SrcMap.GetListOfLayers()
Expand Down Expand Up @@ -3414,7 +3407,6 @@ def UpdateSettings(self):
del layers[0]
layers = self.parent.grwiz.TgtMap.GetListOfLayers()
# self.parent.grwiz.TgtMap.DeleteAllLayers()
reload_target = True
tgt_map["raster"] = self.new_tgt_map["raster"]
tgt_map["vector"] = self.new_tgt_map["vector"]

Expand Down
2 changes: 0 additions & 2 deletions gui/wxpython/image2target/ii2t_mapdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ def PrintMenu(self, event):
"""
Print options and output menu for map display
"""
point = wx.GetMousePosition()
printmenu = Menu()
# Add items to the menu
setup = wx.MenuItem(printmenu, wx.ID_ANY, _("Page setup"))
Expand Down Expand Up @@ -518,7 +517,6 @@ def SaveDisplayRegion(self, event):

def OnZoomMenu(self, event):
"""Popup Zoom menu"""
point = wx.GetMousePosition()
zoommenu = Menu()
# Add items to the menu

Expand Down
Loading