6fc@sdZddlTddlmZedddZdZdZd Zd Zd Z d Z d Z dZ e dkre ZeGHendS(s turtle-example-suite: tdemo_clock.py Enhanced clock-program, showing date and time ------------------------------------ Press STOP to exit the program! ------------------------------------ i(t*(tdatetimetlogoicCs0tt|t|t|tdS(N(tpenuptrighttforwardtlefttpendown(tdistanztwinkel((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytjumps    cCsjt|dtdt|dtdt|tdt|tdt|ddS(Ngffffff?iZg@ix(tfdtrttlt(tlaengetspitze((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pythands      cCsKtt| dtt||tt}t||dS(Ng333333?(tresetR t begin_polyRtend_polytget_polytregister_shape(tnameRRt hand_form((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytmake_hand_shape$s  cCsttdxitdD][}t||ddkrZtdt| dntdt| tdqWdS(Nii<iiiii(RtpensizetrangeR R tdotR (tradiusti((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyt clockface.s     cCs2tdtdddtdddtdddtd tatjdtjd d tatjdtjd d tatjdtjddxDtttfD]3}|j d|j ddd|j dqWt ta t j t jt jddS(NRt second_handi}it minute_handit hour_handiZitgray20tgray80tblue1tred1tblue3tred3tuseriiiiU(tmodeRRtTurtleRtshapetcolorR R!t resizemodet shapesizetspeedthttwritertputbk(R((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytsetup;s.            cCs)dddddddg}||jS(NtMondaytTuesdayt WednesdaytThursdaytFridaytSaturdaytSunday(tweekday(ttt wochentag((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyR>Ws c Cs^ddddddddd d d d g }|j}||jd }|j}d|||fS(NsJan.sFeb.sMar.sApr.tMaytJunetJulysAug.sSep.sOct.sNov.sDec.is%s %d %d(tyeartmonthtday(tztmonattjtmR=((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytdatum\s   cCstj}|j|jd}|j|d}|j|d}tttj tj tj dtj t |ddddtjd tj t|ddddtj d tttjd |tjd |tjd |ttttddS(Ngư>gN@iAtaligntcentertfonttCourieritboldiiUiiid(RMiRN(RMiRN(Rttodaytsecondt microsecondtminutethourttracertFalseR1tclearthomeRtwriteR>tbackRItTrueRt setheadingR R!tontimerttick(R=tsekundeRRtstunde((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyR]ds(           cCs&ttttttdS(Nt EVENTLOOP(RTRUR4RZR](((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pytmainzs   t__main__N(t__doc__tturtleRR)R RRRR4R>RIR]Rat__name__tmsgtmainloop(((s//usr/lib64/python2.7/Demo/turtle/tdemo_clock.pyt s