引发事件时,我的事件处理程序方法收到以下错误。
ClassCastException: java.lang.ClassCastException:
org.python.core.PyMethod cannot be cast to org.sikuli.script.SikuliEventObserver
有人可以告诉我如何将我的 pymethod 显式转换为 eventobserver
def PostTransactionEvent(self):
""" wait while posting transaction handler, make it run in the foreground """
self.screen.onAppear("PostingTrans.png", self.WaitWhilePostingTransaction)
self.screen.observe(Timeouts.Observe, background = False)
事件处理程序
def WaitWhilePostingTransaction(self, event):
self.screen.waitVanish(event.match, Timeouts.Wait)
event.region.stopObserver()