← Back to team overview

sikuli-driver team mailing list archive

[Bug 1450805] Re: [1.0.1] Allow click() to accept and ignore 'None' as a modifier --- fixed 2015-05-02+

 

That makes sense, I didn't think about how that would look in Java,
though I did initially check to see if any of the click() code was in
Jython.

I was hesitant to split the call with an if statement (if modifier or
not) since the logic is more complex than my trivial example, and the
click is part of an if statement.  I overlooked assigning the result of
the click to a variable and splitting out the assignment calls based on
the modifier parameter.

Thanks!

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

Title:
  [1.0.1] Allow click() to accept and ignore 'None' as a modifier ---
  fixed 2015-05-02+

Status in Sikuli:
  Fix Committed

Bug description:
  Currently the click() method accepts key modifiers as optional arguments. We have created a wrapper function on the click to ensure a little extra stability with the click method and have it available across all scripts.
  ex:

  def myClickFun(region, image, modifier=None):
      # Do some things for stability
      region.click(image, modifier)

  We ran into an issue when we needed to introduce the key modifier
  argument. If we provide the modifier it works as expected, however
  this breaks all other instances where no modifier is provided giving
  the following error:

  TypeError: click(): 2nd arg can't be coerced to int

  I was expecting the None to be ignored since that is usually the
  default behavior of an optional argument. Then I remembered that you
  can supply an integer with the click() method (A quick test revealed
  that no integer and a value of 60 timed out at about the same time).
  It seems that the click method could accept keyword arguments (and
  ignore none as a modifier) to allow for greater flexibility in the
  method call. Maybe just a single keyword for the modifier in case an
  integer is not supplied?

  I realize the great chance that I'm doing something wrong here... if
  so please let me know.

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


References