[Python-checkins] python/dist/src/Mac/Tools/IDE PyEdit.py, 1.43.8.1, 1.43.8.2

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Thu Jun 3 17:37:03 EDT 2004


Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12463

Modified Files:
      Tag: release23-maint
	PyEdit.py 
Log Message:
Backport of 1.45 and 1.46:
- Replace backticks with repr() or "%r"
- Fix for #862941: "run with commandline python" crashed. Fixed.
- Prefer to use pythonw (if it exists) for "run with commandline python".



Index: PyEdit.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyEdit.py,v
retrieving revision 1.43.8.1
retrieving revision 1.43.8.2
diff -C2 -d -r1.43.8.1 -r1.43.8.2
*** PyEdit.py	18 Nov 2003 22:46:08 -0000	1.43.8.1
--- PyEdit.py	3 Jun 2004 21:36:58 -0000	1.43.8.2
***************
*** 44,48 ****
  				self.title = title
  			else:
! 				self.title = "Untitled Script " + `_scriptuntitledcounter`
  				_scriptuntitledcounter = _scriptuntitledcounter + 1
  			text = ""
--- 44,48 ----
  				self.title = title
  			else:
! 				self.title = "Untitled Script %r" % (_scriptuntitledcounter,)
  				_scriptuntitledcounter = _scriptuntitledcounter + 1
  			text = ""
***************
*** 445,449 ****
  			code = compile(pytext, filename, "exec")
  		except (SyntaxError, EOFError):
! 			raise buildtools.BuildError, "Syntax error in script %s" % `filename`
  			
  		import tempfile
--- 445,449 ----
  			code = compile(pytext, filename, "exec")
  		except (SyntaxError, EOFError):
! 			raise buildtools.BuildError, "Syntax error in script %r" % (filename,)
  			
  		import tempfile
***************
*** 541,545 ****
  	def _run_with_cl_interpreter(self):
  		import Terminal
! 		interp_path = os.path.join(sys.exec_prefix, "bin", "python")
  		file_path = self.path
  		if not os.path.exists(interp_path):
--- 541,548 ----
  	def _run_with_cl_interpreter(self):
  		import Terminal
! 		interp_path = os.path.join(sys.exec_prefix, 
! 			"Resources", "Python.app", "Contents", "MacOS", "Python")
! 		if not os.path.exists(interp_path):
! 			interp_path = os.path.join(sys.exec_prefix, "bin", "python")
  		file_path = self.path
  		if not os.path.exists(interp_path):
***************
*** 548,552 ****
  		cmd = '"%s" "%s" ; exit' % (interp_path, file_path)
  		t = Terminal.Terminal()
! 		t.do_script(with_command=cmd)
  	
  	def runselection(self):
--- 551,555 ----
  		cmd = '"%s" "%s" ; exit' % (interp_path, file_path)
  		t = Terminal.Terminal()
! 		t.do_script(cmd)
  	
  	def runselection(self):
***************
*** 1263,1268 ****
  		self.w.xsizelabel = W.TextBox((98, 32, 40, 14), "Width:")
  		self.w.ysizelabel = W.TextBox((148, 32, 40, 14), "Height:")
! 		self.w.xsize = W.EditText((98, 48, 40, 20), `self.windowsize[0]`)
! 		self.w.ysize = W.EditText((148, 48, 40, 20), `self.windowsize[1]`)
  		
  		self.w.cancelbutton = W.Button((-180, -26, 80, 16), "Cancel", self.cancel)
--- 1266,1271 ----
  		self.w.xsizelabel = W.TextBox((98, 32, 40, 14), "Width:")
  		self.w.ysizelabel = W.TextBox((148, 32, 40, 14), "Height:")
! 		self.w.xsize = W.EditText((98, 48, 40, 20), repr(self.windowsize[0]))
! 		self.w.ysize = W.EditText((148, 48, 40, 20), repr(self.windowsize[1]))
  		
  		self.w.cancelbutton = W.Button((-180, -26, 80, 16), "Cancel", self.cancel)
***************
*** 1277,1282 ****
  		if editor is not None:
  			width, height = editor._parentwindow._bounds[2:]
! 			self.w.xsize.set(`width`)
! 			self.w.ysize.set(`height`)
  		else:
  			raise W.AlertError, "No edit window found"
--- 1280,1285 ----
  		if editor is not None:
  			width, height = editor._parentwindow._bounds[2:]
! 			self.w.xsize.set(repr(width))
! 			self.w.ysize.set(repr(height))
  		else:
  			raise W.AlertError, "No edit window found"




More information about the Python-checkins mailing list