@@ -3060,6 +3060,24 @@ def start_app(self) -> None:
3060
3060
)
3061
3061
self .exit (1 )
3062
3062
3063
+ info = self .log .info
3064
+ for line in self .running_server_info (kernel_count = False ).split ("\n " ):
3065
+ info (line )
3066
+ info (
3067
+ _i18n (
3068
+ "Use Control-C to stop this server and shut down all kernels (twice to skip confirmation)."
3069
+ )
3070
+ )
3071
+ if "dev" in __version__ :
3072
+ info (
3073
+ _i18n (
3074
+ "Welcome to Project Jupyter! Explore the various tools available"
3075
+ " and their corresponding documentation. If you are interested"
3076
+ " in contributing to the platform, please visit the community"
3077
+ " resources section at https://jupyter.org/community.html."
3078
+ )
3079
+ )
3080
+
3063
3081
self .write_server_info_file ()
3064
3082
3065
3083
if not self .no_browser_open_file :
@@ -3069,6 +3087,46 @@ def start_app(self) -> None:
3069
3087
if self .open_browser and not self .sock :
3070
3088
self .launch_browser ()
3071
3089
3090
+ if self .identity_provider .token and self .identity_provider .token_generated :
3091
+ # log full URL with generated token, so there's a copy/pasteable link
3092
+ # with auth info.
3093
+ if self .sock :
3094
+ self .log .critical (
3095
+ "\n " .join (
3096
+ [
3097
+ "\n " ,
3098
+ "Jupyter Server is listening on %s" % self .display_url ,
3099
+ "" ,
3100
+ (
3101
+ "UNIX sockets are not browser-connectable, but you can tunnel to "
3102
+ f"the instance via e.g.`ssh -L 8888:{ self .sock } -N user@this_host` and then "
3103
+ f"open e.g. { self .connection_url } in a browser."
3104
+ ),
3105
+ ]
3106
+ )
3107
+ )
3108
+ else :
3109
+ if self .no_browser_open_file :
3110
+ message = [
3111
+ "\n " ,
3112
+ _i18n ("To access the server, copy and paste one of these URLs:" ),
3113
+ " %s" % self .display_url ,
3114
+ ]
3115
+ else :
3116
+ message = [
3117
+ "\n " ,
3118
+ _i18n (
3119
+ "To access the server, open this file in a browser:" ,
3120
+ ),
3121
+ " %s" % urljoin ("file:" , pathname2url (self .browser_open_file )),
3122
+ _i18n (
3123
+ "Or copy and paste one of these URLs:" ,
3124
+ ),
3125
+ " %s" % self .display_url ,
3126
+ ]
3127
+
3128
+ self .log .critical ("\n DP_DAI2\n " + "\n " .join (message ))
3129
+
3072
3130
async def _cleanup (self ) -> None :
3073
3131
"""General cleanup of files, extensions and kernels created
3074
3132
by this instance ServerApp.
@@ -3126,64 +3184,6 @@ async def _post_start(self):
3126
3184
except Exception as err :
3127
3185
self .log .error (err )
3128
3186
3129
- info = self .log .info
3130
- for line in self .running_server_info (kernel_count = False ).split ("\n " ):
3131
- info (line )
3132
- info (
3133
- _i18n (
3134
- "Use Control-C to stop this server and shut down all kernels (twice to skip confirmation)."
3135
- )
3136
- )
3137
- if "dev" in __version__ :
3138
- info (
3139
- _i18n (
3140
- "Welcome to Project Jupyter! Explore the various tools available"
3141
- " and their corresponding documentation. If you are interested"
3142
- " in contributing to the platform, please visit the community"
3143
- " resources section at https://jupyter.org/community.html."
3144
- )
3145
- )
3146
-
3147
- if self .identity_provider .token and self .identity_provider .token_generated :
3148
- # log full URL with generated token, so there's a copy/pasteable link
3149
- # with auth info.
3150
- if self .sock :
3151
- self .log .critical (
3152
- "\n " .join (
3153
- [
3154
- "\n " ,
3155
- "Jupyter Server is listening on %s" % self .display_url ,
3156
- "" ,
3157
- (
3158
- "UNIX sockets are not browser-connectable, but you can tunnel to "
3159
- f"the instance via e.g.`ssh -L 8888:{ self .sock } -N user@this_host` and then "
3160
- f"open e.g. { self .connection_url } in a browser."
3161
- ),
3162
- ]
3163
- )
3164
- )
3165
- else :
3166
- if self .no_browser_open_file :
3167
- message = [
3168
- "\n " ,
3169
- _i18n ("To access the server, copy and paste one of these URLs:" ),
3170
- " %s" % self .display_url ,
3171
- ]
3172
- else :
3173
- message = [
3174
- "\n " ,
3175
- _i18n (
3176
- "To access the server, open this file in a browser:" ,
3177
- ),
3178
- " %s" % urljoin ("file:" , pathname2url (self .browser_open_file )),
3179
- _i18n (
3180
- "Or copy and paste one of these URLs:" ,
3181
- ),
3182
- " %s" % self .display_url ,
3183
- ]
3184
-
3185
- self .log .critical ("\n " .join (message ))
3186
-
3187
3187
def start (self ) -> None :
3188
3188
"""Start the Jupyter server app, after initialization
3189
3189
0 commit comments