@@ -1573,6 +1573,10 @@ def _default_info_file(self):
1573
1573
info_file = "jpserver-%s.json" % os .getpid ()
1574
1574
return os .path .join (self .runtime_dir , info_file )
1575
1575
1576
+ no_browser_open_file = Bool (
1577
+ False , help = "If True, do not write redirect HTML file disk, or show in messages."
1578
+ )
1579
+
1576
1580
browser_open_file = Unicode ()
1577
1581
1578
1582
@default ("browser_open_file" )
@@ -2815,9 +2819,11 @@ def start_app(self):
2815
2819
2816
2820
self .write_server_info_file ()
2817
2821
2822
+ if not self .no_browser_open_file :
2823
+ self .write_browser_open_files ()
2824
+
2818
2825
# Handle the browser opening.
2819
2826
if self .open_browser and not self .sock :
2820
- self .write_browser_open_files ()
2821
2827
self .launch_browser ()
2822
2828
2823
2829
if self .identity_provider .token and self .identity_provider .token_generated :
@@ -2840,17 +2846,26 @@ def start_app(self):
2840
2846
)
2841
2847
)
2842
2848
else :
2843
- self .log .critical (
2844
- "\n " .join (
2845
- [
2846
- "\n " ,
2849
+ if self .no_browser_open_file :
2850
+ message = [
2851
+ "\n " ,
2852
+ _i18n ("To access the server, copy and paste one of these URLs:" ),
2853
+ " %s" % self .display_url ,
2854
+ ]
2855
+ else :
2856
+ message = [
2857
+ "\n " ,
2858
+ _i18n (
2847
2859
"To access the server, open this file in a browser:" ,
2848
- " %s" % urljoin ("file:" , pathname2url (self .browser_open_file )),
2860
+ ),
2861
+ " %s" % urljoin ("file:" , pathname2url (self .browser_open_file )),
2862
+ _i18n (
2849
2863
"Or copy and paste one of these URLs:" ,
2850
- " %s" % self .display_url ,
2851
- ]
2852
- )
2853
- )
2864
+ ),
2865
+ " %s" % self .display_url ,
2866
+ ]
2867
+
2868
+ self .log .critical ("\n " .join (message ))
2854
2869
2855
2870
async def _cleanup (self ):
2856
2871
"""General cleanup of files, extensions and kernels created
0 commit comments