##// END OF EJS Templates
Arnd's wxversion support.
fperez -
r91:0122992c
parent child
Show More
@@ -4,7 +4,7
4 All the matplotlib support code was co-developed with John Hunter,
4 All the matplotlib support code was co-developed with John Hunter,
5 matplotlib's author.
5 matplotlib's author.
6
6
7 $Id: Shell.py 994 2006-01-08 08:29:44Z fperez $"""
7 $Id: Shell.py 998 2006-01-09 06:57:40Z fperez $"""
8
8
9 #*****************************************************************************
9 #*****************************************************************************
10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
@@ -668,6 +668,26 class IPShellWX(threading.Thread):
668 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
668 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
669 debug=1,shell_class=MTInteractiveShell):
669 debug=1,shell_class=MTInteractiveShell):
670
670
671 self.IP = make_IPython(argv,user_ns=user_ns,
672 user_global_ns=user_global_ns,
673 debug=debug,
674 shell_class=shell_class,
675 on_kill=[self.wxexit])
676
677 wantedwxversion=self.IP.rc.wxversion
678 if wantedwxversion!="0":
679 try:
680 import wxversion
681 except ImportError:
682 error('The wxversion module is needed for WX version selection')
683 else:
684 try:
685 wxversion.select(wantedwxversion)
686 except:
687 self.IP.InteractiveTB()
688 error('Requested wxPython version %s could not be loaded' %
689 wantedwxversion)
690
671 import wxPython.wx as wx
691 import wxPython.wx as wx
672
692
673 threading.Thread.__init__(self)
693 threading.Thread.__init__(self)
@@ -677,11 +697,7 class IPShellWX(threading.Thread):
677 # Allows us to use both Tk and GTK.
697 # Allows us to use both Tk and GTK.
678 self.tk = get_tk()
698 self.tk = get_tk()
679
699
680 self.IP = make_IPython(argv,user_ns=user_ns,
700
681 user_global_ns=user_global_ns,
682 debug=debug,
683 shell_class=shell_class,
684 on_kill=[self.wxexit])
685 # HACK: slot for banner in self; it will be passed to the mainloop
701 # HACK: slot for banner in self; it will be passed to the mainloop
686 # method only and .run() needs it. The actual value will be set by
702 # method only and .run() needs it. The actual value will be set by
687 # .mainloop().
703 # .mainloop().
@@ -1,5 +1,5
1 # -*- Mode: Shell-Script -*- Not really, but shows comments correctly
1 # -*- Mode: Shell-Script -*- Not really, but shows comments correctly
2 # $Id: ipythonrc 990 2006-01-04 06:59:02Z fperez $
2 # $Id: ipythonrc 998 2006-01-09 06:57:40Z fperez $
3
3
4 #***************************************************************************
4 #***************************************************************************
5 #
5 #
@@ -330,6 +330,16 xmode Context
330
330
331 multi_line_specials 1
331 multi_line_specials 1
332
332
333 # wxversion: request a specific wxPython version (used for -wthread)
334
335 # Set this to the value of wxPython you want to use, but note that this
336 # feature requires you to have the wxversion Python module to work. If you
337 # don't have the wxversion module (try 'import wxversion' at the prompt to
338 # check) or simply want to leave the system to pick up the default, leave this
339 # variable at 0.
340
341 wxversion 0
342
333 #---------------------------------------------------------------------------
343 #---------------------------------------------------------------------------
334 # Section: Readline configuration (readline is not available for MS-Windows)
344 # Section: Readline configuration (readline is not available for MS-Windows)
335
345
@@ -27,7 +27,7 IPython tries to:
27
27
28 IPython requires Python 2.2 or newer.
28 IPython requires Python 2.2 or newer.
29
29
30 $Id: __init__.py 775 2005-09-01 20:24:59Z fperez $"""
30 $Id: __init__.py 998 2006-01-09 06:57:40Z fperez $"""
31
31
32 #*****************************************************************************
32 #*****************************************************************************
33 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
33 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
@@ -38,8 +38,8 $Id: __init__.py 775 2005-09-01 20:24:59Z fperez $"""
38
38
39 # Enforce proper version requirements
39 # Enforce proper version requirements
40 import sys
40 import sys
41 if sys.version[0:3] < '2.2':
41 if sys.version[0:3] < '2.3':
42 raise ImportError, 'Python Version 2.2 or above is required.'
42 raise ImportError, 'Python Version 2.3 or above is required.'
43
43
44 # Define what gets imported with a 'from IPython import *'
44 # Define what gets imported with a 'from IPython import *'
45 __all__ = ['deep_reload','genutils','ultraTB','DPyGetOpt','Itpl','hooks',
45 __all__ = ['deep_reload','genutils','ultraTB','DPyGetOpt','Itpl','hooks',
@@ -6,7 +6,7 Requires Python 2.1 or better.
6
6
7 This file contains the main make_IPython() starter function.
7 This file contains the main make_IPython() starter function.
8
8
9 $Id: ipmaker.py 994 2006-01-08 08:29:44Z fperez $"""
9 $Id: ipmaker.py 998 2006-01-09 06:57:40Z fperez $"""
10
10
11 #*****************************************************************************
11 #*****************************************************************************
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
@@ -159,6 +159,7 object? -> Details about 'object'. ?object also works, ?? prints more.
159 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
159 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
160 'magic_docstrings system_verbose! '
160 'magic_docstrings system_verbose! '
161 'multi_line_specials! '
161 'multi_line_specials! '
162 'wxversion=s '
162 'autoedit_syntax!')
163 'autoedit_syntax!')
163
164
164 # Options that can *only* appear at the cmd line (not in rcfiles).
165 # Options that can *only* appear at the cmd line (not in rcfiles).
@@ -222,6 +223,7 object? -> Details about 'object'. ?object also works, ?? prints more.
222 Version = 0,
223 Version = 0,
223 xmode = 'Verbose',
224 xmode = 'Verbose',
224 wildcards_case_sensitive = 1,
225 wildcards_case_sensitive = 1,
226 wxversion = '0',
225 magic_docstrings = 0, # undocumented, for doc generation
227 magic_docstrings = 0, # undocumented, for doc generation
226 )
228 )
227
229
@@ -6,7 +6,7
6 # the file COPYING, distributed as part of this software.
6 # the file COPYING, distributed as part of this software.
7 #*****************************************************************************
7 #*****************************************************************************
8
8
9 # $Id: usage.py 990 2006-01-04 06:59:02Z fperez $
9 # $Id: usage.py 998 2006-01-09 06:57:40Z fperez $
10
10
11 from IPython import Release
11 from IPython import Release
12 __author__ = '%s <%s>' % Release.authors['Fernando']
12 __author__ = '%s <%s>' % Release.authors['Fernando']
@@ -67,6 +67,11 SPECIAL THREADING OPTIONS
67 essentially the same functionality, respectively for GTK, QT and
67 essentially the same functionality, respectively for GTK, QT and
68 WXWidgets (via their Python interfaces).
68 WXWidgets (via their Python interfaces).
69
69
70 Note that with -wthread, you can additionally use the -wxversion
71 option to request a specific version of wx to be used. This
72 requires that you have the 'wxversion' Python module installed,
73 which is part of recent wxPython distributions.
74
70 If -pylab is given, IPython loads special support for the mat-
75 If -pylab is given, IPython loads special support for the mat-
71 plotlib library (http://matplotlib.sourceforge.net), allowing
76 plotlib library (http://matplotlib.sourceforge.net), allowing
72 interactive usage of any of its backends as defined in the
77 interactive usage of any of its backends as defined in the
@@ -380,6 +385,11 REGULAR OPTIONS
380 -Version
385 -Version
381 Print version information and exit.
386 Print version information and exit.
382
387
388 -wxversion <string>
389 Select a specific version of wxPython (used in conjunction with
390 -wthread). Requires the wxversion module, part of recent
391 wxPython distributions.
392
383 -xmode <modename>
393 -xmode <modename>
384 Mode for exception reporting. The valid modes are Plain, Con-
394 Mode for exception reporting. The valid modes are Plain, Con-
385 text, and Verbose.
395 text, and Verbose.
@@ -1,5 +1,10
1 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2
2
3 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
4 version selection (new -wxversion command line and ipythonrc
5 parameter). Patch contributed by Arnd Baecker
6 <arnd.baecker-AT-web.de>.
7
3 * IPython/iplib.py (embed_mainloop): fix tab-completion in
8 * IPython/iplib.py (embed_mainloop): fix tab-completion in
4 embedded instances, for variables defined at the interactive
9 embedded instances, for variables defined at the interactive
5 prompt of the embedded ipython. Reported by Arnd.
10 prompt of the embedded ipython. Reported by Arnd.
@@ -50,6 +50,12 three provide essentially the same functionality, respectively for GTK, QT and
50 WXWidgets (via their Python interfaces).
50 WXWidgets (via their Python interfaces).
51 .br
51 .br
52 .sp 1
52 .sp 1
53 Note that with \-wthread, you can additionally use the \-wxversion option to
54 request a specific version of wx to be used. This requires that you have the
55 'wxversion' Python module installed, which is part of recent wxPython
56 distributions.
57 .br
58 .sp 1
53 If \-pylab is given, IPython loads special support for the matplotlib library
59 If \-pylab is given, IPython loads special support for the matplotlib library
54 (http://matplotlib.sourceforge.net), allowing interactive usage of any of its
60 (http://matplotlib.sourceforge.net), allowing interactive usage of any of its
55 backends as defined in the user's .matplotlibrc file. It automatically
61 backends as defined in the user's .matplotlibrc file. It automatically
@@ -357,6 +363,11 have in your personal files.
357 .B \-Version
363 .B \-Version
358 Print version information and exit.
364 Print version information and exit.
359 .TP
365 .TP
366 .B -wxversion <string>
367 Select a specific version of wxPython (used in conjunction with
368 \-wthread). Requires the wxversion module, part of recent wxPython
369 distributions.
370 .TP
360 .B \-xmode <modename>
371 .B \-xmode <modename>
361 Mode for exception reporting. The valid modes are Plain, Context, and
372 Mode for exception reporting. The valid modes are Plain, Context, and
362 Verbose.
373 Verbose.
@@ -164,6 +164,12 Offer a flexible framework which can be used as the base environment for
164 other systems with Python as the underlying language.
164 other systems with Python as the underlying language.
165 Specifically scientific environments like Mathematica, IDL and Matlab inspired
165 Specifically scientific environments like Mathematica, IDL and Matlab inspired
166 its design, but similar ideas can be useful in many fields.
166 its design, but similar ideas can be useful in many fields.
167 \layout Enumerate
168
169 Allow interactive testing of threaded graphical toolkits.
170 IPython has support for interactive, non-blocking control of GTK, Qt and
171 WX applications via special threading flags.
172 The normal Python shell can only do this for Tkinter applications.
167 \layout Subsection
173 \layout Subsection
168
174
169 Main features
175 Main features
@@ -176,7 +182,26 Dynamic object introspection.
176 \family typewriter
182 \family typewriter
177 ?
183 ?
178 \family default
184 \family default
179 ').
185 ', and using `
186 \family typewriter
187 ??
188 \family default
189 ' provides additional detail).
190 \layout Itemize
191
192 Searching through modules and namespaces with `
193 \family typewriter
194 *
195 \family default
196 ' wildcards, both when using the `
197 \family typewriter
198 ?
199 \family default
200 ' system and via the
201 \family typewriter
202 %psearch
203 \family default
204 command.
180 \layout Itemize
205 \layout Itemize
181
206
182 Completion in the local namespace, by typing TAB at the prompt.
207 Completion in the local namespace, by typing TAB at the prompt.
@@ -207,10 +232,6 Complete system shell access.
207 !! captures shell output into python variables for further use.
232 !! captures shell output into python variables for further use.
208 \layout Itemize
233 \layout Itemize
209
234
210 All calls to the system (via aliases or via !) have their standard output/error
211 automatically stored as strings, and also available as lists.
212 \layout Itemize
213
214 Background execution of Python commands in a separate thread.
235 Background execution of Python commands in a separate thread.
215 IPython has an internal job manager called
236 IPython has an internal job manager called
216 \family typewriter
237 \family typewriter
@@ -255,15 +276,35 Filesystem navigation, via a magic
255 ) for fast access to frequently visited directories.
276 ) for fast access to frequently visited directories.
256 \layout Itemize
277 \layout Itemize
257
278
279 A lightweight persistence framework via the
280 \family typewriter
281 %store
282 \family default
283 command, which allows you to save arbitrary Python variables.
284 These get restored automatically when your session restarts.
285 \layout Itemize
286
258 Automatic indentation (optional) of code as you type (through the readline
287 Automatic indentation (optional) of code as you type (through the readline
259 library).
288 library).
260 \layout Itemize
289 \layout Itemize
261
290
262 Macro system for quickly re-executing multiple lines of previous input with
291 Macro system for quickly re-executing multiple lines of previous input with
263 a single name.
292 a single name.
293 Macros can be stored persistently via
294 \family typewriter
295 %store
296 \family default
297 and edited via
298 \family typewriter
299 %edit
300 \family default
301 .
302
264 \layout Itemize
303 \layout Itemize
265
304
266 Session logging (you can then later use these logs as code in your programs).
305 Session logging (you can then later use these logs as code in your programs).
306 Logs can optionally timestamp all input, and also store session output
307 (marked as comments, so the log remains valid Python source code).
267 \layout Itemize
308 \layout Itemize
268
309
269 Session restoring: logs can be replayed to restore a previous session to
310 Session restoring: logs can be replayed to restore a previous session to
@@ -405,12 +446,10 Portability and Python requirements
405 \series bold
446 \series bold
406 Python requirements:
447 Python requirements:
407 \series default
448 \series default
408 IPython works with Python version 2.2 or newer.
449 IPython requires with Python version 2.3 or newer.
409 It has been tested with Python 2.4 and no problems have been reported.
450 If you are still using Python 2.2 and can not upgrade, the last version
410 Support for Python 2.1 hasn't been recently tested, since I don't have access
451 of IPython which worked with Python 2.2 was 0.6.15, so you will have to use
411 to it on any of my systems.
452 that.
412 But I suspect there may be some problems with Python 2.1, because some of
413 the newer code may use 2.2 features.
414 \layout Standard
453 \layout Standard
415
454
416 IPython is developed under
455 IPython is developed under
@@ -465,12 +504,22 Windows 9x support is present, and has been reported to work fine (at least
465 on WinME).
504 on WinME).
466 \layout Standard
505 \layout Standard
467
506
468 Please note, however, that I have very little access to and experience with
507 Note, that I have very little access to and experience with Windows development.
469 Windows development.
508 However, an excellent group of Win32 users (led by Ville Vainio), consistenly
470 For this reason, Windows-specific bugs tend to linger far longer than I
509 contribute bugfixes and platform-specific enhancements, so they more than
471 would like, and often I just can't find a satisfactory solution.
510 make up for my deficiencies on that front.
472 If any Windows user wants to join in with development help, all hands are
511 In fact, Win32 users report using IPython as a system shell (see Sec.\SpecialChar ~
473 always welcome.
512
513 \begin_inset LatexCommand \ref{sec:IPython-as-shell}
514
515 \end_inset
516
517 for details), as it offers a level of control and features which the default
518
519 \family typewriter
520 cmd.exe
521 \family default
522 doesn't provide.
474 \layout Subsection
523 \layout Subsection
475
524
476 Location
525 Location
@@ -481,7 +530,7 IPython is generously hosted at
481
530
482 \end_inset
531 \end_inset
483
532
484 by the SciPy project.
533 by the Enthought, Inc and the SciPy project.
485 This site offers downloads, subversion access, mailing lists and a bug
534 This site offers downloads, subversion access, mailing lists and a bug
486 tracking system.
535 tracking system.
487 I am very grateful to Enthought (
536 I am very grateful to Enthought (
@@ -2476,6 +2525,21 one
2476 \labelwidthstring 00.00.0000
2525 \labelwidthstring 00.00.0000
2477
2526
2478 \SpecialChar ~
2527 \SpecialChar ~
2528 Note that with
2529 \family typewriter
2530 -wthread
2531 \family default
2532 , you can additionally use the -wxversion option to request a specific version
2533 of wx to be used.
2534 This requires that you have the
2535 \family typewriter
2536 wxversion
2537 \family default
2538 Python module installed, which is part of recent wxPython distributions.
2539 \layout List
2540 \labelwidthstring 00.00.0000
2541
2542 \SpecialChar ~
2479 If
2543 If
2480 \family typewriter
2544 \family typewriter
2481 -pylab
2545 -pylab
@@ -3452,7 +3516,24 IPYTHONDIR
3452
3516
3453 \family typewriter
3517 \family typewriter
3454 \series bold
3518 \series bold
3455 -xmode <modename>
3519 -wxversion\SpecialChar ~
3520 <string>:
3521 \family default
3522 \series default
3523 Select a specific version of wxPython (used in conjunction with
3524 \family typewriter
3525 -wthread
3526 \family default
3527 ).
3528 Requires the wxversion module, part of recent wxPython distributions
3529 \layout List
3530 \labelwidthstring 00.00.0000
3531
3532
3533 \family typewriter
3534 \series bold
3535 -xmode\SpecialChar ~
3536 <modename>
3456 \series default
3537 \series default
3457 :
3538 :
3458 \family default
3539 \family default
@@ -6778,6 +6859,11 from IPython.Extensions.PhysicalQInteractive import *
6778 import IPython.Extensions.PhysicalQInput
6859 import IPython.Extensions.PhysicalQInput
6779 \layout Section
6860 \layout Section
6780
6861
6862
6863 \begin_inset LatexCommand \label{sec:IPython-as-shell}
6864
6865 \end_inset
6866
6781 IPython as a system shell
6867 IPython as a system shell
6782 \layout Standard
6868 \layout Standard
6783
6869
General Comments 0
You need to be logged in to leave comments. Login now