GIF89a=( �' 7IAXKgNgYvYx\%wh&h}t�h%�s%x�}9�R��&�0%� (�.��5�SD��&�a)�x5��;ͣ*ȡ&ղ)ׯ7׵<ѻ4�3�H֧KͯT��Y�aq��q��F� !� ' !� NETSCAPE2.0 , =( ��pH,�Ȥr�l:xШtJ�Z�جv��z��xL.:��z�n���|N�����~�������& !�0`9R�}��"�"a:S�~x��������g���E�������R���E����B�� ��ȸ��D���"�Ů� �H��L��D٫D�B�����D���T���H �G��A R�ڐ |�� ٭&��E8�S�kG�A�px�a��� R2XB��E8I���6X�:vT)�~��q�賥��"F~%x� � 4#Z�0O|-4Bs�X:= Q� Sal��yXJ`GȦ|s h��K3l7�B|�$'7Jީܪ0!��D�n=�P� ����0`�R�lj����v>���5 �.69�ϸd�����nlv�9��f{���Pbx �l5}�p� ��� �3a���I�O����!ܾ���i��9��#��)p�a ޽ �{�)vm��%D~ 6f��s}Œ�D�W E�`!� �&L8x� �ܝ{)x`X/>�}m��R�*|`D�=�_ ^�5 !_&'a�O�7�c��`DCx`�¥�9�Y�F���`?��"� �n@`�} lď��@4>�d S �v�xN��"@~d��=�g�s~G��� ���ud &p8Q�)ƫlXD����A~H�ySun�j���k*D�LH�] ��C"J��Xb~ʪwSt}6K,��q�S:9ت:���l�@�`�� �.۬�t9�S�[:��=`9N����{¿�A !R�:���6��x�0�_ �;������^���#����!����U���;0L1�����p% A��U̬ݵ��%�S��!���~`�G���� ���=4�np�3���������u�u�ٮ|%2�I��r�#0��J``8�@S@5� ���^`8E�]�.�S���7 � �0�j S�D� z���i�S�����!���l��w9*�D�I�nEX��� &A�Go�Qf��F��;���}�J����F5��Q|���X��T��y���]� o ��C=��:���PB@ D׽S�(>�C�x}`��xJЬ�۠��p+eE0`�}`A �/NE�� �9@��� H�7�!%B0`�l*��!8 2�%� �:�1�0E��ux%nP1�!�C)�P81l�ɸF#Ƭ{����B0>�� �b�`��O3��()yRpb��E.ZD8�H@% �Rx+%���c� ���f��b�d�`F�"8�XH"��-�|1�6iI, 2�$+](A*j� QT�o0.�U�`�R�}`�SN����yae�����b��o~ S)�y�@��3 �tT�0�&�+~L�f"�-|�~��>!�v��~�\Q1)}@�}h#aP72�"�$ !� " , =( &7IAXG]KgNgYvYxR"k\%w]'}h}t�h%�g+�s%r.m3ax3�x�}9��&��+�!7�0%� (�.�SD��&��;�"&ײ)׻4��6�K� �@pH,�Ȥr�l:xШtJ�Z�جv��z��xL.:��z�n���|N�����~�������& !�0`9R�}��"�"a:S�~x��������g �� E �� �������E �´��C���ǶR��D��"Ʒ�ʱH��M��GڬD�B����D��T����G���C�C� l&�~:'�tU�6ɹ#��)�'�.6�&��Ȼ K(8p0N�?!�2"��NIJX>R��OM '��2�*x�>#n� �@<[:�I�f ��T���Cdb��[�}E�5MBo��@�`@��tW-3 �x�B���jI�&E�9[T&$��ﯧ&"s��ȳ����dc�UUρ#���ldj?����`\}���u|3'�R]�6 �S#�!�FKL�*N E���`$�:e�YD�q�.�촁�s \-�jA 9�����-��M[�x(�s��x�|���p��}k�T�DpE@W� ��]k`1� ���Yb ��0l��*n0��"~zBd�~u�7�0Bl��0-�x~|U�U0 �h�*HS�|��e"#"?vp�i`e6^�+q��`m8 #V�� ��VS|`��"m"сSn|@:U���~`pb�G�ED����2F�I�? >�x� R� ��%~jx��<�a�9ij�2�D��&: Z`�]w���:�6��B�7eFJ|�ҧ�,���FǮcS�ʶ+B�,�ܺN���>PAD�HD��~���n��}�#�� Q��S���2�X�{�k�lQ�2�����w�|2� h9��G�,m���3��6-��E�L��I�³*K���q�`DwV�QXS��peS��� qܧTS����R�u �<�a�*At�lmE� � ��N[P1�ۦ��$��@`��Dpy�yXvCAy�B`}D� 0QwG#� �a[^�� $���Ǧ{L�"[��K�g�;�S~��GX.�goT.��ư��x���?1z��x~:�g�|�L� ��S`��0S]P�^p F<""�?!,�!N4&P� ����:T�@h�9%t��:�-~�I<`�9p I&.)^ 40D#p@�j4�ج:�01��rܼF2oW�#Z ;$Q q  �K��Nl#29 !F@�Bh�ᏬL!XF�LHKh�.�hE&J�G��<"WN!�����Y@� >R~19J"�2,/ &.GXB%�R�9B6�W]���W�I�$��9�RE8Y� ��"�A5�Q.axB�&ة�J�! �t)K%tS-�JF b�NMxL��)�R��"���6O!TH�H� 0 !� ) , =( &AXKgNgYvYxR"k\%wh&h}h%�g+�s%r.x3�x�}9��&��+�R,�!7�0%� (�.��5��&�a)��;�"&ף*Ȳ)ׯ7׻4�3��6�H֧KͻH�T��Y��q��h� ��pH,�Ȥr�l:xШtJ�Z�جv��z��xL.:��z�n���|N�����~�������& !�0`9R�}��"�"a:S�~x��������g �� E$����� � ����$E$��"��D� � ������R��C��� E ��H�M��G�D� �B��ϾD��a��`1r��Ӑ�� �o~�zU!L�C'�yW�UGt����ll�0���uG�)A�s[��x� �xO%��X2�  P�n:R/��aHae+�Dm?# ǣ6�8�J�x�Di�M���j���5oQ7�- <! *�l��R2r/a!l)d� A"�E���� &� ;��c �%����b��pe~C"B���H�eF2��`8qb�t_`ur`e� w�u3��Pv�h""�`�Íx�LĹ��3� �~ֺ�:���MDfJ� �۵�W�%�S�X �؁)�@��:E��w�u�Sxb8y\m�zS��Zb�E�L��w!y(>�"w�=�|��s�d �C�W)H�cC$�L �7r.�\{)@�`@ �X�$PD `aaG:���O�72E�amn]�"Rc�x�R� &dR8`g��i�xLR!�P &d����T���i�|�_ � Qi�#�`g:��:noM� :V �)p����W&a=�e�k� j���1߲s�x�W�jal|0��B0�, \j۴:6���C ��W��|��9���zĸV {�;��n��V�m�I��.��PN� ����C��+��By�ѾHŸ:��� 7�Y�FTk�SaoaY$D�S���29R�kt� ��f� ��:��Sp�3�I��DZ� �9���g��u�*3)O��[_hv ,���Et x�BH� �[��64M@�S�M7d�l�ܶ5-��U܍��z�R3Ԭ3~ ��P��5�g: ���kN�&0�j4���#{��3S�2�K�'ợl���2K{� {۶?~m𸧠�I�nE�='����^���_�=��~�#O���'���o..�Y�n��CSO��a��K��o,���b�����{�C�� "�{�K ��w��Ozdը�:$ ���v�] A#� ���a�z)Rx׿ƥ�d``�w-�y�f�K!����|��P��=�`�(f��'Pa ��BJa%��f�%`�}F����6>��`G"�}�=�!o`�^FP�ةQ�C���`(�}\�ݮ ��$<��n@dĠE#��U�I�!� #l��9`k���'Rr��Z�NB�MF �[�+9���-�wj���8�r� ,V�h"�|�S=�G_��"E� 0i*%̲��da0mVk�):;&6p>�jK ��# �D�:�c?:R Ӭf��I-�"�<�="��7�3S��c2RW ,�8(T"P0F¡Jh�" ; 403WebShell
403Webshell
Server IP : 81.88.48.95  /  Your IP : 10.2.217.94, 216.73.216.34
Web Server : Apache
System : Linux opus10 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u3 x86_64
User : nobody ( 99)
PHP Version : 5.3.3-7+squeeze3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python2.6/lib-tk/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/lib-tk/turtle.pyc
McW@s$dZdZddkZddkZddkZddkZddkZddkl	Z	l
Z
lZddkl
Z
ddkTddd	d
ddd
ddg	Zddddddddddddddddd d!d"d#d$d%d&d'd(d)gZd*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmd%dndodpdqdrd(d)dsdtdugOZdvdwdxgZdydzd{d|d}d~dddddddddddddddddddgZeeeeeZdd+d.d;dGdKdOdUdWd\d]d_d`didndqdrgZhddr6dd6dd6dd6ed6ed6dd6dd6dd6dd6dde6ddQ6dd=6dd[6ed6dd6dd6dd6dd$6ed6ZdZdZyeeWndGHnXdefdYZdZdZddZfdZ dei!fdYZ"e e"ei#ddei$fdYZ%ei#Z#de&fdYZ'de(fdYZ)de(fdYZ*de&fdYZ+de&fdYZ,de'fdYZ-de&fdYZ.de&fdYZ/de&fdYZ0d
e/e.fdYZ1e1Z2dZ3de-fdYZ4de1fdYZ5e5Z6dZ7dZ8ddZ9dZ:edZ;ye;djoe:e;nWn+e<j
odGe;GHnde;GHnXdZ=dZ>dZ?xeD]Z@e=eAde@\ZBZCeBdjodGeBGeCGHqndhe@d6eBd6eCd6ZDeDdUe?eAde@ieAe@_qWxeD]Z@e=eAde@\ZBZCeBdjodGeBGeCGHq9ndhe@d6eBd6eCd6ZDeDdUe>eAde@ieAe@_q9WeiEZFZE[B[C[DeGdjo4dZHdZIdZJeIeJeKndS(s

Turtle graphics is a popular way for introducing programming to
kids. It was part of the original Logo programming language developed
by Wally Feurzig and Seymour Papert in 1966.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. Give it
the command turtle.forward(15), and it moves (on-screen!) 15 pixels in
the direction it is facing, drawing a line as it moves. Give it the
command turtle.left(25), and it rotates in-place 25 degrees clockwise.

By combining together these and similar commands, intricate shapes and
pictures can easily be drawn.

----- turtle.py

This module is an extended reimplementation of turtle.py from the
Python standard distribution up to Python 2.5. (See: http://www.python.org)

It tries to keep the merits of turtle.py and to be (nearly) 100%
compatible with it. This means in the first place to enable the
learning programmer to use all the commands, classes and methods
interactively when using the module from within IDLE run with
the -n switch.

Roughly it has the following features added:

- Better animation of the turtle movements, especially of turning the
  turtle. So the turtles can more easily be used as a visual feedback
  instrument by the (beginning) programmer.

- Different turtle shapes, gif-images as turtle shapes, user defined
  and user controllable turtle shapes, among them compound
  (multicolored) shapes. Turtle shapes can be stretched and tilted, which
  makes turtles very versatile geometrical objects.

- Fine control over turtle movement and screen updates via delay(),
  and enhanced tracer() and speed() methods.

- Aliases for the most commonly used commands, like fd for forward etc.,
  following the early Logo traditions. This reduces the boring work of
  typing long sequences of commands, which often occur in a natural way
  when kids try to program fancy pictures on their first encounter with
  turtle graphics.

- Turtles now have an undo()-method with configurable undo-buffer.

- Some simple commands/methods for creating event driven programs
  (mouse-, key-, timer-events). Especially useful for programming games.

- A scrollable Canvas class. The default scrollable Canvas can be
  extended interactively as needed while playing around with the turtle(s).

- A TurtleScreen class with methods controlling background color or
  background image, window and canvas size and other properties of the
  TurtleScreen.

- There is a method, setworldcoordinates(), to install a user defined
  coordinate-system for the TurtleScreen.

- The implementation uses a 2-vector class named Vec2D, derived from tuple.
  This class is public, so it can be imported by the application programmer,
  which makes certain types of computations very natural and compact.

- Appearance of the TurtleScreen and the Turtles at startup/import can be
  configured by means of a turtle.cfg configuration file.
  The default configuration mimics the appearance of the old turtle module.

- If configured appropriately the module reads in docstrings from a docstring
  dictionary in some different language, supplied separately  and replaces
  the English ones by those read in. There is a utility function
  write_docstringdict() to write a dictionary with the original (English)
  docstrings to disc, so it can serve as a template for translations.

Behind the scenes there are some features included with possible
extensions in in mind. These will be commented and documented elsewhere.

s5turtle 1.0b1 - for Python 2.6   -  30. 5. 2008, 18:08iN(tisfiletsplittjoin(tdeepcopy(t*tScrolledCanvastTurtleScreentScreent	RawTurtletTurtletRawPentPentShapetVec2Dtaddshapetbgcolortbgpictbyetclearscreent	colormodetdelaytexitonclickt	getcanvast	getshapestlistentmodetonkeyt
onscreenclicktontimertregister_shapetresetscreent
screensizetsetuptsetworldcoordinatesttitlettracertturtlestupdatet
window_heighttwindow_widthtbacktbackwardt
begin_fillt
begin_polytbktcircletcleart
clearstamptclearstampstclonetcolortdegreestdistancetdottdowntend_filltend_polytfdtfillt	fillcolortforwardtget_polytgetpent	getscreent	getturtletgototheadingt
hideturtlethomethttisdownt	isvisibletlefttlttonclicktondragt	onreleasetpdtpentpencolortpendowntpensizetpenuptpostpositiontputradianstrighttresett
resizemodetrttsetht
setheadingtsetpostsetpositiontsettiltanglet
setundobuffertsetxtsetytshapet	shapesizet
showturtletspeedtsttstampttiltt	tiltanglettowardst
turtlesizetundotundobufferentriestuptwidthtwritetxcortycortwrite_docstringdicttdonetmainlooptacostasintatantatan2tceiltcostcoshtetexptfabstfloortfmodtfrexpthypottldexptlogtlog10tmodftpitpowtsintsinhtsqrtttanttanhg?g?theightit	canvwidthi,t
canvheightt	leftrightt	topbottomtstandardg?i
itundobuffersizetclassictblacktnoresizetvisibletenglishtlanguagetturtlet
exampleturtletscreent
examplescreensPython Turtle Graphicst
using_IDLEc
Cst|d}|i}|ih}x|D]}|i}|p|idoq2ny|id\}}Wnd||fGHq2nX|i}|i}|djot|}n8y-d
|jot|}n
t|}WnnX|||<q2W|S(s/Convert content of config-file into dictionary.trt#t=sBad line in config-file %s:
%stTruetFalsetNones''s""t.(sTruesFalsesNones''s""(	topent	readlinestclosetstript
startswithRtevaltfloattint(tfilenametftcfglinestcfgdicttlinetkeytvalue((s#/usr/lib/python2.6/lib-tk/turtle.pytconfig_dicts4


cCsd}h}h}t|ot|}nd|jod|d}ny%tt\}}t||}Wn
d}nXt|ot|}nti|ti|dS(s@Read config-files, change configuration-dict accordingly.

    If there is a turtle.cfg file in the current working directory,
    read it from there. If this contains an importconfig-value,
    say 'myway', construct filename turtle_mayway.cfg else use
    turtle.cfg and read it from the import-directory, where
    turtle.py is located.
    Update configuration dictionary first according to config-file,
    in the import directory, then according to config-file in the
    current working directory.
    If no config-file is found, the default configuration is used.
    s
turtle.cfgtimportconfigs
turtle_%s.cfgtN(RRRt__file__Rt_CFGR%(Rtdefault_cfgtcfgdict1tcfgdict2theadttailt	cfg_file2((s#/usr/lib/python2.6/lib-tk/turtle.pyt
readconfigs 





s"No configfile read, reason unknowncBsheZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZRS(sA 2 dimensional vector class, used as a helper class
    for implementing turtle graphics.
    May be useful for turtle graphics programs also.
    Derived from tuple, so a vector is a tuple!

    Provides (for a, b vectors, k number):
       a+b vector addition
       a-b vector subtraction
       a*b inner product
       k*a and a*k multiplication with scalar
       |a| absolute value of a
       a.rotate(angle) rotation
    cCsti|||fS(N(ttuplet__new__(tclstxty((s#/usr/lib/python2.6/lib-tk/turtle.pyRscCs%t|d|d|d|dS(Nii(R
(tselftother((s#/usr/lib/python2.6/lib-tk/turtle.pyt__add__scCsNt|to!|d|d|d|dSt|d||d|S(Nii(t
isinstanceR
(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyt__mul__s!cCsBt|tpt|tot|d||d|SdS(Nii(RRRR
(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyt__rmul__s cCs%t|d|d|d|dS(Nii(R
(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyt__sub__scCst|d|dS(Nii(R
(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt__neg__scCs|dd|dddS(Niiig?((R((s#/usr/lib/python2.6/lib-tk/turtle.pyt__abs__scCs}t|d|d}|tid}ti|ti|}}t|d||d||d||d|S(s.rotate self counterclockwise by angle
        iigf@(R
tmathRR|R(Rtangletperptcts((s#/usr/lib/python2.6/lib-tk/turtle.pytrotatescCs|d|dfS(Nii((R((s#/usr/lib/python2.6/lib-tk/turtle.pyt__getnewargs__&scCsd|S(Ns(%.2f,%.2f)((R((s#/usr/lib/python2.6/lib-tk/turtle.pyt__repr__(s(
t__name__t
__module__t__doc__RRRRRRRRRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyR
s
									cCst|i}|ix|D]}t||q WxA|iiD]0\}}t|tijo|||<qGqGWdS(s#helper function for Scrolled CanvasN(	tlistt	__bases__treverset__methodDictt__dict__titemsttypettypestFunctionType(Rt_dicttbaseListt_superRR((s#/usr/lib/python2.6/lib-tk/turtle.pyR4s
cCsh}t|||iS(s#helper function for Scrolled Canvas(Rtkeys(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyt	__methods>s
s*def %(method)s(self, *args, **kw): return s*self.%(attribute)s.%(method)s(*args, **kw)c
Bs5h}e||xA|iD]3}|d djp|ddjo||=q q Wx)|D]!}|i|o||=q^q^Wx/e|D]!}|i|o||=qqWxy|iD]k\}}h|d6|d6}e|eijoeh|d6|d6}	n|	|U|||i	|<qWdS(snHelper functions for Scrolled Canvas, used to forward
    ScrolledCanvas-methods to Tkinter.Canvas class.
    it_itmethodtfunct	attributeN(
RRthas_keyRRRRt
StringTypet__stringBodyR(
t	fromClassttoClassttoParttexcludeRtexRRtdt
execString((s#/usr/lib/python2.6/lib-tk/turtle.pyt__forwardmethodsHs*

"

cBs}eZdZdddddZddddZdZdZdZd	Z	d
Z
dZdZd
Z
RS(sModeled after the scrolled canvas class from Grayons's Tkinter book.

    Used as the default canvas, which pops up automatically when
    using turtle graphics functions or the Turtle class.
    ii^iXcCs
tii||d|d||i|_|||_|_|||_|_d|_	ti
|d|d|d|i	dtidd|_ti
|d|iid	ti|_ti
|d|ii|_|iid
|iid|ii|idd
ddd|idd
ddd|iiddd|dddddddddddd|iiddd|dddddddddddd|iiddd|dddddddddddd|i|iid|idS(NRpRtwhitetbgtrelieftborderwidthitcommandtorienttxscrollcommandtyscrollcommanditweightitminsizetpadxtin_tpadytrowtcolumntrowspant
columnspantstickytnewss<Configure>(tTKtFramet__init__twinfo_toplevelt_rootwindowRpRRRRtCanvastSUNKENt_canvast	Scrollbartxviewt
HORIZONTALthscrolltyviewtvscrollt	configuretsettrowconfiguretcolumnconfiguretgridRXtbindtonResize(RtmasterRpRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRgs,	
$$$
c	Cs|o
||_n|o
||_n|o
||_n|iid|d|id|id|id|idf|iid|i|id|i|iid|i|id|i|i	dS(s<Adjust canvas and scrollbars according to given canvas size.Rtscrollregionig?iN(
RRRRtconfigtxview_movetoRptyview_movetoRt
adjustScrolls(RRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRXs


cCs|ii}|ii}|iid|i||i|iid|i||i||ijp||ijo~|iiddd|ddddddd	dd
ddd|i	iddd|ddddddd	dd
dddn|ii
|i	i
d
S(sA Adjust scrollbars according to window- and canvas-size.
        g?RiRRRRiR	R
RRN(Rtwinfo_widthtwinfo_heightR%RR&RRRRtgrid_forget(Rtcwidthtcheight((s#/usr/lib/python2.6/lib-tk/turtle.pyR's"" $$
cCs|idS(sself-explanatoryN(R'(Rtevent((s#/usr/lib/python2.6/lib-tk/turtle.pyR!scGs|ii|S(s@ 'forward' method, which canvas itself has inherited...
        (Rtbbox(Rtargs((s#/usr/lib/python2.6/lib-tk/turtle.pyR.scOs|ii||S(s@ 'forward' method, which canvas itself has inherited...
        (Rtcget(RR/tkwargs((s#/usr/lib/python2.6/lib-tk/turtle.pyR0scOs|ii||dS(s@ 'forward' method, which canvas itself has inherited...
        N(RR$(RR/R1((s#/usr/lib/python2.6/lib-tk/turtle.pyR$scOs|ii||dS(s@ 'forward' method, which canvas itself has inherited...
        N(RR (RR/R1((s#/usr/lib/python2.6/lib-tk/turtle.pyR scOs|ii||dS(s@ 'forward' method, which canvas itself has inherited...
        N(Rtunbind(RR/R1((s#/usr/lib/python2.6/lib-tk/turtle.pyR2scCs|iidS(s@ 'forward' method, which canvas itself has inherited...
        N(Rtfocus_force(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR3sN(RRRRRRXR'R!R.R0R$R R2R3(((s#/usr/lib/python2.6/lib-tk/turtle.pyRas							Rt_RootcBsMeZdZdZdZdZdZdZdZdZ	RS(s'Root class for Screen based on Tkinter.cCstii|dS(N(R
tTkR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRscCs8t||||||_|iidddddS(NtexpandiR:tboth(RRtpack(RRpRR+R,((s#/usr/lib/python2.6/lib-tk/turtle.pytsetupcanvasscCs|iS(N(R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt
_getcanvasscCs!|id||||fdS(Ns%dx%d%+d%+d(tgeometry(RRpRtstartxtstarty((s#/usr/lib/python2.6/lib-tk/turtle.pytset_geometryscCs|id|dS(NtWM_DELETE_WINDOW(twm_protocol(Rtdestroy((s#/usr/lib/python2.6/lib-tk/turtle.pyt	ondestroyscCs
|iS(N(twinfo_screenwidth(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt	win_widthscCs
|iS(N(twinfo_screenheight(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt
win_heights(
RRRRR9R:R>RBRDRF(((s#/usr/lib/python2.6/lib-tk/turtle.pyR4s						tTurtleScreenBasecBs[eZdZedZedZdZdZddde	dZ
dZddde	dZdZ
d	Zd
ZdZddZd
ZdddZdddZdddZdddZdZdZdZdZdZdZdZdZdZdZ ddddZ!dZ"RS( sProvide the basic graphics functionality.
       Interface between Tkinter and turtle.py.

       To port turtle.py to some different graphics toolkit
       a corresponding TurtleScreenBase class has to be implemented.
    cCs&tidddd}|i|S(s$return a blank image object
        RpiR(R
t
PhotoImagetblank(timg((s#/usr/lib/python2.6/lib-tk/turtle.pyt_blankimages
cCstid|S(s`return an image object containing the
        imagedata from a gif-file named filename.
        tfile(R
RH(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt_imagescCs||_t|to|ii}|ii}nbt|iid}t|iid}|iid|d|d|d|df||_||_d|_|_	dS(NRpRR#ig?(
tcvRRRRRR0R$txscaletyscale(RRNtwth((s#/usr/lib/python2.6/lib-tk/turtle.pyRs	1		cCs|iidddddS(s<Create an invisible polygon item on canvas self.cv)
        iR:Rtoutline(iiiiii(RNtcreate_polygon(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt_createpolysc
Csg}x=|D]5\}}	|i||i|i|	|iq
W|ii|||dj	o|ii|d|n|dj	o|ii|d|n|dj	o|ii|d|n|o|ii|ndS(s`Configure polygonitem polyitem according to provided
        arguments:
        coordlist is sequence of coordinates
        fill is filling color
        outline is outline color
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        R:RSRpN(tappendRORPRNtcoordsRt
itemconfiguret	tag_raise(
Rtpolyitemt	coordlistR:RSRpttoptclRR((s#/usr/lib/python2.6/lib-tk/turtle.pyt	_drawpolys


cCs.|iidddddddddtiS(s9Create an invisible line item on canvas self.cv)
        iR:RRpitcapstyle(RNtcreate_lineR
tROUND(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt_createline$s$c	Cs|dj	o]g}x=|D]5\}}|i||i|i||iqW|ii||n|dj	o|ii|d|n|dj	o|ii|d|n|o|ii|ndS(sQConfigure lineitem according to provided arguments:
        coordlist is sequence of coordinates
        fill is drawing color
        width is width of drawn line.
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        R:RpN(RRVRORPRNRWRXRY(	RtlineitemR[R:RpR\R]RR((s#/usr/lib/python2.6/lib-tk/turtle.pyt	_drawline*s



cCs|ii|dS(s]Delete graphics item from canvas.
        If item is"all" delete all graphics items.
        N(RNtdelete(Rtitem((s#/usr/lib/python2.6/lib-tk/turtle.pyt_deleteAscCs|iidS(s(Redraw graphics items on canvas
        N(RNR%(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt_updateGscCs|ii|dS(s-Delay subsequent canvas actions for delay ms.N(RNtafter(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyt_delayLscCs?y|ii|}t}Wntij
o
t}nX|S(sCCheck if the string color is a legal Tkinter color string.
        (RNt	winfo_rgbRR
tTclErrorR(RR2trgbtok((s#/usr/lib/python2.6/lib-tk/turtle.pyt_iscolorstringPs
cCsB|dj	o!|iid||in|iidSdS(sVSet canvas' backgroundcolor if color is not None,
        else return backgroundcolor.RN(RRNR$RhR0(RR2((s#/usr/lib/python2.6/lib-tk/turtle.pyt_bgcolorZs
cCs|\}}||i}||i}hdd6dd6dd6}|ii|d|d|d	||d
|d|}	|ii|	\}
}}}
|ii|	|dfS(sWrite txt at pos in canvas with specified font
        and color.
        Return text item and x-coord of right bottom corner
        of text's bounding box.tswRHRtcentertseRWittexttanchorR:tfont(RORPRNtcreate_textR.R%(RRSttxttalignRvRORRRuRftx0ty0tx1ty1((s#/usr/lib/python2.6/lib-tk/turtle.pyt_writecs

'
ics[djoii|d|n0fd}ii|d|||dS(sBind fun to mouse-click event on turtle.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1
        s<Button-%s>csKii|iiii|ii}}||dS(N(RNtcanvasxRROtcanvasyRRP(R-RR(Rtfun(s#/usr/lib/python2.6/lib-tk/turtle.pyteventfun~s!N(RRNt
tag_unbindttag_bind(RRfRtnumtaddR((RRs#/usr/lib/python2.6/lib-tk/turtle.pyt_onclickus
cs[djoii|d|n0fd}ii|d|||dS(sgBind fun to mouse-button-release event on turtle.
        fun must be a function with two arguments, the coordinates
        of the point on the canvas where mouse button is released.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        s<Button%s-ButtonRelease>csKii|iiii|ii}}||dS(N(RNRRRORRRP(R-RR(RR(s#/usr/lib/python2.6/lib-tk/turtle.pyRs!N(RRNRR(RRfRRRR((RRs#/usr/lib/python2.6/lib-tk/turtle.pyt
_onreleases
	
cs[djoii|d|n0fd}ii|d|||dS(sqBind fun to mouse-move-event (with pressed mouse button) on turtle.
        fun must be a function with two arguments, the coordinates of the
        actual mouse position on the canvas.
        num, the number of the mouse-button defaults to 1

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.
        s<Button%s-Motion>csYyKii|iiii|ii}}||WnnXdS(N(RNRRRORRRP(R-RR(RR(s#/usr/lib/python2.6/lib-tk/turtle.pyRs!N(RRNRR(RRfRRRR((RRs#/usr/lib/python2.6/lib-tk/turtle.pyt_ondrags	
csUdjoiid|n-fd}iid|||dS(sGBind fun to mouse-click event on canvas.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        s<Button-%s>csKii|iiii|ii}}||dS(N(RNRRRORRRP(R-RR(RR(s#/usr/lib/python2.6/lib-tk/turtle.pyRs!N(RRNR2R (RRRRR((RRs#/usr/lib/python2.6/lib-tk/turtle.pyt_onscreenclicks	
csRdjo|iid|dn'fd}|iid||dS(s`Bind fun to key-release event of key.
        Canvas must have focus. See method listen
        s<KeyRelease-%s>csdS(N((R-(R(s#/usr/lib/python2.6/lib-tk/turtle.pyRsN(RRNR2R (RRRR((Rs#/usr/lib/python2.6/lib-tk/turtle.pyt_onkeys
cCs|iidS(s=Set focus on canvas (in order to collect key-events)
        N(RNR3(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt_listenscCs8|djo|ii|n|ii||dS(s?Install a timer, which calls fun after t milliseconds.
        iN(RNt
after_idleRi(RRtt((s#/usr/lib/python2.6/lib-tk/turtle.pyt_ontimers
cCs|iiddd|S(s0Create and return image item on canvas.
        itimage(RNtcreate_image(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyt_createimagescCsN|\}}|ii|||i||if|ii|d|dS(sZConfigure image item as to draw image object
        at position (x,y) on canvas)
        RN(RNRWRORPt
itemconfig(RRft.2RRR((s#/usr/lib/python2.6/lib-tk/turtle.pyt
_drawimages	(cCs*|ii|d||ii|dS(sConfigure image item as to draw image object
        at center of canvas. Set item to the first item
        in the displaylist, so it will be drawn below
        any other item .RN(RNRt	tag_lower(RRfR((s#/usr/lib/python2.6/lib-tk/turtle.pyt	_setbgpicscCs|ii|S(sQReturn 'line' or 'polygon' or 'image' depending on
        type of item.
        (RNR(RRf((s#/usr/lib/python2.6/lib-tk/turtle.pyt_typescCs\|ii|}g}tdt|dD] }|||||dfq/~}|S(s returns list of coordinate-pairs of points of item
        Example (for insiders):
        >>> from turtle import *
        >>> getscreen()._pointlist(getturtle().turtle._item)
        [(0.0, 9.9999999999999982), (0.0, -9.9999999999999982),
        (9.9999999999999982, 0.0)]
        >>> iii(RNRWtrangetlen(RRfR]t_[1]titpl((s#/usr/lib/python2.6/lib-tk/turtle.pyt
_pointlistsFcCs#|iid||||fdS(NR#(RNR$(Rtsrx1tsry1tsrx2tsry2((s#/usr/lib/python2.6/lib-tk/turtle.pyt_setscrollregionsc	Cs|ii}x|D]|}|ii|}g}xH|o@|d \}}|i|||i|||d}q7W|ii||qWdS(Ni(RNtfind_allRWRV(	RtxscalefactortyscalefactorRRftcoordinatestnewcoordlistRR((s#/usr/lib/python2.6/lib-tk/turtle.pyt_rescalescCst|itp|i|ifS||jo|jo
djno|ii|iifS|dj	o
||_n|dj	o
||_n|ii|||dS(saResize the canvas the turtles are drawing on. Does
        not alter the drawing window.
        N(RRNRRRRRX(RRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyt_resizes*



cCsd|ii}|djo|id}n|ii}|djo|id}n||fS(s; Return the width and height of the turtle window.
        iRpR(RNR(R)(RRpR((s#/usr/lib/python2.6/lib-tk/turtle.pyt_window_sizes

N(#RRRtstaticmethodRKRMRRURRR^RbRdRgRhRjRoRpR~RRRRRRRRRRRRRRRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyRGs@	
						
												t
TerminatorcBseZdZRS(sWill be raised in TurtleScreen.update, if _RUNNING becomes False.

    Thus stops execution of turtle graphics script. Main purpose: use in
    in the Demo-Viewer turtle.Demo.py.
    (RRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyR+stTurtleGraphicsErrorcBseZdZRS(sSome TurtleGraphics Error
    (RRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyR4scBs&eZdZddZddZRS(sData structure modeling shapes.

    attribute _type is one of "polygon", "image", "compound"
    attribute _data is - depending on _type a poygon-tuple,
    an image or a list constructed using the addcomponent method.
    cCs||_|djo$t|tot|}qn|djoNt|to:|iido t|oti	|}qqn(|djo
g}nt
d|||_dS(NtpolygonRs.giftcompoundsThere is no shape type %s(RRRRtstrtlowertendswithRRRMRt_data(Rttype_tdata((s#/usr/lib/python2.6/lib-tk/turtle.pyR@s	

#

cCs[|idjotd|in|djo
|}n|ii|||gdS(s+Add component to a shape of type compound.

        Arguments: poly is a polygon, i. e. a tuple of number pairs.
        fill is the fillcolor of the component,
        outline is the outline color of the component.

        call (for a Shapeobject namend s):
        --   s.addcomponent(((0,0), (10,10), (-10,10)), "red", "blue")

        Example:
        >>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
        >>> s = Shape("compound")
        >>> s.addcomponent(poly, "red", "blue")
        ### .. add more components and then use register_shape()
        Rs Cannot add component to %s ShapeN(RRRRRV(RtpolyR:RS((s#/usr/lib/python2.6/lib-tk/turtle.pytaddcomponentPs

N(RRRRRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyR9stTbuffercBsJeZdZddZddZdZdZdZdZ	RS(	s5Ring buffer used as undobuffer for RawTurtle objects.i
cCs2||_dgg||_d|_t|_dS(Ni(tbufsizeRtbuffertptrRtcumulate(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRjs		cCsd|djo.xGt|iD]}dg|i|<qWn||_dgg||_d|_dS(Ni(RRRRR(RRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRXos
	cCsd|idjoP|ip+|id|i|_||i|i<q`|i|ii|ndS(Nii(RRRRRV(RRf((s#/usr/lib/python2.6/lib-tk/turtle.pytpushws

cCsh|idjoT|i|i}|djodSdg|i|i<|id|i|_|SndS(Nii(RRRR(RRf((s#/usr/lib/python2.6/lib-tk/turtle.pytpop~s
cCs|i|iidgS(N(RRtcountR(R((s#/usr/lib/python2.6/lib-tk/turtle.pytnr_of_itemsscCst|idt|iS(Nt (RRR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRsN(
RRRRRRXRRRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyRhs				cBsOeZdZeZedededdZdZddZ	dZ
ddZd	Zd
Z
ddZdZd
ZdZdddZddZdZdZdZdZdZdZdddZdZdddZddZddZddddZeZ eZ!eZ"eZ#RS( sProvides screen oriented methods like setbg etc.

    Only relies upon the methods of TurtleScreenBase and NOT
    upon components of the underlying graphics toolkit -
    which is Tkinter in this case.
    RRRcCshtdd/d0d1fd6tdd2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIfd6tddJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]fd$6tdd^d_d`dafd%6tddbdcddfd(6tddedfdgdhfd)6td*|id+6|_hd,d-6|_ti||||_||_td.|_	g|_
|idS(iNRiii
tarrowiiiiiiii	iiiiiiiiiiiRgQ#@gQ@gGz. @gQ@gQgQgGz. gQ#gg$R-tsquaregGzg'@ttriangleRRRIRtnopicR(ii(i
i(ii
(ii(ii(ii
(ii(ii	(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(i	i(ii	(ii(ii
(ii(i
i(gQ#@gQ@(gGz. @gQ@(gQ@gGz. @(gQ@gQ#@(ii
(gQgQ#@(gQgGz. @(gGz. gQ@(gQ#gQ@(ii(gQ#gQ(gGz. gQ(gQgGz. (gQgQ#(gg$(gQ@gQ#(gQ@gGz. (gGz. @gQ(gQ#@gQ(i
i(i
i
(ii
(ii(i
gGz(ig'@(igGz(ii(ii(ii(ii(RRKt_shapest_bgpicsRGRt_modet_delayvalueRt
_colormodet_keysR.(RRNRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRs4
		

		
	cCstd|_td|_|id|id|_d|_d|_d|_g|_	|i
dxdD]}|id|qqWx"|i
D]}|id|qWdt_dS(
smDelete all drawings and all turtles from the TurtleScreen.

        Reset empty TurtleScreen to its initial state: white background,
        no backgroundimage, no eventbindings and tracing on.

        No argument.

        Example (for a TurtleScreen instance named screen):
        screen.clear()

        Note: this method is not available as function.
        RRtallRRiiRiiN(iii(RRRRgRt_bgpict
_bgpicnamet_tracingt_updatecountert_turtlesRRJRRRR	t_pen(RtbtnR((s#/usr/lib/python2.6/lib-tk/turtle.pyR.s 



				
cCs|djo|iS|i}|djotd|n||_|d	joH|i|id|id|id|idd|_|_n|i	dS(
sgSet turtle-mode ('standard', 'logo' or 'world') and perform reset.

        Optional argument:
        mode -- on of the strings 'standard', 'logo' or 'world'

        Mode 'standard' is compatible with turtle.py.
        Mode 'logo' is compatible with most Logo-Turtle-Graphics.
        Mode 'world' uses userdefined 'worldcoordinates'. *Attention*: in
        this mode angles appear distorted if x/y unit-ratio doesn't equal 1.
        If mode is not given, return the current mode.

             Mode      Initial turtle heading     positive angles
         ------------|-------------------------|-------------------
          'standard'    to the right (east)       counterclockwise
            'logo'        upward    (north)         clockwise

        Examples:
        >>> mode('logo')   # resets turtle heading to north
        >>> mode()
        'logo'
        RtlogotworldsNo turtle-graphics-mode %sig?N(RRR(RR(
RRRRRRRRORPRX(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRs

	
cCs|idjo|idnt||}t||}|i\}}|i|d|d|i|i}	}
|i||_|i||_||i}||i}|i|}
|i|}|i|||
||i	|i|	|i|
|i
dS(ssSet up a user defined coordinate-system.

        Arguments:
        llx -- a number, x-coordinate of lower left corner of canvas
        lly -- a number, y-coordinate of lower left corner of canvas
        urx -- a number, x-coordinate of upper right corner of canvas
        ury -- a number, y-coordinate of upper right corner of canvas

        Set up user coodinat-system and switch to mode 'world' if necessary.
        This performs a screen.reset. If mode 'world' is already active,
        all drawings are redrawn according to the new coordinates.

        But ATTENTION: in user-defined coordinatesystems angles may appear
        distorted. (see Screen.mode())

        Example (for a TurtleScreen instance named screen):
        >>> screen.setworldcoordinates(-10,-0.5,50,1.5)
        >>> for _ in range(36):
                left(10)
                forward(0.5)
        RiN(RRRRRORPRRRRR%(Rtllxtllyturxturytxspantyspantwxtwyt	oldxscalet	oldyscaleRRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyR!s 


cCs|djoF|iidotd|i|}qvtddn$t|totd|}n||i|<dS(sAdds a turtle shape to TurtleScreen's shapelist.

        Arguments:
        (1) name is the name of a gif-file and shape is None.
            Installs the corresponding image shape.
            !! Image-shapes DO NOT rotate when turning the turtle,
            !! so they do not display the heading of the turtle!
        (2) name is an arbitrary string and shape is a tuple
            of pairs of coordinates. Installs the corresponding
            polygon shape
        (3) name is an arbitrary string and shape is a
            (compound) Shape object. Installs the corresponding
            compound shape.
        To use a shape, you have to issue the command shape(shapename).

        call: register_shape("turtle.gif")
        --or: register_shape("tri", ((0,0), (10,10), (-10,10)))

        Example (for a TurtleScreen instance named screen):
        >>> screen.register_shape("triangle", ((5,-3),(0,5),(-5,-3)))

        s.gifRs"Bad arguments for register_shape.
sUse  help(register_shape)RN(	RRRRRMRRRR(RtnameRc((s#/usr/lib/python2.6/lib-tk/turtle.pyRs
c	Csvt|djo|d}nt|to<|i|p
|djo|Stdt|ny|\}}}Wntdt|nX|idjoAg}|||fD]}|td|q~\}}}nd|jo
djno9d|jo
djnod|jo
djnptd	t|nd
|||fS(sReturn color string corresponding to args.

        Argument may be a string or a tuple of three
        numbers corresponding to actual colormode,
        i.e. in the range 0<=n<=colormode.

        If the argument doesn't represent a color,
        an error is raised.
        iiRsbad color string: %ssbad color arguments: %sg?go@isbad color sequence: %ss
#%02x%02x%02x(RRRRoRRtround(RR2RtgtbRR((s#/usr/lib/python2.6/lib-tk/turtle.pyt	_colorstrAs
AZc		Cs|idp|St|djo9g}dD]!}|t|||d!dq3~}n^t|djo:g}|dD]}|dt||dq~}ntd	|tg}|D]}|||id
q~S(NRiiiiiiisbad colorstring: %si(iii(RRRRRR(	RtcstrRRR]t_[2]RRt_[3]R((s#/usr/lib/python2.6/lib-tk/turtle.pyt_color\s9:cCsY|djo|iS|djot||_n!|djot||_ndS(sxReturn the colormode or set it to 1.0 or 255.

        Optional argument:
        cmode -- one of the values 1.0 or 255

        r, g, b values of colortriples have to be in range 0..cmode.

        Example (for a TurtleScreen instance named screen):
        >>> screen.colormode()
        1.0
        >>> screen.colormode(255)
        >>> turtle.pencolor(240,160,80)
        g?iN(RRRR(Rtcmode((s#/usr/lib/python2.6/lib-tk/turtle.pyRgs


cCs2x+|iD] }|i|i|iq
WdS(sReset all Turtles on the Screen to their initial state.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.reset()
        N(Rt_setmodeRRX(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRX|s
cCs|iS(sReturn the list of turtles on the screen.

        Example (for a TurtleScreen instance named screen):
        >>> screen.turtles()
        [<turtle.Turtle object at 0x00E11FB0>]
        (R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR$scGsS|o|i|}nd}|i|}|dj	o|i|}n|S(sSet or return backgroundcolor of the TurtleScreen.

        Arguments (if given): a color string or three numbers
        in the range 0..colormode or a 3-tuple of such numbers.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgcolor("orange")
        >>> screen.bgcolor()
        'orange'
        >>> screen.bgcolor(0.5,0,0.5)
        >>> screen.bgcolor()
        '#800080'
        N(RRRpR(RR/R2((s#/usr/lib/python2.6/lib-tk/turtle.pyRs
cCsi|djo|iSt||_d|_|dj	ot||_n|io|indS(seTurns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a TurtleScreen instance named screen):
        >>> screen.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
                fd(dist)
                rt(90)
                dist += 2
        iN(RRRRRR%(RtnR((s#/usr/lib/python2.6/lib-tk/turtle.pyR#s
	

cCs(|djo|iSt||_dS(s Return or set the drawing delay in milliseconds.

        Optional argument:
        delay -- positive integer

        Example (for a TurtleScreen instance named screen):
        >>> screen.delay(15)
        >>> screen.delay()
        15
        N(RRR(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRs
cCsVtiptt_tn|idjo%|id7_|i|i;_ndS(sIncrement upadate counter.iiN(Rt_RUNNINGRt	_RUNNNINGRRR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt
_incrementudcs
	
cCsT|i}t|_x(|iD]}|i|iqW||_|idS(s'Perform a TurtleScreen update.
        N(RRR$t_update_datat_drawturtleRh(RttracingR((s#/usr/lib/python2.6/lib-tk/turtle.pyR%s		

	cCs|idS(s Return the width of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_width()
        640
        i(R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR'scCs|idS(s Return the height of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_height()
        480
        i(R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR&scCs|iS(sReturn the Canvas of this TurtleScreen.

        No argument.

        Example (for a Screen instance named screen):
        >>> cv = screen.getcanvas()
        >>> cv
        <turtle.ScrolledCanvas instance at 0x010742D8>
        (RN(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRs
cCst|iiS(sReturn a list of names of all currently available turtle shapes.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.getshapes()
        ['arrow', 'blank', 'circle', ... , 'turtle']
        (tsortedRR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRs	icCs|i|||dS(sEBind fun to mouse-click event on canvas.

        Arguments:
        fun -- a function with two arguments, the coordinates of the
               clicked point on the canvas.
        num -- the number of the mouse-button, defaults to 1

        Example (for a TurtleScreen instance named screen
        and a Turtle instance named turtle):

        >>> screen.onclick(turtle.goto)

        ### Subsequently clicking into the TurtleScreen will
        ### make the turtle move to the clicked point.
        >>> screen.onclick(None)

        ### event-binding will be removed
        N(R(RRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRJscCsm|djo(||ijo|ii|qYn%||ijo|ii|n|i||dS(sBind fun to key-release event of key.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen
        and a Turtle instance named turtle):

        >>> def f():
                fd(50)
                lt(60)


        >>> screen.onkey(f, "Up")
        >>> screen.listen()

        ### Subsequently the turtle can be moved by
        ### repeatedly pressing the up-arrow key,
        ### consequently drawing a hexagon
        N(RRtremoveRVR(RRR((s#/usr/lib/python2.6/lib-tk/turtle.pyR%s
cCs|idS(sSet focus on TurtleScreen (in order to collect key-events)

        No arguments.
        Dummy arguments are provided in order
        to be able to pass listen to the onclick method.

        Example (for a TurtleScreen instance named screen):
        >>> screen.listen()
        N(R(Rtxdummytydummy((s#/usr/lib/python2.6/lib-tk/turtle.pyREs
icCs|i||dS(sInstall a timer, which calls fun after t milliseconds.

        Arguments:
        fun -- a function with no arguments.
        t -- a number >= 0

        Example (for a TurtleScreen instance named screen):

        >>> running = True
        >>> def f():
                if running:
                        fd(50)
                        lt(60)
                        screen.ontimer(f, 250)

        >>> f()   ### makes the turtle marching around
        >>> running = False
        N(R(RRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRQscCsf|djo|iS||ijo|i||i|<n|i|i|i|||_dS(sESet background image or return name of current backgroundimage.

        Optional argument:
        picname -- a string, name of a gif-file or "nopic".

        If picname is a filename, set the corresponing image as background.
        If picname is "nopic", delete backgroundimage, if present.
        If picname is None, return the filename of the current backgroundimage.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgpic()
        'nopic'
        >>> screen.bgpic("landscape.gif")
        >>> screen.bgpic()
        'landscape.gif'
        N(RRRRMRR(Rtpicname((s#/usr/lib/python2.6/lib-tk/turtle.pyRfs
cCs|i|||S(sResize the canvas the turtles are drawing on.

        Optional arguments:
        canvwidth -- positive integer, new width of canvas in pixels
        canvheight --  positive integer, new height of canvas in pixels
        bg -- colorstring or color-tupel, new backgroundcolor
        If no arguments are given, return current (canvaswidth, canvasheight)

        Do not alter the drawing window. To observe hidden parts of
        the canvas use the scrollbars. (Can make visible those parts
        of a drawing, which were outside the canvas before!)

        Example (for a Turtle instance named turtle):
        >>> turtle.screensize(2000,1500)
            ### e. g. to search for an erroneously escaped turtle ;-)
        (R(RRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyR~sN($RRRRRRRR.RRR!RRRRRXR$RR#RRR%R'R&RRRJRRRRRRRRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyRs@	"	'$																 t
TNavigatorcBseZdZheddd6eddd6eddd6ZdZdZdZedZd	Z	d%d
ZdZdd
Z
dZdZdZdZdZdZdZdZdZdZdZd%dZdZdZdZd%dZd%dZdZd Z d%d%d!Z!dd"Z"d%d%d#Z#d%d$Z$eZ%eZ&eZ'eZ(eZ)eZ*eZ+eZ,e Z-RS(&sRNavigation part of the RawTurtle.
    Implements methods for turtle movement.
    g?gRRRiicCs[|i|_|i|_||_d|_|id|_|i|t	i
|dS(N(tDEFAULT_ANGLEOFFSETt_angleOffsettDEFAULT_ANGLEORIENTt_angleOrientRRt
undobufferR3RRRX(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRs		
	
cCs)tdd|_ti|i|_dS(sXreset turtle to its initial values

        Will be overwritten by parent class
        gN(R
t	_positionRtSTART_ORIENTATIONRt_orient(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRXscCsp|djo|iS|d	jodS||_|d
jod|_d|_n|id|_d|_dS(s:Set turtle-mode to 'standard', 'world' or 'logo'.
        RRRNiig@i(sstandardslogosworld(sstandardsworld(RRRRt_fullcircle(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRs

	
	
cCsD||_d||_|idjo
d|_n|d|_dS(s+Helper function for degrees() and radians()ihRig@N(Rt
_degreesPerAURR(Rt
fullcircle((s#/usr/lib/python2.6/lib-tk/turtle.pyt_setDegreesPerAUs
	

gv@cCs|i|dS(s Set angle measurement units to degrees.

        Optional argument:
        fullcircle -  a number

        Set angle measurement units, i. e. set number
        of 'degrees' for a full circle. Dafault value is
        360 degrees.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(90)
        >>> turtle.heading()
        90
        >>> turtle.degrees(400.0)  # angle measurement in gon
        >>> turtle.heading()
        100

        N(R(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyR3scCs|idtidS(s Set the angle measurement units to radians.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        90
        >>> turtle.radians()
        >>> turtle.heading()
        1.5707963267948966
        iN(RRR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRVscCs%|i|i|}|i|dS(s)move turtle forward by specified distanceN(RRt_goto(RR4tende((s#/usr/lib/python2.6/lib-tk/turtle.pyt_goscCs&||i9}|ii||_dS(s=Turn turtle counterclockwise by specified angle if angle > 0.N(RRR(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyt_rotates
cCs
||_dS(smove turtle to position end.N(R(Rtend((s#/usr/lib/python2.6/lib-tk/turtle.pyRscCs|i|dS(sMove the turtle forward by the specified distance.

        Aliases: forward | fd

        Argument:
        distance -- a number (integer or float)

        Move the turtle forward by the specified distance, in the direction
        the turtle is headed.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.forward(25)
        >>> turtle.position()
        (25.00,0.00)
        >>> turtle.forward(-75)
        >>> turtle.position()
        (-50.00,0.00)
        N(R(RR4((s#/usr/lib/python2.6/lib-tk/turtle.pyR<scCs|i|dS(sMove the turtle backward by distance.

        Aliases: back | backward | bk

        Argument:
        distance -- a number

        Move the turtle backward by distance ,opposite to the direction the
        turtle is headed. Do not change the turtle's heading.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.backward(30)
        >>> turtle.position()
        (-30.00, 0.00)
        N(R(RR4((s#/usr/lib/python2.6/lib-tk/turtle.pyR(scCs|i|dS(sTurn turtle right by angle units.

        Aliases: right | rt

        Argument:
        angle -- a number (integer or float)

        Turn turtle right by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.right(45)
        >>> turtle.heading()
        337.0
        N(R(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRW(scCs|i|dS(sTurn turtle left by angle units.

        Aliases: left | lt

        Argument:
        angle -- a number (integer or float)

        Turn turtle left by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.left(45)
        >>> turtle.heading()
        67.0
        N(R(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRH=scCs|iS(sReturn the turtle's current location (x,y), as a Vec2D-vector.

        Aliases: pos | position

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 240.00)
        (R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRSRscCs|idS(s Return the turtle's x coordinate.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.xcor()
        50.0
        i(R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRr_scCs|idS(s	 Return the turtle's y coordinate
        ---
        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.ycor()
        86.6025403784
        i(R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRsmscCs>|djo|it|n|it||dS(stMove turtle to an absolute position.

        Aliases: setpos | setposition | goto:

        Arguments:
        x -- a number      or     a pair/vector of numbers
        y -- a number             None

        call: goto(x, y)         # two coordinates
        --or: goto((x, y))       # a pair (tuple) of coordinates
        --or: goto(vec)          # e.g. as returned by pos()

        Move turtle to an absolute position. If the pen is down,
        a line will be drawn. The turtle's orientation does not change.

        Example (for a Turtle instance named turtle):
        >>> tp = turtle.pos()
        >>> tp
        (0.00, 0.00)
        >>> turtle.setpos(60,30)
        >>> turtle.pos()
        (60.00,30.00)
        >>> turtle.setpos((20,80))
        >>> turtle.pos()
        (20.00,80.00)
        >>> turtle.setpos(tp)
        >>> turtle.pos()
        (0.00,0.00)
        N(RRR
(RRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRA|s
cCs!|idd|iddS(s$Move turtle to the origin - coordinates (0,0).

        No arguments.

        Move turtle to the origin - coordinates (0,0) and set its
        heading to its start-orientation (which depends on mode).

        Example (for a Turtle instance named turtle):
        >>> turtle.home()
        iN(RAR\(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRDscCs!|it||iddS(sSet the turtle's first coordinate to x

        Argument:
        x -- a number (integer or float)

        Set the turtle's first coordinate to x, leave second coordinate
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 240.00)
        >>> turtle.setx(10)
        >>> turtle.position()
        (10.00, 240.00)
        iN(RR
R(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRascCs!|it|id|dS(sSet the turtle's second coordinate to y

        Argument:
        y -- a number (integer or float)

        Set the turtle's first coordinate to x, second coordinate remains
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 40.00)
        >>> turtle.sety(-10)
        >>> turtle.position()
        (0.00, -10.00)
        iN(RR
R(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRbscCs|dj	ot||}nt|to
|}n>t|tot|}nt|to
|i}nt||iS(sReturn the distance from the turtle to (x,y) in turtle step units.

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 0.00)
        >>> turtle.distance(30,40)
        50.0
        >>> pen = Turtle()
        >>> pen.forward(77)
        >>> turtle.distance(pen)
        77.0
        N(RR
RRRRtabs(RRRRS((s#/usr/lib/python2.6/lib-tk/turtle.pyR4s


cCs|dj	ot||}nt|to
|}n>t|tot|}nt|to
|i}n||i\}}tti||dti	dd}||i
:}|i|i||i
S(sCReturn the angle of the line from the turtle's position to (x, y).

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Return the angle, between the line from turtle-position to position
        specified by x, y and the turtle's start orientation. (Depends on
        modes - "standard" or "logo")

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (10.00, 10.00)
        >>> turtle.towards(0,0)
        225.0
        gf@i
gv@N(RR
RRRRRRRzRRRRR(RRRRStresult((s#/usr/lib/python2.6/lib-tk/turtle.pyRks


*
cCs_|i\}}tti||dtidd}||i:}|i|i||iS(s Return the turtle's current heading.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(67)
        >>> turtle.heading()
        67.0
        gf@i
gv@(	RRRRzRRRRR(RRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRBs
*
cCsK||i|i}|i}||d||d}|i|dS(sSet the orientation of the turtle to to_angle.

        Aliases:  setheading | seth

        Argument:
        to_angle -- a number (integer or float)

        Set the orientation of the turtle to to_angle.
        Here are some common directions in degrees:

         standard - mode:          logo-mode:
        -------------------|--------------------
           0 - east                0 - north
          90 - north              90 - east
         180 - west              180 - south
         270 - south             270 - west

        Example (for a Turtle instance named turtle):
        >>> turtle.setheading(90)
        >>> turtle.heading()
        90
        g@N(RBRRR(Rtto_angleRtfull((s#/usr/lib/python2.6/lib-tk/turtle.pyR\#s	cCs|io#|iidgt|i_n|i}|djo
|i}n|djoBt||i}dtt	dt|dd|}nd||}d|}d|t
i|t
id	|i
}|d
jo|||}}}n|i}	|i}
|d
jo|id
d
n|id
|i|xHt|D]:}|i||i||id
|i|qkW|i||d
jo|i|	|
n|i||iot|i_ndS(s Draw a circle with given radius.

        Arguments:
        radius -- a number
        extent (optional) -- a number
        steps (optional) -- an integer

        Draw a circle with given radius. The center is radius units left
        of the turtle; extent - an angle - determines which part of the
        circle is drawn. If extent is not given, draw the entire circle.
        If extent is not a full circle, one endpoint of the arc is the
        current pen position. Draw the arc in counterclockwise direction
        if radius is positive, otherwise in clockwise direction. Finally
        the direction of the turtle is changed by the amount of extent.

        As the circle is approximated by an inscribed regular polygon,
        steps determines the number of steps to use. If not given,
        it will be calculated automatically. Maybe used to draw regular
        polygons.

        call: circle(radius)                  # full circle
        --or: circle(radius, extent)          # arc
        --or: circle(radius, extent, steps)
        --or: circle(radius, steps=6)         # 6-sided polygon

        Example (for a Turtle instance named turtle):
        >>> turtle.circle(50)
        >>> turtle.circle(120, 180)  # semicircle
        tseqiig@gM@g?g?g@gf@iN(RRRRRfRRR
RtminRRRRR#RjRRRR(RtradiustextenttstepsRftfracRQtw2tlttrtdlR((s#/usr/lib/python2.6/lib-tk/turtle.pyR-?s@



/
)










cCsdS(s/dummy method - to be overwritten by child classN((RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRfscCsdS(s/dummy method - to be overwritten by child classN((RtaR((s#/usr/lib/python2.6/lib-tk/turtle.pyR#scCsdS(s/dummy method - to be overwritten by child classN((RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRjsN(.RRRR
RtDEFAULT_MODERRRRXRRRR3RVRRRR<R(RWRHRSRrRsRARDRaRbR4RkRBR\R-RfR#RjR9R,R)RZRIRTR]R^R[(((s#/usr/lib/python2.6/lib-tk/turtle.pyRsZ
												
		#			 #		AtTPencBs
eZdZeddZededdZddZddZdZ	d	Z
d
ZddZdZ
d
ZdZdZdZdZddZedZeedZdZdZeZe	Ze	Ze
Ze
ZeZeZ RS(sFDrawing part of the RawTurtle.
    Implements drawing properties.
    RYcCs#||_d|_ti|dS(N(t_resizemodeRRRt_reset(RRY((s#/usr/lib/python2.6/lib-tk/turtle.pyRs		ROR;cCsUd|_t|_||_||_t|_d|_d|_d|_d|_	dS(Niii(ii(
t_pensizeRt_shownt	_pencolort
_fillcolort_drawingt_speedt_stretchfactort_tiltt
_outlinewidth(RROR;((s#/usr/lib/python2.6/lib-tk/turtle.pyRs								cCsF|djo|iS|i}|djo|id|ndS(szSet resizemode to one of the values: "auto", "user", "noresize".

        (Optional) Argument:
        rmode -- one of the strings "auto", "user", "noresize"

        Different resizemodes have the following effects:
          - "auto" adapts the appearance of the turtle
                   corresponding to the value of pensize.
          - "user" adapts the appearance of the turtle according to the
                   values of stretchfactor and outlinewidth (outline),
                   which are set by shapesize()
          - "noresize" no adaption of the turtle's appearance takes place.
        If no argument is given, return current resizemode.
        resizemode("user") is called by a call of shapesize with arguments.


        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("noresize")
        >>> turtle.resizemode()
        'noresize'
        tautotuserRRYN(R&R'R(RRRRN(Rtrmode((s#/usr/lib/python2.6/lib-tk/turtle.pyRYs


cCs)|djo|iS|id|dS(sSet or return the line thickness.

        Aliases:  pensize | width

        Argument:
        width -- positive number

        Set the line thickness to width or return it. If resizemode is set
        to "auto" and turtleshape is a polygon, that polygon is drawn with
        the same line thickness. If no argument is given, current pensize
        is returned.

        Example (for a Turtle instance named turtle):
        >>> turtle.pensize()
        1
        turtle.pensize(10)   # from here on lines of width 10 are drawn
        RQN(RRRN(RRp((s#/usr/lib/python2.6/lib-tk/turtle.pyRQs
cCs#|ipdS|idtdS(sPull the pen up -- no drawing when moving.

        Aliases: penup | pu | up

        No argument

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        NRP(R!RNR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRRs

cCs#|iodS|idtdS(sPull the pen down -- drawing when moving.

        Aliases: pendown | pd | down

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.pendown()
        NRP(R!RNR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRPs

cCs|iS(sReturn True if pen is down, False if it's up.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        >>> turtle.isdown()
        False
        >>> turtle.pendown()
        >>> turtle.isdown()
        True
        (R!(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRFs
cCshdd6dd6dd6dd6d	d
6}|djo|iS||jo||}n;d|jo
djnott|}nd}|id
|dS(s Return or set the turtle's speed.

        Optional argument:
        speed -- an integer in the range 0..10 or a speedstring (see below)

        Set the turtle's speed to an integer value in the range 0 .. 10.
        If no argument is given: return current speed.

        If input is a number greater than 10 or smaller than 0.5,
        speed is set to 0.
        Speedstrings  are mapped to speedvalues in the following way:
            'fastest' :  0
            'fast'    :  10
            'normal'  :  6
            'slow'    :  3
            'slowest' :  1
        speeds from 1 to 10 enforce increasingly faster animation of
        line drawing and turtle turning.

        Attention:
        speed = 0 : *no* animation takes place. forward/back makes turtle jump
        and likewise left/right make the turtle turn instantly.

        Example (for a Turtle instance named turtle):
        >>> turtle.speed(3)
        itfastesti
tfastitnormalitslowitslowestg?g%@RfN(RR"RRRN(RRftspeeds((s#/usr/lib/python2.6/lib-tk/turtle.pyRfs)

cGs|ot|}|djo|d}}n9|djo|\}}n|djo|}}n|i|}|i|}|id|d|n#|i|i|i|ifSdS(sReturn or set the pencolor and fillcolor.

        Arguments:
        Several input formats are allowed.
        They use 0, 1, 2, or 3 arguments as follows:

        color()
            Return the current pencolor and the current fillcolor
            as a pair of color specification strings as are returned
            by pencolor and fillcolor.
        color(colorstring), color((r,g,b)), color(r,g,b)
            inputs as in pencolor, set both, fillcolor and pencolor,
            to the given value.
        color(colorstring1, colorstring2),
        color((r1,g1,b1), (r2,g2,b2))
            equivalent to pencolor(colorstring1) and fillcolor(colorstring2)
            and analogously, if the other input format is used.

        If turtleshape is a polygon, outline and interior of that polygon
        is drawn with the newly set colors.
        For mor info see: pencolor, fillcolor

        Example (for a Turtle instance named turtle):
        >>> turtle.color('red', 'green')
        >>> turtle.color()
        ('red', 'green')
        >>> colormode(255)
        >>> color((40, 80, 120), (160, 200, 240))
        >>> color()
        ('#285078', '#a0c8f0')
        iiiiROR;N(RRRNRRR (RR/Rtpcolortfcolor((s#/usr/lib/python2.6/lib-tk/turtle.pyR2,s 


cGsS|o8|i|}||ijodS|id|n|i|iSdS(sZ Return or set the pencolor.

        Arguments:
        Four input formats are allowed:
          - pencolor()
            Return the current pencolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - pencolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - pencolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - pencolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the outline of that polygon is drawn
        with the newly set pencolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.pencolor('brown')
        >>> tup = (0.2, 0.8, 0.55)
        >>> turtle.pencolor(tup)
        >>> turtle.pencolor()
        '#33cc8c'
        NRO(RRRNR(RR/R2((s#/usr/lib/python2.6/lib-tk/turtle.pyROZscGsS|o8|i|}||ijodS|id|n|i|iSdS(s] Return or set the fillcolor.

        Arguments:
        Four input formats are allowed:
          - fillcolor()
            Return the current fillcolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - fillcolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - fillcolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - fillcolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the interior of that polygon is drawn
        with the newly set fillcolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.fillcolor('violet')
        >>> col = turtle.pencolor()
        >>> turtle.fillcolor(col)
        >>> turtle.fillcolor(0, .5, 0)
        NR;(RR RNR(RR/R2((s#/usr/lib/python2.6/lib-tk/turtle.pyR;scCs|idtdS(sMakes the turtle visible.

        Aliases: showturtle | st

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> turtle.showturtle()
        tshownN(RNR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRescCs|idtdS(sYMakes the turtle invisible.

        Aliases: hideturtle | ht

        No argument.

        It's a good idea to do this while you're in the
        middle of a complicated drawing, because hiding
        the turtle speeds up the drawing observably.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        R1N(RNR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRCscCs|iS(sReturn True if the Turtle is shown, False if it's hidden.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> print turtle.isvisible():
        False
        (R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRGs
c	Kseh
|id6|id6|id6|id6|id6|id6|id6|id6|id	6|i	d
6}|p|p|St
|to
|}nh}|i|h}x|D]}||||<qW|i
o|i
id|fnt}d|jo"|i|djo
t}q(nd|joTt
|dto|i|df|d<n|i|djo
t}qnd|jo"|i|djo
t}qn|o|ind|jo|d|_nd|jo|d|_nd|jo|d|_nd|joCt
|dto|i|df|d<n|d|_nd|jo|d|_nd|jo|d|_nd|jo=|d}t
|ttfo||f}n||_nd	|jo|d	|_nd|jo|d|_nd
|jo|d
|_	n|idS(
sReturn or set the pen's attributes.

        Arguments:
            pen -- a dictionary with some or all of the below listed keys.
            **pendict -- one or more keyword-arguments with the below
                         listed keys as keywords.

        Return or set the pen's attributes in a 'pen-dictionary'
        with the following key/value pairs:
           "shown"      :   True/False
           "pendown"    :   True/False
           "pencolor"   :   color-string or color-tuple
           "fillcolor"  :   color-string or color-tuple
           "pensize"    :   positive number
           "speed"      :   number in range 0..10
           "resizemode" :   "auto" or "user" or "noresize"
           "stretchfactor": (positive number, positive number)
           "outline"    :   positive number
           "tilt"       :   number

        This dictionary can be used as argument for a subsequent
        pen()-call to restore the former pen-state. Moreover one
        or more of these attributes can be provided as keyword-arguments.
        This can be used to set several pen attributes in one statement.


        Examples (for a Turtle instance named turtle):
        >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10)
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'black',
        'stretchfactor': (1,1), 'speed': 3}
        >>> penstate=turtle.pen()
        >>> turtle.color("yellow","")
        >>> turtle.penup()
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'yellow', 'pendown': False, 'fillcolor': '',
        'stretchfactor': (1,1), 'speed': 3}
        >>> p.pen(penstate, fillcolor="green")
        >>> p.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'green',
        'stretchfactor': (1,1), 'speed': 3}
        R1RPROR;RQRfRYt
stretchfactorRSRiRNN(RR!RR RR"RR#R%R$RtdictR%RRRRRRt_newLineRRRh(	RRNtpendictt_pdtpt_p_bufRtnewLinetsf((s#/usr/lib/python2.6/lib-tk/turtle.pyRNs|.



























cCsdS(s/dummy method - to be overwritten by child classN((RtusePos((s#/usr/lib/python2.6/lib-tk/turtle.pyR4A	scCsdS(s/dummy method - to be overwritten by child classN((RRtforced((s#/usr/lib/python2.6/lib-tk/turtle.pyRhC	scCsdS(s/dummy method - to be overwritten by child classN((RR/((s#/usr/lib/python2.6/lib-tk/turtle.pyRE	scCsdS(s/dummy method - to be overwritten by child classN((RR/((s#/usr/lib/python2.6/lib-tk/turtle.pyRG	sN(!RRRRRRRRYRQRRRPRFRfR2ROR;ReRCRGRNRR4RRhRRRpRoRURMR6RgRE(((s#/usr/lib/python2.6/lib-tk/turtle.pyRs8			&	.	%	$	
		u		t_TurtleImagecBs eZdZdZdZRS(s6Helper class: Datatype to store Turtle attributes
    cCs#||_d|_|i|dS(N(RRRt	_setshape(RRt
shapeIndex((s#/usr/lib/python2.6/lib-tk/turtle.pyRW	s		cCs}|i}||_|idjo|i|ijnodS|idjo|i|ijnodS|idjo|i|in6|idjo%x"|iD]}|i|qWn|i|i|_|idjo|i|_ny|idjo |i|idi|_nI|idjo8g}|i|iD]}||iqV~|_ndS(NRRRRI(simagespolygon(	RR?RRRgt_itemRURR(RR?RRfR((s#/usr/lib/python2.6/lib-tk/turtle.pyR>\	s(		++
 (RRRRR>(((s#/usr/lib/python2.6/lib-tk/turtle.pyR=S	s	cBseZdZgZd8edededdZdZdZdZ	dZ
d	Zd
ZdZ
d8d8dZd
ZdZdZdZd8dZd8d8d8dZdZdZdZdZdZdZdZdZd8dZdZdZdZ e!dZ"d8d Z#d!Z$d"Z%d8d#Z&d$Z'e(d%d9d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.e.Z/d/Z0d0Z1d8d1Z2d2d8d3Z3d2d8d4Z4d2d8d5Z5d6Z6d7Z7eZ8RS(:svAnimation part of the RawTurtle.
    Puts RawTurtle upon a TurtleScreen and provides tools for
    its animation.
    RcRRcCst|to
||_nt|to1|tijotii|n||_nt|ttfoXxetiD]$}|i	|jo||_Pq~q~Wt||_tii|int
d||i}ti||i
ti||ii||i|_t|||_d|_t|_d|_|_||_t|_|i|_|ig|_|ig|_g|_ ||_!t"||_#|i$dS(Nsbad cavas argument %s(%Rt_ScreenRRRtscreensRVRRRNRRRRRRRbtdrawingLineItemR=RRt_polyRt
_creatingPolyt	_fillitemt	_fillpathRt_hidden_from_screentcurrentLineItemRtcurrentLineRt
stampItemst_undobuffersizeRRRh(RtcanvasRcRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRy	sB


			
						cCs<ti|ti||i|i|idS(sDelete the turtle's drawings and restore its default values.

        No argument.
,
        Delete the turtle's drawings from the screen, re-center the turtle
        and set variables to the default values.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00,-22.00)
        >>> turtle.heading()
        100.0
        >>> turtle.reset()
        >>> turtle.position()
        (0.00,0.00)
        >>> turtle.heading()
        0.0
        N(RRXRRt_clearRRh(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRX	s




cCs-|djo
d|_nt||_dS(sSet or disable undobuffer.

        Argument:
        size -- an integer or None

        If size is an integer an empty undobuffer of given size is installed.
        Size gives the maximum number of turtle-actions that can be undone
        by the undo() function.
        If size is None, no undobuffer is present.

        Example (for a Turtle instance named turtle):
        >>> turtle.setundobuffer(42)
        N(RRR(Rtsize((s#/usr/lib/python2.6/lib-tk/turtle.pyR`	s

cCs"|idjodS|iiS(sReturn count of entries in the undobuffer.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> while undobufferentries():
                undo()
        iN(RRR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRn	s	cCsd|_|_x!|iD]}|ii|qW|ii|_g|_|i	o|ii
|in|ig|_|i|i
|idS(sDelete all of pen's drawingsN(RRFRGRRRgRbRIRJR!RVRR0R`RL(RRf((s#/usr/lib/python2.6/lib-tk/turtle.pyRN	s
	

cCs|i|idS(sgDelete the turtle's drawings from the screen. Do not move turtle.

        No arguments.

        Delete the turtle's drawings from the screen. Do not move turtle.
        State and position of the turtle as well as drawings of other
        turtles are not affected.

        Examples (for a Turtle instance named turtle):
        >>> turtle.clear()
        N(RNRh(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR.	s
cCsh|ii|iidjodSt|idjo)|ii|i|i|i|indS(Nii(	RRRRRJRdRIRR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR	s
cCs|i}|idjodS|idjo2|i|i|i|i|inJ|i|idjo/x|iD]}|iqW|indS(s&Perform a Turtle-data update.
        iNi(	RRRRRhRjRRR$(RRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRh	s	




cCs|ii||S(smTurns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a Turtle instance named turtle):
        >>> turtle.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
                turtle.fd(dist)
                turtle.rt(90)
                dist += 2
        (RR#(RtflagR((s#/usr/lib/python2.6/lib-tk/turtle.pyR#
scCs|ii|S(N(RR(RR/((s#/usr/lib/python2.6/lib-tk/turtle.pyR&
scCs|ii|S(N(RR(RR/((s#/usr/lib/python2.6/lib-tk/turtle.pyR)
sc	Cs!t|to|Sy|\}}}Wntdt|nX|iidjoAg}|||fD]}|td|qo~\}}}nd|jo
djno9d|jo
djnod|jo
djnptdt|nd|||fS(s,Convert colortriples to hexstrings.
        sbad color arguments: %sg?go@iisbad color sequence: %ss
#%02x%02x%02x(RRRRRR(RR/RRRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyt_cc,
sAZcCsW|i}|i|i|i}d|_d|_t|}||_||_||_t||ii|_|ii	||i
|iii}|djo|i|i_
n|djo#|i|i
di|i_
nO|djoAg}|i
|iiiD]}||iq~|i_
n|i|_|i|S(sCreate and return a clone of the turtle.

        No argument.

        Create and return a clone of the turtle with same position, heading
        and turtle properties.

        Example (for a Turtle instance named mick):
        mick = Turtle()
        joe = mick.clone()
        RRRIRN(RR4R!RRRR=R?RRVRRRUR@RRRbRIRh(RRRtqtttypeRRf((s#/usr/lib/python2.6/lib-tk/turtle.pyR1;
s,							

#
:
cCs`|djo|iiS||iijotd|n|ii||idS(sSet turtle shape to shape with given name / return current shapename.

        Optional argument:
        name -- a string, which is a valid shapename

        Set turtle shape to shape with given name or, if name is not given,
        return name of current shape.
        Shape with name must exist in the TurtleScreen's shape dictionary.
        Initially there are the following polygon shapes:
        'arrow', 'turtle', 'circle', 'square', 'triangle', 'classic'.
        To learn about how to deal with shapes see Screen-method register_shape.

        Example (for a Turtle instance named turtle):
        >>> turtle.shape()
        'arrow'
        >>> turtle.shape("turtle")
        >>> turtle.shape()
        'turtle'
        sThere is no shape named %sN(RRR?RRRR>Rh(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRcc
s
cCs||jo|jo
djno |i\}}|||ifS|dj	o-|djo||f}q||f}n.|dj	o|id|f}n
|i}|djo
|i}n|iddd|d|dS(sPSet/return turtle's stretchfactors/outline. Set resizemode to "user".

        Optinonal arguments:
           stretch_wid : positive number
           stretch_len : positive number
           outline  : positive number

        Return or set the pen's attributes x/y-stretchfactors and/or outline.
        Set resizemode to "user".
        If and only if resizemode is set to "user", the turtle will be displayed
        stretched according to its stretchfactors:
        stretch_wid is stretchfactor perpendicular to orientation
        stretch_len is stretchfactor in direction of turtles orientation.
        outline determines the width of the shapes's outline.

        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("user")
        >>> turtle.shapesize(5, 5, 12)
        >>> turtle.shapesize(outline=8)
        iRYR'R2RSN(RR#R%RN(Rtstretch_widtstretch_lenRSR2((s#/usr/lib/python2.6/lib-tk/turtle.pyRd~
s*


	

cCsK||i|i}|tiddti}|iddd|dS(sZRotate the turtleshape to point in the specified direction

        Optional argument:
        angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).


        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.settiltangle(45)
        >>> stamp()
        >>> turtle.fd(50)
        >>> turtle.settiltangle(-45)
        >>> stamp()
        >>> turtle.fd(50)
        gf@iRYR'RiN(RRRRRN(RRRi((s#/usr/lib/python2.6/lib-tk/turtle.pyR_
scCs.|idti|i}||i|iS(sReturn the current tilt-angle.

        No argument.

        Return the current tilt-angle, i. e. the angle between the
        orientation of the turtleshape and the heading of the turtle
        (its direction of movement).

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(45)
        >>> turtle.tiltangle()
        >>>
        gf@(R$RRRRR(RRi((s#/usr/lib/python2.6/lib-tk/turtle.pyRj
scCs|i||idS(sRotate the turtleshape by angle.

        Argument:
        angle - a number

        Rotate the turtleshape by angle from its current tilt-angle,
        but do NOT change the turtle's heading (direction of movement).

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        N(R_Rj(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRi
scCs|i}|i\}}|i\}}t|||i|i}dt||\}}g}|D]H\}	}
||||	||
|i|||	||
|ifqi~S(slComputes transformed polygon shapes from a shape
        according to current position and heading.
        g?(RRRR
RPROR
(RRRtp0tp1te0te1R~RRR((s#/usr/lib/python2.6/lib-tk/turtle.pyt
_polytrafo
s	cCs|i}|i|ii}|i}|ii}|io|idjo|idjot	|_
|i}|djoz|idjod}|}n
|idjo-t
d|id}}|i}d}	n6|idjo%|i\}}|i}|i}	ng}
|D]!\}}|
||||fq~
}ti|	ti|	}
}g}|D]2\}}||||
||
|||fqk~}|i|}|i|i}}|i||d|d	|d
|dtq|djo|i||i|q|d
jo|i\}}|i}xt||D]\}\}}}g}|D]!\}}|||||fqp~}|i|}|i||d|i|d	|i|d
|dtqPWqn|i
odS|djo#|i|dddfddns|djo$|i||i|idinB|d
jo4x1|D]%}|i|dddfddqsWnt|_
dS(spManages the correct rendering of the turtle with respect to
        its shape, resizemode, stretch and tilt etc.iRRiR&g@R'R:RSRpR\RRNRRI(ii(ii(ii(ii(ii(ii(RRRR?RR@RRRRRHRRtmaxRR#R%R$RRR|RZR RR^RRRtzipRQ(RRRcRSttitemttshapeRQtlxtlyRjRRRtt0tt1RtfctocRfRR((s#/usr/lib/python2.6/lib-tk/turtle.pyR
sb		*		

	
	
5F

	5(

#

'cCs-|i}|i|ii}|i}|i}|djo|i}|idjod}|}n
|idjo-td|i	d}}|i	}d}	n6|idjo%|i
\}}|i}|i}	ng}
|D]!\}}|
||||fq~
}t
i|	t
i|	}
}g}|D]2\}}||||
||
|||fq8~}|i|}|i|i}}|i||d|d	|d
|dtnC|djo)|id
}|i||i|n
|djog}x'|D]}|i}|i|qWt|}|i
\}}|i}xt||D]\}\}}}g}|D]!\}}|||||fq~}|i|}|i||d|i|d	|i|d
|dtqhWn|ii||iid|f|S(sStamp a copy of the turtleshape onto the canvas and return its id.

        No argument.

        Stamp a copy of the turtle shape onto the canvas at the current
        turtle position. Return a stamp_id for that stamp, which can be
        used to delete it by calling clearstamp(stamp_id).

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> turtle.stamp()
        13
        >>> turtle.fd(50)
        RRiR&g@iR'R:RSRpR\RRRRh(RRRR?RRRURR[RR#R%R$RRR|RZR RR^RRRRRVRR\RQRKRR(RRRcRSR^tstitemRQR_R`RjRRRRaRbRRcRdtelementRfRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRh&sZ			

	
	
5F

	5$cCs||ijoYt|to%x2|D]}|ii|q'Wn|ii||ii|nd|f}|i}||ijodS|ii|}|ii|||i	jo|i	d|i
|_	n|ii|i	d|i
dgdS(s9does the work for clearstamp() and clearstamps()
        RhNi(
RKRRRRgRRRtindexRRtinsertR(RtstampidtsubitemRftbufRg((s#/usr/lib/python2.6/lib-tk/turtle.pyt_clearstampbs 	cCs|i||idS(sDDelete stamp with given stampid

        Argument:
        stampid - an integer, must be return value of previous stamp() call.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> astamp = turtle.stamp()
        >>> turtle.fd(50)
        >>> turtle.clearstamp(astamp)
        N(RlRh(RRi((s#/usr/lib/python2.6/lib-tk/turtle.pyR/xs
cCsr|djo|i}n,|djo|i| }n|i|}x|D]}|i|qMW|idS(sDelete all or first/last n of turtle's stamps.

        Optional argument:
        n -- an integer

        If n is None, delete all of pen's stamps,
        else if n > 0 delete first n stamps
        else if n < 0 delete last n stamps.

        Example (for a Turtle instance named turtle):
        >>> for i in range(8):
                turtle.stamp(); turtle.fd(30)
        ...
        >>> turtle.clearstamps(2)
        >>> turtle.clearstamps(-2)
        >>> turtle.clearstamps()
        iN(RRKRlRh(RRttoDeleteRf((s#/usr/lib/python2.6/lib-tk/turtle.pyR0s


cCsy|i|i|it|itf}|i}d|i|||i|i	|i
|i|iff}|io|ii
|n|i}|io?|idjo/||}|d|id|d|id}dt|ddd|i|i}|d|}	xtd|D]w}
|
djo
t}nt}||	|
|_|io/|i|i||if|i|i|n|iq&W|io,|i|iddfd	d
d|iqn|io|i	i|nt|ito|ii|n||_|io|ii|nt|i	djo|in|id
S(sMove the pen to the point end, thereby drawing a line
        if pen is down. All other methodes for turtle movement depend
        on this one.
        tgoiiig?ig?g?R:RRpi*N(ii(ii(R!RRRRGRRRRIRJRRRRR"RRORPRRRRRdRCRhRVRERDRR4(RR	tgo_modesRt
undo_entrytstarttdifftdiffsqtnhopstdeltaRR\((s#/usr/lib/python2.6/lib-tk/turtle.pyRsT	
	
(*




	
c
Cs,|\}}}}|\}}}}	|\}
}}}
|i}t|i|djo	dGHn|
|_||_|ddgjo
d}n|}|i|
|d|d|g}|iD]4}||
jo!|i|djo||qq~}x+|D]#}|i||ii	|qW|}|i
o0|idjo ||}|d|id	|d|i
d	}dt|dd
d|i
|i
}|d|}xtd|D]n}|djo
t}nt}||||_|o)|i|i||if|||n|iqW|o)|i|iddfddd|qln||_|ioQt|idjo|iin|igjot|_d|_qn|	oG|igjod|_d
GHq|idj	o|iiqn|idS(s)Reverse a _goto. Used for undo()
        g?s$undogoto: HALLO-DA-STIMMT-WAS-NICHT!iRR:RpRiiig?g?sUnwahrscheinlich in _undogoto!N(ii(ii(ii(ii(RR
RRIRJRdRRRgRR"RRORPRRRRRCRhRERRDRRRG(RtentrytoldtnewRotcoodatatdrawingtpctpstfillingtcLItcLRRRtusepcRRttodeleteRqRrRsRtRuRR\((s#/usr/lib/python2.6/lib-tk/turtle.pyt	_undogotosh				
!*

(*

	
			cCs|io |iid||ifn||i9}|ii|}|ii}|djo|idjood|i}dtt	||}d||}x7t
|D]%}|ii||_|iqWn||_|idS(s&Turns pen clockwise by angle.
        trotiig@g?N(RRRRRRRR"RR
RRh(RRt	neworientRtanglevelRRuR((s#/usr/lib/python2.6/lib-tk/turtle.pyRs
 


	cCst|idjoN|ii|i|i|i|i|ii|_|ii	|in|ii|idt
g|_|o|ig|_ndS(sCloses current line item and starts a new one.
           Remark: if current line became too long, animation
           performance (via _drawline) slowed down considerably.
        iR\N(RRJRRdRIRRRbRRVRR(RR;((s#/usr/lib/python2.6/lib-tk/turtle.pyR4+s	cCs}t|it}|djo|S|i}d}}|oOt|idjo5|ii|i|id|id|if}qn|oQ|ii	|_|i
i|i|ig|_d|if}|i
nd|_|_|iop|djo%|d	jo|ii|qkqo|d
jo|ii|qo|iid||gn|idS(sCall fill(True) before drawing a shape to fill, fill(False) when done.

        Optional argument:
        flag -- True/False (or 1/0 respectively)

        Call fill(True) before drawing the shape you want to fill,
        and  fill(False) when done.
        When used without argument: return fillstate (True if filling,
        False else)

        Example (for a Turtle instance named turtle):
        >>> turtle.fill(True)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.fill(False)
        iR:tdofillt	beginfillRN(((((RRGRRRRR^RFR RURRVRR4RRRh(RRPR}Rtentry1tentry2((s#/usr/lib/python2.6/lib-tk/turtle.pyR:;s2
	





cCs|itdS(sCalled just before drawing a shape to be filled.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_fill()
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.end_fill()
        N(R:R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR*nscCs|itdS(sFill the shape drawn after the call begin_fill().

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_fill()
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.left(90)
        >>> turtle.forward(100)
        >>> turtle.end_fill()
        N(R:R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR7scGs|pst|ttfo,|i|}|it|id}q|i}|p|it|id}qn:|djo|it|id}n|i|}t|i	doS|i	i
|i||}|ii
||io|iid|fqn|i}|io#|iidgt|i_nzV|idjo|in|i|i||i||idWd|i|X|iot|i_ndS(sDraw a dot with diameter size, using color.

        Optional argumentS:
        size -- an integer >= 1 (if given)
        color -- a colorstring or a numeric color tuple

        Draw a circular dot with diameter size, using color.
        If size is not given, the maximum of pensize+4 and 2*pensize is used.

        Example (for a Turtle instance named turtle):
        >>> turtle.dot()
        >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50)
        it_dotR5RR&iN(RRRRRR[RRthasattrRRRRRVRRRNRRRYRERPRQROR<R(RROR2RfRN((s#/usr/lib/python2.6/lib-tk/turtle.pyR5s:	!






cCsb|ii|i||||i\}}|ii||io|iid|fn|S(s)Performs the writing for write()
        twri(RR~RRRRVRR(RRxRyRvRfR	((s#/usr/lib/python2.6/lib-tk/turtle.pyR~s
RHtArialiR+cCs|io#|iidgt|i_n|it||i|}|o&|i\}}|i||n|iot	|i_ndS(sWrite text at the current turtle position.

        Arguments:
        arg -- info, which is to be written to the TurtleScreen
        move (optional) -- True/False
        align (optional) -- one of the strings "left", "center" or right"
        font (optional) -- a triple (fontname, fontsize, fonttype)

        Write text - the string representation of arg - at the current
        turtle position according to align ("left", "center" or right")
        and with the given font.
        If move is True, the pen is moved to the bottom-right corner
        of the text. By default, move is False.

        Example (for a Turtle instance named turtle):
        >>> turtle.write('Home = ', True, align="center")
        >>> turtle.write((0,0), True)
        RN(
RRRRR~RRRSR]R(RtargtmoveRyRvR	RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRqs
!
cCs|ig|_t|_dS(sStart recording the vertices of a polygon.

        No argument.

        Start recording the vertices of a polygon. Current turtle position
        is first point of polygon.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_poly()
        N(RRDRRE(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR+scCs
t|_dS(s7Stop recording the vertices of a polygon.

        No argument.

        Stop recording the vertices of a polygon. Current turtle position is
        last point of polygon. This will be connected with the first point.

        Example (for a Turtle instance named turtle):
        >>> turtle.end_poly()
        N(RRE(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR8scCs"|idj	ot|iSdS(sReturn the lastly recorded polygon.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> p = turtle.get_poly()
        >>> turtle.register_shape("myFavouriteShape", p)
        N(RDRR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR=
s
cCs|iS(sReturn the TurtleScreen object, the turtle is drawing  on.

        No argument.

        Return the TurtleScreen object, the turtle is drawing  on.
        So TurtleScreen-methods can be called for that object.

        Example (for a Turtle instance named turtle):
        >>> ts = turtle.getscreen()
        >>> ts
        <turtle.TurtleScreen object at 0x0106B770>
        >>> ts.bgcolor("pink")
        (R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR?
scCs|S(sUReturn the Turtleobject itself.

        No argument.

        Only reasonable use: as a function to return the 'anonymous turtle':

        Example:
        >>> pet = getturtle()
        >>> pet.fd(50)
        >>> pet
        <turtle.Turtle object at 0x0187D810>
        >>> turtles()
        [<turtle.Turtle object at 0x0187D810>]
        ((R((s#/usr/lib/python2.6/lib-tk/turtle.pyR@$
scCs|iidS(s Returns the width of the turtle window.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_width()
        640
        i(RR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR'<
s	cCs|iidS(s Return the height of the turtle window.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_height()
        480
        i(RR(R((s#/usr/lib/python2.6/lib-tk/turtle.pyR&G
s	cCs|ii|S(sDSet delay value which determines speed of turtle animation.
        (RR(RR((s#/usr/lib/python2.6/lib-tk/turtle.pyRjR
sicCs-|ii|ii||||idS(sBind fun to mouse-click event on this turtle on canvas.

        Arguments:
        fun --  a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        num --  number of the mouse-button defaults to 1 (left mouse button).
        add --  True or False. If True, new binding will be added, otherwise
                it will replace a former binding.

        Example for the anonymous turtle, i. e. the procedural way:

        >>> def turn(x, y):
                left(360)

        >>> onclick(turn) # Now clicking into the turtle will turn it.
        >>> onclick(None)  # event-binding will be removed
        N(RRRR@Rh(RRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRJY
scCs-|ii|ii||||idS(sBind fun to mouse-button-release event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        num --  number of the mouse-button defaults to 1 (left mouse button).

        Example (for a MyTurtle instance named joe):
        >>> class MyTurtle(Turtle):
                def glow(self,x,y):
                        self.fillcolor("red")
                def unglow(self,x,y):
                        self.fillcolor("")

        >>> joe = MyTurtle()
        >>> joe.onclick(joe.glow)
        >>> joe.onrelease(joe.unglow)
        ### clicking on joe turns fillcolor red,
        ### unclicking turns it to transparent.
        N(RRRR@Rh(RRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRLn
scCs#|ii|ii|||dS(sBind fun to mouse-move event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
               the coordinates of the clicked point on the canvas.
        num -- number of the mouse-button defaults to 1 (left mouse button).

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.

        Example (for a Turtle instance named turtle):
        >>> turtle.ondrag(turtle.goto)

        ### Subsequently clicking and dragging a Turtle will
        ### move it across the screen thereby producing handdrawings
        ### (if pen is down).
        N(RRRR@(RRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRK
scCs|idjodS|djo8|\}}|i|||i|ii}nB|djo|d}|i|n|djo|i|n|djo.|d}|ii||i	i
|n|djo6|d}|ii|dddfd	d
dd
n~|djo>|d}d|_|_
|ii||i	i
|n3|d
jo%ti||d|iindS(s2Does the main part of the work for undo()
        NRRhiRnRR5RR:RRSRRN(swrisdot(ii(ii(ii(RRRRRR/RRRgRRR^RFRGRRN(RtactionRRtdegPAUtdummyReRf((s#/usr/lib/python2.6/lib-tk/turtle.pyt_undo
s6










cCs|idjodS|ii}|d}|d}|djo7xD|o(|i}|i|d|dqHWn|i||dS(sundo (repeatedly) the last turtle action.

        No argument.

        undo (repeatedly) the last turtle action.
        Number of available undo actions is determined by the size of
        the undobuffer.

        Example (for a Turtle instance named turtle):
        >>> for i in range(4):
                turtle.fd(50); turtle.lt(80)

        >>> for i in range(8):
                turtle.undo()
        NiiR(RRRR(RRfRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRm
s


!N(Risnormal(9RRRRBRRRRXR`RnRNR.RRhR#RRRQR1RcRdR_RjRiRZRRhRlR/R0RRRRR4R:R*R7R5R~RRqR+R8R=R?R@R>R'R&RjRJRLRKRRmRl(((s#/usr/lib/python2.6/lib-tk/turtle.pyRr	sl%			
								(&					7	<			5	A	3		3	
		
	
						cCs'tidjott_ntiS(sReturn the singleton screen object.
    If none exists at the moment, create a new one and return it,
    else return the existing one.N(R	t_screenRRA(((s#/usr/lib/python2.6/lib-tk/turtle.pyR
sRAcBspeZdZdZedZdZededededdZdZ	dZ
d	Zd
ZRS(R"cCstidjo=tt_|_|iiti|ii|intidjot	d}t	d}t	d}t	d}t	d}t	d}|ii
|||||iit_ti
|ti|i||||ndS(NRpRRRRR(RAt_rootRR4R"t_titleRBt_destroyRRR9R:RRR (RRpRRRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyR
s





RpRRRcCst|idpdS|ii}|ii}t|to,d|jo
djno||}n|djo||d}nt|to,d|jo
djno||}n|djo||d}n|ii|||||idS(s Set the size and position of the main window.

        Arguments:
        width: as integer a size in pixels, as float a fraction of the screen.
          Default is 50% of screen.
        height: as integer the height in pixels, as float a fraction of the
          screen. Default is 75% of screen.
        startx: if positive, starting position in pixels from the left
          edge of the screen, if negative from the right edge
          Default, startx=None is to center window horizontally.
        starty: if positive, starting position in pixels from the top
          edge of the screen, if negative from the bottom edge
          Default, starty=None is to center window vertically.

        Examples (for a Screen instance named screen):
        >>> screen.setup (width=200, height=200, startx=0, starty=0)

        sets window to 200x200 pixels, in upper left of screen

        >>> screen.setup(width=.75, height=0.5, startx=None, starty=None)

        sets window to 75% of screen by 50% of screen and centers
        R>Niii(	RRRDRFRRRR>R%(RRpRR<R=Rqtsh((s#/usr/lib/python2.6/lib-tk/turtle.pyR s.
.
cCs1tidj	otii|n|t_dS(sqSet title of turtle-window

        Argument:
        titlestring -- a string, to appear in the titlebar of the
                       turtle graphics window.

        This is a method of Screen-class. Not available for TurtleScreen-
        objects.

        Example (for a Screen instance named screen):
        >>> screen.title("Welcome to the turtle-zoo!")
        N(RARRR"R(Rttitlestring((s#/usr/lib/python2.6/lib-tk/turtle.pyR"(s
cCsX|i}|tijo(dt_dt_dt_dt_ntt_	|i
dS(N(RRARR	RRRRRRRA(Rtroot((s#/usr/lib/python2.6/lib-tk/turtle.pyR9s				
	cCs|idS(s~Shut the turtlegraphics window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bye()
        N(R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyRCscs[fd}i|tdodSytWntj
otdnXdS(slGo into mainloop until the mouse is clicked.

        No arguments.

        Bind bye() method to mouseclick on TurtleScreen.
        If "using_IDLE" - value in configuration dictionary is False
        (default value), enter mainloop.
        If IDLE with -n switch (no subprocess) is used, this value should be
        set to True in turtle.cfg. In this case IDLE's mainloop
        is active also for the client script.

        This is a method of the Screen-class and not available for
        TurtleScreen instances.

        Example (for a Screen instance named screen):
        >>> screen.exitonclick()

        csidS(s&Screen.bye() with two dummy-parametersN(R(RR(R(s#/usr/lib/python2.6/lib-tk/turtle.pytexitGracefully^sRNi(RJRRvtAttributeErrortexit(RR((Rs#/usr/lib/python2.6/lib-tk/turtle.pyRKs
N(
RRRRRRRRR R"RRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyRA
s
	'		
	cBs8eZdZdZdZedededdZRS(sRawTurtle auto-crating (scrolled) canvas.

    When a Turtle object is created or a function derived from some
    Turtle method is called a TurtleScreen object is automatically created.
    RcRRc	CsItidjott_nti|tid|d|d|dS(NRcRR(R	RRRRR(RRcRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRssN(RRRRRRRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyR	jscCs'tidjott_ntiS(s5Create the 'anonymous' turtle if not already present.N(R	RR(((s#/usr/lib/python2.6/lib-tk/turtle.pyt_getpenscCs'tidjott_ntiS(s-Create a TurtleScreen if not already present.N(R	RRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyt
_getscreenstturtle_docstringdictc
Cs_h}x+tD]#}d|}t|i||<q
Wx+tD]#}d|}t|i||<q;Wtd|d}tg}|iD]+}|iddtjo||qq~}|i	dx>|d D]2}|i	d	t
||i	d
||qW|d}|i	d	t
||i	d|||i	d|id
S(sCreate and write docstring-dictionary to file.

    Optional argument:
    filename -- a string, used as filename
                default value is turtle_docstringdict

    Has to be called explicitely, (not used by the turtle-graphics classes)
    The docstring dictionary will be written to the Python script <filname>.py
    It is intended to serve as a template for translation of the docstrings
    into different languages.
    s_Screen.sTurtle.s%s.pyRQRisdocsdict = {

is%s :
s        """%s
""",

s        """%s
"""

s}
N(t_tg_screen_functionsRRt_tg_turtle_functionsRRRRt_alias_listRqtreprR(Rtdocsdictt
methodnameRRRRR((s#/usr/lib/python2.6/lib-tk/turtle.pyRts,

1


cCsndh|id6}t|}|i}x;|D]3}y||t|i_Wq3d|GHq3Xq3WdS(sRead in docstrings from lang-specific docstring dictionary.

    Transfer docstrings, translated to lang, from a dictionary-file
    to the methods of classes Screen and Turtle and - in revised form -
    to the corresponding functions.
    s!turtle_docstringdict_%(language)sRsBad docstring-entry: %sN(Rt
__import__RRtim_funcR(tlangtmodnametmoduleRR((s#/usr/lib/python2.6/lib-tk/turtle.pytread_docstringss	sCannot find docsdict fors;Unknown Error when trying to import %s-docstring-dictionaryc
	Csd}}t|tijo|i}d}n
|}d}t|titigjozyl|ii}t|ii	||!}|ii	||!}|i
pg}ttd|}dgt|t||}td||}	|ii
d@oD|	id|ii	||id|ii	||d7}n|ii
d@o:|	id	|ii	||id	|ii	|nd
i|	}d|}d
i|}d|}WqqXn||fS(s9Get strings describing the arguments for the given objectRiicSsdt|S(s=%s(R(R((s#/usr/lib/python2.6/lib-tk/turtle.pyt<lambda>scSs||S(((Rtdflt((s#/usr/lib/python2.6/lib-tk/turtle.pyRsiRis**s, s(%s)(RRt
MethodTypeRRt
LambdaTypet	func_codetco_argcountRtco_varnamest
func_defaultstmapRtco_flagsRVR(
tobtargText1targText2tfobt	argOffsettcountertitems2trealArgstdefaultstitems1((s#/usr/lib/python2.6/lib-tk/turtle.pytgetmethparlists:
	
!
cCsgddk}|djodStd}|id|d}|id|}|id|}|S(s<To reduce docstrings from RawTurtle class for functions
    iNRs%s.Rs \(.+ %s\):t:(treRRtreplacetcompiletsub(tdocstrRt
turtlenamet	newdocstrtparexp((s#/usr/lib/python2.6/lib-tk/turtle.pyt_turtle_docrevises

cCsgddk}|djodStd}|id|d}|id|}|id|}|S(s?To reduce docstrings from TurtleScreen class for functions
    iNRs%s.Rs \(.+ %s\):R(RRRRRR(RRt
screennameRR((s#/usr/lib/python2.6/lib-tk/turtle.pyt_screen_docrevises

s_Screen.Rs>>>>>>s6def %(key)s%(pl1)s: return _getscreen().%(key)s%(pl2)sRtpl1tpl2sTurtle.s3def %(key)s%(pl1)s: return _getpen().%(key)s%(pl2)st__main__cCs totntdS(N(RFRURM(((s#/usr/lib/python2.6/lib-tk/turtle.pyt	switchpen%s
cCstttttdttdxtdD]}|djotdnx(tdD]}t	dt
dqnW|djotdtd	ntt	d
tq@Wtdtdtttt
dt	dt
dt	dt
dttd
dtddtdx<tdD].}t	dt
dt	dt
dq\Wtttdx<tdD].}t	dt
dt	dt
dqWtd	dS(sDemo of old turtle.py - moduleidiiiiiiZtmarooniiRit
startstartRqtrediN(RXR#RRoR)R6RpRR:R<RHR2RRWRq(RR((s#/usr/lib/python2.6/lib-tk/turtle.pytdemo1+s`






























cCsYtdttdttddtddd}tdx(tdD]}tt	|dqXWt
dxtotqWt
tdtd	d}td
tdtdxtdd
D]}|djo'ttd	d|dd|nx(tdD]}t|tdq/W|d7}tdttddqWttdttdtdttddtdtdx?tdD]1}t	ddtdtdtdqWtdtdttdttdt}|idt}|id|id|i
|id|id|i|idd|id|i |id|idd|id|idtt|d}x|i|djo{|id|id |i|i||id|d!djo|i!|i!tn|d7}q$W|i
d"d#d-d&d'|id(|idd)}t"i#dx#to|i|iqW|id|i
d*d#d.|i$|dd,S(/sDemo of some new features.iiig@iZii
swait a moment...itgreeniiiiixiiFiRtyellowii2RR&ii(itbluetorangeig@g333333?isCAUGHT! RvRtboldRyRWRcSsttdS(N(RR(RR((s#/usr/lib/python2.6/lib-tk/turtle.pytbabass  Click me!tCourierN(sArialiR(RiR(%RfRgRQR\RkR4RZRRR-RqRnRmRXRIRROR*R;R9R7RURMR2R:RcR@RYR	RHRoRAR6RhttimetsleepRJ(RRtlaengeRttriRRR((s#/usr/lib/python2.6/lib-tk/turtle.pytdemo2`s











 

















	
	

















	



(LRt_vertTkinterR
RRRtostos.pathRRRtcopyRt_tg_classesRRt
_tg_utilitiest_math_functionst__all__RRRRRRRRR
RRRRRRRR5R4tobjectRGt	ExceptionRRRRRRRR=RR
RRAR	RRRRtRt	_LANGUAGEtImportErrorRRRRRRRtdefstrRvRuRRRRR(((s#/usr/lib/python2.6/lib-tk/turtle.pyt<module>es
	!


		%	4	
	c	J	/&
j			"	



	$		

&

&
	
		5	b

Youez - 2016 - github.com/yon3zu
LinuXploit