From aa6723b8c300155167cda619aa7a5bafdb48762e 2010-08-19 18:33:31 From: epatters Date: 2010-08-19 18:33:31 Subject: [PATCH] Created a proper IPython script from the console frontend demo. --- diff --git a/IPython/frontend/qt/console/scripts/__init__.py b/IPython/frontend/qt/console/scripts/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/IPython/frontend/qt/console/scripts/__init__.py diff --git a/IPython/frontend/qt/console/demo.py b/IPython/frontend/qt/console/scripts/ipythonqt.py similarity index 89% rename from IPython/frontend/qt/console/demo.py rename to IPython/frontend/qt/console/scripts/ipythonqt.py old mode 100644 new mode 100755 index 5461ccd..42d44fb --- a/IPython/frontend/qt/console/demo.py +++ b/IPython/frontend/qt/console/scripts/ipythonqt.py @@ -1,4 +1,6 @@ -""" A demo of the Qt console-style IPython frontend. +#!/usr/bin/env python + +""" A minimal application using the Qt console-style IPython frontend. """ # Systemm library imports @@ -6,11 +8,14 @@ from PyQt4 import QtCore, QtGui # Local imports from IPython.external.argparse import ArgumentParser +from IPython.frontend.qt.console.frontend_widget import FrontendWidget +from IPython.frontend.qt.console.ipython_widget import IPythonWidget +from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget from IPython.frontend.qt.kernelmanager import QtKernelManager def main(): - """ Entry point for demo. + """ Entry point for application. """ # Parse command line arguments. parser = ArgumentParser() @@ -43,15 +48,12 @@ def main(): # Launch the application. app = QtGui.QApplication([]) if namespace.pure: - from frontend_widget import FrontendWidget kind = 'rich' if namespace.rich else 'plain' widget = FrontendWidget(kind=kind) else: if namespace.rich: - from rich_ipython_widget import RichIPythonWidget widget = RichIPythonWidget() else: - from ipython_widget import IPythonWidget widget = IPythonWidget() widget.kernel_manager = kernel_manager widget.setWindowTitle('Python' if namespace.pure else 'IPython')