14
14
import os
15
15
import time
16
16
import sys
17
+ from typing import Any , Dict , List , Union
17
18
18
19
from zerver .lib .db import TimeTrackingConnection
19
20
import zerver .lib .logging_util
147
148
148
149
from django .template .loaders import app_directories
149
150
class TwoFactorLoader (app_directories .Loader ):
150
- def get_dirs (self ):
151
+ def get_dirs (self ) -> List [ str ] :
151
152
dirs = super ().get_dirs ()
152
153
return [d for d in dirs if 'two_factor' in d ]
153
154
@@ -211,8 +212,8 @@ def get_dirs(self):
211
212
# Base URL of the Tornado server
212
213
# We set it to None when running backend tests or populate_db.
213
214
# 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]
216
217
RUNNING_INSIDE_TORNADO = False
217
218
AUTORELOAD = DEBUG
218
219
@@ -270,7 +271,7 @@ def get_dirs(self):
270
271
'OPTIONS' : {
271
272
'connection_factory' : TimeTrackingConnection
272
273
},
273
- }}
274
+ }} # type: Dict[str, Dict[str, Any]]
274
275
275
276
if DEVELOPMENT :
276
277
LOCAL_DATABASE_PASSWORD = get_secret ("local_database_password" )
@@ -449,7 +450,7 @@ def get_dirs(self):
449
450
'name' : 'Welcome Bot' }]
450
451
451
452
# 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]]
453
454
# These are realm-internal bots that may exist in some organizations,
454
455
# so configure power the setting, but should not be auto-created at this time.
455
456
DISABLED_REALM_INTERNAL_BOTS = [
@@ -545,7 +546,7 @@ def get_dirs(self):
545
546
LOADERS = [
546
547
'django.template.loaders.filesystem.Loader' ,
547
548
'django.template.loaders.app_directories.Loader' ,
548
- ]
549
+ ] # type: List[Union[str, Tuple[object, ...]]]
549
550
if PRODUCTION :
550
551
# Template caching is a significant performance win in production.
551
552
LOADERS = [('django.template.loaders.cached.Loader' , LOADERS )]
@@ -564,7 +565,7 @@ def get_dirs(self):
564
565
'django.template.context_processors.i18n' ,
565
566
],
566
567
},
567
- }
568
+ } # type: Dict[str, Any]
568
569
569
570
default_template_engine_settings = deepcopy (base_template_engine_settings )
570
571
default_template_engine_settings .update ({
@@ -874,7 +875,7 @@ def zulip_path(path: str) -> str:
874
875
'propagate' : False ,
875
876
},
876
877
}
877
- }
878
+ } # type: Dict[str, Any]
878
879
879
880
LOGIN_REDIRECT_URL = '/'
880
881
0 commit comments