Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.141.198.110
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : turtle.cpython-32.pyc
l
��bcO@s�dZdZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlmZddd	d
ddd
ddg	Zddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.gZd/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}gOZd~dgZeeeeZdd0d3d@dMdQdUd[d]dbdcdedfdqdvdydzgZid�dz6d�d�6d�d�6d�d�6ed�6ed�6d�d6d�d6d�d6d�d�6d�dk6d�dW6d�dA6d�da6ed�6d�d�6d�d�6d�d�6d�d)6ed�6Zd��Zd��Zyee�Wned��YnXGd��de�Zd��Zd��Z d�d�Z!fd��Z"Gd��dej#�Z$e"e$ej%d��Gd��d�ej&�Z'ej%Z%Gd��d�e(�Z)Gd��d�e*�Z+Gd��d�e*�Z,Gd��de(�Z-Gd��d�e(�Z.Gd��de)�Z/Gd��d�e(�Z0Gd��d�e(�Z1Gd��d�e(�Z2Gd��d
e1e0�Z3e3Z4d��Z5Gd��d�e/�Z6Gd��de3�Z7e7Z8d��Z9d��Z:d�d��Z;d��Z<ed�Z=ye=d�kr�e<e=�nWn4e>k
red�e=�Yned�e=�YnXd��Z?d��Z@d��ZAx�eD]�ZBe?eCd�eB��\ZDZEeDd�kr�ed�eDeE�qKnd�ieBd�6eDd�6eEd�6ZFeGeF�eAeCd�eB�j�eCeB�_qKWx�eD]�ZBe?eCd�eB��\ZDZEeDd�kr)ed�eDeE�q�nd�ieBd�6eDd�6eEd�6ZFeGeF�e@eCd�eB�j�eCeB�_q�WeHZIeJd�kr�d��ZKd��ZLd��ZMeL�eM�eN�ndS(�u�

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. After an ``import turtle``, 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.right(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 mind. These will be commented and documented elsewhere.

u-turtle 1.1b- - for Python 3.1   -  4. 5. 2009iN(uisfileusplitujoin(udeepcopy(usimpledialoguScrolledCanvasuTurtleScreenuScreenu	RawTurtleuTurtleuRawPenuPenuShapeuVec2Duaddshapeubgcolorubgpicubyeuclearscreenu	colormodeudelayuexitonclicku	getcanvasu	getshapesulistenumainloopumodeunuminputuonkeyu
onkeypressuonkeyreleaseu
onscreenclickuontimeruregister_shapeuresetscreenu
screensizeusetupusetworldcoordinatesu	textinpututitleutraceruturtlesuupdateu
window_heightuwindow_widthubackubackwardu
begin_fillu
begin_polyubkucircleuclearu
clearstampuclearstampsucloneucolorudegreesudistanceudotudownuend_filluend_polyufdu	fillcolorufillinguforwarduget_polyugetpenu	getscreenu
get_shapepolyu	getturtleugotouheadingu
hideturtleuhomeuhtuisdownu	isvisibleuleftultuonclickuondragu	onreleaseupdupenupencolorupendownupensizeupenupuposupositionupuuradiansurighturesetu
resizemodeurtusethu
setheadingusetposusetpositionusettiltangleu
setundobufferusetxusetyushapeu	shapesizeushapetransformushearfactoru
showturtleuspeedustustamputiltu	tiltangleutowardsu
turtlesizeuundouundobufferentriesuupuwidthuwriteuxcoruycoruwrite_docstringdictudoneg�?g�?uheighti�u	canvwidthi,u
canvheightu	leftrightu	topbottomustandardg�?i
i�uundobuffersizeuclassicublackunoresizeuvisibleuenglishulanguageuturtleu
exampleturtleuscreenu
examplescreenuPython Turtle Graphicsu
using_IDLEcCst|d��}|j�}WdQXi}x�|D]�}|j�}|s1|jd�r_q1ny|jd�\}}Wntd||f�w1YnX|j�}|j�}|dkr�t|�}n6y+d|kr�t|�}nt|�}WnYnX|||<q1W|S(
u/Convert content of config-file into dictionary.urNu#u=uBad line in config-file %s:
%suTrueuFalseuNoneu''u""u.(uTrueuFalseuNoneu''u""(	uopenu	readlinesustripu
startswithusplituprintuevalufloatuint(ufilenameufucfglinesucfgdictulineukeyuvalue((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuconfig_dict�s0
c	Cs�d}i}i}t|�r-t|�}nd|krJd|d}ny%tt�\}}t||�}Wnd}YnXt|�r�t|�}ntj|�tj|�dS(u@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.
    u
turtle.cfguimportconfigu
turtle_%s.cfguN(uisfileuconfig_dictusplitu__file__ujoinu_CFGuupdate(ucfgdictudefault_cfgucfgdict1ucfgdict2uheadutailu	cfg_file2((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
readconfig�s 

u"No configfile read, reason unknowncBsn|EeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZdS(u�A 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
    cCstj|||f�S(N(utupleu__new__(uclsuxuy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__new__�scCs%t|d|d|d|d�S(Nii(uVec2D(uselfuother((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__add__�scCsLt|t�r/|d|d|d|dSt|d||d|�S(Nii(u
isinstanceuVec2D(uselfuother((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__mul__�s cCs?t|t�st|t�r;t|d||d|�SdS(Nii(u
isinstanceuintufloatuVec2D(uselfuother((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__rmul__scCs%t|d|d|d|d�S(Nii(uVec2D(uselfuother((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__sub__scCst|d|d�S(Nii(uVec2D(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__neg__scCs|dd|dddS(Niiig�?((uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__abs__	scCs}t|d|d�}|tjd}tj|�tj|�}}t|d||d||d||d|�S(u.rotate self counterclockwise by angle
        iig�f@(uVec2Dumathupiucosusin(uselfuangleuperpucus((u-/usr/local/python-3.2/lib/python3.2/turtle.pyurotatescCs|d|dfS(Nii((uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__getnewargs__scCsd|S(Nu(%.2f,%.2f)((uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__repr__sN(
u__name__u
__module__u__doc__u__new__u__add__u__mul__u__rmul__u__sub__u__neg__u__abs__urotateu__getnewargs__u__repr__(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuVec2D�s

									cCs}t|j�}|j�x|D]}t||�q Wx?|jj�D].\}}t|�tjkrG|||<qGqGWdS(u#helper function for Scrolled CanvasN(	ulistu	__bases__ureverseu__methodDictu__dict__uitemsutypeutypesuFunctionType(uclsu_dictubaseListu_superukeyuvalue((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__methodDict s

cCsi}t||�|j�S(u#helper function for Scrolled Canvas(u__methodDictukeys(uclsu_dict((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	__methods*s
u*def %(method)s(self, *args, **kw): return u*self.%(attribute)s.%(method)s(*args, **kw)cCsi}t||�i}t|�}xi|j�D][}|dd�dks�|dd�dks�||ks�||krq2||||<q2Wxy|j�D]k\}}	i|d6|	d6}
t|t�r�ti|d6|d6}nt||
�t|||
|�q�WdS(Niu_umethodufuncu	attributei����(	u__methodDictu	__methodsukeysuitemsu
isinstanceustru__stringBodyuexecusetattr(u	fromClassutoClassutoPartuexcludeu_dict_1u_dictumfcuexumethodufuncudu
execString((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__forwardmethods4s
D
cBs�|EeZdZddddd�Zdddd�Zd�Zd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
�Z
dS(u�Modeled 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.
    i�i^iXcCs
tjj||d|d|�|j�|_|||_|_|||_|_d|_	tj
|d|d|d|j	dtjdd�|_tj
|d|jjd	tj�|_tj
|d|jj�|_|jjd
|jjd|jj�|jdd
ddd�|jdd
ddd�|jjddd|dddddddddddd�|jjddd|dddddddddddd�|jjddd|dddddddddddd�|j�|jjd|j�dS(Nuwidthuheightuwhiteubgureliefuborderwidthiucommanduorientuxscrollcommanduyscrollcommandiuweightiuminsizeupadxuin_upadyurowucolumnurowspanu
columnspanustickyunewsu<Configure>(uTKuFrameu__init__uwinfo_toplevelu_rootwindowuwidthuheightu	canvwidthu
canvheightubguCanvasuSUNKENu_canvasu	Scrollbaruxviewu
HORIZONTALuhscrolluyviewuvscrollu	configureuseturowconfigureucolumnconfigureugriduresetubinduonResize(uselfumasteruwidthuheightu	canvwidthu
canvheight((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__Os,	
$$$
c	Cs�|r||_n|r$||_n|r6||_n|jjd|d|jd|jd|jd|jdf�|jjd|j|jd|j�|jjd|j|jd|j�|j	�dS(u<Adjust canvas and scrollbars according to given canvas size.ubguscrollregionig�?iN(
u	canvwidthu
canvheightubgu_canvasuconfiguxview_movetouwidthuyview_movetouheightu
adjustScrolls(uselfu	canvwidthu
canvheightubg((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuresethscCs|jj�}|jj�}|jjd|j||j�|jjd|j||j�||jks�||jkr�|jjddd|ddddddd	dd
ddd�|j	jddd|ddddddd	dd
ddd�n|jj
�|j	j
�d
S(uA Adjust scrollbars according to window- and canvas-size.
        g�?upadxiuin_upadyurowucolumniurowspanu
columnspanustickyunewsN(u_canvasuwinfo_widthuwinfo_heightuxview_movetou	canvwidthuyview_movetou
canvheightuhscrollugriduvscrollugrid_forget(uselfucwidthucheight((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
adjustScrollszs""$$
cCs|j�dS(uself-explanatoryN(u
adjustScrolls(uselfuevent((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuonResize�scGs|jj|�S(u@ 'forward' method, which canvas itself has inherited...
        (u_canvasubbox(uselfuargs((u-/usr/local/python-3.2/lib/python3.2/turtle.pyubbox�scOs|jj||�S(u@ 'forward' method, which canvas itself has inherited...
        (u_canvasucget(uselfuargsukwargs((u-/usr/local/python-3.2/lib/python3.2/turtle.pyucget�scOs|jj||�dS(u@ 'forward' method, which canvas itself has inherited...
        N(u_canvasuconfig(uselfuargsukwargs((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuconfig�scOs|jj||�dS(u@ 'forward' method, which canvas itself has inherited...
        N(u_canvasubind(uselfuargsukwargs((u-/usr/local/python-3.2/lib/python3.2/turtle.pyubind�scOs|jj||�dS(u@ 'forward' method, which canvas itself has inherited...
        N(u_canvasuunbind(uselfuargsukwargs((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuunbind�scCs|jj�dS(u@ 'forward' method, which canvas itself has inherited...
        N(u_canvasufocus_force(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyufocus_force�sN(u__name__u
__module__u__doc__u__init__uNoneuresetu
adjustScrollsuonResizeubboxucgetuconfigubinduunbindufocus_force(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuScrolledCanvasIs
							u_canvascBsS|EeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dS(	u'Root class for Screen based on Tkinter.cCstjj|�dS(N(uTKuTku__init__(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__�scCs8t|||||�|_|jjdddd�dS(Nuexpandiufilluboth(uScrolledCanvasu_canvasupack(uselfuwidthuheightucwidthucheight((u-/usr/local/python-3.2/lib/python3.2/turtle.pyusetupcanvas�scCs|jS(N(u_canvas(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
_getcanvas�scCs!|jd||||f�dS(Nu%dx%d%+d%+d(ugeometry(uselfuwidthuheightustartxustarty((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuset_geometry�scCs|jd|�dS(NuWM_DELETE_WINDOW(uwm_protocol(uselfudestroy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	ondestroy�scCs
|j�S(N(uwinfo_screenwidth(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	win_width�scCs
|j�S(N(uwinfo_screenheight(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
win_height�sN(
u__name__u
__module__u__doc__u__init__usetupcanvasu
_getcanvasuset_geometryu	ondestroyu	win_widthu
win_height(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_Root�s
						u_RootcBs�|EeZdZed��Zed��Zd�Zd�Zd#d#d#d$d�Z
d�Zd#d#d#d$d�Zd�Z
d	�Zd
�Zd�Zd#d�Zd
�Zdd#d�Zdd#d�Zdd#d�Zdd#d�Zd�Zd#d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d#d#d#d�Z"d�Z#d �Z$d!�Z%d#d#d#d"�Z&d#S(%u�Provide 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&tjdddd�}|j�|S(u$return a blank image object
        uwidthiuheight(uTKu
PhotoImageublank(uimg((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_blankimage�s
cCstjd|�S(u`return an image object containing the
        imagedata from a gif-file named filename.
        ufile(uTKu
PhotoImage(ufilename((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_image�scCs�||_t|t�r3|jj}|jj}nat|jjd��}t|jjd��}|jjd|d|d|d|df�||_||_d|_|_	dS(Nuwidthuheightuscrollregionig�?(
ucvu
isinstanceuScrolledCanvasu	canvwidthu
canvheightuintucgetuconfiguxscaleuyscale(uselfucvuwuh((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__�s	1		cCs|jjddddd�S(u<Create an invisible polygon item on canvas self.cv)
        iufilluuoutline(iiiiii(ucvucreate_polygon(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_createpoly�sc
Cs�g}x=|D]5\}}	|j||j�|j|	|j�q
W|jj||�|dk	r~|jj|d|�n|dk	r�|jj|d|�n|dk	r�|jj|d|�n|r�|jj|�ndS(u`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.
        ufilluoutlineuwidthN(uappenduxscaleuyscaleucvucoordsuNoneu
itemconfigureu	tag_raise(
uselfupolyitemu	coordlistufilluoutlineuwidthutopucluxuy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	_drawpoly�scCs.|jjdddddddddtj�S(u9Create an invisible line item on canvas self.cv)
        iufilluuwidthiucapstyle(ucvucreate_lineuTKuROUND(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_createlines$c	Cs�|dk	rhg}x=|D]5\}}|j||j�|j||j�qW|jj||�n|dk	r�|jj|d|�n|dk	r�|jj|d|�n|r�|jj|�ndS(uQConfigure 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.
        ufilluwidthN(uNoneuappenduxscaleuyscaleucvucoordsu
itemconfigureu	tag_raise(	uselfulineitemu	coordlistufilluwidthutopucluxuy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	_drawlines
cCs|jj|�dS(u]Delete graphics item from canvas.
        If item is"all" delete all graphics items.
        N(ucvudelete(uselfuitem((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_delete)scCs|jj�dS(u(Redraw graphics items on canvas
        N(ucvuupdate(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_update/scCs|jj|�dS(u-Delay subsequent canvas actions for delay ms.N(ucvuafter(uselfudelay((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_delay4scCs>y|jj|�}d}Wntjk
r9d}YnX|S(uCCheck if the string color is a legal Tkinter color string.
        TF(ucvu	winfo_rgbuTrueuTKuTclErroruFalse(uselfucolorurgbuok((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_iscolorstring8s
cCs@|dk	r,|jjd|�|j�n|jjd�SdS(uVSet canvas' backgroundcolor if color is not None,
        else return backgroundcolor.ubgN(uNoneucvuconfigu_updateucget(uselfucolor((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_bgcolorBs
cCs�|\}}||j}||j}idd6dd6dd6}|jj|d|d|d	||d
|d|�}	|jj|	�\}
}}}
|jj�|	|dfS(u�Write 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.uswuleftusucenteruseurightiutextuanchorufillufont(uxscaleuyscaleucvucreate_textubboxuupdate(uselfuposutxtualignufontupencoloruxuyuanchoruitemux0uy0ux1uy1((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_writeKs

'
icsY�dkr&�jj|d|�n/��fd�}�jj|d|||�dS(u�Bind 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
        u<Button-%s>csK�jj|j��j�jj|j��j}}�||�dS(N(ucvucanvasxuxuxscaleucanvasyuyuyscale(ueventuxuy(ufunuself(u-/usr/local/python-3.2/lib/python3.2/turtle.pyueventfunfs!N(uNoneucvu
tag_unbindutag_bind(uselfuitemufununumuaddueventfun((ufunuselfu-/usr/local/python-3.2/lib/python3.2/turtle.pyu_onclick]scsY�dkr&�jj|d|�n/��fd�}�jj|d|||�dS(ugBind 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.
        u<Button%s-ButtonRelease>csK�jj|j��j�jj|j��j}}�||�dS(N(ucvucanvasxuxuxscaleucanvasyuyuyscale(ueventuxuy(ufunuself(u-/usr/local/python-3.2/lib/python3.2/turtle.pyueventfunxs!N(uNoneucvu
tag_unbindutag_bind(uselfuitemufununumuaddueventfun((ufunuselfu-/usr/local/python-3.2/lib/python3.2/turtle.pyu
_onreleasels
	csY�dkr&�jj|d|�n/��fd�}�jj|d|||�dS(uqBind 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.
        u<Button%s-Motion>c	sZyK�jj|j��j�jj|j��j}}�||�WnYnXdS(N(ucvucanvasxuxuxscaleucanvasyuyuyscale(ueventuxuy(ufunuself(u-/usr/local/python-3.2/lib/python3.2/turtle.pyueventfun�s!N(uNoneucvu
tag_unbindutag_bind(uselfuitemufununumuaddueventfun((ufunuselfu-/usr/local/python-3.2/lib/python3.2/turtle.pyu_ondrags	csS�dkr#�jjd|�n,��fd�}�jjd|||�dS(uGBind 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.
        u<Button-%s>csK�jj|j��j�jj|j��j}}�||�dS(N(ucvucanvasxuxuxscaleucanvasyuyuyscale(ueventuxuy(ufunuself(u-/usr/local/python-3.2/lib/python3.2/turtle.pyueventfun�s!N(uNoneucvuunbindubind(uselfufununumuaddueventfun((ufunuselfu-/usr/local/python-3.2/lib/python3.2/turtle.pyu_onscreenclick�s	csP�dkr&|jjd|d�n&�fd�}|jjd||�dS(u`Bind fun to key-release event of key.
        Canvas must have focus. See method listen
        u<KeyRelease-%s>cs��dS(N((uevent(ufun(u-/usr/local/python-3.2/lib/python3.2/turtle.pyueventfun�sN(uNoneucvuunbindubind(uselfufunukeyueventfun((ufunu-/usr/local/python-3.2/lib/python3.2/turtle.pyu
_onkeyrelease�scs��dkrH|dkr.|jjdd�q�|jjd|d�nH�fd�}|dkry|jjd|�n|jjd||�dS(u�If key is given, bind fun to key-press event of key.
        Otherwise bind fun to any key-press.
        Canvas must have focus. See method listen.
        u
<KeyPress>u
<KeyPress-%s>cs��dS(N((uevent(ufun(u-/usr/local/python-3.2/lib/python3.2/turtle.pyueventfun�sN(uNoneucvuunbindubind(uselfufunukeyueventfun((ufunu-/usr/local/python-3.2/lib/python3.2/turtle.pyu_onkeypress�scCs|jj�dS(u=Set focus on canvas (in order to collect key-events)
        N(ucvufocus_force(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_listen�scCs6|dkr|jj|�n|jj||�dS(u?Install a timer, which calls fun after t milliseconds.
        iN(ucvu
after_idleuafter(uselfufunut((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_ontimer�scCs|jjddd|�S(u0Create and return image item on canvas.
        iuimage(ucvucreate_image(uselfuimage((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_createimage�scCsN|\}}|jj|||j||jf�|jj|d|�dS(uZConfigure image item as to draw image object
        at position (x,y) on canvas)
        uimageN(ucvucoordsuxscaleuyscaleu
itemconfig(uselfuitemuposuimageuxuy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
_drawimage�s(cCs*|jj|d|�|jj|�dS(u�Configure 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 .uimageN(ucvu
itemconfigu	tag_lower(uselfuitemuimage((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	_setbgpic�scCs|jj|�S(uQReturn 'line' or 'polygon' or 'image' depending on
        type of item.
        (ucvutype(uselfuitem((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_type�scs>|jj|���fd�tdt��d�D�}|S(u 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)]
        >>> cs)g|]}�|�|df�qS(i((u.0ui(ucl(u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�s	ii(ucvucoordsurangeulen(uselfuitemupl((uclu-/usr/local/python-3.2/lib/python3.2/turtle.pyu
_pointlist�s(cCs#|jjd||||f�dS(Nuscrollregion(ucvuconfig(uselfusrx1usry1usrx2usry2((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_setscrollregion�sc	Cs�|jj�}x�|D]�}t|jj|��}g}xR|r�|dd�\}}|j||�|j||�|dd�}q=W|jj||�qWdS(Ni(ucvufind_allulistucoordsuappend(	uselfuxscalefactoruyscalefactoruitemsuitemucoordinatesunewcoordlistuxuy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_rescale�s
	cCs�t|jt�s"|j|jfS||koD|koDdknr_|jj|jjfS|dk	rw||_n|dk	r�||_n|jj|||�dS(uaResize the canvas the turtles are drawing on. Does
        not alter the drawing window.
        N(u
isinstanceucvuScrolledCanvasu	canvwidthu
canvheightuNoneureset(uselfu	canvwidthu
canvheightubg((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_resizes'cCs`|jj�}|dkr+|jd}n|jj�}|dkrV|jd}n||fS(u; Return the width and height of the turtle window.
        iuwidthuheight(ucvuwinfo_widthuwinfo_height(uselfuwidthuheight((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_window_sizescCstj�dS(u{Starts event loop - calling Tkinter's mainloop function.

        No argument.

        Must be last statement in a turtle graphics program.
        Must NOT be used if a script is run from within IDLE in -n mode
        (No subprocess) - for interactive use of turtle graphics.

        Example (for a TurtleScreen instance named screen):
        >>> screen.mainloop()

        N(uTKumainloop(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyumainloop s
cCstj||�S(u�Pop up a dialog window for input of a string.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what information to input.

        Return the string input
        If the dialog is canceled, return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.textinput("NIM", "Name of first player:")

        (usimpledialogu	askstring(uselfutitleuprompt((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	textinput/s
c	Cs"tj||d|d|d|�S(u�Pop up a dialog window for input of a number.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what numerical information to input.
        default: default value
        minval: minimum value for imput
        maxval: maximum value for input

        The number input must be in the range minval .. maxval if these are
        given. If not, a hint is issued and the dialog remains open for
        correction. Return the number input.
        If the dialog is canceled,  return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000)

        uinitialvalueuminvalueumaxvalue(usimpledialoguaskfloat(uselfutitleupromptudefaultuminvalumaxval((u-/usr/local/python-3.2/lib/python3.2/turtle.pyunuminput>sNF('u__name__u
__module__u__doc__ustaticmethodu_blankimageu_imageu__init__u_createpolyuNoneuFalseu	_drawpolyu_createlineu	_drawlineu_deleteu_updateu_delayu_iscolorstringu_bgcoloru_writeu_onclicku
_onreleaseu_ondragu_onscreenclicku
_onkeyreleaseu_onkeypressu_listenu_ontimeru_createimageu
_drawimageu	_setbgpicu_typeu
_pointlistu_setscrollregionu_rescaleu_resizeu_window_sizeumainloopu	textinputunuminput(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuTurtleScreenBase�sH
	
						
															uTurtleScreenBasecBs|EeZdZdS(u�Will be raised in TurtleScreen.update, if _RUNNING becomes False.

    This stops execution of a turtle graphics script.
    Main purpose: use in the Demo-Viewer turtle.Demo.py.
    N(u__name__u
__module__u__doc__(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
TerminatorYs
u
TerminatorcBs|EeZdZdS(uSome TurtleGraphics Error
    N(u__name__u
__module__u__doc__(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuTurtleGraphicsErrorbs
uTurtleGraphicsErrorcBs,|EeZdZdd�Zdd�ZdS(u�Data 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�||_|dkr6t|t�r�t|�}q�ny|dkr�t|t�r�|j�jd�r�t|�r�tj	|�}q�q�n%|dkr�g}nt
d|��||_dS(Nupolygonuimageu.gifucompounduThere is no shape type %s(u_typeu
isinstanceulistutupleustruloweruendswithuisfileuTurtleScreenu_imageuTurtleGraphicsErroru_data(uselfutype_udata((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__ns	!	cCsW|jdkr%td|j��n|dkr:|}n|jj|||g�dS(u-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()
        ucompoundu Cannot add component to %s ShapeN(u_typeuTurtleGraphicsErroruNoneu_datauappend(uselfupolyufilluoutline((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuaddcomponent~s	N(u__name__u
__module__u__doc__uNoneu__init__uaddcomponent(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuShapegs
cBsP|EeZdZdd�Zdd�Zd�Zd�Zd�Zd�Z	dS(	u5Ring buffer used as undobuffer for RawTurtle objects.i
cCs2||_dgg||_d|_d|_dS(Nii����F(ubufsizeuNoneubufferuptruFalseucumulate(uselfubufsize((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__�s		cCsb|dkr9xFt|j�D]}dg|j|<qWn||_dgg||_d|_dS(Nii����(uNoneurangeubufsizeubufferuptr(uselfubufsizeui((u-/usr/local/python-3.2/lib/python3.2/turtle.pyureset�s	cCs`|jdkr\|jsB|jd|j|_||j|j<q\|j|jj|�ndS(Nii(ubufsizeucumulateuptrubufferuappend(uselfuitem((u-/usr/local/python-3.2/lib/python3.2/turtle.pyupush�s
	cCsd|jdkr`|j|j}|dkr/dSdg|j|j<|jd|j|_|SndS(Nii(ubufsizeubufferuptruNone(uselfuitem((u-/usr/local/python-3.2/lib/python3.2/turtle.pyupop�scCs|j|jjdg�S(N(ubufsizeubufferucountuNone(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyunr_of_items�scCst|j�dt|j�S(Nu (ustrubufferuptr(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__repr__�sN(
u__name__u
__module__u__doc__u__init__uNoneuresetupushupopunr_of_itemsu__repr__(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuTbuffer�s
				uTbuffercBsg|EeZdZd!Zedededd�Zd�Zd d�Z	d�Z
d d�Zd	�Zd
�Z
d d�Zd�Zd
�Zd�Zd d d�Zd d�Zd�Zd�Zd�Zd�Zd�Zd�Zdd d�Zd�Zd d�Zd d d�Zdd�Zd d�Zd d d d�Z eZ!eZ"eZ#eZ$eZ%d S("u�Provides 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.
    umodeu	colormodeudelaycCsitdd#d$d%f�d6tdd&d(d*d,d.d0d2d4d5d6fd7d8fd9d:fd;d<fdd=fd	d>fd
d?fdd@fddAfdBdCdDdEdFdGdHf�d6tddIdJdKdLdMdNdPdRdTdVdXdYdZfd[d\fd]d^fd_d`fddafddbfddcfdddfddeff�d6tdddffdgdidjdkff�d6tdddlfdmdndoff�d6tddpdqdrfddsfddtff�d6td|j��d6|_idd 6|_tj||�||_||_td!|_	g|_
|j�dS(uNupolygoni
iuarrowiiiiiii	iiiiuturtleg��Q�#@g���Q�@g�G�z. @g��Q��@gg$@ucircleusquareg�G�z@g�����'@utriangleuclassicuimageublankuunopicu	colormodei����(i����i(i
i(ii
(iii����(i����ii����(i����i
i����(i����ii����(i����i	i����(i����ii����(i����ii����(i����ii����i����i����i����i����i����i����i����i����i����i����i����i����(ii(ii(i	i(ii	(ii(ii
(ii(i
i(g��Q�#@g���Q�@(g�G�z. @g��Q��@(g��Q��@g�G�z. @(g���Q�@g��Q�#@(ii
g���Q��(g���Q��g��Q�#@g��Q���(g��Q���g�G�z. @g�G�z. �(g�G�z. �g��Q��@g��Q�#�(g��Q�#�g���Q�@i����(i����ig��Q�#�g���Q��g�G�z. �g��Q���g��Q���g�G�z. �g���Q��g��Q�#�g$�g��Q�#�g�G�z. �g��Q���g���Q��i����(i
i
i����(i����i
i����i����g�G�z�(ig�����'@i����g�G�z�(iii����i����i����i����(uShapeu_blankimageu_shapesu_bgpicsuTurtleScreenBaseu__init__u_modeu_delayvalueu_CFGu
_colormodeu_keysuclear(uselfucvumodeu	colormodeudelay((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__�s46
%.		
	cCs�td|_td|_|jd�|jd�|_d|_d|_d|_g|_	|j
d�xdD]}|jd|�qqW|j
d�x;|jdd�D]&}|jd|�|j
d|�q�Wdt_dS(
uqDelete all drawings and all turtles from the TurtleScreen.

        No argument.

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

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

        Note: this method is not available as function.
        udelayu	colormodeualluunopiciiuwhiteiiN(iii(u_CFGu_delayvalueu
_colormodeu_deleteu_createimageu_bgpicu
_bgpicnameu_tracingu_updatecounteru_turtlesubgcoloruonclickuNoneu
onkeypressu_keysuonkeyuTurtleu_pen(uselfubtnukey((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuclear�s 



				


cCs�|dkr|jS|j�}|dkr>td|��n||_|d	kr�|j|jd|jd|jd|jd�d|_|_n|j	�dS(
ugSet 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'
        ustandardulogouworlduNo turtle-graphics-mode %sig�?N(ustandardulogouworld(ustandardulogo(
uNoneu_modeuloweruTurtleGraphicsErroru_setscrollregionu	canvwidthu
canvheightuxscaleuyscaleureset(uselfumode((u-/usr/local/python-3.2/lib/python3.2/turtle.pyumodes	cCs|j�dkr"|jd�nt||�}t||�}|j�\}}|j|d|d�|j|j}	}
|j||_|j||_||j}||j}|j|}
|j|}|j|||
|�|j	|j|	|j|
�|j
�dS(usSet 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)
        uworldiN(umodeufloatu_window_sizeu
screensizeuxscaleuyscaleu	canvwidthu
canvheightu_setscrollregionu_rescaleuupdate(uselfullxullyuurxuuryuxspanuyspanuwxuwyu	oldxscaleu	oldyscaleusrx1usry1usrx2usry2((u-/usr/local/python-3.2/lib/python3.2/turtle.pyusetworldcoordinates%s 


cCs�|dkrO|j�jd�r<td|j|��}qptdd��n!t|t�rptd|�}n||j|<dS(u�Adds 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)))

        u.gifuimageu"Bad arguments for register_shape.
uUse  help(register_shape)upolygonN(	uNoneuloweruendswithuShapeu_imageuTurtleGraphicsErroru
isinstanceutupleu_shapes(uselfunameushape((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuregister_shapeLs
cCsLt|�dkr|d}nt|t�rf|j|�sI|dkrM|Stdt|���ny|\}}}Wntdt|���YnX|jdkr�d�|||fD�\}}}nd|ko�dknod|kodknod|kodkns;td	t|���nd
|||fS(uReturn 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.
        iiuubad color string: %subad color arguments: %sg�?cSs g|]}td|��qS(g�o@(uround(u.0ux((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�s	i�ubad color sequence: %su
#%02x%02x%02x(ulenu
isinstanceustru_iscolorstringuTurtleGraphicsErroru
_colormode(uselfucolorurugub((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	_colorstros

%Tcs��jd�s�St��dkr>�fd�dD�}nEt��dkrs�fd��dd�D�}ntd	���t�fd
�|D��S(Nu#ics-g|]#}t�||d�d��qS(ii(uint(u.0ui(ucstr(u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�s	iiiics'g|]}dt�|d��qS(i(uint(u.0uh(ucstr(u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�s	ubad colorstring: %scs!g|]}|�jd�qS(i�(u
_colormode(u.0uc(uself(u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�s	(iii(u
startswithulenuTurtleGraphicsErrorutuple(uselfucstrucl((ucstruselfu-/usr/local/python-3.2/lib/python3.2/turtle.pyu_color�s#cCsS|dkr|jS|dkr1t|�|_n|dkrOt|�|_ndS(uqReturn 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)
        >>> pencolor(240,160,80)
        g�?i�N(uNoneu
_colormodeufloatuint(uselfucmode((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	colormode�scCs2x+|jD] }|j|j�|j�q
WdS(u�Reset all Turtles on the Screen to their initial state.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.reset()
        N(u_turtlesu_setmodeu_modeureset(uselfuturtle((u-/usr/local/python-3.2/lib/python3.2/turtle.pyureset�scCs|jS(u�Return the list of turtles on the screen.

        Example (for a TurtleScreen instance named screen):
        >>> screen.turtles()
        [<turtle.Turtle object at 0x00E11FB0>]
        (u_turtles(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuturtles�scGsO|r|j|�}nd}|j|�}|dk	rK|j|�}n|S(u�Set 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(u	_colorstruNoneu_bgcoloru_color(uselfuargsucolor((u-/usr/local/python-3.2/lib/python3.2/turtle.pyubgcolor�scCsc|dkr|jSt|�|_d|_|dk	rIt|�|_n|jr_|j�ndS(ueTurns 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(uNoneu_tracinguintu_updatecounteru_delayvalueuupdate(uselfunudelay((u-/usr/local/python-3.2/lib/python3.2/turtle.pyutracer�s		cCs&|dkr|jSt|�|_dS(u� 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(uNoneu_delayvalueuint(uselfudelay((u-/usr/local/python-3.2/lib/python3.2/turtle.pyudelay�scCsRtjsdt_t�n|jdkrN|jd7_|j|j;_ndS(uIncrement upadate counter.iiNT(uTurtleScreenu_RUNNINGuTrueu	_RUNNNINGu
Terminatoru_tracingu_updatecounter(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
_incrementudcs			cCsT|j}d|_x(|j�D]}|j�|j�qW||_|j�dS(u'Perform a TurtleScreen update.
        NT(u_tracinguTrueuturtlesu_update_datau_drawturtleu_update(uselfutracingut((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuupdate
s		
	cCs|j�dS(u� Return the width of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_width()
        640
        i(u_window_size(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuwindow_widthscCs|j�dS(u� Return the height of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_height()
        480
        i(u_window_size(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
window_heightscCs|jS(u�Return the Canvas of this TurtleScreen.

        No argument.

        Example (for a Screen instance named screen):
        >>> cv = screen.getcanvas()
        >>> cv
        <turtle.ScrolledCanvas instance at 0x010742D8>
        (ucv(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	getcanvas's
cCst|jj��S(u�Return 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']
        (usortedu_shapesukeys(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	getshapes3s	icCs|j|||�dS(u�Bind 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)

        >>> screen.onclick(goto)
        >>> # Subsequently clicking into the TurtleScreen will
        >>> # make the turtle move to the clicked point.
        >>> screen.onclick(None)
        N(u_onscreenclick(uselfufunubtnuadd((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuonclick>scCsg|dkr1||jkrS|jj|�qSn"||jkrS|jj|�n|j||�dS(umBind 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):

        >>> 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(uNoneu_keysuremoveuappendu
_onkeyrelease(uselfufunukey((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuonkeyOscCss|dkr1||jkr_|jj|�q_n.|dk	r_||jkr_|jj|�n|j||�dS(uBind fun to key-press event of key if key is given,
        or to any key-press-event if no key is given.

        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.onkeypress(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, or by keeping pressed the up-arrow key.
        consequently drawing a hexagon.
        N(uNoneu_keysuremoveuappendu_onkeypress(uselfufunukey((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
onkeypressmscCs|j�dS(uSet 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(u_listen(uselfuxdummyuydummy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyulisten�s
icCs|j||�dS(u�Install 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(u_ontimer(uselfufunut((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuontimer�scCsb|dkr|jS||jkr;|j|�|j|<n|j|j|j|�||_dS(uFSet 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 corresponding 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(uNoneu
_bgpicnameu_bgpicsu_imageu	_setbgpicu_bgpic(uselfupicname((u-/usr/local/python-3.2/lib/python3.2/turtle.pyubgpic�scCs|j|||�S(u�Resize 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-tuple, 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 ;-)
        (u_resize(uselfu	canvwidthu
canvheightubg((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
screensize�sNT(&u__name__u
__module__u__doc__uTrueu_RUNNINGu_CFGu__init__uclearuNoneumodeusetworldcoordinatesuregister_shapeu	_colorstru_coloru	colormodeuresetuturtlesubgcolorutracerudelayu
_incrementudcuupdateuwindow_widthu
window_heightu	getcanvasu	getshapesuonclickuonkeyu
onkeypressulistenuontimerubgpicu
screensizeu
onscreenclickuresetscreenuclearscreenuaddshapeuonkeyrelease(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuTurtleScreen�sD
	"	'#																 cBs�|EeZdZiedd�d6edd�d6edd�d6ZdZdZdZed�Zd	�Z	d%d
�Zd�Zdd
�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd%d�Zd�Zd�Zd�Zd%d�Zd%d�Zd�Zd �Z d%d%d!�Z!dd"�Z"d%d%d#�Z#d%d$�Z$eZ%eZ&eZ'eZ(eZ)eZ*eZ+eZ,e Z-d%S(&uRNavigation part of the RawTurtle.
    Implements methods for turtle movement.
    g�?gustandarduworldulogoiicCs[|j|_|j|_||_d|_|j�d|_|j|�t	j
|�dS(N(uDEFAULT_ANGLEOFFSETu_angleOffsetuDEFAULT_ANGLEORIENTu_angleOrientu_modeuNoneu
undobufferudegreesu_setmodeu
TNavigatorureset(uselfumode((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__�s		
	
cCs)tdd�|_tj|j|_dS(uXreset turtle to its initial values

        Will be overwritten by parent class
        gN(uVec2Du	_positionu
TNavigatoruSTART_ORIENTATIONu_modeu_orient(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyureset�scCsj|dkr|jS|dkr#dS||_|d	krMd|_d|_n|jd|_d
|_dS(u:Set turtle-mode to 'standard', 'world' or 'logo'.
        ustandardulogouworldNiig@(ustandardulogouworld(ustandarduworldi����(uNoneu_modeu_angleOffsetu_angleOrientu_fullcircle(uselfumode((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_setmode�s		cCsB||_d||_|jdkr1d|_n
|d|_dS(u+Helper function for degrees() and radians()ihustandardig@N(u_fullcircleu
_degreesPerAUu_modeu_angleOffset(uselfu
fullcircle((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_setDegreesPerAUs
	
g�v@cCs|j|�dS(u> 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

        Change angle measurement unit to grad (also known as gon,
        grade, or gradian and equals 1/100-th of the right angle.)
        >>> turtle.degrees(400.0)
        >>> turtle.heading()
        100

        N(u_setDegreesPerAU(uselfu
fullcircle((u-/usr/local/python-3.2/lib/python3.2/turtle.pyudegreesscCs|jdtj�dS(u 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(u_setDegreesPerAUumathupi(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuradians-scCs%|j|j|}|j|�dS(u)move turtle forward by specified distanceN(u	_positionu_orientu_goto(uselfudistanceuende((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_go;scCs&||j9}|jj|�|_dS(u=Turn turtle counterclockwise by specified angle if angle > 0.N(u
_degreesPerAUu_orienturotate(uselfuangle((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_rotate@s
cCs
||_dS(umove turtle to position end.N(u	_position(uselfuend((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_gotoEscCs|j|�dS(uMove 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(u_go(uselfudistance((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuforwardIscCs|j|�dS(u�Move 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(u_go(uselfudistance((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuback`scCs|j|�dS(u�Turn 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(u_rotate(uselfuangle((u-/usr/local/python-3.2/lib/python3.2/turtle.pyurighttscCs|j|�dS(u�Turn 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(u_rotate(uselfuangle((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuleft�scCs|jS(u�Return 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)
        (u	_position(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyupos�scCs|jdS(u� 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(u	_position(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuxcor�scCs|jdS(u	 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(u	_position(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuycor�scCs<|dkr"|jt|��n|jt||��dS(utMove 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(uNoneu_gotouVec2D(uselfuxuy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyugoto�scCs!|jdd�|jd�dS(u$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(ugotou
setheading(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuhome�scCs!|jt||jd��dS(u�Set 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(u_gotouVec2Du	_position(uselfux((u-/usr/local/python-3.2/lib/python3.2/turtle.pyusetx�scCs!|jt|jd|��dS(u�Set 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(u_gotouVec2Du	_position(uselfuy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyusetyscCs�|dk	rt||�}nt|t�r6|}n9t|t�rTt|�}nt|t�ro|j}nt||j�S(u�Return 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(uNoneuVec2Du
isinstanceutupleu
TNavigatoru	_positionuabs(uselfuxuyupos((u-/usr/local/python-3.2/lib/python3.2/turtle.pyudistances	cCs�|dk	rt||�}nt|t�r6|}n9t|t�rTt|�}nt|t�ro|j}n||j\}}ttj||�dtj	d�d}||j
}|j|j||j
S(uCReturn 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
        g�f@i
g�v@N(uNoneuVec2Du
isinstanceutupleu
TNavigatoru	_positionuroundumathuatan2upiu
_degreesPerAUu_angleOffsetu_angleOrientu_fullcircle(uselfuxuyuposuresult((u-/usr/local/python-3.2/lib/python3.2/turtle.pyutowards=s	*
cCs_|j\}}ttj||�dtjd�d}||j}|j|j||jS(u� Return the turtle's current heading.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(67)
        >>> turtle.heading()
        67.0
        g�f@i
g�v@(	u_orienturoundumathuatan2upiu
_degreesPerAUu_angleOffsetu_angleOrientu_fullcircle(uselfuxuyuresult((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuheading`s
*
cCsK||j�|j}|j}||d||d}|j|�dS(u�Set 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(uheadingu_angleOrientu_fullcircleu_rotate(uselfuto_angleuangleufull((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
setheadingos	cCs�|jr+|jjdg�d|j_n|j�}|dkrO|j}n|dkr�t|�|j}dtt	dt|�dd�|�}nd||}d|}d|t
j|t
jd	|j
�}|d
kr|||}}}n|j�}	|j�}
|d
kr:|jd
d
�n
|jd
�|j|�xHt|�D]:}|j|�|j|�|jd
�|j|�qaW|j|�|d
kr�|j|	|
�n|j|�|jr�d
|j_ndS(u� 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
        useqiig@g�M@g�?g�?g@g�f@iNTF(u
undobufferupushuTrueucumulateuspeeduNoneu_fullcircleuabsuintuminumathusinupiu
_degreesPerAUu_traceru_delayu_rotateurangeu_gouFalse(uselfuradiusuextentustepsuspeedufracuwuw2ulutrudlui((u-/usr/local/python-3.2/lib/python3.2/turtle.pyucircle�s>	.
)





	cCsdS(u/dummy method - to be overwritten by child classN((uselfus((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuspeed�scCsdS(u/dummy method - to be overwritten by child classN((uselfuaub((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_tracer�scCsdS(u/dummy method - to be overwritten by child classN((uselfun((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_delay�sN(.u__name__u
__module__u__doc__uVec2DuSTART_ORIENTATIONuDEFAULT_MODEuDEFAULT_ANGLEOFFSETuDEFAULT_ANGLEORIENTu__init__uresetuNoneu_setmodeu_setDegreesPerAUudegreesuradiansu_gou_rotateu_gotouforwardubackurightuleftuposuxcoruycorugotouhomeusetxusetyudistanceutowardsuheadingu
setheadingucircleuspeedu_traceru_delayufdubkubackwardurtultupositionusetposusetpositionuseth(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
TNavigator�sZ

												
		#			 #		Au
TNavigatorcBs|EeZdZedd�Zededd�Zdd�Zdd�Zd�Z	d	�Z
d
�Zdd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zdd�Zdd�Zddd�Zd�Zd�ZeZe	Ze	Ze
Ze
ZeZeZ dS(uFDrawing part of the RawTurtle.
    Implements drawing properties.
    u
resizemodecCs#||_d|_tj|�dS(N(u_resizemodeuNoneu
undobufferuTPenu_reset(uselfu
resizemode((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__�s		upencoloru	fillcolorcCsgd|_d|_||_||_d|_d|_d|_d|_d|_	d|_
d|_dS(Niig�?gT(g�?g�?(g�?ggg�?(u_pensizeuTrueu_shownu	_pencoloru
_fillcoloru_drawingu_speedu_stretchfactoru_shearfactoru_tiltu_shapetrafou
_outlinewidth(uselfupencoloru	fillcolor((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_reset�s										cCsB|dkr|jS|j�}|dkr>|jd|�ndS(uzSet 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'
        uautouuserunoresizeu
resizemodeN(uautouuserunoresize(uNoneu_resizemodeulowerupen(uselfurmode((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
resizemode�s
cCs'|dkr|jS|jd|�dS(u!Set 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
        upensizeN(uNoneu_pensizeupen(uselfuwidth((u-/usr/local/python-3.2/lib/python3.2/turtle.pyupensizescCs!|js
dS|jdd�dS(u�Pull the pen up -- no drawing when moving.

        Aliases: penup | pu | up

        No argument

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        NupendownF(u_drawingupenuFalse(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyupenup(s
	cCs!|jr
dS|jdd�dS(u�Pull the pen down -- drawing when moving.

        Aliases: pendown | pd | down

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.pendown()
        NupendownT(u_drawingupenuTrue(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyupendown6s
	cCs|jS(uReturn 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
        (u_drawing(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuisdownDs
cCs�idd6dd6dd6dd6d	d
6}|dkr<|jS||krU||}n7d|koldknr�tt|��}nd}|jd
|�dS(u� 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)
        iufastesti
ufastiunormaliuslowiuslowestg�?g%@uspeedN(uNoneu_speeduinturoundupen(uselfuspeeduspeeds((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuspeedSs)
cGs�|r�t|�}|dkr/|d}}n4|dkrJ|\}}n|dkrc|}}n|j|�}|j|�}|jd|d|�n"|j|j�|j|j�fSdS(u�Return 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')
        iiiiupencoloru	fillcolorN(ulenu	_colorstrupenu_coloru	_pencoloru
_fillcolor(uselfuargsulupcolorufcolor((u-/usr/local/python-3.2/lib/python3.2/turtle.pyucolorys 
cGsO|r;|j|�}||jkr(dS|jd|�n|j|j�SdS(uZ 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'
        Nupencolor(u	_colorstru	_pencolorupenu_color(uselfuargsucolor((u-/usr/local/python-3.2/lib/python3.2/turtle.pyupencolor�scGsO|r;|j|�}||jkr(dS|jd|�n|j|j�SdS(u] 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)
        Nu	fillcolor(u	_colorstru
_fillcolorupenu_color(uselfuargsucolor((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	fillcolor�scCs|jdd�dS(u�Makes the turtle visible.

        Aliases: showturtle | st

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> turtle.showturtle()
        ushownNT(upenuTrue(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
showturtle�scCs|jdd�dS(uYMakes 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()
        ushownNF(upenuFalse(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
hideturtle�scCs|jS(u�Return 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
        (u_shown(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	isvisible
	s
c
Ks�i|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd	6|j	d
6|j
d6}|p}|s�|St|t�r�|}ni}|j
|�i}x|D]}||||<q�W|jr�|jjd|f�nd}d|kr'|j|dkr'd}q'nd|kr�t|dt�rc|j|df�|d<n|j|dkr�d}q�nd|kr�|j|dkr�d}q�n|r�|j�nd|kr�|d|_nd|kr�|d|_nd|kr|d|_nd|kr`t|dt�rP|j|df�|d<n|d|_nd|kr||d|_nd|kr�|d|_nd|kr�|d}t|ttf�r�||f}n||_nd	|kr�|d	|_nd
|kr|d
|_	nd|kr2|d|_nd|krN|d|_
nd|ksrd|ksrd	|kr�|j\}	}
|j}tj|j
�tj|j
�}}
|	|
|
||
||	||
|
||f|_n|j�d
S(uLReturn 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)
           "shearfactor":   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, 'shearfactor': 0.0}
        >>> 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, 'shearfactor': 0.0}
        >>> 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, 'shearfactor': 0.0}
        ushownupendownupencoloru	fillcolorupensizeuspeedu
resizemodeu
stretchfactorushearfactoruoutlineutiltupenNFT(u_shownu_drawingu	_pencoloru
_fillcoloru_pensizeu_speedu_resizemodeu_stretchfactoru_shearfactoru
_outlinewidthu_tiltu
isinstanceudictuupdateu
undobufferupushuFalseuTrueutupleu	_colorstru_newLineuintufloatumathusinucosu_shapetrafou_update(uselfupenupendictu_pdupu_p_bufukeyunewLineusfuscxuscyushfusauca((u-/usr/local/python-3.2/lib/python3.2/turtle.pyupen	s�/










	

	

$	%#cCsdS(u/dummy method - to be overwritten by child classN((uselfuusePos((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_newLine�	scCsdS(u/dummy method - to be overwritten by child classN((uselfucountuforced((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_update�	scCsdS(u/dummy method - to be overwritten by child classN((uselfuargs((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_color�	scCsdS(u/dummy method - to be overwritten by child classN((uselfuargs((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	_colorstr�	sNTF(!u__name__u
__module__u__doc__u_CFGu__init__u_resetuNoneu
resizemodeupensizeupenupupendownuisdownuspeeducolorupencoloru	fillcoloru
showturtleu
hideturtleu	isvisibleupenuTrueu_newLineuFalseu_updateu_coloru	_colorstruwidthuupupuupdudownustuht(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuTPen�s8

			&	.	%	$	
				uTPencBs&|EeZdZd�Zd�ZdS(u6Helper class: Datatype to store Turtle attributes
    cCs#||_d|_|j|�dS(N(uscreenuNoneu_typeu	_setshape(uselfuscreenu
shapeIndex((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__�	s		cs\|j�||_|jdko6�j|jknr?dS|jdkoc�j|jknrldS|jdkr��j|j�n3|jdkr�x!|jD]}�j|�q�Wn�j|j|_|jdkr��j�|_nc|jdkr#�j�jdj�|_n5|jdkrX�fd��j|jD�|_ndS(Nupolygonuimageucompoundublankcsg|]}�j��qS((u_createpoly(u.0uitem(uscreen(u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�	s	(uimageupolygon(	uscreenu
shapeIndexu_typeu_shapesu_deleteu_itemu_createpolyu_createimageu_data(uselfu
shapeIndexuitem((uscreenu-/usr/local/python-3.2/lib/python3.2/turtle.pyu	_setshape�	s&		))N(u__name__u
__module__u__doc__u__init__u	_setshape(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_TurtleImage�	s
	u_TurtleImagecBsE|EeZdZgZd:edededd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d:d:d�Zd
�Zd�Zd�Zd�Zd:d�Zd:d:d:d�Zd:d�Zd�Zd:d�Zd�Zd:d:d:d:d�Zd�Zd�Zd;d�Zd�Zd�Zd�Z d�Z!d:d�Z"d �Z#d!�Z$d"�Z%d<d#�Z'd$�Z(d%�Z)d&�Z*d:d'�Z+d(�Z,d;d)d=d-�Z-d.�Z.d/�Z/d0�Z0d1�Z1d2�Z2e2Z3d:d3�Z4d4d:d5�Z5d4d:d6�Z6d4d:d7�Z7d8�Z8d9�Z9eZ:d:S(>uvAnimation part of the RawTurtle.
    Puts RawTurtle upon a TurtleScreen and provides tools for
    its animation.
    ushapeuundobuffersizeuvisiblecCs�t|t�r||_n�t|t�rX|tjkrLtjj|�n||_nzt|ttf�r�xbtjD]"}|j	|krw||_PqwqwWt|�|_tjj|j�nt
d|��|j}tj||j
��tj|�|jj|�|j�|_t||�|_d|_d|_d|_|_||_d|_|j�|_|jg|_|jg|_g|_ ||_!t"|�|_#|j$�dS(Nubad cavas argument %sF(%u
isinstanceu_ScreenuscreenuTurtleScreenu	RawTurtleuscreensuappenduScrolledCanvasuCanvasucvuTurtleGraphicsErroru
TNavigatoru__init__umodeuTPenu_turtlesu_createlineudrawingLineItemu_TurtleImageuturtleuNoneu_polyuFalseu
_creatingPolyu	_fillitemu	_fillpathu_shownu_hidden_from_screenucurrentLineItemu	_positionucurrentLineuitemsu
stampItemsu_undobuffersizeuTbufferu
undobufferu_update(uselfucanvasushapeuundobuffersizeuvisibleuscreen((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__�	s@		
						cCs<tj|�tj|�|j�|j�|j�dS(u�Delete 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(u
TNavigatoruresetuTPenu_resetu_clearu_drawturtleu_update(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyureset�	s




cCs+|dkrd|_nt|�|_dS(u�Set 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(uNoneu
undobufferuTbuffer(uselfusize((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
setundobuffer
scCs |jdkrdS|jj�S(u�Return count of entries in the undobuffer.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> while undobufferentries():
        ...     undo()
        iN(u
undobufferuNoneunr_of_items(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuundobufferentries$
s	cCs�d|_|_x!|jD]}|jj|�qW|jj�|_g|_|j	rn|jj
|j�n|jg|_|j�|j
|j�dS(uDelete all of pen's drawingsN(uNoneu	_fillitemu	_fillpathuitemsuscreenu_deleteu_createlineucurrentLineItemucurrentLineu_drawinguappendu	_positionuclearstampsu
setundobufferu_undobuffersize(uselfuitem((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_clear1
s		
cCs|j�|j�dS(ugDelete 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(u_clearu_update(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuclear?
s
cCsd|jj�|jjdkr#dSt|j�dkr`|jj|j|j|j|j�ndS(Nii(	uscreenu
_incrementudcu_updatecounterulenucurrentLineu	_drawlineucurrentLineItemu	_pencoloru_pensize(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_update_dataN
s
cCs�|j}|jdkrdS|jdkr\|j�|j�|j�|j|j�nG|j�|jdkr�x|j�D]}|j�q�W|j�ndS(u&Perform a Turtle-data update.
        iNi(	uscreenu_tracingu_update_datau_drawturtleu_updateu_delayu_delayvalueu_updatecounteruturtles(uselfuscreenut((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_updateV
s	



cCs|jj||�S(umTurns 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
        (uscreenutracer(uselfuflagudelay((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_tracerh
scCs|jj|�S(N(uscreenu_color(uselfuargs((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_color}
scCs|jj|�S(N(uscreenu	_colorstr(uselfuargs((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	_colorstr�
scCs�t|t�r|Sy|\}}}Wntdt|���YnX|jjdkr~d�|||fD�\}}}nd|ko�dkno�d|ko�dkno�d|ko�dkns�tdt|���nd|||fS(u,Convert colortriples to hexstrings.
        ubad color arguments: %sg�?cSs g|]}td|��qS(g�o@(uround(u.0ux((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�
s	ii�ubad color sequence: %su
#%02x%02x%02x(u
isinstanceustruTurtleGraphicsErroruscreenu
_colormode(uselfuargsurugub((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_cc�
s%Tcs@|j�|j|j�|j}d|_d|_t|�}�|_||_�|_t�|jj�|_�jj	|��j
|jjj}|dkr��j�|j_
ni|dkr��j�j
dj�|j_
n;|dkr#�fd��j
|jjjD�|j_
n�j�|_|j�|S(uCreate 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()
        upolygonuimageublankucompoundcsg|]}�j��qS((u_createpoly(u.0uitem(uscreen(u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�
s	N(uscreenu_newLineu_drawinguturtleuNoneudeepcopyu_TurtleImageu
shapeIndexu_turtlesuappendu_shapesu_typeu_createpolyu_itemu_createimageu_datau_createlineucurrentLineItemu_update(uselfuturtleuquttype((uscreenu-/usr/local/python-3.2/lib/python3.2/turtle.pyuclone�
s,							"#
cCs\|dkr|jjS||jj�kr>td|��n|jj|�|j�dS(u�Set 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'
        uThere is no shape named %sN(uNoneuturtleu
shapeIndexuscreenu	getshapesuTurtleGraphicsErroru	_setshapeu_update(uselfuname((u-/usr/local/python-3.2/lib/python3.2/turtle.pyushape�
s
c
Cs||ko"|ko"dknrF|j\}}|||jfS|dks^|dkrmtd��n|dk	r�|dkr�||f}q�||f}n+|dk	r�|jd|f}n	|j}|dkr�|j}n|jddd|d|�dS(uPSet/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)
        iu(stretch_wid/stretch_len must not be zerou
resizemodeuuseru
stretchfactoruoutlineN(uNoneu_stretchfactoru
_outlinewidthuTurtleGraphicsErrorupen(uselfustretch_widustretch_lenuoutlineu
stretchfactor((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	shapesize�
s '	cCs-|dkr|jS|jddd|�dS(u�Set or return the current shearfactor.

        Optional argument: shear -- number, tangent of the shear angle

        Shear the turtleshape according to the given shearfactor shear,
        which is the tangent of the shear angle. DO NOT change the
        turtle's heading (direction of movement).
        If shear is not given: return the current shearfactor, i. e. the
        tangent of the shear angle, by which lines parallel to the
        heading of the turtle are sheared.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.shearfactor(0.5)
        >>> turtle.shearfactor()
        >>> 0.5
        u
resizemodeuuserushearfactorN(uNoneu_shearfactorupen(uselfushear((u-/usr/local/python-3.2/lib/python3.2/turtle.pyushearfactor�
scCsK||j|j}|tjddtj}|jddd|�dS(uIRotate the turtleshape to point in the specified direction

        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)
        g�f@iu
resizemodeuuserutiltN(u
_degreesPerAUu_angleOrientumathupiupen(uselfuangleutilt((u-/usr/local/python-3.2/lib/python3.2/turtle.pyusettiltanglescCsK|dkr:|jdtj|j}||j|jS|j|�dS(u�Set or return the current tilt-angle.

        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).
        If angle is not given: 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).

        Deprecated since Python 3.1

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(45)
        >>> turtle.tiltangle()
        g�f@N(uNoneu_tiltumathupiu_angleOrientu
_degreesPerAUu_fullcircleusettiltangle(uselfuangleutilt((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	tiltangle,scCs|j||j��dS(u�Rotate 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(usettiltangleu	tiltangle(uselfuangle((u-/usr/local/python-3.2/lib/python3.2/turtle.pyutiltFsc	Cs�||ko-|ko-|ko-dknr9|jS|j\}}}}|dk	rc|}n|dk	rx|}n|dk	r�|}n|dk	r�|}n||||dkr�td��n||||f|_tj||�dtj}	tj|	�tj|	�}
}|||
||||
||
||||
|||f\}}
}}||f|_|
||_	|	|_
|j�dS(u�Set or return the current transformation matrix of the turtle shape.

        Optional arguments: t11, t12, t21, t22 -- numbers.

        If none of the matrix elements are given, return the transformation
        matrix.
        Otherwise set the given elements and transform the turtleshape
        according to the matrix consisting of first row t11, t12 and
        second row t21, 22.
        Modify stretchfactor, shearfactor and tiltangle according to the
        given matrix.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapesize(4,2)
        >>> turtle.shearfactor(-0.5)
        >>> turtle.shapetransform()
        (4.0, -1.0, -0.0, 2.0)
        iu0Bad shape transform matrix: must not be singulariN(uNoneu_shapetrafouTurtleGraphicsErrorumathuatan2upiusinucosu_stretchfactoru_shearfactoru_tiltu_update(uselfut11ut12ut21ut22um11um12um21um22ualfausaucaua11ua12ua21ua22((u-/usr/local/python-3.2/lib/python3.2/turtle.pyushapetransformYs,2				0
	cs~|j�|j\��|j\��t���j�j�}dt|�|\�������fd�|D�S(ulComputes transformed polygon shapes from a shape
        according to current position and heading.
        g�?csQg|]G\}}��|�|�j��|�|�jf�qS((uxscaleuyscale(u.0uxuy(ue0ue1up0up1uscreen(u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�s	(uscreenu	_positionu_orientuVec2Duyscaleuxscaleuabs(uselfupolyue((ue0ue1up0up1uscreenu-/usr/local/python-3.2/lib/python3.2/turtle.pyu
_polytrafo�s	cCsE|jj|jj}|jdkrA|j|j|jdk�SdS(u@Return the current shape polygon as tuple of coordinate pairs.

        No argument.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapetransform(4, -1, 0, 2)
        >>> turtle.get_shapepoly()
        ((50, -20), (30, 20), (-50, 20), (-30, -20))

        upolygonucompoundN(uscreenu_shapesuturtleu
shapeIndexu_typeu
_getshapepolyu_data(uselfushape((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
get_shapepoly�scs�|jdks|r-|j\����nY|jdkrstd|jd�}|dd|f\����n|jdkr�|St����fd�|D��S(u`Calculate transformed shape polygon according to resizemode
        and shapetransform.
        uuseruautoig@iunoresizecs:g|]0\}}�|�|�|�|f�qS(((u.0uxuy(ut11ut12ut21ut22(u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�s	(u_resizemodeu_shapetrafoumaxu_pensizeutuple(uselfupolygonucompoundul((ut11ut12ut21ut22u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
_getshapepoly�s!cCsv|j}|j|jj}|j}|jj}|jr�|jdkr�|jdkr�d|_
|j}|dkr|jdkr�d}n$|jdkr�|j
}n	|j}|j|j|��}|j|j}}|j||d|d|d|d	d�qr|d
kr-|j||j|�qr|dkrrx�t||�D]m\}	\}
}}|j|j|
d��}
|j|	|
d|j|�d|j|�d|jd	d�qIWqrn�|j
r�dS|dkr�|j|dddfd
d
�nn|d
kr*|j||j|jdj�n?|dkrix0|D]%}	|j|	dddfd
d
�q=Wnd|_
dS(upManages the correct rendering of the turtle with respect to
        its shape, resizemode, stretch and tilt etc.iupolygonunoresizeiuautoufilluoutlineuwidthutopuimageucompoundNuublankFT(ii(ii(ii(ii(ii(ii(uscreenu_shapesuturtleu
shapeIndexu_typeu_itemu_shownu_updatecounteru_tracinguFalseu_hidden_from_screenu_datau_resizemodeu_pensizeu
_outlinewidthu
_polytrafou
_getshapepolyu
_fillcoloru	_pencoloru	_drawpolyuTrueu
_drawimageu	_positionuzipu_cc(uselfuscreenushapeuttypeutitemutshapeuwufcuocuitemupoly((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_drawturtle�sF		'				%)	"
&cCs|j}|j|jj}|j}|j}|dkr�|j�}|jdkr^d}n$|jdkry|j}n	|j	}|j
|j|��}|j|j
}}|j||d|d|d|dd
�n|d	kr|jd
�}|j||j|�n�|dkr�g}x'|D]}	|j�}
|j|
�q%Wt|�}x�t||�D]m\}
\}}}|j
|j|d
��}|j|
|d|j|�d|j|�d|j	dd
�qdWn|jj|�|jjd|f�|S(u�Stamp 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)
        upolygonunoresizeiuautoufilluoutlineuwidthutopuimageuucompoundustampT(uscreenu_shapesuturtleu
shapeIndexu_typeu_datau_createpolyu_resizemodeu_pensizeu
_outlinewidthu
_polytrafou
_getshapepolyu
_fillcoloru	_pencoloru	_drawpolyuTrueu_createimageu
_drawimageu	_positionuappendutupleuzipu_ccu
stampItemsu
undobufferupush(uselfuscreenushapeuttypeutshapeustitemuwufcuocuelementuitemupoly((u-/usr/local/python-3.2/lib/python3.2/turtle.pyustamp�s>					
%&cCs||jkret|t�rBx1|D]}|jj|�q%Wn|jj|�|jj|�nd|f}|j}||jkr�dS|jj|�}|jj|�||j	kr�|j	d|j
|_	n|jj|j	d|j
dg�dS(u9does the work for clearstamp() and clearstamps()
        ustampNi(
u
stampItemsu
isinstanceutupleuscreenu_deleteuremoveu
undobufferubufferuindexuptrubufsizeuinsertuNone(uselfustampidusubitemuitemubufuindex((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_clearstamps
	cCs|j|�|j�dS(uDDelete 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(u_clearstampu_update(uselfustampid((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
clearstamps
cCs�|dkr"|jdd�}n5|dkrD|jd|�}n|j|d�}x|D]}|j|�q^W|j�dS(u�Delete 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()
        Ni(uNoneu
stampItemsu_clearstampu_update(uselfunutoDeleteuitem((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuclearstamps%s
c
Csx|j|j|jt|jt�f}|j}d|j|||j|j	dd�|j
|j�|jdd�ff}|jr�|jj
|�n|j}|jr�|jdkr�||}|d|jd|d|jd}dt|ddd|j|j�}|d	|}	x�td|�D]s}
|
dkrOd}nd}||	|
|_|jr�|j|j||jf|j|j|�n|j�q4W|jr�|j|jddfd
dd|j�q�n|jr�|j	j|�nt|jt�r#|jj|�n||_|jrH|jj|�nt|j	�d
krj|j�n|j�dS(u�Move the pen to the point end, thereby drawing a line
        if pen is down. All other methodes for turtle movement depend
        on this one.
        ugoNiiig�?ig�������?g�?ufilluuwidthi*TF(ii(ii(u_drawingu	_pencoloru_pensizeu
isinstanceu	_fillpathulistuscreenu	_positionucurrentLineItemucurrentLineu
_pointlistuitemsu
undobufferupushu_speedu_tracinguxscaleuyscaleuinturangeuTrueuFalseu	_drawlineudrawingLineItemu_updateuappendu
_creatingPolyu_polyulenu_newLine(uselfuendugo_modesuscreenu
undo_entryustartudiffudiffsqunhopsudeltaunutop((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_gotoAsR			
(*						
cs�|\}}}}|\}}}}	|\}
}}�|j�t|j|�dkretd�n|
|_||_|ddgkr�d}
n|}
�j|
|d|
d|���fd�|jD�}x+|D]#}�j|�|jj	|�q�W|}|j
r5�jdkr5||}|d�jd	|d�j
d	}dt|dd
d|j
|j
�}|d|}x{td|�D]j}|dkr�d}nd}||||_|r��j|j||jf|||�n|j�q�W|r5�j|jddfddd|�q5n||_|jr�t|j�dkrl|jj�n|jgkr�d|_d|_q�n|	r�|jgkr�d|_td
�q�|jdk	r�|jj�q�n|j�dS(u)Reverse a _goto. Used for undo()
        g�?u$undogoto: HALLO-DA-STIMMT-WAS-NICHT!iuufilluwidthcs7g|]-}|�kr�j|�dkr|�qS(uline(u_type(u.0ui(uitemsuscreen(u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>�s	iiig�������?g�?uUnwahrscheinlich in _undogoto!N(ii(iiTF(ii(ii(uscreenuabsu	_positionuprintucurrentLineItemucurrentLineu	_drawlineuitemsu_deleteuremoveu_speedu_tracinguxscaleuyscaleuinturangeuTrueuFalseudrawingLineItemu_updateu
_creatingPolyulenu_polyupopuNoneu	_fillpath(uselfuentryuoldunewugo_modesucoodataudrawingupcupsufillingucLIucLupluusepcutodeleteuiustartudiffudiffsqunhopsudeltaunutop((uitemsuscreenu-/usr/local/python-3.2/lib/python3.2/turtle.pyu	_undogotovsb	
			


(*					
cCs�|jr(|jjd||jf�n||j9}|jj|�}|jj}|dkr�|jdkr�d|j}dtt	|�|�}d||}x6t
|�D]%}|jj|�|_|j�q�Wn||_|j�dS(u&Turns pen clockwise by angle.
        urotiig@g�?N(u
undobufferupushu
_degreesPerAUu_orienturotateuscreenu_tracingu_speeduintuabsurangeu_update(uselfuangleu	neworientutracinguanglevelustepsudeltau_((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_rotate�s	

	cCs�t|j�dkrb|jj|j|j|j|j�|jj�|_|jj	|j�n|jj|jdd�g|_|r�|jg|_ndS(u�Closes current line item and starts a new one.
           Remark: if current line became too long, animation
           performance (via _drawline) slowed down considerably.
        iutopNT(ulenucurrentLineuscreenu	_drawlineucurrentLineItemu	_pencoloru_pensizeu_createlineuitemsuappenduTrueu	_position(uselfuusePos((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_newLine�s	cCst|jt�S(uReturn fillstate (True if filling, False else).

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_fill()
        >>> if turtle.filling():
        ...     turtle.pensize(5)
        ... else:
        ...     turtle.pensize(3)
        (u
isinstanceu	_fillpathulist(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyufilling�scCs�|j�s4|jj�|_|jj|j�n|jg|_|j�|j	rr|j	j
d|jf�n|j�dS(uCalled just before drawing a shape to be filled.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        u	beginfillN(ufillinguscreenu_createpolyu	_fillitemuitemsuappendu	_positionu	_fillpathu_newLineu
undobufferupushu_update(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
begin_fill�s
	cCs�|j�r�t|j�dkrk|jj|j|jd|j�|jrk|jjd|jf�qknd|_|_|j
�ndS(uFill the shape drawn after the call begin_fill().

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        iufilludofillN(ufillingulenu	_fillpathuscreenu	_drawpolyu	_fillitemu
_fillcoloru
undobufferupushuNoneu_update(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuend_fill�s
	cGs�|stt|ttf�rF|j|�}|jt|jd�}q�|j}|s�|jt|jd�}q�n7|dkr�|jt|jd�}n|j|�}t|j	d�r
|j	j
|j||�}|jj
|�|jr�|jjd|f�q�n�|j�}|jrD|jjdg�d|j_nzT|j�dkrf|j�n|j�|j|�|j|�|jd�Wd|j|�X|jr�d	|j_ndS(
u�Draw 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)
        iu_dotudotusequautoiNTF(u
isinstanceustrutupleu	_colorstru_pensizeumaxu	_pencoloruNoneuhasattruscreenu_dotu	_positionuitemsuappendu
undobufferupushupenuTrueucumulateu
resizemodeuhtupendownupensizeupencoloruforwarduFalse(uselfusizeucoloruitemupen((u-/usr/local/python-3.2/lib/python3.2/turtle.pyudot
s:			



	cCs`|jj|j||||j�\}}|jj|�|jr\|jjd|f�n|S(u)Performs the writing for write()
        uwri(uscreenu_writeu	_positionu	_pencoloruitemsuappendu
undobufferupush(uselfutxtualignufontuitemuend((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_write@
s	uleftuArialiunormalcCs�|jr+|jjdg�d|j_n|jt|�|j�|�}|rw|j�\}}|j||�n|jr�d|j_ndS(u�Write 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)
        useqNTF(
u
undobufferupushuTrueucumulateu_writeustruloweruposusetposuFalse(uselfuargumoveualignufontuenduxuy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuwriteJ
s	!	cCs|jg|_d|_dS(uStart 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()
        NT(u	_positionu_polyuTrueu
_creatingPoly(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
begin_polyg
scCs
d|_dS(u7Stop 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()
        NF(uFalseu
_creatingPoly(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuend_polyu
scCs |jdk	rt|j�SdS(u�Return the lastly recorded polygon.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> p = turtle.get_poly()
        >>> turtle.register_shape("myFavouriteShape", p)
        N(u_polyuNoneutuple(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuget_poly�
s
cCs|jS(u�Return 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")
        (uscreen(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	getscreen�
scCs|S(uUReturn 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>]
        ((uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	getturtle�
scCs|jj|�S(uDSet delay value which determines speed of turtle animation.
        (uscreenudelay(uselfudelay((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_delay�
sicCs-|jj|jj|||�|j�dS(u�Bind 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(uscreenu_onclickuturtleu_itemu_update(uselfufunubtnuadd((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuonclick�
scCs-|jj|jj|||�|j�dS(u�Bind 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(uscreenu
_onreleaseuturtleu_itemu_update(uselfufunubtnuadd((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	onrelease�
scCs#|jj|jj|||�dS(u�Bind 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(uscreenu_ondraguturtleu_item(uselfufunubtnuadd((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuondrag�
scCs�|jdkrdS|dkrV|\}}|j|||j�|jj�}nG|dkr||d}|j|�n!|dkr�|j|�n|dkr�|d}|jj|�|j	j
|�n�|dkr|d}|jj|dddfd	d
dd
�n�|dkrm|d}d|_|_
||j	kr�|jj|�|j	j
|�q�n0|d
kr�tj||d�|jj�ndS(u2Does the main part of the work for undo()
        Nurotustampiugouwriudotudofillufilluuoutlineu	beginfillupen(uwriudot(ii(ii(ii(u
undobufferuNoneu_rotateu
_degreesPerAUupopu
clearstampu	_undogotouscreenu_deleteuitemsuremoveu	_drawpolyu	_fillitemu	_fillpathuTPenupen(uselfuactionudatauangleudegPAUudummyustitemuitem((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_undo�
s8



cCs�|jdkrdS|jj�}|d}|dd�}|dkr�xG|r~|j�}|j|d|dd��qKWn|j||�dS(u�undo (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()
        ...
        Niiuseq(u
undobufferuNoneupopu_undo(uselfuitemuactionudata((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuundos
	%NFT(uArialiunormal(;u__name__u
__module__u__doc__uscreensuNoneu_CFGu__init__uresetu
setundobufferuundobufferentriesu_clearuclearu_update_datau_updateu_traceru_coloru	_colorstru_ccucloneushapeu	shapesizeushearfactorusettiltangleu	tiltangleutiltushapetransformu
_polytrafou
get_shapepolyuFalseu
_getshapepolyu_drawturtleustampu_clearstampu
clearstampuclearstampsu_gotou	_undogotou_rotateuTrueu_newLineufillingu
begin_filluend_filludotu_writeuwriteu
begin_polyuend_polyuget_polyu	getscreenu	getturtleugetpenu_delayuonclicku	onreleaseuondragu_undouundou
turtlesize(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	RawTurtle�	sp
%			
								((		(		
	(	-			5	A				0	
		
	
			 	cCs%tjdkrt�t_ntjS(u�Return the singleton screen object.
    If none exists at the moment, create a new one and return it,
    else return the existing one.N(uTurtleu_screenuNoneu_Screen(((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuScreenBscBsv|EeZdZdZedZd�Zededededd�Zd�Z	d�Z
d	�Zd
�ZdS(utitlecCs�tjdkrKt�t_|_|jjtj�|jj|j�ntjdkr�t	d}t	d}t	d}t	d}t	d}t	d}|jj
||||�|jj�t_tj
|tj�|j||||�ndS(Nuwidthuheightu	canvwidthu
canvheightu	leftrightu	topbottom(u_Screenu_rootuNoneu_Rootutitleu_titleu	ondestroyu_destroyu_canvasu_CFGusetupcanvasu
_getcanvasuTurtleScreenu__init__usetup(uselfuwidthuheightu	canvwidthu
canvheightu	leftrightu	topbottom((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__Ps





uwidthuheightu	leftrightu	topbottomc	Cst|jd�sdS|jj�}|jj�}t|t�rld|koZdknrl||}n|dkr�||d}nt|t�r�d|ko�dknr�||}n|dkr�||d}n|jj||||�|j�dS(u 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
        uset_geometryNiii(	uhasattru_rootu	win_widthu
win_heightu
isinstanceufloatuNoneuset_geometryuupdate(uselfuwidthuheightustartxustartyuswush((u-/usr/local/python-3.2/lib/python3.2/turtle.pyusetupfs+
+
cCs/tjdk	r"tjj|�n|t_dS(uqSet 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(u_Screenu_rootuNoneutitleu_title(uselfutitlestring((u-/usr/local/python-3.2/lib/python3.2/turtle.pyutitle�s
cCsV|j}|tjkr?dt_dt_dt_dt_ndt_	|j
�dS(NT(u_rootu_ScreenuNoneuTurtleu_penu_screenu_canvasuTrueuTurtleScreenu_RUNNINGudestroy(uselfuroot((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_destroy�s					cCs|j�dS(u~Shut the turtlegraphics window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bye()
        N(u_destroy(uself((u-/usr/local/python-3.2/lib/python3.2/turtle.pyubye�scsX�fd�}�j|�tdr*dSyt�Wntk
rStd�YnXdS(ulGo 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()

        cs�j�dS(u&Screen.bye() with two dummy-parametersN(ubye(uxuy(uself(u-/usr/local/python-3.2/lib/python3.2/turtle.pyuexitGracefully�su
using_IDLENi(uonclicku_CFGumainloopuAttributeErroruexit(uselfuexitGracefully((uselfu-/usr/local/python-3.2/lib/python3.2/turtle.pyuexitonclick�s


N(
u__name__u
__module__uNoneu_rootu_canvasu_CFGu_titleu__init__usetuputitleu_destroyubyeuexitonclick(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_ScreenJs

	'		
	u_ScreencBs>|EeZdZdZdZedededd�ZdS(u�RawTurtle auto-creating (scrolled) canvas.

    When a Turtle object is created or a function derived from some
    Turtle method is called a TurtleScreen object is automatically created.
    ushapeuundobuffersizeuvisiblec	CsGtjdkrt�t_ntj|tjd|d|d|�dS(Nushapeuundobuffersizeuvisible(uTurtleu_screenuNoneuScreenu	RawTurtleu__init__(uselfushapeuundobuffersizeuvisible((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu__init__�sN(u__name__u
__module__u__doc__uNoneu_penu_screenu_CFGu__init__(u
__locals__((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuTurtle�s
cCs%tjdkrt�t_ntjS(u5Create the 'anonymous' turtle if not already present.N(uTurtleu_penuNone(((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_getpen�scCs%tjdkrt�t_ntjS(u-Create a TurtleScreen if not already present.N(uTurtleu_screenuNoneuScreen(((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
_getscreen�suturtle_docstringdictcCs6i}x+tD]#}d|}t|�j||<q
Wx+tD]#}d|}t|�j||<q;Wtd|d�}td�|j�D��}|jd�xD|dd
�D]2}|jd	t|��|jd
||�q�W|d}|jd	t|��|jd||�|jd�|j	�dS(u�Create and write docstring-dictionary to file.

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

    Has to be called explicitly, (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.
    u_Screen.uTurtle.u%s.pyuwcSs/g|]%}|jd�dtkr|�qS(u.i(usplitu_alias_list(u.0ux((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>s	udocsdict = {

Niu%s :
u        """%s
""",

u        """%s
"""

u}
i����i����(
u_tg_screen_functionsuevalu__doc__u_tg_turtle_functionsuopenusortedukeysuwriteurepruclose(ufilenameudocsdictu
methodnameukeyufukeys((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuwrite_docstringdict�s$






c
Csqdi|j�d6}t|�}|j}x>|D]6}y||t|�_Wq3td|�Yq3Xq3WdS(u�Read 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.
    u!turtle_docstringdict_%(language)sulanguageuBad docstring-entry: %sN(uloweru
__import__udocsdictuevalu__doc__uprint(ulangumodnameumoduleudocsdictukey((u-/usr/local/python-3.2/lib/python3.2/turtle.pyuread_docstringss	
uCannot find docsdict foru;Unknown Error when trying to import %s-docstring-dictionaryc
Cs<d}}tj|j�\}}}|dd�}|dd�}|jpQg}d�|D�}dgt|�t|�|}d�t||�D�}	|dk	r�|	jd|�|jd|�n|dk	r|	jd|�|jd|�ndj|	�}d	|}dj|�}d	|}||fS(
u?Get strings describing the arguments for the given object

    Returns a pair of strings representing function parameter lists
    including parenthesis.  The first string is suitable for use in
    function definition and the second is suitable for use in function
    call.  The "self" parameter is not included.
    uiNcSsg|]}d|f�qS(u=%r((u.0uvalue((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>As	cSs g|]\}}||�qS(((u.0uargudflt((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu
<listcomp>Cs	u*u**u, u(%s)(	uinspectugetargsu__code__u__defaults__ulenuzipuNoneuappendujoin(
uobudefTextucallTextuargsuvarargsuvarkwuitems2urealArgsudefaultsuitems1((u-/usr/local/python-3.2/lib/python3.2/turtle.pyugetmethparlist1s&
!

cCseddl}|dkrdStd}|jd|d�}|jd|�}|jd|�}|S(u<To reduce docstrings from RawTurtle class for functions
    iNu
exampleturtleu%s.uu \(.+ %s\):u:(ureuNoneu_CFGureplaceucompileusub(udocstrureu
turtlenameu	newdocstruparexp((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_turtle_docrevisePs
cCseddl}|dkrdStd}|jd|d�}|jd|�}|jd|�}|S(u?To reduce docstrings from TurtleScreen class for functions
    iNu
examplescreenu%s.uu \(.+ %s\):u:(ureuNoneu_CFGureplaceucompileusub(udocstrureu
screennameu	newdocstruparexp((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu_screen_docrevise\s
u_Screen.uu>>>>>>u6def %(key)s%(pl1)s: return _getscreen().%(key)s%(pl2)sukeyupl1upl2uTurtle.u3def %(key)s%(pl1)s: return _getpen().%(key)s%(pl2)su__main__cCst�rt�nt�dS(N(uisdownupuupd(((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu	switchpen�s	
cCs�t�td�t�td�t�td�x�td�D]}|dkr\t�nx(td�D]}t	d�t
d�qiW|dkr�td�t�nt�t	d�t�q@Wtd	�td
�td�t�td�t	d�td�t	d�td�t�tdd	�td
d	�td�x<td�D].}t	d�t
d�t	d�td�qRWtd�t�x<td�D].}t	d�t
d�t	d�td�q�Wt�dS(uDemo of old turtle.py - moduleidiiiiiZumarooniiublacki�u
startstartustarturediNTF(uresetutraceruTrueuupubackwardudownuwidthurangeu
begin_filluforwarduleftucoloruend_filluFalseurightuwrite(uiu_((u-/usr/local/python-3.2/lib/python3.2/turtle.pyudemo1�sX

























cCsItd�t�td�ttdd��tdd�d}td�x(td�D]}t�t	|d�qXWt
d�xt�r�t�q�Wt
�td�td	�d}td
�td�td�x�td,d
�D]�}|dkrt�td	d|dd|�nx(td�D]}t|�td�q+Wt�|d7}td�tt�dd�q�Wtd�t�td�td�t�tdd�td�t�x?td�D]1}t	dd�td�td�td�q�Wt�td�t�td�t�td�t�}|jd�t�}|jd�|jd�|j
�|jd�|jd�|j�|jdd�|jd�|j�|jd�|jdd�|jd�|jd�tt|��d}x�|j|�dkr�|jd�|jd�|j|j|��|jd�|d dkr�|j �|j �t�n|d7}qW|j
d!d"d-d%d&�|jd'�|jd�d(�}t!j"d�x!t�r|j�|j�q�W|jd�|j
d)d"d.�|j#|d�d+S(/uDemo of some new features.iiig@iZii
uwait a moment...i�ugreeni�iiiixiiFiureduyellowii2uturtleuautoii(iublueuorangeg@g333333�?iuCAUGHT! ufontuArialuboldualignurightublackcSst�t�dS(N(uclearscreenubye(uxdummyuydummy((u-/usr/local/python-3.2/lib/python3.2/turtle.pyubabasu  Click me!uCourierNi����(uArialiubold(uCourieriubold($uspeedustupensizeu
setheadingutowardsudistanceurturangeu	switchpenucircleuwriteuundobufferentriesuundouresetultu	colormodeupencoloru
begin_fillu	fillcolorufduend_fillupuupducolorushapeu	getturtleu
resizemodeuTurtleuleftuupugotoudownustamputimeusleepuonclick(uradiusu_ulaengeuiutriuturtleucountubaba((u-/usr/local/python-3.2/lib/python3.2/turtle.pyudemo2�s�






















	
	


















	


(Ou__doc__u_verutkinteruTKutypesumathutimeuosuinspectuos.pathuisfileusplitujoinucopyudeepcopyusimpledialogu_tg_classesu_tg_screen_functionsu_tg_turtle_functionsu
_tg_utilitiesu__all__u_alias_listuNoneuTrueuFalseu_CFGuconfig_dictu
readconfiguprintutupleuVec2Du__methodDictu	__methodsu__stringBodyu__forwardmethodsuFrameuScrolledCanvasuCanvasuTku_RootuobjectuTurtleScreenBaseu	Exceptionu
TerminatoruTurtleGraphicsErroruShapeuTbufferuTurtleScreenu
TNavigatoruTPenu_TurtleImageu	RawTurtleuRawPenuScreenu_ScreenuTurtleuPenu_getpenu
_getscreenuwrite_docstringdicturead_docstringsu	_LANGUAGEuImportErrorugetmethparlistu_turtle_docreviseu_screen_docreviseu
methodnameuevalupl1upl2udefstruexecumainloopudoneu__name__u	switchpenudemo1udemo2uexitonclick(((u-/usr/local/python-3.2/lib/python3.2/turtle.pyu<module>es	

		4	
	c	��	/&��%��������y	�		"	


			

&

&		5	c
© 2025 GrazzMean