[Python-checkins] python/dist/src/Mac/Tools/IDE ProfileBrowser.py,1.3,1.4 PyConsole.py,1.13,1.14 PyDocSearch.py,1.9,1.10 PyEdit.py,1.33,1.34 PythonIDEMain.py,1.24,1.25

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Sun, 26 Jan 2003 14:15:51 -0800


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

Modified Files:
	ProfileBrowser.py PyConsole.py PyDocSearch.py PyEdit.py 
	PythonIDEMain.py 
Log Message:
Use new file dialogs.

Index: ProfileBrowser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/ProfileBrowser.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ProfileBrowser.py	31 Dec 2001 08:58:44 -0000	1.3
--- ProfileBrowser.py	26 Jan 2003 22:15:48 -0000	1.4
***************
*** 1,4 ****
--- 1,5 ----
  import W
  from Carbon import Evt
+ import EasyDialogs
  
  import sys
***************
*** 84,90 ****
  	else:
  		import macfs
! 		fss, ok = macfs.PromptGetFile('Profiler data')
! 		if not ok: sys.exit(0)
! 		stats = pstats.Stats(fss.as_pathname())
  		browser = ProfileBrowser(stats)
  
--- 85,91 ----
  	else:
  		import macfs
! 		filename = EasyDialogs.AskFileForOpen(message='Profiler data')
! 		if not filename: sys.exit(0)
! 		stats = pstats.Stats(filename)
  		browser = ProfileBrowser(stats)
  

Index: PyConsole.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyConsole.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** PyConsole.py	20 Jan 2003 09:02:23 -0000	1.13
--- PyConsole.py	26 Jan 2003 22:15:48 -0000	1.14
***************
*** 11,14 ****
--- 11,15 ----
  import MacPrefs
  from Carbon import Qd
+ import EasyDialogs
  import PyInteractive
  
***************
*** 86,93 ****
  	def domenu_save_as(self, *args):
  		import macfs
! 		fss, ok = macfs.StandardPutFile('Save console text as:', 'console.txt')
! 		if not ok:
  			return
! 		f = open(fss.as_pathname(), 'wb')
  		f.write(self.get())
  		f.close()
--- 87,95 ----
  	def domenu_save_as(self, *args):
  		import macfs
! 		filename = EasyDialogs.AskFileForSave(message='Save console text as:', 
! 			savedFileName='console.txt')
! 		if not filename:
  			return
! 		f = open(filename, 'wb')
  		f.write(self.get())
  		f.close()
***************
*** 242,249 ****
  		title = self._parentwindow.gettitle()
  		import macfs
! 		fss, ok = macfs.StandardPutFile('Save %s text as:' % title, title + '.txt')
! 		if not ok:
  			return
! 		f = open(fss.as_pathname(), 'wb')
  		f.write(self.get())
  		f.close()
--- 244,252 ----
  		title = self._parentwindow.gettitle()
  		import macfs
! 		filename = EasyDialogs.AskFileForSave(message='Save %s text as:' % title, 
! 			savedFileName=title + '.txt')
! 		if not filename:
  			return
! 		f = open(filename, 'wb')
  		f.write(self.get())
  		f.close()

Index: PyDocSearch.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyDocSearch.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PyDocSearch.py	21 Jan 2002 23:00:52 -0000	1.9
--- PyDocSearch.py	26 Jan 2003 22:15:48 -0000	1.10
***************
*** 7,10 ****
--- 7,11 ----
  import string
  import webbrowser
+ import EasyDialogs
  
  
***************
*** 224,230 ****
  	
  	def setdocpath(self):
! 		fss, ok = macfs.GetDirectory()
! 		if ok:
! 			docpath = fss.as_pathname()
  			if not verifydocpath(docpath):
  				W.Message("This does not seem to be a Python documentation folder...")
--- 225,230 ----
  	
  	def setdocpath(self):
! 		docpath = EasyDialogs.AskFolder()
! 		if docpath:
  			if not verifydocpath(docpath):
  				W.Message("This does not seem to be a Python documentation folder...")

Index: PyEdit.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyEdit.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** PyEdit.py	24 Oct 2002 20:03:29 -0000	1.33
--- PyEdit.py	26 Jan 2003 22:15:48 -0000	1.34
***************
*** 8,11 ****
--- 8,12 ----
  import MACFS
  import MacOS
+ import EasyDialogs
  from Carbon import Win
  from Carbon import Res
***************
*** 68,72 ****
  		
  		if '\n' in text:
- 			import EasyDialogs
  			if string.find(text, '\r\n') >= 0:
  				self._eoln = '\r\n'
--- 69,72 ----
***************
*** 366,370 ****
  	def close(self):
  		if self.editgroup.editor.changed:
- 			import EasyDialogs
  			Qd.InitCursor()
  			save = EasyDialogs.AskYesNoCancel('Save window "%s" before closing?' % self.title,
--- 366,369 ----
***************
*** 407,415 ****
  	
  	def domenu_save_as(self, *args):
! 		fss, ok = macfs.StandardPutFile('Save as:', self.title)
! 		if not ok: 
  			return 1
  		self.showbreakpoints(0)
! 		self.path = fss.as_pathname()
  		self.setinfotext()
  		self.title = os.path.split(self.path)[-1]
--- 406,414 ----
  	
  	def domenu_save_as(self, *args):
! 		path = EasyDialogs.AskFileForSave(message='Save as:', savedFileName=self.title)
! 		if not path: 
  			return 1
  		self.showbreakpoints(0)
! 		self.path = path
  		self.setinfotext()
  		self.title = os.path.split(self.path)[-1]
***************
*** 435,443 ****
  		else:
  			destname = self.title + ".applet"
! 		fss, ok = macfs.StandardPutFile('Save as Applet:', destname)
! 		if not ok: 
  			return 1
  		W.SetCursor("watch")
- 		destname = fss.as_pathname()
  		if self.path:
  			filename = self.path
--- 434,442 ----
  		else:
  			destname = self.title + ".applet"
! 		destname = EasyDialogs.AskFileForSave(message='Save as Applet:', 
! 			savedFileName=destname)
! 		if not destname: 
  			return 1
  		W.SetCursor("watch")
  		if self.path:
  			filename = self.path
***************
*** 509,513 ****
  		if self.run_with_interpreter:
  			if self.editgroup.editor.changed:
- 				import EasyDialogs
  				Qd.InitCursor()
  				save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1)
--- 508,511 ----
***************
*** 522,526 ****
  		elif self.run_with_cl_interpreter:
  			if self.editgroup.editor.changed:
- 				import EasyDialogs
  				Qd.InitCursor()
  				save = EasyDialogs.AskYesNoCancel('Save "%s" before running?' % self.title, 1)
--- 520,523 ----
***************
*** 1026,1030 ****
  		if counter:
  			self.hide()
- 			import EasyDialogs
  			from Carbon import Res
  			editor.textchanged()
--- 1023,1026 ----

Index: PythonIDEMain.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDEMain.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** PythonIDEMain.py	22 Nov 2002 12:48:47 -0000	1.24
--- PythonIDEMain.py	26 Jan 2003 22:15:48 -0000	1.25
***************
*** 10,13 ****
--- 10,14 ----
  import macfs
  import MacOS
+ import EasyDialogs
  
  if MacOS.runtimemodel == 'macho':
***************
*** 190,195 ****
  	
  	def do_setscriptsfolder(self, *args):
! 		fss, ok = macfs.GetDirectory("Select Scripts Folder")
! 		if ok:
  			prefs = self.getprefs()
  			alis = fss.NewAlias()
--- 191,197 ----
  	
  	def do_setscriptsfolder(self, *args):
! 		fss = EasyDialogs.AskFolder(message="Select Scripts Folder",
! 			wanted=macfs.FSSpec)
! 		if fss:
  			prefs = self.getprefs()
  			alis = fss.NewAlias()
***************
*** 205,211 ****
  	
  	def domenu_open(self, *args):
! 		fss, ok = macfs.StandardGetFile("TEXT")
! 		if ok:
! 			self.openscript(fss.as_pathname())
  	
  	def domenu_new(self, *args):
--- 207,213 ----
  	
  	def domenu_open(self, *args):
! 		filename = EasyDialogs.AskFileForOpen(typeList=("TEXT",))
! 		if filename:
! 			self.openscript(filename)
  	
  	def domenu_new(self, *args):
***************
*** 345,349 ****
  		# if there is no selection, but the can_ methods only seem
  		# to work for Windows. Or not for the Help menu, maybe?
- 		import EasyDialogs
  		text = EasyDialogs.AskString("Search documentation for", ok="Search")
  		return text
--- 347,350 ----