@@ -26,6 +26,7 @@ class _Proxy(SuperviseAndProxyHandler):
26
26
def __init__ (self , * args , ** kwargs ):
27
27
super ().__init__ (* args , ** kwargs )
28
28
self .name = name
29
+ self .command = command
29
30
self .proxy_base = name
30
31
self .absolute_url = absolute_url
31
32
self .requested_port = port
@@ -62,7 +63,7 @@ def _realize_rendered_template(self, attribute):
62
63
return self ._render_template (attribute )
63
64
64
65
def get_cmd (self ):
65
- return self ._realize_rendered_template (command )
66
+ return self ._realize_rendered_template (self . command )
66
67
67
68
def get_env (self ):
68
69
return self ._realize_rendered_template (environment )
@@ -121,7 +122,7 @@ def make_server_process(name, server_process_config, serverproxy_config):
121
122
le = server_process_config .get ('launcher_entry' , {})
122
123
return ServerProcess (
123
124
name = name ,
124
- command = server_process_config [ 'command' ] ,
125
+ command = server_process_config . get ( 'command' , list ()) ,
125
126
environment = server_process_config .get ('environment' , {}),
126
127
timeout = server_process_config .get ('timeout' , 5 ),
127
128
absolute_url = server_process_config .get ('absolute_url' , False ),
@@ -152,12 +153,16 @@ class ServerProxy(Configurable):
152
153
153
154
Value should be a dictionary with the following keys:
154
155
command
155
- A list of strings that should be the full command to be executed.
156
+ An optional list of strings that should be the full command to be executed.
156
157
The optional template arguments {{port}} and {{base_url}} will be substituted with the
157
158
port the process should listen on and the base-url of the notebook.
158
159
159
160
Could also be a callable. It should return a list.
160
161
162
+ If the command is not specified or is an empty list, it is assumed the process is already
163
+ running, therefore the port checking is skipped and the proxy is set up on the specified
164
+ port.
165
+
161
166
environment
162
167
A dictionary of environment variable mappings. As with the command
163
168
traitlet, {{port}} and {{base_url}} will be substituted.
0 commit comments