sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #32193
[Bug 1450805] Re: [1.0.1] Allow click() to accept and ignore 'None' as a modifier --- fixed 2015-05-02+
** Summary changed:
- Allow click() to accept and ignore 'None' as a modifier
+ [1.0.1] Allow click() to accept and ignore 'None' as a modifier --- fixed 2015-05-02+
** Changed in: sikuli
Status: New => Fix Committed
** Changed in: sikuli
Importance: Undecided => Critical
** Changed in: sikuli
Assignee: (unassigned) => RaiMan (raimund-hocke)
** Changed in: sikuli
Milestone: None => 1.1.0
--
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