[Python-checkins] python/dist/src/Mac/Tools/IDE PackageManager.plist, 1.1, 1.2 PackageManager.py, 1.14, 1.15 PythonIDE.plist, 1.2, 1.3 PythonIDE.py, 1.13, 1.14 PythonIDEMain.py, 1.35, 1.36

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Wed Nov 19 08:45:28 EST 2003


Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE
In directory sc8-pr-cvs1:/tmp/cvs-serv31188

Modified Files:
	PackageManager.py PythonIDE.plist PythonIDE.py 
	PythonIDEMain.py 
Added Files:
	PackageManager.plist 
Log Message:
Forward port of various fixes that were initially only done on the
release23-maint branch:
- Remember the scroll position when rebuilding the browser (as we do far
too often). Fixes #824430.
- Allow for the documentation to be inside PythonIDE as well as in
the Python.app inside the framework (the original location for 2.3).
- Updated version numbers
- In PythonIDE, add the Tools/IDE directory as the second entry in
sys.path in stead of as the first, leaving PythonIDE.app/Contents/Resources
as the first one.
- The code for setting the working directory to $HOME was both incorrect
and in the wrong place, fixed.
- On OSX the default location for IDE scripts is now
$HOME/Library/Python/IDE-Scripts.




Index: PackageManager.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PackageManager.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** PackageManager.py	21 Jul 2003 22:11:07 -0000	1.14
--- PackageManager.py	19 Nov 2003 13:45:26 -0000	1.15
***************
*** 367,370 ****
--- 367,371 ----
  		
  	def updatestatus(self):
+ 		topcell = self.w.packagebrowser.gettopcell()
  		sel = self.w.packagebrowser.getselection()
  		data = self.getbrowserdata(self.w.hidden_button.get())
***************
*** 397,400 ****
--- 398,402 ----
  			self.w.force_button.enable(1)
  			self.w.user_button.enable(1)
+ 		self.w.packagebrowser.settopcell(topcell)
  		
  	def listhit(self, *args, **kwargs):

Index: PythonIDE.plist
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDE.plist,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PythonIDE.plist	4 Jul 2003 13:06:14 -0000	1.2
--- PythonIDE.plist	19 Nov 2003 13:45:26 -0000	1.3
***************
*** 28,38 ****
  
  	<key>CFBundleGetInfoString</key>
! 	<string>2.3, (c) 2003 Python Software Foundation.</string>
  	<key>CFBundleLongVersionString</key>
! 	<string>2.3, (c) 2003 Python Software Foundation.</string>
  	<key>NSHumanReadableCopyright</key>
  	<string>Copyright 2003 Python Software Foundation.</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>2.3</string>
  
  	<key>CFBundleIconFile</key>
--- 28,47 ----
  
  	<key>CFBundleGetInfoString</key>
! 	<string>2.4a0, (c) 2003 Python Software Foundation.</string>
  	<key>CFBundleLongVersionString</key>
! 	<string>2.4a0, (c) 2003 Python Software Foundation.</string>
  	<key>NSHumanReadableCopyright</key>
  	<string>Copyright 2003 Python Software Foundation.</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>2.4a0</string>
! 
! 	<key>CFBundleHelpBookFolder</key>
! 	<array>
! 		<string>PythonDocumentation</string>
! 	</array>
! 	<key>CFBundleHelpBookName</key>
! 	<string>Python Help</string>
! 	<key>CFBundleHelpTOCFile</key>
! 	<string>index.html</string>
  
  	<key>CFBundleIconFile</key>
***************
*** 49,53 ****
  	<string>Pide</string>
  	<key>CFBundleVersion</key>
! 	<string>2.3</string>
  	<key>LSRequiresCarbon</key>
      <true/>
--- 58,62 ----
  	<string>Pide</string>
  	<key>CFBundleVersion</key>
! 	<string>2.3.2</string>
  	<key>LSRequiresCarbon</key>
      <true/>

Index: PythonIDE.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDE.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** PythonIDE.py	3 May 2003 00:31:35 -0000	1.13
--- PythonIDE.py	19 Nov 2003 13:45:26 -0000	1.14
***************
*** 50,54 ****
  		ide_path = sys.argv[0]
  	if ide_path not in sys.path:
! 		sys.path.insert(0, ide_path)
  
  
--- 50,54 ----
  		ide_path = sys.argv[0]
  	if ide_path not in sys.path:
! 		sys.path.insert(1, ide_path)
  
  

Index: PythonIDEMain.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDEMain.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** PythonIDEMain.py	6 May 2003 14:28:31 -0000	1.35
--- PythonIDEMain.py	19 Nov 2003 13:45:26 -0000	1.36
***************
*** 33,36 ****
--- 33,41 ----
  	
  	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')
***************
*** 50,58 ****
  		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.
--- 55,58 ----
***************
*** 141,147 ****
  			path = os.path.join(os.getcwd(), "Mac", "IDE scripts")
  			if not os.path.exists(path):
! 				path = os.path.join(os.getcwd(), "Scripts")
  				if not os.path.exists(path):
! 					os.mkdir(path)
  					f = open(os.path.join(path, "Place your scripts here"+ELIPSES), "w")
  					f.close()
--- 141,150 ----
  			path = os.path.join(os.getcwd(), "Mac", "IDE scripts")
  			if not os.path.exists(path):
! 				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.makedirs(path)
  					f = open(os.path.join(path, "Place your scripts here"+ELIPSES), "w")
  					f.close()
***************
*** 452,460 ****
  		# 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')
! 		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:
--- 455,483 ----
  		# 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')
! 		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:





More information about the Python-checkins mailing list