Issue #21882: In turtle demos, remove module scope gui and sys calls by

either deleting or moving to the module's main function.
This commit is contained in:
Terry Jan Reedy 2014-06-30 16:09:24 -04:00
parent 98b6391fd4
commit f5ac57dc05
7 changed files with 48 additions and 58 deletions

View file

@ -143,7 +143,6 @@ class NimView(object):
self.writer.write(msg1, align="center", font=("Courier",14,"bold"))
self.screen.tracer(True)
def setup(self):
self.screen.tracer(False)
for row in range(3):
@ -181,6 +180,7 @@ class NimView(object):
if self.game.state == Nim.OVER:
self.screen.clear()
class NimController(object):
def __init__(self, game):
@ -201,6 +201,7 @@ class NimController(object):
self.game.model.notify_move(row, col)
self.BUSY = False
class Nim(object):
CREATED = 0
RUNNING = 1
@ -213,11 +214,10 @@ class Nim(object):
self.controller = NimController(self)
mainscreen = turtle.Screen()
mainscreen.mode("standard")
mainscreen.setup(SCREENWIDTH, SCREENHEIGHT)
def main():
mainscreen = turtle.Screen()
mainscreen.mode("standard")
mainscreen.setup(SCREENWIDTH, SCREENHEIGHT)
nim = Nim(mainscreen)
return "EVENTLOOP!"