On 9/12/05, Bob Ippolito <[EMAIL PROTECTED]> wrote:
Patches accepted at http://sourceforge.net/projects/python :)

I don't know where the packagemaker configuration file is, but here's a step toward something that would work in postflight:

#!/bin/sh

dialogText="Version 2.4.1 of python has now been installed in /usr/local/bin.  You probably want to use this new version as the default python, so that other python-using programs will find it instead of the built-in version.  I can take care of this by putting /usr/local/bin/ at the front of your shell path.  Should I do this for you?"
osascriptOutput=`/usr/bin/mktemp /tmp/osascript_XXXXXXXXX`
osascript >$osascriptOutput <<appleScriptEnd
on display_message_dialog()
    try
        tell application "Finder" to display dialog "$dialogText"
    on error errMsg number errnum
        if errnum is -128 then --If user canceled
            return 0
        else
            error errMsg
        end if
    end try
    return 1
end display_message_dialog

tell application "Finder" to activate
set dialogResult to display_message_dialog()
tell application "Terminal" to activate

return dialogResult
appleScriptEnd

shouldInsertIntoPath=`cat $osascriptOutput`
if [ $shouldInsertIntoPath = 1 ]; then
    # user hit OK, now mangle their startup scripts
    echo got yes!
fi

(obviously I left out the part where we actually modify the user's .profile, .bash_profile, .cshrc, and/or .tcshrc, but I thought that this bit of applescript hackery could help someone along the way)

--
// jack
// http://www.nuthole.com
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to