sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #24380
[Question #244467]: Is that healthy to write long commands?
New question #244467 on Sikuli:
https://answers.launchpad.net/sikuli/+question/244467
Greetings,
I'm not sure whether this question is Siluli oriented or of a more general type. But I will try.
Ususally, when I needed to locate a pattern within specific area or relative to another pattern, I would follow steps that look like that (in this case I want to locate and lick in a button that is loctaed from right to a pattern):
1. pat = find("pattern.png")
2. pat.highlight(1)
3. patR = pat.right()
4. patR.highlight
5. but = patR.find("button.png")
6. but.highlight(1)
7. but.click()
However, it is also possible to do all this just in one line, which makes the code more easy to maintain. So to rewrite the above lines:
find("pattern.png").highlight(1).right().highlight(1).find("button.png").highlight(1).click()
This works perfectly but for some reason I'm not sure if that's the better way to do that. Can someone advise or share his opinion on such way of organizing the code? Is that safe/healthy or maybe more prone to errors in a way I haven't discovered yet?
Thanks!
Eugene S
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.