sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #48137
Re: [Question #672584]: [1.1.4] getWords() and getLines() not working --- must be collectWords/collectLines
Question #672584 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/672584
Status: Answered => Open
Tim B is still having a problem:
Awesome! The function calls no longer fail....
But just want to clarify one last thing, to be sure I understand this is
working as intended for both the collectWords() and collectLines()
functions. Should these return the actual text as elements within the
list, or the match object for the text elements resulting from the
function call?
Example:
new_reg = selectRegion("Pick some text") #<--- the actual text in the
image capture reads "This is a test!"
print new_reg.text() #<--- This returns properly "This is a test!"
print new_reg.collectWords() #<--- This returns a string type list with 4 "match" objects
# Example result:
# [M[145,57 63x22]@S(S(0)[0,0 1366x768]) S:0.88 C:177,68 [-1 msec], [etc for 2nd match], [etc for 3rd match], [etc for 4th match])
new_str = new_reg.collectWords()
print new_reg[0].text() #<--- This returns the value of the "match" object... in this case, the word "This"
print new_reg[1].text() #<--- Returns "is"
print new_reg[2].text() #<--- Returns "a"
print new_reg[3].text() #<--- Returns "test!"
--------------------------
Is this as expected, from your perspective? If so, the documents should probably reflect that the returned result is a list of Match objects, shouldn't it?
Just making sure I understand it! Thanks again for the rapid responses
and all of your great work!
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.