mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
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:
parent
98b6391fd4
commit
f5ac57dc05
7 changed files with 48 additions and 58 deletions
|
@ -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!"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue