##// END OF EJS Templates
Close issue 41, remove obsolete gtk 1.x code, trap os.getcwd exceptions at...
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 703 2005-08-16 17:34:44Z fperez $"""
7 $Id: Shell.py 802 2005-09-06 03:49:12Z fperez $"""
8 8
9 9 #*****************************************************************************
10 10 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
@@ -561,9 +561,6 b' def hijack_gtk():'
561 561 """Modifies pyGTK's mainloop with a dummy so user code does not
562 562 block IPython. This function returns the original `gtk.mainloop`
563 563 function that has been hijacked.
564
565 NOTE: Make sure you import this *AFTER* you call
566 pygtk.require(...).
567 564 """
568 565 def dummy_mainloop(*args, **kw):
569 566 pass
@@ -592,8 +589,6 b' class IPShellGTK(threading.Thread):'
592 589 def __init__(self,argv=None,user_ns=None,debug=1,
593 590 shell_class=MTInteractiveShell):
594 591
595 import pygtk
596 pygtk.require("2.0")
597 592 import gtk
598 593
599 594 self.gtk = gtk
@@ -6,7 +6,7 b' Requires Python 2.1 or newer.'
6 6
7 7 This file contains all the classes and helper functions specific to IPython.
8 8
9 $Id: iplib.py 774 2005-09-01 00:27:53Z fperez $
9 $Id: iplib.py 802 2005-09-06 03:49:12Z fperez $
10 10 """
11 11
12 12 #*****************************************************************************
@@ -590,7 +590,10 b' class InteractiveShell(code.InteractiveConsole, Logger, Magic):'
590 590 self.input_hist = InputList(['\n'])
591 591
592 592 # list of visited directories
593 self.dir_hist = [os.getcwd()]
593 try:
594 self.dir_hist = [os.getcwd()]
595 except IOError, e:
596 self.dir_hist = []
594 597
595 598 # dict of output history
596 599 self.output_hist = {}
@@ -600,11 +603,14 b' class InteractiveShell(code.InteractiveConsole, Logger, Magic):'
600 603 # number of positional arguments of the alias.
601 604 self.alias_table = {}
602 605
603 # dict of things NOT to alias (keywords and builtins)
604 self.no_alias = {}
605 for key in keyword.kwlist:
606 self.no_alias[key] = 1
607 self.no_alias.update(__builtin__.__dict__)
606 # dict of things NOT to alias (keywords, builtins and some special magics)
607 no_alias = {}
608 no_alias_magics = ['cd','popd','pushd','dhist','alias','unalias']
609 for key in keyword.kwlist + no_alias_magics:
610 no_alias[key] = 1
611 no_alias.update(__builtin__.__dict__)
612 self.no_alias = no_alias
613
608 614
609 615 # make global variables for user access to these
610 616 self.user_ns['_ih'] = self.input_hist
@@ -953,7 +959,7 b' class InteractiveShell(code.InteractiveConsole, Logger, Magic):'
953 959 In particular, make sure no Python keywords/builtins are in it."""
954 960
955 961 no_alias = self.no_alias
956 for k in self.alias_table.keys():
962 for k in self.alias_table:
957 963 if k in no_alias:
958 964 del self.alias_table[k]
959 965 if verbose:
@@ -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 638 2005-07-18 03:01:41Z fperez $"""
9 $Id: ipmaker.py 802 2005-09-06 03:49:12Z fperez $"""
10 10
11 11 #*****************************************************************************
12 12 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
@@ -194,9 +194,9 b" object? -> Details about 'object'. ?object also works, ?? prints more."
194 194 pdb = 0,
195 195 pprint = 0,
196 196 profile = '',
197 prompt_in1 = 'In [\\#]:',
198 prompt_in2 = ' .\\D.:',
199 prompt_out = 'Out[\\#]:',
197 prompt_in1 = 'In [\\#]: ',
198 prompt_in2 = ' .\\D.: ',
199 prompt_out = 'Out[\\#]: ',
200 200 prompts_pad_left = 1,
201 201 quick = 0,
202 202 readline = 1,
@@ -1,3 +1,16 b''
1 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
4 calls. These were a leftover from the GTK 1.x days, and can cause
5 problems in certain cases (after a report by John Hunter).
6
7 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
8 os.getcwd() fails at init time. Thanks to patch from David Remahl
9 <chmod007 AT mac.com>.
10 (InteractiveShell.__init__): prevent certain special magics from
11 being shadowed by aliases. Closes
12 http://www.scipy.net/roundup/ipython/issue41.
13
1 14 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2 15
3 16 * IPython/iplib.py (InteractiveShell.complete): Added new
General Comments 0
You need to be logged in to leave comments. Login now