##// END OF EJS Templates
fix %autopx in scripts by calling run_code for each ast node...
fix %autopx in scripts by calling run_code for each ast node Previously, there was no call to override if %autopx was called inside a single cell (e.g. %run script.ipy). This splits run_ast_nodes, so that each node gets a separate call to run_code. reviewed changes: * remove old use of 'new' * fix interactiveshell.run_code docstring Additional change: automatically load parallelmagic extension on view.activate()

File last commit:

r3364:48ca8275
r3735:31c15b8f
Show More
qt.py
32 lines | 948 B | text/x-python | PythonLexer
""" A Qt API selector that can be used to switch between PyQt and PySide.
"""
import os
# Available APIs.
QT_API_PYQT = 'pyqt'
QT_API_PYSIDE = 'pyside'
# Use PyQt by default until PySide is stable.
QT_API = os.environ.get('QT_API', QT_API_PYQT)
if QT_API == QT_API_PYQT:
# For PySide compatibility, use the new-style string API that automatically
# converts QStrings to Unicode Python strings. Also, automatically unpack
# QVariants to their underlying objects.
import sip
sip.setapi('QString', 2)
sip.setapi('QVariant', 2)
from PyQt4 import QtCore, QtGui, QtSvg
# Alias PyQt-specific functions for PySide compatibility.
QtCore.Signal = QtCore.pyqtSignal
QtCore.Slot = QtCore.pyqtSlot
elif QT_API == QT_API_PYSIDE:
from PySide import QtCore, QtGui, QtSvg
else:
raise RuntimeError('Invalid Qt API %r, valid values are: %r or %r' %
(QT_API, QT_API_PYQT, QT_API_PYSIDE))