mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-10-31 07:57:38 +03:00 
			
		
		
		
	Simplify copying generated Client signatures
This commit is contained in:
		
							parent
							
								
									c57543d79a
								
							
						
					
					
						commit
						80fefca2e9
					
				|  | @ -79,6 +79,8 @@ def main() -> None: | ||||||
| 
 | 
 | ||||||
|     m_visitor.visit(ast.parse(contents)) |     m_visitor.visit(ast.parse(contents)) | ||||||
| 
 | 
 | ||||||
|  |     class_body = [] | ||||||
|  | 
 | ||||||
|     for function in sorted(fm_visitor.methods, key=lambda f: f.name): |     for function in sorted(fm_visitor.methods, key=lambda f: f.name): | ||||||
|         function.body = [] |         function.body = [] | ||||||
|         if doc := m_visitor.method_docs.get(function.name): |         if doc := m_visitor.method_docs.get(function.name): | ||||||
|  | @ -105,8 +107,15 @@ def main() -> None: | ||||||
|                 call = ast.Return(value=call) |                 call = ast.Return(value=call) | ||||||
| 
 | 
 | ||||||
|         function.body.append(call) |         function.body.append(call) | ||||||
|  |         class_body.append(function) | ||||||
| 
 | 
 | ||||||
|         print(ast.unparse(function)) |     print( | ||||||
|  |         ast.unparse( | ||||||
|  |             ast.ClassDef( | ||||||
|  |                 name="Client", bases=[], keywords=[], body=class_body, decorator_list=[] | ||||||
|  |             ) | ||||||
|  |         ) | ||||||
|  |     ) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user