From 32f5d8f1b153be33be42df82eb0f04c42006db54 Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Wed, 7 Jun 2006 19:02:03 +0000 Subject: Move Mac/OSX/* one level up --- Mac/Extras.ReadMe.txt | 5 + Mac/Extras.install.py | 54 ++ Mac/Icons/Disk Image.icns | Bin 0 -> 50703 bytes Mac/Icons/IDLE.icns | Bin 0 -> 53456 bytes Mac/Icons/Python Folder.icns | Bin 0 -> 133608 bytes Mac/Icons/PythonCompiled.icns | Bin 0 -> 60777 bytes Mac/Icons/PythonLauncher.icns | Bin 0 -> 42658 bytes Mac/Icons/PythonSource.icns | Bin 0 -> 54522 bytes Mac/Icons/ReadMe.txt | 3 + Mac/Makefile.in | 251 +++++ Mac/OSX/BuildScript/README.txt | 35 - Mac/OSX/BuildScript/build-installer.py | 1014 -------------------- Mac/OSX/BuildScript/ncurses-5.5.patch | 36 - Mac/OSX/BuildScript/resources/ReadMe.txt | 31 - Mac/OSX/BuildScript/resources/Welcome.rtf | 15 - Mac/OSX/BuildScript/resources/background.jpg | Bin 45421 -> 0 bytes .../BuildScript/scripts/postflight.documentation | 12 - Mac/OSX/BuildScript/scripts/postflight.framework | 33 - .../BuildScript/scripts/postflight.patch-profile | 71 -- .../HelpIndexingTool/Help_Indexing_Tool_Suite.py | 110 --- .../HelpIndexingTool/Miscellaneous_Standards.py | 49 - Mac/OSX/Doc/HelpIndexingTool/Required_Suite.py | 32 - Mac/OSX/Doc/HelpIndexingTool/Standard_Suite.py | 343 ------- Mac/OSX/Doc/HelpIndexingTool/__init__.py | 78 -- Mac/OSX/Doc/HelpIndexingTool/odds_and_ends.py | 49 - Mac/OSX/Doc/README | 35 - Mac/OSX/Doc/setup.py | 214 ----- Mac/OSX/Extras.ReadMe.txt | 5 - Mac/OSX/Extras.install.py | 54 -- Mac/OSX/IDLE/Info.plist | 55 -- Mac/OSX/IDLE/Makefile.in | 54 -- Mac/OSX/IDLE/config-extensions.def | 88 -- Mac/OSX/IDLE/config-main.def | 79 -- Mac/OSX/IDLE/idlemain.py | 27 - Mac/OSX/Icons/Disk Image.icns | Bin 50703 -> 0 bytes Mac/OSX/Icons/IDLE.icns | Bin 53456 -> 0 bytes Mac/OSX/Icons/Python Folder.icns | Bin 133608 -> 0 bytes Mac/OSX/Icons/PythonCompiled.icns | Bin 60777 -> 0 bytes Mac/OSX/Icons/PythonLauncher.icns | Bin 42658 -> 0 bytes Mac/OSX/Icons/PythonSource.icns | Bin 54522 -> 0 bytes Mac/OSX/Icons/ReadMe.txt | 3 - Mac/OSX/Makefile.in | 259 ----- Mac/OSX/PythonLauncher/English.lproj/Credits.rtf | 30 - .../English.lproj/MainMenu.nib/classes.nib | 12 - .../English.lproj/MainMenu.nib/info.nib | 21 - .../English.lproj/MainMenu.nib/objects.nib | Bin 5016 -> 0 bytes .../English.lproj/MyDocument.nib/classes.nib | 26 - .../English.lproj/MyDocument.nib/info.nib | 16 - .../English.lproj/MyDocument.nib/objects.nib | Bin 4845 -> 0 bytes .../English.lproj/PreferenceWindow.nib/classes.nib | 26 - .../English.lproj/PreferenceWindow.nib/info.nib | 16 - .../English.lproj/PreferenceWindow.nib/objects.nib | Bin 5882 -> 0 bytes Mac/OSX/PythonLauncher/FileSettings.h | 64 -- Mac/OSX/PythonLauncher/FileSettings.m | 298 ------ Mac/OSX/PythonLauncher/Info.plist | 65 -- Mac/OSX/PythonLauncher/Makefile.in | 78 -- Mac/OSX/PythonLauncher/MyAppDelegate.h | 15 - Mac/OSX/PythonLauncher/MyAppDelegate.m | 96 -- Mac/OSX/PythonLauncher/MyDocument.h | 41 - Mac/OSX/PythonLauncher/MyDocument.m | 175 ---- .../PreferenceWindow.nib/classes.nib | 26 - .../PythonLauncher/PreferenceWindow.nib/info.nib | 16 - .../PreferenceWindow.nib/objects.nib | Bin 5882 -> 0 bytes .../PythonLauncher/PreferencesWindowController.h | 38 - .../PythonLauncher/PreferencesWindowController.m | 121 --- Mac/OSX/PythonLauncher/doscript.h | 12 - Mac/OSX/PythonLauncher/doscript.m | 118 --- Mac/OSX/PythonLauncher/factorySettings.plist | 87 -- Mac/OSX/PythonLauncher/main.m | 17 - Mac/OSX/README | 167 ---- Mac/OSX/Tools/pythonw.c | 17 - Mac/OSX/fixapplepython23.py | 118 --- Mac/OSXResources/app/Info.plist | 60 -- Mac/OSXResources/app/PkgInfo | 1 - .../English.lproj/Documentation/PackageManager.gif | Bin 6087 -> 0 bytes .../English.lproj/Documentation/community.html | 69 -- .../English.lproj/Documentation/doc/index.html | 21 - .../English.lproj/Documentation/finder.html | 36 - .../Resources/English.lproj/Documentation/gui.html | 54 -- .../English.lproj/Documentation/ide/IDE.gif | Bin 10249 -> 0 bytes .../Documentation/ide/entering_in_new_window.gif | Bin 15578 -> 0 bytes .../Documentation/ide/hello_world.gif | Bin 15681 -> 0 bytes .../English.lproj/Documentation/ide/index.html | 222 ----- .../Documentation/ide/loading_ide.gif | Bin 50595 -> 0 bytes .../Documentation/ide/making_new_window.gif | Bin 25978 -> 0 bytes .../Documentation/ide/new_ide_window.gif | Bin 20606 -> 0 bytes .../Documentation/ide/new_window_made.gif | Bin 21808 -> 0 bytes .../Documentation/ide/output_window.gif | Bin 37660 -> 0 bytes .../Documentation/ide/saving_edited_file.gif | Bin 26559 -> 0 bytes .../Documentation/ide/simple_commands.gif | Bin 14134 -> 0 bytes .../Documentation/ide/syntax_error.gif | Bin 12850 -> 0 bytes .../English.lproj/Documentation/index.html | 51 - .../English.lproj/Documentation/intro.html | 76 -- .../English.lproj/Documentation/packman.html | 64 -- .../English.lproj/Documentation/python.gif | Bin 6389 -> 0 bytes .../English.lproj/Documentation/pythonsmall.gif | Bin 138 -> 0 bytes .../English.lproj/Documentation/scripting.html | 53 - .../English.lproj/Documentation/shell.html | 52 - .../app/Resources/English.lproj/InfoPlist.strings | Bin 656 -> 0 bytes Mac/OSXResources/app/Resources/PythonApplet.icns | Bin 63136 -> 0 bytes .../app/Resources/PythonInterpreter.icns | Bin 42658 -> 0 bytes .../framework/English.lproj/InfoPlist.strings | Bin 358 -> 0 bytes Mac/OSXResources/framework/Info.plist | 26 - Mac/OSXResources/framework/version.plist | 18 - Mac/OSXResources/iconsrc/IDE.psd | Bin 83876 -> 0 bytes Mac/OSXResources/iconsrc/PackageManager.psd | Bin 71056 -> 0 bytes Mac/OSXResources/iconsrc/PythonApplet.psd | Bin 41543 -> 0 bytes Mac/OSXResources/iconsrc/PythonCompiled.psd | Bin 76118 -> 0 bytes Mac/OSXResources/iconsrc/PythonIcon.psd | Bin 67236 -> 0 bytes Mac/OSXResources/iconsrc/PythonSource.psd | Bin 62075 -> 0 bytes Mac/OSXResources/iconsrc/PythonWSource.psd | Bin 64185 -> 0 bytes Mac/README | 167 ++++ Mac/Resources/app/Info.plist | 60 ++ Mac/Resources/app/PkgInfo | 1 + .../English.lproj/Documentation/PackageManager.gif | Bin 0 -> 6087 bytes .../English.lproj/Documentation/community.html | 69 ++ .../English.lproj/Documentation/doc/index.html | 21 + .../English.lproj/Documentation/finder.html | 36 + .../Resources/English.lproj/Documentation/gui.html | 54 ++ .../English.lproj/Documentation/ide/IDE.gif | Bin 0 -> 10249 bytes .../Documentation/ide/entering_in_new_window.gif | Bin 0 -> 15578 bytes .../Documentation/ide/hello_world.gif | Bin 0 -> 15681 bytes .../English.lproj/Documentation/ide/index.html | 222 +++++ .../Documentation/ide/loading_ide.gif | Bin 0 -> 50595 bytes .../Documentation/ide/making_new_window.gif | Bin 0 -> 25978 bytes .../Documentation/ide/new_ide_window.gif | Bin 0 -> 20606 bytes .../Documentation/ide/new_window_made.gif | Bin 0 -> 21808 bytes .../Documentation/ide/output_window.gif | Bin 0 -> 37660 bytes .../Documentation/ide/saving_edited_file.gif | Bin 0 -> 26559 bytes .../Documentation/ide/simple_commands.gif | Bin 0 -> 14134 bytes .../Documentation/ide/syntax_error.gif | Bin 0 -> 12850 bytes .../English.lproj/Documentation/index.html | 51 + .../English.lproj/Documentation/intro.html | 76 ++ .../English.lproj/Documentation/packman.html | 64 ++ .../English.lproj/Documentation/python.gif | Bin 0 -> 6389 bytes .../English.lproj/Documentation/pythonsmall.gif | Bin 0 -> 138 bytes .../English.lproj/Documentation/scripting.html | 53 + .../English.lproj/Documentation/shell.html | 52 + .../app/Resources/English.lproj/InfoPlist.strings | Bin 0 -> 656 bytes Mac/Resources/app/Resources/PythonApplet.icns | Bin 0 -> 63136 bytes Mac/Resources/app/Resources/PythonInterpreter.icns | Bin 0 -> 42658 bytes .../framework/English.lproj/InfoPlist.strings | Bin 0 -> 358 bytes Mac/Resources/framework/Info.plist | 26 + Mac/Resources/framework/version.plist | 18 + Mac/Resources/iconsrc/IDE.psd | Bin 0 -> 83876 bytes Mac/Resources/iconsrc/PackageManager.psd | Bin 0 -> 71056 bytes Mac/Resources/iconsrc/PythonApplet.psd | Bin 0 -> 41543 bytes Mac/Resources/iconsrc/PythonCompiled.psd | Bin 0 -> 76118 bytes Mac/Resources/iconsrc/PythonIcon.psd | Bin 0 -> 67236 bytes Mac/Resources/iconsrc/PythonSource.psd | Bin 0 -> 62075 bytes Mac/Resources/iconsrc/PythonWSource.psd | Bin 0 -> 64185 bytes 151 files changed, 1283 insertions(+), 5300 deletions(-) create mode 100644 Mac/Extras.ReadMe.txt create mode 100644 Mac/Extras.install.py create mode 100644 Mac/Icons/Disk Image.icns create mode 100644 Mac/Icons/IDLE.icns create mode 100644 Mac/Icons/Python Folder.icns create mode 100644 Mac/Icons/PythonCompiled.icns create mode 100644 Mac/Icons/PythonLauncher.icns create mode 100644 Mac/Icons/PythonSource.icns create mode 100644 Mac/Icons/ReadMe.txt create mode 100644 Mac/Makefile.in delete mode 100644 Mac/OSX/BuildScript/README.txt delete mode 100755 Mac/OSX/BuildScript/build-installer.py delete mode 100644 Mac/OSX/BuildScript/ncurses-5.5.patch delete mode 100644 Mac/OSX/BuildScript/resources/ReadMe.txt delete mode 100644 Mac/OSX/BuildScript/resources/Welcome.rtf delete mode 100644 Mac/OSX/BuildScript/resources/background.jpg delete mode 100755 Mac/OSX/BuildScript/scripts/postflight.documentation delete mode 100755 Mac/OSX/BuildScript/scripts/postflight.framework delete mode 100755 Mac/OSX/BuildScript/scripts/postflight.patch-profile delete mode 100644 Mac/OSX/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py delete mode 100644 Mac/OSX/Doc/HelpIndexingTool/Miscellaneous_Standards.py delete mode 100644 Mac/OSX/Doc/HelpIndexingTool/Required_Suite.py delete mode 100644 Mac/OSX/Doc/HelpIndexingTool/Standard_Suite.py delete mode 100644 Mac/OSX/Doc/HelpIndexingTool/__init__.py delete mode 100644 Mac/OSX/Doc/HelpIndexingTool/odds_and_ends.py delete mode 100644 Mac/OSX/Doc/README delete mode 100644 Mac/OSX/Doc/setup.py delete mode 100644 Mac/OSX/Extras.ReadMe.txt delete mode 100644 Mac/OSX/Extras.install.py delete mode 100644 Mac/OSX/IDLE/Info.plist delete mode 100644 Mac/OSX/IDLE/Makefile.in delete mode 100644 Mac/OSX/IDLE/config-extensions.def delete mode 100644 Mac/OSX/IDLE/config-main.def delete mode 100644 Mac/OSX/IDLE/idlemain.py delete mode 100644 Mac/OSX/Icons/Disk Image.icns delete mode 100644 Mac/OSX/Icons/IDLE.icns delete mode 100644 Mac/OSX/Icons/Python Folder.icns delete mode 100644 Mac/OSX/Icons/PythonCompiled.icns delete mode 100644 Mac/OSX/Icons/PythonLauncher.icns delete mode 100644 Mac/OSX/Icons/PythonSource.icns delete mode 100644 Mac/OSX/Icons/ReadMe.txt delete mode 100644 Mac/OSX/Makefile.in delete mode 100644 Mac/OSX/PythonLauncher/English.lproj/Credits.rtf delete mode 100644 Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/classes.nib delete mode 100644 Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/info.nib delete mode 100644 Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/objects.nib delete mode 100644 Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib delete mode 100644 Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib delete mode 100644 Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib delete mode 100644 Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/classes.nib delete mode 100644 Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/info.nib delete mode 100644 Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/objects.nib delete mode 100755 Mac/OSX/PythonLauncher/FileSettings.h delete mode 100755 Mac/OSX/PythonLauncher/FileSettings.m delete mode 100644 Mac/OSX/PythonLauncher/Info.plist delete mode 100644 Mac/OSX/PythonLauncher/Makefile.in delete mode 100644 Mac/OSX/PythonLauncher/MyAppDelegate.h delete mode 100644 Mac/OSX/PythonLauncher/MyAppDelegate.m delete mode 100755 Mac/OSX/PythonLauncher/MyDocument.h delete mode 100755 Mac/OSX/PythonLauncher/MyDocument.m delete mode 100644 Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib delete mode 100644 Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib delete mode 100644 Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib delete mode 100644 Mac/OSX/PythonLauncher/PreferencesWindowController.h delete mode 100644 Mac/OSX/PythonLauncher/PreferencesWindowController.m delete mode 100644 Mac/OSX/PythonLauncher/doscript.h delete mode 100644 Mac/OSX/PythonLauncher/doscript.m delete mode 100644 Mac/OSX/PythonLauncher/factorySettings.plist delete mode 100755 Mac/OSX/PythonLauncher/main.m delete mode 100644 Mac/OSX/README delete mode 100644 Mac/OSX/Tools/pythonw.c delete mode 100644 Mac/OSX/fixapplepython23.py delete mode 100644 Mac/OSXResources/app/Info.plist delete mode 100644 Mac/OSXResources/app/PkgInfo delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/PackageManager.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/community.html delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/doc/index.html delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/finder.html delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/gui.html delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/IDE.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/entering_in_new_window.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/hello_world.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/index.html delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/loading_ide.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/making_new_window.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/new_ide_window.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/new_window_made.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/output_window.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/saving_edited_file.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/simple_commands.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/syntax_error.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/index.html delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/intro.html delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/packman.html delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/python.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/pythonsmall.gif delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/scripting.html delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/Documentation/shell.html delete mode 100644 Mac/OSXResources/app/Resources/English.lproj/InfoPlist.strings delete mode 100644 Mac/OSXResources/app/Resources/PythonApplet.icns delete mode 100644 Mac/OSXResources/app/Resources/PythonInterpreter.icns delete mode 100644 Mac/OSXResources/framework/English.lproj/InfoPlist.strings delete mode 100644 Mac/OSXResources/framework/Info.plist delete mode 100644 Mac/OSXResources/framework/version.plist delete mode 100644 Mac/OSXResources/iconsrc/IDE.psd delete mode 100644 Mac/OSXResources/iconsrc/PackageManager.psd delete mode 100644 Mac/OSXResources/iconsrc/PythonApplet.psd delete mode 100755 Mac/OSXResources/iconsrc/PythonCompiled.psd delete mode 100755 Mac/OSXResources/iconsrc/PythonIcon.psd delete mode 100755 Mac/OSXResources/iconsrc/PythonSource.psd delete mode 100644 Mac/OSXResources/iconsrc/PythonWSource.psd create mode 100644 Mac/README create mode 100644 Mac/Resources/app/Info.plist create mode 100644 Mac/Resources/app/PkgInfo create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/PackageManager.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/community.html create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/doc/index.html create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/finder.html create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/gui.html create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/IDE.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/entering_in_new_window.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/hello_world.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/index.html create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/loading_ide.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/making_new_window.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/new_ide_window.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/new_window_made.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/output_window.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/saving_edited_file.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/simple_commands.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/ide/syntax_error.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/index.html create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/intro.html create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/packman.html create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/python.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/pythonsmall.gif create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/scripting.html create mode 100644 Mac/Resources/app/Resources/English.lproj/Documentation/shell.html create mode 100644 Mac/Resources/app/Resources/English.lproj/InfoPlist.strings create mode 100644 Mac/Resources/app/Resources/PythonApplet.icns create mode 100644 Mac/Resources/app/Resources/PythonInterpreter.icns create mode 100644 Mac/Resources/framework/English.lproj/InfoPlist.strings create mode 100644 Mac/Resources/framework/Info.plist create mode 100644 Mac/Resources/framework/version.plist create mode 100644 Mac/Resources/iconsrc/IDE.psd create mode 100644 Mac/Resources/iconsrc/PackageManager.psd create mode 100644 Mac/Resources/iconsrc/PythonApplet.psd create mode 100755 Mac/Resources/iconsrc/PythonCompiled.psd create mode 100755 Mac/Resources/iconsrc/PythonIcon.psd create mode 100755 Mac/Resources/iconsrc/PythonSource.psd create mode 100644 Mac/Resources/iconsrc/PythonWSource.psd diff --git a/Mac/Extras.ReadMe.txt b/Mac/Extras.ReadMe.txt new file mode 100644 index 0000000..2d7fd42 --- /dev/null +++ b/Mac/Extras.ReadMe.txt @@ -0,0 +1,5 @@ +This folder contains examples of Python usage and useful scripts and tools. + +You should be aware that these are not Macintosh-specific but are shared +among Python on all platforms, so there are some that only run on Windows +or Unix or another platform, and/or make little sense on a Macintosh. diff --git a/Mac/Extras.install.py b/Mac/Extras.install.py new file mode 100644 index 0000000..ce00af3 --- /dev/null +++ b/Mac/Extras.install.py @@ -0,0 +1,54 @@ +"""Recursively copy a directory but skip undesired files and +directories (CVS, backup files, pyc files, etc)""" + +import sys +import os +import shutil + +verbose = 1 +debug = 0 + +def isclean(name): + if name == 'CVS': return 0 + if name == '.cvsignore': return 0 + if name == '.DS_store': return 0 + if name == '.svn': return 0 + if name.endswith('~'): return 0 + if name.endswith('.BAK'): return 0 + if name.endswith('.pyc'): return 0 + if name.endswith('.pyo'): return 0 + if name.endswith('.orig'): return 0 + return 1 + +def copycleandir(src, dst): + for cursrc, dirs, files in os.walk(src): + assert cursrc.startswith(src) + curdst = dst + cursrc[len(src):] + if verbose: + print "mkdir", curdst + if not debug: + if not os.path.exists(curdst): + os.makedirs(curdst) + for fn in files: + if isclean(fn): + if verbose: + print "copy", os.path.join(cursrc, fn), os.path.join(curdst, fn) + if not debug: + shutil.copy2(os.path.join(cursrc, fn), os.path.join(curdst, fn)) + else: + if verbose: + print "skipfile", os.path.join(cursrc, fn) + for i in range(len(dirs)-1, -1, -1): + if not isclean(dirs[i]): + if verbose: + print "skipdir", os.path.join(cursrc, dirs[i]) + del dirs[i] + +def main(): + if len(sys.argv) != 3: + sys.stderr.write("Usage: %s srcdir dstdir\n" % sys.argv[0]) + sys.exit(1) + copycleandir(sys.argv[1], sys.argv[2]) + +if __name__ == '__main__': + main() diff --git a/Mac/Icons/Disk Image.icns b/Mac/Icons/Disk Image.icns new file mode 100644 index 0000000..35f16bf Binary files /dev/null and b/Mac/Icons/Disk Image.icns differ diff --git a/Mac/Icons/IDLE.icns b/Mac/Icons/IDLE.icns new file mode 100644 index 0000000..c12c9da Binary files /dev/null and b/Mac/Icons/IDLE.icns differ diff --git a/Mac/Icons/Python Folder.icns b/Mac/Icons/Python Folder.icns new file mode 100644 index 0000000..ae766ee Binary files /dev/null and b/Mac/Icons/Python Folder.icns differ diff --git a/Mac/Icons/PythonCompiled.icns b/Mac/Icons/PythonCompiled.icns new file mode 100644 index 0000000..7d9f320 Binary files /dev/null and b/Mac/Icons/PythonCompiled.icns differ diff --git a/Mac/Icons/PythonLauncher.icns b/Mac/Icons/PythonLauncher.icns new file mode 100644 index 0000000..e09fd38 Binary files /dev/null and b/Mac/Icons/PythonLauncher.icns differ diff --git a/Mac/Icons/PythonSource.icns b/Mac/Icons/PythonSource.icns new file mode 100644 index 0000000..9e35c1e Binary files /dev/null and b/Mac/Icons/PythonSource.icns differ diff --git a/Mac/Icons/ReadMe.txt b/Mac/Icons/ReadMe.txt new file mode 100644 index 0000000..226836a --- /dev/null +++ b/Mac/Icons/ReadMe.txt @@ -0,0 +1,3 @@ +The icons for use on MacOS X were created by Jacob Rus +with some feedback from the folks on pythonmac-sig@python.org. + diff --git a/Mac/Makefile.in b/Mac/Makefile.in new file mode 100644 index 0000000..82514b2 --- /dev/null +++ b/Mac/Makefile.in @@ -0,0 +1,251 @@ +# This file can be invoked from the various frameworkinstall... targets in the +# main Makefile. The next couple of variables are overridden on the +# commandline in that case. + +VERSION=@VERSION@ +builddir = .. +srcdir=@srcdir@ +prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION) +LIBDEST=$(prefix)/lib/python$(VERSION) +RUNSHARED=@RUNSHARED@ +BUILDEXE=@BUILDEXEEXT@ +BUILDPYTHON=$(builddir)/python$(BUILDEXE) +DESTDIR= +LDFLAGS=@LDFLAGS@ +FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@ + +# These are normally glimpsed from the previous set +bindir=$(prefix)/bin +PYTHONAPPSDIR=/Applications/MacPython $(VERSION) +APPINSTALLDIR=$(prefix)/Resources/Python.app + +# Variables for installing the "normal" unix binaries +INSTALLED_PYTHONAPP=$(APPINSTALLDIR)/Contents/MacOS/Python + +# Items more-or-less copied from the main Makefile +DIRMODE=755 +FILEMODE=644 +INSTALL=@INSTALL@ +INSTALL_SYMLINK=ln -fsn +INSTALL_PROGRAM=@INSTALL_PROGRAM@ +INSTALL_SCRIPT= @INSTALL_SCRIPT@ +INSTALL_DATA=@INSTALL_DATA@ +LN=@LN@ +STRIPFLAG=-s +CPMAC=/Developer/Tools/CpMac + +APPTEMPLATE=$(srcdir)/Resources/app +APPSUBDIRS=MacOS Resources Resources/English.lproj \ + Resources/English.lproj/Documentation \ + Resources/English.lproj/Documentation/doc \ + Resources/English.lproj/Documentation/ide +DOCDIR=$(srcdir)/Resources/app/Resources/English.lproj/Documentation +DOCINDEX=$(DOCDIR)/"Documentation idx" +CACHERSRC=$(srcdir)/scripts/cachersrc.py +compileall=$(srcdir)/../Lib/compileall.py + +installapps: install_Python install_BuildApplet install_PythonLauncher \ + install_IDLE checkapplepython install_pythonw install_versionedtools + +install_pythonw: pythonw + $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)" + $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)" + ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python" + ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw" + +# +# Install unix tools in /usr/local/bin. These are just aliases for the +# actual installation inside the framework. +# +installunixtools: + if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \ + $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\ + fi + for fn in python pythonw idle pydoc python-config smtpd.py \ + python$(VERSION) pythonw$(VERSION) idle$(VERSION) \ + pydoc$(VERSION) python-config$(VERSION) smtpd$(VERSION).py ;\ + do \ + ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\ + done + +# +# Like installunixtools, but only install links to the versioned binaries. +# +altinstallunixtools: + if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \ + $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\ + fi + for fn in python$(VERSION) pythonw$(VERSION) idle$(VERSION) \ + pydoc$(VERSION) python-config$(VERSION) smtpd$(VERSION).py ;\ + do \ + ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\ + done + + +# By default most tools are installed without a version in their basename, to +# make it easier to install (and use) several python versions side-by-side move +# the tools to a version-specific name and add the non-versioned name as an +# alias. +install_versionedtools: + for fn in idle pydoc python-config ;\ + do \ + if [ -h "$(DESTDIR)$(prefix)/bin/$${fn}" ]; then \ + continue ;\ + fi ;\ + mv "$(DESTDIR)$(prefix)/bin/$${fn}" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\ + ln -sf "$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}" ;\ + done + if [ ! -h "$(DESTDIR)$(prefix)/bin/smtpd.py" ]; then \ + mv "$(DESTDIR)$(prefix)/bin/smtpd.py" "$(DESTDIR)$(prefix)/bin/smtpd$(VERSION).py" ;\ + ln -sf "smtpd$(VERSION).py" "$(DESTDIR)$(prefix)/bin/smtpd.py" ;\ + fi + + +pythonw: $(srcdir)/Tools/pythonw.c + $(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c \ + -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/Python"' + + +install_PythonLauncher: + cd PythonLauncher && make install DESTDIR=$(DESTDIR) + +install_Python: + @if test ! -f $(DOCINDEX); then \ + echo WARNING: you should run Apple Help Indexing Tool on $(DOCDIR); \ + fi + @for i in "$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \ + if test ! -d "$(DESTDIR)$$i"; then \ + echo "Creating directory $(DESTDIR)$$i"; \ + $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$$i"; \ + fi;\ + done + @for i in $(APPSUBDIRS); do \ + if test ! -d "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; then \ + echo "Creating directory $(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \ + $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \ + else true; \ + fi; \ + done + @for d in . $(APPSUBDIRS); \ + do \ + a=$(APPTEMPLATE)/$$d; \ + if test ! -d $$a; then continue; else true; fi; \ + b="$(DESTDIR)$(APPINSTALLDIR)/Contents/$$d"; \ + for i in $$a/*; \ + do \ + case $$i in \ + *CVS) ;; \ + *.svn) ;; \ + *.py[co]) ;; \ + *.orig) ;; \ + *~) ;; \ + *idx) \ + echo $(CPMAC) "$$i" $$b; \ + $(CPMAC) "$$i" "$$b"; \ + ;; \ + *) \ + if test -d $$i; then continue; fi; \ + if test -x $$i; then \ + echo $(INSTALL_SCRIPT) "$$i" "$$b"; \ + $(INSTALL_SCRIPT) "$$i" "$$b"; \ + else \ + echo $(INSTALL_DATA) "$$i" "$$b"; \ + $(INSTALL_DATA) "$$i" "$$b"; \ + fi;; \ + esac; \ + done; \ + done + $(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/Python" + +install_IDLE: + cd IDLE && make install + +install_BuildApplet: + $(RUNSHARED) $(BUILDPYTHON) $(srcdir)/scripts/BuildApplet.py \ + --destroot "$(DESTDIR)" \ + --python $(INSTALLED_PYTHONAPP) \ + --output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \ + $(srcdir)/scripts/BuildApplet.py + +MACLIBDEST=$(LIBDEST)/plat-mac +MACTOOLSDEST=$(prefix)/Mac/Tools +MACTOOLSSRC=$(srcdir)/Mac/Tools +MACTOOLSSUBDIRS=IDE + +installmacsubtree: + @for i in $(MACTOOLSDEST); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $(DESTDIR)$$i"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ + else true; \ + fi; \ + done + @for d in $(MACTOOLSSUBDIRS); \ + do \ + a=$(MACTOOLSSRC)/$$d; \ + if test ! -d $$a; then continue; else true; fi; \ + b=$(DESTDIR)$(MACTOOLSDEST)/$$d; \ + if test ! -d $$b; then \ + echo "Creating directory $$b"; \ + $(INSTALL) -d -m $(DIRMODE) $$b; \ + else true; \ + fi; \ + done + @for d in $(MACTOOLSSUBDIRS); \ + do \ + a=$(MACTOOLSSRC)/$$d; \ + if test ! -d $$a; then continue; else true; fi; \ + b=$(DESTDIR)$(MACTOOLSDEST)/$$d; \ + for i in $$a/*; \ + do \ + case $$i in \ + *CVS) ;; \ + *.svn) ;; \ + *.py[co]) ;; \ + *.orig) ;; \ + *~) ;; \ + *.rsrc) \ + echo $(CPMAC) $$i $$b ; \ + $(CPMAC) $$i $$b ; \ + ;; \ + *) \ + if test -d $$i; then continue; fi; \ + if test -x $$i; then \ + echo $(INSTALL_SCRIPT) $$i $$b; \ + $(INSTALL_SCRIPT) $$i $$b; \ + else \ + echo $(INSTALL_DATA) $$i $$b; \ + $(INSTALL_DATA) $$i $$b; \ + fi;; \ + esac; \ + done; \ + done + + + $(RUNSHARED) $(BUILDPYTHON) $(CACHERSRC) -v $(DESTDIR)$(MACLIBDEST) $(DESTDIR)$(MACTOOLSDEST) + $(RUNSHARED) $(BUILDPYTHON) -Wi -tt $(compileall) -d $(MACTOOLSDEST) -x badsyntax $(DESTDIR)$(MACTOOLSDEST) + $(RUNSHARED) $(BUILDPYTHON) -O -Wi -tt $(compileall) -d $(MACTOOLSDEST) -x badsyntax $(DESTDIR)$(MACTOOLSDEST) + +$(INSTALLED_PYTHONAPP): install_Python + +installextras: $(srcdir)/Extras.ReadMe.txt $(srcdir)/Extras.install.py + $(INSTALL) -d "$(DESTDIR)$(PYTHONAPPSDIR)/Extras" + $(INSTALL) $(srcdir)/Extras.ReadMe.txt "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/ReadMe.txt" + $(RUNSHARED) $(BUILDPYTHON) $(srcdir)/Extras.install.py $(srcdir)/../Demo \ + "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo" + $(RUNSHARED) $(BUILDPYTHON) $(srcdir)/Extras.install.py $(srcdir)/Demo \ + "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo.Mac" + + +checkapplepython: $(srcdir)/Tools/fixapplepython23.py + @if ! $(RUNSHARED) $(BUILDPYTHON) $(srcdir)/Tools/fixapplepython23.py -n; then \ + echo "* WARNING: Apple-installed Python 2.3 will have trouble building extensions from now on."; \ + echo "* WARNING: Run $(srcdir)/Tools/fixapplepython23.py with \"sudo\" to fix this."; \ + fi + + +clean: + rm pythonw + cd PythonLauncher && make clean + cd IDLE && make clean diff --git a/Mac/OSX/BuildScript/README.txt b/Mac/OSX/BuildScript/README.txt deleted file mode 100644 index c556de83..0000000 --- a/Mac/OSX/BuildScript/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Building a MacPython distribution -================================= - -The ``build-install.py`` script creates MacPython distributions, including -sleepycat db4, sqlite3 and readline support. It builds a complete -framework-based Python out-of-tree, installs it in a funny place with -$DESTROOT, massages that installation to remove .pyc files and such, creates -an Installer package from the installation plus other files in ``resources`` -and ``scripts`` and placed that on a ``.dmg`` disk image. - -Here are the steps you ned to follow to build a MacPython installer: - -- Run ``./build-installer.py``. Optionally you can pass a number of arguments - to specify locations of various files. Please see the top of - ``build-installer.py`` for its usage. -- When done the script will tell you where the DMG image is. - -The script needs to be run on Mac OS X 10.4 with Xcode 2.2 or later and -the 10.4u SDK. - -When all is done, announcements can be posted to at least the following -places: -- pythonmac-sig@python.org -- python-dev@python.org -- python-announce@python.org -- archivist@info-mac.org -- adcnews@apple.com -- news@macnn.com -- http://www.macupdate.com -- http://guide.apple.com/usindex.lasso -- http://www.apple.com/downloads/macosx/submit -- http://www.versiontracker.com/ (userid Jack.Jansen@oratrix.com) -- http://www.macshareware.net (userid jackjansen) - -Also, check out Stephan Deibels http://pythonology.org/market contact list diff --git a/Mac/OSX/BuildScript/build-installer.py b/Mac/OSX/BuildScript/build-installer.py deleted file mode 100755 index b24f5dc..0000000 --- a/Mac/OSX/BuildScript/build-installer.py +++ /dev/null @@ -1,1014 +0,0 @@ -#!/usr/bin/python2.3 -""" -This script is used to build the "official unofficial" universal build on -Mac OS X. It requires Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK to do its -work. - -Please ensure that this script keeps working with Python 2.3, to avoid -bootstrap issues (/usr/bin/python is Python 2.3 on OSX 10.4) - -Usage: see USAGE variable in the script. -""" -import platform, os, sys, getopt, textwrap, shutil, urllib2, stat, time, pwd - -INCLUDE_TIMESTAMP=1 -VERBOSE=1 - -from plistlib import Plist - -import MacOS -import Carbon.File -import Carbon.Icn -import Carbon.Res -from Carbon.Files import kCustomIconResource, fsRdWrPerm, kHasCustomIcon -from Carbon.Files import kFSCatInfoFinderInfo - -try: - from plistlib import writePlist -except ImportError: - # We're run using python2.3 - def writePlist(plist, path): - plist.write(path) - -def shellQuote(value): - """ - Return the string value in a form that can savely be inserted into - a shell command. - """ - return "'%s'"%(value.replace("'", "'\"'\"'")) - -def grepValue(fn, variable): - variable = variable + '=' - for ln in open(fn, 'r'): - if ln.startswith(variable): - value = ln[len(variable):].strip() - return value[1:-1] - -def getVersion(): - return grepValue(os.path.join(SRCDIR, 'configure'), 'PACKAGE_VERSION') - -def getFullVersion(): - fn = os.path.join(SRCDIR, 'Include', 'patchlevel.h') - for ln in open(fn): - if 'PY_VERSION' in ln: - return ln.split()[-1][1:-1] - - raise RuntimeError, "Cannot find full version??" - -# The directory we'll use to create the build, will be erased and recreated -WORKDIR="/tmp/_py" - -# The directory we'll use to store third-party sources, set this to something -# else if you don't want to re-fetch required libraries every time. -DEPSRC=os.path.join(WORKDIR, 'third-party') -DEPSRC=os.path.expanduser('~/Universal/other-sources') - -# Location of the preferred SDK -SDKPATH="/Developer/SDKs/MacOSX10.4u.sdk" -#SDKPATH="/" - -# Source directory (asume we're in Mac/OSX/Dist) -SRCDIR=os.path.dirname( - os.path.dirname( - os.path.dirname( - os.path.dirname( - os.path.abspath(__file__ - ))))) - -USAGE=textwrap.dedent("""\ - Usage: build_python [options] - - Options: - -? or -h: Show this message - -b DIR - --build-dir=DIR: Create build here (default: %(WORKDIR)r) - --third-party=DIR: Store third-party sources here (default: %(DEPSRC)r) - --sdk-path=DIR: Location of the SDK (default: %(SDKPATH)r) - --src-dir=DIR: Location of the Python sources (default: %(SRCDIR)r) -""")% globals() - - -# Instructions for building libraries that are necessary for building a -# batteries included python. -LIBRARY_RECIPES=[ - dict( - # Note that GNU readline is GPL'd software - name="GNU Readline 5.1.4", - url="http://ftp.gnu.org/pub/gnu/readline/readline-5.1.tar.gz" , - patchlevel='0', - patches=[ - # The readline maintainers don't do actual micro releases, but - # just ship a set of patches. - 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-001', - 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-002', - 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-003', - 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-004', - ] - ), - - dict( - name="SQLite 3.3.5", - url="http://www.sqlite.org/sqlite-3.3.5.tar.gz", - checksum='93f742986e8bc2dfa34792e16df017a6feccf3a2', - configure_pre=[ - '--enable-threadsafe', - '--enable-tempstore', - '--enable-shared=no', - '--enable-static=yes', - '--disable-tcl', - ] - ), - - dict( - name="NCurses 5.5", - url="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.5.tar.gz", - configure_pre=[ - "--without-cxx", - "--without-ada", - "--without-progs", - "--without-curses-h", - "--enable-shared", - "--with-shared", - "--datadir=/usr/share", - "--sysconfdir=/etc", - "--sharedstatedir=/usr/com", - "--with-terminfo-dirs=/usr/share/terminfo", - "--with-default-terminfo-dir=/usr/share/terminfo", - "--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib"%(getVersion(),), - "--enable-termcap", - ], - patches=[ - "ncurses-5.5.patch", - ], - useLDFlags=False, - install='make && make install DESTDIR=%s && cd %s/usr/local/lib && ln -fs ../../../Library/Frameworks/Python.framework/Versions/%s/lib/lib* .'%( - shellQuote(os.path.join(WORKDIR, 'libraries')), - shellQuote(os.path.join(WORKDIR, 'libraries')), - getVersion(), - ), - ), - dict( - name="Sleepycat DB 4.4", - url="http://downloads.sleepycat.com/db-4.4.20.tar.gz", - #name="Sleepycat DB 4.3.29", - #url="http://downloads.sleepycat.com/db-4.3.29.tar.gz", - buildDir="build_unix", - configure="../dist/configure", - configure_pre=[ - '--includedir=/usr/local/include/db4', - ] - ), -] - - -# Instructions for building packages inside the .mpkg. -PKG_RECIPES=[ - dict( - name="PythonFramework", - long_name="Python Framework", - source="/Library/Frameworks/Python.framework", - readme="""\ - This package installs Python.framework, that is the python - interpreter and the standard library. This also includes Python - wrappers for lots of Mac OS X API's. - """, - postflight="scripts/postflight.framework", - ), - dict( - name="PythonApplications", - long_name="GUI Applications", - source="/Applications/MacPython %(VER)s", - readme="""\ - This package installs Python.framework, that is the python - interpreter and the standard library. This also includes Python - wrappers for lots of Mac OS X API's. - """, - required=False, - ), - dict( - name="PythonUnixTools", - long_name="UNIX command-line tools", - source="/usr/local/bin", - readme="""\ - This package installs the unix tools in /usr/local/bin for - compatibility with older releases of MacPython. This package - is not necessary to use MacPython. - """, - required=False, - ), - dict( - name="PythonDocumentation", - long_name="Python Documentation", - topdir="/Library/Frameworks/Python.framework/Versions/%(VER)s/Resources/English.lproj/Documentation", - source="/pydocs", - readme="""\ - This package installs the python documentation at a location - that is useable for pydoc and IDLE. If you have installed Xcode - it will also install a link to the documentation in - /Developer/Documentation/Python - """, - postflight="scripts/postflight.documentation", - required=False, - ), - dict( - name="PythonProfileChanges", - long_name="Shell profile updater", - readme="""\ - This packages updates your shell profile to make sure that - the MacPython tools are found by your shell in preference of - the system provided Python tools. - - If you don't install this package you'll have to add - "/Library/Frameworks/Python.framework/Versions/%(VER)s/bin" - to your PATH by hand. - """, - postflight="scripts/postflight.patch-profile", - topdir="/Library/Frameworks/Python.framework", - source="/empty-dir", - required=False, - ), -] - - -def fatal(msg): - """ - A fatal error, bail out. - """ - sys.stderr.write('FATAL: ') - sys.stderr.write(msg) - sys.stderr.write('\n') - sys.exit(1) - -def fileContents(fn): - """ - Return the contents of the named file - """ - return open(fn, 'rb').read() - -def runCommand(commandline): - """ - Run a command and raise RuntimeError if it fails. Output is surpressed - unless the command fails. - """ - fd = os.popen(commandline, 'r') - data = fd.read() - xit = fd.close() - if xit != None: - sys.stdout.write(data) - raise RuntimeError, "command failed: %s"%(commandline,) - - if VERBOSE: - sys.stdout.write(data); sys.stdout.flush() - -def captureCommand(commandline): - fd = os.popen(commandline, 'r') - data = fd.read() - xit = fd.close() - if xit != None: - sys.stdout.write(data) - raise RuntimeError, "command failed: %s"%(commandline,) - - return data - -def checkEnvironment(): - """ - Check that we're running on a supported system. - """ - - if platform.system() != 'Darwin': - fatal("This script should be run on a Mac OS X 10.4 system") - - if platform.release() <= '8.': - fatal("This script should be run on a Mac OS X 10.4 system") - - if not os.path.exists(SDKPATH): - fatal("Please install the latest version of Xcode and the %s SDK"%( - os.path.basename(SDKPATH[:-4]))) - - - -def parseOptions(args = None): - """ - Parse arguments and update global settings. - """ - global WORKDIR, DEPSRC, SDKPATH, SRCDIR - - if args is None: - args = sys.argv[1:] - - try: - options, args = getopt.getopt(args, '?hb', - [ 'build-dir=', 'third-party=', 'sdk-path=' , 'src-dir=']) - except getopt.error, msg: - print msg - sys.exit(1) - - if args: - print "Additional arguments" - sys.exit(1) - - for k, v in options: - if k in ('-h', '-?'): - print USAGE - sys.exit(0) - - elif k in ('-d', '--build-dir'): - WORKDIR=v - - elif k in ('--third-party',): - DEPSRC=v - - elif k in ('--sdk-path',): - SDKPATH=v - - elif k in ('--src-dir',): - SRCDIR=v - - else: - raise NotImplementedError, k - - SRCDIR=os.path.abspath(SRCDIR) - WORKDIR=os.path.abspath(WORKDIR) - SDKPATH=os.path.abspath(SDKPATH) - DEPSRC=os.path.abspath(DEPSRC) - - print "Settings:" - print " * Source directory:", SRCDIR - print " * Build directory: ", WORKDIR - print " * SDK location: ", SDKPATH - print " * third-party source:", DEPSRC - print "" - - - - -def extractArchive(builddir, archiveName): - """ - Extract a source archive into 'builddir'. Returns the path of the - extracted archive. - - XXX: This function assumes that archives contain a toplevel directory - that is has the same name as the basename of the archive. This is - save enough for anything we use. - """ - curdir = os.getcwd() - try: - os.chdir(builddir) - if archiveName.endswith('.tar.gz'): - retval = os.path.basename(archiveName[:-7]) - if os.path.exists(retval): - shutil.rmtree(retval) - fp = os.popen("tar zxf %s 2>&1"%(shellQuote(archiveName),), 'r') - - elif archiveName.endswith('.tar.bz2'): - retval = os.path.basename(archiveName[:-8]) - if os.path.exists(retval): - shutil.rmtree(retval) - fp = os.popen("tar jxf %s 2>&1"%(shellQuote(archiveName),), 'r') - - elif archiveName.endswith('.tar'): - retval = os.path.basename(archiveName[:-4]) - if os.path.exists(retval): - shutil.rmtree(retval) - fp = os.popen("tar xf %s 2>&1"%(shellQuote(archiveName),), 'r') - - elif archiveName.endswith('.zip'): - retval = os.path.basename(archiveName[:-4]) - if os.path.exists(retval): - shutil.rmtree(retval) - fp = os.popen("unzip %s 2>&1"%(shellQuote(archiveName),), 'r') - - data = fp.read() - xit = fp.close() - if xit is not None: - sys.stdout.write(data) - raise RuntimeError, "Cannot extract %s"%(archiveName,) - - return os.path.join(builddir, retval) - - finally: - os.chdir(curdir) - -KNOWNSIZES = { - "http://ftp.gnu.org/pub/gnu/readline/readline-5.1.tar.gz": 7952742, - "http://downloads.sleepycat.com/db-4.4.20.tar.gz": 2030276, -} - -def downloadURL(url, fname): - """ - Download the contents of the url into the file. - """ - try: - size = os.path.getsize(fname) - except OSError: - pass - else: - if KNOWNSIZES.get(url) == size: - print "Using existing file for", url - return - fpIn = urllib2.urlopen(url) - fpOut = open(fname, 'wb') - block = fpIn.read(10240) - try: - while block: - fpOut.write(block) - block = fpIn.read(10240) - fpIn.close() - fpOut.close() - except: - try: - os.unlink(fname) - except: - pass - -def buildRecipe(recipe, basedir, archList): - """ - Build software using a recipe. This function does the - 'configure;make;make install' dance for C software, with a possibility - to customize this process, basically a poor-mans DarwinPorts. - """ - curdir = os.getcwd() - - name = recipe['name'] - url = recipe['url'] - configure = recipe.get('configure', './configure') - install = recipe.get('install', 'make && make install DESTDIR=%s'%( - shellQuote(basedir))) - - archiveName = os.path.split(url)[-1] - sourceArchive = os.path.join(DEPSRC, archiveName) - - if not os.path.exists(DEPSRC): - os.mkdir(DEPSRC) - - - if os.path.exists(sourceArchive): - print "Using local copy of %s"%(name,) - - else: - print "Downloading %s"%(name,) - downloadURL(url, sourceArchive) - print "Archive for %s stored as %s"%(name, sourceArchive) - - print "Extracting archive for %s"%(name,) - buildDir=os.path.join(WORKDIR, '_bld') - if not os.path.exists(buildDir): - os.mkdir(buildDir) - - workDir = extractArchive(buildDir, sourceArchive) - os.chdir(workDir) - if 'buildDir' in recipe: - os.chdir(recipe['buildDir']) - - - for fn in recipe.get('patches', ()): - if fn.startswith('http://'): - # Download the patch before applying it. - path = os.path.join(DEPSRC, os.path.basename(fn)) - downloadURL(fn, path) - fn = path - - fn = os.path.join(curdir, fn) - runCommand('patch -p%s < %s'%(recipe.get('patchlevel', 1), - shellQuote(fn),)) - - configure_args = [ - "--prefix=/usr/local", - "--enable-static", - "--disable-shared", - #"CPP=gcc -arch %s -E"%(' -arch '.join(archList,),), - ] - - if 'configure_pre' in recipe: - args = list(recipe['configure_pre']) - if '--disable-static' in args: - configure_args.remove('--enable-static') - if '--enable-shared' in args: - configure_args.remove('--disable-shared') - configure_args.extend(args) - - if recipe.get('useLDFlags', 1): - configure_args.extend([ - "CFLAGS=-arch %s -isysroot %s -I%s/usr/local/include"%( - ' -arch '.join(archList), - shellQuote(SDKPATH)[1:-1], - shellQuote(basedir)[1:-1],), - "LDFLAGS=-syslibroot,%s -L%s/usr/local/lib -arch %s"%( - shellQuote(SDKPATH)[1:-1], - shellQuote(basedir)[1:-1], - ' -arch '.join(archList)), - ]) - else: - configure_args.extend([ - "CFLAGS=-arch %s -isysroot %s -I%s/usr/local/include"%( - ' -arch '.join(archList), - shellQuote(SDKPATH)[1:-1], - shellQuote(basedir)[1:-1],), - ]) - - if 'configure_post' in recipe: - configure_args = configure_args = list(recipe['configure_post']) - - configure_args.insert(0, configure) - configure_args = [ shellQuote(a) for a in configure_args ] - - print "Running configure for %s"%(name,) - runCommand(' '.join(configure_args) + ' 2>&1') - - print "Running install for %s"%(name,) - runCommand('{ ' + install + ' ;} 2>&1') - - print "Done %s"%(name,) - print "" - - os.chdir(curdir) - -def buildLibraries(): - """ - Build our dependencies into $WORKDIR/libraries/usr/local - """ - print "" - print "Building required libraries" - print "" - universal = os.path.join(WORKDIR, 'libraries') - os.mkdir(universal) - os.makedirs(os.path.join(universal, 'usr', 'local', 'lib')) - os.makedirs(os.path.join(universal, 'usr', 'local', 'include')) - - for recipe in LIBRARY_RECIPES: - buildRecipe(recipe, universal, ('i386', 'ppc',)) - - - -def buildPythonDocs(): - # This stores the documentation as Resources/English.lproj/Docuentation - # inside the framwork. pydoc and IDLE will pick it up there. - print "Install python documentation" - rootDir = os.path.join(WORKDIR, '_root') - version = getVersion() - docdir = os.path.join(rootDir, 'pydocs') - - name = 'html-%s.tar.bz2'%(getFullVersion(),) - sourceArchive = os.path.join(DEPSRC, name) - if os.path.exists(sourceArchive): - print "Using local copy of %s"%(name,) - - else: - print "Downloading %s"%(name,) - downloadURL('http://www.python.org/ftp/python/doc/%s/%s'%( - getFullVersion(), name), sourceArchive) - print "Archive for %s stored as %s"%(name, sourceArchive) - - extractArchive(os.path.dirname(docdir), sourceArchive) - os.rename( - os.path.join( - os.path.dirname(docdir), 'Python-Docs-%s'%(getFullVersion(),)), - docdir) - - -def buildPython(): - print "Building a universal python" - - buildDir = os.path.join(WORKDIR, '_bld', 'python') - rootDir = os.path.join(WORKDIR, '_root') - - if os.path.exists(buildDir): - shutil.rmtree(buildDir) - if os.path.exists(rootDir): - shutil.rmtree(rootDir) - os.mkdir(buildDir) - os.mkdir(rootDir) - os.mkdir(os.path.join(rootDir, 'empty-dir')) - curdir = os.getcwd() - os.chdir(buildDir) - - # Not sure if this is still needed, the original build script - # claims that parts of the install assume python.exe exists. - os.symlink('python', os.path.join(buildDir, 'python.exe')) - - # Extract the version from the configure file, needed to calculate - # several paths. - version = getVersion() - - print "Running configure..." - runCommand("%s -C --enable-framework --enable-universalsdk=%s LDFLAGS='-g -L%s/libraries/usr/local/lib' OPT='-g -O3 -I%s/libraries/usr/local/include' 2>&1"%( - shellQuote(os.path.join(SRCDIR, 'configure')), - shellQuote(SDKPATH), shellQuote(WORKDIR)[1:-1], - shellQuote(WORKDIR)[1:-1])) - - print "Running make" - runCommand("make") - - print "Runing make frameworkinstall" - runCommand("make frameworkinstall DESTDIR=%s"%( - shellQuote(rootDir))) - - print "Runing make frameworkinstallextras" - runCommand("make frameworkinstallextras DESTDIR=%s"%( - shellQuote(rootDir))) - - print "Copy required shared libraries" - if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')): - runCommand("mv %s/* %s"%( - shellQuote(os.path.join( - WORKDIR, 'libraries', 'Library', 'Frameworks', - 'Python.framework', 'Versions', getVersion(), - 'lib')), - shellQuote(os.path.join(WORKDIR, '_root', 'Library', 'Frameworks', - 'Python.framework', 'Versions', getVersion(), - 'lib')))) - - print "Fix file modes" - frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework') - for dirpath, dirnames, filenames in os.walk(frmDir): - for dn in dirnames: - os.chmod(os.path.join(dirpath, dn), 0775) - - for fn in filenames: - if os.path.islink(fn): - continue - - # "chmod g+w $fn" - p = os.path.join(dirpath, fn) - st = os.stat(p) - os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IXGRP) - - # We added some directories to the search path during the configure - # phase. Remove those because those directories won't be there on - # the end-users system. - path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework', - 'Versions', version, 'lib', 'python%s'%(version,), - 'config', 'Makefile') - fp = open(path, 'r') - data = fp.read() - fp.close() - - data = data.replace('-L%s/libraries/usr/local/lib'%(WORKDIR,), '') - data = data.replace('-I%s/libraries/usr/local/include'%(WORKDIR,), '') - fp = open(path, 'w') - fp.write(data) - fp.close() - - # Add symlinks in /usr/local/bin, using relative links - usr_local_bin = os.path.join(rootDir, 'usr', 'local', 'bin') - to_framework = os.path.join('..', '..', '..', 'Library', 'Frameworks', - 'Python.framework', 'Versions', version, 'bin') - if os.path.exists(usr_local_bin): - shutil.rmtree(usr_local_bin) - os.makedirs(usr_local_bin) - for fn in os.listdir( - os.path.join(frmDir, 'Versions', version, 'bin')): - os.symlink(os.path.join(to_framework, fn), - os.path.join(usr_local_bin, fn)) - - os.chdir(curdir) - - - -def patchFile(inPath, outPath): - data = fileContents(inPath) - data = data.replace('$FULL_VERSION', getFullVersion()) - data = data.replace('$VERSION', getVersion()) - data = data.replace('$MACOSX_DEPLOYMENT_TARGET', '10.3 or later') - data = data.replace('$ARCHITECTURES', "i386, ppc") - data = data.replace('$INSTALL_SIZE', installSize()) - fp = open(outPath, 'wb') - fp.write(data) - fp.close() - -def patchScript(inPath, outPath): - data = fileContents(inPath) - data = data.replace('@PYVER@', getVersion()) - fp = open(outPath, 'wb') - fp.write(data) - fp.close() - os.chmod(outPath, 0755) - - - -def packageFromRecipe(targetDir, recipe): - curdir = os.getcwd() - try: - pkgname = recipe['name'] - srcdir = recipe.get('source') - pkgroot = recipe.get('topdir', srcdir) - postflight = recipe.get('postflight') - readme = textwrap.dedent(recipe['readme']) - isRequired = recipe.get('required', True) - - print "- building package %s"%(pkgname,) - - # Substitute some variables - textvars = dict( - VER=getVersion(), - FULLVER=getFullVersion(), - ) - readme = readme % textvars - - if pkgroot is not None: - pkgroot = pkgroot % textvars - else: - pkgroot = '/' - - if srcdir is not None: - srcdir = os.path.join(WORKDIR, '_root', srcdir[1:]) - srcdir = srcdir % textvars - - if postflight is not None: - postflight = os.path.abspath(postflight) - - packageContents = os.path.join(targetDir, pkgname + '.pkg', 'Contents') - os.makedirs(packageContents) - - if srcdir is not None: - os.chdir(srcdir) - runCommand("pax -wf %s . 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.pax')),)) - runCommand("gzip -9 %s 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.pax')),)) - runCommand("mkbom . %s 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.bom')),)) - - fn = os.path.join(packageContents, 'PkgInfo') - fp = open(fn, 'w') - fp.write('pmkrpkg1') - fp.close() - - rsrcDir = os.path.join(packageContents, "Resources") - os.mkdir(rsrcDir) - fp = open(os.path.join(rsrcDir, 'ReadMe.txt'), 'w') - fp.write(readme) - fp.close() - - if postflight is not None: - patchScript(postflight, os.path.join(rsrcDir, 'postflight')) - - vers = getFullVersion() - major, minor = map(int, getVersion().split('.', 2)) - pl = Plist( - CFBundleGetInfoString="MacPython.%s %s"%(pkgname, vers,), - CFBundleIdentifier='org.python.MacPython.%s'%(pkgname,), - CFBundleName='MacPython.%s'%(pkgname,), - CFBundleShortVersionString=vers, - IFMajorVersion=major, - IFMinorVersion=minor, - IFPkgFormatVersion=0.10000000149011612, - IFPkgFlagAllowBackRev=False, - IFPkgFlagAuthorizationAction="RootAuthorization", - IFPkgFlagDefaultLocation=pkgroot, - IFPkgFlagFollowLinks=True, - IFPkgFlagInstallFat=True, - IFPkgFlagIsRequired=isRequired, - IFPkgFlagOverwritePermissions=False, - IFPkgFlagRelocatable=False, - IFPkgFlagRestartAction="NoRestart", - IFPkgFlagRootVolumeOnly=True, - IFPkgFlagUpdateInstalledLangauges=False, - ) - writePlist(pl, os.path.join(packageContents, 'Info.plist')) - - pl = Plist( - IFPkgDescriptionDescription=readme, - IFPkgDescriptionTitle=recipe.get('long_name', "MacPython.%s"%(pkgname,)), - IFPkgDescriptionVersion=vers, - ) - writePlist(pl, os.path.join(packageContents, 'Resources', 'Description.plist')) - - finally: - os.chdir(curdir) - - -def makeMpkgPlist(path): - - vers = getFullVersion() - major, minor = map(int, getVersion().split('.', 2)) - - pl = Plist( - CFBundleGetInfoString="MacPython %s"%(vers,), - CFBundleIdentifier='org.python.MacPython', - CFBundleName='MacPython', - CFBundleShortVersionString=vers, - IFMajorVersion=major, - IFMinorVersion=minor, - IFPkgFlagComponentDirectory="Contents/Packages", - IFPkgFlagPackageList=[ - dict( - IFPkgFlagPackageLocation='%s.pkg'%(item['name']), - IFPkgFlagPackageSelection='selected' - ) - for item in PKG_RECIPES - ], - IFPkgFormatVersion=0.10000000149011612, - IFPkgFlagBackgroundScaling="proportional", - IFPkgFlagBackgroundAlignment="left", - ) - - writePlist(pl, path) - - -def buildInstaller(): - - # Zap all compiled files - for dirpath, _, filenames in os.walk(os.path.join(WORKDIR, '_root')): - for fn in filenames: - if fn.endswith('.pyc') or fn.endswith('.pyo'): - os.unlink(os.path.join(dirpath, fn)) - - outdir = os.path.join(WORKDIR, 'installer') - if os.path.exists(outdir): - shutil.rmtree(outdir) - os.mkdir(outdir) - - pkgroot = os.path.join(outdir, 'MacPython.mpkg', 'Contents') - pkgcontents = os.path.join(pkgroot, 'Packages') - os.makedirs(pkgcontents) - for recipe in PKG_RECIPES: - packageFromRecipe(pkgcontents, recipe) - - rsrcDir = os.path.join(pkgroot, 'Resources') - - fn = os.path.join(pkgroot, 'PkgInfo') - fp = open(fn, 'w') - fp.write('pmkrpkg1') - fp.close() - - os.mkdir(rsrcDir) - - makeMpkgPlist(os.path.join(pkgroot, 'Info.plist')) - pl = Plist( - IFPkgDescriptionTitle="Universal MacPython", - IFPkgDescriptionVersion=getVersion(), - ) - - writePlist(pl, os.path.join(pkgroot, 'Resources', 'Description.plist')) - for fn in os.listdir('resources'): - if fn == '.svn': continue - if fn.endswith('.jpg'): - shutil.copy(os.path.join('resources', fn), os.path.join(rsrcDir, fn)) - else: - patchFile(os.path.join('resources', fn), os.path.join(rsrcDir, fn)) - - shutil.copy("../../../LICENSE", os.path.join(rsrcDir, 'License.txt')) - - -def installSize(clear=False, _saved=[]): - if clear: - del _saved[:] - if not _saved: - data = captureCommand("du -ks %s"%( - shellQuote(os.path.join(WORKDIR, '_root')))) - _saved.append("%d"%((0.5 + (int(data.split()[0]) / 1024.0)),)) - return _saved[0] - - -def buildDMG(): - """ - Create DMG containing the rootDir - """ - outdir = os.path.join(WORKDIR, 'diskimage') - if os.path.exists(outdir): - shutil.rmtree(outdir) - - imagepath = os.path.join(outdir, - 'python-%s-macosx'%(getFullVersion(),)) - if INCLUDE_TIMESTAMP: - imagepath = imagepath + '%04d-%02d-%02d'%(time.localtime()[:3]) - imagepath = imagepath + '.dmg' - - os.mkdir(outdir) - runCommand("hdiutil create -volname 'Univeral MacPython %s' -srcfolder %s %s"%( - getFullVersion(), - shellQuote(os.path.join(WORKDIR, 'installer')), - shellQuote(imagepath))) - - return imagepath - - -def setIcon(filePath, icnsPath): - """ - Set the custom icon for the specified file or directory. - - For a directory the icon data is written in a file named 'Icon\r' inside - the directory. For both files and directories write the icon as an 'icns' - resource. Furthermore set kHasCustomIcon in the finder flags for filePath. - """ - ref, isDirectory = Carbon.File.FSPathMakeRef(icnsPath) - icon = Carbon.Icn.ReadIconFile(ref) - del ref - - # - # Open the resource fork of the target, to add the icon later on. - # For directories we use the file 'Icon\r' inside the directory. - # - - ref, isDirectory = Carbon.File.FSPathMakeRef(filePath) - - if isDirectory: - tmpPath = os.path.join(filePath, "Icon\r") - if not os.path.exists(tmpPath): - fp = open(tmpPath, 'w') - fp.close() - - tmpRef, _ = Carbon.File.FSPathMakeRef(tmpPath) - spec = Carbon.File.FSSpec(tmpRef) - - else: - spec = Carbon.File.FSSpec(ref) - - try: - Carbon.Res.HCreateResFile(*spec.as_tuple()) - except MacOS.Error: - pass - - # Try to create the resource fork again, this will avoid problems - # when adding an icon to a directory. I have no idea why this helps, - # but without this adding the icon to a directory will fail sometimes. - try: - Carbon.Res.HCreateResFile(*spec.as_tuple()) - except MacOS.Error: - pass - - refNum = Carbon.Res.FSpOpenResFile(spec, fsRdWrPerm) - - Carbon.Res.UseResFile(refNum) - - # Check if there already is an icon, remove it if there is. - try: - h = Carbon.Res.Get1Resource('icns', kCustomIconResource) - except MacOS.Error: - pass - - else: - h.RemoveResource() - del h - - # Add the icon to the resource for of the target - res = Carbon.Res.Resource(icon) - res.AddResource('icns', kCustomIconResource, '') - res.WriteResource() - res.DetachResource() - Carbon.Res.CloseResFile(refNum) - - # And now set the kHasCustomIcon property for the target. Annoyingly, - # python doesn't seem to have bindings for the API that is needed for - # this. Cop out and call SetFile - os.system("/Developer/Tools/SetFile -a C %s"%( - shellQuote(filePath),)) - - if isDirectory: - os.system('/Developer/Tools/SetFile -a V %s'%( - shellQuote(tmpPath), - )) - -def main(): - # First parse options and check if we can perform our work - parseOptions() - checkEnvironment() - - os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3' - - if os.path.exists(WORKDIR): - shutil.rmtree(WORKDIR) - os.mkdir(WORKDIR) - - # Then build third-party libraries such as sleepycat DB4. - buildLibraries() - - # Now build python itself - buildPython() - buildPythonDocs() - fn = os.path.join(WORKDIR, "_root", "Applications", - "MacPython %s"%(getVersion(),), "Update Shell Profile.command") - shutil.copy("scripts/postflight.patch-profile", fn) - os.chmod(fn, 0755) - - folder = os.path.join(WORKDIR, "_root", "Applications", "MacPython %s"%( - getVersion(),)) - os.chmod(folder, 0755) - setIcon(folder, "../Icons/Python Folder.icns") - - # Create the installer - buildInstaller() - - # And copy the readme into the directory containing the installer - patchFile('resources/ReadMe.txt', os.path.join(WORKDIR, 'installer', 'ReadMe.txt')) - - # Ditto for the license file. - shutil.copy('../../../LICENSE', os.path.join(WORKDIR, 'installer', 'License.txt')) - - fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w') - print >> fp, "# BUILD INFO" - print >> fp, "# Date:", time.ctime() - print >> fp, "# By:", pwd.getpwuid(os.getuid()).pw_gecos - fp.close() - - # Custom icon for the DMG, shown when the DMG is mounted. - shutil.copy("../Icons/Disk Image.icns", - os.path.join(WORKDIR, "installer", ".VolumeIcon.icns")) - os.system("/Developer/Tools/SetFile -a C %s"%( - os.path.join(WORKDIR, "installer", ".VolumeIcon.icns"))) - - - # And copy it to a DMG - buildDMG() - - -if __name__ == "__main__": - main() diff --git a/Mac/OSX/BuildScript/ncurses-5.5.patch b/Mac/OSX/BuildScript/ncurses-5.5.patch deleted file mode 100644 index 0eab3d3..0000000 --- a/Mac/OSX/BuildScript/ncurses-5.5.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -r -u ncurses-5.5-orig/test/Makefile.in ncurses-5.5/test/Makefile.in ---- ncurses-5.5-orig/test/Makefile.in 2006-03-24 12:47:40.000000000 +0100 -+++ ncurses-5.5/test/Makefile.in 2006-03-24 12:47:50.000000000 +0100 -@@ -75,7 +75,7 @@ - MATH_LIB = @MATH_LIB@ - - LD = @LD@ --LINK = @LINK_TESTS@ $(LIBTOOL_LINK) $(CC) $(CFLAGS) -+LINK = @LINK_TESTS@ $(LIBTOOL_LINK) $(CC) - - usFLAGS = @LD_MODEL@ @LOCAL_LDFLAGS@ @LDFLAGS@ - -diff -ru ncurses-5.5-orig/ncurses/tinfo/read_entry.c ncurses-5.5/ncurses/tinfo/read_entry.c ---- ncurses-5.5-orig/ncurses/tinfo/read_entry.c 2004-01-11 02:57:05.000000000 +0100 -+++ ncurses-5.5/ncurses/tinfo/read_entry.c 2006-03-25 22:49:39.000000000 +0100 -@@ -474,7 +474,7 @@ - } - - /* truncate the terminal name to prevent buffer overflow */ -- (void) sprintf(ttn, "%c/%.*s", *tn, (int) sizeof(ttn) - 3, tn); -+ (void) sprintf(ttn, "%x/%.*s", *tn, (int) sizeof(ttn) - 3, tn); - - /* This is System V behavior, in conjunction with our requirements for - * writing terminfo entries. -diff -ru ncurses-5.5-orig/configure ncurses-5.5/configure ---- ncurses-5.5-orig/configure 2005-09-24 23:50:50.000000000 +0200 -+++ ncurses-5.5/configure 2006-03-26 22:24:59.000000000 +0200 -@@ -5027,7 +5027,7 @@ - darwin*) - EXTRA_CFLAGS="-no-cpp-precomp" - CC_SHARED_OPTS="-dynamic" -- MK_SHARED_LIB='$(CC) -dynamiclib -install_name $(DESTDIR)$(libdir)/`basename $@` -compatibility_version $(ABI_VERSION) -current_version $(ABI_VERSION) -o $@' -+ MK_SHARED_LIB='$(CC) $(CFLAGS) -dynamiclib -install_name $(DESTDIR)$(libdir)/`basename $@` -compatibility_version $(ABI_VERSION) -current_version $(ABI_VERSION) -o $@' - test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi - cf_cv_shlib_version_infix=yes - ;; diff --git a/Mac/OSX/BuildScript/resources/ReadMe.txt b/Mac/OSX/BuildScript/resources/ReadMe.txt deleted file mode 100644 index 1a6e637..0000000 --- a/Mac/OSX/BuildScript/resources/ReadMe.txt +++ /dev/null @@ -1,31 +0,0 @@ -This package will install MacPython $FULL_VERSION for Mac OS X -$MACOSX_DEPLOYMENT_TARGET for the following -architecture(s): $ARCHITECTURES. - -Separate installers are available for older versions -of Mac OS X, see the homepage, below. - -Installation requires approximately $INSTALL_SIZE MB of disk -space, ignore the message that it will take zero bytes. - -You must install onto your current boot disk, even -though the installer does not enforce this, otherwise -things will not work. - -MacPython consists of the Python programming language -interpreter, plus a set of programs to allow easy -access to it for Mac users (an integrated development -environment, an applet builder), plus a set of pre-built -extension modules that open up specific Macintosh technologies -to Python programs (Carbon, AppleScript, Quicktime, more). - -The installer puts the applications in "MacPython $VERSION" -in your Applications folder, command-line tools in -/usr/local/bin and the underlying machinery in -$PYTHONFRAMEWORKINSTALLDIR. - -More information on MacPython can be found at -http://www.cwi.nl/~jack/macpython and -http://pythonmac.org/. More information on -Python in general can be found at -http://www.python.org. diff --git a/Mac/OSX/BuildScript/resources/Welcome.rtf b/Mac/OSX/BuildScript/resources/Welcome.rtf deleted file mode 100644 index cb65f09..0000000 --- a/Mac/OSX/BuildScript/resources/Welcome.rtf +++ /dev/null @@ -1,15 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf330 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;} -{\colortbl;\red255\green255\blue255;} -\paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0 -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural - -\f0\fs24 \cf0 This package will install -\f1\b MacPython $FULL_VERSION -\f0\b0 for -\f1\b Mac OS X $MACOSX_DEPLOYMENT_TARGET -\f0\b0 .\ -\ -MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users (an integrated development environment, an applet builder), plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs (Carbon, AppleScript, Quicktime, more).\ -\ -See the ReadMe file for more information.} \ No newline at end of file diff --git a/Mac/OSX/BuildScript/resources/background.jpg b/Mac/OSX/BuildScript/resources/background.jpg deleted file mode 100644 index b3c7640..0000000 Binary files a/Mac/OSX/BuildScript/resources/background.jpg and /dev/null differ diff --git a/Mac/OSX/BuildScript/scripts/postflight.documentation b/Mac/OSX/BuildScript/scripts/postflight.documentation deleted file mode 100755 index 85d400f..0000000 --- a/Mac/OSX/BuildScript/scripts/postflight.documentation +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# FIXME -PYVER="@PYVER@" - -if [ -d /Developer/Documentation ]; then - if [ ! -d /Developer/Documentation/Python ]; then - mkdir -p /Developer/Documentation/Python - fi - - ln -fhs /Library/Frameworks/Python.framework/Versions/${PYVER}/Resources/English.lproj/Documentation "/Developer/Documentation/Python/Reference Documentation" -fi diff --git a/Mac/OSX/BuildScript/scripts/postflight.framework b/Mac/OSX/BuildScript/scripts/postflight.framework deleted file mode 100755 index 532e745..0000000 --- a/Mac/OSX/BuildScript/scripts/postflight.framework +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# -# Recompile the .py files. -# - -PYVER="@PYVER@" -FWK="/Library/Frameworks/Python.framework/Versions/@PYVER@/" - -"${FWK}/bin/python" -Wi -tt \ - "${FWK}/lib/python${PYVER}/compileall.py" \ - -x badsyntax -x site-packages \ - "${FWK}/lib/python${PYVER}" - -"${FWK}/bin/python" -Wi -tt -O \ - "${FWK}/lib/python${PYVER}/compileall.py" \ - -x badsyntax -x site-packages \ - "${FWK}/lib/python${PYVER}" - -"${FWK}/bin/python" -Wi -tt \ - "${FWK}/lib/python${PYVER}/compileall.py" \ - -x badsyntax -x site-packages \ - "${FWK}/Mac/Tools" - -"${FWK}/bin/python" -Wi -tt -O \ - "${FWK}/lib/python${PYVER}/compileall.py" \ - -x badsyntax -x site-packages \ - "${FWK}/Mac/Tools" - - -chown -R admin "${FWK}" -chmod -R g+w "${FWK}" - -exit 0 diff --git a/Mac/OSX/BuildScript/scripts/postflight.patch-profile b/Mac/OSX/BuildScript/scripts/postflight.patch-profile deleted file mode 100755 index 48bf701..0000000 --- a/Mac/OSX/BuildScript/scripts/postflight.patch-profile +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -echo "This script will update your shell profile when the 'bin' directory" -echo "of python is not early enough of the PATH of your shell." -echo "These changes will be effective only in shell windows that you open" -echo "after running this script." - -PYVER=@PYVER@ -PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/Current" - -# Make sure the directory ${PYTHON_ROOT}/bin is on the users PATH. -BSH="`basename "${SHELL}"`" -case "${BSH}" in -bash|ksh|sh|*csh) - P="`${SHELL} -c 'echo $PATH'`" - ;; -*) - echo "Sorry, I don't know how to patch $BSH shells" - exit 0 - ;; -esac - -# Now ensure that our bin directory is on $P and before /usr/bin at that -for elem in `echo $P | tr ':' ' '` -do - if [ "${elem}" == "${PYTHON_ROOT}/bin" ]; then - echo "All right, you're a python lover already" - exit 0 - elif [ "${elem}" == "/usr/bin" ]; then - break - fi -done - -echo "${PYTHON_ROOT}/bin is not on your PATH or at least not early enough" -case "${BSH}" in -*csh) - # Create backup copy before patching - if [ -f "${HOME}/.cshrc" ]; then - cp -fp "${HOME}/.cshrc" "${HOME}/.cshrc.pysave" - fi - echo "" >> "${HOME}/.cshrc" - echo "# Setting PATH for MacPython ${PYVER}" >> "${HOME}/.cshrc" - echo "# The orginal version is saved in .cshrc.pysave" >> "${HOME}/.cshrc" - echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${HOME}/.cshrc" - exit 0 - ;; -bash) - if [ -e "${HOME}/.profile" ]; then - PR="${HOME}/.profile" - else - PR="${HOME}/.bash_profile" - fi - ;; -*sh) - PR="${HOME}/.profile" - ;; -esac - -# Create backup copy before patching -if [ -f "${PR}" ]; then - cp -fp "${PR}" "${PR}.pysave" -fi -echo "" >> "${PR}" -echo "# Setting PATH for MacPython ${PYVER}" >> "${PR}" -echo "# The orginal version is saved in `basename ${PR}`.pysave" >> "${PR}" -echo 'PATH="'"${PYTHON_ROOT}/bin"':${PATH}"' >> "${PR}" -echo 'export PATH' >> "${PR}" -if [ `id -ur` = 0 ]; then - chown "${LOGNAME}" "${PR}" -fi -exit 0 diff --git a/Mac/OSX/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py b/Mac/OSX/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py deleted file mode 100644 index 58d7307..0000000 --- a/Mac/OSX/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py +++ /dev/null @@ -1,110 +0,0 @@ -"""Suite Help Indexing Tool Suite: Special events that just the Help Indexing Tool supports. -Level 0, version 0 - -Generated from /Developer/Applications/Apple Help Indexing Tool.app -AETE/AEUT resource version 1/1, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'HIT ' - -class Help_Indexing_Tool_Suite_Events: - - def turn_anchor_indexing(self, _object, _attributes={}, **_arguments): - """turn anchor indexing: Turns anchor indexing on or off. - Required argument: \xd2on\xd3 or \xd2off\xd3, to turn anchor indexing on or off - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'HIT ' - _subcode = 'tAnc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_turn_remote_root = { - 'with_root_url' : 'rURL', - } - - def turn_remote_root(self, _object, _attributes={}, **_arguments): - """turn remote root: Turn usage of remote root for content on the web on or off. If turning \xd2on\xd3, supply a string as second parameter. - Required argument: \xd2on\xd3 or \xd2off\xd3, to turn remote root on or off - Keyword argument with_root_url: The remote root to use, in the form of \xd2http://www.apple.com/help/\xd3. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'HIT ' - _subcode = 'tRem' - - aetools.keysubst(_arguments, self._argmap_turn_remote_root) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def use_tokenizer(self, _object, _attributes={}, **_arguments): - """use tokenizer: Tells the indexing tool which tokenizer to use. - Required argument: Specify \xd2English\xd3, \xd2European\xd3, \xd2Japanese\xd3, \xd2Korean\xd3, or \xd2Simple\xd3. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'HIT ' - _subcode = 'uTok' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - Application class """ - want = 'capp' -class _Prop_idleStatus(aetools.NProperty): - """idleStatus - """ - which = 'sIdl' - want = 'bool' -application._superclassnames = [] -application._privpropdict = { - 'idleStatus' : _Prop_idleStatus, -} -application._privelemdict = { -} - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, -} - -_propdeclarations = { - 'sIdl' : _Prop_idleStatus, -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/Mac/OSX/Doc/HelpIndexingTool/Miscellaneous_Standards.py b/Mac/OSX/Doc/HelpIndexingTool/Miscellaneous_Standards.py deleted file mode 100644 index 3cf745f..0000000 --- a/Mac/OSX/Doc/HelpIndexingTool/Miscellaneous_Standards.py +++ /dev/null @@ -1,49 +0,0 @@ -"""Suite Miscellaneous Standards: Useful events that aren\xd5t in any other suite -Level 0, version 0 - -Generated from /Developer/Applications/Apple Help Indexing Tool.app -AETE/AEUT resource version 1/1, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'misc' - -class Miscellaneous_Standards_Events: - - def revert(self, _object, _attributes={}, **_arguments): - """revert: Revert an object to the most recently saved version - Required argument: object to revert - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'rvrt' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/Mac/OSX/Doc/HelpIndexingTool/Required_Suite.py b/Mac/OSX/Doc/HelpIndexingTool/Required_Suite.py deleted file mode 100644 index eb9fee0..0000000 --- a/Mac/OSX/Doc/HelpIndexingTool/Required_Suite.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Suite Required Suite: Terms that every application should support -Level 1, version 1 - -Generated from /Developer/Applications/Apple Help Indexing Tool.app -AETE/AEUT resource version 1/1, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'reqd' - -from StdSuites.Required_Suite import * -class Required_Suite_Events(Required_Suite_Events): - - pass - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/Mac/OSX/Doc/HelpIndexingTool/Standard_Suite.py b/Mac/OSX/Doc/HelpIndexingTool/Standard_Suite.py deleted file mode 100644 index 4f6604c..0000000 --- a/Mac/OSX/Doc/HelpIndexingTool/Standard_Suite.py +++ /dev/null @@ -1,343 +0,0 @@ -"""Suite Standard Suite: Common terms for most applications -Level 1, version 1 - -Generated from /Developer/Applications/Apple Help Indexing Tool.app -AETE/AEUT resource version 1/1, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'CoRe' - -from StdSuites.Standard_Suite import * -class Standard_Suite_Events(Standard_Suite_Events): - - _argmap_close = { - 'saving' : 'savo', - 'in_' : 'kfil', - } - - def close(self, _object, _attributes={}, **_arguments): - """close: Close an object - Required argument: the objects to close - Keyword argument saving: specifies whether or not changes should be saved before closing - Keyword argument in_: the file in which to save the object - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'clos' - - aetools.keysubst(_arguments, self._argmap_close) - _arguments['----'] = _object - - aetools.enumsubst(_arguments, 'savo', _Enum_savo) - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def data_size(self, _object, _attributes={}, **_arguments): - """data size: Return the size in bytes of an object - Required argument: the object whose data size is to be returned - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: the size of the object in bytes - """ - _code = 'core' - _subcode = 'dsiz' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def get(self, _object, _attributes={}, **_arguments): - """get: Get the data for an object - Required argument: the object whose data is to be returned - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: The data from the object - """ - _code = 'core' - _subcode = 'getd' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_make = { - 'new' : 'kocl', - 'at' : 'insh', - 'with_data' : 'data', - 'with_properties' : 'prdt', - } - - def make(self, _no_object=None, _attributes={}, **_arguments): - """make: Make a new element - Keyword argument new: the class of the new element - Keyword argument at: the location at which to insert the element - Keyword argument with_data: the initial data for the element - Keyword argument with_properties: the initial values for the properties of the element - Keyword argument _attributes: AppleEvent attribute dictionary - Returns: Object specifier for the new element - """ - _code = 'core' - _subcode = 'crel' - - aetools.keysubst(_arguments, self._argmap_make) - if _no_object != None: raise TypeError, 'No direct arg expected' - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def open(self, _object, _attributes={}, **_arguments): - """open: Open the specified object(s) - Required argument: Objects to open. Can be a list of files or an object specifier. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'odoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - def print_(self, _object, _attributes={}, **_arguments): - """print: Print the specified object(s) - Required argument: Objects to print. Can be a list of files or an object specifier. - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'aevt' - _subcode = 'pdoc' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_save = { - 'in_' : 'kfil', - 'as' : 'fltp', - } - - def save(self, _object, _attributes={}, **_arguments): - """save: save a set of objects - Required argument: Objects to save. - Keyword argument in_: the file in which to save the object(s) - Keyword argument as: the file type of the document in which to save the data - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'save' - - aetools.keysubst(_arguments, self._argmap_save) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - _argmap_set = { - 'to' : 'data', - } - - def set(self, _object, _attributes={}, **_arguments): - """set: Set an object\xd5s data - Required argument: the object to change - Keyword argument to: the new value - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'core' - _subcode = 'setd' - - aetools.keysubst(_arguments, self._argmap_set) - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -class application(aetools.ComponentItem): - """application - An application program """ - want = 'capp' -# element 'cwin' as ['indx', 'name', 'rele'] -# element 'docu' as ['name'] - -class window(aetools.ComponentItem): - """window - A Window """ - want = 'cwin' -class _Prop_bounds(aetools.NProperty): - """bounds - the boundary rectangle for the window """ - which = 'pbnd' - want = 'qdrt' -class _Prop_closeable(aetools.NProperty): - """closeable - Does the window have a close box? """ - which = 'hclb' - want = 'bool' -class _Prop_floating(aetools.NProperty): - """floating - Does the window float? """ - which = 'isfl' - want = 'bool' -class _Prop_index(aetools.NProperty): - """index - the number of the window """ - which = 'pidx' - want = 'long' -class _Prop_modal(aetools.NProperty): - """modal - Is the window modal? """ - which = 'pmod' - want = 'bool' -class _Prop_name(aetools.NProperty): - """name - the title of the window """ - which = 'pnam' - want = 'itxt' -class _Prop_position(aetools.NProperty): - """position - upper left coordinates of window """ - which = 'ppos' - want = 'QDpt' -class _Prop_resizable(aetools.NProperty): - """resizable - Is the window resizable? """ - which = 'prsz' - want = 'bool' -class _Prop_titled(aetools.NProperty): - """titled - Does the window have a title bar? """ - which = 'ptit' - want = 'bool' -class _Prop_visible(aetools.NProperty): - """visible - is the window visible? """ - which = 'pvis' - want = 'bool' -class _Prop_zoomable(aetools.NProperty): - """zoomable - Is the window zoomable? """ - which = 'iszm' - want = 'bool' -class _Prop_zoomed(aetools.NProperty): - """zoomed - Is the window zoomed? """ - which = 'pzum' - want = 'bool' - -class document(aetools.ComponentItem): - """document - A Document """ - want = 'docu' -class _Prop_modified(aetools.NProperty): - """modified - Has the document been modified since the last save? """ - which = 'imod' - want = 'bool' -application._superclassnames = [] -application._privpropdict = { -} -application._privelemdict = { - 'document' : document, - 'window' : window, -} -window._superclassnames = [] -window._privpropdict = { - 'bounds' : _Prop_bounds, - 'closeable' : _Prop_closeable, - 'floating' : _Prop_floating, - 'index' : _Prop_index, - 'modal' : _Prop_modal, - 'name' : _Prop_name, - 'position' : _Prop_position, - 'resizable' : _Prop_resizable, - 'titled' : _Prop_titled, - 'visible' : _Prop_visible, - 'zoomable' : _Prop_zoomable, - 'zoomed' : _Prop_zoomed, -} -window._privelemdict = { -} -document._superclassnames = [] -document._privpropdict = { - 'modified' : _Prop_modified, - 'name' : _Prop_name, -} -document._privelemdict = { -} -_Enum_savo = { - 'yes' : 'yes ', # Save objects now - 'no' : 'no ', # Do not save objects - 'ask' : 'ask ', # Ask the user whether to save -} - - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'capp' : application, - 'cwin' : window, - 'docu' : document, -} - -_propdeclarations = { - 'hclb' : _Prop_closeable, - 'imod' : _Prop_modified, - 'isfl' : _Prop_floating, - 'iszm' : _Prop_zoomable, - 'pbnd' : _Prop_bounds, - 'pidx' : _Prop_index, - 'pmod' : _Prop_modal, - 'pnam' : _Prop_name, - 'ppos' : _Prop_position, - 'prsz' : _Prop_resizable, - 'ptit' : _Prop_titled, - 'pvis' : _Prop_visible, - 'pzum' : _Prop_zoomed, -} - -_compdeclarations = { -} - -_enumdeclarations = { - 'savo' : _Enum_savo, -} diff --git a/Mac/OSX/Doc/HelpIndexingTool/__init__.py b/Mac/OSX/Doc/HelpIndexingTool/__init__.py deleted file mode 100644 index 5359df5..0000000 --- a/Mac/OSX/Doc/HelpIndexingTool/__init__.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -Package generated from /Developer/Applications/Apple Help Indexing Tool.app -""" -import aetools -Error = aetools.Error -import Standard_Suite -import Help_Indexing_Tool_Suite -import odds_and_ends -import Miscellaneous_Standards -import Required_Suite - - -_code_to_module = { - 'CoRe' : Standard_Suite, - 'HIT ' : Help_Indexing_Tool_Suite, - 'Odds' : odds_and_ends, - 'misc' : Miscellaneous_Standards, - 'reqd' : Required_Suite, -} - - - -_code_to_fullname = { - 'CoRe' : ('HelpIndexingTool.Standard_Suite', 'Standard_Suite'), - 'HIT ' : ('HelpIndexingTool.Help_Indexing_Tool_Suite', 'Help_Indexing_Tool_Suite'), - 'Odds' : ('HelpIndexingTool.odds_and_ends', 'odds_and_ends'), - 'misc' : ('HelpIndexingTool.Miscellaneous_Standards', 'Miscellaneous_Standards'), - 'reqd' : ('HelpIndexingTool.Required_Suite', 'Required_Suite'), -} - -from Standard_Suite import * -from Help_Indexing_Tool_Suite import * -from odds_and_ends import * -from Miscellaneous_Standards import * -from Required_Suite import * - -def getbaseclasses(v): - if not getattr(v, '_propdict', None): - v._propdict = {} - v._elemdict = {} - for superclassname in getattr(v, '_superclassnames', []): - superclass = eval(superclassname) - getbaseclasses(superclass) - v._propdict.update(getattr(superclass, '_propdict', {})) - v._elemdict.update(getattr(superclass, '_elemdict', {})) - v._propdict.update(getattr(v, '_privpropdict', {})) - v._elemdict.update(getattr(v, '_privelemdict', {})) - -import StdSuites - -# -# Set property and element dictionaries now that all classes have been defined -# -getbaseclasses(window) -getbaseclasses(application) -getbaseclasses(document) -getbaseclasses(application) - -# -# Indices of types declared in this module -# -_classdeclarations = { - 'cwin' : window, - 'capp' : application, - 'docu' : document, - 'capp' : application, -} - - -class HelpIndexingTool(Standard_Suite_Events, - Help_Indexing_Tool_Suite_Events, - odds_and_ends_Events, - Miscellaneous_Standards_Events, - Required_Suite_Events, - aetools.TalkTo): - _signature = 'hiti' - - _moduleName = 'HelpIndexingTool' diff --git a/Mac/OSX/Doc/HelpIndexingTool/odds_and_ends.py b/Mac/OSX/Doc/HelpIndexingTool/odds_and_ends.py deleted file mode 100644 index 7ee46f3..0000000 --- a/Mac/OSX/Doc/HelpIndexingTool/odds_and_ends.py +++ /dev/null @@ -1,49 +0,0 @@ -"""Suite odds and ends: Things that should be in some standard suite, but aren\xd5t -Level 1, version 1 - -Generated from /Developer/Applications/Apple Help Indexing Tool.app -AETE/AEUT resource version 1/1, language 0, script 0 -""" - -import aetools -import MacOS - -_code = 'Odds' - -class odds_and_ends_Events: - - def select(self, _object=None, _attributes={}, **_arguments): - """select: Select the specified object - Required argument: the object to select - Keyword argument _attributes: AppleEvent attribute dictionary - """ - _code = 'misc' - _subcode = 'slct' - - if _arguments: raise TypeError, 'No optional args expected' - _arguments['----'] = _object - - - _reply, _arguments, _attributes = self.send(_code, _subcode, - _arguments, _attributes) - if _arguments.get('errn', 0): - raise aetools.Error, aetools.decodeerror(_arguments) - # XXXX Optionally decode result - if _arguments.has_key('----'): - return _arguments['----'] - - -# -# Indices of types declared in this module -# -_classdeclarations = { -} - -_propdeclarations = { -} - -_compdeclarations = { -} - -_enumdeclarations = { -} diff --git a/Mac/OSX/Doc/README b/Mac/OSX/Doc/README deleted file mode 100644 index 4f4d53d..0000000 --- a/Mac/OSX/Doc/README +++ /dev/null @@ -1,35 +0,0 @@ -In this directory you can build the Python documentation in a form that -is suitable for access with Apple Help Viewer. This will enable the -"Python Documentation" menu entries in the MacPython IDE Help menu. - -Unfortunately the procedure to build the docs is not very streamlined. - -First, edit setup.py. At the top, edit MAJOR_VERSION and MINOR_VERSION, -and check that DESTDIR makes sense. The documentation will be installed -inside PythonIDE.app. - -In DocBuild.initialize_options, set self.download to True if you want to -download the docs. Set it to False if you want to build the docs from -the source tree, but this requires LaTex and lots of other stuff. -Doable, but not easy. - -Second, if you want to download the docs you may need to do a couple -more edits. The way the docs are packaged will often change between -major releases. Fiddle DocBuild.downloadDocs to make it do the right -thing (download the docs from python.org, unpack them, rename the -directory to "build/html"). - -After these edits you should be ready to roll. "pythonw setup.py build" -should download and unpack (or build) the docs. Next, it will do some -magic to make the docs indexable. Finally, it will run the Apple Help -Indexing Tool. (This last step is the reason you must use "pythonw" as -opposed to "python"). Usually it will time out while waiting for AHIT to -do its work. Wait until AHIT is done. - -Now you're ready to install with "python setup.py install". - -After this is done test your work. Fire up PythonIDE, and check that -Help->Python Documentation brings up the documentation in the Help Viewer. -Also open an IDE edit window, type something like "import sys", select -"import", and use Help->Lookup in Python Documentation to check that the -index has been generated correctly. diff --git a/Mac/OSX/Doc/setup.py b/Mac/OSX/Doc/setup.py deleted file mode 100644 index bd86a20..0000000 --- a/Mac/OSX/Doc/setup.py +++ /dev/null @@ -1,214 +0,0 @@ -# Build and install an Apple Help Viewer compatible version of the Python -# documentation into the framework. -# Code by Bill Fancher, with some modifications by Jack Jansen. -# -# You must run this as a two-step process -# 1. python setupDocs.py build -# 2. Wait for Apple Help Indexing Tool to finish -# 3. python setupDocs.py install -# -# To do: -# - test whether the docs are available locally before downloading -# - fix buildDocsFromSource -# - Get documentation version from sys.version, fallback to 2.2.1 -# - See if we can somehow detect that Apple Help Indexing Tool is finished -# - data_files to setup() doesn't seem the right way to pass the arguments -# -import sys, os, re -from distutils.cmd import Command -from distutils.command.build import build -from distutils.core import setup -from distutils.file_util import copy_file -from distutils.dir_util import copy_tree -from distutils.log import log -from distutils.spawn import spawn -from distutils import sysconfig, dep_util -from distutils.util import change_root -import HelpIndexingTool -import Carbon.File -import time - -MAJOR_VERSION='2.4' -MINOR_VERSION='2.4.1' -DESTDIR='/Applications/MacPython-%s/PythonIDE.app/Contents/Resources/English.lproj/PythonDocumentation' % MAJOR_VERSION - -class DocBuild(build): - def initialize_options(self): - build.initialize_options(self) - self.build_html = None - self.build_dest = None - self.download = 1 - self.doc_version = MINOR_VERSION # Only needed if download is true - - def finalize_options(self): - build.finalize_options(self) - if self.build_html is None: - self.build_html = os.path.join(self.build_base, 'html') - if self.build_dest is None: - self.build_dest = os.path.join(self.build_base, 'PythonDocumentation') - - def spawn(self, *args): - spawn(args, 1, self.verbose, self.dry_run) - - def downloadDocs(self): - workdir = os.getcwd() - # XXX Note: the next strings may change from version to version - url = 'http://www.python.org/ftp/python/doc/%s/html-%s.tar.bz2' % \ - (self.doc_version,self.doc_version) - tarfile = 'html-%s.tar.bz2' % self.doc_version - dirname = 'Python-Docs-%s' % self.doc_version - - if os.path.exists(self.build_html): - raise RuntimeError, '%s: already exists, please remove and try again' % self.build_html - os.chdir(self.build_base) - self.spawn('curl','-O', url) - self.spawn('tar', '-xjf', tarfile) - os.rename(dirname, 'html') - os.chdir(workdir) -## print "** Please unpack %s" % os.path.join(self.build_base, tarfile) -## print "** Unpack the files into %s" % self.build_html -## raise RuntimeError, "You need to unpack the docs manually" - - def buildDocsFromSource(self): - srcdir = '../../..' - docdir = os.path.join(srcdir, 'Doc') - htmldir = os.path.join(docdir, 'html') - spawn(('make','--directory', docdir, 'html'), 1, self.verbose, self.dry_run) - self.mkpath(self.build_html) - copy_tree(htmldir, self.build_html) - - def ensureHtml(self): - if not os.path.exists(self.build_html): - if self.download: - self.downloadDocs() - else: - self.buildDocsFromSource() - - def hackIndex(self): - ind_html = 'index.html' - #print 'self.build_dest =', self.build_dest - hackedIndex = file(os.path.join(self.build_dest, ind_html),'w') - origIndex = file(os.path.join(self.build_html,ind_html)) - r = re.compile('', re.DOTALL) - hackedIndex.write(r.sub('',origIndex.read())) - - def hackFile(self,d,f): - origPath = os.path.join(d,f) - assert(origPath[:len(self.build_html)] == self.build_html) - outPath = os.path.join(self.build_dest, d[len(self.build_html)+1:], f) - (name, ext) = os.path.splitext(f) - if os.path.isdir(origPath): - self.mkpath(outPath) - elif ext == '.html': - if self.verbose: print 'hacking %s to %s' % (origPath,outPath) - hackedFile = file(outPath, 'w') - origFile = file(origPath,'r') - hackedFile.write(self.r.sub('
', origFile.read())) - else: - copy_file(origPath, outPath) - - def hackHtml(self): - self.r = re.compile('
') - os.path.walk(self.build_html, self.visit, None) - - def visit(self, dummy, dirname, filenames): - for f in filenames: - self.hackFile(dirname, f) - - def makeHelpIndex(self): - app = '/Developer/Applications/Apple Help Indexing Tool.app' - self.spawn('open', '-a', app , self.build_dest) - print "Please wait until Apple Help Indexing Tool finishes before installing" - - def makeHelpIndex(self): - app = HelpIndexingTool.HelpIndexingTool(start=1) - app.open(Carbon.File.FSSpec(self.build_dest)) - sys.stderr.write("Waiting for Help Indexing Tool to start...") - while 1: - # This is bad design in the suite generation code! - idle = app._get(HelpIndexingTool.Help_Indexing_Tool_Suite._Prop_idleStatus()) - time.sleep(10) - if not idle: break - sys.stderr.write(".") - sys.stderr.write("\n") - sys.stderr.write("Waiting for Help Indexing Tool to finish...") - while 1: - # This is bad design in the suite generation code! - idle = app._get(HelpIndexingTool.Help_Indexing_Tool_Suite._Prop_idleStatus()) - time.sleep(10) - if idle: break - sys.stderr.write(".") - sys.stderr.write("\n") - - - def run(self): - self.ensure_finalized() - self.mkpath(self.build_base) - self.ensureHtml() - if not os.path.isdir(self.build_html): - raise RuntimeError, \ - "Can't find source folder for documentation." - self.mkpath(self.build_dest) - if dep_util.newer(os.path.join(self.build_html,'index.html'), os.path.join(self.build_dest,'index.html')): - self.mkpath(self.build_dest) - self.hackHtml() - self.hackIndex() - self.makeHelpIndex() - -class AHVDocInstall(Command): - description = "install Apple Help Viewer html files" - user_options = [('install-doc=', 'd', - 'directory to install HTML tree'), - ('root=', None, - "install everything relative to this alternate root directory"), - ] - - def initialize_options(self): - self.build_dest = None - self.install_doc = None - self.prefix = None - self.root = None - - def finalize_options(self): - self.set_undefined_options('install', - ('prefix', 'prefix'), - ('root', 'root')) -# import pdb ; pdb.set_trace() - build_cmd = self.get_finalized_command('build') - if self.build_dest == None: - build_cmd = self.get_finalized_command('build') - self.build_dest = build_cmd.build_dest - if self.install_doc == None: - self.install_doc = os.path.join(self.prefix, DESTDIR) - print 'INSTALL', self.build_dest, '->', self.install_doc - - def run(self): - self.finalize_options() - self.ensure_finalized() - print "Running Installer" - instloc = self.install_doc - if self.root: - instloc = change_root(self.root, instloc) - self.mkpath(instloc) - copy_tree(self.build_dest, instloc) - print "Installation complete" - -def mungeVersion(infile, outfile): - i = file(infile,'r') - o = file(outfile,'w') - o.write(re.sub('\$\(VERSION\)',sysconfig.get_config_var('VERSION'),i.read())) - i.close() - o.close() - -def main(): - # turn off warnings when deprecated modules are imported -## import warnings -## warnings.filterwarnings("ignore",category=DeprecationWarning) - setup(name = 'Documentation', - version = '%d.%d' % sys.version_info[:2], - cmdclass = {'install_data':AHVDocInstall, 'build':DocBuild}, - data_files = ['dummy'], - ) - -if __name__ == '__main__': - main() diff --git a/Mac/OSX/Extras.ReadMe.txt b/Mac/OSX/Extras.ReadMe.txt deleted file mode 100644 index 2d7fd42..0000000 --- a/Mac/OSX/Extras.ReadMe.txt +++ /dev/null @@ -1,5 +0,0 @@ -This folder contains examples of Python usage and useful scripts and tools. - -You should be aware that these are not Macintosh-specific but are shared -among Python on all platforms, so there are some that only run on Windows -or Unix or another platform, and/or make little sense on a Macintosh. diff --git a/Mac/OSX/Extras.install.py b/Mac/OSX/Extras.install.py deleted file mode 100644 index ce00af3..0000000 --- a/Mac/OSX/Extras.install.py +++ /dev/null @@ -1,54 +0,0 @@ -"""Recursively copy a directory but skip undesired files and -directories (CVS, backup files, pyc files, etc)""" - -import sys -import os -import shutil - -verbose = 1 -debug = 0 - -def isclean(name): - if name == 'CVS': return 0 - if name == '.cvsignore': return 0 - if name == '.DS_store': return 0 - if name == '.svn': return 0 - if name.endswith('~'): return 0 - if name.endswith('.BAK'): return 0 - if name.endswith('.pyc'): return 0 - if name.endswith('.pyo'): return 0 - if name.endswith('.orig'): return 0 - return 1 - -def copycleandir(src, dst): - for cursrc, dirs, files in os.walk(src): - assert cursrc.startswith(src) - curdst = dst + cursrc[len(src):] - if verbose: - print "mkdir", curdst - if not debug: - if not os.path.exists(curdst): - os.makedirs(curdst) - for fn in files: - if isclean(fn): - if verbose: - print "copy", os.path.join(cursrc, fn), os.path.join(curdst, fn) - if not debug: - shutil.copy2(os.path.join(cursrc, fn), os.path.join(curdst, fn)) - else: - if verbose: - print "skipfile", os.path.join(cursrc, fn) - for i in range(len(dirs)-1, -1, -1): - if not isclean(dirs[i]): - if verbose: - print "skipdir", os.path.join(cursrc, dirs[i]) - del dirs[i] - -def main(): - if len(sys.argv) != 3: - sys.stderr.write("Usage: %s srcdir dstdir\n" % sys.argv[0]) - sys.exit(1) - copycleandir(sys.argv[1], sys.argv[2]) - -if __name__ == '__main__': - main() diff --git a/Mac/OSX/IDLE/Info.plist b/Mac/OSX/IDLE/Info.plist deleted file mode 100644 index bbe2ea1..0000000 --- a/Mac/OSX/IDLE/Info.plist +++ /dev/null @@ -1,55 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - py - pyw - - CFBundleTypeIconFile - PythonSource.icns - CFBundleTypeName - Python Script - CFBundleTypeRole - Editor - - - CFBundleTypeExtensions - - pyc - pyo - - CFBundleTypeIconFile - PythonCompiled.icns - CFBundleTypeName - Python Bytecode Document - CFBundleTypeRole - Editor - - - CFBundleExecutable - IDLE - CFBundleGetInfoString - 2.5, © 001-2006 Python Software Foundation - CFBundleIconFile - IDLE.icns - CFBundleIdentifier - org.python.IDLE - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - IDLE - CFBundlePackageType - APPL - CFBundleShortVersionString - 2.5 - CFBundleVersion - 2.5 - - diff --git a/Mac/OSX/IDLE/Makefile.in b/Mac/OSX/IDLE/Makefile.in deleted file mode 100644 index 5ed1d5a..0000000 --- a/Mac/OSX/IDLE/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -prefix=@prefix@ -CC=@CC@ -LD=@CC@ -BASECFLAGS=@BASECFLAGS@ -OPT=@OPT@ -CFLAGS=$(BASECFLAGS) $(OPT) -LDFLAGS=@LDFLAGS@ -srcdir= @srcdir@ -VERSION= @VERSION@ -UNIVERSALSDK=@UNIVERSALSDK@ -builddir= ../../.. - -RUNSHARED= @RUNSHARED@ -BUILDEXE= @BUILDEXEEXT@ -BUILDPYTHON= ../../../python$(BUILDEXE) - -# Deployment target selected during configure, to be checked -# by distutils -MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@ -@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET - -BUNDLEBULDER=$(srcdir)/../../../Lib/plat-mac/bundlebuilder.py - -PYTHONAPPSDIR=/Applications/MacPython $(VERSION) - -all: IDLE.app - -install: IDLE.app $(srcdir)/config-main.def $(srcdir)/config-extensions.def - test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" - -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)" - touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" - cp $(srcdir)/config-main.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-main.def" - cp $(srcdir)/config-extensions.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-extensions.def" - -clean: - rm -rf IDLE.app - -IDLE.app: \ - $(srcdir)/../Icons/IDLE.icns $(srcdir)/idlemain.py \ - $(srcdir)/../Icons/PythonSource.icns \ - $(srcdir)/../Icons/PythonCompiled.icns - rm -fr IDLE.app - $(RUNSHARED) $(BUILDPYTHON) $(BUNDLEBULDER) \ - --builddir=. \ - --name=IDLE \ - --link-exec \ - --plist=$(srcdir)/Info.plist \ - --mainprogram=$(srcdir)/idlemain.py \ - --iconfile=$(srcdir)/../Icons/IDLE.icns \ - --resource=$(srcdir)/../Icons/PythonSource.icns \ - --resource=$(srcdir)/../Icons/PythonCompiled.icns \ - --python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \ - build diff --git a/Mac/OSX/IDLE/config-extensions.def b/Mac/OSX/IDLE/config-extensions.def deleted file mode 100644 index c17f068..0000000 --- a/Mac/OSX/IDLE/config-extensions.def +++ /dev/null @@ -1,88 +0,0 @@ -# config-extensions.def -# -# IDLE reads several config files to determine user preferences. This -# file is the default configuration file for IDLE extensions settings. -# -# Each extension must have at least one section, named after the extension -# module. This section must contain an 'enable' item (=1 to enable the -# extension, =0 to disable it), it may contain 'enable_editor' or 'enable_shell' -# items, to apply it only to editor/shell windows, and may also contain any -# other general configuration items for the extension. -# -# Each extension must define at least one section named ExtensionName_bindings -# or ExtensionName_cfgBindings. If present, ExtensionName_bindings defines -# virtual event bindings for the extension that are not user re-configurable. -# If present, ExtensionName_cfgBindings defines virtual event bindings for the -# extension that may be sensibly re-configured. -# -# If there are no keybindings for a menus' virtual events, include lines like -# <>= (See [CodeContext], below.) -# -# Currently it is necessary to manually modify this file to change extension -# key bindings and default values. To customize, create -# ~/.idlerc/config-extensions.cfg and append the appropriate customized -# section(s). Those sections will override the defaults in this file. -# -# Note: If a keybinding is already in use when the extension is -# loaded, the extension's virtual event's keybinding will be set to ''. -# -# See config-keys.def for notes on specifying keys and extend.txt for -# information on creating IDLE extensions. - -[FormatParagraph] -enable=1 -[FormatParagraph_cfgBindings] -format-paragraph= - -[AutoExpand] -enable=1 -[AutoExpand_cfgBindings] -expand-word= - -[ZoomHeight] -enable=1 -[ZoomHeight_cfgBindings] -zoom-height= - -[ScriptBinding] -enable=1 -[ScriptBinding_cfgBindings] -run-module= -check-module= - -[CallTips] -enable=1 -[CallTips_cfgBindings] -force-open-calltip= -[CallTips_bindings] -try-open-calltip= -refresh-calltip= - -[ParenMatch] -enable=1 -style= expression -flash-delay= 500 -bell= 1 -[ParenMatch_cfgBindings] -flash-paren= -[ParenMatch_bindings] -paren-closed= - -[AutoComplete] -enable=1 -popupwait=2000 -[AutoComplete_cfgBindings] -force-open-completions= -[AutoComplete_bindings] -autocomplete= -try-open-completions= - -[CodeContext] -enable=1 -enable_shell=0 -numlines=3 -visible=0 -bgcolor=LightGray -fgcolor=Black -[CodeContext_bindings] -toggle-code-context= diff --git a/Mac/OSX/IDLE/config-main.def b/Mac/OSX/IDLE/config-main.def deleted file mode 100644 index 1cdc0c5..0000000 --- a/Mac/OSX/IDLE/config-main.def +++ /dev/null @@ -1,79 +0,0 @@ -# IDLE reads several config files to determine user preferences. This -# file is the default config file for general idle settings. -# -# When IDLE starts, it will look in -# the following two sets of files, in order: -# -# default configuration -# --------------------- -# config-main.def the default general config file -# config-extensions.def the default extension config file -# config-highlight.def the default highlighting config file -# config-keys.def the default keybinding config file -# -# user configuration -# ------------------- -# ~/.idlerc/config-main.cfg the user general config file -# ~/.idlerc/config-extensions.cfg the user extension config file -# ~/.idlerc/config-highlight.cfg the user highlighting config file -# ~/.idlerc/config-keys.cfg the user keybinding config file -# -# On Windows2000 and Windows XP the .idlerc directory is at -# Documents and Settings\\.idlerc -# -# On Windows98 it is at c:\.idlerc -# -# Any options the user saves through the config dialog will be saved to -# the relevant user config file. Reverting any general setting to the -# default causes that entry to be wiped from the user file and re-read -# from the default file. User highlighting themes or keybinding sets are -# retained unless specifically deleted within the config dialog. Choosing -# one of the default themes or keysets just applies the relevant settings -# from the default file. -# -# Additional help sources are listed in the [HelpFiles] section and must be -# viewable by a web browser (or the Windows Help viewer in the case of .chm -# files). These sources will be listed on the Help menu. The pattern is -# -# You can't use a semi-colon in a menu item or path. The path will be platform -# specific because of path separators, drive specs etc. -# -# It is best to use the Configuration GUI to set up additional help sources! -# Example: -#1 = My Extra Help Source;/usr/share/doc/foo/index.html -#2 = Another Help Source;/path/to/another.pdf - -[General] -editor-on-startup= 0 -autosave= 0 -print-command-posix=lpr %s -print-command-win=start /min notepad /p %s -delete-exitfunc= 1 - -[EditorWindow] -width= 80 -height= 40 -font= courier -font-size= 10 -font-bold= 0 -encoding= none - -[FormatParagraph] -paragraph=70 - -[Indent] -use-spaces= 1 -num-spaces= 4 - -[Theme] -default= 1 -name= IDLE Classic - -[Keys] -default= 1 -name= IDLE Classic Mac - -[History] -cyclic=1 - -[HelpFiles] diff --git a/Mac/OSX/IDLE/idlemain.py b/Mac/OSX/IDLE/idlemain.py deleted file mode 100644 index aa75d4c..0000000 --- a/Mac/OSX/IDLE/idlemain.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -Bootstrap script for IDLE as an application bundle. -""" -import sys, os - -from idlelib.PyShell import main - -# Change the current directory the user's home directory, that way we'll get -# a more useful default location in the open/save dialogs. -os.chdir(os.path.expanduser('~/Documents')) - - -# Make sure sys.executable points to the python interpreter inside the -# framework, instead of at the helper executable inside the application -# bundle (the latter works, but doesn't allow access to the window server) -sys.executable = os.path.join(sys.prefix, 'bin', 'python') - -# Look for the -psn argument that the launcher adds and remove it, it will -# only confuse the IDLE startup code. -for idx, value in enumerate(sys.argv): - if value.startswith('-psn_'): - del sys.argv[idx] - break - -#argvemulator.ArgvCollector().mainloop() -if __name__ == '__main__': - main() diff --git a/Mac/OSX/Icons/Disk Image.icns b/Mac/OSX/Icons/Disk Image.icns deleted file mode 100644 index 35f16bf..0000000 Binary files a/Mac/OSX/Icons/Disk Image.icns and /dev/null differ diff --git a/Mac/OSX/Icons/IDLE.icns b/Mac/OSX/Icons/IDLE.icns deleted file mode 100644 index c12c9da..0000000 Binary files a/Mac/OSX/Icons/IDLE.icns and /dev/null differ diff --git a/Mac/OSX/Icons/Python Folder.icns b/Mac/OSX/Icons/Python Folder.icns deleted file mode 100644 index ae766ee..0000000 Binary files a/Mac/OSX/Icons/Python Folder.icns and /dev/null differ diff --git a/Mac/OSX/Icons/PythonCompiled.icns b/Mac/OSX/Icons/PythonCompiled.icns deleted file mode 100644 index 7d9f320..0000000 Binary files a/Mac/OSX/Icons/PythonCompiled.icns and /dev/null differ diff --git a/Mac/OSX/Icons/PythonLauncher.icns b/Mac/OSX/Icons/PythonLauncher.icns deleted file mode 100644 index e09fd38..0000000 Binary files a/Mac/OSX/Icons/PythonLauncher.icns and /dev/null differ diff --git a/Mac/OSX/Icons/PythonSource.icns b/Mac/OSX/Icons/PythonSource.icns deleted file mode 100644 index 9e35c1e..0000000 Binary files a/Mac/OSX/Icons/PythonSource.icns and /dev/null differ diff --git a/Mac/OSX/Icons/ReadMe.txt b/Mac/OSX/Icons/ReadMe.txt deleted file mode 100644 index 226836a..0000000 --- a/Mac/OSX/Icons/ReadMe.txt +++ /dev/null @@ -1,3 +0,0 @@ -The icons for use on MacOS X were created by Jacob Rus -with some feedback from the folks on pythonmac-sig@python.org. - diff --git a/Mac/OSX/Makefile.in b/Mac/OSX/Makefile.in deleted file mode 100644 index d0e39e4..0000000 --- a/Mac/OSX/Makefile.in +++ /dev/null @@ -1,259 +0,0 @@ -# This file can be invoked from the various frameworkinstall... targets in the -# main Makefile. The next couple of variables are overridden on the -# commandline in that case. - -VERSION=@VERSION@ -builddir = ../.. -srcdir = @srcdir@ -prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION) -LIBDEST=$(prefix)/lib/python$(VERSION) -BUILDPYTHON=$(builddir)/python.exe -DESTDIR= -LDFLAGS= @LDFLAGS@ -FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@ - -# These are normally glimpsed from the previous set -bindir=@exec_prefix@/bin -PYTHONAPPSDIR=/Applications/MacPython $(VERSION) -APPINSTALLDIR=$(prefix)/Resources/Python.app - -# Variables for installing the "normal" unix binaries -INSTALLED_PYDOC=$(prefix)/bin/pydoc -INSTALLED_IDLE=$(prefix)/bin/idle -INSTALLED_PYTHON=$(prefix)/bin/python -INSTALLED_PYTHONW=$(prefix)/bin/pythonw -INSTALLED_PYTHONAPP=$(APPINSTALLDIR)/Contents/MacOS/Python - -# Items more-or-less copied from the main Makefile -DIRMODE=755 -FILEMODE=644 -INSTALL=@INSTALL@ -INSTALL_SYMLINK=ln -fsn -INSTALL_PROGRAM=@INSTALL_PROGRAM@ -INSTALL_SCRIPT= @INSTALL_SCRIPT@ -INSTALL_DATA=@INSTALL_DATA@ -LN=@LN@ -STRIPFLAG=-s -CPMAC=/Developer/Tools/CpMac - -APPTEMPLATE=$(srcdir)/../OSXResources/app -APPSUBDIRS=MacOS Resources Resources/English.lproj \ - Resources/English.lproj/Documentation \ - Resources/English.lproj/Documentation/doc \ - Resources/English.lproj/Documentation/ide -DOCDIR=$(srcdir)/../OSXResources/app/Resources/English.lproj/Documentation -DOCINDEX=$(DOCDIR)/"Documentation idx" -CACHERSRC=$(srcdir)/../scripts/cachersrc.py -compileall=$(srcdir)/../../Lib/compileall.py - -installapps: install_Python install_BuildApplet install_PythonLauncher \ - install_IDLE checkapplepython install_pythonw install_versionedtools - -install_pythonw: pythonw - $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)" - $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)" - ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python" - ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw" - -# -# Install unix tools in /usr/local/bin. These are just aliases for the -# actual installation inside the framework. -# -installunixtools: - if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \ - $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\ - fi - for fn in python pythonw idle pydoc python-config smtpd.py \ - python$(VERSION) pythonw$(VERSION) idle$(VERSION) \ - pydoc$(VERSION) python-config$(VERSION) smtpd$(VERSION).py ;\ - do \ - ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\ - done - -# -# Like installunixtools, but only install links to the versioned binaries. -# -altinstallunixtools: - if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \ - $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\ - fi - for fn in python$(VERSION) pythonw$(VERSION) idle$(VERSION) \ - pydoc$(VERSION) python-config$(VERSION) smtpd$(VERSION).py ;\ - do \ - ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\ - done - - -# By default most tools are installed without a version in their basename, to -# make it easier to install (and use) several python versions side-by-side move -# the tools to a version-specific name and add the non-versioned name as an -# alias. -install_versionedtools: - for fn in idle pydoc python-config ;\ - do \ - if [ -h "$(DESTDIR)$(prefix)/bin/$${fn}" ]; then \ - continue ;\ - fi ;\ - mv "$(DESTDIR)$(prefix)/bin/$${fn}" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\ - ln -sf "$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}" ;\ - done - if [ ! -h "$(DESTDIR)$(prefix)/bin/smtpd.py" ]; then \ - mv "$(DESTDIR)$(prefix)/bin/smtpd.py" "$(DESTDIR)$(prefix)/bin/smtpd$(VERSION).py" ;\ - ln -sf "smtpd$(VERSION).py" "$(DESTDIR)$(prefix)/bin/smtpd.py" ;\ - fi - - -pythonw: $(srcdir)/Tools/pythonw.c - $(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c \ - -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/Python"' - - -install_PythonLauncher: - cd PythonLauncher && make install DESTDIR=$(DESTDIR) - -install_Python: - @if test ! -f $(DOCINDEX); then \ - echo WARNING: you should run Apple Help Indexing Tool on $(DOCDIR); \ - fi - @for i in "$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \ - if test ! -d "$(DESTDIR)$$i"; then \ - echo "Creating directory $(DESTDIR)$$i"; \ - $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$$i"; \ - fi;\ - done - @for i in $(APPSUBDIRS); do \ - if test ! -d "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; then \ - echo "Creating directory $(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \ - $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \ - else true; \ - fi; \ - done - @for d in . $(APPSUBDIRS); \ - do \ - a=$(APPTEMPLATE)/$$d; \ - if test ! -d $$a; then continue; else true; fi; \ - b="$(DESTDIR)$(APPINSTALLDIR)/Contents/$$d"; \ - for i in $$a/*; \ - do \ - case $$i in \ - *CVS) ;; \ - *.svn) ;; \ - *.py[co]) ;; \ - *.orig) ;; \ - *~) ;; \ - *idx) \ - echo $(CPMAC) "$$i" $$b; \ - $(CPMAC) "$$i" "$$b"; \ - ;; \ - *) \ - if test -d $$i; then continue; fi; \ - if test -x $$i; then \ - echo $(INSTALL_SCRIPT) "$$i" "$$b"; \ - $(INSTALL_SCRIPT) "$$i" "$$b"; \ - else \ - echo $(INSTALL_DATA) "$$i" "$$b"; \ - $(INSTALL_DATA) "$$i" "$$b"; \ - fi;; \ - esac; \ - done; \ - done - $(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/Python" - -install_IDLE: - cd IDLE && make install - -install_BuildApplet: - $(BUILDPYTHON) $(srcdir)/../scripts/BuildApplet.py \ - --destroot "$(DESTDIR)" \ - --python $(INSTALLED_PYTHONAPP) \ - --output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \ - $(srcdir)/../scripts/BuildApplet.py - -MACLIBDEST=$(LIBDEST)/plat-mac -MACTOOLSDEST=$(prefix)/Mac/Tools -MACTOOLSSRC=$(srcdir)/Mac/Tools -MACTOOLSSUBDIRS=IDE - -installmacsubtree: - @for i in $(MACTOOLSDEST); \ - do \ - if test ! -d $(DESTDIR)$$i; then \ - echo "Creating directory $(DESTDIR)$$i"; \ - $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ - else true; \ - fi; \ - done - @for d in $(MACTOOLSSUBDIRS); \ - do \ - a=$(MACTOOLSSRC)/$$d; \ - if test ! -d $$a; then continue; else true; fi; \ - b=$(DESTDIR)$(MACTOOLSDEST)/$$d; \ - if test ! -d $$b; then \ - echo "Creating directory $$b"; \ - $(INSTALL) -d -m $(DIRMODE) $$b; \ - else true; \ - fi; \ - done - @for d in $(MACTOOLSSUBDIRS); \ - do \ - a=$(MACTOOLSSRC)/$$d; \ - if test ! -d $$a; then continue; else true; fi; \ - b=$(DESTDIR)$(MACTOOLSDEST)/$$d; \ - for i in $$a/*; \ - do \ - case $$i in \ - *CVS) ;; \ - *.svn) ;; \ - *.py[co]) ;; \ - *.orig) ;; \ - *~) ;; \ - *.rsrc) \ - echo $(CPMAC) $$i $$b ; \ - $(CPMAC) $$i $$b ; \ - ;; \ - *) \ - if test -d $$i; then continue; fi; \ - if test -x $$i; then \ - echo $(INSTALL_SCRIPT) $$i $$b; \ - $(INSTALL_SCRIPT) $$i $$b; \ - else \ - echo $(INSTALL_DATA) $$i $$b; \ - $(INSTALL_DATA) $$i $$b; \ - fi;; \ - esac; \ - done; \ - done - - - $(BUILDPYTHON) $(CACHERSRC) -v $(DESTDIR)$(MACLIBDEST) $(DESTDIR)$(MACTOOLSDEST) - $(BUILDPYTHON) -Wi -tt $(compileall) -d $(MACTOOLSDEST) -x badsyntax $(DESTDIR)$(MACTOOLSDEST) - $(BUILDPYTHON) -O -Wi -tt $(compileall) -d $(MACTOOLSDEST) -x badsyntax $(DESTDIR)$(MACTOOLSDEST) - -# -# We use the full name here in stead of $(INSTALLED_PYTHONAPP), because -# the latter may be overridden by Makefile.jaguar when building for a pre-installed -$(APPINSTALLDIR)/Contents/MacOS/Python: install_Python - -# $(INSTALLED_PYTHON) has to be done by the main Makefile, we cannot do that here. -# At least this rule will give an error if it doesn't exist. - -installextras: - $(INSTALL) -d "$(DESTDIR)$(PYTHONAPPSDIR)/Extras" - $(INSTALL) $(srcdir)/Mac/OSX/Extras.ReadMe.txt "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/ReadMe.txt" - $(BUILDPYTHON) $(srcdir)/Mac/OSX/Extras.install.py $(srcdir)/Demo \ - "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo" - - -checkapplepython: - @if ! $(BUILDPYTHON) $(srcdir)/fixapplepython23.py -n; then \ - echo "* WARNING: Apple-installed Python 2.3 will have trouble building extensions from now on."; \ - echo "* WARNING: Run $(srcdir)/fixapplepython23.py with \"sudo\" to fix this."; \ - fi - - -clean: - rm pythonw - cd PythonLauncher && make clean - cd IDLE && make clean - - diff --git a/Mac/OSX/PythonLauncher/English.lproj/Credits.rtf b/Mac/OSX/PythonLauncher/English.lproj/Credits.rtf deleted file mode 100644 index 930ca22..0000000 --- a/Mac/OSX/PythonLauncher/English.lproj/Credits.rtf +++ /dev/null @@ -1,30 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf100 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\b\fs24 \cf0 Engineering: -\f1\b0 \ - Jack Jansen\ -\ - -\f0\b Human Interface Design: -\f1\b0 \ - Jack Jansen\ -\ - -\f0\b Testing: -\f1\b0 \ - Jack Jansen\ - Pythonmac-SIG@python.org\ -\ - -\f0\b Documentation: -\f1\b0 \ - Missing\ -\ - -\f0\b With special thanks to: -\f1\b0 \ - Guido, of course\ -} \ No newline at end of file diff --git a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/classes.nib b/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 47b40ab..0000000 --- a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,12 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {showPreferences = id; }; - CLASS = MyAppDelegate; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/info.nib b/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/info.nib deleted file mode 100644 index b96759a..0000000 --- a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/info.nib +++ /dev/null @@ -1,21 +0,0 @@ - - - - - IBDocumentLocation - 99 33 356 240 0 0 800 578 - IBEditorPositions - - 29 - 82 396 318 44 0 0 800 578 - - IBFramework Version - 263.2 - IBOpenObjects - - 29 - - IBSystem Version - 5S66 - - diff --git a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/objects.nib b/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index 532a5c8..0000000 Binary files a/Mac/OSX/PythonLauncher/English.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib deleted file mode 100644 index bcdc0cd..0000000 --- a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib +++ /dev/null @@ -1,26 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {"do_apply" = id; "do_cancel" = id; "do_reset" = id; "do_run" = id; }; - CLASS = MyDocument; - LANGUAGE = ObjC; - OUTLETS = { - commandline = NSTextField; - debug = NSButton; - honourhashbang = NSButton; - inspect = NSButton; - interpreter = NSTextField; - nosite = NSButton; - optimize = NSButton; - others = NSTextField; - scriptargs = NSTextField; - tabs = NSButton; - verbose = NSButton; - "with_terminal" = NSButton; - }; - SUPERCLASS = NSDocument; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib deleted file mode 100644 index e258c72..0000000 --- a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBDocumentLocation - 398 60 356 240 0 0 1024 746 - IBFramework Version - 291.0 - IBOpenObjects - - 5 - - IBSystem Version - 6L60 - - diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib deleted file mode 100644 index 0473a31..0000000 Binary files a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib and /dev/null differ diff --git a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/classes.nib b/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/classes.nib deleted file mode 100644 index 467aa8b..0000000 --- a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/classes.nib +++ /dev/null @@ -1,26 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {"do_apply" = id; "do_filetype" = id; "do_reset" = id; }; - CLASS = PreferencesWindowController; - LANGUAGE = ObjC; - OUTLETS = { - commandline = NSTextField; - debug = NSButton; - filetype = NSPopUpButton; - honourhashbang = NSButton; - inspect = NSButton; - interpreter = NSTextField; - nosite = NSButton; - optimize = NSButton; - others = NSTextField; - tabs = NSButton; - verbose = NSButton; - "with_terminal" = NSButton; - }; - SUPERCLASS = NSWindowController; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/info.nib b/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/info.nib deleted file mode 100644 index bc558f7..0000000 --- a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBDocumentLocation - 565 235 519 534 0 0 1280 1002 - IBFramework Version - 364.0 - IBOpenObjects - - 5 - - IBSystem Version - 7H63 - - diff --git a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/objects.nib b/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/objects.nib deleted file mode 100644 index 3dfed33..0000000 Binary files a/Mac/OSX/PythonLauncher/English.lproj/PreferenceWindow.nib/objects.nib and /dev/null differ diff --git a/Mac/OSX/PythonLauncher/FileSettings.h b/Mac/OSX/PythonLauncher/FileSettings.h deleted file mode 100755 index d807bae..0000000 --- a/Mac/OSX/PythonLauncher/FileSettings.h +++ /dev/null @@ -1,64 +0,0 @@ -// -// FileSettings.h -// PythonLauncher -// -// Created by Jack Jansen on Sun Jul 21 2002. -// Copyright (c) 2002 __MyCompanyName__. All rights reserved. -// - -#import - -@protocol FileSettingsSource -- (NSString *) interpreter; -- (BOOL) honourhashbang; -- (BOOL) debug; -- (BOOL) verbose; -- (BOOL) inspect; -- (BOOL) optimize; -- (BOOL) nosite; -- (BOOL) tabs; -- (NSString *) others; -- (BOOL) with_terminal; -- (NSString *) scriptargs; -@end - -@interface FileSettings : NSObject -{ - NSString *interpreter; // The pathname of the interpreter to use - NSArray *interpreters; // List of known interpreters - BOOL honourhashbang; // #! line overrides interpreter - BOOL debug; // -d option: debug parser - BOOL verbose; // -v option: verbose import - BOOL inspect; // -i option: interactive mode after script - BOOL optimize; // -O option: optimize bytecode - BOOL nosite; // -S option: don't import site.py - BOOL tabs; // -t option: warn about inconsistent tabs - NSString *others; // other options - NSString *scriptargs; // script arguments (not for preferences) - BOOL with_terminal; // Run in terminal window - - FileSettings *origsource; - NSString *prefskey; -} - -+ (id)getDefaultsForFileType: (NSString *)filetype; -+ (id)getFactorySettingsForFileType: (NSString *)filetype; -+ (id)newSettingsForFileType: (NSString *)filetype; - -//- (id)init; -- (id)initForFileType: (NSString *)filetype; -- (id)initForFSDefaultFileType: (NSString *)filetype; -- (id)initForDefaultFileType: (NSString *)filetype; -//- (id)initWithFileSettings: (FileSettings *)source; - -- (void)updateFromSource: (id )source; -- (NSString *)commandLineForScript: (NSString *)script; - -//- (void)applyFactorySettingsForFileType: (NSString *)filetype; -//- (void)saveDefaults; -//- (void)applyUserDefaults: (NSString *)filetype; -- (void)applyValuesFromDict: (NSDictionary *)dict; -- (void)reset; -- (NSArray *) interpreters; - -@end diff --git a/Mac/OSX/PythonLauncher/FileSettings.m b/Mac/OSX/PythonLauncher/FileSettings.m deleted file mode 100755 index fc3937b..0000000 --- a/Mac/OSX/PythonLauncher/FileSettings.m +++ /dev/null @@ -1,298 +0,0 @@ -// -// FileSettings.m -// PythonLauncher -// -// Created by Jack Jansen on Sun Jul 21 2002. -// Copyright (c) 2002 __MyCompanyName__. All rights reserved. -// - -#import "FileSettings.h" - -@implementation FileSettings - -+ (id)getFactorySettingsForFileType: (NSString *)filetype -{ - static FileSettings *fsdefault_py, *fsdefault_pyw, *fsdefault_pyc; - FileSettings **curdefault; - - if ([filetype isEqualToString: @"Python Script"]) { - curdefault = &fsdefault_py; - } else if ([filetype isEqualToString: @"Python GUI Script"]) { - curdefault = &fsdefault_pyw; - } else if ([filetype isEqualToString: @"Python Bytecode Document"]) { - curdefault = &fsdefault_pyc; - } else { - NSLog(@"Funny File Type: %@\n", filetype); - curdefault = &fsdefault_py; - filetype = @"Python Script"; - } - if (!*curdefault) { - *curdefault = [[FileSettings new] initForFSDefaultFileType: filetype]; - } - return *curdefault; -} - -+ (id)getDefaultsForFileType: (NSString *)filetype -{ - static FileSettings *default_py, *default_pyw, *default_pyc; - FileSettings **curdefault; - - if ([filetype isEqualToString: @"Python Script"]) { - curdefault = &default_py; - } else if ([filetype isEqualToString: @"Python GUI Script"]) { - curdefault = &default_pyw; - } else if ([filetype isEqualToString: @"Python Bytecode Document"]) { - curdefault = &default_pyc; - } else { - NSLog(@"Funny File Type: %@\n", filetype); - curdefault = &default_py; - filetype = @"Python Script"; - } - if (!*curdefault) { - *curdefault = [[FileSettings new] initForDefaultFileType: filetype]; - } - return *curdefault; -} - -+ (id)newSettingsForFileType: (NSString *)filetype -{ - FileSettings *cur; - - cur = [FileSettings new]; - [cur initForFileType: filetype]; - return [cur retain]; -} - -- (id)initWithFileSettings: (FileSettings *)source -{ - self = [super init]; - if (!self) return self; - - interpreter = [source->interpreter retain]; - honourhashbang = source->honourhashbang; - debug = source->debug; - verbose = source->verbose; - inspect = source->inspect; - optimize = source->optimize; - nosite = source->nosite; - tabs = source->tabs; - others = [source->others retain]; - scriptargs = [source->scriptargs retain]; - with_terminal = source->with_terminal; - prefskey = source->prefskey; - if (prefskey) [prefskey retain]; - - return self; -} - -- (id)initForFileType: (NSString *)filetype -{ - FileSettings *defaults; - - defaults = [FileSettings getDefaultsForFileType: filetype]; - self = [self initWithFileSettings: defaults]; - origsource = [defaults retain]; - return self; -} - -//- (id)init -//{ -// self = [self initForFileType: @"Python Script"]; -// return self; -//} - -- (id)initForFSDefaultFileType: (NSString *)filetype -{ - int i; - NSString *filename; - NSDictionary *dict; - static NSDictionary *factorySettings; - - self = [super init]; - if (!self) return self; - - if (factorySettings == NULL) { - NSBundle *bdl = [NSBundle mainBundle]; - NSString *path = [ bdl pathForResource: @"factorySettings" - ofType: @"plist"]; - factorySettings = [[NSDictionary dictionaryWithContentsOfFile: - path] retain]; - if (factorySettings == NULL) { - NSLog(@"Missing %@", path); - return NULL; - } - } - dict = [factorySettings objectForKey: filetype]; - if (dict == NULL) { - NSLog(@"factorySettings.plist misses file type \"%@\"", filetype); - interpreter = [@"no default found" retain]; - return NULL; - } - [self applyValuesFromDict: dict]; - interpreters = [dict objectForKey: @"interpreter_list"]; - interpreter = NULL; - for (i=0; i < [interpreters count]; i++) { - filename = [interpreters objectAtIndex: i]; - filename = [filename stringByExpandingTildeInPath]; - if ([[NSFileManager defaultManager] fileExistsAtPath: filename]) { - interpreter = [filename retain]; - break; - } - } - if (interpreter == NULL) - interpreter = [@"no default found" retain]; - origsource = NULL; - return self; -} - -- (void)applyUserDefaults: (NSString *)filetype -{ - NSUserDefaults *defaults; - NSDictionary *dict; - - defaults = [NSUserDefaults standardUserDefaults]; - dict = [defaults dictionaryForKey: filetype]; - if (!dict) - return; - [self applyValuesFromDict: dict]; -} - -- (id)initForDefaultFileType: (NSString *)filetype -{ - FileSettings *fsdefaults; - - fsdefaults = [FileSettings getFactorySettingsForFileType: filetype]; - self = [self initWithFileSettings: fsdefaults]; - if (!self) return self; - interpreters = [fsdefaults->interpreters retain]; - scriptargs = [@"" retain]; - [self applyUserDefaults: filetype]; - prefskey = [filetype retain]; - return self; -} - -- (void)reset -{ - if (origsource) { - [self updateFromSource: origsource]; - } else { - FileSettings *fsdefaults; - fsdefaults = [FileSettings getFactorySettingsForFileType: prefskey]; - [self updateFromSource: fsdefaults]; - } -} - -- (void)updateFromSource: (id )source -{ - interpreter = [[source interpreter] retain]; - honourhashbang = [source honourhashbang]; - debug = [source debug]; - verbose = [source verbose]; - inspect = [source inspect]; - optimize = [source optimize]; - nosite = [source nosite]; - tabs = [source tabs]; - others = [[source others] retain]; - scriptargs = [[source scriptargs] retain]; - with_terminal = [source with_terminal]; - // And if this is a user defaults object we also save the - // values - if (!origsource) { - NSUserDefaults *defaults; - NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: - interpreter, @"interpreter", - [NSNumber numberWithBool: honourhashbang], @"honourhashbang", - [NSNumber numberWithBool: debug], @"debug", - [NSNumber numberWithBool: verbose], @"verbose", - [NSNumber numberWithBool: inspect], @"inspect", - [NSNumber numberWithBool: optimize], @"optimize", - [NSNumber numberWithBool: nosite], @"nosite", - [NSNumber numberWithBool: nosite], @"nosite", - others, @"others", - scriptargs, @"scriptargs", - [NSNumber numberWithBool: with_terminal], @"with_terminal", - nil]; - defaults = [NSUserDefaults standardUserDefaults]; - [defaults setObject: dict forKey: prefskey]; - } -} - -- (void)applyValuesFromDict: (NSDictionary *)dict -{ - id value; - - value = [dict objectForKey: @"interpreter"]; - if (value) interpreter = [value retain]; - value = [dict objectForKey: @"honourhashbang"]; - if (value) honourhashbang = [value boolValue]; - value = [dict objectForKey: @"debug"]; - if (value) debug = [value boolValue]; - value = [dict objectForKey: @"verbose"]; - if (value) verbose = [value boolValue]; - value = [dict objectForKey: @"inspect"]; - if (value) inspect = [value boolValue]; - value = [dict objectForKey: @"optimize"]; - if (value) optimize = [value boolValue]; - value = [dict objectForKey: @"nosite"]; - if (value) nosite = [value boolValue]; - value = [dict objectForKey: @"nosite"]; - if (value) tabs = [value boolValue]; - value = [dict objectForKey: @"others"]; - if (value) others = [value retain]; - value = [dict objectForKey: @"scriptargs"]; - if (value) scriptargs = [value retain]; - value = [dict objectForKey: @"with_terminal"]; - if (value) with_terminal = [value boolValue]; -} - -- (NSString *)commandLineForScript: (NSString *)script -{ - NSString *cur_interp = NULL; - char hashbangbuf[1024]; - FILE *fp; - char *p; - - if (honourhashbang && - (fp=fopen([script cString], "r")) && - fgets(hashbangbuf, sizeof(hashbangbuf), fp) && - strncmp(hashbangbuf, "#!", 2) == 0 && - (p=strchr(hashbangbuf, '\n'))) { - *p = '\0'; - p = hashbangbuf + 2; - while (*p == ' ') p++; - cur_interp = [NSString stringWithCString: p]; - } - if (!cur_interp) - cur_interp = interpreter; - - return [NSString stringWithFormat: - @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %@ %s", - cur_interp, - debug?" -d":"", - verbose?" -v":"", - inspect?" -i":"", - optimize?" -O":"", - nosite?" -S":"", - tabs?" -t":"", - others, - script, - scriptargs, - with_terminal? "&& echo Exit status: $? && exit 1" : " &"]; -} - -- (NSArray *) interpreters { return interpreters;}; - -// FileSettingsSource protocol -- (NSString *) interpreter { return interpreter;}; -- (BOOL) honourhashbang { return honourhashbang; }; -- (BOOL) debug { return debug;}; -- (BOOL) verbose { return verbose;}; -- (BOOL) inspect { return inspect;}; -- (BOOL) optimize { return optimize;}; -- (BOOL) nosite { return nosite;}; -- (BOOL) tabs { return tabs;}; -- (NSString *) others { return others;}; -- (NSString *) scriptargs { return scriptargs;}; -- (BOOL) with_terminal { return with_terminal;}; - -@end diff --git a/Mac/OSX/PythonLauncher/Info.plist b/Mac/OSX/PythonLauncher/Info.plist deleted file mode 100644 index 1dd795f..0000000 --- a/Mac/OSX/PythonLauncher/Info.plist +++ /dev/null @@ -1,65 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - py - pyw - - CFBundleTypeIconFile - PythonSource.icns - CFBundleTypeName - Python Script - CFBundleTypeRole - Viewer - NSDocumentClass - MyDocument - - - CFBundleTypeExtensions - - pyc - pyo - - CFBundleTypeIconFile - PythonCompiled.icns - CFBundleTypeName - Python Bytecode Document - CFBundleTypeRole - Viewer - NSDocumentClass - MyDocument - - - CFBundleExecutable - PythonLauncher - CFBundleGetInfoString - 2.5, © 001-2006 Python Software Foundation - CFBundleIconFile - PythonLauncher.icns - CFBundleIdentifier - org.python.PythonLauncher - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Python Launcher - CFBundlePackageType - APPL - CFBundleShortVersionString - 2.5 - CFBundleSignature - PytL - CFBundleVersion - 2.5 - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/Mac/OSX/PythonLauncher/Makefile.in b/Mac/OSX/PythonLauncher/Makefile.in deleted file mode 100644 index e6dacb3..0000000 --- a/Mac/OSX/PythonLauncher/Makefile.in +++ /dev/null @@ -1,78 +0,0 @@ -CC=@CC@ -LD=@CC@ -BASECFLAGS=@BASECFLAGS@ -OPT=@OPT@ -CFLAGS=$(BASECFLAGS) $(OPT) -LDFLAGS=@LDFLAGS@ -srcdir= @srcdir@ -VERSION= @VERSION@ -UNIVERSALSDK=@UNIVERSALSDK@ -builddir= ../../.. - -RUNSHARED= @RUNSHARED@ -BUILDEXE= @BUILDEXEEXT@ -BUILDPYTHON= ../../../python$(BUILDEXE) - -# Deployment target selected during configure, to be checked -# by distutils -MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@ -@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET - -BUNDLEBULDER=$(srcdir)/../../../Lib/plat-mac/bundlebuilder.py - -PYTHONAPPSDIR=/Applications/MacPython $(VERSION) -OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o - -all: Python\ Launcher.app - -install: Python\ Launcher.app - test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" - -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" - cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" - touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" - -clean: - rm -f *.o "Python Launcher" - rm -rf "Python Launcher.app" - -Python\ Launcher.app: \ - Python\ Launcher $(srcdir)/../Icons/PythonLauncher.icns \ - $(srcdir)/../Icons/PythonSource.icns \ - $(srcdir)/../Icons/PythonCompiled.icns \ - $(srcdir)/factorySettings.plist - rm -fr "Python Launcher.app" - $(RUNSHARED) $(BUILDPYTHON) $(BUNDLEBULDER) \ - --builddir=. \ - --name="Python Launcher" \ - --executable="Python Launcher" \ - --iconfile=$(srcdir)/../Icons/PythonLauncher.icns \ - --bundle-id=org.python.PythonLauncher \ - --resource=$(srcdir)/../Icons/PythonSource.icns \ - --resource=$(srcdir)/../Icons/PythonCompiled.icns \ - --resource=$(srcdir)/English.lproj \ - --resource=$(srcdir)/factorySettings.plist \ - --plist=$(srcdir)/Info.plist \ - build - find "Python Launcher.app" -name '.svn' -print0 | xargs -0 rm -r - - -FileSettings.o: $(srcdir)/FileSettings.m - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/FileSettings.m - -MyAppDelegate.o: $(srcdir)/MyAppDelegate.m - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyAppDelegate.m - -MyDocument.o: $(srcdir)/MyDocument.m - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyDocument.m - -PreferencesWindowController.o: $(srcdir)/PreferencesWindowController.m - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/PreferencesWindowController.m - -doscript.o: $(srcdir)/doscript.m - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/doscript.m - -main.o: $(srcdir)/main.m - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/main.m - -Python\ Launcher: $(OBJECTS) - $(CC) $(LDFLAGS) -o "Python Launcher" $(OBJECTS) -framework AppKit -framework Carbon diff --git a/Mac/OSX/PythonLauncher/MyAppDelegate.h b/Mac/OSX/PythonLauncher/MyAppDelegate.h deleted file mode 100644 index 097b541..0000000 --- a/Mac/OSX/PythonLauncher/MyAppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -/* MyAppDelegate */ - -#import - -@interface MyAppDelegate : NSObject -{ - BOOL initial_action_done; - BOOL should_terminate; -} -- (id)init; -- (IBAction)showPreferences:(id)sender; -- (BOOL)shouldShowUI; -- (BOOL)shouldTerminate; -- (void)testFileTypeBinding; -@end diff --git a/Mac/OSX/PythonLauncher/MyAppDelegate.m b/Mac/OSX/PythonLauncher/MyAppDelegate.m deleted file mode 100644 index a5ba751..0000000 --- a/Mac/OSX/PythonLauncher/MyAppDelegate.m +++ /dev/null @@ -1,96 +0,0 @@ -#import "MyAppDelegate.h" -#import "PreferencesWindowController.h" -#import -#import - -@implementation MyAppDelegate - -- (id)init -{ - self = [super init]; - initial_action_done = NO; - should_terminate = NO; - return self; -} - -- (IBAction)showPreferences:(id)sender -{ - [PreferencesWindowController getPreferencesWindow]; -} - -- (void)applicationDidFinishLaunching:(NSNotification *)notification -{ - // Test that the file mappings are correct - [self testFileTypeBinding]; - // If we were opened because of a file drag or doubleclick - // we've set initial_action_done in shouldShowUI - // Otherwise we open a preferences dialog. - if (!initial_action_done) { - initial_action_done = YES; - [self showPreferences: self]; - } -} - -- (BOOL)shouldShowUI -{ - // if this call comes before applicationDidFinishLaunching: we - // should terminate immedeately after starting the script. - if (!initial_action_done) - should_terminate = YES; - initial_action_done = YES; - if( GetCurrentKeyModifiers() & optionKey ) - return YES; - return NO; -} - -- (BOOL)shouldTerminate -{ - return should_terminate; -} - -- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender -{ - return NO; -} - -- (void)testFileTypeBinding -{ - NSURL *ourUrl; - OSStatus err; - FSRef appRef; - NSURL *appUrl; - static NSString *extensions[] = { @"py", @"pyw", @"pyc", NULL}; - NSString **ext_p; - int i; - - if ([[NSUserDefaults standardUserDefaults] boolForKey: @"SkipFileBindingTest"]) - return; - ourUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] bundlePath]]; - for( ext_p = extensions; *ext_p; ext_p++ ) { - err = LSGetApplicationForInfo( - kLSUnknownType, - kLSUnknownCreator, - (CFStringRef)*ext_p, - kLSRolesViewer, - &appRef, - (CFURLRef *)&appUrl); - if (err || ![appUrl isEqual: ourUrl] ) { - i = NSRunAlertPanel(@"File type binding", - @"PythonLauncher is not the default application for all " \ - @"Python script types. You should fix this with the " \ - @"Finder's \"Get Info\" command.\n\n" \ - @"See \"Changing the application that opens a file\" in " \ - @"Mac Help for details.", - @"OK", - @"Don't show this warning again", - NULL); - if ( i == 0 ) { // Don't show again - [[NSUserDefaults standardUserDefaults] - setObject:@"YES" forKey:@"SkipFileBindingTest"]; - } - return; - } - } -} - -@end diff --git a/Mac/OSX/PythonLauncher/MyDocument.h b/Mac/OSX/PythonLauncher/MyDocument.h deleted file mode 100755 index 00c1bae..0000000 --- a/Mac/OSX/PythonLauncher/MyDocument.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// MyDocument.h -// PythonLauncher -// -// Created by Jack Jansen on Fri Jul 19 2002. -// Copyright (c) 2002 __MyCompanyName__. All rights reserved. -// - - -#import - -#import "FileSettings.h" - -@interface MyDocument : NSDocument -{ - IBOutlet NSTextField *interpreter; - IBOutlet NSButton *honourhashbang; - IBOutlet NSButton *debug; - IBOutlet NSButton *verbose; - IBOutlet NSButton *inspect; - IBOutlet NSButton *optimize; - IBOutlet NSButton *nosite; - IBOutlet NSButton *tabs; - IBOutlet NSTextField *others; - IBOutlet NSButton *with_terminal; - IBOutlet NSTextField *scriptargs; - IBOutlet NSTextField *commandline; - - NSString *script; - NSString *filetype; - FileSettings *settings; -} - -- (IBAction)do_run:(id)sender; -- (IBAction)do_cancel:(id)sender; -- (IBAction)do_reset:(id)sender; -- (IBAction)do_apply:(id)sender; - -- (void)controlTextDidChange:(NSNotification *)aNotification; - -@end diff --git a/Mac/OSX/PythonLauncher/MyDocument.m b/Mac/OSX/PythonLauncher/MyDocument.m deleted file mode 100755 index 5acc2dc..0000000 --- a/Mac/OSX/PythonLauncher/MyDocument.m +++ /dev/null @@ -1,175 +0,0 @@ -// -// MyDocument.m -// PythonLauncher -// -// Created by Jack Jansen on Fri Jul 19 2002. -// Copyright (c) 2002 __MyCompanyName__. All rights reserved. -// - -#import "MyDocument.h" -#import "MyAppDelegate.h" -#import "doscript.h" - -@implementation MyDocument - -- (id)init -{ - self = [super init]; - if (self) { - - // Add your subclass-specific initialization here. - // If an error occurs here, send a [self dealloc] message and return nil. - script = [@".py" retain]; - filetype = [@"Python Script" retain]; - settings = NULL; - } - return self; -} - -- (NSString *)windowNibName -{ - // Override returning the nib file name of the document - // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead. - return @"MyDocument"; -} - -- (void)close -{ - NSApplication *app = [NSApplication sharedApplication]; - [super close]; - if ([[app delegate] shouldTerminate]) - [app terminate: self]; -} - -- (void)load_defaults -{ -// if (settings) [settings release]; - settings = [FileSettings newSettingsForFileType: filetype]; -} - -- (void)update_display -{ -// [[self window] setTitle: script]; - - [interpreter setStringValue: [settings interpreter]]; - [honourhashbang setState: [settings honourhashbang]]; - [debug setState: [settings debug]]; - [verbose setState: [settings verbose]]; - [inspect setState: [settings inspect]]; - [optimize setState: [settings optimize]]; - [nosite setState: [settings nosite]]; - [tabs setState: [settings tabs]]; - [others setStringValue: [settings others]]; - [scriptargs setStringValue: [settings scriptargs]]; - [with_terminal setState: [settings with_terminal]]; - - [commandline setStringValue: [settings commandLineForScript: script]]; -} - -- (void)update_settings -{ - [settings updateFromSource: self]; -} - -- (BOOL)run -{ - const char *cmdline; - int sts; - - cmdline = [[settings commandLineForScript: script] cString]; - if ([settings with_terminal]) { - sts = doscript(cmdline); - } else { - sts = system(cmdline); - } - if (sts) { - NSLog(@"Exit status: %d\n", sts); - return NO; - } - return YES; -} - -- (void)windowControllerDidLoadNib:(NSWindowController *) aController -{ - [super windowControllerDidLoadNib:aController]; - // Add any code here that need to be executed once the windowController has loaded the document's window. - [self load_defaults]; - [self update_display]; -} - -- (NSData *)dataRepresentationOfType:(NSString *)aType -{ - // Insert code here to write your document from the given data. You can also choose to override -fileWrapperRepresentationOfType: or -writeToFile:ofType: instead. - return nil; -} - -- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type; -{ - // Insert code here to read your document from the given data. You can also choose to override -loadFileWrapperRepresentation:ofType: or -readFromFile:ofType: instead. - BOOL show_ui; - - // ask the app delegate whether we should show the UI or not. - show_ui = [[[NSApplication sharedApplication] delegate] shouldShowUI]; - [script release]; - script = [fileName retain]; - [filetype release]; - filetype = [type retain]; -// if (settings) [settings release]; - settings = [FileSettings newSettingsForFileType: filetype]; - if (show_ui) { - [self update_display]; - return YES; - } else { - [self run]; - [self close]; - return NO; - } -} - -- (IBAction)do_run:(id)sender -{ - [self update_settings]; - [self update_display]; - if ([self run]) - [self close]; -} - -- (IBAction)do_cancel:(id)sender -{ - [self close]; -} - - -- (IBAction)do_reset:(id)sender -{ - [settings reset]; - [self update_display]; -} - -- (IBAction)do_apply:(id)sender -{ - [self update_settings]; - [self update_display]; -} - -// FileSettingsSource protocol -- (NSString *) interpreter { return [interpreter stringValue];}; -- (BOOL) honourhashbang { return [honourhashbang state];}; -- (BOOL) debug { return [debug state];}; -- (BOOL) verbose { return [verbose state];}; -- (BOOL) inspect { return [inspect state];}; -- (BOOL) optimize { return [optimize state];}; -- (BOOL) nosite { return [nosite state];}; -- (BOOL) tabs { return [tabs state];}; -- (NSString *) others { return [others stringValue];}; -- (NSString *) scriptargs { return [scriptargs stringValue];}; -- (BOOL) with_terminal { return [with_terminal state];}; - -// Delegates -- (void)controlTextDidChange:(NSNotification *)aNotification -{ - [self update_settings]; - [self update_display]; -}; - -@end diff --git a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib deleted file mode 100644 index 467aa8b..0000000 --- a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/classes.nib +++ /dev/null @@ -1,26 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {"do_apply" = id; "do_filetype" = id; "do_reset" = id; }; - CLASS = PreferencesWindowController; - LANGUAGE = ObjC; - OUTLETS = { - commandline = NSTextField; - debug = NSButton; - filetype = NSPopUpButton; - honourhashbang = NSButton; - inspect = NSButton; - interpreter = NSTextField; - nosite = NSButton; - optimize = NSButton; - others = NSTextField; - tabs = NSButton; - verbose = NSButton; - "with_terminal" = NSButton; - }; - SUPERCLASS = NSWindowController; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib deleted file mode 100644 index bc558f7..0000000 --- a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBDocumentLocation - 565 235 519 534 0 0 1280 1002 - IBFramework Version - 364.0 - IBOpenObjects - - 5 - - IBSystem Version - 7H63 - - diff --git a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib b/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib deleted file mode 100644 index 3dfed33..0000000 Binary files a/Mac/OSX/PythonLauncher/PreferenceWindow.nib/objects.nib and /dev/null differ diff --git a/Mac/OSX/PythonLauncher/PreferencesWindowController.h b/Mac/OSX/PythonLauncher/PreferencesWindowController.h deleted file mode 100644 index 6346996..0000000 --- a/Mac/OSX/PythonLauncher/PreferencesWindowController.h +++ /dev/null @@ -1,38 +0,0 @@ -/* PreferencesWindowController */ - -#import - -#import "FileSettings.h" - -@interface PreferencesWindowController : NSWindowController -{ - IBOutlet NSPopUpButton *filetype; - IBOutlet NSComboBox *interpreter; - IBOutlet NSButton *honourhashbang; - IBOutlet NSButton *debug; - IBOutlet NSButton *verbose; - IBOutlet NSButton *inspect; - IBOutlet NSButton *optimize; - IBOutlet NSButton *nosite; - IBOutlet NSButton *tabs; - IBOutlet NSTextField *others; - IBOutlet NSButton *with_terminal; - IBOutlet NSTextField *commandline; - - FileSettings *settings; -} - -+ getPreferencesWindow; - -- (IBAction)do_reset:(id)sender; -- (IBAction)do_apply:(id)sender; -- (IBAction)do_filetype:(id)sender; - -- (void)controlTextDidChange:(NSNotification *)aNotification; - -- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString; -- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index; -- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox; - - -@end diff --git a/Mac/OSX/PythonLauncher/PreferencesWindowController.m b/Mac/OSX/PythonLauncher/PreferencesWindowController.m deleted file mode 100644 index 311c375..0000000 --- a/Mac/OSX/PythonLauncher/PreferencesWindowController.m +++ /dev/null @@ -1,121 +0,0 @@ -#import "PreferencesWindowController.h" - -@implementation PreferencesWindowController - -+ getPreferencesWindow -{ - static PreferencesWindowController *_singleton; - - if (!_singleton) - _singleton = [[PreferencesWindowController alloc] init]; - [_singleton showWindow: _singleton]; - return _singleton; -} - -- (id) init -{ - self = [self initWithWindowNibName: @"PreferenceWindow"]; - return self; -} - -- (void)load_defaults -{ - NSString *title = [filetype titleOfSelectedItem]; - - settings = [FileSettings getDefaultsForFileType: title]; -} - -- (void)update_display -{ -// [[self window] setTitle: script]; - - [interpreter reloadData]; - [interpreter setStringValue: [settings interpreter]]; - [honourhashbang setState: [settings honourhashbang]]; - [debug setState: [settings debug]]; - [verbose setState: [settings verbose]]; - [inspect setState: [settings inspect]]; - [optimize setState: [settings optimize]]; - [nosite setState: [settings nosite]]; - [tabs setState: [settings tabs]]; - [others setStringValue: [settings others]]; - [with_terminal setState: [settings with_terminal]]; - // Not scriptargs, it isn't for preferences - - [commandline setStringValue: [settings commandLineForScript: @""]]; -} - -- (void) windowDidLoad -{ - [super windowDidLoad]; - [self load_defaults]; - [self update_display]; -} - -- (void)update_settings -{ - [settings updateFromSource: self]; -} - -- (IBAction)do_filetype:(id)sender -{ - [self load_defaults]; - [self update_display]; -} - -- (IBAction)do_reset:(id)sender -{ - [settings reset]; - [self update_display]; -} - -- (IBAction)do_apply:(id)sender -{ - [self update_settings]; - [self update_display]; -} - -// FileSettingsSource protocol -- (NSString *) interpreter { return [interpreter stringValue];}; -- (BOOL) honourhashbang { return [honourhashbang state]; }; -- (BOOL) debug { return [debug state];}; -- (BOOL) verbose { return [verbose state];}; -- (BOOL) inspect { return [inspect state];}; -- (BOOL) optimize { return [optimize state];}; -- (BOOL) nosite { return [nosite state];}; -- (BOOL) tabs { return [tabs state];}; -- (NSString *) others { return [others stringValue];}; -- (BOOL) with_terminal { return [with_terminal state];}; -- (NSString *) scriptargs { return @"";}; - -// Delegates -- (void)controlTextDidChange:(NSNotification *)aNotification -{ - [self update_settings]; - [self update_display]; -}; - -// NSComboBoxDataSource protocol -- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString -{ - NSArray *interp_list = [settings interpreters]; - unsigned int rv = [interp_list indexOfObjectIdenticalTo: aString]; - return rv; -} - -- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index -{ - NSArray *interp_list = [settings interpreters]; - id rv = [interp_list objectAtIndex: index]; - return rv; -} - -- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox -{ - NSArray *interp_list = [settings interpreters]; - int rv = [interp_list count]; - return rv; -} - - -@end diff --git a/Mac/OSX/PythonLauncher/doscript.h b/Mac/OSX/PythonLauncher/doscript.h deleted file mode 100644 index eef0b56..0000000 --- a/Mac/OSX/PythonLauncher/doscript.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * doscript.h - * PythonLauncher - * - * Created by Jack Jansen on Wed Jul 31 2002. - * Copyright (c) 2002 __MyCompanyName__. All rights reserved. - * - */ - -#include - -extern int doscript(const char *command); \ No newline at end of file diff --git a/Mac/OSX/PythonLauncher/doscript.m b/Mac/OSX/PythonLauncher/doscript.m deleted file mode 100644 index 3e4e223..0000000 --- a/Mac/OSX/PythonLauncher/doscript.m +++ /dev/null @@ -1,118 +0,0 @@ -/* - * doscript.c - * PythonLauncher - * - * Created by Jack Jansen on Wed Jul 31 2002. - * Copyright (c) 2002 __MyCompanyName__. All rights reserved. - * - */ - -#import -#import -#import "doscript.h" - -/* I assume I could pick these up from somewhere, but where... */ -#define CREATOR 'trmx' - -#define ACTIVATE_CMD 'misc' -#define ACTIVATE_SUITE 'actv' - -#define DOSCRIPT_CMD 'dosc' -#define DOSCRIPT_SUITE 'core' -#define WITHCOMMAND 'cmnd' - -/* ... and there's probably also a better way to do this... */ -#define START_TERMINAL "/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal &" - -extern int -doscript(const char *command) -{ - OSErr err; - AppleEvent theAEvent, theReply; - AEAddressDesc terminalAddress; - AEDesc commandDesc; - OSType terminalCreator = CREATOR; - - /* set up locals */ - AECreateDesc(typeNull, NULL, 0, &theAEvent); - AECreateDesc(typeNull, NULL, 0, &terminalAddress); - AECreateDesc(typeNull, NULL, 0, &theReply); - AECreateDesc(typeNull, NULL, 0, &commandDesc); - - /* create the "activate" event for Terminal */ - err = AECreateDesc(typeApplSignature, (Ptr) &terminalCreator, - sizeof(terminalCreator), &terminalAddress); - if (err != noErr) { - NSLog(@"doscript: AECreateDesc: error %d\n", err); - goto bail; - } - err = AECreateAppleEvent(ACTIVATE_SUITE, ACTIVATE_CMD, - &terminalAddress, kAutoGenerateReturnID, - kAnyTransactionID, &theAEvent); - - if (err != noErr) { - NSLog(@"doscript: AECreateAppleEvent(activate): error %d\n", err); - goto bail; - } - /* send the event */ - err = AESend(&theAEvent, &theReply, kAEWaitReply, - kAENormalPriority, kAEDefaultTimeout, NULL, NULL); - if ( err == -600 ) { - int count=10; - /* If it failed with "no such process" try to start Terminal */ - err = system(START_TERMINAL); - if ( err ) { - NSLog(@"doscript: system(): %s\n", strerror(errno)); - goto bail; - } - do { - sleep(1); - /* send the event again */ - err = AESend(&theAEvent, &theReply, kAEWaitReply, - kAENormalPriority, kAEDefaultTimeout, NULL, NULL); - } while (err == -600 && --count > 0); - if ( err == -600 ) - NSLog(@"doscript: Could not activate Terminal\n"); - } - if (err != noErr) { - NSLog(@"doscript: AESend(activate): error %d\n", err); - goto bail; - } - - /* create the "doscript with command" event for Terminal */ - err = AECreateAppleEvent(DOSCRIPT_SUITE, DOSCRIPT_CMD, - &terminalAddress, kAutoGenerateReturnID, - kAnyTransactionID, &theAEvent); - if (err != noErr) { - NSLog(@"doscript: AECreateAppleEvent(doscript): error %d\n", err); - goto bail; - } - - /* add the command to the apple event */ - err = AECreateDesc(typeChar, command, strlen(command), &commandDesc); - if (err != noErr) { - NSLog(@"doscript: AECreateDesc(command): error %d\n", err); - goto bail; - } - err = AEPutParamDesc(&theAEvent, WITHCOMMAND, &commandDesc); - if (err != noErr) { - NSLog(@"doscript: AEPutParamDesc: error %d\n", err); - goto bail; - } - - /* send the command event to Terminal.app */ - err = AESend(&theAEvent, &theReply, kAEWaitReply, - kAENormalPriority, kAEDefaultTimeout, NULL, NULL); - - if (err != noErr) { - NSLog(@"doscript: AESend(docommand): error %d\n", err); - goto bail; - } - /* clean up and leave */ -bail: - AEDisposeDesc(&commandDesc); - AEDisposeDesc(&theAEvent); - AEDisposeDesc(&terminalAddress); - AEDisposeDesc(&theReply); - return err; -} diff --git a/Mac/OSX/PythonLauncher/factorySettings.plist b/Mac/OSX/PythonLauncher/factorySettings.plist deleted file mode 100644 index 1202421..0000000 --- a/Mac/OSX/PythonLauncher/factorySettings.plist +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Python GUI Script - - debug - - inspect - - interpreter_list - - /usr/local/bin/pythonw - /usr/bin/pythonw - /sw/bin/pythonw - - honourhashbang - - nosite - - optimize - - others - - verbose - - with_terminal - - - Python Script - - debug - - inspect - - interpreter_list - - /usr/local/bin/pythonw - /usr/local/bin/python - /usr/bin/pythonw - /usr/bin/python - /sw/bin/pythonw - /sw/bin/python - - honourhashbang - - nosite - - optimize - - others - - verbose - - with_terminal - - - Python Bytecode Document - - debug - - inspect - - interpreter_list - - /usr/local/bin/pythonw - /usr/local/bin/python - /usr/bin/pythonw - /usr/bin/python - /sw/bin/pythonw - /sw/bin/python - - honourhashbang - - nosite - - optimize - - others - - verbose - - with_terminal - - - - diff --git a/Mac/OSX/PythonLauncher/main.m b/Mac/OSX/PythonLauncher/main.m deleted file mode 100755 index 6841433..0000000 --- a/Mac/OSX/PythonLauncher/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// PythonLauncher -// -// Created by Jack Jansen on Fri Jul 19 2002. -// Copyright (c) 2002 __MyCompanyName__. All rights reserved. -// - -#import -#include - -int main(int argc, const char *argv[]) -{ - char *home = getenv("HOME"); - if (home) chdir(home); - return NSApplicationMain(argc, argv); -} diff --git a/Mac/OSX/README b/Mac/OSX/README deleted file mode 100644 index 1e58b02..0000000 --- a/Mac/OSX/README +++ /dev/null @@ -1,167 +0,0 @@ -============ -MacOSX Notes -============ - -This document provides a quick overview of some Mac OS X specific features in -the Python distribution. - - -Building and using a universal binary of Python on Mac OS X -=========================================================== - -1. What is a universal binary ------------------------------ - -A universal binary build of Python contains object code for both PPC and i386 -and can therefore run at native speed on both classic powerpc based macs and -the newer intel based macs. - -2. How do I build a universal binary ------------------------------------- - -You can enable universal binaries by specifying the "--enable-universalsdk" -flag to configure:: - - $ ./configure --enable-universalsdk - $ make - $ make install - -This flag can be used a framework build of python, but also with a classic -unix build. Either way you will have to build python on Mac OS X 10.4 (or later) -with Xcode 2.1 (or later). You also have to install the 10.4u SDK when -installing Xcode. - - -Building and using a framework-based Python on Mac OS X. -======================================================== - - -1. Why would I want a framework Python instead of a normal static Python? --------------------------------------------------------------------------- - -The main reason is because you want to create GUI programs in Python. With the -exception of X11/XDarwin-based GUI toolkits all GUI programs need to be run -from a fullblown MacOSX application (a ".app" bundle). - -While it is technically possible to create a .app without using frameworks you -will have to do the work yourself if you really want this. - -A second reason for using frameworks is that they put Python-related items in -only two places: "/Library/Framework/Python.framework" and -"/Applications/MacPython 2.5". This simplifies matters for users installing -Python from a binary distribution if they want to get rid of it again. Moreover, -due to the way frameworks work a user without admin privileges can install a -binary distribution in his or her home directory without recompilation. - -2. How does a framework Python differ from a normal static Python? ------------------------------------------------------------------- - -In everyday use there is no difference, except that things are stored in -a different place. If you look in /Library/Frameworks/Python.framework -you will see lots of relative symlinks, see the Apple documentation for -details. If you are used to a normal unix Python file layout go down to -Versions/Current and you will see the familiar bin and lib directories. - -3. Do I need extra packages? ----------------------------- - -Yes, probably. If you want Tkinter support you need to get the OSX AquaTk -distribution, this is installed by default on Mac OS X 10.4 or later. If -you want wxPython you need to get that. If you want Cocoa you need to get -PyObjC. - -4. How do I build a framework Python? -------------------------------------- - -This directory contains a Makefile that will create a couple of python-related -applications (fullblown OSX .app applications, that is) in -"/Applications/MacPython 2.3", and a hidden helper application Python.app -inside the Python.framework, and unix tools "python" and "pythonw" into -/usr/local/bin. In addition it has a target "installmacsubtree" that installs -the relevant portions of the Mac subtree into the Python.framework. - -It is normally invoked indirectly through the main Makefile, as the last step -in the sequence - - 1. ./configure --enable-framework - - 2. make - - 3. make install - -This sequence will put the framework in /Library/Framework/Python.framework, -the applications in /Applications/MacPython 2.5 and the unix tools in -/usr/local/bin. - -Installing in another place, for instance $HOME/Library/Frameworks if you have -no admin privileges on your machine, has only been tested very lightly. This -can be done by configuring with --enable-framework=$HOME/Library/Frameworks. -The other two directories, /Applications/MacPython-2.3 and /usr/local/bin, will -then also be deposited in $HOME. This is sub-optimal for the unix tools, which -you would want in $HOME/bin, but there is no easy way to fix this right now. - -Note that there are no references to the actual locations in the code or -resource files, so you are free to move things around afterwards. For example, -you could use --enable-framework=/tmp/newversion/Library/Frameworks and use -/tmp/newversion as the basis for an installer or something. - -If you want to install some part, but not all, read the main Makefile. The -frameworkinstall is composed of a couple of sub-targets that install the -framework itself, the Mac subtree, the applications and the unix tools. - -There is an extra target frameworkinstallextras that is not part of the -normal frameworkinstall which installs the Demo and Tools directories -into /Applications/MacPython-2.3, this is useful for binary distributions. - -What do all these programs do? -=============================== - -"IDLE.app" is an integrated development environment for Python: editor, -debugger, etc. - -"PythonLauncher.app" is a helper application that will handle things when you -double-click a .py, .pyc or .pyw file. For the first two it creates a Terminal -window and runs the scripts with the normal command-line Python. For the -latter it runs the script in the Python.app interpreter so the script can do -GUI-things. Keep the "alt" key depressed while dragging or double-clicking a -script to set runtime options. These options can be set once and for all -through PythonLauncher's preferences dialog. - -"BuildApplet.app" creates an applet from a Python script. Drop the script on it -and out comes a full-featured MacOS application. There is much more to this, -to be supplied later. Some useful (but outdated) info can be found in -Mac/Demo. - -The commandline scripts /usr/local/bin/python and pythonw can be used to run -non-GUI and GUI python scripts from the command line, respectively. - -How do I create a binary distribution? -====================================== - -Go to the directory "Mac/OSX/BuildScript". There you'll find a script -"build-installer.py" that does all the work. This will download and build -a number of 3th-party libaries, configures and builds a framework Python, -installs it, creates the installer pacakge files and then packs this in a -DMG image. - -The script will build a universal binary, you'll therefore have to run this -script on Mac OS X 10.4 or later and with Xcode 2.1 or later installed. - -All of this is normally done completely isolated in /tmp/_py, so it does not -use your normal build directory nor does it install into /. - -Because of the way the script locates the files it needs you have to run it -from within the BuildScript directory. The script accepts a number of -command-line arguments, run it with --help for more information. - -Odds and ends -============= - -Something to take note of is that the ".rsrc" files in the distribution are -not actually resource files, they're AppleSingle encoded resource files. The -macresource module and the Mac/OSX/Makefile cater for this, and create -".rsrc.df.rsrc" files on the fly that are normal datafork-based resource -files. - - Jack Jansen, Jack.Jansen@cwi.nl, 15-Jul-2004. - Ronald Oussoren, RonaldOussoren@mac.com, 26-May-2006 diff --git a/Mac/OSX/Tools/pythonw.c b/Mac/OSX/Tools/pythonw.c deleted file mode 100644 index e70a76f..0000000 --- a/Mac/OSX/Tools/pythonw.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * This wrapper program executes a python executable hidden inside an - * application bundle inside the Python framework. This is needed to run - * GUI code: some GUI API's don't work unless the program is inside an - * application bundle. - */ -#include -#include - -static char Python[] = PYTHONWEXECUTABLE; - -int main(int argc, char **argv) { - argv[0] = Python; - execv(Python, argv); - err(1, "execv: %s", Python); - /* NOTREACHED */ -} diff --git a/Mac/OSX/fixapplepython23.py b/Mac/OSX/fixapplepython23.py deleted file mode 100644 index 181181e..0000000 --- a/Mac/OSX/fixapplepython23.py +++ /dev/null @@ -1,118 +0,0 @@ -"""fixapplepython23 - Fix Apple-installed Python 2.3 (on Mac OS X 10.3) - -Python 2.3 (and 2.3.X for X<5) have the problem that building an extension -for a framework installation may accidentally pick up the framework -of a newer Python, in stead of the one that was used to build the extension. - -This script modifies the Makefile (in .../lib/python2.3/config) to use -the newer method of linking extensions with "-undefined dynamic_lookup" -which fixes this problem. - -The script will first check all prerequisites, and return a zero exit -status also when nothing needs to be fixed. -""" -import sys -import os -import gestalt - -MAKEFILE='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/Makefile' -CHANGES=(( - 'LDSHARED=\t$(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK)\n', - 'LDSHARED=\t$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup\n' - ),( - 'BLDSHARED=\t$(CC) $(LDFLAGS) -bundle -framework $(PYTHONFRAMEWORK)\n', - 'BLDSHARED=\t$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup\n' - ),( - 'CC=\t\tgcc\n', - 'CC=\t\t/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-gcc\n' - ),( - 'CXX=\t\tc++\n', - 'CXX=\t\t/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-g++\n' -)) - -GCC_SCRIPT='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-gcc' -GXX_SCRIPT='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-g++' -SCRIPT="""#!/bin/sh -export MACOSX_DEPLOYMENT_TARGET=10.3 -exec %s "${@}" -""" - -def findline(lines, start): - """return line starting with given string or -1""" - for i in range(len(lines)): - if lines[i][:len(start)] == start: - return i - return -1 - -def fix(makefile, do_apply): - """Fix the Makefile, if required.""" - fixed = False - lines = open(makefile).readlines() - - for old, new in CHANGES: - i = findline(lines, new) - if i >= 0: - # Already fixed - continue - i = findline(lines, old) - if i < 0: - print 'fixapplepython23: Python installation not fixed (appears broken)' - print 'fixapplepython23: missing line:', old - return 2 - lines[i] = new - fixed = True - - if fixed: - if do_apply: - print 'fixapplepython23: Fix to Apple-installed Python 2.3 applied' - os.rename(makefile, makefile + '~') - open(makefile, 'w').writelines(lines) - return 0 - else: - print 'fixapplepython23: Fix to Apple-installed Python 2.3 should be applied' - return 1 - else: - print 'fixapplepython23: No fix needed, appears to have been applied before' - return 0 - -def makescript(filename, compiler): - """Create a wrapper script for a compiler""" - dirname = os.path.split(filename)[0] - if not os.access(dirname, os.X_OK): - os.mkdir(dirname, 0755) - fp = open(filename, 'w') - fp.write(SCRIPT % compiler) - fp.close() - os.chmod(filename, 0755) - print 'fixapplepython23: Created', filename - -def main(): - # Check for -n option - if len(sys.argv) > 1 and sys.argv[1] == '-n': - do_apply = False - else: - do_apply = True - # First check OS version - if gestalt.gestalt('sysv') < 0x1030: - print 'fixapplepython23: no fix needed on MacOSX < 10.3' - sys.exit(0) - # Test that a framework Python is indeed installed - if not os.path.exists(MAKEFILE): - print 'fixapplepython23: Python framework does not appear to be installed (?), nothing fixed' - sys.exit(0) - # Check that we can actually write the file - if do_apply and not os.access(MAKEFILE, os.W_OK): - print 'fixapplepython23: No write permission, please run with "sudo"' - sys.exit(2) - # Create the shell scripts - if do_apply: - if not os.access(GCC_SCRIPT, os.X_OK): - makescript(GCC_SCRIPT, "gcc") - if not os.access(GXX_SCRIPT, os.X_OK): - makescript(GXX_SCRIPT, "g++") - # Finally fix the makefile - rv = fix(MAKEFILE, do_apply) - sys.exit(rv) - -if __name__ == '__main__': - main() diff --git a/Mac/OSXResources/app/Info.plist b/Mac/OSXResources/app/Info.plist deleted file mode 100644 index 387bbed..0000000 --- a/Mac/OSXResources/app/Info.plist +++ /dev/null @@ -1,60 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeOSTypes - - **** - fold - disk - - CFBundleTypeRole - Viewer - - - CFBundleExecutable - Python - CFBundleGetInfoString - 2.5alpha0, (c) 2004 Python Software Foundation. - CFBundleHelpBookFolder - - Documentation - PythonDocumentation - - CFBundleHelpBookName - MacPython Help - CFBundleHelpTOCFile - index.html - CFBundleIconFile - PythonInterpreter.icns - CFBundleIdentifier - org.python.python - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - 2.5alpha0, (c) 2004 Python Software Foundation. - CFBundleName - Python - CFBundlePackageType - APPL - CFBundleShortVersionString - 2.5alpha0 - CFBundleSignature - PytX - CFBundleVersion - 2.5alpha0 - CSResourcesFileMapped - - LSRequiresCarbon - - NSAppleScriptEnabled - - NSHumanReadableCopyright - (c) 2004 Python Software Foundation. - - diff --git a/Mac/OSXResources/app/PkgInfo b/Mac/OSXResources/app/PkgInfo deleted file mode 100644 index 67c491a..0000000 --- a/Mac/OSXResources/app/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -APPLPytX \ No newline at end of file diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/PackageManager.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/PackageManager.gif deleted file mode 100644 index 2b93dc8..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/PackageManager.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/community.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/community.html deleted file mode 100644 index 140a38b..0000000 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/community.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - What is MacPython? - - - - - - - - - - -
- - -

MacPython Community

-
-
- -

Web Sites

- -

The MacPython homepage, -www.cwi.nl/~jack/macpython.html -is where you can find installers, documents, links to useful packages and more. -And, of course, -www.python.org has a much larger collection -of material on Python that is not Mac-specific.

- -

News groups and Mailing lists

- -

There are a lot of mailing lists on Python. Some of the more interesting -ones are:

-
    -
  • python-help@python.org where -you can send questions for individual support. Please check the websites mentioned -above first, though!
  • -
  • The comp.lang.python newsgroup for general -discussion. Also available as a -mailing list.
  • -
  • The comp.lang.python.announce -newsgroup for announcements. Low-volume and moderated. Also available as a -mailing list.
  • -
  • Last but not least, the pythonmac-sig -mailing list is specifically for MacPython. Discussions on the implementation of new -features, but beginners questions are welcome too.
  • -
- -

In addition there are Python Special Interest Group -mailing lists on a wide variety of topics such as image processing, numerical algorithms -and more.

- -

More

- -

An index of conferences, Wiki's, bookshops and more can be found at the -Community section of the Python website.

- -

If you find a bug you are kindly requested to report it, preferrably through the -automatic bug tracker at www.python.org

- -

If you want to become an active developer you are very welcome! Join the -pythonmac-sig mailing list mentioned above, and read the -Developer section on the Python website.

- - - diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/doc/index.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/doc/index.html deleted file mode 100644 index 2ce7357..0000000 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/doc/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Python Language Documentation - - - -

Python Language and runtime documentation

- -

This volume of documentation is rather big (17 Megabytes) and contains -a tutorial, full description of the Python library (all the modules -and packages included), formal description of the language and more.

- -

You can view it online, where -you can also download PDFs for printing, or you can download and install it -through the Package Manager for viewing and -searching via Apple Help Viewer.

- - diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/finder.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/finder.html deleted file mode 100644 index a8877ba..0000000 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/finder.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - Python and the Finder - - - - - -

Running Python scripts from the Finder

- - - - - -
- - -

The application PythonLauncher will start a Python interpreter - when you drop a Python source file onto it, any file with a .py - or .pyw extension. If you set PythonLauncher as the default - application to open a file -( -tell me more) this also works when you double click a Python script.

- -

PythonLauncher has preferences per filetype for selecting - the interpreter to use, and how to launch it: in a Terminal window - or not, etc. Holding the Option key while launching your script will - bring up a window that allows changing these settings for a single - run.

-
-
- - diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/gui.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/gui.html deleted file mode 100644 index 252c78c..0000000 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/gui.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Creating a User Interface with MacPython - - - - - -

Creating a User Interface with MacPython

- -

There are a number of packages that allow creation of a user interface -for your Python code, each of which has its own merits:

- -
    -
  • The Carbon package gives low-level access to the old Macintosh toolbox - calls for windows, events, dialogs and more. The FrameWork module - wraps these in a minimal framework. For documentation see the Macintosh - Library section of the Python Language and runtime - documentation and the Human Interface Toolbox section of - Apple's Carbon Documentation. - This solution is compatible with MacPython-OS9.
  • -
  • The W framework is built on top of this, and easier to use. - The MacPython IDE uses W. Some documentation is available on - Corran Webster's website. - Compatible with MacPython-OS9.
  • -
- -

For new work, however, one of the following packages may be better suited. -They may be available out of the box in this distribution, otherwise you -can install them through the Package Manager:

- -
    -
  • PyObjC allows complete access to Cocoa. - In technical terms it is a - bidirectional bridge between Python and Objectve-C, similar to Apple's Java - bridge. Probably the best choice for Mac OS X-only applications, but at the - time of this writing PyObjC is still in beta.
  • - -
  • wxPython gives Python programs - access to the wxWindows GUI toolkit. Many people consider this - the best open source cross-platform GUI solution available today.
  • - -
  • Tkinter is the oldest cross-platform GUI toolkit for Python, bridging Python - to Tcl/Tk. If you install AquaTk it creates a native user interface on Mac OS X. - Documented in the Library section, Tkinter subsection of the - Python Language and runtime documentation. Tkinter - is not available for MacPython-OS9.
  • -
- - - diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/IDE.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/IDE.gif deleted file mode 100644 index da9325d..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/IDE.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/entering_in_new_window.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/entering_in_new_window.gif deleted file mode 100644 index baa400e..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/entering_in_new_window.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/hello_world.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/hello_world.gif deleted file mode 100644 index c7390af..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/hello_world.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/index.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/index.html deleted file mode 100644 index a169f5e..0000000 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/index.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - One Day of MacPython IDE Toying - - - - -

One Day of MacPython IDE Toying

- - - - - -
- - -

This document gives a very basic introduction to the - MacPython Integrated Development Environment (IDE) on Mac OS. It was - written specifically for MacPython 2.3 on Mac OS X, but most of - it is applicable to MacPython-OS9 too. It is based on - "One - Day of IDLE Toying" by Danny Yoo, which you should read if - you want to use the cross-platform IDLE Python development - environment.

- -
-
-
- -

Ok, let's assume that we've already installed Python. (If not, we can -visit: http://www.cwi.nl/~jack/macpython.html -or http://python.org -and download the most recent Python interpreter. Get the Mac OSX binary -installer.) The first thing we'd like to do is actually start running it! -We can do this by opening up the IDE, which should be in Applications -under the newly-created MacPython program folder:

image of IDE icon

- -

- -

The IDE starts up and shows an interactive window:

-

image of new window

- -

If the window does not show up (because you have run the IDE before -and closed it: it remembers that between runs) open it with the Windows->Python Interactive -menu entry.

- -

This is the interactive window to the IDE, it allows us to enter -commands directly into Python, and as soon as we enter a command, -Python will execute it and spit its result back to us. We'll be -using this interactive window a lot when we're exploring Python: it's -very nice because we get back our results immediately. If it helps, -we can think of it as a very powerful calculator.

- -

- -

Let's try something now! As per tradition, let's get Python to say -the immortal words, "Hello World". image of hello world program

Those '>>>' signs act as a prompt -for us: Python is ready to read in a new command by giving us that -visual cue. Also, we notice that as we enter commands, Python will -give us its output immediately. -

- -

- -

Ok, this seems pretty simple enough. Let's try a few more -commands. If we look below:

- -

image of command window

- -

we'll see the result of running a few more commands. Don't worry -too much about knowing the exact rules for making programs yet: the -idea is that we can experiment with Python by typing in commands. If -things don't work, then we can correct the mistake, and try it -again.

- -

If you got to this point, you now know enough to start playing -around with Python! Crack open one of the tutorials from the Python For Beginners web -page, and start exploring with the interpreter. No time limit here. *grin*

- -

- -

Now that we've paddled long enough, we might be asking: ok, this is -neat, but if we close down Python and start it up again, how do we get -the computer to remember what we typed?

- -

The solution is a little subtle: we can't directly save what's in -the interpreter window, because it will include both our commands and -the system's responses. What we'd like is to make a prepared file, -with just our own commands, and to be able to save that file as a -document. When we're in the mood, we can later open that file and -"run" Python over it, saving us the time of retyping the whole -thing over again.

- -

Let's try this. First, let's start with a clean slate by opening -up a new window.

- -

image of making new window

- -

Here's the result of that menu command:

- -

image of new window

- -

We notice that there's nothing in this new window. What this means -is that this file is purely for our commands: Python won't interject -with its own responses as we enter the program, that is, not until we -tell it to. This is called an edit window, and it is very similar -to edit windows in other editors such as TextEdit or BBEdit.

- -

- -

What we wanted to do before was save some of the stuff we had -tried out on the interpreter window. Let's do that by typing (or -copy/pasting) those commands into our edit window.

-

image of entering commands

- -

Ok, we're done with copying and pasting. -One big thing to notice -is that we're careful to get rid of the ">>>" -prompts because they're not really part of our program. The -interpreter uses them just to tell us that we're in the interpreter, -but now that we're editing in a separate file, we can remove the -artifacts that the interpreter introduces. -I have added -an extra empty print statement so our output ends with a newline. -

- -

- -

Let's save the file now. The Save command is located under the File menu:

-

image of saving file

- - -

- -

Now that we've saved the program, how do we run the program? Use the -Run All button at the top of the editing window, or the equivalent -menu command Python->Run Window. The output will appear in a new -window called Output Window.

- -

By the way, one thing to notice is that I made a typo: I didn't -quite copy exactly what I had entered in the interpreter window -before. Does this affect things?

- -

image of syntax error

- -

Ooops. Here is an example of what Python calls a "syntax error". -Python sees that we made a typo, and warns us to take a much closer -look at our program. The designers of Python feel that having the -system point out the error is better than trying to guess at what the -programmer meant. Press the Edit button and you will be brought to -the trouble spot.

- -

Python is often perceptive enough to direct us toward the problem, -and in this case, it's telling us that we forgot to put something at -the end of this line. In this case, we need to add a -quotation mark at the end. Let's add that in now.

- -

Other errors, which usually occur later, when your program has -already done something, result in a different dialog that allows you -to look at variables and such in addition to showing you where -the error occurred.

- -

- -

Ok, let's say that we fixed that silly typo. Let's try to run the -program again. This gives us a new window, the Output window, showing -the output of our program:

-

image of output window

- -

- -

As we play with Python, we'll find ourselves "switching modes" -between the Interpreter window and the edit window. However, -if we try anything more complicated than two or three lines it -is often a good idea to work in an edit window. Align -your edit and output window such that you can see them at the same time.

- -

This is pretty much all we need to know about the MacPython IDE to actually do -interesting things. There is a lot more to the IDE, here is a quick -breakdown of things to see and explore:

- -
    -
  • All sorts of edit commands such as find and replace can be - used in the editor windows. See the Edit menu.
  • - -
  • The bottom of the edit window has the scrollbar, but at the - left are two navigation devices: a line number box that you can type - numbers into to quickly go to a specific place, and a popup menu - that lists all classes, functions and methods in your file.
  • - -
  • Above the vertical scrollbar you find another popup menu, this - influences how the Run command works. You should try the debugger - some time! If you do, and you wonder what the new small column on - the left of your script is: you can click in it to make Python stop - when it reaches this line so you can inspect things. The profiler - is also nifty: it shows you where your program is spending its time.
  • - -
  • The module browser (Python->Module Browser) shows you all Python - modules currently loaded. You can look at the contents of the module with - Browse... and (for modules written in Python) at the source with Source...
  • - -
  • The Package Manager (under the File menu, also available as a - separate application) allows you to easily install Python extension packages - for all sorts of things: scientific computation, image processing, - building user interfaces and more.
  • - -
  • The Help menu gives you quick access to both the Python documentation, - if you have installed it with the Package Manager, and the Apple Developer - documentation.
  • - -
  • The File->Save as Applet menu command saves your script as a MacOSX - application. This allows you to create a script that you can drop files on, - and much more. The IDE itself is such an applet, completely written in Python.
  • - -
- - diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/loading_ide.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/loading_ide.gif deleted file mode 100644 index e7cca3d..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/loading_ide.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/making_new_window.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/making_new_window.gif deleted file mode 100644 index d2022c8..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/making_new_window.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/new_ide_window.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/new_ide_window.gif deleted file mode 100644 index 7268a84..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/new_ide_window.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/new_window_made.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/new_window_made.gif deleted file mode 100644 index dd6cca3..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/new_window_made.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/output_window.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/output_window.gif deleted file mode 100644 index 568dcb5..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/output_window.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/saving_edited_file.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/saving_edited_file.gif deleted file mode 100644 index 6e5c926..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/saving_edited_file.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/simple_commands.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/simple_commands.gif deleted file mode 100644 index 1dba570..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/simple_commands.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/syntax_error.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/syntax_error.gif deleted file mode 100644 index 2e95b87..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/ide/syntax_error.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/index.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/index.html deleted file mode 100644 index ef12c10..0000000 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/index.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - MacPython Help - - - - - - - -

MacPython Help

- - - - - -
- - -

Choose a topic, or enter keywords into the search field:

- - -
-
- - - diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/intro.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/intro.html deleted file mode 100644 index f0ab371..0000000 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/intro.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - What is MacPython? - - - - - -

What is MacPython?

- - - - - -
- - -

Python is a programming language. MacPython is a package containing -that programming language plus Mac-specific tools and extensions.

- -
-
- -

The Python Language

-

The Python programming language is available for many hardware -platforms, and most general documentation is Unix- or Windows-centered. Keep -this in mind when reading the rest of this help, or information on the web. -

- -

The Python website, www.python.org, -has a Beginners Guide section including an -executive summary on -the language and a -comparison of Python -to other languages. Or read the (rather longwinded) Python -Tutorial in the Python Language and runtime documentation.

- -

MacPython contains a complete unix interpreter so -if you are familiar with Python on unix you should feel right at home.

- -

MacPython additions

- -

The MacPython Integrated Development Environment (IDE) allows -easy editing, running and debugging of scripts. Read the -Introduction -to the IDE to whet your appetite.

- -

MacPython comes with lots of modules that allow access to -MacOS-specific technology, such as Carbon, Quicktime and AppleScript. -See the Macintosh -Modules section of the -Python Language and runtime documentation, -but please keep in mind that some information there still pertains to -Mac OS 9. - -Full access to the Cocoa APIs -and tools such as Interface Builder is available separately through the -Package Manager.

- -

The Package Manager also gives you access to extension -packages for cross-platform GUI development (Tkinter, wxPython, PyOpenGL), -image processing (PIL), scientific -computing (Numeric) and much more. PyObjC deserves a special mention: it allows -transparent access to Cocoa and Interface Builder, similar to what Java provides, -thereby making Python a first class citizen in the Mac OS X developer world.

- -

Python scripts can be saved as applets, semi-standalone applications -that work just like a normal application. Additionally you can even create -true standalone application that have everything embedded and can be -shipped to anyone, without the need to install Python. You do not -need to install the Apple Developer Tools for this.

- - diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/packman.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/packman.html deleted file mode 100644 index 355e0da..0000000 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/packman.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - Python Package Manager - - - - - -

Installing additional Python Packages

- - - - - -
- - -

The Python Package Manager helps you installing additional - packages that enhance Python. It determines the exact MacOS version - and Python version you have and uses that information to download - a database that has packages that are test and tried on that - combination. In other words: if something is in your Package Manager - window but does not work you are free to blame the database maintainer.

- -

PackageManager then checks which of the packages you have installed - and which ones not. This should also work when you have installed packages - outside of PackageManager. - You can select packages and install them, and PackageManager will work - out the requirements and install these too.

- -

Often PackageManager will list a package in two flavors: binary - and source. Binary should always work, source will only work if - you have installed the Apple Developer Tools. PackageManager will warn - you about this, and also about other external dependencies.

- -

PackageManager is available as a separate application and also - as a function of the IDE, through the File->Package Manager menu - entry.

- -

Troubleshooting

- -

If package manager fails to open the database first check that you are - connected to the internet. If you are connected then the problem - could be that there is no database (yet?) for your version of Mac OS X. - You may be able to find an alternative - database that works for your system at - http://www.python.org/packman. - In the standalone Package Manager you can then open such an alternative database - with the File->Open URL... command, but you should realize that - you are now on untested ground.

- -

Another potential problem source is that you are behind a firewall. This version - of PackageManager uses the Unix method of setting a firewall: you need to set the - environment variable http_proxy to "http://proxyhost:port". - See Apple Technical - Q&A QA1067 for instructions.

- -
-
- - diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/python.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/python.gif deleted file mode 100644 index 3d4aa5d..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/python.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/pythonsmall.gif b/Mac/OSXResources/app/Resources/English.lproj/Documentation/pythonsmall.gif deleted file mode 100644 index 440225e..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/Documentation/pythonsmall.gif and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/scripting.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/scripting.html deleted file mode 100644 index 16321cb..0000000 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/scripting.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Controlling other Applications from MacPython - - - - - -

Controlling other Applications from MacPython

- -

Python has a fairly complete implementation of the Open Scripting -Architecure (OSA, also commonly referred to as AppleScript), allowing -you to control scriptable applications from your Python program, -and with a fairly pythonic interface. This piece of -Python:

- -

-import Finder
-
-f = Finder.Finder()
-print f.get(f.window(1).name)
-
- -

is identical to the following piece of AppleScript:

- -

-tell application "Finder"
-	get name of window 1
-end tell
-
- -

To send AppleEvents to an application you must first create the Python -modules interfacing to the terminology of the application (what -Script Editor calls the "Dictionary"). Use the IDE menu command -File->Generate OSA Suite... for this. For more control run

- -
-pythonw .../Lib/plat-mac/gensuitemodule.py --help -
- -

from a terminal window.

- -

Creating a scriptable application in Python

- -You can also create a scriptable application in Python, but this is not -very well documented. For Carbon -applications you should look at the MiniAEFrame module. - - - diff --git a/Mac/OSXResources/app/Resources/English.lproj/Documentation/shell.html b/Mac/OSXResources/app/Resources/English.lproj/Documentation/shell.html deleted file mode 100644 index 56f5646..0000000 --- a/Mac/OSXResources/app/Resources/English.lproj/Documentation/shell.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Python and the Unix Shell - - - - - -

Running Python scripts from the Unix Shell

- - - - - -
- - -

MacPython 2.3 installs a perfectly normal Unix commandline - python interpreter in /usr/local/bin/python. As of Mac OS X 10.2, however, - /usr/local/bin is not on the search path of your shell. Moreover, - Apple's python 2.2, which lives in /usr/bin is on your - search path, so this can lead to confusion.

- -

If you use tcsh you should add the following line - to the file .login in your home directory and restart Terminal: -
- setenv PATH /usr/local/bin:$PATH -

- -

If you use bash or zsh - you should add the following line - to the file .profile in your home directory and restart Terminal: -
- export PATH=/usr/local/bin:$PATH -

- -

GUI scripts

- -

Due to the way MacOS handles windowing applications you need to run - all scripts that use the window manager (be it through - Carbon, Cocoa, Tkinter, wxPython, PyOpenGL or anything else) with the - pythonw interpreter, also installed in /usr/local/bin.

- -

Running with python results in an inability to bring the - script to the front, or interacting with it.

-
-
- - diff --git a/Mac/OSXResources/app/Resources/English.lproj/InfoPlist.strings b/Mac/OSXResources/app/Resources/English.lproj/InfoPlist.strings deleted file mode 100644 index f8a8bc1..0000000 Binary files a/Mac/OSXResources/app/Resources/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/PythonApplet.icns b/Mac/OSXResources/app/Resources/PythonApplet.icns deleted file mode 100644 index c8aad9f..0000000 Binary files a/Mac/OSXResources/app/Resources/PythonApplet.icns and /dev/null differ diff --git a/Mac/OSXResources/app/Resources/PythonInterpreter.icns b/Mac/OSXResources/app/Resources/PythonInterpreter.icns deleted file mode 100644 index e09fd38..0000000 Binary files a/Mac/OSXResources/app/Resources/PythonInterpreter.icns and /dev/null differ diff --git a/Mac/OSXResources/framework/English.lproj/InfoPlist.strings b/Mac/OSXResources/framework/English.lproj/InfoPlist.strings deleted file mode 100644 index cc24bfc..0000000 Binary files a/Mac/OSXResources/framework/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Mac/OSXResources/framework/Info.plist b/Mac/OSXResources/framework/Info.plist deleted file mode 100644 index 302ff48..0000000 --- a/Mac/OSXResources/framework/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - Python - CFBundleGetInfoString - Python Runtime and Library - CFBundleIdentifier - org.python.python - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Python - CFBundlePackageType - FMWK - CFBundleShortVersionString - 2.5 - CFBundleSignature - ???? - CFBundleVersion - 2.5 - - diff --git a/Mac/OSXResources/framework/version.plist b/Mac/OSXResources/framework/version.plist deleted file mode 100644 index 7527442..0000000 --- a/Mac/OSXResources/framework/version.plist +++ /dev/null @@ -1,18 +0,0 @@ - - - - - BuildVersion - 1 - CFBundleShortVersionString - 2.5alpha0 - CFBundleVersion - 2.5alpha0 - ProjectName - Python - ReleaseStatus - alfa - SourceVersion - 2.4a0 - - diff --git a/Mac/OSXResources/iconsrc/IDE.psd b/Mac/OSXResources/iconsrc/IDE.psd deleted file mode 100644 index b9637b9..0000000 Binary files a/Mac/OSXResources/iconsrc/IDE.psd and /dev/null differ diff --git a/Mac/OSXResources/iconsrc/PackageManager.psd b/Mac/OSXResources/iconsrc/PackageManager.psd deleted file mode 100644 index 42f41b1..0000000 Binary files a/Mac/OSXResources/iconsrc/PackageManager.psd and /dev/null differ diff --git a/Mac/OSXResources/iconsrc/PythonApplet.psd b/Mac/OSXResources/iconsrc/PythonApplet.psd deleted file mode 100644 index 7458b52..0000000 Binary files a/Mac/OSXResources/iconsrc/PythonApplet.psd and /dev/null differ diff --git a/Mac/OSXResources/iconsrc/PythonCompiled.psd b/Mac/OSXResources/iconsrc/PythonCompiled.psd deleted file mode 100755 index 61fc4d1..0000000 Binary files a/Mac/OSXResources/iconsrc/PythonCompiled.psd and /dev/null differ diff --git a/Mac/OSXResources/iconsrc/PythonIcon.psd b/Mac/OSXResources/iconsrc/PythonIcon.psd deleted file mode 100755 index d818dc6..0000000 Binary files a/Mac/OSXResources/iconsrc/PythonIcon.psd and /dev/null differ diff --git a/Mac/OSXResources/iconsrc/PythonSource.psd b/Mac/OSXResources/iconsrc/PythonSource.psd deleted file mode 100755 index eba8f28..0000000 Binary files a/Mac/OSXResources/iconsrc/PythonSource.psd and /dev/null differ diff --git a/Mac/OSXResources/iconsrc/PythonWSource.psd b/Mac/OSXResources/iconsrc/PythonWSource.psd deleted file mode 100644 index 2b84d94..0000000 Binary files a/Mac/OSXResources/iconsrc/PythonWSource.psd and /dev/null differ diff --git a/Mac/README b/Mac/README new file mode 100644 index 0000000..1e58b02 --- /dev/null +++ b/Mac/README @@ -0,0 +1,167 @@ +============ +MacOSX Notes +============ + +This document provides a quick overview of some Mac OS X specific features in +the Python distribution. + + +Building and using a universal binary of Python on Mac OS X +=========================================================== + +1. What is a universal binary +----------------------------- + +A universal binary build of Python contains object code for both PPC and i386 +and can therefore run at native speed on both classic powerpc based macs and +the newer intel based macs. + +2. How do I build a universal binary +------------------------------------ + +You can enable universal binaries by specifying the "--enable-universalsdk" +flag to configure:: + + $ ./configure --enable-universalsdk + $ make + $ make install + +This flag can be used a framework build of python, but also with a classic +unix build. Either way you will have to build python on Mac OS X 10.4 (or later) +with Xcode 2.1 (or later). You also have to install the 10.4u SDK when +installing Xcode. + + +Building and using a framework-based Python on Mac OS X. +======================================================== + + +1. Why would I want a framework Python instead of a normal static Python? +-------------------------------------------------------------------------- + +The main reason is because you want to create GUI programs in Python. With the +exception of X11/XDarwin-based GUI toolkits all GUI programs need to be run +from a fullblown MacOSX application (a ".app" bundle). + +While it is technically possible to create a .app without using frameworks you +will have to do the work yourself if you really want this. + +A second reason for using frameworks is that they put Python-related items in +only two places: "/Library/Framework/Python.framework" and +"/Applications/MacPython 2.5". This simplifies matters for users installing +Python from a binary distribution if they want to get rid of it again. Moreover, +due to the way frameworks work a user without admin privileges can install a +binary distribution in his or her home directory without recompilation. + +2. How does a framework Python differ from a normal static Python? +------------------------------------------------------------------ + +In everyday use there is no difference, except that things are stored in +a different place. If you look in /Library/Frameworks/Python.framework +you will see lots of relative symlinks, see the Apple documentation for +details. If you are used to a normal unix Python file layout go down to +Versions/Current and you will see the familiar bin and lib directories. + +3. Do I need extra packages? +---------------------------- + +Yes, probably. If you want Tkinter support you need to get the OSX AquaTk +distribution, this is installed by default on Mac OS X 10.4 or later. If +you want wxPython you need to get that. If you want Cocoa you need to get +PyObjC. + +4. How do I build a framework Python? +------------------------------------- + +This directory contains a Makefile that will create a couple of python-related +applications (fullblown OSX .app applications, that is) in +"/Applications/MacPython 2.3", and a hidden helper application Python.app +inside the Python.framework, and unix tools "python" and "pythonw" into +/usr/local/bin. In addition it has a target "installmacsubtree" that installs +the relevant portions of the Mac subtree into the Python.framework. + +It is normally invoked indirectly through the main Makefile, as the last step +in the sequence + + 1. ./configure --enable-framework + + 2. make + + 3. make install + +This sequence will put the framework in /Library/Framework/Python.framework, +the applications in /Applications/MacPython 2.5 and the unix tools in +/usr/local/bin. + +Installing in another place, for instance $HOME/Library/Frameworks if you have +no admin privileges on your machine, has only been tested very lightly. This +can be done by configuring with --enable-framework=$HOME/Library/Frameworks. +The other two directories, /Applications/MacPython-2.3 and /usr/local/bin, will +then also be deposited in $HOME. This is sub-optimal for the unix tools, which +you would want in $HOME/bin, but there is no easy way to fix this right now. + +Note that there are no references to the actual locations in the code or +resource files, so you are free to move things around afterwards. For example, +you could use --enable-framework=/tmp/newversion/Library/Frameworks and use +/tmp/newversion as the basis for an installer or something. + +If you want to install some part, but not all, read the main Makefile. The +frameworkinstall is composed of a couple of sub-targets that install the +framework itself, the Mac subtree, the applications and the unix tools. + +There is an extra target frameworkinstallextras that is not part of the +normal frameworkinstall which installs the Demo and Tools directories +into /Applications/MacPython-2.3, this is useful for binary distributions. + +What do all these programs do? +=============================== + +"IDLE.app" is an integrated development environment for Python: editor, +debugger, etc. + +"PythonLauncher.app" is a helper application that will handle things when you +double-click a .py, .pyc or .pyw file. For the first two it creates a Terminal +window and runs the scripts with the normal command-line Python. For the +latter it runs the script in the Python.app interpreter so the script can do +GUI-things. Keep the "alt" key depressed while dragging or double-clicking a +script to set runtime options. These options can be set once and for all +through PythonLauncher's preferences dialog. + +"BuildApplet.app" creates an applet from a Python script. Drop the script on it +and out comes a full-featured MacOS application. There is much more to this, +to be supplied later. Some useful (but outdated) info can be found in +Mac/Demo. + +The commandline scripts /usr/local/bin/python and pythonw can be used to run +non-GUI and GUI python scripts from the command line, respectively. + +How do I create a binary distribution? +====================================== + +Go to the directory "Mac/OSX/BuildScript". There you'll find a script +"build-installer.py" that does all the work. This will download and build +a number of 3th-party libaries, configures and builds a framework Python, +installs it, creates the installer pacakge files and then packs this in a +DMG image. + +The script will build a universal binary, you'll therefore have to run this +script on Mac OS X 10.4 or later and with Xcode 2.1 or later installed. + +All of this is normally done completely isolated in /tmp/_py, so it does not +use your normal build directory nor does it install into /. + +Because of the way the script locates the files it needs you have to run it +from within the BuildScript directory. The script accepts a number of +command-line arguments, run it with --help for more information. + +Odds and ends +============= + +Something to take note of is that the ".rsrc" files in the distribution are +not actually resource files, they're AppleSingle encoded resource files. The +macresource module and the Mac/OSX/Makefile cater for this, and create +".rsrc.df.rsrc" files on the fly that are normal datafork-based resource +files. + + Jack Jansen, Jack.Jansen@cwi.nl, 15-Jul-2004. + Ronald Oussoren, RonaldOussoren@mac.com, 26-May-2006 diff --git a/Mac/Resources/app/Info.plist b/Mac/Resources/app/Info.plist new file mode 100644 index 0000000..387bbed --- /dev/null +++ b/Mac/Resources/app/Info.plist @@ -0,0 +1,60 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeOSTypes + + **** + fold + disk + + CFBundleTypeRole + Viewer + + + CFBundleExecutable + Python + CFBundleGetInfoString + 2.5alpha0, (c) 2004 Python Software Foundation. + CFBundleHelpBookFolder + + Documentation + PythonDocumentation + + CFBundleHelpBookName + MacPython Help + CFBundleHelpTOCFile + index.html + CFBundleIconFile + PythonInterpreter.icns + CFBundleIdentifier + org.python.python + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + 2.5alpha0, (c) 2004 Python Software Foundation. + CFBundleName + Python + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.5alpha0 + CFBundleSignature + PytX + CFBundleVersion + 2.5alpha0 + CSResourcesFileMapped + + LSRequiresCarbon + + NSAppleScriptEnabled + + NSHumanReadableCopyright + (c) 2004 Python Software Foundation. + + diff --git a/Mac/Resources/app/PkgInfo b/Mac/Resources/app/PkgInfo new file mode 100644 index 0000000..67c491a --- /dev/null +++ b/Mac/Resources/app/PkgInfo @@ -0,0 +1 @@ +APPLPytX \ No newline at end of file diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/PackageManager.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/PackageManager.gif new file mode 100644 index 0000000..2b93dc8 Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/PackageManager.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/community.html b/Mac/Resources/app/Resources/English.lproj/Documentation/community.html new file mode 100644 index 0000000..140a38b --- /dev/null +++ b/Mac/Resources/app/Resources/English.lproj/Documentation/community.html @@ -0,0 +1,69 @@ + + + + + What is MacPython? + + + + + + + + + + +
+ + +

MacPython Community

+
+
+ +

Web Sites

+ +

The MacPython homepage, +www.cwi.nl/~jack/macpython.html +is where you can find installers, documents, links to useful packages and more. +And, of course, +www.python.org has a much larger collection +of material on Python that is not Mac-specific.

+ +

News groups and Mailing lists

+ +

There are a lot of mailing lists on Python. Some of the more interesting +ones are:

+
    +
  • python-help@python.org where +you can send questions for individual support. Please check the websites mentioned +above first, though!
  • +
  • The comp.lang.python newsgroup for general +discussion. Also available as a +mailing list.
  • +
  • The comp.lang.python.announce +newsgroup for announcements. Low-volume and moderated. Also available as a +mailing list.
  • +
  • Last but not least, the pythonmac-sig +mailing list is specifically for MacPython. Discussions on the implementation of new +features, but beginners questions are welcome too.
  • +
+ +

In addition there are Python Special Interest Group +mailing lists on a wide variety of topics such as image processing, numerical algorithms +and more.

+ +

More

+ +

An index of conferences, Wiki's, bookshops and more can be found at the +Community section of the Python website.

+ +

If you find a bug you are kindly requested to report it, preferrably through the +automatic bug tracker at www.python.org

+ +

If you want to become an active developer you are very welcome! Join the +pythonmac-sig mailing list mentioned above, and read the +Developer section on the Python website.

+ + + diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/doc/index.html b/Mac/Resources/app/Resources/English.lproj/Documentation/doc/index.html new file mode 100644 index 0000000..2ce7357 --- /dev/null +++ b/Mac/Resources/app/Resources/English.lproj/Documentation/doc/index.html @@ -0,0 +1,21 @@ + + + + + Python Language Documentation + + + +

Python Language and runtime documentation

+ +

This volume of documentation is rather big (17 Megabytes) and contains +a tutorial, full description of the Python library (all the modules +and packages included), formal description of the language and more.

+ +

You can view it online, where +you can also download PDFs for printing, or you can download and install it +through the Package Manager for viewing and +searching via Apple Help Viewer.

+ + diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/finder.html b/Mac/Resources/app/Resources/English.lproj/Documentation/finder.html new file mode 100644 index 0000000..a8877ba --- /dev/null +++ b/Mac/Resources/app/Resources/English.lproj/Documentation/finder.html @@ -0,0 +1,36 @@ + + + + + Python and the Finder + + + + + +

Running Python scripts from the Finder

+ + + + + +
+ + +

The application PythonLauncher will start a Python interpreter + when you drop a Python source file onto it, any file with a .py + or .pyw extension. If you set PythonLauncher as the default + application to open a file +( +tell me more) this also works when you double click a Python script.

+ +

PythonLauncher has preferences per filetype for selecting + the interpreter to use, and how to launch it: in a Terminal window + or not, etc. Holding the Option key while launching your script will + bring up a window that allows changing these settings for a single + run.

+
+
+ + diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/gui.html b/Mac/Resources/app/Resources/English.lproj/Documentation/gui.html new file mode 100644 index 0000000..252c78c --- /dev/null +++ b/Mac/Resources/app/Resources/English.lproj/Documentation/gui.html @@ -0,0 +1,54 @@ + + + + + Creating a User Interface with MacPython + + + + + +

Creating a User Interface with MacPython

+ +

There are a number of packages that allow creation of a user interface +for your Python code, each of which has its own merits:

+ +
    +
  • The Carbon package gives low-level access to the old Macintosh toolbox + calls for windows, events, dialogs and more. The FrameWork module + wraps these in a minimal framework. For documentation see the Macintosh + Library section of the Python Language and runtime + documentation and the Human Interface Toolbox section of + Apple's Carbon Documentation. + This solution is compatible with MacPython-OS9.
  • +
  • The W framework is built on top of this, and easier to use. + The MacPython IDE uses W. Some documentation is available on + Corran Webster's website. + Compatible with MacPython-OS9.
  • +
+ +

For new work, however, one of the following packages may be better suited. +They may be available out of the box in this distribution, otherwise you +can install them through the Package Manager:

+ +
    +
  • PyObjC allows complete access to Cocoa. + In technical terms it is a + bidirectional bridge between Python and Objectve-C, similar to Apple's Java + bridge. Probably the best choice for Mac OS X-only applications, but at the + time of this writing PyObjC is still in beta.
  • + +
  • wxPython gives Python programs + access to the wxWindows GUI toolkit. Many people consider this + the best open source cross-platform GUI solution available today.
  • + +
  • Tkinter is the oldest cross-platform GUI toolkit for Python, bridging Python + to Tcl/Tk. If you install AquaTk it creates a native user interface on Mac OS X. + Documented in the Library section, Tkinter subsection of the + Python Language and runtime documentation. Tkinter + is not available for MacPython-OS9.
  • +
+ + + diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/IDE.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/IDE.gif new file mode 100644 index 0000000..da9325d Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/IDE.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/entering_in_new_window.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/entering_in_new_window.gif new file mode 100644 index 0000000..baa400e Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/entering_in_new_window.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/hello_world.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/hello_world.gif new file mode 100644 index 0000000..c7390af Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/hello_world.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/index.html b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/index.html new file mode 100644 index 0000000..a169f5e --- /dev/null +++ b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/index.html @@ -0,0 +1,222 @@ + + + + One Day of MacPython IDE Toying + + + + +

One Day of MacPython IDE Toying

+ + + + + +
+ + +

This document gives a very basic introduction to the + MacPython Integrated Development Environment (IDE) on Mac OS. It was + written specifically for MacPython 2.3 on Mac OS X, but most of + it is applicable to MacPython-OS9 too. It is based on + "One + Day of IDLE Toying" by Danny Yoo, which you should read if + you want to use the cross-platform IDLE Python development + environment.

+ +
+
+
+ +

Ok, let's assume that we've already installed Python. (If not, we can +visit: http://www.cwi.nl/~jack/macpython.html +or http://python.org +and download the most recent Python interpreter. Get the Mac OSX binary +installer.) The first thing we'd like to do is actually start running it! +We can do this by opening up the IDE, which should be in Applications +under the newly-created MacPython program folder:

image of IDE icon

+ +

+ +

The IDE starts up and shows an interactive window:

+

image of new window

+ +

If the window does not show up (because you have run the IDE before +and closed it: it remembers that between runs) open it with the Windows->Python Interactive +menu entry.

+ +

This is the interactive window to the IDE, it allows us to enter +commands directly into Python, and as soon as we enter a command, +Python will execute it and spit its result back to us. We'll be +using this interactive window a lot when we're exploring Python: it's +very nice because we get back our results immediately. If it helps, +we can think of it as a very powerful calculator.

+ +

+ +

Let's try something now! As per tradition, let's get Python to say +the immortal words, "Hello World". image of hello world program

Those '>>>' signs act as a prompt +for us: Python is ready to read in a new command by giving us that +visual cue. Also, we notice that as we enter commands, Python will +give us its output immediately. +

+ +

+ +

Ok, this seems pretty simple enough. Let's try a few more +commands. If we look below:

+ +

image of command window

+ +

we'll see the result of running a few more commands. Don't worry +too much about knowing the exact rules for making programs yet: the +idea is that we can experiment with Python by typing in commands. If +things don't work, then we can correct the mistake, and try it +again.

+ +

If you got to this point, you now know enough to start playing +around with Python! Crack open one of the tutorials from the Python For Beginners web +page, and start exploring with the interpreter. No time limit here. *grin*

+ +

+ +

Now that we've paddled long enough, we might be asking: ok, this is +neat, but if we close down Python and start it up again, how do we get +the computer to remember what we typed?

+ +

The solution is a little subtle: we can't directly save what's in +the interpreter window, because it will include both our commands and +the system's responses. What we'd like is to make a prepared file, +with just our own commands, and to be able to save that file as a +document. When we're in the mood, we can later open that file and +"run" Python over it, saving us the time of retyping the whole +thing over again.

+ +

Let's try this. First, let's start with a clean slate by opening +up a new window.

+ +

image of making new window

+ +

Here's the result of that menu command:

+ +

image of new window

+ +

We notice that there's nothing in this new window. What this means +is that this file is purely for our commands: Python won't interject +with its own responses as we enter the program, that is, not until we +tell it to. This is called an edit window, and it is very similar +to edit windows in other editors such as TextEdit or BBEdit.

+ +

+ +

What we wanted to do before was save some of the stuff we had +tried out on the interpreter window. Let's do that by typing (or +copy/pasting) those commands into our edit window.

+

image of entering commands

+ +

Ok, we're done with copying and pasting. +One big thing to notice +is that we're careful to get rid of the ">>>" +prompts because they're not really part of our program. The +interpreter uses them just to tell us that we're in the interpreter, +but now that we're editing in a separate file, we can remove the +artifacts that the interpreter introduces. +I have added +an extra empty print statement so our output ends with a newline. +

+ +

+ +

Let's save the file now. The Save command is located under the File menu:

+

image of saving file

+ + +

+ +

Now that we've saved the program, how do we run the program? Use the +Run All button at the top of the editing window, or the equivalent +menu command Python->Run Window. The output will appear in a new +window called Output Window.

+ +

By the way, one thing to notice is that I made a typo: I didn't +quite copy exactly what I had entered in the interpreter window +before. Does this affect things?

+ +

image of syntax error

+ +

Ooops. Here is an example of what Python calls a "syntax error". +Python sees that we made a typo, and warns us to take a much closer +look at our program. The designers of Python feel that having the +system point out the error is better than trying to guess at what the +programmer meant. Press the Edit button and you will be brought to +the trouble spot.

+ +

Python is often perceptive enough to direct us toward the problem, +and in this case, it's telling us that we forgot to put something at +the end of this line. In this case, we need to add a +quotation mark at the end. Let's add that in now.

+ +

Other errors, which usually occur later, when your program has +already done something, result in a different dialog that allows you +to look at variables and such in addition to showing you where +the error occurred.

+ +

+ +

Ok, let's say that we fixed that silly typo. Let's try to run the +program again. This gives us a new window, the Output window, showing +the output of our program:

+

image of output window

+ +

+ +

As we play with Python, we'll find ourselves "switching modes" +between the Interpreter window and the edit window. However, +if we try anything more complicated than two or three lines it +is often a good idea to work in an edit window. Align +your edit and output window such that you can see them at the same time.

+ +

This is pretty much all we need to know about the MacPython IDE to actually do +interesting things. There is a lot more to the IDE, here is a quick +breakdown of things to see and explore:

+ +
    +
  • All sorts of edit commands such as find and replace can be + used in the editor windows. See the Edit menu.
  • + +
  • The bottom of the edit window has the scrollbar, but at the + left are two navigation devices: a line number box that you can type + numbers into to quickly go to a specific place, and a popup menu + that lists all classes, functions and methods in your file.
  • + +
  • Above the vertical scrollbar you find another popup menu, this + influences how the Run command works. You should try the debugger + some time! If you do, and you wonder what the new small column on + the left of your script is: you can click in it to make Python stop + when it reaches this line so you can inspect things. The profiler + is also nifty: it shows you where your program is spending its time.
  • + +
  • The module browser (Python->Module Browser) shows you all Python + modules currently loaded. You can look at the contents of the module with + Browse... and (for modules written in Python) at the source with Source...
  • + +
  • The Package Manager (under the File menu, also available as a + separate application) allows you to easily install Python extension packages + for all sorts of things: scientific computation, image processing, + building user interfaces and more.
  • + +
  • The Help menu gives you quick access to both the Python documentation, + if you have installed it with the Package Manager, and the Apple Developer + documentation.
  • + +
  • The File->Save as Applet menu command saves your script as a MacOSX + application. This allows you to create a script that you can drop files on, + and much more. The IDE itself is such an applet, completely written in Python.
  • + +
+ + diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/loading_ide.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/loading_ide.gif new file mode 100644 index 0000000..e7cca3d Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/loading_ide.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/making_new_window.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/making_new_window.gif new file mode 100644 index 0000000..d2022c8 Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/making_new_window.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/new_ide_window.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/new_ide_window.gif new file mode 100644 index 0000000..7268a84 Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/new_ide_window.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/new_window_made.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/new_window_made.gif new file mode 100644 index 0000000..dd6cca3 Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/new_window_made.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/output_window.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/output_window.gif new file mode 100644 index 0000000..568dcb5 Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/output_window.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/saving_edited_file.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/saving_edited_file.gif new file mode 100644 index 0000000..6e5c926 Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/saving_edited_file.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/simple_commands.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/simple_commands.gif new file mode 100644 index 0000000..1dba570 Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/simple_commands.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/ide/syntax_error.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/syntax_error.gif new file mode 100644 index 0000000..2e95b87 Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/ide/syntax_error.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/index.html b/Mac/Resources/app/Resources/English.lproj/Documentation/index.html new file mode 100644 index 0000000..ef12c10 --- /dev/null +++ b/Mac/Resources/app/Resources/English.lproj/Documentation/index.html @@ -0,0 +1,51 @@ + + + + + MacPython Help + + + + + + + +

MacPython Help

+ + + + + +
+ + +

Choose a topic, or enter keywords into the search field:

+ + +
+
+ + + diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/intro.html b/Mac/Resources/app/Resources/English.lproj/Documentation/intro.html new file mode 100644 index 0000000..f0ab371 --- /dev/null +++ b/Mac/Resources/app/Resources/English.lproj/Documentation/intro.html @@ -0,0 +1,76 @@ + + + + + What is MacPython? + + + + + +

What is MacPython?

+ + + + + +
+ + +

Python is a programming language. MacPython is a package containing +that programming language plus Mac-specific tools and extensions.

+ +
+
+ +

The Python Language

+

The Python programming language is available for many hardware +platforms, and most general documentation is Unix- or Windows-centered. Keep +this in mind when reading the rest of this help, or information on the web. +

+ +

The Python website, www.python.org, +has a Beginners Guide section including an +executive summary on +the language and a +comparison of Python +to other languages. Or read the (rather longwinded) Python +Tutorial in the Python Language and runtime documentation.

+ +

MacPython contains a complete unix interpreter so +if you are familiar with Python on unix you should feel right at home.

+ +

MacPython additions

+ +

The MacPython Integrated Development Environment (IDE) allows +easy editing, running and debugging of scripts. Read the +Introduction +to the IDE to whet your appetite.

+ +

MacPython comes with lots of modules that allow access to +MacOS-specific technology, such as Carbon, Quicktime and AppleScript. +See the Macintosh +Modules section of the +Python Language and runtime documentation, +but please keep in mind that some information there still pertains to +Mac OS 9. + +Full access to the Cocoa APIs +and tools such as Interface Builder is available separately through the +Package Manager.

+ +

The Package Manager also gives you access to extension +packages for cross-platform GUI development (Tkinter, wxPython, PyOpenGL), +image processing (PIL), scientific +computing (Numeric) and much more. PyObjC deserves a special mention: it allows +transparent access to Cocoa and Interface Builder, similar to what Java provides, +thereby making Python a first class citizen in the Mac OS X developer world.

+ +

Python scripts can be saved as applets, semi-standalone applications +that work just like a normal application. Additionally you can even create +true standalone application that have everything embedded and can be +shipped to anyone, without the need to install Python. You do not +need to install the Apple Developer Tools for this.

+ + diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/packman.html b/Mac/Resources/app/Resources/English.lproj/Documentation/packman.html new file mode 100644 index 0000000..355e0da --- /dev/null +++ b/Mac/Resources/app/Resources/English.lproj/Documentation/packman.html @@ -0,0 +1,64 @@ + + + + + Python Package Manager + + + + + +

Installing additional Python Packages

+ + + + + +
+ + +

The Python Package Manager helps you installing additional + packages that enhance Python. It determines the exact MacOS version + and Python version you have and uses that information to download + a database that has packages that are test and tried on that + combination. In other words: if something is in your Package Manager + window but does not work you are free to blame the database maintainer.

+ +

PackageManager then checks which of the packages you have installed + and which ones not. This should also work when you have installed packages + outside of PackageManager. + You can select packages and install them, and PackageManager will work + out the requirements and install these too.

+ +

Often PackageManager will list a package in two flavors: binary + and source. Binary should always work, source will only work if + you have installed the Apple Developer Tools. PackageManager will warn + you about this, and also about other external dependencies.

+ +

PackageManager is available as a separate application and also + as a function of the IDE, through the File->Package Manager menu + entry.

+ +

Troubleshooting

+ +

If package manager fails to open the database first check that you are + connected to the internet. If you are connected then the problem + could be that there is no database (yet?) for your version of Mac OS X. + You may be able to find an alternative + database that works for your system at + http://www.python.org/packman. + In the standalone Package Manager you can then open such an alternative database + with the File->Open URL... command, but you should realize that + you are now on untested ground.

+ +

Another potential problem source is that you are behind a firewall. This version + of PackageManager uses the Unix method of setting a firewall: you need to set the + environment variable http_proxy to "http://proxyhost:port". + See Apple Technical + Q&A QA1067 for instructions.

+ +
+
+ + diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/python.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/python.gif new file mode 100644 index 0000000..3d4aa5d Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/python.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/pythonsmall.gif b/Mac/Resources/app/Resources/English.lproj/Documentation/pythonsmall.gif new file mode 100644 index 0000000..440225e Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/Documentation/pythonsmall.gif differ diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/scripting.html b/Mac/Resources/app/Resources/English.lproj/Documentation/scripting.html new file mode 100644 index 0000000..16321cb --- /dev/null +++ b/Mac/Resources/app/Resources/English.lproj/Documentation/scripting.html @@ -0,0 +1,53 @@ + + + + + Controlling other Applications from MacPython + + + + + +

Controlling other Applications from MacPython

+ +

Python has a fairly complete implementation of the Open Scripting +Architecure (OSA, also commonly referred to as AppleScript), allowing +you to control scriptable applications from your Python program, +and with a fairly pythonic interface. This piece of +Python:

+ +

+import Finder
+
+f = Finder.Finder()
+print f.get(f.window(1).name)
+
+ +

is identical to the following piece of AppleScript:

+ +

+tell application "Finder"
+	get name of window 1
+end tell
+
+ +

To send AppleEvents to an application you must first create the Python +modules interfacing to the terminology of the application (what +Script Editor calls the "Dictionary"). Use the IDE menu command +File->Generate OSA Suite... for this. For more control run

+ +
+pythonw .../Lib/plat-mac/gensuitemodule.py --help +
+ +

from a terminal window.

+ +

Creating a scriptable application in Python

+ +You can also create a scriptable application in Python, but this is not +very well documented. For Carbon +applications you should look at the MiniAEFrame module. + + + diff --git a/Mac/Resources/app/Resources/English.lproj/Documentation/shell.html b/Mac/Resources/app/Resources/English.lproj/Documentation/shell.html new file mode 100644 index 0000000..56f5646 --- /dev/null +++ b/Mac/Resources/app/Resources/English.lproj/Documentation/shell.html @@ -0,0 +1,52 @@ + + + + + Python and the Unix Shell + + + + + +

Running Python scripts from the Unix Shell

+ + + + + +
+ + +

MacPython 2.3 installs a perfectly normal Unix commandline + python interpreter in /usr/local/bin/python. As of Mac OS X 10.2, however, + /usr/local/bin is not on the search path of your shell. Moreover, + Apple's python 2.2, which lives in /usr/bin is on your + search path, so this can lead to confusion.

+ +

If you use tcsh you should add the following line + to the file .login in your home directory and restart Terminal: +
+ setenv PATH /usr/local/bin:$PATH +

+ +

If you use bash or zsh + you should add the following line + to the file .profile in your home directory and restart Terminal: +
+ export PATH=/usr/local/bin:$PATH +

+ +

GUI scripts

+ +

Due to the way MacOS handles windowing applications you need to run + all scripts that use the window manager (be it through + Carbon, Cocoa, Tkinter, wxPython, PyOpenGL or anything else) with the + pythonw interpreter, also installed in /usr/local/bin.

+ +

Running with python results in an inability to bring the + script to the front, or interacting with it.

+
+
+ + diff --git a/Mac/Resources/app/Resources/English.lproj/InfoPlist.strings b/Mac/Resources/app/Resources/English.lproj/InfoPlist.strings new file mode 100644 index 0000000..f8a8bc1 Binary files /dev/null and b/Mac/Resources/app/Resources/English.lproj/InfoPlist.strings differ diff --git a/Mac/Resources/app/Resources/PythonApplet.icns b/Mac/Resources/app/Resources/PythonApplet.icns new file mode 100644 index 0000000..c8aad9f Binary files /dev/null and b/Mac/Resources/app/Resources/PythonApplet.icns differ diff --git a/Mac/Resources/app/Resources/PythonInterpreter.icns b/Mac/Resources/app/Resources/PythonInterpreter.icns new file mode 100644 index 0000000..e09fd38 Binary files /dev/null and b/Mac/Resources/app/Resources/PythonInterpreter.icns differ diff --git a/Mac/Resources/framework/English.lproj/InfoPlist.strings b/Mac/Resources/framework/English.lproj/InfoPlist.strings new file mode 100644 index 0000000..cc24bfc Binary files /dev/null and b/Mac/Resources/framework/English.lproj/InfoPlist.strings differ diff --git a/Mac/Resources/framework/Info.plist b/Mac/Resources/framework/Info.plist new file mode 100644 index 0000000..302ff48 --- /dev/null +++ b/Mac/Resources/framework/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + Python + CFBundleGetInfoString + Python Runtime and Library + CFBundleIdentifier + org.python.python + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Python + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.5 + CFBundleSignature + ???? + CFBundleVersion + 2.5 + + diff --git a/Mac/Resources/framework/version.plist b/Mac/Resources/framework/version.plist new file mode 100644 index 0000000..7527442 --- /dev/null +++ b/Mac/Resources/framework/version.plist @@ -0,0 +1,18 @@ + + + + + BuildVersion + 1 + CFBundleShortVersionString + 2.5alpha0 + CFBundleVersion + 2.5alpha0 + ProjectName + Python + ReleaseStatus + alfa + SourceVersion + 2.4a0 + + diff --git a/Mac/Resources/iconsrc/IDE.psd b/Mac/Resources/iconsrc/IDE.psd new file mode 100644 index 0000000..b9637b9 Binary files /dev/null and b/Mac/Resources/iconsrc/IDE.psd differ diff --git a/Mac/Resources/iconsrc/PackageManager.psd b/Mac/Resources/iconsrc/PackageManager.psd new file mode 100644 index 0000000..42f41b1 Binary files /dev/null and b/Mac/Resources/iconsrc/PackageManager.psd differ diff --git a/Mac/Resources/iconsrc/PythonApplet.psd b/Mac/Resources/iconsrc/PythonApplet.psd new file mode 100644 index 0000000..7458b52 Binary files /dev/null and b/Mac/Resources/iconsrc/PythonApplet.psd differ diff --git a/Mac/Resources/iconsrc/PythonCompiled.psd b/Mac/Resources/iconsrc/PythonCompiled.psd new file mode 100755 index 0000000..61fc4d1 Binary files /dev/null and b/Mac/Resources/iconsrc/PythonCompiled.psd differ diff --git a/Mac/Resources/iconsrc/PythonIcon.psd b/Mac/Resources/iconsrc/PythonIcon.psd new file mode 100755 index 0000000..d818dc6 Binary files /dev/null and b/Mac/Resources/iconsrc/PythonIcon.psd differ diff --git a/Mac/Resources/iconsrc/PythonSource.psd b/Mac/Resources/iconsrc/PythonSource.psd new file mode 100755 index 0000000..eba8f28 Binary files /dev/null and b/Mac/Resources/iconsrc/PythonSource.psd differ diff --git a/Mac/Resources/iconsrc/PythonWSource.psd b/Mac/Resources/iconsrc/PythonWSource.psd new file mode 100644 index 0000000..2b84d94 Binary files /dev/null and b/Mac/Resources/iconsrc/PythonWSource.psd differ -- cgit v0.12