mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Merged revisions 75327 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75327 | georg.brandl | 2009-10-11 00:03:43 +0200 (So, 11 Okt 2009) | 1 line Style fixes. ........
This commit is contained in:
		
							parent
							
								
									8bef554cf7
								
							
						
					
					
						commit
						583350f104
					
				
					 1 changed files with 6 additions and 6 deletions
				
			
		|  | @ -21,20 +21,20 @@ | ||||||
| import re | import re | ||||||
| 
 | 
 | ||||||
| def main(args): | def main(args): | ||||||
|     unicode_names= [] |     unicode_names = [] | ||||||
|     for ix in range(sys.maxunicode+1): |     for ix in range(sys.maxunicode+1): | ||||||
|         try: |         try: | ||||||
|             unicode_names.append( (ix, unicodedata.name(chr(ix))) ) |             unicode_names.append((ix, unicodedata.name(chr(ix)))) | ||||||
|         except ValueError: # no name for the character |         except ValueError: # no name for the character | ||||||
|             pass |             pass | ||||||
|     for arg in args: |     for arg in args: | ||||||
|         pat = re.compile(arg, re.I) |         pat = re.compile(arg, re.I) | ||||||
|         matches = [(x,y) for (x,y) in unicode_names |         matches = [(y,x) for (x,y) in unicode_names | ||||||
|                        if pat.search(y) is not None] |                    if pat.search(y) is not None] | ||||||
|         if matches: |         if matches: | ||||||
|             print("***", arg, "matches", "***") |             print("***", arg, "matches", "***") | ||||||
|             for (x,y) in matches: |             for match in matches: | ||||||
|                 print("%s (%d)" % (y,x)) |                 print("%s (%d)" % match) | ||||||
| 
 | 
 | ||||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||||
|     main(sys.argv[1:]) |     main(sys.argv[1:]) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Georg Brandl
						Georg Brandl