[Pythonmac-SIG] PythonLauncher - first stab available

Tony Lownds tony@lownds.com
Tue, 30 Jul 2002 14:43:44 -0700


Hi Jack,

>I would like people to check it out and comment on the 
>functionality, interface, etc.

Here are some quick notes, before I leave on vacation (returning at 
end of August).

- My .py files already had a preferential application; PythonLauncher 
didn't get called when I tried clicking for the first time. Unless 
PythonLauncher can magically take care of enforcing a preference, 
perhaps the following blurb could be added to the readme:

Users of Python.app in previous versions of Python should use the 
Finder to create the association between .py files and 
PythonLauncher. Do this by selecting a .py file, choose the "Show 
Info" menu option under the "File" menu, and make the change in the 
"Open with Application" pane. Click the "Change All" button and apply 
it to all files with extension "py".

- Is the File > New menu item one of the menu options that will be 
removed? If not I don't really understand what it does.

- One way to do the terminal window bit is to make a temporary file 
named something.command then using the "open" command:

def run_in_terminal(interpreter, script, args):
   # untested.
   filename = '/tmp/RunPythonInTerminal.command'
   handle = open(filename, 'w')
   handle.write('''#!/bin/sh
     exec %s %s %s
     ''' % (interpreter, script, ' '.join(args)))
   handle.close()
   os.system("open "+filename)

- Are the preferences stored in a per-user area? I didn't get a 
chance to search thoroughly.

>If PythonLauncher wasn't running it does its thing for one script and exits.
>If it was manually started before a dialog is presented where the user
>can set the options to use, etc.

Since one can option-click to open the interactive dialog, and there 
is a menu item to open the interactive dialog, I'd suggest dropping 
the modal behavior described above. Basically, double-clicking should 
always do the same thing.

Thanks,
-Tony