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

adding stream kwarg to current.new_output #3162

Merged
merged 1 commit into from Apr 12, 2013

Conversation

ivanov
Copy link
Member

@ivanov ivanov commented Apr 12, 2013

This was missing, and made unnecessarily clunky to create output cells
of stream type using the nbformat API.

Before this commit, you had to do something like

from IPython.nbformat import current as c
output = c.new_output('stream', the_text)
output['stream'] = 'stdout'

after this commit

from IPython.nbformat import current as c
output = c.new_output('stream', the_text, stream='stdout')

and actually, that stream= argument defaults to 'stdout' if it isn't given.

I modified a test that will break if this functionality is ever removed.

This was missing, and made unnecessarily clunky to create output cells
of stream type using the nbformat API.

Before this commit, you had to do something like

  from IPython.nbformat import current as c
  output = c.new_output('stream', the_text)
  output['stream'] = 'stdout'

after this commit

  from IPython.nbformat import current as c
  output = c.new_output('stream', the_text, stream='stdout')
@minrk
Copy link
Member

minrk commented Apr 12, 2013

Is there anywhere in our code that was using the clunky path that should be cleaned up?

@ivanov
Copy link
Member Author

ivanov commented Apr 12, 2013

nope, just ran grep -R new_output * | cut -f 1 -d: | sort | uniq and checked all of those. Should I bother applying the same change to nbformat/v2/nbbase.py?

@minrk
Copy link
Member

minrk commented Apr 12, 2013

No, v2 should not be touched - it should be frozen. I'll go ahead and merge, then. Thanks!

minrk added a commit that referenced this pull request Apr 12, 2013
adding stream kwarg to current.new_output

This was missing, and made unnecessarily clunky to create output cells
of stream type using the nbformat API.

Before this commit, you had to do something like

    from IPython.nbformat import current as c
    output = c.new_output('stream', the_text)
    output['stream'] = 'stdout'

after this commit

    from IPython.nbformat import current as c
    output = c.new_output('stream', the_text, stream='stdout')

and actually, that stream= argument defaults to 'stdout' if it isn't given.

I modified a test that will break if this functionality is ever removed.
@minrk minrk merged commit c3b429b into ipython:master Apr 12, 2013
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
adding stream kwarg to current.new_output

This was missing, and made unnecessarily clunky to create output cells
of stream type using the nbformat API.

Before this commit, you had to do something like

    from IPython.nbformat import current as c
    output = c.new_output('stream', the_text)
    output['stream'] = 'stdout'

after this commit

    from IPython.nbformat import current as c
    output = c.new_output('stream', the_text, stream='stdout')

and actually, that stream= argument defaults to 'stdout' if it isn't given.

I modified a test that will break if this functionality is ever removed.
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.

None yet

2 participants