diff --git a/Mac/Tools/IDE/PackageManager.plist b/Mac/Tools/IDE/PackageManager.plist
new file mode 100644
index 00000000000..9d582d6a3d9
--- /dev/null
+++ b/Mac/Tools/IDE/PackageManager.plist
@@ -0,0 +1,41 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleDocumentTypes
+
+
+ CFBundleExecutable
+ PackageManager
+
+ CFBundleGetInfoString
+ 2.3.2, (c) 2003 Python Software Foundation.
+ CFBundleLongVersionString
+ 2.3.2, (c) 2003 Python Software Foundation.
+ NSHumanReadableCopyright
+ Copyright 2003 Python Software Foundation.
+ CFBundleShortVersionString
+ 2.3.2
+
+ CFBundleIconFile
+ PackageManager.icns
+ CFBundleIdentifier
+ org.python.pythonide
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ PythonIDE
+ CFBundlePackageType
+ APPL
+ CFBundleSignature
+ Pide
+ CFBundleVersion
+ 2.3.2
+ LSRequiresCarbon
+
+ CSResourcesFileMapped
+
+
+
diff --git a/Mac/Tools/IDE/PackageManager.py b/Mac/Tools/IDE/PackageManager.py
index 2b27ac09937..a4b9accf5af 100755
--- a/Mac/Tools/IDE/PackageManager.py
+++ b/Mac/Tools/IDE/PackageManager.py
@@ -366,6 +366,7 @@ class PackageBrowser(PimpInterface):
self.w.description.enable(0)
def updatestatus(self):
+ topcell = self.w.packagebrowser.gettopcell()
sel = self.w.packagebrowser.getselection()
data = self.getbrowserdata(self.w.hidden_button.get())
self.w.packagebrowser.setitems(data)
@@ -396,6 +397,7 @@ class PackageBrowser(PimpInterface):
self.w.recursive_button.enable(1)
self.w.force_button.enable(1)
self.w.user_button.enable(1)
+ self.w.packagebrowser.settopcell(topcell)
def listhit(self, *args, **kwargs):
self.updatestatus()
diff --git a/Mac/Tools/IDE/PythonIDE.plist b/Mac/Tools/IDE/PythonIDE.plist
index 8bebe379467..a3f922968f5 100644
--- a/Mac/Tools/IDE/PythonIDE.plist
+++ b/Mac/Tools/IDE/PythonIDE.plist
@@ -27,13 +27,22 @@
PythonIDE
CFBundleGetInfoString
- 2.3, (c) 2003 Python Software Foundation.
+ 2.4a0, (c) 2003 Python Software Foundation.
CFBundleLongVersionString
- 2.3, (c) 2003 Python Software Foundation.
+ 2.4a0, (c) 2003 Python Software Foundation.
NSHumanReadableCopyright
Copyright 2003 Python Software Foundation.
CFBundleShortVersionString
- 2.3
+ 2.4a0
+
+ CFBundleHelpBookFolder
+
+ PythonDocumentation
+
+ CFBundleHelpBookName
+ Python Help
+ CFBundleHelpTOCFile
+ index.html
CFBundleIconFile
PythonIDE.icns
@@ -48,7 +57,7 @@
CFBundleSignature
Pide
CFBundleVersion
- 2.3
+ 2.3.2
LSRequiresCarbon
CSResourcesFileMapped
diff --git a/Mac/Tools/IDE/PythonIDE.py b/Mac/Tools/IDE/PythonIDE.py
index b7bc388f087..fb991b0d90e 100644
--- a/Mac/Tools/IDE/PythonIDE.py
+++ b/Mac/Tools/IDE/PythonIDE.py
@@ -49,7 +49,7 @@ def init():
# We are a fully frozen application
ide_path = sys.argv[0]
if ide_path not in sys.path:
- sys.path.insert(0, ide_path)
+ sys.path.insert(1, ide_path)
init()
diff --git a/Mac/Tools/IDE/PythonIDEMain.py b/Mac/Tools/IDE/PythonIDEMain.py
index 5987c10d79a..3ad35b725f1 100644
--- a/Mac/Tools/IDE/PythonIDEMain.py
+++ b/Mac/Tools/IDE/PythonIDEMain.py
@@ -32,6 +32,11 @@ def getmodtime(file):
class PythonIDE(Wapplication.Application):
def __init__(self):
+ if sys.platform == "darwin":
+ if len(sys.argv) > 1 and sys.argv[1].startswith("-psn"):
+ home = os.getenv("HOME")
+ if home:
+ os.chdir(home)
self.preffilepath = os.path.join("Python", "PythonIDE preferences")
Wapplication.Application.__init__(self, 'Pide')
from Carbon import AE
@@ -49,11 +54,6 @@ class PythonIDE(Wapplication.Application):
self.quitevent)
import PyConsole, PyEdit
Splash.wait()
- if sys.platform == "darwin":
- if sys.argv and sys.argv[0].startswith("-psn"):
- home = os.getenv("HOME")
- if home:
- os.chdir(home)
# With -D option (OSX command line only) keep stderr, for debugging the IDE
# itself.
debug_stderr = None
@@ -140,9 +140,12 @@ class PythonIDE(Wapplication.Application):
except:
path = os.path.join(os.getcwd(), "Mac", "IDE scripts")
if not os.path.exists(path):
- path = os.path.join(os.getcwd(), "Scripts")
+ if sys.platform == "darwin":
+ path = os.path.join(os.getenv("HOME"), "Library", "Python", "IDE-Scripts")
+ else:
+ path = os.path.join(os.getcwd(), "Scripts")
if not os.path.exists(path):
- os.mkdir(path)
+ os.makedirs(path)
f = open(os.path.join(path, "Place your scripts here"+ELIPSES), "w")
f.close()
fsr = File.FSRef(path)
@@ -451,11 +454,31 @@ class PythonIDE(Wapplication.Application):
# is located in the framework, but there's a symlink in Python.app.
# And as AHRegisterHelpBook wants a bundle (with the right bits in
# the plist file) we refer it to Python.app
+ #
+ # To make matters worse we have to look in two places: first in the IDE
+ # itself, then in the Python application inside the framework.
+ has_help = False
+ has_doc = False
+ ide_path_components = sys.argv[0].split("/")
+ if ide_path_components[-3:] == ["Contents", "Resources", "PythonIDE.py"]:
+ ide_app = "/".join(ide_path_components[:-3])
+ help_source = os.path.join(ide_app, 'Contents/Resources/English.lproj/Documentation')
+ doc_source = os.path.join(ide_app, 'Contents/Resources/English.lproj/PythonDocumentation')
+ has_help = os.path.isdir(help_source)
+ has_doc = os.path.isdir(doc_source)
+ if has_help or has_doc:
+ try:
+ from Carbon import AH
+ AH.AHRegisterHelpBook(ide_app)
+ except (ImportError, MacOS.Error), arg:
+ pass # W.Message("Cannot register Python Documentation: %s" % str(arg))
python_app = os.path.join(sys.prefix, 'Resources/Python.app')
- help_source = os.path.join(python_app, 'Contents/Resources/English.lproj/Documentation')
- doc_source = os.path.join(python_app, 'Contents/Resources/English.lproj/PythonDocumentation')
- has_help = os.path.isdir(help_source)
- has_doc = os.path.isdir(doc_source)
+ if not has_help:
+ help_source = os.path.join(python_app, 'Contents/Resources/English.lproj/Documentation')
+ has_help = os.path.isdir(help_source)
+ if not has_doc:
+ doc_source = os.path.join(python_app, 'Contents/Resources/English.lproj/PythonDocumentation')
+ has_doc = os.path.isdir(doc_source)
if has_help or has_doc:
try:
from Carbon import AH