← Back to team overview

sikuli-driver team mailing list archive

[Bug 778819] Re: X-1.0rc2: Region spatial operators (nearby, left, right, ...) do not return a Region object

 

Thanks for reporting this.

** Summary changed:

- X-1.0rc2: TypeError: click(): expected 2 args; got 1
+ X-1.0rc2: Region spatial operators (nearby, left, right, ...) do not return a Region object

** Changed in: sikuli
       Status: New => Confirmed

** Description changed:

+ affected is the Python level
+ they seem to return a Region object from the Java level, that cannot be used the same way on the Python level
+ This gives errors when trying to use Region methods with these Regions (like Region.click())
+ 
+ *** workaround
+ cast the region to a Region object on the Python level, e.g.
+ Region(other_region.nearby(100)).click("some-image.png")
+ -------------------------------------------------------------------------------------------
+ 
  This gives the error above:
  
-     for ready in region.findAll(status):
-       ready.nearby(100)).click(ok)
+     for ready in region.findAll(status):
+       ready.nearby(100)).click(ok)
  
  Note that this also gives the same error:
  
-     for ready in region.findAll(status):
-       ready = Region(ready)
-       ready.nearby(100).click(ok)
+     for ready in region.findAll(status):
+       ready = Region(ready)
+       ready.nearby(100).click(ok)
  
  Only this one works without `click(): expected 2 args; got 1` error:
  
-     for ready in region.findAll(status):
-       Region(ready.nearby(100)).click(ok)
+     for ready in region.findAll(status):
+       Region(ready.nearby(100)).click(ok)

** Summary changed:

- X-1.0rc2: Region spatial operators (nearby, left, right, ...) do not return a Region object
+ X-1.0rc2: Region spatial operators (nearby, left, right, ...) do not return a Region object --- workaround

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

Title:
  X-1.0rc2: Region spatial operators (nearby, left, right, ...) do not
  return a Region object --- workaround

Status in Sikuli:
  Confirmed

Bug description:
  affected is the Python level
  they seem to return a Region object from the Java level, that cannot be used the same way on the Python level
  This gives errors when trying to use Region methods with these Regions (like Region.click())

  *** workaround
  cast the region to a Region object on the Python level, e.g.
  Region(other_region.nearby(100)).click("some-image.png")
  -------------------------------------------------------------------------------------------

  This gives the error above:

      for ready in region.findAll(status):
        ready.nearby(100)).click(ok)

  Note that this also gives the same error:

      for ready in region.findAll(status):
        ready = Region(ready)
        ready.nearby(100).click(ok)

  Only this one works without `click(): expected 2 args; got 1` error:

      for ready in region.findAll(status):
        Region(ready.nearby(100)).click(ok)


References