mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Merge Py Idle changes:
Rev 1.3 tim_one Convert a pile of obvious "yes/no" functions to return bool.
This commit is contained in:
		
							parent
							
								
									05bab1ee93
								
							
						
					
					
						commit
						0f4402dcf7
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		|  | @ -34,9 +34,9 @@ def default_command(self, event=None): | ||||||
|     def find_again(self, text): |     def find_again(self, text): | ||||||
|         if not self.engine.getpat(): |         if not self.engine.getpat(): | ||||||
|             self.open(text) |             self.open(text) | ||||||
|             return 0 |             return False | ||||||
|         if not self.engine.getprog(): |         if not self.engine.getprog(): | ||||||
|             return 0 |             return False | ||||||
|         res = self.engine.search_text(text) |         res = self.engine.search_text(text) | ||||||
|         if res: |         if res: | ||||||
|             line, m = res |             line, m = res | ||||||
|  | @ -48,17 +48,17 @@ def find_again(self, text): | ||||||
|                 sellast = text.index("sel.last") |                 sellast = text.index("sel.last") | ||||||
|                 if selfirst == first and sellast == last: |                 if selfirst == first and sellast == last: | ||||||
|                     text.bell() |                     text.bell() | ||||||
|                     return 0 |                     return False | ||||||
|             except TclError: |             except TclError: | ||||||
|                 pass |                 pass | ||||||
|             text.tag_remove("sel", "1.0", "end") |             text.tag_remove("sel", "1.0", "end") | ||||||
|             text.tag_add("sel", first, last) |             text.tag_add("sel", first, last) | ||||||
|             text.mark_set("insert", self.engine.isback() and first or last) |             text.mark_set("insert", self.engine.isback() and first or last) | ||||||
|             text.see("insert") |             text.see("insert") | ||||||
|             return 1 |             return True | ||||||
|         else: |         else: | ||||||
|             text.bell() |             text.bell() | ||||||
|             return 0 |             return False | ||||||
| 
 | 
 | ||||||
|     def find_selection(self, text): |     def find_selection(self, text): | ||||||
|         pat = text.get("sel.first", "sel.last") |         pat = text.get("sel.first", "sel.last") | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kurt B. Kaiser
						Kurt B. Kaiser