Skip to content

Commit

Permalink
fixed busyInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Arohan Ajit authored and Arohan Ajit committed Oct 22, 2024
1 parent 6c7c9f2 commit d73e0f3
Showing 1 changed file with 25 additions and 27 deletions.
52 changes: 25 additions & 27 deletions gui/wxpython/photo2image/ip2i_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,42 +1107,40 @@ def OnGeorect(self, event):
else:
flags = "a"

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

ret, msg = RunCommand(
"i.rectify",
parent=self,
getErrorMsg=True,
quiet=True,
group=self.xygroup,
extension=self.extension,
order=self.gr_order,
method=self.gr_method,
flags=flags,
)

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

# provide feedback on failure
if ret != 0:
print("ip2i: Error in i.rectify", file=sys.stderr)
print(self.grwiz.src_map, file=sys.stderr)
print(msg, file=sys.stderr)

wx.BusyInfo(_("Writing output image to group, please wait..."), parent=self)
wx.GetApp().Yield()

ret1, msg1 = RunCommand(
"i.group",
parent=self,
getErrorMsg=True,
quiet=False,
group=self.xygroup,
input="".join([self.grwiz.src_map.split("@")[0], self.extension]),
)
with wx.BusyInfo(
_("Writing output image to group, please wait..."), parent=self
):
wx.GetApp().Yield()

del busy
ret1, msg1 = RunCommand(
"i.group",
parent=self,
getErrorMsg=True,
quiet=False,
group=self.xygroup,
input="".join([self.grwiz.src_map.split("@")[0], self.extension]),
)

if ret1 != 0:
print("ip2i: Error in i.group", file=sys.stderr)
Expand Down

0 comments on commit d73e0f3

Please sign in to comment.