mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	If we can't find our splash dialog (i.e. we're probably running from source) go into interactive mode: print what we're doing and ask about carbon/classic configure.
This commit is contained in:
		
							parent
							
								
									85ba673b0a
								
							
						
					
					
						commit
						72b97aed80
					
				
					 1 changed files with 25 additions and 4 deletions
				
			
		|  | @ -12,6 +12,7 @@ | ||||||
| import macfs | import macfs | ||||||
| import MacOS | import MacOS | ||||||
| import gestalt | import gestalt | ||||||
|  | import string | ||||||
| 
 | 
 | ||||||
| SPLASH_COPYCORE=512 | SPLASH_COPYCORE=512 | ||||||
| SPLASH_COPYCARBON=513 | SPLASH_COPYCARBON=513 | ||||||
|  | @ -103,6 +104,12 @@ def buildcopy(top, dummy, list): | ||||||
| 		macostools.copy(src, dst) | 		macostools.copy(src, dst) | ||||||
| 
 | 
 | ||||||
| def main(): | def main(): | ||||||
|  | 	verbose = 0 | ||||||
|  | 	try: | ||||||
|  | 		h = Res.GetResource('DLOG', SPLASH_COPYCORE) | ||||||
|  | 		del h | ||||||
|  | 	except: | ||||||
|  | 		verbose = 1 | ||||||
| 	os.chdir(sys.prefix) | 	os.chdir(sys.prefix) | ||||||
| 	 | 	 | ||||||
| 	sys.path.append('::Mac:Lib') | 	sys.path.append('::Mac:Lib') | ||||||
|  | @ -110,21 +117,35 @@ def main(): | ||||||
| 				 | 				 | ||||||
| 	# Create the PythonCore alias(es) | 	# Create the PythonCore alias(es) | ||||||
| 	MacOS.splash(SPLASH_COPYCORE) | 	MacOS.splash(SPLASH_COPYCORE) | ||||||
|  | 	if verbose: | ||||||
|  | 		print "Copying PythonCore..." | ||||||
| 	n = 0 | 	n = 0 | ||||||
| 	n = n + mkcorealias('PythonCore', 'PythonCore') | 	n = n + mkcorealias('PythonCore', 'PythonCore') | ||||||
| 	n = n + mkcorealias('PythonCoreCarbon', 'PythonCoreCarbon') | 	n = n + mkcorealias('PythonCoreCarbon', 'PythonCoreCarbon') | ||||||
| 	if n == 0: | 	if n == 0: | ||||||
| 		import Dlg | 		import Dlg | ||||||
| 		Dlg.CautionAlert(ALERT_NOCORE, None) | 		Dlg.CautionAlert(ALERT_NOCORE, None) | ||||||
| 		return | 		if verbose: | ||||||
|  | 			print "Warning: PythonCore not copied to Extensions folder" | ||||||
| 	if sys.argv[0][-7:] == 'Classic': | 	if sys.argv[0][-7:] == 'Classic': | ||||||
| 		do_classic = 1 | 		do_classic = 1 | ||||||
| 	elif sys.argv[0][-6:] == 'Carbon': | 	elif sys.argv[0][-6:] == 'Carbon': | ||||||
| 		do_classic = 0 | 		do_classic = 0 | ||||||
| 	elif sys.argv[0][-15:] == 'ConfigurePython' or sys.argv[0][-18:] == 'ConfigurePython.py': |  | ||||||
| 		return |  | ||||||
| 	else: | 	else: | ||||||
| 		print "I don't know the sys.argv[0] function", sys.argv[0] | 		print "I don't know the sys.argv[0] function", sys.argv[0] | ||||||
|  | 		if verbose: | ||||||
|  | 			print "Configure classic or carbon - ", | ||||||
|  | 			rv = string.strip(sys.stdin.readline()) | ||||||
|  | 			while rv and rv != "classic" and rv != "carbon": | ||||||
|  | 				print "Configure classic or carbon - ", | ||||||
|  | 				rv = string.strip(sys.stdin.readline()) | ||||||
|  | 			if rv == "classic": | ||||||
|  | 				do_classic = 1 | ||||||
|  | 			elif rv == "carbon": | ||||||
|  | 				do_classic = 0 | ||||||
|  | 			else: | ||||||
|  | 				return | ||||||
|  | 		else: | ||||||
| 			sys.exit(1) | 			sys.exit(1) | ||||||
| 	if do_classic: | 	if do_classic: | ||||||
| 		MacOS.splash(SPLASH_COPYCLASSIC) | 		MacOS.splash(SPLASH_COPYCLASSIC) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jack Jansen
						Jack Jansen