mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Changes by Donovan Preston (and a few minor ones by me) to make IDE run under
MachoPython. Mainly making sure we don't call routines that don't exist and representing pathnames in a os.separator-neutral format. These shouldn't interfere too much with Just's work on the next generation IDE, I hope.
This commit is contained in:
		
							parent
							
								
									c71efe0116
								
							
						
					
					
						commit
						815d2bf067
					
				
					 8 changed files with 71 additions and 38 deletions
				
			
		|  | @ -7,7 +7,12 @@ | |||
| import W | ||||
| import os | ||||
| import macfs | ||||
| import MacOS | ||||
| 
 | ||||
| if MacOS.runtimemodel == 'macho': | ||||
| 	ELIPSES = '...' | ||||
| else: | ||||
| 	ELIPSES = '\xc9' | ||||
| 
 | ||||
| class PythonIDE(Wapplication.Application): | ||||
| 	 | ||||
|  | @ -50,13 +55,13 @@ def __init__(self): | |||
| 	def makeusermenus(self): | ||||
| 		m = Wapplication.Menu(self.menubar, "File") | ||||
| 		newitem = FrameWork.MenuItem(m, "New", "N", 'new') | ||||
| 		openitem = FrameWork.MenuItem(m, "Open\xc9", "O", 'open') | ||||
| 		openitem = FrameWork.MenuItem(m, "Open"+ELIPSES, "O", 'open') | ||||
| 		FrameWork.Separator(m) | ||||
| 		closeitem = FrameWork.MenuItem(m, "Close", "W", 'close') | ||||
| 		saveitem = FrameWork.MenuItem(m, "Save", "S", 'save') | ||||
| 		saveasitem = FrameWork.MenuItem(m, "Save as\xc9", None, 'save_as') | ||||
| 		saveasitem = FrameWork.MenuItem(m, "Save as"+ELIPSES, None, 'save_as') | ||||
| 		FrameWork.Separator(m) | ||||
| 		saveasappletitem = FrameWork.MenuItem(m, "Save as Applet\xc9", None, 'save_as_applet') | ||||
| 		saveasappletitem = FrameWork.MenuItem(m, "Save as Applet"+ELIPSES, None, 'save_as_applet') | ||||
| 		FrameWork.Separator(m) | ||||
| 		quititem = FrameWork.MenuItem(m, "Quit", "Q", 'quit') | ||||
| 		 | ||||
|  | @ -71,7 +76,7 @@ def makeusermenus(self): | |||
| 		selallitem = FrameWork.MenuItem(m, "Select all", "A", "selectall") | ||||
| 		sellineitem = FrameWork.MenuItem(m, "Select line", "L", "selectline") | ||||
| 		FrameWork.Separator(m) | ||||
| 		finditem = FrameWork.MenuItem(m, "Find\xc9", "F", "find") | ||||
| 		finditem = FrameWork.MenuItem(m, "Find"+ELIPSES, "F", "find") | ||||
| 		findagainitem = FrameWork.MenuItem(m, "Find again", 'G', "findnext") | ||||
| 		enterselitem = FrameWork.MenuItem(m, "Enter search string", "E", "entersearchstring") | ||||
| 		replaceitem = FrameWork.MenuItem(m, "Replace", None, "replace") | ||||
|  | @ -84,12 +89,12 @@ def makeusermenus(self): | |||
| 		runitem = FrameWork.MenuItem(m, "Run window", "R", 'run') | ||||
| 		runselitem = FrameWork.MenuItem(m, "Run selection", None, 'runselection') | ||||
| 		FrameWork.Separator(m) | ||||
| 		moditem = FrameWork.MenuItem(m, "Module browser\xc9", "M", self.domenu_modulebrowser) | ||||
| 		moditem = FrameWork.MenuItem(m, "Module browser"+ELIPSES, "M", self.domenu_modulebrowser) | ||||
| 		FrameWork.Separator(m) | ||||
| 		mm = FrameWork.SubMenu(m, "Preferences") | ||||
| 		FrameWork.MenuItem(mm, "Set Scripts folder\xc9", None, self.do_setscriptsfolder) | ||||
| 		FrameWork.MenuItem(mm, "Editor default settings\xc9", None, self.do_editorprefs) | ||||
| 		FrameWork.MenuItem(mm, "Set default window font\xc9", None, self.do_setwindowfont) | ||||
| 		FrameWork.MenuItem(mm, "Set Scripts folder"+ELIPSES, None, self.do_setscriptsfolder) | ||||
| 		FrameWork.MenuItem(mm, "Editor default settings"+ELIPSES, None, self.do_editorprefs) | ||||
| 		FrameWork.MenuItem(mm, "Set default window font"+ELIPSES, None, self.do_setwindowfont) | ||||
| 		 | ||||
| 		self.openwindowsmenu = Wapplication.Menu(self.menubar, 'Windows') | ||||
| 		self.makeopenwindowsmenu() | ||||
|  | @ -110,7 +115,7 @@ def makeusermenus(self): | |||
| 				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\xc9"), "w") | ||||
| 					f = open(os.path.join(path, "Place your scripts here"+ELIPSES), "w") | ||||
| 					f.close() | ||||
| 			fss = macfs.FSSpec(path) | ||||
| 			self.scriptsfolder = fss.NewAlias() | ||||
|  | @ -159,7 +164,7 @@ def opendoc(self, path): | |||
| 			W.Message("Can't open file of type '%s'." % ftype) | ||||
| 	 | ||||
| 	def getabouttext(self): | ||||
| 		return "About Python IDE\xc9" | ||||
| 		return "About Python IDE"+ELIPSES | ||||
| 	 | ||||
| 	def do_about(self, id, item, window, event): | ||||
| 		Splash.about() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jack Jansen
						Jack Jansen