[Python-checkins] python/dist/src/Mac/Tools/IDE PythonIDEMain.py, 1.35, 1.35.8.1

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Sat Nov 1 17:28:21 EST 2003


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

Modified Files:
      Tag: release23-maint
	PythonIDEMain.py 
Log Message:
Two related fixes:
- 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.

Together, these solve the problem that some people had (but, curiously
enough, only some) that the IDE crashed at startup because it couldn't
create "/Scripts".


Index: PythonIDEMain.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDEMain.py,v
retrieving revision 1.35
retrieving revision 1.35.8.1
diff -C2 -d -r1.35 -r1.35.8.1
*** PythonIDEMain.py	6 May 2003 14:28:31 -0000	1.35
--- PythonIDEMain.py	1 Nov 2003 22:28:19 -0000	1.35.8.1
***************
*** 33,36 ****
--- 33,42 ----
  	
  	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)
+ 		print "We are in", os.getcwd()
  		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.
--- 56,59 ----
***************
*** 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()
--- 142,151 ----
  			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()





More information about the Python-checkins mailing list