typing: Convert function type annotations to Python 3 style.
Generated by com2ann (slightly patched to avoid also converting assignment type annotations, which require Python 3.6), followed by some manual whitespace adjustment, and two fixes for use-before-define issues: - def set_zulip_client(self, zulipToJabberClient: ZulipToJabberBot) -> None: + def set_zulip_client(self, zulipToJabberClient: 'ZulipToJabberBot') -> None: -def init_from_options(options: Any, client: Optional[str] = None) -> Client: +def init_from_options(options: Any, client: Optional[str] = None) -> 'Client': Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
		
							parent
							
								
									7c5f73dce9
								
							
						
					
					
						commit
						5428c5f296
					
				
					 42 changed files with 311 additions and 577 deletions
				
			
		|  | @ -26,8 +26,7 @@ CLIENT_SECRET_FILE = 'client_secret.json' | |||
| APPLICATION_NAME = 'Zulip Calendar Bot' | ||||
| HOME_DIR = os.path.expanduser('~') | ||||
| 
 | ||||
| def get_credentials(): | ||||
|     # type: () -> client.Credentials | ||||
| def get_credentials() -> client.Credentials: | ||||
|     """Gets valid user credentials from storage. | ||||
| 
 | ||||
|     If nothing has been stored, or if the stored credentials are invalid, | ||||
|  |  | |||
|  | @ -79,8 +79,7 @@ if not (options.zulip_email): | |||
| 
 | ||||
| zulip_client = zulip.init_from_options(options) | ||||
| 
 | ||||
| def get_credentials(): | ||||
|     # type: () -> client.Credentials | ||||
| def get_credentials() -> client.Credentials: | ||||
|     """Gets valid user credentials from storage. | ||||
| 
 | ||||
|     If nothing has been stored, or if the stored credentials are invalid, | ||||
|  | @ -104,8 +103,7 @@ def get_credentials(): | |||
|         logging.error("Run the get-google-credentials script from this directory first.") | ||||
| 
 | ||||
| 
 | ||||
| def populate_events(): | ||||
|     # type: () -> Optional[None] | ||||
| def populate_events() -> Optional[None]: | ||||
|     global events | ||||
| 
 | ||||
|     credentials = get_credentials() | ||||
|  | @ -145,8 +143,7 @@ def populate_events(): | |||
|             events.append((event["id"], start, "(No Title)")) | ||||
| 
 | ||||
| 
 | ||||
| def send_reminders(): | ||||
|     # type: () -> Optional[None] | ||||
| def send_reminders() -> Optional[None]: | ||||
|     global sent | ||||
| 
 | ||||
|     messages = [] | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Anders Kaseorg
						Anders Kaseorg