From 71f1c23ac57d2df8f97cc50c0f2e7838b1b427fe 2012-09-07 18:09:53 From: Takafumi Arakaki Date: 2012-09-07 18:09:53 Subject: [PATCH] Add the new search option `n` to the messaging protocol --- diff --git a/IPython/zmq/ipkernel.py b/IPython/zmq/ipkernel.py index ef7a934..70dfffc 100755 --- a/IPython/zmq/ipkernel.py +++ b/IPython/zmq/ipkernel.py @@ -486,9 +486,10 @@ class Kernel(Configurable): raw=raw, output=output) elif hist_access_type == 'search': + n = parent['content']['n'] pattern = parent['content']['pattern'] hist = self.shell.history_manager.search(pattern, raw=raw, - output=output) + output=output, n=n) else: hist = [] diff --git a/docs/source/development/messaging.txt b/docs/source/development/messaging.txt index c98041d..55bfbf9 100644 --- a/docs/source/development/messaging.txt +++ b/docs/source/development/messaging.txt @@ -627,7 +627,7 @@ Message type: ``history_request``:: 'start' : int, 'stop' : int, - # If hist_access_type is 'tail', get the last n cells. + # If hist_access_type is 'tail' or 'search', get the last n cells. 'n' : int, # If hist_access_type is 'search', get cells matching the specified glob