File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
kernel_gateway/notebook_http Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ def _handle_request(self):
184184 'headers' : headers_to_dict (self .request .headers )
185185 })
186186 # Turn the request string into a valid code string
187- request_code = format_request (request )
187+ request_code = format_request (request , self . kernel_name )
188188
189189 # Run the request and source code and yield until there's a result
190190 access_log .debug ('Request code for notebook cell is: {}' .format (request_code ))
Original file line number Diff line number Diff line change 1212APPLICATION_JSON = 'application/json'
1313TEXT_PLAIN = 'text/plain'
1414
15- def format_request (bundle ):
15+ def format_request (bundle , kernel_name ):
1616 """Creates an assignment statement of bundle JSON-encoded to a variable
1717 named `REQUEST`.
1818
@@ -22,7 +22,10 @@ def format_request(bundle):
2222 `REQUEST = "<json-encoded expression>"`
2323 """
2424 bundle = json .dumps (bundle )
25- statement = "REQUEST = {}" .format (bundle )
25+ if kernel_name == 'iperl' :
26+ statement = "my $REQUEST = {}" .format (bundle )
27+ else :
28+ statement = "REQUEST = {}" .format (bundle )
2629 return statement
2730
2831def parameterize_path (path ):
You can’t perform that action at this time.
0 commit comments