sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #18089
Re: [Question #229079]: select a date from calendar
Question #229079 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/229079
Status: Answered => Open
csy is still having a problem:
Hi RaiMan, yea, sikuli cannot read those integer on calendar.
I think I can only try the 2nd method as suggested.
I read through the https://answers.launchpad.net/sikuli/+question/190414, where my case is quite similar to this.
but I don't understand the script:
import datetime
ctopImg = Pattern().targetOffset(104,60)
ctop = wait(ctopImg, 10)
cboxH = 225 #?
cbarH = 60+23 #?
ccalH = cboxH-cbarH #?
ccal = ctop.below(cbarH).below(ccalH)
ccal.x += 3; ccal.w -= 8 #?
colW = ccal.w/7 #divided to 7 columns for weekday
rowH = ccal.h/5 #divided to 5 rows for week
topLeft = Location(ccal.x+colW/2, ccal.y+rowH/2) #?
mths = (31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) #how if
February got 28 days?
# visit last monday which day that I want to click
from datetime import timedelta
weeks = 0
today = date.today()
monday = today - timedelta(days=today.weekday()) + timedelta(days=0, weeks=-1)
wait(3)
firstDay = datetime.date(y, m, 1).weekday()
for r in range(6):
for c in range(firstDay,7):
monday -= 1 #?
if 1 > monday:
hover(topLeft.offset(c*colW, r*rowH))
break
if 1 > monday: break
firstDay = 0
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.