MCPcopy Index your code
hub / github.com/python/cpython / startDemo

Method startDemo

Lib/turtledemo/__main__.py:345–372  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

343 self.state = READY
344
345 def startDemo(self):
346 self.refreshCanvas()
347 self.dirty = True
348 turtle.TurtleScreen._RUNNING = True
349 self.configGUI(DISABLED, NORMAL, DISABLED,
350 "demo running...", "black")
351 self.screen.clear()
352 self.screen.mode("standard")
353 self.state = RUNNING
354
355 try:
356 result = self.module.main()
357 if result == "EVENTLOOP":
358 self.state = EVENTDRIVEN
359 else:
360 self.state = DONE
361 except turtle.Terminator:
362 if self.root is None:
363 return
364 self.state = DONE
365 result = "stopped!"
366 if self.state == DONE:
367 self.configGUI(NORMAL, DISABLED, NORMAL,
368 result)
369 elif self.state == EVENTDRIVEN:
370 self.exitflag = True
371 self.configGUI(DISABLED, NORMAL, DISABLED,
372 "use mouse/keys or STOP", "red")
373
374 def clearCanvas(self):
375 self.refreshCanvas()

Callers

nothing calls this directly

Calls 5

refreshCanvasMethod · 0.95
configGUIMethod · 0.95
clearMethod · 0.45
modeMethod · 0.45
mainMethod · 0.45

Tested by

no test coverage detected