mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-11-04 09:57:29 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			411 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			411 B
		
	
	
	
		
			Python
		
	
	
	
	
	
def generate_errors(errors, f):
 | 
						|
    f.write('_captures = {\n')
 | 
						|
    for error in errors:
 | 
						|
        if error.capture_name:
 | 
						|
            f.write(f"    {error.canonical_name!r}: {error.capture_name!r},\n")
 | 
						|
    f.write('}\n')
 | 
						|
 | 
						|
    f.write('\n\n_descriptions = {\n')
 | 
						|
    for error in errors:
 | 
						|
        if error.description:
 | 
						|
            f.write(f"    {error.canonical_name!r}: {error.description!r},\n")
 | 
						|
    f.write('}\n')
 |