##// END OF EJS Templates
Merge pull request #3162 from ivanov/output-stream-kwarg...
Merge pull request #3162 from ivanov/output-stream-kwarg 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.

File last commit:

r5390:c82649ea
r10190:c3b429bd merge
Show More
inputhookgtk.py
35 lines | 1017 B | text/x-python | PythonLexer
# encoding: utf-8
"""
Enable pygtk to be used interacive by setting PyOS_InputHook.
Authors: Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import sys
import gtk, gobject
#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------
def _main_quit(*args, **kwargs):
gtk.main_quit()
return False
def inputhook_gtk():
gobject.io_add_watch(sys.stdin, gobject.IO_IN, _main_quit)
gtk.main()
return 0