I have an Observer
running in background forever, that is looking for a specific pattern
, and will call the handler rdp_handler
when triggererd:
onAppear("1615387075076.png", rdp_handler)
observeInBackground()
The handler is supposed to wait FOREVER
or to wait for the pattern
to vanish:
print "rdp_handler called"
waitVanish("1615387075076.png", FOREVER)
print "rdp_handler finished"
Basically what I'm trying to do is pause the execution of the script until the pattern
vanish, obviously this doesn't work because the handler is executed in a Thread
, so the Thread
is paused but my main programm keep running.
I tried to import psutil
to suspend the java process, but I get the following traceback (after adding the path to the site-package directory):
[error] script [ OrderCreate ] stopped with error in line 11
[error] NotImplementedError ( platform java13.0.2 is not supported )
[error] --- Traceback --- error source first
line: module ( function ) statement
143: __init__ ( <module> ) raise NotImplementedError('platform %s is not supported' % sys.platform)
11: main ( <module> ) import psutil
[error] --- Traceback --- end --------------
After some research I found out that I can only import java
and pur python
lib, psutil has some C
code in it...
Here come my question: do you have a clue on how to proceed to pause the main programm until the handler is done doing his stuff ?