-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose store_history to execute_request messages. #2184
Conversation
execution counter is tied to store_history. silent should just be for disabling displayhook stuff. Since we only exposed a silent arg, we used that in an overloaded way to mean both at the same time. Do you want to propagate this up to ShellChannel.execute method as well? |
…ilent execute message parameters.
Like that? |
Perfect, yes (though slight grammar tweak needed in store_history |
Better? |
yes, thanks! |
@@ -331,6 +331,7 @@ def execute_request(self, stream, ident, parent): | |||
content = parent[u'content'] | |||
code = content[u'code'] | |||
silent = content[u'silent'] | |||
store_history = content.get(u'store_history', not silent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstrings say that silent=True
will force store_history to be False, but it doesn't look like this line will do that - if store_history and silent are both True, store_history will be left as True, I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It happens on a lower level, in interactiveshell: https://github.com/ipython/ipython/blob/master/IPython/core/interactiveshell.py#L2573
Test results for commit 60122c0 merged into master
Not available for testing: python2.6 |
This is looking pretty clean, any further thoughts on it or should we proceed with merge? |
Looks okay to me too. |
@@ -219,7 +219,7 @@ def call_handlers(self, msg): | |||
""" | |||
raise NotImplementedError('call_handlers must be defined in a subclass.') | |||
|
|||
def execute(self, code, silent=False, | |||
def execute(self, code, silent=False, store_history=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the core, store_history
defaults to False, and the code path that executes user input sets it to True. I don't know if it makes sense to do the same here, I just thought it worth mentioning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to leave the default as True here, because that maintains backwards compatibility.
Looks like everyone was happy with this - I'll merge it tomorrow unless anyone wants to take another look. |
I guess I forgot about it after my last message, but since there were no objections, I'll merge it now. |
Expose store_history to execute_request messages.
Expose store_history to execute_request messages.
The doc changes should definitely be checked by someone who understands the system better. In particular, is the execution counter incremented if store_history is false, or is that tied to
silent
?I'm submitting this because Min said it would probably be a good idea: http://mail.scipy.org/pipermail/ipython-dev/2012-July/009937.html