Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions IPython/core/pylabtools.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
# -*- coding: utf-8 -*-
"""Pylab (matplotlib) support utilities.

Authors
-------

* Fernando Perez.
* Brian Granger
"""
"""Pylab (matplotlib) support utilities."""
from __future__ import print_function

#-----------------------------------------------------------------------------
# Copyright (C) 2009 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
#-----------------------------------------------------------------------------
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.

from io import BytesIO

Expand All @@ -34,7 +19,9 @@
'wx': 'WXAgg',
'qt': 'Qt4Agg', # qt3 not supported
'qt4': 'Qt4Agg',
'qt5': 'Qt5Agg',
'osx': 'MacOSX',
'nbagg': 'nbAgg',
'inline' : 'module://IPython.kernel.zmq.pylab.backend_inline'}

# We also need a reverse backends2guis mapping that will properly choose which
Expand Down
30 changes: 11 additions & 19 deletions IPython/kernel/zmq/eventloops.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
# encoding: utf-8
"""Event loop integration for the ZeroMQ-based kernels.
"""
"""Event loop integration for the ZeroMQ-based kernels."""

#-----------------------------------------------------------------------------
# Copyright (C) 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
#-----------------------------------------------------------------------------
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.

import os
import sys

# System library imports
import zmq

# Local imports
from IPython.config.application import Application
from IPython.utils import io


#------------------------------------------------------------------------------
# Eventloops for integrating the Kernel into different GUIs
#------------------------------------------------------------------------------

def _on_os_x_10_9():
import platform
from distutils.version import LooseVersion as V
Expand All @@ -54,6 +39,7 @@ def process_stream_events():
# mapping of keys to loop functions
loop_map = {
'inline': None,
'nbagg': None,
None : None,
}

Expand Down Expand Up @@ -92,6 +78,12 @@ def loop_qt4(kernel):

start_event_loop_qt4(kernel.app)

@register_integration('qt5')
def loop_qt5(kernel):
"""Start a kernel with PyQt5 event loop integration."""
os.environ['QT_API'] = 'pyqt5'
return loop_qt4(kernel)


@register_integration('wx')
def loop_wx(kernel):
Expand Down