##// END OF EJS Templates
Arnd's wxversion support.
fperez -
Show More
@@ -4,7 +4,7 b''
4 4 All the matplotlib support code was co-developed with John Hunter,
5 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 10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
@@ -668,6 +668,26 b' class IPShellWX(threading.Thread):'
668 668 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
669 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 691 import wxPython.wx as wx
672 692
673 693 threading.Thread.__init__(self)
@@ -677,11 +697,7 b' class IPShellWX(threading.Thread):'
677 697 # Allows us to use both Tk and GTK.
678 698 self.tk = get_tk()
679 699
680 self.IP = make_IPython(argv,user_ns=user_ns,
681 user_global_ns=user_global_ns,
682 debug=debug,
683 shell_class=shell_class,
684 on_kill=[self.wxexit])
700
685 701 # HACK: slot for banner in self; it will be passed to the mainloop
686 702 # method only and .run() needs it. The actual value will be set by
687 703 # .mainloop().
@@ -1,5 +1,5 b''
1 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 b' xmode Context'
330 330
331 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 344 # Section: Readline configuration (readline is not available for MS-Windows)
335 345
@@ -27,7 +27,7 b' IPython tries to:'
27 27
28 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 33 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
@@ -38,8 +38,8 b' $Id: __init__.py 775 2005-09-01 20:24:59Z fperez $"""'
38 38
39 39 # Enforce proper version requirements
40 40 import sys
41 if sys.version[0:3] < '2.2':
42 raise ImportError, 'Python Version 2.2 or above is required.'
41 if sys.version[0:3] < '2.3':
42 raise ImportError, 'Python Version 2.3 or above is required.'
43 43
44 44 # Define what gets imported with a 'from IPython import *'
45 45 __all__ = ['deep_reload','genutils','ultraTB','DPyGetOpt','Itpl','hooks',
@@ -6,7 +6,7 b' Requires Python 2.1 or better.'
6 6
7 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 12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
@@ -159,6 +159,7 b" object? -> Details about 'object'. ?object also works, ?? prints more."
159 159 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
160 160 'magic_docstrings system_verbose! '
161 161 'multi_line_specials! '
162 'wxversion=s '
162 163 'autoedit_syntax!')
163 164
164 165 # Options that can *only* appear at the cmd line (not in rcfiles).
@@ -222,6 +223,7 b" object? -> Details about 'object'. ?object also works, ?? prints more."
222 223 Version = 0,
223 224 xmode = 'Verbose',
224 225 wildcards_case_sensitive = 1,
226 wxversion = '0',
225 227 magic_docstrings = 0, # undocumented, for doc generation
226 228 )
227 229
@@ -6,7 +6,7 b''
6 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 11 from IPython import Release
12 12 __author__ = '%s <%s>' % Release.authors['Fernando']
@@ -67,6 +67,11 b' SPECIAL THREADING OPTIONS'
67 67 essentially the same functionality, respectively for GTK, QT and
68 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 75 If -pylab is given, IPython loads special support for the mat-
71 76 plotlib library (http://matplotlib.sourceforge.net), allowing
72 77 interactive usage of any of its backends as defined in the
@@ -380,6 +385,11 b' REGULAR OPTIONS'
380 385 -Version
381 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 393 -xmode <modename>
384 394 Mode for exception reporting. The valid modes are Plain, Con-
385 395 text, and Verbose.
@@ -1,5 +1,10 b''
1 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 8 * IPython/iplib.py (embed_mainloop): fix tab-completion in
4 9 embedded instances, for variables defined at the interactive
5 10 prompt of the embedded ipython. Reported by Arnd.
@@ -50,6 +50,12 b' three provide essentially the same functionality, respectively for GTK, QT and'
50 50 WXWidgets (via their Python interfaces).
51 51 .br
52 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 59 If \-pylab is given, IPython loads special support for the matplotlib library
54 60 (http://matplotlib.sourceforge.net), allowing interactive usage of any of its
55 61 backends as defined in the user's .matplotlibrc file. It automatically
@@ -357,6 +363,11 b' have in your personal files.'
357 363 .B \-Version
358 364 Print version information and exit.
359 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 371 .B \-xmode <modename>
361 372 Mode for exception reporting. The valid modes are Plain, Context, and
362 373 Verbose.
@@ -164,6 +164,12 b' Offer a flexible framework which can be used as the base environment for'
164 164 other systems with Python as the underlying language.
165 165 Specifically scientific environments like Mathematica, IDL and Matlab inspired
166 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 173 \layout Subsection
168 174
169 175 Main features
@@ -176,7 +182,26 b' Dynamic object introspection.'
176 182 \family typewriter
177 183 ?
178 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 205 \layout Itemize
181 206
182 207 Completion in the local namespace, by typing TAB at the prompt.
@@ -207,10 +232,6 b' Complete system shell access.'
207 232 !! captures shell output into python variables for further use.
208 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 235 Background execution of Python commands in a separate thread.
215 236 IPython has an internal job manager called
216 237 \family typewriter
@@ -255,15 +276,35 b' Filesystem navigation, via a magic'
255 276 ) for fast access to frequently visited directories.
256 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 287 Automatic indentation (optional) of code as you type (through the readline
259 288 library).
260 289 \layout Itemize
261 290
262 291 Macro system for quickly re-executing multiple lines of previous input with
263 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 303 \layout Itemize
265 304
266 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 308 \layout Itemize
268 309
269 310 Session restoring: logs can be replayed to restore a previous session to
@@ -405,12 +446,10 b' Portability and Python requirements'
405 446 \series bold
406 447 Python requirements:
407 448 \series default
408 IPython works with Python version 2.2 or newer.
409 It has been tested with Python 2.4 and no problems have been reported.
410 Support for Python 2.1 hasn't been recently tested, since I don't have access
411 to it on any of my systems.
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.
449 IPython requires with Python version 2.3 or newer.
450 If you are still using Python 2.2 and can not upgrade, the last version
451 of IPython which worked with Python 2.2 was 0.6.15, so you will have to use
452 that.
414 453 \layout Standard
415 454
416 455 IPython is developed under
@@ -465,12 +504,22 b' Windows 9x support is present, and has been reported to work fine (at least'
465 504 on WinME).
466 505 \layout Standard
467 506
468 Please note, however, that I have very little access to and experience with
469 Windows development.
470 For this reason, Windows-specific bugs tend to linger far longer than I
471 would like, and often I just can't find a satisfactory solution.
472 If any Windows user wants to join in with development help, all hands are
473 always welcome.
507 Note, that I have very little access to and experience with Windows development.
508 However, an excellent group of Win32 users (led by Ville Vainio), consistenly
509 contribute bugfixes and platform-specific enhancements, so they more than
510 make up for my deficiencies on that front.
511 In fact, Win32 users report using IPython as a system shell (see Sec.\SpecialChar ~
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 523 \layout Subsection
475 524
476 525 Location
@@ -481,7 +530,7 b' IPython is generously hosted at'
481 530
482 531 \end_inset
483 532
484 by the SciPy project.
533 by the Enthought, Inc and the SciPy project.
485 534 This site offers downloads, subversion access, mailing lists and a bug
486 535 tracking system.
487 536 I am very grateful to Enthought (
@@ -2476,6 +2525,21 b' one'
2476 2525 \labelwidthstring 00.00.0000
2477 2526
2478 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 2543 If
2480 2544 \family typewriter
2481 2545 -pylab
@@ -3452,7 +3516,24 b' IPYTHONDIR'
3452 3516
3453 3517 \family typewriter
3454 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 3537 \series default
3457 3538 :
3458 3539 \family default
@@ -6778,6 +6859,11 b' from IPython.Extensions.PhysicalQInteractive import *'
6778 6859 import IPython.Extensions.PhysicalQInput
6779 6860 \layout Section
6780 6861
6862
6863 \begin_inset LatexCommand \label{sec:IPython-as-shell}
6864
6865 \end_inset
6866
6781 6867 IPython as a system shell
6782 6868 \layout Standard
6783 6869
General Comments 0
You need to be logged in to leave comments. Login now