Show More
@@ -212,7 +212,7 b' class IPythonWidget(FrontendWidget):' | |||
|
212 | 212 | """ Reimplemented to make a history request. |
|
213 | 213 | """ |
|
214 | 214 | super(IPythonWidget, self)._started_channels() |
|
215 |
self.kernel_manager.xreq_channel.history |
|
|
215 | self.kernel_manager.xreq_channel.history(hist_access_type='tail', n=1000) | |
|
216 | 216 | |
|
217 | 217 | #--------------------------------------------------------------------------- |
|
218 | 218 | # 'ConsoleWidget' public interface |
@@ -282,23 +282,40 b' class XReqSocketChannel(ZmqSocketChannel):' | |||
|
282 | 282 | self._queue_request(msg) |
|
283 | 283 | return msg['header']['msg_id'] |
|
284 | 284 | |
|
285 |
def history |
|
|
286 | """Get the history list. | |
|
285 | def history(self, raw=True, output=False, hist_access_type='range', **kwargs): | |
|
286 | """Get entries from the history list. | |
|
287 | 287 | |
|
288 | 288 | Parameters |
|
289 | 289 | ---------- |
|
290 | n : int | |
|
291 | The number of lines of history to get. | |
|
292 | 290 | raw : bool |
|
293 | 291 | If True, return the raw input. |
|
294 | 292 | output : bool |
|
295 | 293 | If True, then return the output as well. |
|
294 | hist_access_type : str | |
|
295 | 'range' (fill in session, start and stop params), 'tail' (fill in n) | |
|
296 | or 'search' (fill in pattern param). | |
|
297 | ||
|
298 | session : int | |
|
299 | For a range request, the session from which to get lines. Session | |
|
300 | numbers are positive integers; negative ones count back from the | |
|
301 | current session. | |
|
302 | start : int | |
|
303 | The first line number of a history range. | |
|
304 | stop : int | |
|
305 | The final (excluded) line number of a history range. | |
|
306 | ||
|
307 | n : int | |
|
308 | The number of lines of history to get for a tail request. | |
|
309 | ||
|
310 | pattern : str | |
|
311 | The glob-syntax pattern for a search request. | |
|
296 | 312 | |
|
297 | 313 | Returns |
|
298 | 314 | ------- |
|
299 | 315 | The msg_id of the message sent. |
|
300 | 316 | """ |
|
301 |
content = dict( |
|
|
317 | content = dict(raw=raw, output=output, hist_access_type=hist_access_type, | |
|
318 | **kwargs) | |
|
302 | 319 | msg = self.session.msg('history_request', content) |
|
303 | 320 | self._queue_request(msg) |
|
304 | 321 | return msg['header']['msg_id'] |
General Comments 0
You need to be logged in to leave comments.
Login now