1414import os
1515import time
1616import sys
17+ from typing import Any , Dict , List , Union
1718
1819from zerver .lib .db import TimeTrackingConnection
1920import zerver .lib .logging_util
147148
148149from django .template .loaders import app_directories
149150class TwoFactorLoader (app_directories .Loader ):
150- def get_dirs (self ):
151+ def get_dirs (self ) -> List [ str ] :
151152 dirs = super ().get_dirs ()
152153 return [d for d in dirs if 'two_factor' in d ]
153154
@@ -211,8 +212,8 @@ def get_dirs(self):
211212# Base URL of the Tornado server
212213# We set it to None when running backend tests or populate_db.
213214# We override the port number when running frontend tests.
214- TORNADO_PROCESSES = int (get_config ('application_server' , 'tornado_processes' , 1 ))
215- TORNADO_SERVER = 'http://127.0.0.1:9993'
215+ TORNADO_PROCESSES = int (get_config ('application_server' , 'tornado_processes' , '1' ))
216+ TORNADO_SERVER = 'http://127.0.0.1:9993' # type: Optional[str]
216217RUNNING_INSIDE_TORNADO = False
217218AUTORELOAD = DEBUG
218219
@@ -270,7 +271,7 @@ def get_dirs(self):
270271 'OPTIONS' : {
271272 'connection_factory' : TimeTrackingConnection
272273 },
273- }}
274+ }} # type: Dict[str, Dict[str, Any]]
274275
275276if DEVELOPMENT :
276277 LOCAL_DATABASE_PASSWORD = get_secret ("local_database_password" )
@@ -449,7 +450,7 @@ def get_dirs(self):
449450 'name' : 'Welcome Bot' }]
450451
451452# Bots that are created for each realm like the reminder-bot goes here.
452- REALM_INTERNAL_BOTS = []
453+ REALM_INTERNAL_BOTS = [] # type: List[Dict[str, str]]
453454# These are realm-internal bots that may exist in some organizations,
454455# so configure power the setting, but should not be auto-created at this time.
455456DISABLED_REALM_INTERNAL_BOTS = [
@@ -545,7 +546,7 @@ def get_dirs(self):
545546LOADERS = [
546547 'django.template.loaders.filesystem.Loader' ,
547548 'django.template.loaders.app_directories.Loader' ,
548- ]
549+ ] # type: List[Union[str, Tuple[object, ...]]]
549550if PRODUCTION :
550551 # Template caching is a significant performance win in production.
551552 LOADERS = [('django.template.loaders.cached.Loader' , LOADERS )]
@@ -564,7 +565,7 @@ def get_dirs(self):
564565 'django.template.context_processors.i18n' ,
565566 ],
566567 },
567- }
568+ } # type: Dict[str, Any]
568569
569570default_template_engine_settings = deepcopy (base_template_engine_settings )
570571default_template_engine_settings .update ({
@@ -874,7 +875,7 @@ def zulip_path(path: str) -> str:
874875 'propagate' : False ,
875876 },
876877 }
877- }
878+ } # type: Dict[str, Any]
878879
879880LOGIN_REDIRECT_URL = '/'
880881
0 commit comments