diff --git a/IPython/Shell.py b/IPython/Shell.py index 8c5a8c3..67f3655 100644 --- a/IPython/Shell.py +++ b/IPython/Shell.py @@ -4,7 +4,7 @@ All the matplotlib support code was co-developed with John Hunter, matplotlib's author. -$Id: Shell.py 965 2005-12-28 23:23:09Z fperez $""" +$Id: Shell.py 993 2006-01-04 19:51:01Z fperez $""" #***************************************************************************** # Copyright (C) 2001-2004 Fernando Perez @@ -625,9 +625,9 @@ class IPShellGTK(threading.Thread): if self.gtk.pygtk_version >= (2,4,0): import gobject - gobject.idle_add(self.on_timer) + gobject.timeout_add(self.TIMEOUT, self.on_timer) else: - self.gtk.idle_add(self.on_timer) + self.gtk.timeout_add(self.TIMEOUT, self.on_timer) if sys.platform != 'win32': try: diff --git a/IPython/iplib.py b/IPython/iplib.py index 8d05b7d..0ba8abd 100644 --- a/IPython/iplib.py +++ b/IPython/iplib.py @@ -6,7 +6,7 @@ Requires Python 2.1 or newer. This file contains all the classes and helper functions specific to IPython. -$Id: iplib.py 990 2006-01-04 06:59:02Z fperez $ +$Id: iplib.py 993 2006-01-04 19:51:01Z fperez $ """ #***************************************************************************** @@ -472,7 +472,7 @@ class InteractiveShell(object,Magic): # RegExp to identify potential function names self.re_fun_name = re.compile(r'[a-zA-Z_]([a-zA-Z0-9_.]*) *$') # RegExp to exclude strings with this start from autocalling - self.re_exclude_auto = re.compile('^[!=()\[\]<>,\*/\+-]|^is ') + self.re_exclude_auto = re.compile('^[!=()<>,\*/\+-]|^is ') # try to catch also methods for stuff in lists/tuples/dicts: off # (experimental). For this to work, the line_split regexp would need @@ -1942,9 +1942,9 @@ want to merge them back into the new files.""" % locals() # We only apply it to argument-less calls if the autocall # parameter is set to 2. We only need to check that autocall is < # 2, since this function isn't called unless it's at least 1. - if not theRest and self.rc.autocall < 2: - newcmd = '%s %s' % (iFun,theRest) - auto_rewrite = False + if not theRest and (self.rc.autocall < 2): + newcmd = '%s %s' % (iFun,theRest) + auto_rewrite = False else: if theRest.startswith('['): if hasattr(obj,'__getitem__'): diff --git a/doc/ChangeLog b/doc/ChangeLog index aea95da..e6c390a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,13 @@ 2006-01-04 Fernando Perez + * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK + backend for matplotlib (100% cpu utiliziation). Thanks to Charlie + Moad for help with tracking it down. + + * IPython/iplib.py (handle_auto): fix autocall handling for + objects which support BOTH __getitem__ and __call__ (so that f [x] + is left alone, instead of becoming f([x]) automatically). + * IPython/Magic.py (magic_cd): fix crash when cd -b was used. Ville's patch.