@@ -76,7 +76,7 @@ def _default_path_info(self):
76
76
)
77
77
78
78
79
- class ServerProcess (Configurable ):
79
+ class _ServerProcess (Configurable ):
80
80
name = Unicode (help = "Name of the server" ).tag (config = True )
81
81
82
82
command = List (
@@ -264,6 +264,22 @@ def cats_only(response, path):
264
264
).tag (config = True )
265
265
266
266
267
+ class ServerProcess (_ServerProcess ):
268
+ """
269
+ A configurable server process for single standalone servers.
270
+ This is separate from ServerProcessEntryPoint so that we can configure it
271
+ independently of ServerProcessEntryPoint
272
+ """
273
+
274
+
275
+ class ServerProcessEntryPoint (_ServerProcess ):
276
+ """
277
+ A ServeProcess entrypoint that is a Configurable.
278
+ This is separate from ServerProcess so that we can configure it
279
+ independently of ServerProcess
280
+ """
281
+
282
+
267
283
def _make_proxy_handler (sp : ServerProcess ):
268
284
"""
269
285
Create an appropriate handler with given parameters
@@ -319,16 +335,23 @@ def get_timeout(self):
319
335
return _Proxy
320
336
321
337
322
- def get_entrypoint_server_processes (serverproxy_config ):
338
+ def get_entrypoint_server_processes (serverproxy_config , parent ):
323
339
sps = []
324
340
for entry_point in entry_points (group = "jupyter_serverproxy_servers" ):
325
341
name = entry_point .name
326
342
try :
327
- server_process_config = entry_point .load ()()
343
+ server_process_callable = entry_point .load ()
344
+ if issubclass (server_process_callable , ServerProcessEntryPoint ):
345
+ server_process = server_process_callable (name = name , parent = parent )
346
+ sps .append (server_process )
347
+ else :
348
+ server_process_config = server_process_callable ()
349
+ sps .append (
350
+ make_server_process (name , server_process_config , serverproxy_config )
351
+ )
328
352
except Exception as e :
329
353
warn (f"entry_point { name } was unable to be loaded: { str (e )} " )
330
354
continue
331
- sps .append (make_server_process (name , server_process_config , serverproxy_config ))
332
355
return sps
333
356
334
357
0 commit comments