diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-03-16 22:09:22 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-03-16 22:09:22 (GMT) |
commit | 08801db123077407ae7ec7af2fe2d65a24a46063 (patch) | |
tree | 31d1c29efc37b6bc15efe77d2f95449d77b20c94 /Mac/Tools | |
parent | f3ef03880811caa3da9f339e9a32e3ce126fa7d1 (diff) | |
download | cpython-08801db123077407ae7ec7af2fe2d65a24a46063.zip cpython-08801db123077407ae7ec7af2fe2d65a24a46063.tar.gz cpython-08801db123077407ae7ec7af2fe2d65a24a46063.tar.bz2 |
The MacPython introductory help is now called MacPython Help, and the
optional full documentation Python Documentation.
Diffstat (limited to 'Mac/Tools')
-rw-r--r-- | Mac/Tools/IDE/PythonIDEMain.py | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/Mac/Tools/IDE/PythonIDEMain.py b/Mac/Tools/IDE/PythonIDEMain.py index 01969e9..fec8620 100644 --- a/Mac/Tools/IDE/PythonIDEMain.py +++ b/Mac/Tools/IDE/PythonIDEMain.py @@ -353,12 +353,14 @@ class PythonIDE(Wapplication.Application): PackageManager.PackageBrowser() def makehelpmenu(self): - docs = self.installdocumentation() + hashelp, hasdocs = self.installdocumentation() self.helpmenu = m = self.gethelpmenu() + helpitem = FrameWork.MenuItem(m, "MacPython Help", None, self.domenu_localhelp) + helpitem.enable(hashelp) docitem = FrameWork.MenuItem(m, "Python Documentation", None, self.domenu_localdocs) - docitem.enable(docs) + docitem.enable(hasdocs) finditem = FrameWork.MenuItem(m, "Lookup in Python Documentation", None, 'lookuppython') - finditem.enable(docs) + finditem.enable(hasdocs) if runningOnOSX(): FrameWork.Separator(m) doc2item = FrameWork.MenuItem(m, "Apple Developer Documentation", None, self.domenu_appledocs) @@ -370,7 +372,11 @@ class PythonIDE(Wapplication.Application): def domenu_localdocs(self, *args): from Carbon import AH - AH.AHGotoPage("Python Help", None, None) + AH.AHGotoPage("Python Documentation", None, None) + + def domenu_localhelp(self, *args): + from Carbon import AH + AH.AHGotoPage("MacPython Help", None, None) def domenu_appledocs(self, *args): from Carbon import AH, AppleHelp @@ -388,7 +394,7 @@ class PythonIDE(Wapplication.Application): if not searchstring: return try: - AH.AHSearch("Python Help", searchstring) + AH.AHSearch("Python Documentation", searchstring) except AH.Error, arg: W.Message("AppleHelp Error: %s" % `arg`) @@ -441,16 +447,17 @@ class PythonIDE(Wapplication.Application): # And as AHRegisterHelpBook wants a bundle (with the right bits in # the plist file) we refer it to Python.app python_app = os.path.join(sys.prefix, 'Resources/Python.app') - doc_source = os.path.join(python_app, 'Contents/Resources/English.lproj/Documentation') - if not os.path.isdir(doc_source): - return 0 - try: - from Carbon import AH - AH.AHRegisterHelpBook(python_app) - except (ImportError, MacOS.Error), arg: - W.Message("Cannot register Python documentation: %s" % `arg`) - return 0 - return 1 + 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 has_help or has_doc: + try: + from Carbon import AH + AH.AHRegisterHelpBook(python_app) + except (ImportError, MacOS.Error), arg: + pass # W.Message("Cannot register Python Documentation: %s" % str(arg)) + return has_help, has_doc PythonIDE() |