Skip to content
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

Merged
merged 4 commits into from
Aug 20, 2012

Conversation

jasongrout
Copy link
Member

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

@minrk
Copy link
Member

minrk commented Jul 21, 2012

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?

@jasongrout
Copy link
Member Author

Like that?

@minrk
Copy link
Member

minrk commented Jul 21, 2012

Perfect, yes (though slight grammar tweak needed in store_history
description).

@jasongrout
Copy link
Member Author

Better?

@minrk
Copy link
Member

minrk commented Jul 21, 2012

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)
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fperez
Copy link
Member

fperez commented Jul 24, 2012

Test results for commit 60122c0 merged into master
Platform: linux2

  • python2.7: OK
  • python3.2: OK (libraries not available: cython matplotlib oct2py pymongo rpy2 wx wx.aui)

Not available for testing: python2.6

@fperez
Copy link
Member

fperez commented Jul 24, 2012

This is looking pretty clean, any further thoughts on it or should we proceed with merge?

@bfroehle
Copy link
Contributor

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,
Copy link
Member

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.

Copy link
Member

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.

@takluyver
Copy link
Member

Looks like everyone was happy with this - I'll merge it tomorrow unless anyone wants to take another look.

@takluyver
Copy link
Member

I guess I forgot about it after my last message, but since there were no objections, I'll merge it now.

takluyver added a commit that referenced this pull request Aug 20, 2012
Expose store_history to execute_request messages.
@takluyver takluyver merged commit f56e91c into ipython:master Aug 20, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Expose store_history to execute_request messages.
@jasongrout jasongrout deleted the store-history branch April 17, 2015 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants