Author terry.reedy
Recipients Lita.Cho, Ramchandra Apte, ezio.melotti, jesstess, kbk, ned.deily, orsenthil, rhettinger, ronaldoussoren, terry.reedy
Date 2014-07-29.00:27:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I agree with skipping 2.7. The current patch is based on importing turtledemo, while on 2.7, is in Demo/turtle/ and cannot be imported. It could run with execfile, but the viewer will only run if /turtle is the current directory. On Windows, this would still be useless as the 2.7 installer does not install Demo or anything therein. When turtleDemo is installed, the location is system dependent. An extended version of the new checker extension, #21880, would allow users to configure 'run turtledemo' to work on a system that has it.

The patch works fine on Windows, including not blocking other actions with Idle. The only change I might make is
   cmd = [sys.executable, '-m', 'turtledemo']
which is more readable and does the same as the current version. But see below. (Lita, don't make a new patch for this or anything else in this message.)

The main remaining demo viewer fix is font re-sizing, #21933, which I expect we should finish within a week.

'Run turtledemo' should go on the Run menu, along with other 'run <external program>' menu items.  The Run menu is easily enabled in the Shell window by adding '("run", "_Run"),' to menu_specs before options (line 842). However, putting the entry where it would belong, after Run Module, means that the addition has to be delayed until after the ScriptBinding extension is loaded. That would be done most easily as part of loading the checker extension #21880.  The open_turtle_demo function would be moved and perhaps generalized.

The change to make turtledemo run properly in a subprocess on Mac appears to be a separate issue from adding it to Idle's menu. I presume that if turtledemo.__main__ is loaded into Idle, and run with F5, as I have been doing, there is the same problem (on a Mac). I would guess that the same would be true of any tkinter app run in a subprocess from Idle. How about non-gui apps that are not mac-aware? If any of these are true, the fix would be generally useful outside of turtledemo and would seem to belong somewhere in the tkinter package.  (Is the same true for some of maxosxSupport).

If the activate code is moved to macosxSupport.activate(), does the following work in EditorWindow.open_turtle_demo?
cmd = [sys.executable, '-c',
  'from idlelib.macosxSupport import activate as A; A()\n'
  'from turtledemo.__main__ import main; main()']
Does the activate code have to be called after, say, the tkinter import in turtledemo, or is anytime in the process ok?  While something like this is not needed to run turtledemo, which we can edit, it would be to run tkinter (or mac-unaware gui apps) that we cannot edit.
Date User Action Args
2014-07-29 00:27:34terry.reedysetrecipients: + terry.reedy, rhettinger, kbk, ronaldoussoren, orsenthil, ned.deily, ezio.melotti, jesstess, Ramchandra Apte, Lita.Cho
2014-07-29 00:27:32terry.reedysetmessageid: <>
2014-07-29 00:27:32terry.reedylinkissue17172 messages
2014-07-29 00:27:31terry.reedycreate