/usr/lib/python2.6/site-packages/boto/manage
NameSizeModeActions
cmdshell.py147390644editdlrm
cmdshell.pyc163510644editdlrm
cmdshell.pyo163510644editdlrm
propget.py25020644editdlrm
propget.pyc12960644editdlrm
propget.pyo12960644editdlrm
server.py218630644editdlrm
server.pyc217100644editdlrm
server.pyo217100644editdlrm
task.py67810644editdlrm
task.pyc65480644editdlrm
task.pyo65480644editdlrm
test_manage.py8060644editdlrm
test_manage.pyc10040644editdlrm
test_manage.pyo10040644editdlrm
volume.py162960644editdlrm
volume.pyc162220644editdlrm
volume.pyo162220644editdlrm
__init__.py11080644editdlrm
__init__.pyc1430644editdlrm
__init__.pyo1430644editdlrm
Edit: /usr/lib/python2.6/site-packages/boto/manage/task.pyo (6548B)
Ñò Å-õSc @s¥ddkZddklZlZlZddklZddkZddkZddk Z ddk l Z d„Z defd„ƒYZ defd „ƒYZdS( iÿÿÿÿN(tStringPropertytDateTimePropertytIntegerProperty(tModel(tStringIOcCsF|djodSt|ƒdjpt|ƒdjo t‚ndS(Nt*ii(tintt ValueError(tval((s4/usr/lib/python2.6/site-packages/boto/manage/task.pyt check_hours &tTaskcBs§eZdZeƒZedededdƒZedeƒZe ƒZ e ƒZ eƒZ eƒZed„ƒZd d„Zd„Zd„Zd d „Zd „ZRS( sç A scheduled, repeating task that can be executed by any participating servers. The scheduling is similar to cron jobs. Each task has an hour attribute. The allowable values for hour are [0-23|*]. To keep the operation reasonably efficient and not cause excessive polling, the minimum granularity of a Task is hourly. Some examples: hour='*' - the task would be executed each hour hour='3' - the task would be executed at 3AM GMT each day. trequiredt validatortdefaultRcCs(x!|iƒD]}|i|ƒq WdS(N(talltstart(tclst queue_namettask((s4/usr/lib/python2.6/site-packages/boto/manage/task.pyt start_all9s cKsStt|ƒi|||idj|_|idj|_tiiƒ|_dS(NR( tsuperR t__init__thourthourlytdailytdatetimetutcnowtnow(tselftidtkw((s4/usr/lib/python2.6/site-packages/boto/manage/task.pyR>scCsktiid|i|i|ifƒ|io|i odS|iok|i o`t|i ƒ|ii jodSt t|i ƒ|ii |ii t|i ƒƒddSn|i|i}|io$|i djodSd|i Snut|i ƒ|ii jo|i djodSdSn<t t|i ƒ|ii |ii t|i ƒƒddSdS( sg Determine how long until the next scheduled time for a Task. Returns the number of seconds until the next scheduled time or zero if the task needs to be run immediately. If it's an hourly task and it's never been run, run it now. If it's a daily task and it's never been run and the hour is right, run it now. s!checking Task[%s]-now=%s, last=%sii<iipCNii( tbototlogtinfotnameRt last_executedRRRRtmaxtsecondstdays(Rtdelta((s4/usr/lib/python2.6/site-packages/boto/manage/task.pytcheckDs"&? c Cs‡tiid|i|ifƒtƒ}ti|idtdti dti dti ƒ}d}|}x™|i ƒdjo…tiid||fƒ||joC||7}tiid|i|fƒ|o|i |ƒqènt idƒ|d7}qkW|iƒ}|i|d ƒ|i|d ƒtiid |i|iƒfƒ|i|_|i|_|iƒd d !|_dS( NsTask[%s] - running:%stshelltstdintstdouttstderrisnsecs=%s, timeout=%ss(Task[%s] - setting timeout to %d secondsiisTask[%s] - output: %siÿ(RR R!R"tcommandRt subprocesstPopentTruetPIPEtpolltNonetchange_visibilityttimetsleept communicatetwritetgetvalueRR#t returncodet last_statust last_output(Rtmsgtvtimeouttlog_fptprocesstnsecstcurrent_timeouttt((s4/usr/lib/python2.6/site-packages/boto/manage/task.pyt_runfs.      #  i<cCsù|iƒ}tiid|i|fƒ|djož|i||ƒ|i}|i|iƒ}|i |ƒ}|i|_ |i ƒtiid|i|ifƒ|i ƒtiid|i|ifƒn"tiid|ƒ|i |ƒdS(NsTask[%s] - delay=%s secondsisTask[%s] - new message id=%ssTask[%s] - deleted message %ssnew_vtimeout: %d(R(RR R!R"RDtqueuet new_messageRR8t message_idtputtdeleteR4(RR=R>tdelayREtnew_msg((s4/usr/lib/python2.6/site-packages/boto/manage/task.pytrun~s       $cCstiid|i|fƒtid|ƒ}|i|iƒ}|i|ƒ}|i|_|i ƒtiid|iƒdS(Ns"Task[%s] - starting with queue: %stsqssTask[%s] - start successful( RR R!R"tlookupRFRR8RGRH(RRRER=((s4/usr/lib/python2.6/site-packages/boto/manage/task.pyRs  N(t__name__t __module__t__doc__RR"R0R RR-RR#RR;R<RGt classmethodRR3RR(RDRLR(((s4/usr/lib/python2.6/site-packages/boto/manage/task.pyR #s        "  t TaskPollercBs eZd„Zddd„ZRS(cCs(tiƒ|_|ii|ƒ|_dS(N(Rt connect_sqsRMRNRE(RR((s4/usr/lib/python2.6/site-packages/boto/manage/task.pyRšsi<cCsÆx¿to·|ii|ƒ}|oti|iƒƒ}|om|i p|i|ijo4ti i d|i |ifƒ|i ||ƒq¬ti i d|i ƒq½qt i|ƒqWdS(NsTask[%s] - read message %ss-Task[%s] - found extraneous message, ignoring(R0REtreadR t get_by_idtget_bodyRGRRR R!R"RLR5R6(RtwaitR>tmR((s4/usr/lib/python2.6/site-packages/boto/manage/task.pyR2žs (RORPRR2(((s4/usr/lib/python2.6/site-packages/boto/manage/task.pyRS˜s (Rtboto.sdb.db.propertyRRRtboto.sdb.db.modelRRR.R5t boto.compatRR R tobjectRS(((s4/usr/lib/python2.6/site-packages/boto/manage/task.pyts $ u