← Back to team overview

sikuli-driver team mailing list archive

[Bug 1502783] [NEW] [1.1.0] Observe: log messages should be revised to be more clear

 

Public bug reported:

******* 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. ;-) )

** Affects: sikuli
     Importance: High
     Assignee: RaiMan (raimund-hocke)
         Status: Fix Committed

** Changed in: sikuli
       Status: New => Fix Committed

** Changed in: sikuli
   Importance: Undecided => High

** Changed in: sikuli
     Assignee: (unassigned) => RaiMan (raimund-hocke)

** Changed in: sikuli
    Milestone: None => 1.1.0

** Description changed:

+ ******* 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>
+             leftRegion = <some region>
  
-             changeEvent = leftRegion.onChange()
-             if not leftRegion.observe(True):
-                 print "Could not start observer"
-                 exit()
+             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.)
+ 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. ;-) )

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1502783

Title:
  [1.1.0] Observe: log messages should be revised to be more clear

Status in Sikuli:
  Fix Committed

Bug description:
  ******* 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. ;-) )

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1502783/+subscriptions


Follow ups