[1.1.0] Observe: log messages should be revised to be more clear --- use 1.1.4+

Bug #1502783 reported by RaiMan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Released
Undecided
RaiMan

Bug Description

observe completely revised in 1.1.3+

******* the comment from the related question:

The logging is a bit odd, though. Region.isObserving() often reports false, though there still seem to be observers. Region.stopObserver() also /says/ it stops the observer… then some other logs say the observer isn't stopped, and when I put an observer on another region, it reports "n + 1" observers… i.e., I get a monotonically increasing number of observers.

--------------------------------------------------------------------------

This is the 2015-09-25 daily.

I have Python code like:

            leftRegion = <some region>

            changeEvent = leftRegion.onChange()
            if not leftRegion.observe(True):
                print "Could not start observer"
                exit()

The program always exits (i.e., the observation can't start), with debug/error messages like:

[debug] Region: R[544,943 790x83]@S(0): observer CHANGE : 1443785667124 with: 50
[debug] Region: observe: starting in R[544,943 790x83]@S(0) for 1.0 seconds
[debug] Observer: resetting observe states for R[544,943 790x83]@S(0)
[debug] Observing: add observer: now running 1 observer(s)

[debug] Observer: update result: Patterns: false
[debug] Observer: update result: Changes: true

[debug] Observer: update result: Patterns: false
[debug] Observer: update result: Changes: true

[debug] Observer: update result: Patterns: false

[debug] Observer: update result: Changes: true

[debug] Observer: update result: Patterns: false
[debug] Observer: update result: Changes: true

[debug] Region: observe: stopped due to timeout in R[544,943 790x83]@S(0) for 1.0 seconds
Could not start observer
[debug] Sikulix: cleanUp: 0
[info] Exit code: 0
[debug] Exit code: 0
[debug] Sikulix: cleanUp: 0

So the observer can't start… or it does start, but only runs for 1 second? (and what's the "Changes: true" bit? There's nothing changing on the screen at this point.)

If I try: leftRegion.observe(FOREVER, True), it tells me the observe functions expects 0-1 arguments, not 2.

If I try leftRegion.observe(background=True) (with or without a time arg), it tells me observe doesn't take any keyword arguments:

[error] script [ DOFFOptions ] stopped with error in line 235
[error] TypeError ( observe(): takes no keyword arguments )
[error] --- Traceback --- error source first line: module ( function ) statement 60: AssignmentTasks ( collectComplete ) if not leftRegion.observe(FOREVER, background=True):
[error] --- Traceback --- end --------------
[debug] Sikulix: cleanUp: 0

Any ideas?

(Oh, and it slows down my mouse too. ;-) )

RaiMan (raimund-hocke)
Changed in sikuli:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
description: updated
RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 1.1.0 → none
importance: High → Undecided
status: Fix Committed → Fix Released
description: updated
summary: - [1.1.0] Observe: log messages should be revised to be more clear
+ [1.1.0] Observe: log messages should be revised to be more clear --- use
+ 1.1.4+
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.