← Back to team overview

sikuli-driver team mailing list archive

[Bug 702291] [NEW] [request] want additional method signature Region.inside(left, right, top, bottom)

 

Public bug reported:

especially, when trying to use Region.text() optimally, I found the
following helper very convenient (I have it in my basics):

def regInside(reg, left, right, top=0, bottom=0):
    return Region(reg.x+left, reg.y+top, reg.w-left-right, reg.h-top-bottom)

This returns a new region inside the given one, with some padding left,
right, top, bottom.

It would be helpful to have it as a Region method
def inside(reg, left, right, top=0, bottom=0):

the defaults for top and bottom: I found that it is mostly helpful to
cut the region horizontally and keep the height.

e.g.
App.focus("Safari") # supposing Safari is running and shows a webpage
win = App.focusedWindow()
titleText = win.above(1).below(25).inside(70, 40).text()

so inside() helps to cut off the parts of the titlebar containing
grafics.

** Affects: sikuli
     Importance: Undecided
         Status: New

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

Title:
  [request] want additional method signature Region.inside(left, right,
  top, bottom)

Status in Sikuli:
  New

Bug description:
  especially, when trying to use Region.text() optimally, I found the
  following helper very convenient (I have it in my basics):

  def regInside(reg, left, right, top=0, bottom=0):
      return Region(reg.x+left, reg.y+top, reg.w-left-right, reg.h-top-bottom)

  This returns a new region inside the given one, with some padding
  left, right, top, bottom.

  It would be helpful to have it as a Region method
  def inside(reg, left, right, top=0, bottom=0):

  the defaults for top and bottom: I found that it is mostly helpful to
  cut the region horizontally and keep the height.

  e.g.
  App.focus("Safari") # supposing Safari is running and shows a webpage
  win = App.focusedWindow()
  titleText = win.above(1).below(25).inside(70, 40).text()

  so inside() helps to cut off the parts of the titlebar containing
  grafics.





Follow ups

References