[Idle-dev] Merging VIDLE differences into idlelib

Ned Deily nad at acm.org
Tue Aug 4 19:55:24 CEST 2009


In article 
<ac2200130908040625qac2c52bg8946ae26e40e15ec at mail.gmail.com>,
 Guilherme Polo <ggpolo at gmail.com> wrote:
> I have verified the VIDLE fork last week expecting to find many
> differences between it and IDLE. Most files differ but it turned out
> that most of these differences are equivalent (many of the changes
> were merged already), except for two of them. One of these changes is
> related to py2app, so I can't verify it.

[...]

> Index: Lib/idlelib/macosxSupport.py
> ===================================================================
> --- Lib/idlelib/macosxSupport.py	(revision 74191)
> +++ Lib/idlelib/macosxSupport.py	(working copy)
> @@ -9,7 +9,7 @@
>      """
>      Returns True if Python is running from within an app on OSX.
>      If so, assume that Python was built with Aqua Tcl/Tk rather than
> -    X11 Tck/Tk.
> +    X11 Tcl/Tk.
>      """
>      return (sys.platform == 'darwin' and '.app' in sys.executable)
> 
> @@ -121,6 +121,13 @@
>                          menu.add_command(label=label, underline=underline,
>                          command=command, accelerator=accelerator)
> 
> +def preprocessArguments():
> +    # Deal with spurious argument passed by Finder, so "argv emulation" is
> +    # not required for app bundle
> +    argv = sys.argv
> +    if runningAsOSXApp() and len(argv) > 1 and argv[1].startswith("-psn"):
> +        del sys.argv[1]
> +
>  def setupApp(root, flist):
>      """
>      Perform setup for the OSX application bundle.

This isn't needed as there already is similar code in 
Mac/IDLE/idlemain.py, an initialization script that gets invoked when 
IDLE.app is launched and that goes on to call idlelib.Pyshell.main.  
(BTW, this has nothing to do with py2app which is not used by IDLE or 
anything else in the standard library.)

-- 
 Ned Deily,
 nad at acm.org



More information about the IDLE-dev mailing list