Show More
@@ -4,7 +4,7 b'' | |||||
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 92 |
|
7 | $Id: Shell.py 927 2005-12-08 23:19:59Z fperez $""" | |
8 |
|
8 | |||
9 | #***************************************************************************** |
|
9 | #***************************************************************************** | |
10 | # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu> |
|
10 | # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu> | |
@@ -599,14 +599,22 b' class IPShellGTK(threading.Thread):' | |||||
599 | self.IP = make_IPython(argv,user_ns=user_ns,debug=debug, |
|
599 | self.IP = make_IPython(argv,user_ns=user_ns,debug=debug, | |
600 | shell_class=shell_class, |
|
600 | shell_class=shell_class, | |
601 | on_kill=[mainquit]) |
|
601 | on_kill=[mainquit]) | |
|
602 | ||||
|
603 | # HACK: slot for banner in self; it will be passed to the mainloop | |||
|
604 | # method only and .run() needs it. The actual value will be set by | |||
|
605 | # .mainloop(). | |||
|
606 | self._banner = None | |||
|
607 | ||||
602 | threading.Thread.__init__(self) |
|
608 | threading.Thread.__init__(self) | |
603 |
|
609 | |||
604 | def run(self): |
|
610 | def run(self): | |
605 | self.IP.mainloop() |
|
611 | self.IP.mainloop(self._banner) | |
606 | self.IP.kill() |
|
612 | self.IP.kill() | |
607 |
|
613 | |||
608 | def mainloop(self): |
|
614 | def mainloop(self,sys_exit=0,banner=None): | |
609 |
|
615 | |||
|
616 | self._banner = banner | |||
|
617 | ||||
610 | if self.gtk.pygtk_version >= (2,4,0): |
|
618 | if self.gtk.pygtk_version >= (2,4,0): | |
611 | import gobject |
|
619 | import gobject | |
612 | gobject.idle_add(self.on_timer) |
|
620 | gobject.idle_add(self.on_timer) | |
@@ -664,6 +672,11 b' class IPShellWX(threading.Thread):' | |||||
664 | self.IP = make_IPython(argv,user_ns=user_ns,debug=debug, |
|
672 | self.IP = make_IPython(argv,user_ns=user_ns,debug=debug, | |
665 | shell_class=shell_class, |
|
673 | shell_class=shell_class, | |
666 | on_kill=[self.wxexit]) |
|
674 | on_kill=[self.wxexit]) | |
|
675 | # HACK: slot for banner in self; it will be passed to the mainloop | |||
|
676 | # method only and .run() needs it. The actual value will be set by | |||
|
677 | # .mainloop(). | |||
|
678 | self._banner = None | |||
|
679 | ||||
667 | self.app = None |
|
680 | self.app = None | |
668 |
|
681 | |||
669 | def wxexit(self, *args): |
|
682 | def wxexit(self, *args): | |
@@ -672,10 +685,12 b' class IPShellWX(threading.Thread):' | |||||
672 | self.app.ExitMainLoop() |
|
685 | self.app.ExitMainLoop() | |
673 |
|
686 | |||
674 | def run(self): |
|
687 | def run(self): | |
675 | self.IP.mainloop() |
|
688 | self.IP.mainloop(self._banner) | |
676 | self.IP.kill() |
|
689 | self.IP.kill() | |
677 |
|
690 | |||
678 | def mainloop(self): |
|
691 | def mainloop(self,sys_exit=0,banner=None): | |
|
692 | ||||
|
693 | self._banner = banner | |||
679 |
|
694 | |||
680 | self.start() |
|
695 | self.start() | |
681 |
|
696 | |||
@@ -750,18 +765,26 b' class IPShellQt(threading.Thread):' | |||||
750 | self.IP = make_IPython(argv,user_ns=user_ns,debug=debug, |
|
765 | self.IP = make_IPython(argv,user_ns=user_ns,debug=debug, | |
751 | shell_class=shell_class, |
|
766 | shell_class=shell_class, | |
752 | on_kill=[qt.qApp.exit]) |
|
767 | on_kill=[qt.qApp.exit]) | |
|
768 | ||||
|
769 | # HACK: slot for banner in self; it will be passed to the mainloop | |||
|
770 | # method only and .run() needs it. The actual value will be set by | |||
|
771 | # .mainloop(). | |||
|
772 | self._banner = None | |||
753 |
|
773 | |||
754 | threading.Thread.__init__(self) |
|
774 | threading.Thread.__init__(self) | |
755 |
|
775 | |||
756 | def run(self): |
|
776 | def run(self): | |
757 | #sys.excepthook = self.IP.excepthook # dbg |
|
777 | self.IP.mainloop(self._banner) | |
758 | self.IP.mainloop() |
|
|||
759 | self.IP.kill() |
|
778 | self.IP.kill() | |
760 |
|
779 | |||
761 | def mainloop(self): |
|
780 | def mainloop(self,sys_exit=0,banner=None): | |
762 | import qt, sys |
|
781 | ||
|
782 | import qt | |||
|
783 | ||||
|
784 | self._banner = banner | |||
|
785 | ||||
763 | if qt.QApplication.startingUp(): |
|
786 | if qt.QApplication.startingUp(): | |
764 |
a = qt.QApplication.QApplication( |
|
787 | a = qt.QApplication.QApplication(sys.argv) | |
765 | self.timer = qt.QTimer() |
|
788 | self.timer = qt.QTimer() | |
766 | qt.QObject.connect( self.timer, qt.SIGNAL( 'timeout()' ), self.on_timer ) |
|
789 | qt.QObject.connect( self.timer, qt.SIGNAL( 'timeout()' ), self.on_timer ) | |
767 |
|
790 |
@@ -1,3 +1,10 b'' | |||||
|
1 | 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu> | |||
|
2 | ||||
|
3 | * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling | |||
|
4 | sequence to consistently accept the banner argument. The | |||
|
5 | inconsistency was tripping SAGE, thanks to Gary Zablackis | |||
|
6 | <gzabl-AT-yahoo.com> for the report. | |||
|
7 | ||||
1 | 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu> |
|
8 | 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu> | |
2 |
|
9 | |||
3 | * IPython/iplib.py (InteractiveShell.post_config_initialization): |
|
10 | * IPython/iplib.py (InteractiveShell.post_config_initialization): |
@@ -347,8 +347,12 b' Embeddable.' | |||||
347 | \layout Itemize |
|
347 | \layout Itemize | |
348 |
|
348 | |||
349 | Easy debugger access. |
|
349 | Easy debugger access. | |
350 |
You can set IPython to call up the Python debugger |
|
350 | You can set IPython to call up an enhanced version of the Python debugger | |
351 | is an uncaught exception. |
|
351 | ( | |
|
352 | \family typewriter | |||
|
353 | pdb | |||
|
354 | \family default | |||
|
355 | ) every time there is an uncaught exception. | |||
352 | This drops you inside the code which triggered the exception with all the |
|
356 | This drops you inside the code which triggered the exception with all the | |
353 | data live and it is possible to navigate the stack to rapidly isolate the |
|
357 | data live and it is possible to navigate the stack to rapidly isolate the | |
354 | source of a bug. |
|
358 | source of a bug. | |
@@ -365,6 +369,12 b' Easy debugger access.' | |||||
365 | pdb |
|
369 | pdb | |
366 | \family default |
|
370 | \family default | |
367 | 's control, automatically setting initial breakpoints for you. |
|
371 | 's control, automatically setting initial breakpoints for you. | |
|
372 | This version of | |||
|
373 | \family typewriter | |||
|
374 | pdb | |||
|
375 | \family default | |||
|
376 | has IPython-specific improvements, including tab-completion and traceback | |||
|
377 | coloring support. | |||
368 | \layout Itemize |
|
378 | \layout Itemize | |
369 |
|
379 | |||
370 | Profiler support. |
|
380 | Profiler support. | |
@@ -2058,9 +2068,17 b' Thanks to Christian Hart and Matthew Arnison for the suggestions leading' | |||||
2058 | \family typewriter |
|
2068 | \family typewriter | |
2059 | %pdb |
|
2069 | %pdb | |
2060 | \family default |
|
2070 | \family default | |
2061 |
command allows you to toggle on and off the automatic invocation of |
|
2071 | command allows you to toggle on and off the automatic invocation of an | |
2062 | pdb debugger at any uncaught exception. |
|
2072 | IPython-enhanced | |
2063 | The advantage of this is that pdb starts |
|
2073 | \family typewriter | |
|
2074 | pdb | |||
|
2075 | \family default | |||
|
2076 | debugger (with coloring, tab completion and more) at any uncaught exception. | |||
|
2077 | The advantage of this is that | |||
|
2078 | \family typewriter | |||
|
2079 | pdb | |||
|
2080 | \family default | |||
|
2081 | starts | |||
2064 | \emph on |
|
2082 | \emph on | |
2065 | inside |
|
2083 | inside | |
2066 | \emph default |
|
2084 | \emph default | |
@@ -9092,4 +9110,15 b' Stenarson' | |||||
9092 | <jorgen.stenarson-AT-bostream.nu> |
|
9110 | <jorgen.stenarson-AT-bostream.nu> | |
9093 | \family default |
|
9111 | \family default | |
9094 | Wildcard support implementation for searching namespaces. |
|
9112 | Wildcard support implementation for searching namespaces. | |
|
9113 | \layout List | |||
|
9114 | \labelwidthstring 00.00.0000 | |||
|
9115 | ||||
|
9116 | Vivian\SpecialChar ~ | |||
|
9117 | De\SpecialChar ~ | |||
|
9118 | Smedt | |||
|
9119 | \family typewriter | |||
|
9120 | <vivian-AT-vdesmedt.com> | |||
|
9121 | \family default | |||
|
9122 | Debugger enhancements, so that when pdb is activated from within IPython, | |||
|
9123 | coloring, tab completion and other features continue to work seamlessly. | |||
9095 | \the_end |
|
9124 | \the_end |
General Comments 0
You need to be logged in to leave comments.
Login now