kopia lustrzana https://github.com/ihabunek/toot
				
				
				
			Add toot env command
							rodzic
							
								
									c74d2ad916
								
							
						
					
					
						commit
						29ff629464
					
				|  | @ -1,9 +1,10 @@ | |||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| import sys | ||||
| import platform | ||||
| 
 | ||||
| from datetime import datetime, timedelta, timezone | ||||
| from toot import api, config | ||||
| from toot import api, config, __version__ | ||||
| from toot.auth import login_interactive, login_browser_interactive, create_app_interactive | ||||
| from toot.exceptions import ApiError, ConsoleError | ||||
| from toot.output import (print_out, print_instance, print_account, print_acct_list, | ||||
|  | @ -220,6 +221,12 @@ def auth(app, user, args): | |||
|     print_out("\nAuth tokens are stored in: <blue>{}</blue>".format(path)) | ||||
| 
 | ||||
| 
 | ||||
| def env(app, user, args): | ||||
|     print_out(f"toot {__version__}") | ||||
|     print_out(f"Python {sys.version}") | ||||
|     print_out(platform.platform()) | ||||
| 
 | ||||
| 
 | ||||
| def login_cli(app, user, args): | ||||
|     app = create_app_interactive(instance=args.instance, scheme=args.scheme) | ||||
|     login_interactive(app, args.email) | ||||
|  |  | |||
|  | @ -223,6 +223,12 @@ AUTH_COMMANDS = [ | |||
|         arguments=[], | ||||
|         require_auth=False, | ||||
|     ), | ||||
|     Command( | ||||
|         name="env", | ||||
|         description="Print environment information for inclusion in bug reports.", | ||||
|         arguments=[], | ||||
|         require_auth=False, | ||||
|     ), | ||||
| ] | ||||
| 
 | ||||
| TUI_COMMANDS = [ | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Ivan Habunek
						Ivan Habunek