Whitespace normalization.

This commit is contained in:
Tim Peters 2006-05-18 02:06:40 +00:00
parent b89316fdbf
commit fd4c419332
2 changed files with 12 additions and 12 deletions

View file

@ -754,11 +754,11 @@ def setup(**geometry):
Setting either width or height to None before drawing will force Setting either width or height to None before drawing will force
use of default geometry as in older versions of turtle.py use of default geometry as in older versions of turtle.py
startx: starting position in pixels from the left edge of the screen. startx: starting position in pixels from the left edge of the screen.
Default is to center window. Setting startx to None is the default Default is to center window. Setting startx to None is the default
and centers window horizontally on screen. and centers window horizontally on screen.
starty: starting position in pixels from the top edge of the screen. starty: starting position in pixels from the top edge of the screen.
Default is to center window. Setting starty to None is the default Default is to center window. Setting starty to None is the default
and centers window vertically on screen. and centers window vertically on screen.
@ -776,7 +776,7 @@ def setup(**geometry):
forces use of default geometry as in older versions of turtle.py forces use of default geometry as in older versions of turtle.py
""" """
global _width, _height, _startx, _starty global _width, _height, _startx, _starty
width = geometry.get('width',_width) width = geometry.get('width',_width)
@ -790,7 +790,7 @@ def setup(**geometry):
_height = height _height = height
else: else:
raise ValueError, "height can not be less than 0" raise ValueError, "height can not be less than 0"
startx = geometry.get('startx', _startx) startx = geometry.get('startx', _startx)
if startx >= 0 or startx == None: if startx >= 0 or startx == None:
_startx = _startx _startx = _startx
@ -813,7 +813,7 @@ def setup(**geometry):
# center window on screen # center window on screen
if _startx is None: if _startx is None:
_startx = (_root.winfo_screenwidth() - _width) / 2 _startx = (_root.winfo_screenwidth() - _width) / 2
if _starty is None: if _starty is None:
_starty = (_root.winfo_screenheight() - _height) / 2 _starty = (_root.winfo_screenheight() - _height) / 2
@ -827,7 +827,7 @@ def title(title):
Example: Example:
>>> title("My Window") >>> title("My Window")
""" """
global _title global _title
_title = title _title = title
@ -904,10 +904,10 @@ def demo2():
pendown = True pendown = True
circle(r,10) circle(r,10)
sleep(2) sleep(2)
reset() reset()
left(90) left(90)
# draw a series of triangles # draw a series of triangles
l = 10 l = 10
color("green") color("green")
@ -936,7 +936,7 @@ def demo2():
forward(90) forward(90)
color("red") color("red")
speed('fastest') speed('fastest')
down(); down();
# create a second turtle and make the original pursue and catch it # create a second turtle and make the original pursue and catch it
turtle=Turtle() turtle=Turtle()
@ -963,7 +963,7 @@ def demo2():
forward(4) forward(4)
write("CAUGHT! ", move=True) write("CAUGHT! ", move=True)
if __name__ == '__main__': if __name__ == '__main__':
from time import sleep from time import sleep

View file

@ -132,7 +132,7 @@ def _group(s, monetary=False):
def format(percent, value, grouping=False, monetary=False, *additional): def format(percent, value, grouping=False, monetary=False, *additional):
"""Returns the locale-aware substitution of a %? specifier """Returns the locale-aware substitution of a %? specifier
(percent). (percent).
additional is for format strings which contain one or more additional is for format strings which contain one or more
'*' modifiers.""" '*' modifiers."""
# this is only for one-percent-specifier strings and this should be checked # this is only for one-percent-specifier strings and this should be checked