mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Initial checkin of IDE scripts. (jvr)
This commit is contained in:
		
							parent
							
								
									b7ad821f02
								
							
						
					
					
						commit
						a840fca155
					
				
					 19 changed files with 334 additions and 0 deletions
				
			
		
							
								
								
									
										45
									
								
								Mac/IDE scripts/Hack/Toolbox Assistant...
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								Mac/IDE scripts/Hack/Toolbox Assistant...
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,45 @@ | |||
| import aetools | ||||
| import Standard_Suite | ||||
| import Required_Suite | ||||
| import MacOS | ||||
| import W | ||||
| 
 | ||||
| 
 | ||||
| class Toolbox(aetools.TalkTo, Standard_Suite.Standard_Suite): | ||||
| 	 | ||||
| 	def LookupTopic(self, _object, _attributes={}, **_arguments): | ||||
| 		_code = 'DanR' | ||||
| 		_subcode = 'REF ' | ||||
| 
 | ||||
| 		_arguments['----'] = _object | ||||
| 		 | ||||
| 		_reply, _arguments, _attributes = self.send(_code, _subcode, | ||||
| 				_arguments, _attributes) | ||||
| 		if _arguments.has_key('errn'): | ||||
| 			raise MacOS.Error, aetools.decodeerror(_arguments) | ||||
| 	 | ||||
| 
 | ||||
| class ToolboxAssi: | ||||
| 	 | ||||
| 	def __init__(self): | ||||
| 		self.talker = None | ||||
| 		self.w = W.Window((200, 100), "Toolbox Assistant") | ||||
| 		self.w.button = W.Button((-94, -32, 80, 16), "Lookup", self.lookup) | ||||
| 		self.w.prompt = W.TextBox((10, 8, -10, 15), "Enter topic:") | ||||
| 		self.w.edit = W.EditText((10, 24, -10, 20)) | ||||
| 		self.w.setdefaultbutton(self.w.button) | ||||
| 		self.w.open() | ||||
| 	 | ||||
| 	def lookup(self): | ||||
| 		if self.talker is None: | ||||
| 			try: | ||||
| 				self.talker = Toolbox('ALTV', start = 1) | ||||
| 			except: | ||||
| 				raise W.AlertError, "Can¹t find ³Toolbox Assistant²" | ||||
| 		lookup = self.w.edit.get() | ||||
| 		try: | ||||
| 			self.talker.LookupTopic(lookup) | ||||
| 		except MacOS.Error, detail: | ||||
| 			W.Message("Requested topic not found.\r(%d)" % detail[0]) | ||||
| 
 | ||||
| t = ToolboxAssi() | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Just van Rossum
						Just van Rossum