@@ -75,7 +75,7 @@ def json_sys_info():
7575def log () -> Logger :
7676 """Get the application log."""
7777 if Application .initialized ():
78- return cast (Logger , Application .instance ().log )
78+ return cast (" Logger" , Application .instance ().log )
7979 else :
8080 return app_log
8181
@@ -85,7 +85,7 @@ class AuthenticatedHandler(web.RequestHandler):
8585
8686 @property
8787 def base_url (self ) -> str :
88- return cast (str , self .settings .get ("base_url" , "/" ))
88+ return cast (" str" , self .settings .get ("base_url" , "/" ))
8989
9090 @property
9191 def content_security_policy (self ) -> str :
@@ -95,7 +95,7 @@ def content_security_policy(self) -> str:
9595 """
9696 if "Content-Security-Policy" in self .settings .get ("headers" , {}):
9797 # user-specified, don't override
98- return cast (str , self .settings ["headers" ]["Content-Security-Policy" ])
98+ return cast (" str" , self .settings ["headers" ]["Content-Security-Policy" ])
9999
100100 return "; " .join (
101101 [
@@ -173,7 +173,7 @@ def get_current_user(self) -> str:
173173 DeprecationWarning ,
174174 stacklevel = 2 ,
175175 )
176- return cast (str , self ._jupyter_current_user )
176+ return cast (" str" , self ._jupyter_current_user )
177177 # haven't called get_user in prepare, raise
178178 raise RuntimeError (msg )
179179
@@ -224,7 +224,7 @@ def login_available(self) -> bool:
224224 whether the user is already logged in or not.
225225
226226 """
227- return cast (bool , self .identity_provider .login_available )
227+ return cast (" bool" , self .identity_provider .login_available )
228228
229229 @property
230230 def authorizer (self ) -> Authorizer :
@@ -302,34 +302,34 @@ def serverapp(self) -> ServerApp | None:
302302 @property
303303 def version_hash (self ) -> str :
304304 """The version hash to use for cache hints for static files"""
305- return cast (str , self .settings .get ("version_hash" , "" ))
305+ return cast (" str" , self .settings .get ("version_hash" , "" ))
306306
307307 @property
308308 def mathjax_url (self ) -> str :
309- url = cast (str , self .settings .get ("mathjax_url" , "" ))
309+ url = cast (" str" , self .settings .get ("mathjax_url" , "" ))
310310 if not url or url_is_absolute (url ):
311311 return url
312312 return url_path_join (self .base_url , url )
313313
314314 @property
315315 def mathjax_config (self ) -> str :
316- return cast (str , self .settings .get ("mathjax_config" , "TeX-AMS-MML_HTMLorMML-full,Safe" ))
316+ return cast (" str" , self .settings .get ("mathjax_config" , "TeX-AMS-MML_HTMLorMML-full,Safe" ))
317317
318318 @property
319319 def default_url (self ) -> str :
320- return cast (str , self .settings .get ("default_url" , "" ))
320+ return cast (" str" , self .settings .get ("default_url" , "" ))
321321
322322 @property
323323 def ws_url (self ) -> str :
324- return cast (str , self .settings .get ("websocket_url" , "" ))
324+ return cast (" str" , self .settings .get ("websocket_url" , "" ))
325325
326326 @property
327327 def contents_js_source (self ) -> str :
328328 self .log .debug (
329329 "Using contents: %s" ,
330330 self .settings .get ("contents_js_source" , "services/contents" ),
331331 )
332- return cast (str , self .settings .get ("contents_js_source" , "services/contents" ))
332+ return cast (" str" , self .settings .get ("contents_js_source" , "services/contents" ))
333333
334334 # ---------------------------------------------------------------
335335 # Manager objects
@@ -370,7 +370,7 @@ def event_logger(self) -> EventLogger:
370370 @property
371371 def allow_origin (self ) -> str :
372372 """Normal Access-Control-Allow-Origin"""
373- return cast (str , self .settings .get ("allow_origin" , "" ))
373+ return cast (" str" , self .settings .get ("allow_origin" , "" ))
374374
375375 @property
376376 def allow_origin_pat (self ) -> str | None :
@@ -380,7 +380,7 @@ def allow_origin_pat(self) -> str | None:
380380 @property
381381 def allow_credentials (self ) -> bool :
382382 """Whether to set Access-Control-Allow-Credentials"""
383- return cast (bool , self .settings .get ("allow_credentials" , False ))
383+ return cast (" bool" , self .settings .get ("allow_credentials" , False ))
384384
385385 def set_default_headers (self ) -> None :
386386 """Add CORS headers, if defined"""
0 commit comments