mirror of
https://github.com/python/cpython.git
synced 2025-08-19 08:11:46 +00:00
Merged revisions 69816 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r69816 | mark.dickinson | 2009-02-20 20:42:53 +0000 (Fri, 20 Feb 2009) | 2 lines Issue #5295: Typos in turtle.py ........
This commit is contained in:
parent
1718b47328
commit
58a5cbde5e
1 changed files with 21 additions and 21 deletions
|
@ -38,7 +38,7 @@ pictures can easily be drawn.
|
||||||
----- turtle.py
|
----- turtle.py
|
||||||
|
|
||||||
This module is an extended reimplementation of turtle.py from the
|
This module is an extended reimplementation of turtle.py from the
|
||||||
Python standard distribution up to Python 2.5. (See: http:\\www.python.org)
|
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%
|
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
|
compatible with it. This means in the first place to enable the
|
||||||
|
@ -54,8 +54,8 @@ Roughly it has the following features added:
|
||||||
|
|
||||||
- Different turtle shapes, gif-images as turtle shapes, user defined
|
- Different turtle shapes, gif-images as turtle shapes, user defined
|
||||||
and user controllable turtle shapes, among them compound
|
and user controllable turtle shapes, among them compound
|
||||||
(multicolored) shapes. Turtle shapes can be stgretched and tilted, which
|
(multicolored) shapes. Turtle shapes can be stretched and tilted, which
|
||||||
makes turtles zu very versatile geometrical objects.
|
makes turtles very versatile geometrical objects.
|
||||||
|
|
||||||
- Fine control over turtle movement and screen updates via delay(),
|
- Fine control over turtle movement and screen updates via delay(),
|
||||||
and enhanced tracer() and speed() methods.
|
and enhanced tracer() and speed() methods.
|
||||||
|
@ -64,7 +64,7 @@ Roughly it has the following features added:
|
||||||
following the early Logo traditions. This reduces the boring work of
|
following the early Logo traditions. This reduces the boring work of
|
||||||
typing long sequences of commands, which often occur in a natural way
|
typing long sequences of commands, which often occur in a natural way
|
||||||
when kids try to program fancy pictures on their first encounter with
|
when kids try to program fancy pictures on their first encounter with
|
||||||
turtle graphcis.
|
turtle graphics.
|
||||||
|
|
||||||
- Turtles now have an undo()-method with configurable undo-buffer.
|
- Turtles now have an undo()-method with configurable undo-buffer.
|
||||||
|
|
||||||
|
@ -91,8 +91,8 @@ Roughly it has the following features added:
|
||||||
|
|
||||||
- If configured appropriately the module reads in docstrings from a docstring
|
- If configured appropriately the module reads in docstrings from a docstring
|
||||||
dictionary in some different language, supplied separately and replaces
|
dictionary in some different language, supplied separately and replaces
|
||||||
the english ones by those read in. There is a utility function
|
the English ones by those read in. There is a utility function
|
||||||
write_docstringdict() to write a dictionary with the original (english)
|
write_docstringdict() to write a dictionary with the original (English)
|
||||||
docstrings to disc, so it can serve as a template for translations.
|
docstrings to disc, so it can serve as a template for translations.
|
||||||
|
|
||||||
Behind the scenes there are some features included with possible
|
Behind the scenes there are some features included with possible
|
||||||
|
@ -299,7 +299,7 @@ class Vec2D(tuple):
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
### From here up to line : Tkinter - Interface for turtle.py ###
|
### From here up to line : Tkinter - Interface for turtle.py ###
|
||||||
### May be replaced by an interface to some different graphcis-toolkit ###
|
### May be replaced by an interface to some different graphics toolkit ###
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
## helper functions for Scrolled Canvas, to forward Canvas-methods
|
## helper functions for Scrolled Canvas, to forward Canvas-methods
|
||||||
|
@ -382,7 +382,7 @@ class ScrolledCanvas(TK.Frame):
|
||||||
self._rootwindow.bind('<Configure>', self.onResize)
|
self._rootwindow.bind('<Configure>', self.onResize)
|
||||||
|
|
||||||
def reset(self, canvwidth=None, canvheight=None, bg = None):
|
def reset(self, canvwidth=None, canvheight=None, bg = None):
|
||||||
"""Ajust canvas and scrollbars according to given canvas size."""
|
"""Adjust canvas and scrollbars according to given canvas size."""
|
||||||
if canvwidth:
|
if canvwidth:
|
||||||
self.canvwidth = canvwidth
|
self.canvwidth = canvwidth
|
||||||
if canvheight:
|
if canvheight:
|
||||||
|
@ -777,7 +777,7 @@ class TurtleScreenBase(object):
|
||||||
self.cv.coords(item, *newcoordlist)
|
self.cv.coords(item, *newcoordlist)
|
||||||
|
|
||||||
def _resize(self, canvwidth=None, canvheight=None, bg=None):
|
def _resize(self, canvwidth=None, canvheight=None, bg=None):
|
||||||
"""Resize the canvas, the turtles are drawing on. Does
|
"""Resize the canvas the turtles are drawing on. Does
|
||||||
not alter the drawing window.
|
not alter the drawing window.
|
||||||
"""
|
"""
|
||||||
# needs amendment
|
# needs amendment
|
||||||
|
@ -952,7 +952,7 @@ class TurtleScreen(TurtleScreenBase):
|
||||||
def clear(self):
|
def clear(self):
|
||||||
"""Delete all drawings and all turtles from the TurtleScreen.
|
"""Delete all drawings and all turtles from the TurtleScreen.
|
||||||
|
|
||||||
Reset empty TurtleScreen to it's initial state: white background,
|
Reset empty TurtleScreen to its initial state: white background,
|
||||||
no backgroundimage, no eventbindings and tracing on.
|
no backgroundimage, no eventbindings and tracing on.
|
||||||
|
|
||||||
No argument.
|
No argument.
|
||||||
|
@ -1318,7 +1318,7 @@ class TurtleScreen(TurtleScreenBase):
|
||||||
fun -- a function with no arguments
|
fun -- a function with no arguments
|
||||||
key -- a string: key (e.g. "a") or key-symbol (e.g. "space")
|
key -- a string: key (e.g. "a") or key-symbol (e.g. "space")
|
||||||
|
|
||||||
In order ro be able to register key-events, TurtleScreen
|
In order to be able to register key-events, TurtleScreen
|
||||||
must have focus. (See method listen.)
|
must have focus. (See method listen.)
|
||||||
|
|
||||||
Example (for a TurtleScreen instance named screen
|
Example (for a TurtleScreen instance named screen
|
||||||
|
@ -1400,7 +1400,7 @@ class TurtleScreen(TurtleScreenBase):
|
||||||
self._bgpicname = picname
|
self._bgpicname = picname
|
||||||
|
|
||||||
def screensize(self, canvwidth=None, canvheight=None, bg=None):
|
def screensize(self, canvwidth=None, canvheight=None, bg=None):
|
||||||
"""Resize the canvas, the turtles are drawing on.
|
"""Resize the canvas the turtles are drawing on.
|
||||||
|
|
||||||
Optional arguments:
|
Optional arguments:
|
||||||
canvwidth -- positive integer, new width of canvas in pixels
|
canvwidth -- positive integer, new width of canvas in pixels
|
||||||
|
@ -1693,8 +1693,8 @@ class TNavigator(object):
|
||||||
|
|
||||||
No arguments.
|
No arguments.
|
||||||
|
|
||||||
Move turtle to the origin - coordinates (0,0) and set it's
|
Move turtle to the origin - coordinates (0,0) and set its
|
||||||
heading to it's start-orientation (which depends on mode).
|
heading to its start-orientation (which depends on mode).
|
||||||
|
|
||||||
Example (for a Turtle instance named turtle):
|
Example (for a Turtle instance named turtle):
|
||||||
>>> turtle.home()
|
>>> turtle.home()
|
||||||
|
@ -2266,7 +2266,7 @@ class TPen(object):
|
||||||
"outline" : positive number
|
"outline" : positive number
|
||||||
"tilt" : number
|
"tilt" : number
|
||||||
|
|
||||||
This dicionary can be used as argument for a subsequent
|
This dictionary can be used as argument for a subsequent
|
||||||
pen()-call to restore the former pen-state. Moreover one
|
pen()-call to restore the former pen-state. Moreover one
|
||||||
or more of these attributes can be provided as keyword-arguments.
|
or more of these attributes can be provided as keyword-arguments.
|
||||||
This can be used to set several pen attributes in one statement.
|
This can be used to set several pen attributes in one statement.
|
||||||
|
@ -2414,7 +2414,7 @@ class _TurtleImage(object):
|
||||||
class RawTurtle(TPen, TNavigator):
|
class RawTurtle(TPen, TNavigator):
|
||||||
"""Animation part of the RawTurtle.
|
"""Animation part of the RawTurtle.
|
||||||
Puts RawTurtle upon a TurtleScreen and provides tools for
|
Puts RawTurtle upon a TurtleScreen and provides tools for
|
||||||
it's animation.
|
its animation.
|
||||||
"""
|
"""
|
||||||
screens = []
|
screens = []
|
||||||
|
|
||||||
|
@ -2459,7 +2459,7 @@ class RawTurtle(TPen, TNavigator):
|
||||||
self._update()
|
self._update()
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
"""Delete the turtle's drawings and restore it's default values.
|
"""Delete the turtle's drawings and restore its default values.
|
||||||
|
|
||||||
No argument.
|
No argument.
|
||||||
,
|
,
|
||||||
|
@ -2749,7 +2749,7 @@ class RawTurtle(TPen, TNavigator):
|
||||||
|
|
||||||
Return the current tilt-angle, i. e. the angle between the
|
Return the current tilt-angle, i. e. the angle between the
|
||||||
orientation of the turtleshape and the heading of the turtle
|
orientation of the turtleshape and the heading of the turtle
|
||||||
(it's direction of movement).
|
(its direction of movement).
|
||||||
|
|
||||||
Examples (for a Turtle instance named turtle):
|
Examples (for a Turtle instance named turtle):
|
||||||
>>> turtle.shape("circle")
|
>>> turtle.shape("circle")
|
||||||
|
@ -2794,7 +2794,7 @@ class RawTurtle(TPen, TNavigator):
|
||||||
|
|
||||||
def _drawturtle(self):
|
def _drawturtle(self):
|
||||||
"""Manages the correct rendering of the turtle with respect to
|
"""Manages the correct rendering of the turtle with respect to
|
||||||
it's shape, resizemode, strech and tilt etc."""
|
its shape, resizemode, strech and tilt etc."""
|
||||||
screen = self.screen
|
screen = self.screen
|
||||||
shape = screen._shapes[self.turtle.shapeIndex]
|
shape = screen._shapes[self.turtle.shapeIndex]
|
||||||
ttype = shape._type
|
ttype = shape._type
|
||||||
|
@ -2848,7 +2848,7 @@ class RawTurtle(TPen, TNavigator):
|
||||||
############################## stamp stuff ###############################
|
############################## stamp stuff ###############################
|
||||||
|
|
||||||
def stamp(self):
|
def stamp(self):
|
||||||
"""Stamp a copy of the turtleshape onto the canvas and return it's id.
|
"""Stamp a copy of the turtleshape onto the canvas and return its id.
|
||||||
|
|
||||||
No argument.
|
No argument.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue