diff --git a/IPython/core/usage.py b/IPython/core/usage.py index 39425e7..20cece8 100644 --- a/IPython/core/usage.py +++ b/IPython/core/usage.py @@ -39,83 +39,6 @@ USAGE In the rest of this text, we will refer to this directory as IPYTHONDIR. - -SPECIAL THREADING OPTIONS - The following special options are ONLY valid at the beginning of the - command line, and not later. This is because they control the initial- - ization of ipython itself, before the normal option-handling mechanism - is active. - - -gthread, -qthread, -q4thread, -wthread, -pylab - - Only ONE of these can be given, and it can only be given as the - first option passed to IPython (it will have no effect in any - other position). They provide threading support for the GTK, QT - and WXWidgets toolkits, and for the matplotlib library. - - With any of the first four options, IPython starts running a - separate thread for the graphical toolkit's operation, so that - you can open and control graphical elements from within an - IPython command line, without blocking. All four provide - essentially the same functionality, respectively for GTK, QT3, - QT4 and WXWidgets (via their Python interfaces). - - Note that with -wthread, you can additionally use the -wxversion - option to request a specific version of wx to be used. This - requires that you have the 'wxversion' Python module installed, - which is part of recent wxPython distributions. - - If -pylab is given, IPython loads special support for the mat- - plotlib library (http://matplotlib.sourceforge.net), allowing - interactive usage of any of its backends as defined in the - user's .matplotlibrc file. It automatically activates GTK, QT - or WX threading for IPyhton if the choice of matplotlib backend - requires it. It also modifies the %run command to correctly - execute (without blocking) any matplotlib-based script which - calls show() at the end. - - -tk The -g/q/q4/wthread options, and -pylab (if matplotlib is - configured to use GTK, QT or WX), will normally block Tk - graphical interfaces. This means that when GTK, QT or WX - threading is active, any attempt to open a Tk GUI will result in - a dead window, and possibly cause the Python interpreter to - crash. An extra option, -tk, is available to address this - issue. It can ONLY be given as a SECOND option after any of the - above (-gthread, -qthread, q4thread, -wthread or -pylab). - - If -tk is given, IPython will try to coordinate Tk threading - with GTK, QT or WX. This is however potentially unreliable, and - you will have to test on your platform and Python configuration - to determine whether it works for you. Debian users have - reported success, apparently due to the fact that Debian builds - all of Tcl, Tk, Tkinter and Python with pthreads support. Under - other Linux environments (such as Fedora Core 2/3), this option - has caused random crashes and lockups of the Python interpreter. - Under other operating systems (Mac OSX and Windows), you'll need - to try it to find out, since currently no user reports are - available. - - There is unfortunately no way for IPython to determine at run- - time whether -tk will work reliably or not, so you will need to - do some experiments before relying on it for regular work. - -A WARNING ABOUT SIGNALS AND THREADS - - When any of the thread systems (GTK, QT or WX) are active, either - directly or via -pylab with a threaded backend, it is impossible to - interrupt long-running Python code via Ctrl-C. IPython can not pass - the KeyboardInterrupt exception (or the underlying SIGINT) across - threads, so any long-running process started from IPython will run to - completion, or will have to be killed via an external (OS-based) - mechanism. - - To the best of my knowledge, this limitation is imposed by the Python - interpreter itself, and it comes from the difficulty of writing - portable signal/threaded code. If any user is an expert on this topic - and can suggest a better solution, I would love to hear about it. In - the IPython sources, look at the shell.py module, and in particular at - the runcode() method. - REGULAR OPTIONS After the above threading options have been given, regular options can follow in any order. All options can be abbreviated to their shortest @@ -132,16 +55,6 @@ REGULAR OPTIONS -h, --help Show summary of options. - -pylab This can only be given as the first option passed to IPython (it - will have no effect in any other position). It adds special sup- - port for the matplotlib library (http://matplotlib.source- - forge.net), allowing interactive usage of any of its backends as - defined in the user's .matplotlibrc file. It automatically - activates GTK or WX threading for IPyhton if the choice of mat- - plotlib backend requires it. It also modifies the @run command - to correctly execute (without blocking) any matplotlib-based - script which calls show() at the end. - -autocall Make IPython automatically call any callable object even if you didn't type explicit parentheses. For example, 'str 43' becomes diff --git a/docs/man/ipython.1 b/docs/man/ipython.1 index 74b9f98..4ec3f0e 100644 --- a/docs/man/ipython.1 +++ b/docs/man/ipython.1 @@ -31,62 +31,6 @@ An interactive Python shell with automatic history (input and output), dynamic object introspection, easier configuration, command completion, access to the system shell, integration with numerical and scientific computing tools, and more. -.SH SPECIAL THREADING OPTIONS -The following special options are ONLY valid at the beginning of the command -line, and not later. This is because they control the initialization of -ipython itself, before the normal option-handling mechanism is active. -.TP -.B \-gthread, \-qthread, \-q4thread, \-wthread, \-pylab -Only ONE of these can be given, and it can only be given as the first option -passed to IPython (it will have no effect in any other position). They provide -threading support for the GTK, QT3, QT4 and WXWidgets toolkits, for the -matplotlib library and Twisted reactor. -.br -.sp 1 -With any of the first four options, IPython starts running a separate thread -for the graphical toolkit's operation, so that you can open and control -graphical elements from within an IPython command line, without blocking. All -four provide essentially the same functionality, respectively for GTK, QT3, QT4 -and WXWidgets (via their Python interfaces). -.br -.sp 1 -Note that with \-wthread, you can additionally use the \-wxversion option to -request a specific version of wx to be used. This requires that you have the -wxversion Python module installed, which is part of recent wxPython -distributions. -.br -.sp 1 -If \-pylab is given, IPython loads special support for the matplotlib library -(http://matplotlib.sourceforge.net), allowing interactive usage of any of its -backends as defined in the user's .matplotlibrc file. It automatically -activates GTK, QT or WX threading for IPyhton if the choice of matplotlib -backend requires it. It also modifies the %run command to correctly execute -(without blocking) any matplotlib-based script which calls show() at the end. -.TP -.B \-tk -The \-g/q/q4/wthread options, and \-pylab (if matplotlib is configured to use -GTK, QT or WX), will normally block Tk graphical interfaces. This means that -when GTK, QT or WX threading is active, any attempt to open a Tk GUI will -result in a dead window, and possibly cause the Python interpreter to crash. -An extra option, \-tk, is available to address this issue. It can ONLY be -given as a SECOND option after any of the above (\-gthread, \-qthread, -\-wthread or \-pylab). -.br -.sp 1 -If \-tk is given, IPython will try to coordinate Tk threading with GTK, QT or -WX. This is however potentially unreliable, and you will have to test on your -platform and Python configuration to determine whether it works for you. -Debian users have reported success, apparently due to the fact that Debian -builds all of Tcl, Tk, Tkinter and Python with pthreads support. Under other -Linux environments (such as Fedora Core 2), this option has caused random -crashes and lockups of the Python interpreter. Under other operating systems -(Mac OSX and Windows), you'll need to try it to find out, since currently no -user reports are available. -.br -.sp 1 -There is unfortunately no way for IPython to determine at runtime whether \-tk -will work reliably or not, so you will need to do some experiments before -relying on it for regular work. . .SH REGULAR OPTIONS After the above threading options have been given, regular options can follow diff --git a/scripts/ipython_win_post_install.py b/scripts/ipython_win_post_install.py index fd11784..7769861 100755 --- a/scripts/ipython_win_post_install.py +++ b/scripts/ipython_win_post_install.py @@ -62,12 +62,8 @@ def install(): cmd = '"%s" -p sh' % ipybase mkshortcut(python,'IPython (command prompt mode)',link,cmd) - link = pjoin(ip_start_menu, 'pylab.lnk') - cmd = '"%s" -pylab' % ipybase - mkshortcut(python,'IPython (PyLab mode)',link,cmd) - link = pjoin(ip_start_menu, 'scipy.lnk') - cmd = '"%s" -pylab -p scipy' % ipybase + cmd = '"%s" -p scipy' % ipybase mkshortcut(python,'IPython (scipy profile)',link,cmd) link = pjoin(ip_start_menu, 'IPython test suite.lnk') diff --git a/test/test_shell_options.py b/test/test_shell_options.py deleted file mode 100755 index fd00112..0000000 --- a/test/test_shell_options.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python -"""A few unit tests for the Shell module. -""" - -from unittest import TestCase, main - -from IPython import Shell - -try: - import matplotlib - has_matplotlib = True -except ImportError: - has_matplotlib = False - -class ShellTestBase(TestCase): - def _test(self,argv,ans): - shell = Shell._select_shell(argv) - err = 'Got %s != %s' % (shell,ans) - self.failUnlessEqual(shell,ans,err) - -class ArgsTestCase(ShellTestBase): - def test_plain(self): - self._test([],Shell.IPShell) - - def test_tkthread(self): - self._test(['-tkthread'],Shell.IPShell) - - def test_gthread(self): - self._test(['-gthread'],Shell.IPShellGTK) - - def test_qthread(self): - self._test(['-qthread'],Shell.IPShellQt) - - def test_q4thread(self): - self._test(['-q4thread'],Shell.IPShellQt4) - - def test_wthread(self): - self._test(['-wthread'],Shell.IPShellWX) - -if has_matplotlib: - class MplArgsTestCase(ShellTestBase): - def setUp(self): - self.backend = matplotlib.rcParams['backend'] - - def tearDown(self): - matplotlib.rcParams['backend'] = self.backend - - def _test(self,argv,ans): - shell = Shell._select_shell(argv) - err = 'Got %s != %s' % (shell,ans) - self.failUnlessEqual(shell,ans,err) - - def test_tk(self): - matplotlib.rcParams['backend'] = 'TkAgg' - self._test(['-pylab'],Shell.IPShellMatplotlib) - - def test_ps(self): - matplotlib.rcParams['backend'] = 'PS' - self._test(['-pylab'],Shell.IPShellMatplotlib) - - def test_gtk(self): - matplotlib.rcParams['backend'] = 'GTKAgg' - self._test(['-pylab'],Shell.IPShellMatplotlibGTK) - - def test_gtk_2(self): - self._test(['-gthread','-pylab'],Shell.IPShellMatplotlibGTK) - self.failUnlessEqual(matplotlib.rcParams['backend'],'GTKAgg') - - def test_qt(self): - matplotlib.rcParams['backend'] = 'QtAgg' - self._test(['-pylab'],Shell.IPShellMatplotlibQt) - - def test_qt_2(self): - self._test(['-qthread','-pylab'],Shell.IPShellMatplotlibQt) - self.failUnlessEqual(matplotlib.rcParams['backend'],'QtAgg') - - def test_qt4(self): - matplotlib.rcParams['backend'] = 'Qt4Agg' - self._test(['-pylab'],Shell.IPShellMatplotlibQt4) - - def test_qt4_2(self): - self._test(['-q4thread','-pylab'],Shell.IPShellMatplotlibQt4) - self.failUnlessEqual(matplotlib.rcParams['backend'],'Qt4Agg') - - def test_wx(self): - matplotlib.rcParams['backend'] = 'WxAgg' - self._test(['-pylab'],Shell.IPShellMatplotlibWX) - - def test_wx_2(self): - self._test(['-pylab','-wthread'],Shell.IPShellMatplotlibWX) - self.failUnlessEqual(matplotlib.rcParams['backend'],'WXAgg') - - -main()