##// END OF EJS Templates
Expose store_history to execute_request messages.
Jason Grout -
Show More
@@ -331,6 +331,7 b' class Kernel(Configurable):'
331 content = parent[u'content']
331 content = parent[u'content']
332 code = content[u'code']
332 code = content[u'code']
333 silent = content[u'silent']
333 silent = content[u'silent']
334 store_history = content.get(u'store_history', not silent)
334 except:
335 except:
335 self.log.error("Got bad msg: ")
336 self.log.error("Got bad msg: ")
336 self.log.error("%s", parent)
337 self.log.error("%s", parent)
@@ -366,7 +367,7 b' class Kernel(Configurable):'
366 reply_content = {}
367 reply_content = {}
367 try:
368 try:
368 # FIXME: the shell calls the exception handler itself.
369 # FIXME: the shell calls the exception handler itself.
369 shell.run_cell(code, store_history=not silent, silent=silent)
370 shell.run_cell(code, store_history=store_history, silent=silent)
370 except:
371 except:
371 status = u'error'
372 status = u'error'
372 # FIXME: this code right now isn't being used yet by default,
373 # FIXME: this code right now isn't being used yet by default,
@@ -161,11 +161,14 b' Message type: ``execute_request``::'
161 # sys.displayhook will not fire), and will *not*:
161 # sys.displayhook will not fire), and will *not*:
162 # - broadcast exceptions on the PUB socket
162 # - broadcast exceptions on the PUB socket
163 # - do any logging
163 # - do any logging
164 # - populate any history
165 #
164 #
166 # The default is False.
165 # The default is False.
167 'silent' : bool,
166 'silent' : bool,
168
167
168 # A boolean flag which, if True, signals the kernel to populate history
169 # The default is False if silent is True, or True if silent is False.
170 'store_history' : bool,
171
169 # A list of variable names from the user's namespace to be retrieved. What
172 # A list of variable names from the user's namespace to be retrieved. What
170 # returns is a JSON string of the variable's repr(), not a python object.
173 # returns is a JSON string of the variable's repr(), not a python object.
171 'user_variables' : list,
174 'user_variables' : list,
@@ -308,7 +311,7 b' Execution counter (old prompt number)'
308 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
311 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
309
312
310 The kernel has a single, monotonically increasing counter of all execution
313 The kernel has a single, monotonically increasing counter of all execution
311 requests that are made with ``silent=False``. This counter is used to populate
314 requests that are made with ``store_history=True``. This counter is used to populate
312 the ``In[n]``, ``Out[n]`` and ``_n`` variables, so clients will likely want to
315 the ``In[n]``, ``Out[n]`` and ``_n`` variables, so clients will likely want to
313 display it in some form to the user, which will typically (but not necessarily)
316 display it in some form to the user, which will typically (but not necessarily)
314 be done in the prompts. The value of this counter will be returned as the
317 be done in the prompts. The value of this counter will be returned as the
@@ -325,9 +328,9 b' Message type: ``execute_reply``::'
325 # One of: 'ok' OR 'error' OR 'abort'
328 # One of: 'ok' OR 'error' OR 'abort'
326 'status' : str,
329 'status' : str,
327
330
328 # The global kernel counter that increases by one with each non-silent
331 # The global kernel counter that increases by one with each request that
329 # executed request. This will typically be used by clients to display
332 # stores history. This will typically be used by clients to display
330 # prompt numbers to the user. If the request was a silent one, this will
333 # prompt numbers to the user. If the request did not store history, this will
331 # be the current value of the counter in the kernel.
334 # be the current value of the counter in the kernel.
332 'execution_count' : int,
335 'execution_count' : int,
333 }
336 }
General Comments 0
You need to be logged in to leave comments. Login now