##// END OF EJS Templates
merge remote
Fernando Perez -
r1226:c5dce4c7 merge
parent child Browse files
Show More
@@ -1,183 +1,184 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 %store magic for lightweight persistence.
3 %store magic for lightweight persistence.
4
4
5 Stores variables, aliases etc. in PickleShare database.
5 Stores variables, aliases etc. in PickleShare database.
6
6
7 $Id: iplib.py 1107 2006-01-30 19:02:20Z vivainio $
7 $Id: iplib.py 1107 2006-01-30 19:02:20Z vivainio $
8 """
8 """
9
9
10 import IPython.ipapi
10 import IPython.ipapi
11 from IPython.ipapi import UsageError
11 ip = IPython.ipapi.get()
12 ip = IPython.ipapi.get()
12
13
13 import pickleshare
14 import pickleshare
14
15
15 import inspect,pickle,os,sys,textwrap
16 import inspect,pickle,os,sys,textwrap
16 from IPython.FakeModule import FakeModule
17 from IPython.FakeModule import FakeModule
17
18
18 def restore_aliases(self):
19 def restore_aliases(self):
19 ip = self.getapi()
20 ip = self.getapi()
20 staliases = ip.db.get('stored_aliases', {})
21 staliases = ip.db.get('stored_aliases', {})
21 for k,v in staliases.items():
22 for k,v in staliases.items():
22 #print "restore alias",k,v # dbg
23 #print "restore alias",k,v # dbg
23 #self.alias_table[k] = v
24 #self.alias_table[k] = v
24 ip.defalias(k,v)
25 ip.defalias(k,v)
25
26
26
27
27 def refresh_variables(ip):
28 def refresh_variables(ip):
28 db = ip.db
29 db = ip.db
29 for key in db.keys('autorestore/*'):
30 for key in db.keys('autorestore/*'):
30 # strip autorestore
31 # strip autorestore
31 justkey = os.path.basename(key)
32 justkey = os.path.basename(key)
32 try:
33 try:
33 obj = db[key]
34 obj = db[key]
34 except KeyError:
35 except KeyError:
35 print "Unable to restore variable '%s', ignoring (use %%store -d to forget!)" % justkey
36 print "Unable to restore variable '%s', ignoring (use %%store -d to forget!)" % justkey
36 print "The error was:",sys.exc_info()[0]
37 print "The error was:",sys.exc_info()[0]
37 else:
38 else:
38 #print "restored",justkey,"=",obj #dbg
39 #print "restored",justkey,"=",obj #dbg
39 ip.user_ns[justkey] = obj
40 ip.user_ns[justkey] = obj
40
41
41
42
42 def restore_dhist(ip):
43 def restore_dhist(ip):
43 db = ip.db
44 db = ip.db
44 ip.user_ns['_dh'] = db.get('dhist',[])
45 ip.user_ns['_dh'] = db.get('dhist',[])
45
46
46 def restore_data(self):
47 def restore_data(self):
47 ip = self.getapi()
48 ip = self.getapi()
48 refresh_variables(ip)
49 refresh_variables(ip)
49 restore_aliases(self)
50 restore_aliases(self)
50 restore_dhist(self)
51 restore_dhist(self)
51 raise IPython.ipapi.TryNext
52 raise IPython.ipapi.TryNext
52
53
53 ip.set_hook('late_startup_hook', restore_data)
54 ip.set_hook('late_startup_hook', restore_data)
54
55
55 def magic_store(self, parameter_s=''):
56 def magic_store(self, parameter_s=''):
56 """Lightweight persistence for python variables.
57 """Lightweight persistence for python variables.
57
58
58 Example:
59 Example:
59
60
60 ville@badger[~]|1> A = ['hello',10,'world']\\
61 ville@badger[~]|1> A = ['hello',10,'world']\\
61 ville@badger[~]|2> %store A\\
62 ville@badger[~]|2> %store A\\
62 ville@badger[~]|3> Exit
63 ville@badger[~]|3> Exit
63
64
64 (IPython session is closed and started again...)
65 (IPython session is closed and started again...)
65
66
66 ville@badger:~$ ipython -p pysh\\
67 ville@badger:~$ ipython -p pysh\\
67 ville@badger[~]|1> print A
68 ville@badger[~]|1> print A
68
69
69 ['hello', 10, 'world']
70 ['hello', 10, 'world']
70
71
71 Usage:
72 Usage:
72
73
73 %store - Show list of all variables and their current values\\
74 %store - Show list of all variables and their current values\\
74 %store <var> - Store the *current* value of the variable to disk\\
75 %store <var> - Store the *current* value of the variable to disk\\
75 %store -d <var> - Remove the variable and its value from storage\\
76 %store -d <var> - Remove the variable and its value from storage\\
76 %store -z - Remove all variables from storage\\
77 %store -z - Remove all variables from storage\\
77 %store -r - Refresh all variables from store (delete current vals)\\
78 %store -r - Refresh all variables from store (delete current vals)\\
78 %store foo >a.txt - Store value of foo to new file a.txt\\
79 %store foo >a.txt - Store value of foo to new file a.txt\\
79 %store foo >>a.txt - Append value of foo to file a.txt\\
80 %store foo >>a.txt - Append value of foo to file a.txt\\
80
81
81 It should be noted that if you change the value of a variable, you
82 It should be noted that if you change the value of a variable, you
82 need to %store it again if you want to persist the new value.
83 need to %store it again if you want to persist the new value.
83
84
84 Note also that the variables will need to be pickleable; most basic
85 Note also that the variables will need to be pickleable; most basic
85 python types can be safely %stored.
86 python types can be safely %stored.
86
87
87 Also aliases can be %store'd across sessions.
88 Also aliases can be %store'd across sessions.
88 """
89 """
89
90
90 opts,argsl = self.parse_options(parameter_s,'drz',mode='string')
91 opts,argsl = self.parse_options(parameter_s,'drz',mode='string')
91 args = argsl.split(None,1)
92 args = argsl.split(None,1)
92 ip = self.getapi()
93 ip = self.getapi()
93 db = ip.db
94 db = ip.db
94 # delete
95 # delete
95 if opts.has_key('d'):
96 if opts.has_key('d'):
96 try:
97 try:
97 todel = args[0]
98 todel = args[0]
98 except IndexError:
99 except IndexError:
99 error('You must provide the variable to forget')
100 raise UsageError('You must provide the variable to forget')
100 else:
101 else:
101 try:
102 try:
102 del db['autorestore/' + todel]
103 del db['autorestore/' + todel]
103 except:
104 except:
104 error("Can't delete variable '%s'" % todel)
105 raise UsageError("Can't delete variable '%s'" % todel)
105 # reset
106 # reset
106 elif opts.has_key('z'):
107 elif opts.has_key('z'):
107 for k in db.keys('autorestore/*'):
108 for k in db.keys('autorestore/*'):
108 del db[k]
109 del db[k]
109
110
110 elif opts.has_key('r'):
111 elif opts.has_key('r'):
111 refresh_variables(ip)
112 refresh_variables(ip)
112
113
113
114
114 # run without arguments -> list variables & values
115 # run without arguments -> list variables & values
115 elif not args:
116 elif not args:
116 vars = self.db.keys('autorestore/*')
117 vars = self.db.keys('autorestore/*')
117 vars.sort()
118 vars.sort()
118 if vars:
119 if vars:
119 size = max(map(len,vars))
120 size = max(map(len,vars))
120 else:
121 else:
121 size = 0
122 size = 0
122
123
123 print 'Stored variables and their in-db values:'
124 print 'Stored variables and their in-db values:'
124 fmt = '%-'+str(size)+'s -> %s'
125 fmt = '%-'+str(size)+'s -> %s'
125 get = db.get
126 get = db.get
126 for var in vars:
127 for var in vars:
127 justkey = os.path.basename(var)
128 justkey = os.path.basename(var)
128 # print 30 first characters from every var
129 # print 30 first characters from every var
129 print fmt % (justkey,repr(get(var,'<unavailable>'))[:50])
130 print fmt % (justkey,repr(get(var,'<unavailable>'))[:50])
130
131
131 # default action - store the variable
132 # default action - store the variable
132 else:
133 else:
133 # %store foo >file.txt or >>file.txt
134 # %store foo >file.txt or >>file.txt
134 if len(args) > 1 and args[1].startswith('>'):
135 if len(args) > 1 and args[1].startswith('>'):
135 fnam = os.path.expanduser(args[1].lstrip('>').lstrip())
136 fnam = os.path.expanduser(args[1].lstrip('>').lstrip())
136 if args[1].startswith('>>'):
137 if args[1].startswith('>>'):
137 fil = open(fnam,'a')
138 fil = open(fnam,'a')
138 else:
139 else:
139 fil = open(fnam,'w')
140 fil = open(fnam,'w')
140 obj = ip.ev(args[0])
141 obj = ip.ev(args[0])
141 print "Writing '%s' (%s) to file '%s'." % (args[0],
142 print "Writing '%s' (%s) to file '%s'." % (args[0],
142 obj.__class__.__name__, fnam)
143 obj.__class__.__name__, fnam)
143
144
144
145
145 if not isinstance (obj,basestring):
146 if not isinstance (obj,basestring):
146 from pprint import pprint
147 from pprint import pprint
147 pprint(obj,fil)
148 pprint(obj,fil)
148 else:
149 else:
149 fil.write(obj)
150 fil.write(obj)
150 if not obj.endswith('\n'):
151 if not obj.endswith('\n'):
151 fil.write('\n')
152 fil.write('\n')
152
153
153 fil.close()
154 fil.close()
154 return
155 return
155
156
156 # %store foo
157 # %store foo
157 try:
158 try:
158 obj = ip.user_ns[args[0]]
159 obj = ip.user_ns[args[0]]
159 except KeyError:
160 except KeyError:
160 # it might be an alias
161 # it might be an alias
161 if args[0] in self.alias_table:
162 if args[0] in self.alias_table:
162 staliases = db.get('stored_aliases',{})
163 staliases = db.get('stored_aliases',{})
163 staliases[ args[0] ] = self.alias_table[ args[0] ]
164 staliases[ args[0] ] = self.alias_table[ args[0] ]
164 db['stored_aliases'] = staliases
165 db['stored_aliases'] = staliases
165 print "Alias stored:", args[0], self.alias_table[ args[0] ]
166 print "Alias stored:", args[0], self.alias_table[ args[0] ]
166 return
167 return
167 else:
168 else:
168 print "Error: unknown variable '%s'" % args[0]
169 raise UsageError("Unknown variable '%s'" % args[0])
169
170
170 else:
171 else:
171 if isinstance(inspect.getmodule(obj), FakeModule):
172 if isinstance(inspect.getmodule(obj), FakeModule):
172 print textwrap.dedent("""\
173 print textwrap.dedent("""\
173 Warning:%s is %s
174 Warning:%s is %s
174 Proper storage of interactively declared classes (or instances
175 Proper storage of interactively declared classes (or instances
175 of those classes) is not possible! Only instances
176 of those classes) is not possible! Only instances
176 of classes in real modules on file system can be %%store'd.
177 of classes in real modules on file system can be %%store'd.
177 """ % (args[0], obj) )
178 """ % (args[0], obj) )
178 return
179 return
179 #pickled = pickle.dumps(obj)
180 #pickled = pickle.dumps(obj)
180 self.db[ 'autorestore/' + args[0] ] = obj
181 self.db[ 'autorestore/' + args[0] ] = obj
181 print "Stored '%s' (%s)" % (args[0], obj.__class__.__name__)
182 print "Stored '%s' (%s)" % (args[0], obj.__class__.__name__)
182
183
183 ip.expose_magic('store',magic_store)
184 ip.expose_magic('store',magic_store)
@@ -1,460 +1,465 b''
1 #!/usr/bin/python
1 #!/usr/bin/python
2 # -*- coding: iso-8859-15 -*-
2 # -*- coding: iso-8859-15 -*-
3 '''
3 '''
4 Provides IPython remote instance.
4 Provides IPython remote instance.
5
5
6 @author: Laurent Dufrechou
6 @author: Laurent Dufrechou
7 laurent.dufrechou _at_ gmail.com
7 laurent.dufrechou _at_ gmail.com
8 @license: BSD
8 @license: BSD
9
9
10 All rights reserved. This program and the accompanying materials are made
10 All rights reserved. This program and the accompanying materials are made
11 available under the terms of the BSD which accompanies this distribution, and
11 available under the terms of the BSD which accompanies this distribution, and
12 is available at U{http://www.opensource.org/licenses/bsd-license.php}
12 is available at U{http://www.opensource.org/licenses/bsd-license.php}
13 '''
13 '''
14
14
15 __version__ = 0.9
15 __version__ = 0.9
16 __author__ = "Laurent Dufrechou"
16 __author__ = "Laurent Dufrechou"
17 __email__ = "laurent.dufrechou _at_ gmail.com"
17 __email__ = "laurent.dufrechou _at_ gmail.com"
18 __license__ = "BSD"
18 __license__ = "BSD"
19
19
20 import re
20 import re
21 import sys
21 import sys
22 import os
22 import os
23 import locale
23 import locale
24 import time
25 import pydoc,__builtin__,site
26 from thread_ex import ThreadEx
24 from thread_ex import ThreadEx
27 from StringIO import StringIO
28
25
29 try:
26 try:
30 import IPython
27 import IPython
31 except Exception,e:
28 except Exception,e:
32 raise "Error importing IPython (%s)" % str(e)
29 print "Error importing IPython (%s)" % str(e)
30 raise Exception, e
33
31
34 ##############################################################################
32 ##############################################################################
35 class _Helper(object):
33 class _Helper(object):
36 """Redefine the built-in 'help'.
34 """Redefine the built-in 'help'.
37 This is a wrapper around pydoc.help (with a twist).
35 This is a wrapper around pydoc.help (with a twist).
38 """
36 """
39
37
40 def __init__(self,pager):
38 def __init__(self, pager):
41 self._pager = pager
39 self._pager = pager
42
40
43 def __repr__(self):
41 def __repr__(self):
44 return "Type help() for interactive help, " \
42 return "Type help() for interactive help, " \
45 "or help(object) for help about object."
43 "or help(object) for help about object."
46
44
47 def __call__(self, *args, **kwds):
45 def __call__(self, *args, **kwds):
48 class DummyWriter(object):
46 class DummyWriter(object):
49 def __init__(self,pager):
47 '''Dumy class to handle help output'''
48 def __init__(self, pager):
50 self._pager = pager
49 self._pager = pager
51
50
52 def write(self,data):
51 def write(self, data):
52 '''hook to fill self._pager'''
53 self._pager(data)
53 self._pager(data)
54
54
55 import pydoc
55 import pydoc
56 pydoc.help.output = DummyWriter(self._pager)
56 pydoc.help.output = DummyWriter(self._pager)
57 pydoc.help.interact = lambda :1
57 pydoc.help.interact = lambda :1
58
58
59 return pydoc.help(*args, **kwds)
59 return pydoc.help(*args, **kwds)
60
60
61
61
62 ##############################################################################
62 ##############################################################################
63 class _CodeExecutor(ThreadEx):
63 class _CodeExecutor(ThreadEx):
64
64 ''' Thread that execute ipython code '''
65 def __init__(self, instance, after):
65 def __init__(self, instance, after):
66 ThreadEx.__init__(self)
66 ThreadEx.__init__(self)
67 self.instance = instance
67 self.instance = instance
68 self._afterExecute=after
68 self._afterExecute = after
69
69
70 def run(self):
70 def run(self):
71 '''Thread main loop'''
71 try:
72 try:
72 self.instance._doc_text = None
73 self.instance._doc_text = None
73 self.instance._help_text = None
74 self.instance._help_text = None
74 self.instance._execute()
75 self.instance._execute()
75 # used for uper class to generate event after execution
76 # used for uper class to generate event after execution
76 self._afterExecute()
77 self._afterExecute()
77
78
78 except KeyboardInterrupt:
79 except KeyboardInterrupt:
79 pass
80 pass
80
81
81
82
82 ##############################################################################
83 ##############################################################################
83 class NonBlockingIPShell(object):
84 class NonBlockingIPShell(object):
84 '''
85 '''
85 Create an IPython instance, running the commands in a separate,
86 Create an IPython instance, running the commands in a separate,
86 non-blocking thread.
87 non-blocking thread.
87 This allows embedding in any GUI without blockage.
88 This allows embedding in any GUI without blockage.
88
89
89 Note: The ThreadEx class supports asynchroneous function call
90 Note: The ThreadEx class supports asynchroneous function call
90 via raise_exc()
91 via raise_exc()
91 '''
92 '''
92
93
93 def __init__(self,argv=[],user_ns={},user_global_ns=None,
94 def __init__(self, argv=[], user_ns={}, user_global_ns=None,
94 cin=None, cout=None, cerr=None,
95 cin=None, cout=None, cerr=None,
95 ask_exit_handler=None):
96 ask_exit_handler=None):
96 '''
97 '''
97 @param argv: Command line options for IPython
98 @param argv: Command line options for IPython
98 @type argv: list
99 @type argv: list
99 @param user_ns: User namespace.
100 @param user_ns: User namespace.
100 @type user_ns: dictionary
101 @type user_ns: dictionary
101 @param user_global_ns: User global namespace.
102 @param user_global_ns: User global namespace.
102 @type user_global_ns: dictionary.
103 @type user_global_ns: dictionary.
103 @param cin: Console standard input.
104 @param cin: Console standard input.
104 @type cin: IO stream
105 @type cin: IO stream
105 @param cout: Console standard output.
106 @param cout: Console standard output.
106 @type cout: IO stream
107 @type cout: IO stream
107 @param cerr: Console standard error.
108 @param cerr: Console standard error.
108 @type cerr: IO stream
109 @type cerr: IO stream
109 @param exit_handler: Replacement for builtin exit() function
110 @param exit_handler: Replacement for builtin exit() function
110 @type exit_handler: function
111 @type exit_handler: function
111 @param time_loop: Define the sleep time between two thread's loop
112 @param time_loop: Define the sleep time between two thread's loop
112 @type int
113 @type int
113 '''
114 '''
114 #ipython0 initialisation
115 #ipython0 initialisation
116 self._IP = None
117 self._term = None
115 self.initIpython0(argv, user_ns, user_global_ns,
118 self.initIpython0(argv, user_ns, user_global_ns,
116 cin, cout, cerr,
119 cin, cout, cerr,
117 ask_exit_handler)
120 ask_exit_handler)
118
121
119 #vars used by _execute
122 #vars used by _execute
120 self._iter_more = 0
123 self._iter_more = 0
121 self._history_level = 0
124 self._history_level = 0
122 self._complete_sep = re.compile('[\s\{\}\[\]\(\)\=]')
125 self._complete_sep = re.compile('[\s\{\}\[\]\(\)\=]')
123 self._prompt = str(self._IP.outputcache.prompt1).strip()
126 self._prompt = str(self._IP.outputcache.prompt1).strip()
124
127
125 #thread working vars
128 #thread working vars
126 self._line_to_execute = ''
129 self._line_to_execute = ''
127
130
128 #vars that will be checked by GUI loop to handle thread states...
131 #vars that will be checked by GUI loop to handle thread states...
129 #will be replaced later by PostEvent GUI funtions...
132 #will be replaced later by PostEvent GUI funtions...
130 self._doc_text = None
133 self._doc_text = None
131 self._help_text = None
134 self._help_text = None
132 self._add_button = None
135 self._add_button = None
133
136
134 def initIpython0(self, argv=[], user_ns={}, user_global_ns=None,
137 def initIpython0(self, argv=[], user_ns={}, user_global_ns=None,
135 cin=None, cout=None, cerr=None,
138 cin=None, cout=None, cerr=None,
136 ask_exit_handler=None):
139 ask_exit_handler=None):
140 ''' Initialize an ithon0 instance '''
141
137 #first we redefine in/out/error functions of IPython
142 #first we redefine in/out/error functions of IPython
138 if cin:
143 if cin:
139 IPython.Shell.Term.cin = cin
144 IPython.Shell.Term.cin = cin
140 if cout:
145 if cout:
141 IPython.Shell.Term.cout = cout
146 IPython.Shell.Term.cout = cout
142 if cerr:
147 if cerr:
143 IPython.Shell.Term.cerr = cerr
148 IPython.Shell.Term.cerr = cerr
144
149
145 # This is to get rid of the blockage that accurs during
150 # This is to get rid of the blockage that accurs during
146 # IPython.Shell.InteractiveShell.user_setup()
151 # IPython.Shell.InteractiveShell.user_setup()
147 IPython.iplib.raw_input = lambda x: None
152 IPython.iplib.raw_input = lambda x: None
148
153
149 self._term = IPython.genutils.IOTerm(cin=cin, cout=cout, cerr=cerr)
154 self._term = IPython.genutils.IOTerm(cin=cin, cout=cout, cerr=cerr)
150
155
151 excepthook = sys.excepthook
156 excepthook = sys.excepthook
152
157
153 self._IP = IPython.Shell.make_IPython(
158 self._IP = IPython.Shell.make_IPython(
154 argv,user_ns=user_ns,
159 argv,user_ns=user_ns,
155 user_global_ns=user_global_ns,
160 user_global_ns=user_global_ns,
156 embedded=True,
161 embedded=True,
157 shell_class=IPython.Shell.InteractiveShell)
162 shell_class=IPython.Shell.InteractiveShell)
158
163
159 #we replace IPython default encoding by wx locale encoding
164 #we replace IPython default encoding by wx locale encoding
160 loc = locale.getpreferredencoding()
165 loc = locale.getpreferredencoding()
161 if loc:
166 if loc:
162 self._IP.stdin_encoding = loc
167 self._IP.stdin_encoding = loc
163 #we replace the ipython default pager by our pager
168 #we replace the ipython default pager by our pager
164 self._IP.set_hook('show_in_pager',self._pager)
169 self._IP.set_hook('show_in_pager', self._pager)
165
170
166 #we replace the ipython default shell command caller by our shell handler
171 #we replace the ipython default shell command caller by our shell handler
167 self._IP.set_hook('shell_hook',self._shell)
172 self._IP.set_hook('shell_hook', self._shell)
168
173
169 #we replace the ipython default input command caller by our method
174 #we replace the ipython default input command caller by our method
170 IPython.iplib.raw_input_original = self._raw_input
175 IPython.iplib.raw_input_original = self._raw_input
171 #we replace the ipython default exit command by our method
176 #we replace the ipython default exit command by our method
172 self._IP.exit = ask_exit_handler
177 self._IP.exit = ask_exit_handler
173 #we replace the help command
178 #we replace the help command
174 self._IP.user_ns['help'] = _Helper(self._pager_help)
179 self._IP.user_ns['help'] = _Helper(self._pager_help)
175
180
176 #we disable cpase magic... until we found a way to use it properly.
181 #we disable cpase magic... until we found a way to use it properly.
177 #import IPython.ipapi
182 #import IPython.ipapi
178 ip = IPython.ipapi.get()
183 ip = IPython.ipapi.get()
179 def bypassMagic(self, arg):
184 def bypassMagic(self, arg):
180 print '%this magic is currently disabled.'
185 print '%this magic is currently disabled.'
181 ip.expose_magic('cpaste', bypassMagic)
186 ip.expose_magic('cpaste', bypassMagic)
182
187
183 sys.excepthook = excepthook
188 sys.excepthook = excepthook
184
189
185 #----------------------- Thread management section ----------------------
190 #----------------------- Thread management section ----------------------
186 def doExecute(self,line):
191 def doExecute(self, line):
187 """
192 """
188 Tell the thread to process the 'line' command
193 Tell the thread to process the 'line' command
189 """
194 """
190
195
191 self._line_to_execute = line
196 self._line_to_execute = line
192 #we launch the ipython line execution in a thread to make it interruptible
197 #we launch the ipython line execution in a thread to make it interruptible
193 self.ce = _CodeExecutor(self,self._afterExecute)
198 ce = _CodeExecutor(self, self._afterExecute)
194 self.ce.start()
199 ce.start()
195
200
196 #----------------------- IPython management section ----------------------
201 #----------------------- IPython management section ----------------------
197 def getDocText(self):
202 def getDocText(self):
198 """
203 """
199 Returns the output of the processing that need to be paged (if any)
204 Returns the output of the processing that need to be paged (if any)
200
205
201 @return: The std output string.
206 @return: The std output string.
202 @rtype: string
207 @rtype: string
203 """
208 """
204 return self._doc_text
209 return self._doc_text
205
210
206 def getHelpText(self):
211 def getHelpText(self):
207 """
212 """
208 Returns the output of the processing that need to be paged via help pager(if any)
213 Returns the output of the processing that need to be paged via help pager(if any)
209
214
210 @return: The std output string.
215 @return: The std output string.
211 @rtype: string
216 @rtype: string
212 """
217 """
213 return self._help_text
218 return self._help_text
214
219
215 def getBanner(self):
220 def getBanner(self):
216 """
221 """
217 Returns the IPython banner for useful info on IPython instance
222 Returns the IPython banner for useful info on IPython instance
218
223
219 @return: The banner string.
224 @return: The banner string.
220 @rtype: string
225 @rtype: string
221 """
226 """
222 return self._IP.BANNER
227 return self._IP.BANNER
223
228
224 def getPromptCount(self):
229 def getPromptCount(self):
225 """
230 """
226 Returns the prompt number.
231 Returns the prompt number.
227 Each time a user execute a line in the IPython shell the prompt count is increased
232 Each time a user execute a line in the IPython shell the prompt count is increased
228
233
229 @return: The prompt number
234 @return: The prompt number
230 @rtype: int
235 @rtype: int
231 """
236 """
232 return self._IP.outputcache.prompt_count
237 return self._IP.outputcache.prompt_count
233
238
234 def getPrompt(self):
239 def getPrompt(self):
235 """
240 """
236 Returns current prompt inside IPython instance
241 Returns current prompt inside IPython instance
237 (Can be In [...]: ot ...:)
242 (Can be In [...]: ot ...:)
238
243
239 @return: The current prompt.
244 @return: The current prompt.
240 @rtype: string
245 @rtype: string
241 """
246 """
242 return self._prompt
247 return self._prompt
243
248
244 def getIndentation(self):
249 def getIndentation(self):
245 """
250 """
246 Returns the current indentation level
251 Returns the current indentation level
247 Usefull to put the caret at the good start position if we want to do autoindentation.
252 Usefull to put the caret at the good start position if we want to do autoindentation.
248
253
249 @return: The indentation level.
254 @return: The indentation level.
250 @rtype: int
255 @rtype: int
251 """
256 """
252 return self._IP.indent_current_nsp
257 return self._IP.indent_current_nsp
253
258
254 def updateNamespace(self, ns_dict):
259 def updateNamespace(self, ns_dict):
255 '''
260 '''
256 Add the current dictionary to the shell namespace.
261 Add the current dictionary to the shell namespace.
257
262
258 @param ns_dict: A dictionary of symbol-values.
263 @param ns_dict: A dictionary of symbol-values.
259 @type ns_dict: dictionary
264 @type ns_dict: dictionary
260 '''
265 '''
261 self._IP.user_ns.update(ns_dict)
266 self._IP.user_ns.update(ns_dict)
262
267
263 def complete(self, line):
268 def complete(self, line):
264 '''
269 '''
265 Returns an auto completed line and/or posibilities for completion.
270 Returns an auto completed line and/or posibilities for completion.
266
271
267 @param line: Given line so far.
272 @param line: Given line so far.
268 @type line: string
273 @type line: string
269
274
270 @return: Line completed as for as possible,
275 @return: Line completed as for as possible,
271 and possible further completions.
276 and possible further completions.
272 @rtype: tuple
277 @rtype: tuple
273 '''
278 '''
274 split_line = self._complete_sep.split(line)
279 split_line = self._complete_sep.split(line)
275 possibilities = self._IP.complete(split_line[-1])
280 possibilities = self._IP.complete(split_line[-1])
276 if possibilities:
281 if possibilities:
277
282
278 def _commonPrefix(str1, str2):
283 def _commonPrefix(str1, str2):
279 '''
284 '''
280 Reduction function. returns common prefix of two given strings.
285 Reduction function. returns common prefix of two given strings.
281
286
282 @param str1: First string.
287 @param str1: First string.
283 @type str1: string
288 @type str1: string
284 @param str2: Second string
289 @param str2: Second string
285 @type str2: string
290 @type str2: string
286
291
287 @return: Common prefix to both strings.
292 @return: Common prefix to both strings.
288 @rtype: string
293 @rtype: string
289 '''
294 '''
290 for i in range(len(str1)):
295 for i in range(len(str1)):
291 if not str2.startswith(str1[:i+1]):
296 if not str2.startswith(str1[:i+1]):
292 return str1[:i]
297 return str1[:i]
293 return str1
298 return str1
294 common_prefix = reduce(_commonPrefix, possibilities)
299 common_prefix = reduce(_commonPrefix, possibilities)
295 completed = line[:-len(split_line[-1])]+common_prefix
300 completed = line[:-len(split_line[-1])]+common_prefix
296 else:
301 else:
297 completed = line
302 completed = line
298 return completed, possibilities
303 return completed, possibilities
299
304
300 def historyBack(self):
305 def historyBack(self):
301 '''
306 '''
302 Provides one history command back.
307 Provides one history command back.
303
308
304 @return: The command string.
309 @return: The command string.
305 @rtype: string
310 @rtype: string
306 '''
311 '''
307 history = ''
312 history = ''
308 #the below while loop is used to suppress empty history lines
313 #the below while loop is used to suppress empty history lines
309 while((history == '' or history == '\n') and self._history_level >0):
314 while((history == '' or history == '\n') and self._history_level >0):
310 if self._history_level>=1:
315 if self._history_level >= 1:
311 self._history_level -= 1
316 self._history_level -= 1
312 history = self._getHistory()
317 history = self._getHistory()
313 return history
318 return history
314
319
315 def historyForward(self):
320 def historyForward(self):
316 '''
321 '''
317 Provides one history command forward.
322 Provides one history command forward.
318
323
319 @return: The command string.
324 @return: The command string.
320 @rtype: string
325 @rtype: string
321 '''
326 '''
322 history = ''
327 history = ''
323 #the below while loop is used to suppress empty history lines
328 #the below while loop is used to suppress empty history lines
324 while((history == '' or history == '\n') and self._history_level <= self._getHistoryMaxIndex()):
329 while((history == '' or history == '\n') \
325 if self._history_level < self._getHistoryMaxIndex():
330 and self._history_level <= self._getHistoryMaxIndex()):
326 self._history_level += 1
331 if self._history_level < self._getHistoryMaxIndex():
327 history = self._getHistory()
332 self._history_level += 1
333 history = self._getHistory()
334 else:
335 if self._history_level == self._getHistoryMaxIndex():
336 history = self._getHistory()
337 self._history_level += 1
328 else:
338 else:
329 if self._history_level == self._getHistoryMaxIndex():
339 history = ''
330 history = self._getHistory()
331 self._history_level += 1
332 else:
333 history = ''
334 return history
340 return history
335
341
336 def initHistoryIndex(self):
342 def initHistoryIndex(self):
337 '''
343 '''
338 set history to last command entered
344 set history to last command entered
339 '''
345 '''
340 self._history_level = self._getHistoryMaxIndex()+1
346 self._history_level = self._getHistoryMaxIndex()+1
341
347
342 #----------------------- IPython PRIVATE management section --------------
348 #----------------------- IPython PRIVATE management section --------------
343 def _afterExecute(self):
349 def _afterExecute(self):
344 '''
350 '''
345 Can be redefined to generate post event after excution is done
351 Can be redefined to generate post event after excution is done
346 '''
352 '''
347 pass
353 pass
348
354
349 #def _askExit(self):
355 #def _askExit(self):
350 # '''
356 # '''
351 # Can be redefined to generate post event to exit the Ipython shell
357 # Can be redefined to generate post event to exit the Ipython shell
352 # '''
358 # '''
353 # pass
359 # pass
354
360
355 def _getHistoryMaxIndex(self):
361 def _getHistoryMaxIndex(self):
356 '''
362 '''
357 returns the max length of the history buffer
363 returns the max length of the history buffer
358
364
359 @return: history length
365 @return: history length
360 @rtype: int
366 @rtype: int
361 '''
367 '''
362 return len(self._IP.input_hist_raw)-1
368 return len(self._IP.input_hist_raw)-1
363
369
364 def _getHistory(self):
370 def _getHistory(self):
365 '''
371 '''
366 Get's the command string of the current history level.
372 Get's the command string of the current history level.
367
373
368 @return: Historic command stri
374 @return: Historic command stri
369 @rtype: string
375 @rtype: string
370 '''
376 '''
371 rv = self._IP.input_hist_raw[self._history_level].strip('\n')
377 rv = self._IP.input_hist_raw[self._history_level].strip('\n')
372 return rv
378 return rv
373
379
374 def _pager_help(self,text):
380 def _pager_help(self, text):
375 '''
381 '''
376 This function is used as a callback replacment to IPython help pager function
382 This function is used as a callback replacment to IPython help pager function
377
383
378 It puts the 'text' value inside the self._help_text string that can be retrived via getHelpText
384 It puts the 'text' value inside the self._help_text string that can be retrived via
379 function.
385 getHelpText function.
380 '''
386 '''
381 if self._help_text == None:
387 if self._help_text == None:
382 self._help_text = text
388 self._help_text = text
383 else:
389 else:
384 self._help_text += text
390 self._help_text += text
385
391
386 def _pager(self,IP,text):
392 def _pager(self, IP, text):
387 '''
393 '''
388 This function is used as a callback replacment to IPython pager function
394 This function is used as a callback replacment to IPython pager function
389
395
390 It puts the 'text' value inside the self._doc_text string that can be retrived via getDocText
396 It puts the 'text' value inside the self._doc_text string that can be retrived via
391 function.
397 getDocText function.
392 '''
398 '''
393 self._doc_text = text
399 self._doc_text = text
394
400
395 def _raw_input(self, prompt=''):
401 def _raw_input(self, prompt=''):
396 '''
402 '''
397 Custom raw_input() replacement. Get's current line from console buffer.
403 Custom raw_input() replacement. Get's current line from console buffer.
398
404
399 @param prompt: Prompt to print. Here for compatability as replacement.
405 @param prompt: Prompt to print. Here for compatability as replacement.
400 @type prompt: string
406 @type prompt: string
401
407
402 @return: The current command line text.
408 @return: The current command line text.
403 @rtype: string
409 @rtype: string
404 '''
410 '''
405 return self._line_to_execute
411 return self._line_to_execute
406
412
407 def _execute(self):
413 def _execute(self):
408 '''
414 '''
409 Executes the current line provided by the shell object.
415 Executes the current line provided by the shell object.
410 '''
416 '''
411 orig_stdout = sys.stdout
417 orig_stdout = sys.stdout
412 sys.stdout = IPython.Shell.Term.cout
418 sys.stdout = IPython.Shell.Term.cout
413
419
414 try:
420 try:
415 line = self._IP.raw_input(None, self._iter_more)
421 line = self._IP.raw_input(None, self._iter_more)
416 if self._IP.autoindent:
422 if self._IP.autoindent:
417 self._IP.readline_startup_hook(None)
423 self._IP.readline_startup_hook(None)
418
424
419 except KeyboardInterrupt:
425 except KeyboardInterrupt:
420 self._IP.write('\nKeyboardInterrupt\n')
426 self._IP.write('\nKeyboardInterrupt\n')
421 self._IP.resetbuffer()
427 self._IP.resetbuffer()
422 # keep cache in sync with the prompt counter:
428 # keep cache in sync with the prompt counter:
423 self._IP.outputcache.prompt_count -= 1
429 self._IP.outputcache.prompt_count -= 1
424
430
425 if self._IP.autoindent:
431 if self._IP.autoindent:
426 self._IP.indent_current_nsp = 0
432 self._IP.indent_current_nsp = 0
427 self._iter_more = 0
433 self._iter_more = 0
428 except:
434 except:
429 self._IP.showtraceback()
435 self._IP.showtraceback()
430 else:
436 else:
431 self._iter_more = self._IP.push(line)
437 self._iter_more = self._IP.push(line)
432 if (self._IP.SyntaxTB.last_syntax_error and
438 if (self._IP.SyntaxTB.last_syntax_error and self._IP.rc.autoedit_syntax):
433 self._IP.rc.autoedit_syntax):
434 self._IP.edit_syntax_error()
439 self._IP.edit_syntax_error()
435 if self._iter_more:
440 if self._iter_more:
436 self._prompt = str(self._IP.outputcache.prompt2).strip()
441 self._prompt = str(self._IP.outputcache.prompt2).strip()
437 if self._IP.autoindent:
442 if self._IP.autoindent:
438 self._IP.readline_startup_hook(self._IP.pre_readline)
443 self._IP.readline_startup_hook(self._IP.pre_readline)
439 else:
444 else:
440 self._prompt = str(self._IP.outputcache.prompt1).strip()
445 self._prompt = str(self._IP.outputcache.prompt1).strip()
441 self._IP.indent_current_nsp = 0 #we set indentation to 0
446 self._IP.indent_current_nsp = 0 #we set indentation to 0
442 sys.stdout = orig_stdout
447 sys.stdout = orig_stdout
443
448
444 def _shell(self, ip, cmd):
449 def _shell(self, ip, cmd):
445 '''
450 '''
446 Replacement method to allow shell commands without them blocking.
451 Replacement method to allow shell commands without them blocking.
447
452
448 @param ip: Ipython instance, same as self._IP
453 @param ip: Ipython instance, same as self._IP
449 @type cmd: Ipython instance
454 @type cmd: Ipython instance
450 @param cmd: Shell command to execute.
455 @param cmd: Shell command to execute.
451 @type cmd: string
456 @type cmd: string
452 '''
457 '''
453 stdin, stdout = os.popen4(cmd)
458 stdin, stdout = os.popen4(cmd)
454 result = stdout.read().decode('cp437').encode(locale.getpreferredencoding())
459 result = stdout.read().decode('cp437').encode(locale.getpreferredencoding())
455 #we use print command because the shell command is called inside IPython instance and thus is
460 #we use print command because the shell command is called
456 #redirected to thread cout
461 #inside IPython instance and thus is redirected to thread cout
457 #"\x01\x1b[1;36m\x02" <-- add colour to the text...
462 #"\x01\x1b[1;36m\x02" <-- add colour to the text...
458 print "\x01\x1b[1;36m\x02"+result
463 print "\x01\x1b[1;36m\x02"+result
459 stdout.close()
464 stdout.close()
460 stdin.close()
465 stdin.close()
@@ -1,877 +1,870 b''
1 #!/usr/bin/python
1 #!/usr/bin/python
2 # -*- coding: iso-8859-15 -*-
2 # -*- coding: iso-8859-15 -*-
3 '''
3 '''
4 Provides IPython WX console widgets.
4 Provides IPython WX console widgets.
5
5
6 @author: Laurent Dufrechou
6 @author: Laurent Dufrechou
7 laurent.dufrechou _at_ gmail.com
7 laurent.dufrechou _at_ gmail.com
8 This WX widget is based on the original work of Eitan Isaacson
8 This WX widget is based on the original work of Eitan Isaacson
9 that provided the console for the GTK toolkit.
9 that provided the console for the GTK toolkit.
10
10
11 Original work from:
11 Original work from:
12 @author: Eitan Isaacson
12 @author: Eitan Isaacson
13 @organization: IBM Corporation
13 @organization: IBM Corporation
14 @copyright: Copyright (c) 2007 IBM Corporation
14 @copyright: Copyright (c) 2007 IBM Corporation
15 @license: BSD
15 @license: BSD
16
16
17 All rights reserved. This program and the accompanying materials are made
17 All rights reserved. This program and the accompanying materials are made
18 available under the terms of the BSD which accompanies this distribution, and
18 available under the terms of the BSD which accompanies this distribution, and
19 is available at U{http://www.opensource.org/licenses/bsd-license.php}
19 is available at U{http://www.opensource.org/licenses/bsd-license.php}
20 '''
20 '''
21
21
22 __version__ = 0.8
22 __version__ = 0.8
23 __author__ = "Laurent Dufrechou"
23 __author__ = "Laurent Dufrechou"
24 __email__ = "laurent.dufrechou _at_ gmail.com"
24 __email__ = "laurent.dufrechou _at_ gmail.com"
25 __license__ = "BSD"
25 __license__ = "BSD"
26
26
27 import wx
27 import wx
28 import wx.stc as stc
28 import wx.stc as stc
29
29
30 import re
30 import re
31 import sys
32 import locale
33 from StringIO import StringIO
31 from StringIO import StringIO
34 try:
35 import IPython
36 except Exception,e:
37 raise "Error importing IPython (%s)" % str(e)
38
32
39 from ipshell_nonblocking import NonBlockingIPShell
33 from ipshell_nonblocking import NonBlockingIPShell
40
34
41 class WxNonBlockingIPShell(NonBlockingIPShell):
35 class WxNonBlockingIPShell(NonBlockingIPShell):
42 '''
36 '''
43 An NonBlockingIPShell Thread that is WX dependent.
37 An NonBlockingIPShell Thread that is WX dependent.
44 '''
38 '''
45 def __init__(self, parent,
39 def __init__(self, parent,
46 argv=[],user_ns={},user_global_ns=None,
40 argv=[],user_ns={},user_global_ns=None,
47 cin=None, cout=None, cerr=None,
41 cin=None, cout=None, cerr=None,
48 ask_exit_handler=None):
42 ask_exit_handler=None):
49
43
50 NonBlockingIPShell.__init__(self,argv,user_ns,user_global_ns,
44 NonBlockingIPShell.__init__(self, argv, user_ns, user_global_ns,
51 cin, cout, cerr,
45 cin, cout, cerr,
52 ask_exit_handler)
46 ask_exit_handler)
53
47
54 self.parent = parent
48 self.parent = parent
55
49
56 self.ask_exit_callback = ask_exit_handler
50 self.ask_exit_callback = ask_exit_handler
57 self._IP.exit = self._askExit
51 self._IP.exit = self._askExit
58
52
59 def addGUIShortcut(self,text,func):
53 def addGUIShortcut(self, text, func):
60 wx.CallAfter(self.parent.add_button_handler,
54 wx.CallAfter(self.parent.add_button_handler,
61 button_info={ 'text':text,
55 button_info={ 'text':text,
62 'func':self.parent.doExecuteLine(func)})
56 'func':self.parent.doExecuteLine(func)})
63
57
64 def _askExit(self):
58 def _askExit(self):
65 wx.CallAfter(self.ask_exit_callback, ())
59 wx.CallAfter(self.ask_exit_callback, ())
66
60
67 def _afterExecute(self):
61 def _afterExecute(self):
68 wx.CallAfter(self.parent.evtStateExecuteDone, ())
62 wx.CallAfter(self.parent.evtStateExecuteDone, ())
69
63
70
64
71 class WxConsoleView(stc.StyledTextCtrl):
65 class WxConsoleView(stc.StyledTextCtrl):
72 '''
66 '''
73 Specialized styled text control view for console-like workflow.
67 Specialized styled text control view for console-like workflow.
74 We use here a scintilla frontend thus it can be reused in any GUI that
68 We use here a scintilla frontend thus it can be reused in any GUI that
75 supports scintilla with less work.
69 supports scintilla with less work.
76
70
77 @cvar ANSI_COLORS_BLACK: Mapping of terminal colors to X11 names.
71 @cvar ANSI_COLORS_BLACK: Mapping of terminal colors to X11 names.
78 (with Black background)
72 (with Black background)
79 @type ANSI_COLORS_BLACK: dictionary
73 @type ANSI_COLORS_BLACK: dictionary
80
74
81 @cvar ANSI_COLORS_WHITE: Mapping of terminal colors to X11 names.
75 @cvar ANSI_COLORS_WHITE: Mapping of terminal colors to X11 names.
82 (with White background)
76 (with White background)
83 @type ANSI_COLORS_WHITE: dictionary
77 @type ANSI_COLORS_WHITE: dictionary
84
78
85 @ivar color_pat: Regex of terminal color pattern
79 @ivar color_pat: Regex of terminal color pattern
86 @type color_pat: _sre.SRE_Pattern
80 @type color_pat: _sre.SRE_Pattern
87 '''
81 '''
88 ANSI_STYLES_BLACK={'0;30': [0,'WHITE'], '0;31': [1,'RED'],
82 ANSI_STYLES_BLACK = {'0;30': [0, 'WHITE'], '0;31': [1, 'RED'],
89 '0;32': [2,'GREEN'], '0;33': [3,'BROWN'],
83 '0;32': [2, 'GREEN'], '0;33': [3, 'BROWN'],
90 '0;34': [4,'BLUE'], '0;35': [5,'PURPLE'],
84 '0;34': [4, 'BLUE'], '0;35': [5, 'PURPLE'],
91 '0;36': [6,'CYAN'], '0;37': [7,'LIGHT GREY'],
85 '0;36': [6, 'CYAN'], '0;37': [7, 'LIGHT GREY'],
92 '1;30': [8,'DARK GREY'], '1;31': [9,'RED'],
86 '1;30': [8, 'DARK GREY'], '1;31': [9, 'RED'],
93 '1;32': [10,'SEA GREEN'], '1;33': [11,'YELLOW'],
87 '1;32': [10, 'SEA GREEN'], '1;33': [11, 'YELLOW'],
94 '1;34': [12,'LIGHT BLUE'], '1;35':
88 '1;34': [12, 'LIGHT BLUE'], '1;35':
95 [13,'MEDIUM VIOLET RED'],
89 [13, 'MEDIUM VIOLET RED'],
96 '1;36': [14,'LIGHT STEEL BLUE'],'1;37': [15,'YELLOW']}
90 '1;36': [14, 'LIGHT STEEL BLUE'], '1;37': [15, 'YELLOW']}
97
91
98 ANSI_STYLES_WHITE={'0;30': [0,'BLACK'], '0;31': [1,'RED'],
92 ANSI_STYLES_WHITE = {'0;30': [0, 'BLACK'], '0;31': [1, 'RED'],
99 '0;32': [2,'GREEN'], '0;33': [3,'BROWN'],
93 '0;32': [2, 'GREEN'], '0;33': [3, 'BROWN'],
100 '0;34': [4,'BLUE'], '0;35': [5,'PURPLE'],
94 '0;34': [4, 'BLUE'], '0;35': [5, 'PURPLE'],
101 '0;36': [6,'CYAN'], '0;37': [7,'LIGHT GREY'],
95 '0;36': [6, 'CYAN'], '0;37': [7, 'LIGHT GREY'],
102 '1;30': [8,'DARK GREY'], '1;31': [9,'RED'],
96 '1;30': [8, 'DARK GREY'], '1;31': [9, 'RED'],
103 '1;32': [10,'SEA GREEN'], '1;33': [11,'YELLOW'],
97 '1;32': [10, 'SEA GREEN'], '1;33': [11, 'YELLOW'],
104 '1;34': [12,'LIGHT BLUE'], '1;35':
98 '1;34': [12, 'LIGHT BLUE'], '1;35':
105 [13,'MEDIUM VIOLET RED'],
99 [13, 'MEDIUM VIOLET RED'],
106 '1;36': [14,'LIGHT STEEL BLUE'],'1;37': [15,'YELLOW']}
100 '1;36': [14, 'LIGHT STEEL BLUE'], '1;37': [15, 'YELLOW']}
107
101
108 def __init__(self,parent,prompt,intro="",background_color="BLACK",
102 def __init__(self, parent, prompt, intro="", background_color="BLACK",
109 pos=wx.DefaultPosition, ID = -1, size=wx.DefaultSize,
103 pos=wx.DefaultPosition, ID = -1, size=wx.DefaultSize,
110 style=0, autocomplete_mode = 'IPYTHON'):
104 style=0, autocomplete_mode = 'IPYTHON'):
111 '''
105 '''
112 Initialize console view.
106 Initialize console view.
113
107
114 @param parent: Parent widget
108 @param parent: Parent widget
115 @param prompt: User specified prompt
109 @param prompt: User specified prompt
116 @type intro: string
110 @type intro: string
117 @param intro: User specified startup introduction string
111 @param intro: User specified startup introduction string
118 @type intro: string
112 @type intro: string
119 @param background_color: Can be BLACK or WHITE
113 @param background_color: Can be BLACK or WHITE
120 @type background_color: string
114 @type background_color: string
121 @param other: init param of styledTextControl (can be used as-is)
115 @param other: init param of styledTextControl (can be used as-is)
122 @param autocomplete_mode: Can be 'IPYTHON' or 'STC'
116 @param autocomplete_mode: Can be 'IPYTHON' or 'STC'
123 'IPYTHON' show autocompletion the ipython way
117 'IPYTHON' show autocompletion the ipython way
124 'STC" show it scintilla text control way
118 'STC" show it scintilla text control way
125 '''
119 '''
126 stc.StyledTextCtrl.__init__(self, parent, ID, pos, size, style)
120 stc.StyledTextCtrl.__init__(self, parent, ID, pos, size, style)
127
121
128 ####### Scintilla configuration ###################################
122 ####### Scintilla configuration ###################################
129
123
130 # Ctrl + B or Ctrl + N can be used to zoomin/zoomout the text inside
124 # Ctrl + B or Ctrl + N can be used to zoomin/zoomout the text inside
131 # the widget
125 # the widget
132 self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN)
126 self.CmdKeyAssign(ord('B'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMIN)
133 self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
127 self.CmdKeyAssign(ord('N'), stc.STC_SCMOD_CTRL, stc.STC_CMD_ZOOMOUT)
134
128
135 #We draw a line at position 80
129 #We draw a line at position 80
136 self.SetEdgeMode(stc.STC_EDGE_LINE)
130 self.SetEdgeMode(stc.STC_EDGE_LINE)
137 self.SetEdgeColumn(80)
131 self.SetEdgeColumn(80)
138 self.SetEdgeColour(wx.LIGHT_GREY)
132 self.SetEdgeColour(wx.LIGHT_GREY)
139
133
140 #self.SetViewWhiteSpace(True)
134 #self.SetViewWhiteSpace(True)
141 #self.SetViewEOL(True)
135 #self.SetViewEOL(True)
142 self.SetEOLMode(stc.STC_EOL_CRLF)
136 self.SetEOLMode(stc.STC_EOL_CRLF)
143 #self.SetWrapMode(stc.STC_WRAP_CHAR)
137 #self.SetWrapMode(stc.STC_WRAP_CHAR)
144 #self.SetWrapMode(stc.STC_WRAP_WORD)
138 #self.SetWrapMode(stc.STC_WRAP_WORD)
145 self.SetBufferedDraw(True)
139 self.SetBufferedDraw(True)
146 #self.SetUseAntiAliasing(True)
140 #self.SetUseAntiAliasing(True)
147 self.SetLayoutCache(stc.STC_CACHE_PAGE)
141 self.SetLayoutCache(stc.STC_CACHE_PAGE)
148 self.SetUndoCollection(False)
142 self.SetUndoCollection(False)
149 self.SetUseTabs(True)
143 self.SetUseTabs(True)
150 self.SetIndent(4)
144 self.SetIndent(4)
151 self.SetTabWidth(4)
145 self.SetTabWidth(4)
152
146
153 self.EnsureCaretVisible()
147 self.EnsureCaretVisible()
154
148
155 self.SetMargins(3,3) #text is moved away from border with 3px
149 self.SetMargins(3, 3) #text is moved away from border with 3px
156 # Suppressing Scintilla margins
150 # Suppressing Scintilla margins
157 self.SetMarginWidth(0,0)
151 self.SetMarginWidth(0, 0)
158 self.SetMarginWidth(1,0)
152 self.SetMarginWidth(1, 0)
159 self.SetMarginWidth(2,0)
153 self.SetMarginWidth(2, 0)
160
154
161 self.background_color = background_color
155 self.background_color = background_color
162 self.buildStyles()
156 self.buildStyles()
163
157
164 self.indent = 0
158 self.indent = 0
165 self.prompt_count = 0
159 self.prompt_count = 0
166 self.color_pat = re.compile('\x01?\x1b\[(.*?)m\x02?')
160 self.color_pat = re.compile('\x01?\x1b\[(.*?)m\x02?')
167
161
168 self.write(intro)
162 self.write(intro)
169 self.setPrompt(prompt)
163 self.setPrompt(prompt)
170 self.showPrompt()
164 self.showPrompt()
171
165
172 self.autocomplete_mode = autocomplete_mode
166 self.autocomplete_mode = autocomplete_mode
173
167
174 self.Bind(wx.EVT_KEY_DOWN, self._onKeypress)
168 self.Bind(wx.EVT_KEY_DOWN, self._onKeypress)
175
169
176 def buildStyles(self):
170 def buildStyles(self):
177 #we define platform specific fonts
171 #we define platform specific fonts
178 if wx.Platform == '__WXMSW__':
172 if wx.Platform == '__WXMSW__':
179 faces = { 'times': 'Times New Roman',
173 faces = { 'times': 'Times New Roman',
180 'mono' : 'Courier New',
174 'mono' : 'Courier New',
181 'helv' : 'Arial',
175 'helv' : 'Arial',
182 'other': 'Comic Sans MS',
176 'other': 'Comic Sans MS',
183 'size' : 10,
177 'size' : 10,
184 'size2': 8,
178 'size2': 8,
185 }
179 }
186 elif wx.Platform == '__WXMAC__':
180 elif wx.Platform == '__WXMAC__':
187 faces = { 'times': 'Times New Roman',
181 faces = { 'times': 'Times New Roman',
188 'mono' : 'Monaco',
182 'mono' : 'Monaco',
189 'helv' : 'Arial',
183 'helv' : 'Arial',
190 'other': 'Comic Sans MS',
184 'other': 'Comic Sans MS',
191 'size' : 10,
185 'size' : 10,
192 'size2': 8,
186 'size2': 8,
193 }
187 }
194 else:
188 else:
195 faces = { 'times': 'Times',
189 faces = { 'times': 'Times',
196 'mono' : 'Courier',
190 'mono' : 'Courier',
197 'helv' : 'Helvetica',
191 'helv' : 'Helvetica',
198 'other': 'new century schoolbook',
192 'other': 'new century schoolbook',
199 'size' : 10,
193 'size' : 10,
200 'size2': 8,
194 'size2': 8,
201 }
195 }
202
196
203 # make some styles
197 # make some styles
204 if self.background_color != "BLACK":
198 if self.background_color != "BLACK":
205 self.background_color = "WHITE"
199 self.background_color = "WHITE"
206 self.SetCaretForeground("BLACK")
200 self.SetCaretForeground("BLACK")
207 self.ANSI_STYLES = self.ANSI_STYLES_WHITE
201 self.ANSI_STYLES = self.ANSI_STYLES_WHITE
208 else:
202 else:
209 self.SetCaretForeground("WHITE")
203 self.SetCaretForeground("WHITE")
210 self.ANSI_STYLES = self.ANSI_STYLES_BLACK
204 self.ANSI_STYLES = self.ANSI_STYLES_BLACK
211
205
212 self.StyleSetSpec(stc.STC_STYLE_DEFAULT,
206 self.StyleSetSpec(stc.STC_STYLE_DEFAULT,
213 "fore:%s,back:%s,size:%d,face:%s"
207 "fore:%s,back:%s,size:%d,face:%s"
214 % (self.ANSI_STYLES['0;30'][1],
208 % (self.ANSI_STYLES['0;30'][1],
215 self.background_color,
209 self.background_color,
216 faces['size'], faces['mono']))
210 faces['size'], faces['mono']))
217 self.StyleClearAll()
211 self.StyleClearAll()
218 self.StyleSetSpec(stc.STC_STYLE_BRACELIGHT,
212 self.StyleSetSpec(stc.STC_STYLE_BRACELIGHT,
219 "fore:#FF0000,back:#0000FF,bold")
213 "fore:#FF0000,back:#0000FF,bold")
220 self.StyleSetSpec(stc.STC_STYLE_BRACEBAD,
214 self.StyleSetSpec(stc.STC_STYLE_BRACEBAD,
221 "fore:#000000,back:#FF0000,bold")
215 "fore:#000000,back:#FF0000,bold")
222
216
223 for style in self.ANSI_STYLES.values():
217 for style in self.ANSI_STYLES.values():
224 self.StyleSetSpec(style[0], "bold,fore:%s" % style[1])
218 self.StyleSetSpec(style[0], "bold,fore:%s" % style[1])
225
219
226 #######################################################################
220 #######################################################################
227
221
228 def setBackgroundColor(self,color):
222 def setBackgroundColor(self, color):
229 self.background_color = color
223 self.background_color = color
230 self.buildStyles()
224 self.buildStyles()
231
225
232 def getBackgroundColor(self,color):
226 def getBackgroundColor(self, color):
233 return self.background_color
227 return self.background_color
234
228
235 def asyncWrite(self, text):
229 def asyncWrite(self, text):
236 '''
230 '''
237 Write given text to buffer in an asynchroneous way.
231 Write given text to buffer in an asynchroneous way.
238 It is used from another thread to be able to acces the GUI.
232 It is used from another thread to be able to acces the GUI.
239 @param text: Text to append
233 @param text: Text to append
240 @type text: string
234 @type text: string
241 '''
235 '''
242 try:
236 try:
243 #print >>sys.__stdout__,'entering'
237 #print >>sys.__stdout__,'entering'
244 wx.MutexGuiEnter()
238 wx.MutexGuiEnter()
245 #print >>sys.__stdout__,'locking the GUI'
239 #print >>sys.__stdout__,'locking the GUI'
246
240
247 #be sure not to be interrutpted before the MutexGuiLeave!
241 #be sure not to be interrutpted before the MutexGuiLeave!
248 self.write(text)
242 self.write(text)
249
243
250 #print >>sys.__stdout__,'done'
244 #print >>sys.__stdout__,'done'
251
245
252 except KeyboardInterrupt:
246 except KeyboardInterrupt:
253 #print >>sys.__stdout__,'got keyboard interrupt'
247 #print >>sys.__stdout__,'got keyboard interrupt'
254 wx.MutexGuiLeave()
248 wx.MutexGuiLeave()
255 #print >>sys.__stdout__,'interrupt unlock the GUI'
249 #print >>sys.__stdout__,'interrupt unlock the GUI'
256 raise KeyboardInterrupt
250 raise KeyboardInterrupt
257 wx.MutexGuiLeave()
251 wx.MutexGuiLeave()
258 #print >>sys.__stdout__,'normal unlock the GUI'
252 #print >>sys.__stdout__,'normal unlock the GUI'
259
253
260
254
261 def write(self, text):
255 def write(self, text):
262 '''
256 '''
263 Write given text to buffer.
257 Write given text to buffer.
264
258
265 @param text: Text to append.
259 @param text: Text to append.
266 @type text: string
260 @type text: string
267 '''
261 '''
268 segments = self.color_pat.split(text)
262 segments = self.color_pat.split(text)
269 segment = segments.pop(0)
263 segment = segments.pop(0)
270 self.StartStyling(self.getCurrentLineEnd(),0xFF)
264 self.StartStyling(self.getCurrentLineEnd(), 0xFF)
271 self.AppendText(segment)
265 self.AppendText(segment)
272
266
273 if segments:
267 if segments:
274 ansi_tags = self.color_pat.findall(text)
268 ansi_tags = self.color_pat.findall(text)
275
269
276 for tag in ansi_tags:
270 for tag in ansi_tags:
277 i = segments.index(tag)
271 i = segments.index(tag)
278 self.StartStyling(self.getCurrentLineEnd(),0xFF)
272 self.StartStyling(self.getCurrentLineEnd(), 0xFF)
279 self.AppendText(segments[i+1])
273 self.AppendText(segments[i+1])
280
274
281 if tag != '0':
275 if tag != '0':
282 self.SetStyling(len(segments[i+1]),self.ANSI_STYLES[tag][0])
276 self.SetStyling(len(segments[i+1]), self.ANSI_STYLES[tag][0])
283
277
284 segments.pop(i)
278 segments.pop(i)
285
279
286 self.moveCursor(self.getCurrentLineEnd())
280 self.moveCursor(self.getCurrentLineEnd())
287
281
288 def getPromptLen(self):
282 def getPromptLen(self):
289 '''
283 '''
290 Return the length of current prompt
284 Return the length of current prompt
291 '''
285 '''
292 return len(str(self.prompt_count)) + 7
286 return len(str(self.prompt_count)) + 7
293
287
294 def setPrompt(self,prompt):
288 def setPrompt(self, prompt):
295 self.prompt = prompt
289 self.prompt = prompt
296
290
297 def setIndentation(self,indentation):
291 def setIndentation(self, indentation):
298 self.indent = indentation
292 self.indent = indentation
299
293
300 def setPromptCount(self,count):
294 def setPromptCount(self, count):
301 self.prompt_count = count
295 self.prompt_count = count
302
296
303 def showPrompt(self):
297 def showPrompt(self):
304 '''
298 '''
305 Prints prompt at start of line.
299 Prints prompt at start of line.
306
300
307 @param prompt: Prompt to print.
301 @param prompt: Prompt to print.
308 @type prompt: string
302 @type prompt: string
309 '''
303 '''
310 self.write(self.prompt)
304 self.write(self.prompt)
311 #now we update the position of end of prompt
305 #now we update the position of end of prompt
312 self.current_start = self.getCurrentLineEnd()
306 self.current_start = self.getCurrentLineEnd()
313
307
314 autoindent = self.indent*' '
308 autoindent = self.indent*' '
315 autoindent = autoindent.replace(' ','\t')
309 autoindent = autoindent.replace(' ','\t')
316 self.write(autoindent)
310 self.write(autoindent)
317
311
318 def changeLine(self, text):
312 def changeLine(self, text):
319 '''
313 '''
320 Replace currently entered command line with given text.
314 Replace currently entered command line with given text.
321
315
322 @param text: Text to use as replacement.
316 @param text: Text to use as replacement.
323 @type text: string
317 @type text: string
324 '''
318 '''
325 self.SetSelection(self.getCurrentPromptStart(),self.getCurrentLineEnd())
319 self.SetSelection(self.getCurrentPromptStart(), self.getCurrentLineEnd())
326 self.ReplaceSelection(text)
320 self.ReplaceSelection(text)
327 self.moveCursor(self.getCurrentLineEnd())
321 self.moveCursor(self.getCurrentLineEnd())
328
322
329 def getCurrentPromptStart(self):
323 def getCurrentPromptStart(self):
330 return self.current_start
324 return self.current_start
331
325
332 def getCurrentLineStart(self):
326 def getCurrentLineStart(self):
333 return self.GotoLine(self.LineFromPosition(self.GetCurrentPos()))
327 return self.GotoLine(self.LineFromPosition(self.GetCurrentPos()))
334
328
335 def getCurrentLineEnd(self):
329 def getCurrentLineEnd(self):
336 return self.GetLength()
330 return self.GetLength()
337
331
338 def getCurrentLine(self):
332 def getCurrentLine(self):
339 '''
333 '''
340 Get text in current command line.
334 Get text in current command line.
341
335
342 @return: Text of current command line.
336 @return: Text of current command line.
343 @rtype: string
337 @rtype: string
344 '''
338 '''
345 return self.GetTextRange(self.getCurrentPromptStart(),
339 return self.GetTextRange(self.getCurrentPromptStart(),
346 self.getCurrentLineEnd())
340 self.getCurrentLineEnd())
347
341
348 def moveCursorOnNewValidKey(self):
342 def moveCursorOnNewValidKey(self):
349 #If cursor is at wrong position put it at last line...
343 #If cursor is at wrong position put it at last line...
350 if self.GetCurrentPos() < self.getCurrentPromptStart():
344 if self.GetCurrentPos() < self.getCurrentPromptStart():
351 self.GotoPos(self.getCurrentPromptStart())
345 self.GotoPos(self.getCurrentPromptStart())
352
346
353 def removeFromTo(self,from_pos,to_pos):
347 def removeFromTo(self, from_pos, to_pos):
354 if from_pos < to_pos:
348 if from_pos < to_pos:
355 self.SetSelection(from_pos,to_pos)
349 self.SetSelection(from_pos, to_pos)
356 self.DeleteBack()
350 self.DeleteBack()
357
351
358 def removeCurrentLine(self):
352 def removeCurrentLine(self):
359 self.LineDelete()
353 self.LineDelete()
360
354
361 def moveCursor(self,position):
355 def moveCursor(self, position):
362 self.GotoPos(position)
356 self.GotoPos(position)
363
357
364 def getCursorPos(self):
358 def getCursorPos(self):
365 return self.GetCurrentPos()
359 return self.GetCurrentPos()
366
360
367 def selectFromTo(self,from_pos,to_pos):
361 def selectFromTo(self, from_pos, to_pos):
368 self.SetSelectionStart(from_pos)
362 self.SetSelectionStart(from_pos)
369 self.SetSelectionEnd(to_pos)
363 self.SetSelectionEnd(to_pos)
370
364
371 def writeHistory(self,history):
365 def writeHistory(self, history):
372 self.removeFromTo(self.getCurrentPromptStart(),self.getCurrentLineEnd())
366 self.removeFromTo(self.getCurrentPromptStart(), self.getCurrentLineEnd())
373 self.changeLine(history)
367 self.changeLine(history)
374
368
375 def setCompletionMethod(self, completion):
369 def setCompletionMethod(self, completion):
376 if completion in ['IPYTHON','STC']:
370 if completion in ['IPYTHON', 'STC']:
377 self.autocomplete_mode = completion
371 self.autocomplete_mode = completion
378 else:
372 else:
379 raise AttributeError
373 raise AttributeError
380
374
381 def getCompletionMethod(self, completion):
375 def getCompletionMethod(self, completion):
382 return self.autocomplete_mode
376 return self.autocomplete_mode
383
377
384 def writeCompletion(self, possibilities):
378 def writeCompletion(self, possibilities):
385 if self.autocomplete_mode == 'IPYTHON':
379 if self.autocomplete_mode == 'IPYTHON':
386 max_len = len(max(possibilities,key=len))
380 max_len = len(max(possibilities, key=len))
387 max_symbol =' '*max_len
381 max_symbol = ' '*max_len
388
382
389 #now we check how much symbol we can put on a line...
383 #now we check how much symbol we can put on a line...
390 cursor_pos = self.getCursorPos()
391 test_buffer = max_symbol + ' '*4
384 test_buffer = max_symbol + ' '*4
392 current_lines = self.GetLineCount()
393
385
394 allowed_symbols = 80/len(test_buffer)
386 allowed_symbols = 80/len(test_buffer)
395 if allowed_symbols == 0:
387 if allowed_symbols == 0:
396 allowed_symbols = 1
388 allowed_symbols = 1
397
389
398 pos = 1
390 pos = 1
399 buf = ''
391 buf = ''
400 for symbol in possibilities:
392 for symbol in possibilities:
401 #buf += symbol+'\n'#*spaces)
393 #buf += symbol+'\n'#*spaces)
402 if pos<allowed_symbols:
394 if pos < allowed_symbols:
403 spaces = max_len - len(symbol) + 4
395 spaces = max_len - len(symbol) + 4
404 buf += symbol+' '*spaces
396 buf += symbol+' '*spaces
405 pos += 1
397 pos += 1
406 else:
398 else:
407 buf+=symbol+'\n'
399 buf += symbol+'\n'
408 pos = 1
400 pos = 1
409 self.write(buf)
401 self.write(buf)
410 else:
402 else:
411 possibilities.sort() # Python sorts are case sensitive
403 possibilities.sort() # Python sorts are case sensitive
412 self.AutoCompSetIgnoreCase(False)
404 self.AutoCompSetIgnoreCase(False)
413 self.AutoCompSetAutoHide(False)
405 self.AutoCompSetAutoHide(False)
414 #let compute the length ot last word
406 #let compute the length ot last word
415 splitter = [' ','(','[','{']
407 splitter = [' ', '(', '[', '{']
416 last_word = self.getCurrentLine()
408 last_word = self.getCurrentLine()
417 for breaker in splitter:
409 for breaker in splitter:
418 last_word = last_word.split(breaker)[-1]
410 last_word = last_word.split(breaker)[-1]
419 self.AutoCompShow(len(last_word), " ".join(possibilities))
411 self.AutoCompShow(len(last_word), " ".join(possibilities))
420
412
421 def _onKeypress(self, event, skip=True):
413 def _onKeypress(self, event, skip=True):
422 '''
414 '''
423 Key press callback used for correcting behavior for console-like
415 Key press callback used for correcting behavior for console-like
424 interfaces. For example 'home' should go to prompt, not to begining of
416 interfaces. For example 'home' should go to prompt, not to begining of
425 line.
417 line.
426
418
427 @param widget: Widget that key press accored in.
419 @param widget: Widget that key press accored in.
428 @type widget: gtk.Widget
420 @type widget: gtk.Widget
429 @param event: Event object
421 @param event: Event object
430 @type event: gtk.gdk.Event
422 @type event: gtk.gdk.Event
431
423
432 @return: Return True if event as been catched.
424 @return: Return True if event as been catched.
433 @rtype: boolean
425 @rtype: boolean
434 '''
426 '''
435
427
436 if not self.AutoCompActive():
428 if not self.AutoCompActive():
437 if event.GetKeyCode() == wx.WXK_HOME:
429 if event.GetKeyCode() == wx.WXK_HOME:
438 if event.Modifiers == wx.MOD_NONE:
430 if event.Modifiers == wx.MOD_NONE:
439 self.moveCursorOnNewValidKey()
431 self.moveCursorOnNewValidKey()
440 self.moveCursor(self.getCurrentPromptStart())
432 self.moveCursor(self.getCurrentPromptStart())
441 return True
433 return True
442 elif event.Modifiers == wx.MOD_SHIFT:
434 elif event.Modifiers == wx.MOD_SHIFT:
443 self.moveCursorOnNewValidKey()
435 self.moveCursorOnNewValidKey()
444 self.selectFromTo(self.getCurrentPromptStart(),self.getCursorPos())
436 self.selectFromTo(self.getCurrentPromptStart(), self.getCursorPos())
445 return True
437 return True
446 else:
438 else:
447 return False
439 return False
448
440
449 elif event.GetKeyCode() == wx.WXK_LEFT:
441 elif event.GetKeyCode() == wx.WXK_LEFT:
450 if event.Modifiers == wx.MOD_NONE:
442 if event.Modifiers == wx.MOD_NONE:
451 self.moveCursorOnNewValidKey()
443 self.moveCursorOnNewValidKey()
452
444
453 self.moveCursor(self.getCursorPos()-1)
445 self.moveCursor(self.getCursorPos()-1)
454 if self.getCursorPos() < self.getCurrentPromptStart():
446 if self.getCursorPos() < self.getCurrentPromptStart():
455 self.moveCursor(self.getCurrentPromptStart())
447 self.moveCursor(self.getCurrentPromptStart())
456 return True
448 return True
457
449
458 elif event.GetKeyCode() == wx.WXK_BACK:
450 elif event.GetKeyCode() == wx.WXK_BACK:
459 self.moveCursorOnNewValidKey()
451 self.moveCursorOnNewValidKey()
460 if self.getCursorPos() > self.getCurrentPromptStart():
452 if self.getCursorPos() > self.getCurrentPromptStart():
461 event.Skip()
453 event.Skip()
462 return True
454 return True
463
455
464 if skip:
456 if skip:
465 if event.GetKeyCode() not in [wx.WXK_PAGEUP,wx.WXK_PAGEDOWN] and event.Modifiers == wx.MOD_NONE:
457 if event.GetKeyCode() not in [wx.WXK_PAGEUP, wx.WXK_PAGEDOWN]\
458 and event.Modifiers == wx.MOD_NONE:
466 self.moveCursorOnNewValidKey()
459 self.moveCursorOnNewValidKey()
467
460
468 event.Skip()
461 event.Skip()
469 return True
462 return True
470 return False
463 return False
471 else:
464 else:
472 event.Skip()
465 event.Skip()
473
466
474 def OnUpdateUI(self, evt):
467 def OnUpdateUI(self, evt):
475 # check for matching braces
468 # check for matching braces
476 braceAtCaret = -1
469 braceAtCaret = -1
477 braceOpposite = -1
470 braceOpposite = -1
478 charBefore = None
471 charBefore = None
479 caretPos = self.GetCurrentPos()
472 caretPos = self.GetCurrentPos()
480
473
481 if caretPos > 0:
474 if caretPos > 0:
482 charBefore = self.GetCharAt(caretPos - 1)
475 charBefore = self.GetCharAt(caretPos - 1)
483 styleBefore = self.GetStyleAt(caretPos - 1)
476 styleBefore = self.GetStyleAt(caretPos - 1)
484
477
485 # check before
478 # check before
486 if charBefore and chr(charBefore) in "[]{}()" and styleBefore == stc.STC_P_OPERATOR:
479 if charBefore and chr(charBefore) in "[]{}()" and styleBefore == stc.STC_P_OPERATOR:
487 braceAtCaret = caretPos - 1
480 braceAtCaret = caretPos - 1
488
481
489 # check after
482 # check after
490 if braceAtCaret < 0:
483 if braceAtCaret < 0:
491 charAfter = self.GetCharAt(caretPos)
484 charAfter = self.GetCharAt(caretPos)
492 styleAfter = self.GetStyleAt(caretPos)
485 styleAfter = self.GetStyleAt(caretPos)
493
486
494 if charAfter and chr(charAfter) in "[]{}()" and styleAfter == stc.STC_P_OPERATOR:
487 if charAfter and chr(charAfter) in "[]{}()" and styleAfter == stc.STC_P_OPERATOR:
495 braceAtCaret = caretPos
488 braceAtCaret = caretPos
496
489
497 if braceAtCaret >= 0:
490 if braceAtCaret >= 0:
498 braceOpposite = self.BraceMatch(braceAtCaret)
491 braceOpposite = self.BraceMatch(braceAtCaret)
499
492
500 if braceAtCaret != -1 and braceOpposite == -1:
493 if braceAtCaret != -1 and braceOpposite == -1:
501 self.BraceBadLight(braceAtCaret)
494 self.BraceBadLight(braceAtCaret)
502 else:
495 else:
503 self.BraceHighlight(braceAtCaret, braceOpposite)
496 self.BraceHighlight(braceAtCaret, braceOpposite)
504 #pt = self.PointFromPosition(braceOpposite)
497 #pt = self.PointFromPosition(braceOpposite)
505 #self.Refresh(True, wxRect(pt.x, pt.y, 5,5))
498 #self.Refresh(True, wxRect(pt.x, pt.y, 5,5))
506 #print pt
499 #print pt
507 #self.Refresh(False)
500 #self.Refresh(False)
508
501
509 class IPShellWidget(wx.Panel):
502 class IPShellWidget(wx.Panel):
510 '''
503 '''
511 This is wx.Panel that embbed the IPython Thread and the wx.StyledTextControl
504 This is wx.Panel that embbed the IPython Thread and the wx.StyledTextControl
512 If you want to port this to any other GUI toolkit, just replace the
505 If you want to port this to any other GUI toolkit, just replace the
513 WxConsoleView by YOURGUIConsoleView and make YOURGUIIPythonView derivate
506 WxConsoleView by YOURGUIConsoleView and make YOURGUIIPythonView derivate
514 from whatever container you want. I've choosed to derivate from a wx.Panel
507 from whatever container you want. I've choosed to derivate from a wx.Panel
515 because it seems to be more useful
508 because it seems to be more useful
516 Any idea to make it more 'generic' welcomed.
509 Any idea to make it more 'generic' welcomed.
517 '''
510 '''
518
511
519 def __init__(self, parent, intro=None,
512 def __init__(self, parent, intro=None,
520 background_color="BLACK", add_button_handler=None,
513 background_color="BLACK", add_button_handler=None,
521 wx_ip_shell=None, user_ns={},user_global_ns=None,
514 wx_ip_shell=None, user_ns={},user_global_ns=None,
522 ):
515 ):
523 '''
516 '''
524 Initialize.
517 Initialize.
525 Instanciate an IPython thread.
518 Instanciate an IPython thread.
526 Instanciate a WxConsoleView.
519 Instanciate a WxConsoleView.
527 Redirect I/O to console.
520 Redirect I/O to console.
528 '''
521 '''
529 wx.Panel.__init__(self,parent,wx.ID_ANY)
522 wx.Panel.__init__(self,parent,wx.ID_ANY)
530
523
531 self.parent = parent
524 self.parent = parent
532 ### IPython non blocking shell instanciation ###
525 ### IPython non blocking shell instanciation ###
533 self.cout = StringIO()
526 self.cout = StringIO()
534 self.add_button_handler = add_button_handler
527 self.add_button_handler = add_button_handler
535
528
536 if wx_ip_shell is not None:
529 if wx_ip_shell is not None:
537 self.IP = wx_ip_shell
530 self.IP = wx_ip_shell
538 else:
531 else:
539 self.IP = WxNonBlockingIPShell(self,
532 self.IP = WxNonBlockingIPShell(self,
540 cout = self.cout, cerr = self.cout,
533 cout = self.cout, cerr = self.cout,
541 ask_exit_handler = self.askExitCallback)
534 ask_exit_handler = self.askExitCallback)
542
535
543 ### IPython wx console view instanciation ###
536 ### IPython wx console view instanciation ###
544 #If user didn't defined an intro text, we create one for him
537 #If user didn't defined an intro text, we create one for him
545 #If you really wnat an empty intro just call wxIPythonViewPanel
538 #If you really wnat an empty intro just call wxIPythonViewPanel
546 #with intro=''
539 #with intro=''
547 if intro is None:
540 if intro is None:
548 welcome_text = "Welcome to WxIPython Shell.\n\n"
541 welcome_text = "Welcome to WxIPython Shell.\n\n"
549 welcome_text+= self.IP.getBanner()
542 welcome_text+= self.IP.getBanner()
550 welcome_text+= "!command -> Execute command in shell\n"
543 welcome_text+= "!command -> Execute command in shell\n"
551 welcome_text+= "TAB -> Autocompletion\n"
544 welcome_text+= "TAB -> Autocompletion\n"
552 else:
545 else:
553 welcome_text = intro
546 welcome_text = intro
554
547
555 self.text_ctrl = WxConsoleView(self,
548 self.text_ctrl = WxConsoleView(self,
556 self.IP.getPrompt(),
549 self.IP.getPrompt(),
557 intro=welcome_text,
550 intro=welcome_text,
558 background_color=background_color)
551 background_color=background_color)
559
552
560 self.cout.write = self.text_ctrl.asyncWrite
553 self.cout.write = self.text_ctrl.asyncWrite
561
554
562 option_text = wx.StaticText(self, -1, "Options:")
555 option_text = wx.StaticText(self, -1, "Options:")
563 self.completion_option = wx.CheckBox(self, -1, "Scintilla Completion")
556 self.completion_option = wx.CheckBox(self, -1, "Scintilla Completion")
564 #self.completion_option.SetValue(False)
557 #self.completion_option.SetValue(False)
565 self.background_option = wx.CheckBox(self, -1, "White Background")
558 self.background_option = wx.CheckBox(self, -1, "White Background")
566 #self.background_option.SetValue(False)
559 #self.background_option.SetValue(False)
567
560
568 self.options={'completion':{'value':'IPYTHON',
561 self.options={'completion':{'value':'IPYTHON',
569 'checkbox':self.completion_option,'STC':True,'IPYTHON':False,
562 'checkbox':self.completion_option,'STC':True,'IPYTHON':False,
570 'setfunc':self.text_ctrl.setCompletionMethod},
563 'setfunc':self.text_ctrl.setCompletionMethod},
571 'background_color':{'value':'BLACK',
564 'background_color':{'value':'BLACK',
572 'checkbox':self.background_option,'WHITE':True,'BLACK':False,
565 'checkbox':self.background_option,'WHITE':True,'BLACK':False,
573 'setfunc':self.text_ctrl.setBackgroundColor},
566 'setfunc':self.text_ctrl.setBackgroundColor},
574 }
567 }
575 self.reloadOptions(self.options)
568 self.reloadOptions(self.options)
576
569
577 self.text_ctrl.Bind(wx.EVT_KEY_DOWN, self.keyPress)
570 self.text_ctrl.Bind(wx.EVT_KEY_DOWN, self.keyPress)
578 self.completion_option.Bind(wx.EVT_CHECKBOX, self.evtCheckOptionCompletion)
571 self.completion_option.Bind(wx.EVT_CHECKBOX, self.evtCheckOptionCompletion)
579 self.background_option.Bind(wx.EVT_CHECKBOX, self.evtCheckOptionBackgroundColor)
572 self.background_option.Bind(wx.EVT_CHECKBOX, self.evtCheckOptionBackgroundColor)
580
573
581 ### making the layout of the panel ###
574 ### making the layout of the panel ###
582 sizer = wx.BoxSizer(wx.VERTICAL)
575 sizer = wx.BoxSizer(wx.VERTICAL)
583 sizer.Add(self.text_ctrl, 1, wx.EXPAND)
576 sizer.Add(self.text_ctrl, 1, wx.EXPAND)
584 option_sizer = wx.BoxSizer(wx.HORIZONTAL)
577 option_sizer = wx.BoxSizer(wx.HORIZONTAL)
585 sizer.Add(option_sizer, 0)
578 sizer.Add(option_sizer, 0)
586 option_sizer.AddMany([(10, 20),
579 option_sizer.AddMany([(10, 20),
587 (option_text, 0, wx.ALIGN_CENTER_VERTICAL),
580 (option_text, 0, wx.ALIGN_CENTER_VERTICAL),
588 (5, 5),
581 (5, 5),
589 (self.completion_option, 0, wx.ALIGN_CENTER_VERTICAL),
582 (self.completion_option, 0, wx.ALIGN_CENTER_VERTICAL),
590 (8, 8),
583 (8, 8),
591 (self.background_option, 0, wx.ALIGN_CENTER_VERTICAL)
584 (self.background_option, 0, wx.ALIGN_CENTER_VERTICAL)
592 ])
585 ])
593 self.SetAutoLayout(True)
586 self.SetAutoLayout(True)
594 sizer.Fit(self)
587 sizer.Fit(self)
595 sizer.SetSizeHints(self)
588 sizer.SetSizeHints(self)
596 self.SetSizer(sizer)
589 self.SetSizer(sizer)
597 #and we focus on the widget :)
590 #and we focus on the widget :)
598 self.SetFocus()
591 self.SetFocus()
599
592
600 #widget state management (for key handling different cases)
593 #widget state management (for key handling different cases)
601 self.setCurrentState('IDLE')
594 self.setCurrentState('IDLE')
602 self.pager_state = 'DONE'
595 self.pager_state = 'DONE'
603 self.raw_input_current_line = 0
596 self.raw_input_current_line = 0
604
597
605 def askExitCallback(self, event):
598 def askExitCallback(self, event):
606 self.askExitHandler(event)
599 self.askExitHandler(event)
607
600
608 #---------------------- IPython Thread Management ------------------------
601 #---------------------- IPython Thread Management ------------------------
609 def stateDoExecuteLine(self):
602 def stateDoExecuteLine(self):
610 lines=self.text_ctrl.getCurrentLine()
603 lines=self.text_ctrl.getCurrentLine()
611 self.text_ctrl.write('\n')
604 self.text_ctrl.write('\n')
612 lines_to_execute = lines.replace('\t',' '*4)
605 lines_to_execute = lines.replace('\t',' '*4)
613 lines_to_execute = lines_to_execute.replace('\r','')
606 lines_to_execute = lines_to_execute.replace('\r','')
614 self.IP.doExecute(lines_to_execute.encode('cp1252'))
607 self.IP.doExecute(lines_to_execute.encode('cp1252'))
615 self.updateHistoryTracker(lines)
608 self.updateHistoryTracker(lines)
616 self.setCurrentState('WAIT_END_OF_EXECUTION')
609 self.setCurrentState('WAIT_END_OF_EXECUTION')
617
610
618 def evtStateExecuteDone(self,evt):
611 def evtStateExecuteDone(self,evt):
619 self.doc = self.IP.getDocText()
612 self.doc = self.IP.getDocText()
620 self.help = self.IP.getHelpText()
613 self.help = self.IP.getHelpText()
621 if self.doc:
614 if self.doc:
622 self.pager_lines = self.doc[7:].split('\n')
615 self.pager_lines = self.doc[7:].split('\n')
623 self.pager_state = 'INIT'
616 self.pager_state = 'INIT'
624 self.setCurrentState('SHOW_DOC')
617 self.setCurrentState('SHOW_DOC')
625 self.pager(self.doc)
618 self.pager(self.doc)
626 elif self.help:
619 elif self.help:
627 self.pager_lines = self.help.split('\n')
620 self.pager_lines = self.help.split('\n')
628 self.pager_state = 'INIT'
621 self.pager_state = 'INIT'
629 self.setCurrentState('SHOW_DOC')
622 self.setCurrentState('SHOW_DOC')
630 self.pager(self.help)
623 self.pager(self.help)
631 else:
624 else:
632 self.stateShowPrompt()
625 self.stateShowPrompt()
633
626
634 def stateShowPrompt(self):
627 def stateShowPrompt(self):
635 self.setCurrentState('SHOW_PROMPT')
628 self.setCurrentState('SHOW_PROMPT')
636 self.text_ctrl.setPrompt(self.IP.getPrompt())
629 self.text_ctrl.setPrompt(self.IP.getPrompt())
637 self.text_ctrl.setIndentation(self.IP.getIndentation())
630 self.text_ctrl.setIndentation(self.IP.getIndentation())
638 self.text_ctrl.setPromptCount(self.IP.getPromptCount())
631 self.text_ctrl.setPromptCount(self.IP.getPromptCount())
639 self.text_ctrl.showPrompt()
632 self.text_ctrl.showPrompt()
640 self.IP.initHistoryIndex()
633 self.IP.initHistoryIndex()
641 self.setCurrentState('IDLE')
634 self.setCurrentState('IDLE')
642
635
643 def setCurrentState(self, state):
636 def setCurrentState(self, state):
644 self.cur_state = state
637 self.cur_state = state
645 self.updateStatusTracker(self.cur_state)
638 self.updateStatusTracker(self.cur_state)
646
639
647 def pager(self,text):
640 def pager(self,text):
648
641
649 if self.pager_state == 'INIT':
642 if self.pager_state == 'INIT':
650 #print >>sys.__stdout__,"PAGER state:",self.pager_state
643 #print >>sys.__stdout__,"PAGER state:",self.pager_state
651 self.pager_nb_lines = len(self.pager_lines)
644 self.pager_nb_lines = len(self.pager_lines)
652 self.pager_index = 0
645 self.pager_index = 0
653 self.pager_do_remove = False
646 self.pager_do_remove = False
654 self.text_ctrl.write('\n')
647 self.text_ctrl.write('\n')
655 self.pager_state = 'PROCESS_LINES'
648 self.pager_state = 'PROCESS_LINES'
656
649
657 if self.pager_state == 'PROCESS_LINES':
650 if self.pager_state == 'PROCESS_LINES':
658 #print >>sys.__stdout__,"PAGER state:",self.pager_state
651 #print >>sys.__stdout__,"PAGER state:",self.pager_state
659 if self.pager_do_remove == True:
652 if self.pager_do_remove == True:
660 self.text_ctrl.removeCurrentLine()
653 self.text_ctrl.removeCurrentLine()
661 self.pager_do_remove = False
654 self.pager_do_remove = False
662
655
663 if self.pager_nb_lines > 10:
656 if self.pager_nb_lines > 10:
664 #print >>sys.__stdout__,"PAGER processing 10 lines"
657 #print >>sys.__stdout__,"PAGER processing 10 lines"
665 if self.pager_index > 0:
658 if self.pager_index > 0:
666 self.text_ctrl.write(">\x01\x1b[1;36m\x02"+self.pager_lines[self.pager_index]+'\n')
659 self.text_ctrl.write(">\x01\x1b[1;36m\x02"+self.pager_lines[self.pager_index]+'\n')
667 else:
668 self.text_ctrl.write("\x01\x1b[1;36m\x02 "+self.pager_lines[self.pager_index]+'\n')
669
670 for line in self.pager_lines[self.pager_index+1:self.pager_index+9]:
671 self.text_ctrl.write("\x01\x1b[1;36m\x02 "+line+'\n')
672 self.pager_index += 10
673 self.pager_nb_lines -= 10
674 self.text_ctrl.write("--- Push Enter to continue or 'Q' to quit---")
675 self.pager_do_remove = True
676 self.pager_state = 'WAITING'
677 return
678 else:
660 else:
679 #print >>sys.__stdout__,"PAGER processing last lines"
661 self.text_ctrl.write("\x01\x1b[1;36m\x02 "+self.pager_lines[self.pager_index]+'\n')
680 if self.pager_nb_lines > 0:
662
681 if self.pager_index > 0:
663 for line in self.pager_lines[self.pager_index+1:self.pager_index+9]:
682 self.text_ctrl.write(">\x01\x1b[1;36m\x02"+self.pager_lines[self.pager_index]+'\n')
664 self.text_ctrl.write("\x01\x1b[1;36m\x02 "+line+'\n')
683 else:
665 self.pager_index += 10
684 self.text_ctrl.write("\x01\x1b[1;36m\x02 "+self.pager_lines[self.pager_index]+'\n')
666 self.pager_nb_lines -= 10
685
667 self.text_ctrl.write("--- Push Enter to continue or 'Q' to quit---")
686 self.pager_index += 1
668 self.pager_do_remove = True
687 self.pager_nb_lines -= 1
669 self.pager_state = 'WAITING'
688 if self.pager_nb_lines > 0:
670 return
689 for line in self.pager_lines[self.pager_index:]:
671 else:
690 self.text_ctrl.write("\x01\x1b[1;36m\x02 "+line+'\n')
672 #print >>sys.__stdout__,"PAGER processing last lines"
691 self.pager_nb_lines = 0
673 if self.pager_nb_lines > 0:
692 self.pager_state = 'DONE'
674 if self.pager_index > 0:
693 self.stateShowPrompt()
675 self.text_ctrl.write(">\x01\x1b[1;36m\x02"+self.pager_lines[self.pager_index]+'\n')
694
676 else:
677 self.text_ctrl.write("\x01\x1b[1;36m\x02 "+self.pager_lines[self.pager_index]+'\n')
678
679 self.pager_index += 1
680 self.pager_nb_lines -= 1
681 if self.pager_nb_lines > 0:
682 for line in self.pager_lines[self.pager_index:]:
683 self.text_ctrl.write("\x01\x1b[1;36m\x02 "+line+'\n')
684 self.pager_nb_lines = 0
685 self.pager_state = 'DONE'
686 self.stateShowPrompt()
687
695 #------------------------ Key Handler ------------------------------------
688 #------------------------ Key Handler ------------------------------------
696 def keyPress(self, event):
689 def keyPress(self, event):
697 '''
690 '''
698 Key press callback with plenty of shell goodness, like history,
691 Key press callback with plenty of shell goodness, like history,
699 autocompletions, etc.
692 autocompletions, etc.
700 '''
693 '''
701 if event.GetKeyCode() == ord('C'):
694 if event.GetKeyCode() == ord('C'):
702 if event.Modifiers == wx.MOD_CONTROL or event.Modifiers == wx.MOD_ALT:
695 if event.Modifiers == wx.MOD_CONTROL or event.Modifiers == wx.MOD_ALT:
703 if self.cur_state == 'WAIT_END_OF_EXECUTION':
696 if self.cur_state == 'WAIT_END_OF_EXECUTION':
704 #we raise an exception inside the IPython thread container
697 #we raise an exception inside the IPython thread container
705 self.IP.ce.raise_exc(KeyboardInterrupt)
698 self.IP.ce.raise_exc(KeyboardInterrupt)
706 return
699 return
707
700
708 #let this before 'wx.WXK_RETURN' because we have to put 'IDLE'
701 #let this before 'wx.WXK_RETURN' because we have to put 'IDLE'
709 #mode if AutoComp has been set as inactive
702 #mode if AutoComp has been set as inactive
710 if self.cur_state == 'COMPLETING':
703 if self.cur_state == 'COMPLETING':
711 if not self.text_ctrl.AutoCompActive():
704 if not self.text_ctrl.AutoCompActive():
712 self.cur_state = 'IDLE'
705 self.cur_state = 'IDLE'
713 else:
706 else:
714 event.Skip()
707 event.Skip()
715
708
716 if event.KeyCode == wx.WXK_RETURN:
709 if event.KeyCode == wx.WXK_RETURN:
717 if self.cur_state == 'IDLE':
710 if self.cur_state == 'IDLE':
718 #we change the state ot the state machine
711 #we change the state ot the state machine
719 self.setCurrentState('DO_EXECUTE_LINE')
712 self.setCurrentState('DO_EXECUTE_LINE')
720 self.stateDoExecuteLine()
713 self.stateDoExecuteLine()
721 return
714 return
722
715
723 if self.pager_state == 'WAITING':
716 if self.pager_state == 'WAITING':
724 self.pager_state = 'PROCESS_LINES'
717 self.pager_state = 'PROCESS_LINES'
725 self.pager(self.doc)
718 self.pager(self.doc)
726 return
719 return
727
720
728 if self.cur_state == 'WAITING_USER_INPUT':
721 if self.cur_state == 'WAITING_USER_INPUT':
729 line=self.text_ctrl.getCurrentLine()
722 line=self.text_ctrl.getCurrentLine()
730 self.text_ctrl.write('\n')
723 self.text_ctrl.write('\n')
731 self.setCurrentState('WAIT_END_OF_EXECUTION')
724 self.setCurrentState('WAIT_END_OF_EXECUTION')
732 return
725 return
733
726
734 if event.GetKeyCode() in [ord('q'),ord('Q')]:
727 if event.GetKeyCode() in [ord('q'),ord('Q')]:
735 if self.pager_state == 'WAITING':
728 if self.pager_state == 'WAITING':
736 self.pager_state = 'DONE'
729 self.pager_state = 'DONE'
737 self.text_ctrl.write('\n')
730 self.text_ctrl.write('\n')
738 self.stateShowPrompt()
731 self.stateShowPrompt()
739 return
732 return
740
733
741 if self.cur_state == 'WAITING_USER_INPUT':
734 if self.cur_state == 'WAITING_USER_INPUT':
742 event.Skip()
735 event.Skip()
743
736
744 if self.cur_state == 'IDLE':
737 if self.cur_state == 'IDLE':
745 if event.KeyCode == wx.WXK_UP:
738 if event.KeyCode == wx.WXK_UP:
746 history = self.IP.historyBack()
739 history = self.IP.historyBack()
747 self.text_ctrl.writeHistory(history)
740 self.text_ctrl.writeHistory(history)
748 return
741 return
749 if event.KeyCode == wx.WXK_DOWN:
742 if event.KeyCode == wx.WXK_DOWN:
750 history = self.IP.historyForward()
743 history = self.IP.historyForward()
751 self.text_ctrl.writeHistory(history)
744 self.text_ctrl.writeHistory(history)
752 return
745 return
753 if event.KeyCode == wx.WXK_TAB:
746 if event.KeyCode == wx.WXK_TAB:
754 #if line empty we disable tab completion
747 #if line empty we disable tab completion
755 if not self.text_ctrl.getCurrentLine().strip():
748 if not self.text_ctrl.getCurrentLine().strip():
756 self.text_ctrl.write('\t')
749 self.text_ctrl.write('\t')
757 return
750 return
758 completed, possibilities = self.IP.complete(self.text_ctrl.getCurrentLine())
751 completed, possibilities = self.IP.complete(self.text_ctrl.getCurrentLine())
759 if len(possibilities) > 1:
752 if len(possibilities) > 1:
760 if self.text_ctrl.autocomplete_mode == 'IPYTHON':
753 if self.text_ctrl.autocomplete_mode == 'IPYTHON':
761 cur_slice = self.text_ctrl.getCurrentLine()
754 cur_slice = self.text_ctrl.getCurrentLine()
762 self.text_ctrl.write('\n')
755 self.text_ctrl.write('\n')
763 self.text_ctrl.writeCompletion(possibilities)
756 self.text_ctrl.writeCompletion(possibilities)
764 self.text_ctrl.write('\n')
757 self.text_ctrl.write('\n')
765
758
766 self.text_ctrl.showPrompt()
759 self.text_ctrl.showPrompt()
767 self.text_ctrl.write(cur_slice)
760 self.text_ctrl.write(cur_slice)
768 self.text_ctrl.changeLine(completed or cur_slice)
761 self.text_ctrl.changeLine(completed or cur_slice)
769 else:
762 else:
770 self.cur_state = 'COMPLETING'
763 self.cur_state = 'COMPLETING'
771 self.text_ctrl.writeCompletion(possibilities)
764 self.text_ctrl.writeCompletion(possibilities)
772 else:
765 else:
773 self.text_ctrl.changeLine(completed or cur_slice)
766 self.text_ctrl.changeLine(completed or cur_slice)
774 return
767 return
775 event.Skip()
768 event.Skip()
776
769
777 #------------------------ Option Section ---------------------------------
770 #------------------------ Option Section ---------------------------------
778 def evtCheckOptionCompletion(self, event):
771 def evtCheckOptionCompletion(self, event):
779 if event.IsChecked():
772 if event.IsChecked():
780 self.options['completion']['value']='STC'
773 self.options['completion']['value']='STC'
781 else:
774 else:
782 self.options['completion']['value']='IPYTHON'
775 self.options['completion']['value']='IPYTHON'
783 self.text_ctrl.setCompletionMethod(self.options['completion']['value'])
776 self.text_ctrl.setCompletionMethod(self.options['completion']['value'])
784 self.updateOptionTracker('completion',
777 self.updateOptionTracker('completion',
785 self.options['completion']['value'])
778 self.options['completion']['value'])
786 self.text_ctrl.SetFocus()
779 self.text_ctrl.SetFocus()
787
780
788 def evtCheckOptionBackgroundColor(self, event):
781 def evtCheckOptionBackgroundColor(self, event):
789 if event.IsChecked():
782 if event.IsChecked():
790 self.options['background_color']['value']='WHITE'
783 self.options['background_color']['value']='WHITE'
791 else:
784 else:
792 self.options['background_color']['value']='BLACK'
785 self.options['background_color']['value']='BLACK'
793 self.text_ctrl.setBackgroundColor(self.options['background_color']['value'])
786 self.text_ctrl.setBackgroundColor(self.options['background_color']['value'])
794 self.updateOptionTracker('background_color',
787 self.updateOptionTracker('background_color',
795 self.options['background_color']['value'])
788 self.options['background_color']['value'])
796 self.text_ctrl.SetFocus()
789 self.text_ctrl.SetFocus()
797
790
798 def getOptions(self):
791 def getOptions(self):
799 return self.options
792 return self.options
800
793
801 def reloadOptions(self,options):
794 def reloadOptions(self,options):
802 self.options = options
795 self.options = options
803 for key in self.options.keys():
796 for key in self.options.keys():
804 value = self.options[key]['value']
797 value = self.options[key]['value']
805 self.options[key]['checkbox'].SetValue(self.options[key][value])
798 self.options[key]['checkbox'].SetValue(self.options[key][value])
806 self.options[key]['setfunc'](value)
799 self.options[key]['setfunc'](value)
807
800
808
801
809 #------------------------ Hook Section -----------------------------------
802 #------------------------ Hook Section -----------------------------------
810 def updateOptionTracker(self,name,value):
803 def updateOptionTracker(self,name,value):
811 '''
804 '''
812 Default history tracker (does nothing)
805 Default history tracker (does nothing)
813 '''
806 '''
814 pass
807 pass
815
808
816 def setOptionTrackerHook(self,func):
809 def setOptionTrackerHook(self,func):
817 '''
810 '''
818 Define a new history tracker
811 Define a new history tracker
819 '''
812 '''
820 self.updateOptionTracker = func
813 self.updateOptionTracker = func
821
814
822 def updateHistoryTracker(self,command_line):
815 def updateHistoryTracker(self,command_line):
823 '''
816 '''
824 Default history tracker (does nothing)
817 Default history tracker (does nothing)
825 '''
818 '''
826 pass
819 pass
827
820
828 def setHistoryTrackerHook(self,func):
821 def setHistoryTrackerHook(self,func):
829 '''
822 '''
830 Define a new history tracker
823 Define a new history tracker
831 '''
824 '''
832 self.updateHistoryTracker = func
825 self.updateHistoryTracker = func
833
826
834 def updateStatusTracker(self,status):
827 def updateStatusTracker(self,status):
835 '''
828 '''
836 Default status tracker (does nothing)
829 Default status tracker (does nothing)
837 '''
830 '''
838 pass
831 pass
839
832
840 def setStatusTrackerHook(self,func):
833 def setStatusTrackerHook(self,func):
841 '''
834 '''
842 Define a new status tracker
835 Define a new status tracker
843 '''
836 '''
844 self.updateStatusTracker = func
837 self.updateStatusTracker = func
845
838
846 def askExitHandler(self, event):
839 def askExitHandler(self, event):
847 '''
840 '''
848 Default exit handler
841 Default exit handler
849 '''
842 '''
850 self.text_ctrl.write('\nExit callback has not been set.')
843 self.text_ctrl.write('\nExit callback has not been set.')
851
844
852 def setAskExitHandler(self, func):
845 def setAskExitHandler(self, func):
853 '''
846 '''
854 Define an exit handler
847 Define an exit handler
855 '''
848 '''
856 self.askExitHandler = func
849 self.askExitHandler = func
857
850
858 if __name__ == '__main__':
851 if __name__ == '__main__':
859 # Some simple code to test the shell widget.
852 # Some simple code to test the shell widget.
860 class MainWindow(wx.Frame):
853 class MainWindow(wx.Frame):
861 def __init__(self, parent, id, title):
854 def __init__(self, parent, id, title):
862 wx.Frame.__init__(self, parent, id, title, size=(300,250))
855 wx.Frame.__init__(self, parent, id, title, size=(300,250))
863 self._sizer = wx.BoxSizer(wx.VERTICAL)
856 self._sizer = wx.BoxSizer(wx.VERTICAL)
864 self.shell = IPShellWidget(self)
857 self.shell = IPShellWidget(self)
865 self._sizer.Add(self.shell, 1, wx.EXPAND)
858 self._sizer.Add(self.shell, 1, wx.EXPAND)
866 self.SetSizer(self._sizer)
859 self.SetSizer(self._sizer)
867 self.SetAutoLayout(1)
860 self.SetAutoLayout(1)
868 self.Show(True)
861 self.Show(True)
869
862
870 app = wx.PySimpleApp()
863 app = wx.PySimpleApp()
871 frame = MainWindow(None, wx.ID_ANY, 'Ipython')
864 frame = MainWindow(None, wx.ID_ANY, 'Ipython')
872 frame.SetSize((780, 460))
865 frame.SetSize((780, 460))
873 shell = frame.shell
866 shell = frame.shell
874
867
875 app.MainLoop()
868 app.MainLoop()
876
869
877
870
@@ -1,7660 +1,7673 b''
1 2008-06-03 Ville Vainio <vivainio@gmail.com>
2
3 * ipython.rst, ipython.1: remove -twisted from man page,
4 add -pydb to both man page and manual.
5
6 * pspersistence.py: report UsageError on %store -w w/o arg,
7 and other usage pattern errors. Bug report by Johann Cohen-Tanugi.
8
1 2008-06-02 Fernando Perez <Fernando.Perez@berkeley.edu>
9 2008-06-02 Fernando Perez <Fernando.Perez@berkeley.edu>
2
10
3 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): add
11 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): add
4 numpy/np/pyplot/plt imports according to new conventions we're
12 numpy/np/pyplot/plt imports according to new conventions we're
5 trying to standardize on. This only affects the -pylab mode.
13 trying to standardize on. This only affects the -pylab mode.
6
14
15 2008-05-31 Fernando Perez <Fernando.Perez@berkeley.edu>
16
17 * IPython/ipmaker.py (make_IPython): The -twisted option is fully
18 disabled.
19
7 2008-05-31 *** Released version 0.8.4
20 2008-05-31 *** Released version 0.8.4
8
21
9 2008-05-31 Fernando Perez <Fernando.Perez@berkeley.edu>
22 2008-05-31 Fernando Perez <Fernando.Perez@berkeley.edu>
10
23
11 * IPython/ipmaker.py (make_IPython): The -twisted option is fully
24 * IPython/ipmaker.py (make_IPython): The -twisted option is fully
12 disabled.
25 disabled.
13
26
14 * IPython/Shell.py (_select_shell): completely disable -twisted.
27 * IPython/Shell.py (_select_shell): completely disable -twisted.
15 This code is of dubious quality and normal users should not
28 This code is of dubious quality and normal users should not
16 encounter it until we can clarify things further, even under
29 encounter it until we can clarify things further, even under
17 win32. Since we need a quick emergency 0.8.4 release, it is now
30 win32. Since we need a quick emergency 0.8.4 release, it is now
18 disabled completely. Users who want to run it can use the
31 disabled completely. Users who want to run it can use the
19 following command (it's easy to put it in an alias or script):
32 following command (it's easy to put it in an alias or script):
20
33
21 python -c"from IPython import twshell;twshell.IPShellTwisted().mainloop()"
34 python -c"from IPython import twshell;twshell.IPShellTwisted().mainloop()"
22
35
23 2008-05-30 Ville Vainio <vivainio@gmail.com>
36 2008-05-30 Ville Vainio <vivainio@gmail.com>
24
37
25 * shell.py: disable -twisted on non-win32 platforms.
38 * shell.py: disable -twisted on non-win32 platforms.
26 import sets module on python 2.3.
39 import sets module on python 2.3.
27
40
28 * ipy_profile_sh.py: disable ipy_signals. Now, ipython
41 * ipy_profile_sh.py: disable ipy_signals. Now, ipython
29 is verified to work with python 2.3
42 is verified to work with python 2.3
30
43
31 * Release.py: update version to 0.8.4 for quick point fix
44 * Release.py: update version to 0.8.4 for quick point fix
32
45
33 2008-05-28 *** Released version 0.8.3
46 2008-05-28 *** Released version 0.8.3
34
47
35 2008-05-28 Fernando Perez <Fernando.Perez@berkeley.edu>
48 2008-05-28 Fernando Perez <Fernando.Perez@berkeley.edu>
36
49
37 * ../win32_manual_post_install.py (run): Fix the windows installer
50 * ../win32_manual_post_install.py (run): Fix the windows installer
38 so the links to the docs are correct.
51 so the links to the docs are correct.
39
52
40 * IPython/ultraTB.py: flush stderr after writing to it to fix
53 * IPython/ultraTB.py: flush stderr after writing to it to fix
41 problems with exception traceback ordering in some platforms.
54 problems with exception traceback ordering in some platforms.
42 Thanks to a report/fix by Jie Tang <jietang86-AT-gmail.com>.
55 Thanks to a report/fix by Jie Tang <jietang86-AT-gmail.com>.
43
56
44 * IPython/Magic.py (magic_cpaste): add stripping of continuation
57 * IPython/Magic.py (magic_cpaste): add stripping of continuation
45 prompts, feature requested by Stefan vdW.
58 prompts, feature requested by Stefan vdW.
46
59
47 * ../setup.py: updates to build and release tools in preparation
60 * ../setup.py: updates to build and release tools in preparation
48 for 0.8.3 release.
61 for 0.8.3 release.
49
62
50 2008-05-27 Ville Vainio <vivainio@gmail.com>
63 2008-05-27 Ville Vainio <vivainio@gmail.com>
51
64
52 * iplib.py, ipmaker.py: survive lack of doctest and site._Helper
65 * iplib.py, ipmaker.py: survive lack of doctest and site._Helper
53 for minimal environments (e.g. Maemo sdk python)
66 for minimal environments (e.g. Maemo sdk python)
54
67
55 * Magic.py: cpaste strips whitespace before >>> (allow pasting
68 * Magic.py: cpaste strips whitespace before >>> (allow pasting
56 doctests)
69 doctests)
57
70
58 * ipy_completers.py: cd completer now does recursive path expand
71 * ipy_completers.py: cd completer now does recursive path expand
59 (old behaviour is buggy on some readline versions)
72 (old behaviour is buggy on some readline versions)
60
73
61 2008-05-14 Ville Vainio <vivainio@gmail.com>
74 2008-05-14 Ville Vainio <vivainio@gmail.com>
62
75
63 * Extensions/ipy_greedycompleter.py:
76 * Extensions/ipy_greedycompleter.py:
64 New extension that enables a bit more "relaxed" tab
77 New extension that enables a bit more "relaxed" tab
65 completer that evaluates code without safety checks
78 completer that evaluates code without safety checks
66 (i.e. there can be side effects like function calls)
79 (i.e. there can be side effects like function calls)
67
80
68 2008-04-20 Ville Vainio <vivainio@gmail.com>
81 2008-04-20 Ville Vainio <vivainio@gmail.com>
69
82
70 * Extensions/ipy_lookfor.py: add %lookfor magic command
83 * Extensions/ipy_lookfor.py: add %lookfor magic command
71 (search docstrings for words) by Pauli Virtanen. Close #245.
84 (search docstrings for words) by Pauli Virtanen. Close #245.
72
85
73 * Extension/ipy_jot.py: %jot and %read magics, analogous
86 * Extension/ipy_jot.py: %jot and %read magics, analogous
74 to %store but you can specify some notes. Not read
87 to %store but you can specify some notes. Not read
75 in automatically on startup, you need %read.
88 in automatically on startup, you need %read.
76 Contributed by Yichun Wei.
89 Contributed by Yichun Wei.
77
90
78 2008-04-18 Fernando Perez <Fernando.Perez@berkeley.edu>
91 2008-04-18 Fernando Perez <Fernando.Perez@berkeley.edu>
79
92
80 * IPython/genutils.py (page): apply workaround to curses bug that
93 * IPython/genutils.py (page): apply workaround to curses bug that
81 can leave terminal corrupted after a call to initscr().
94 can leave terminal corrupted after a call to initscr().
82
95
83 2008-04-15 Ville Vainio <vivainio@gmail.com>
96 2008-04-15 Ville Vainio <vivainio@gmail.com>
84
97
85 * genutils.py: SList.grep supports 'field' argument
98 * genutils.py: SList.grep supports 'field' argument
86
99
87 * ipy_completers.py: module completer looks inside
100 * ipy_completers.py: module completer looks inside
88 .egg zip files (patch by mc). Close #196.
101 .egg zip files (patch by mc). Close #196.
89
102
90 2008-04-09 Ville Vainio <vivainio@gmail.com>
103 2008-04-09 Ville Vainio <vivainio@gmail.com>
91
104
92 * deep_reload.py: do not crash on from __future__ import
105 * deep_reload.py: do not crash on from __future__ import
93 absolute_import. Close #244.
106 absolute_import. Close #244.
94
107
95 2008-04-02 Ville Vainio <vivainio@gmail.com>
108 2008-04-02 Ville Vainio <vivainio@gmail.com>
96
109
97 * ipy_winpdb.py: New extension for winpdb integration. %wdb
110 * ipy_winpdb.py: New extension for winpdb integration. %wdb
98 test.py is winpdb equivalent of %run -d test.py. winpdb is a
111 test.py is winpdb equivalent of %run -d test.py. winpdb is a
99 crossplatform remote GUI debugger based on wxpython.
112 crossplatform remote GUI debugger based on wxpython.
100
113
101 2008-03-29 Ville Vainio <vivainio@gmail.com>
114 2008-03-29 Ville Vainio <vivainio@gmail.com>
102
115
103 * ipython.rst, do_sphinx.py: New documentation base, based on
116 * ipython.rst, do_sphinx.py: New documentation base, based on
104 reStucturedText and Sphinx (html/pdf generation). The old Lyx
117 reStucturedText and Sphinx (html/pdf generation). The old Lyx
105 based documentation will not be updated anymore.
118 based documentation will not be updated anymore.
106
119
107 * jobctrl.py: Use shell in Popen for 'start' command (in windows).
120 * jobctrl.py: Use shell in Popen for 'start' command (in windows).
108
121
109 2008-03-24 Ville Vainio <vivainio@gmail.com>
122 2008-03-24 Ville Vainio <vivainio@gmail.com>
110
123
111 * ipython.rst, do_sphinx.py: New documentation base, based on
124 * ipython.rst, do_sphinx.py: New documentation base, based on
112 reStucturedText and Sphinx (html/pdf generation). The old Lyx
125 reStucturedText and Sphinx (html/pdf generation). The old Lyx
113 based documentation will not be updated anymore.
126 based documentation will not be updated anymore.
114
127
115 ipython.rst has up to date documentation on matters that were not
128 ipython.rst has up to date documentation on matters that were not
116 documented at all, and it also removes various
129 documented at all, and it also removes various
117 misdocumented/deprecated features.
130 misdocumented/deprecated features.
118
131
119 2008-03-22 Ville Vainio <vivainio@gmail.com>
132 2008-03-22 Ville Vainio <vivainio@gmail.com>
120
133
121 * Shell.py: Merge mtexp branch:
134 * Shell.py: Merge mtexp branch:
122 https://code.launchpad.net/~ipython/ipython/mtexp
135 https://code.launchpad.net/~ipython/ipython/mtexp
123
136
124 Privides simpler and more robust MTInteractiveShell that won't
137 Privides simpler and more robust MTInteractiveShell that won't
125 deadlock, even when the worker thread (GUI) stops doing runcode()
138 deadlock, even when the worker thread (GUI) stops doing runcode()
126 regularly. r71.
139 regularly. r71.
127
140
128 2008-03-20 Ville Vainio <vivainio@gmail.com>
141 2008-03-20 Ville Vainio <vivainio@gmail.com>
129
142
130 * twshell.py: New shell that runs IPython code in Twisted reactor.
143 * twshell.py: New shell that runs IPython code in Twisted reactor.
131 Launch by doing ipython -twisted. r67.
144 Launch by doing ipython -twisted. r67.
132
145
133 2008-03-19 Ville Vainio <vivainio@gmail.com>
146 2008-03-19 Ville Vainio <vivainio@gmail.com>
134
147
135 * Magic.py: %rehashx works correctly when shadowed system commands
148 * Magic.py: %rehashx works correctly when shadowed system commands
136 have upper case characters (e.g. Print.exe). r64.
149 have upper case characters (e.g. Print.exe). r64.
137
150
138 * ipy_bzr.py, ipy_app_completers.py: new bzr completer that also
151 * ipy_bzr.py, ipy_app_completers.py: new bzr completer that also
139 knows options to commands, based on bzrtools. Uses bzrlib
152 knows options to commands, based on bzrtools. Uses bzrlib
140 directly. r66.
153 directly. r66.
141
154
142 2008-03-16 Ville Vainio <vivainio@gmail.com>
155 2008-03-16 Ville Vainio <vivainio@gmail.com>
143
156
144 * make_tarball.py: Fixed for bzr.
157 * make_tarball.py: Fixed for bzr.
145
158
146 * ipapi.py: Better _ip.runlines() script cleanup. r56,r79.
159 * ipapi.py: Better _ip.runlines() script cleanup. r56,r79.
147
160
148 * ipy_vimserver.py, ipy.vim: New extension for vim server mode,
161 * ipy_vimserver.py, ipy.vim: New extension for vim server mode,
149 by Erich Heine.
162 by Erich Heine.
150
163
151 2008-03-12 Ville Vainio <vivainio@gmail.com>
164 2008-03-12 Ville Vainio <vivainio@gmail.com>
152
165
153 * ipmaker.py: Force (reload?) import of ipy_user_conf and
166 * ipmaker.py: Force (reload?) import of ipy_user_conf and
154 ipy_profile_foo, so that embedded instances can be relaunched and
167 ipy_profile_foo, so that embedded instances can be relaunched and
155 configuration is still done. r50
168 configuration is still done. r50
156
169
157 * ipapi.py, test_embed.py: Allow specifying shell class in
170 * ipapi.py, test_embed.py: Allow specifying shell class in
158 launch_new_instance & make_new instance. Use this in
171 launch_new_instance & make_new instance. Use this in
159 test_embed.py. r51.
172 test_embed.py. r51.
160
173
161 test_embed.py is also a good and simple demo of embedding IPython.
174 test_embed.py is also a good and simple demo of embedding IPython.
162
175
163
176
164 2008-03-10 Ville Vainio <vivainio@gmail.com>
177 2008-03-10 Ville Vainio <vivainio@gmail.com>
165
178
166 * tool/update_revnum.py: Change to bzr revisioning scheme in
179 * tool/update_revnum.py: Change to bzr revisioning scheme in
167 revision numbers.
180 revision numbers.
168
181
169 * Shell.py: Threading improvements:
182 * Shell.py: Threading improvements:
170
183
171 In multithreaded shells, do not hang on macros and o.autoexec
184 In multithreaded shells, do not hang on macros and o.autoexec
172 commands (or anything executed with _ip.runlines()) anymore. Allow
185 commands (or anything executed with _ip.runlines()) anymore. Allow
173 recursive execution of IPython code in
186 recursive execution of IPython code in
174 MTInteractiveShell.runsource by checking if we are already in
187 MTInteractiveShell.runsource by checking if we are already in
175 worker thread, and execute code directly if we are. r48.
188 worker thread, and execute code directly if we are. r48.
176
189
177 MTInteractiveShell.runsource: execute code directly if worker
190 MTInteractiveShell.runsource: execute code directly if worker
178 thread is not running yet (this is the case in config files). r49.
191 thread is not running yet (this is the case in config files). r49.
179
192
180 2008-03-09 Ville Vainio <vivainio@gmail.com>
193 2008-03-09 Ville Vainio <vivainio@gmail.com>
181
194
182 * ipy_profile_sh.py: You can now use $LA or LA() to refer to last
195 * ipy_profile_sh.py: You can now use $LA or LA() to refer to last
183 argument of previous command in sh profile. Similar to bash '!$'.
196 argument of previous command in sh profile. Similar to bash '!$'.
184 LA(3) or $LA(3) stands for last argument of input history command
197 LA(3) or $LA(3) stands for last argument of input history command
185 3.
198 3.
186
199
187 * Shell.py: -pylab names don't clutter %whos listing.
200 * Shell.py: -pylab names don't clutter %whos listing.
188
201
189 2008-03-07 Ville Vainio <vivainio@gmail.com>
202 2008-03-07 Ville Vainio <vivainio@gmail.com>
190
203
191 * ipy_autoreload.py: new extension (by Pauli Virtanen) for
204 * ipy_autoreload.py: new extension (by Pauli Virtanen) for
192 autoreloading modules; try %autoreload and %aimport. Close #154.
205 autoreloading modules; try %autoreload and %aimport. Close #154.
193 Uses the new pre_runcode_hook.
206 Uses the new pre_runcode_hook.
194
207
195 2008-02-24 Ville Vainio <vivainio@gmail.com>
208 2008-02-24 Ville Vainio <vivainio@gmail.com>
196
209
197 * platutils_posix.py: freeze_term_title works
210 * platutils_posix.py: freeze_term_title works
198
211
199 2008-02-21 Ville Vainio <vivainio@gmail.com>
212 2008-02-21 Ville Vainio <vivainio@gmail.com>
200
213
201 * Magic.py: %quickref does not crash with empty docstring
214 * Magic.py: %quickref does not crash with empty docstring
202
215
203 2008-02-20 Ville Vainio <vivainio@gmail.com>
216 2008-02-20 Ville Vainio <vivainio@gmail.com>
204
217
205 * completer.py: do not treat [](){} as protectable chars anymore,
218 * completer.py: do not treat [](){} as protectable chars anymore,
206 close #233.
219 close #233.
207
220
208 * completer.py: do not treat [](){} as protectable chars anymore
221 * completer.py: do not treat [](){} as protectable chars anymore
209
222
210 * magic.py, test_cpaste.py: Allow different prefix for pasting
223 * magic.py, test_cpaste.py: Allow different prefix for pasting
211 from email
224 from email
212
225
213 2008-02-17 Ville Vainio <vivainio@gmail.com>
226 2008-02-17 Ville Vainio <vivainio@gmail.com>
214
227
215 * Switched over to Launchpad/bzr as primary VCS.
228 * Switched over to Launchpad/bzr as primary VCS.
216
229
217 2008-02-14 Ville Vainio <vivainio@gmail.com>
230 2008-02-14 Ville Vainio <vivainio@gmail.com>
218
231
219 * ipapi.py: _ip.runlines() is now much more liberal about
232 * ipapi.py: _ip.runlines() is now much more liberal about
220 indentation - it cleans up the scripts it gets
233 indentation - it cleans up the scripts it gets
221
234
222 2008-02-14 Ville Vainio <vivainio@gmail.com>
235 2008-02-14 Ville Vainio <vivainio@gmail.com>
223
236
224 * Extensions/ipy_leo.py: created 'ILeo' IPython-Leo bridge.
237 * Extensions/ipy_leo.py: created 'ILeo' IPython-Leo bridge.
225 Changes to it (later on) are too numerous to list in ChangeLog
238 Changes to it (later on) are too numerous to list in ChangeLog
226 until it stabilizes
239 until it stabilizes
227
240
228 2008-02-07 Darren Dale <darren.dale@cornell.edu>
241 2008-02-07 Darren Dale <darren.dale@cornell.edu>
229
242
230 * IPython/Shell.py: Call QtCore.pyqtRemoveInputHook() when creating
243 * IPython/Shell.py: Call QtCore.pyqtRemoveInputHook() when creating
231 an IPShellQt4. PyQt4-4.2.1 and later uses PyOS_InputHook to improve
244 an IPShellQt4. PyQt4-4.2.1 and later uses PyOS_InputHook to improve
232 interaction in the interpreter (like Tkinter does), but it seems to
245 interaction in the interpreter (like Tkinter does), but it seems to
233 partially interfere with the IPython implementation and exec_()
246 partially interfere with the IPython implementation and exec_()
234 still seems to block. So we disable the PyQt implementation and
247 still seems to block. So we disable the PyQt implementation and
235 stick with the IPython one for now.
248 stick with the IPython one for now.
236
249
237 2008-02-02 Walter Doerwald <walter@livinglogic.de>
250 2008-02-02 Walter Doerwald <walter@livinglogic.de>
238
251
239 * ipipe.py: A new ipipe table has been added: ialias produces all
252 * ipipe.py: A new ipipe table has been added: ialias produces all
240 entries from IPython's alias table.
253 entries from IPython's alias table.
241
254
242 2008-02-01 Fernando Perez <Fernando.Perez@colorado.edu>
255 2008-02-01 Fernando Perez <Fernando.Perez@colorado.edu>
243
256
244 * IPython/Shell.py (MTInteractiveShell.runcode): Improve handling
257 * IPython/Shell.py (MTInteractiveShell.runcode): Improve handling
245 of KBINT in threaded shells. After code provided by Marc in #212.
258 of KBINT in threaded shells. After code provided by Marc in #212.
246
259
247 2008-01-30 Fernando Perez <Fernando.Perez@colorado.edu>
260 2008-01-30 Fernando Perez <Fernando.Perez@colorado.edu>
248
261
249 * IPython/Shell.py (MTInteractiveShell.__init__): Fixed deadlock
262 * IPython/Shell.py (MTInteractiveShell.__init__): Fixed deadlock
250 that could occur due to a race condition in threaded shells.
263 that could occur due to a race condition in threaded shells.
251 Thanks to code provided by Marc, as #210.
264 Thanks to code provided by Marc, as #210.
252
265
253 2008-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
266 2008-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
254
267
255 * IPython/Magic.py (magic_doctest_mode): respect the user's
268 * IPython/Magic.py (magic_doctest_mode): respect the user's
256 settings for input separators rather than overriding them. After
269 settings for input separators rather than overriding them. After
257 a report by Jeff Kowalczyk <jtk-AT-yahoo.com>
270 a report by Jeff Kowalczyk <jtk-AT-yahoo.com>
258
271
259 * IPython/history.py (magic_history): Add support for declaring an
272 * IPython/history.py (magic_history): Add support for declaring an
260 output file directly from the history command.
273 output file directly from the history command.
261
274
262 2008-01-21 Walter Doerwald <walter@livinglogic.de>
275 2008-01-21 Walter Doerwald <walter@livinglogic.de>
263
276
264 * ipipe.py: Register ipipe's displayhooks via the generic function
277 * ipipe.py: Register ipipe's displayhooks via the generic function
265 generics.result_display() instead of using ipapi.set_hook().
278 generics.result_display() instead of using ipapi.set_hook().
266
279
267 2008-01-19 Walter Doerwald <walter@livinglogic.de>
280 2008-01-19 Walter Doerwald <walter@livinglogic.de>
268
281
269 * ibrowse.py, igrid.py, ipipe.py:
282 * ibrowse.py, igrid.py, ipipe.py:
270 The input object can now be passed to the constructor of the display classes.
283 The input object can now be passed to the constructor of the display classes.
271 This makes it possible to use them with objects that implement __or__.
284 This makes it possible to use them with objects that implement __or__.
272 Use this constructor in the displayhook instead of piping.
285 Use this constructor in the displayhook instead of piping.
273
286
274 * ipipe.py: Importing astyle.py is done as late as possible to
287 * ipipe.py: Importing astyle.py is done as late as possible to
275 avoid problems with circular imports.
288 avoid problems with circular imports.
276
289
277 2008-01-19 Ville Vainio <vivainio@gmail.com>
290 2008-01-19 Ville Vainio <vivainio@gmail.com>
278
291
279 * hooks.py, iplib.py: Added 'shell_hook' to customize how
292 * hooks.py, iplib.py: Added 'shell_hook' to customize how
280 IPython calls shell.
293 IPython calls shell.
281
294
282 * hooks.py, iplib.py: Added 'show_in_pager' hook to specify
295 * hooks.py, iplib.py: Added 'show_in_pager' hook to specify
283 how IPython pages text (%page, %pycat, %pdoc etc.)
296 how IPython pages text (%page, %pycat, %pdoc etc.)
284
297
285 * Extensions/jobctrl.py: Use shell_hook. New magics: '%tasks'
298 * Extensions/jobctrl.py: Use shell_hook. New magics: '%tasks'
286 and '%kill' to kill hanging processes that won't obey ctrl+C.
299 and '%kill' to kill hanging processes that won't obey ctrl+C.
287
300
288 2008-01-16 Ville Vainio <vivainio@gmail.com>
301 2008-01-16 Ville Vainio <vivainio@gmail.com>
289
302
290 * ipy_completers.py: pyw extension support for %run completer.
303 * ipy_completers.py: pyw extension support for %run completer.
291
304
292 2008-01-11 Ville Vainio <vivainio@gmail.com>
305 2008-01-11 Ville Vainio <vivainio@gmail.com>
293
306
294 * iplib.py, ipmaker.py: new rc option - autoexec. It's a list
307 * iplib.py, ipmaker.py: new rc option - autoexec. It's a list
295 of ipython commands to be run when IPython has started up
308 of ipython commands to be run when IPython has started up
296 (just before running the scripts and -c arg on command line).
309 (just before running the scripts and -c arg on command line).
297
310
298 * ipy_user_conf.py: Added an example on how to change term
311 * ipy_user_conf.py: Added an example on how to change term
299 colors in config file (through using autoexec).
312 colors in config file (through using autoexec).
300
313
301 * completer.py, test_completer.py: Ability to specify custom
314 * completer.py, test_completer.py: Ability to specify custom
302 get_endidx to replace readline.get_endidx. For emacs users.
315 get_endidx to replace readline.get_endidx. For emacs users.
303
316
304 2008-01-10 Ville Vainio <vivainio@gmail.com>
317 2008-01-10 Ville Vainio <vivainio@gmail.com>
305
318
306 * Prompts.py (set_p_str): do not crash on illegal prompt strings
319 * Prompts.py (set_p_str): do not crash on illegal prompt strings
307
320
308 2008-01-08 Ville Vainio <vivainio@gmail.com>
321 2008-01-08 Ville Vainio <vivainio@gmail.com>
309
322
310 * '%macro -r' (raw mode) is now default in sh profile.
323 * '%macro -r' (raw mode) is now default in sh profile.
311
324
312 2007-12-31 Ville Vainio <vivainio@gmail.com>
325 2007-12-31 Ville Vainio <vivainio@gmail.com>
313
326
314 * completer.py: custom completer matching is now case sensitive
327 * completer.py: custom completer matching is now case sensitive
315 (#207).
328 (#207).
316
329
317 * ultraTB.py, iplib.py: Add some KeyboardInterrupt catching in
330 * ultraTB.py, iplib.py: Add some KeyboardInterrupt catching in
318 an attempt to prevent occasional crashes.
331 an attempt to prevent occasional crashes.
319
332
320 * CrashHandler.py: Crash log dump now asks user to press enter
333 * CrashHandler.py: Crash log dump now asks user to press enter
321 before exiting.
334 before exiting.
322
335
323 * Store _ip in user_ns instead of __builtin__, enabling safer
336 * Store _ip in user_ns instead of __builtin__, enabling safer
324 coexistence of multiple IPython instances in the same python
337 coexistence of multiple IPython instances in the same python
325 interpreter (#197).
338 interpreter (#197).
326
339
327 * Debugger.py, ipmaker.py: Need to add '-pydb' command line
340 * Debugger.py, ipmaker.py: Need to add '-pydb' command line
328 switch to enable pydb in post-mortem debugging and %run -d.
341 switch to enable pydb in post-mortem debugging and %run -d.
329
342
330 2007-12-28 Ville Vainio <vivainio@gmail.com>
343 2007-12-28 Ville Vainio <vivainio@gmail.com>
331
344
332 * ipy_server.py: TCP socket server for "remote control" of an IPython
345 * ipy_server.py: TCP socket server for "remote control" of an IPython
333 instance.
346 instance.
334
347
335 * Debugger.py: Change to PSF license
348 * Debugger.py: Change to PSF license
336
349
337 * simplegeneric.py: Add license & author notes.
350 * simplegeneric.py: Add license & author notes.
338
351
339 * ipy_fsops.py: Added PathObj and FileObj, an object-oriented way
352 * ipy_fsops.py: Added PathObj and FileObj, an object-oriented way
340 to navigate file system with a custom completer. Run
353 to navigate file system with a custom completer. Run
341 ipy_fsops.test_pathobj() to play with it.
354 ipy_fsops.test_pathobj() to play with it.
342
355
343 2007-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
356 2007-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
344
357
345 * IPython/dtutils.py: Add utilities for interactively running
358 * IPython/dtutils.py: Add utilities for interactively running
346 doctests. Still needs work to more easily handle the namespace of
359 doctests. Still needs work to more easily handle the namespace of
347 the package one may be working on, but the basics are in place.
360 the package one may be working on, but the basics are in place.
348
361
349 2007-12-27 Ville Vainio <vivainio@gmail.com>
362 2007-12-27 Ville Vainio <vivainio@gmail.com>
350
363
351 * ipy_completers.py: Applied arno's patch to get proper list of
364 * ipy_completers.py: Applied arno's patch to get proper list of
352 packages in import completer. Closes #196.
365 packages in import completer. Closes #196.
353
366
354 2007-12-20 Ville Vainio <vivainio@gmail.com>
367 2007-12-20 Ville Vainio <vivainio@gmail.com>
355
368
356 * completer.py, generics.py(complete_object): Allow
369 * completer.py, generics.py(complete_object): Allow
357 custom complers based on python objects via simplegeneric.
370 custom complers based on python objects via simplegeneric.
358 See generics.py / my_demo_complete_object
371 See generics.py / my_demo_complete_object
359
372
360 2007-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
373 2007-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
361
374
362 * IPython/Prompts.py (BasePrompt.__nonzero__): add proper boolean
375 * IPython/Prompts.py (BasePrompt.__nonzero__): add proper boolean
363 behavior to prompt objects, useful for display hooks to adjust
376 behavior to prompt objects, useful for display hooks to adjust
364 themselves depending on whether prompts will be there or not.
377 themselves depending on whether prompts will be there or not.
365
378
366 2007-12-13 Ville Vainio <vivainio@gmail.com>
379 2007-12-13 Ville Vainio <vivainio@gmail.com>
367
380
368 * iplib.py(raw_input): unix readline does not allow unicode in
381 * iplib.py(raw_input): unix readline does not allow unicode in
369 history, encode to normal string. After patch by Tiago.
382 history, encode to normal string. After patch by Tiago.
370 Close #201
383 Close #201
371
384
372 2007-12-12 Ville Vainio <vivainio@gmail.com>
385 2007-12-12 Ville Vainio <vivainio@gmail.com>
373
386
374 * genutils.py (abbrev_cwd): Terminal title now shows 2 levels of
387 * genutils.py (abbrev_cwd): Terminal title now shows 2 levels of
375 current directory.
388 current directory.
376
389
377 2007-12-12 Fernando Perez <Fernando.Perez@colorado.edu>
390 2007-12-12 Fernando Perez <Fernando.Perez@colorado.edu>
378
391
379 * IPython/Shell.py (_select_shell): add support for controlling
392 * IPython/Shell.py (_select_shell): add support for controlling
380 the pylab threading mode directly at the command line, without
393 the pylab threading mode directly at the command line, without
381 having to modify MPL config files. Added unit tests for this
394 having to modify MPL config files. Added unit tests for this
382 feature, though manual/docs update is still pending, will do later.
395 feature, though manual/docs update is still pending, will do later.
383
396
384 2007-12-11 Ville Vainio <vivainio@gmail.com>
397 2007-12-11 Ville Vainio <vivainio@gmail.com>
385
398
386 * ext_rescapture.py: var = !cmd is no longer verbose (to facilitate
399 * ext_rescapture.py: var = !cmd is no longer verbose (to facilitate
387 use in scripts)
400 use in scripts)
388
401
389 2007-12-07 Ville Vainio <vivainio@gmail.com>
402 2007-12-07 Ville Vainio <vivainio@gmail.com>
390
403
391 * iplib.py, ipy_profile_sh.py: Do not escape # on command lines
404 * iplib.py, ipy_profile_sh.py: Do not escape # on command lines
392 anymore (to \#) - even if it is a comment char that is implicitly
405 anymore (to \#) - even if it is a comment char that is implicitly
393 escaped in some unix shells in interactive mode, it is ok to leave
406 escaped in some unix shells in interactive mode, it is ok to leave
394 it in IPython as such.
407 it in IPython as such.
395
408
396
409
397 2007-12-01 Robert Kern <robert.kern@gmail.com>
410 2007-12-01 Robert Kern <robert.kern@gmail.com>
398
411
399 * IPython/ultraTB.py (findsource): Improve the monkeypatch to
412 * IPython/ultraTB.py (findsource): Improve the monkeypatch to
400 inspect.findsource(). It can now find source lines inside zipped
413 inspect.findsource(). It can now find source lines inside zipped
401 packages.
414 packages.
402
415
403 * IPython/ultraTB.py: When constructing tracebacks, try to use __file__
416 * IPython/ultraTB.py: When constructing tracebacks, try to use __file__
404 in the frame's namespace before trusting the filename in the code object
417 in the frame's namespace before trusting the filename in the code object
405 which created the frame.
418 which created the frame.
406
419
407 2007-11-29 *** Released version 0.8.2
420 2007-11-29 *** Released version 0.8.2
408
421
409 2007-11-25 Fernando Perez <Fernando.Perez@colorado.edu>
422 2007-11-25 Fernando Perez <Fernando.Perez@colorado.edu>
410
423
411 * IPython/Logger.py (Logger.logstop): add a proper logstop()
424 * IPython/Logger.py (Logger.logstop): add a proper logstop()
412 method to fully stop the logger, along with a corresponding
425 method to fully stop the logger, along with a corresponding
413 %logstop magic for interactive use.
426 %logstop magic for interactive use.
414
427
415 * IPython/Extensions/ipy_host_completers.py: added new host
428 * IPython/Extensions/ipy_host_completers.py: added new host
416 completers functionality, contributed by Gael Pasgrimaud
429 completers functionality, contributed by Gael Pasgrimaud
417 <gawel-AT-afpy.org>.
430 <gawel-AT-afpy.org>.
418
431
419 2007-11-24 Fernando Perez <Fernando.Perez@colorado.edu>
432 2007-11-24 Fernando Perez <Fernando.Perez@colorado.edu>
420
433
421 * IPython/DPyGetOpt.py (ArgumentError): Apply patch by Paul Mueller
434 * IPython/DPyGetOpt.py (ArgumentError): Apply patch by Paul Mueller
422 <gakusei-AT-dakotacom.net>, to fix deprecated string exceptions in
435 <gakusei-AT-dakotacom.net>, to fix deprecated string exceptions in
423 options handling. Unicode fix in %whos (committed a while ago)
436 options handling. Unicode fix in %whos (committed a while ago)
424 was also contributed by Paul.
437 was also contributed by Paul.
425
438
426 2007-11-23 Darren Dale <darren.dale@cornell.edu>
439 2007-11-23 Darren Dale <darren.dale@cornell.edu>
427 * ipy_traits_completer.py: let traits_completer respect the user's
440 * ipy_traits_completer.py: let traits_completer respect the user's
428 readline_omit__names setting.
441 readline_omit__names setting.
429
442
430 2007-11-08 Ville Vainio <vivainio@gmail.com>
443 2007-11-08 Ville Vainio <vivainio@gmail.com>
431
444
432 * ipy_completers.py (import completer): assume 'xml' module exists.
445 * ipy_completers.py (import completer): assume 'xml' module exists.
433 Do not add every module twice anymore. Closes #196.
446 Do not add every module twice anymore. Closes #196.
434
447
435 * ipy_completers.py, ipy_app_completers.py: Add proper apt-get
448 * ipy_completers.py, ipy_app_completers.py: Add proper apt-get
436 completer that uses apt-cache to search for existing packages.
449 completer that uses apt-cache to search for existing packages.
437
450
438 2007-11-06 Ville Vainio <vivainio@gmail.com>
451 2007-11-06 Ville Vainio <vivainio@gmail.com>
439
452
440 * Prompts.py: Do not update _oh and _123 when do_full_cache is not
453 * Prompts.py: Do not update _oh and _123 when do_full_cache is not
441 true. Closes #194.
454 true. Closes #194.
442
455
443 2007-11-01 Brian Granger <ellisonbg@gmail.com>
456 2007-11-01 Brian Granger <ellisonbg@gmail.com>
444
457
445 * iplib.py, rlineimpl.py: Applied Body Water's patches to get IPython
458 * iplib.py, rlineimpl.py: Applied Body Water's patches to get IPython
446 working with OS X 10.5 libedit implementation of readline.
459 working with OS X 10.5 libedit implementation of readline.
447
460
448 2007-10-24 Ville Vainio <vivainio@gmail.com>
461 2007-10-24 Ville Vainio <vivainio@gmail.com>
449
462
450 * iplib.py(user_setup): To route around buggy installations where
463 * iplib.py(user_setup): To route around buggy installations where
451 UserConfig is not available, create a minimal _ipython.
464 UserConfig is not available, create a minimal _ipython.
452
465
453 * iplib.py: Unicode fixes from Jorgen.
466 * iplib.py: Unicode fixes from Jorgen.
454
467
455 * genutils.py: Slist now has new method 'fields()' for extraction of
468 * genutils.py: Slist now has new method 'fields()' for extraction of
456 whitespace-separated fields from line-oriented data.
469 whitespace-separated fields from line-oriented data.
457
470
458 2007-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
471 2007-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
459
472
460 * IPython/OInspect.py (Inspector.pinfo): fix bug that could arise
473 * IPython/OInspect.py (Inspector.pinfo): fix bug that could arise
461 when querying objects with no __class__ attribute (such as
474 when querying objects with no __class__ attribute (such as
462 f2py-generated modules).
475 f2py-generated modules).
463
476
464 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
477 2007-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
465
478
466 * IPython/Magic.py (magic_time): track compilation time and report
479 * IPython/Magic.py (magic_time): track compilation time and report
467 it if longer than 0.1s (fix done to %time and %timeit). After a
480 it if longer than 0.1s (fix done to %time and %timeit). After a
468 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
481 SAGE bug report: http://trac.sagemath.org/sage_trac/ticket/632.
469
482
470 2007-09-18 Ville Vainio <vivainio@gmail.com>
483 2007-09-18 Ville Vainio <vivainio@gmail.com>
471
484
472 * genutils.py(make_quoted_expr): Do not use Itpl, it does
485 * genutils.py(make_quoted_expr): Do not use Itpl, it does
473 not support unicode at the moment. Fixes (many) magic calls with
486 not support unicode at the moment. Fixes (many) magic calls with
474 special characters.
487 special characters.
475
488
476 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
489 2007-09-14 Fernando Perez <Fernando.Perez@colorado.edu>
477
490
478 * IPython/genutils.py (doctest_reload): expose the doctest
491 * IPython/genutils.py (doctest_reload): expose the doctest
479 reloader to the user so that people can easily reset doctest while
492 reloader to the user so that people can easily reset doctest while
480 using it interactively. Fixes a problem reported by Jorgen.
493 using it interactively. Fixes a problem reported by Jorgen.
481
494
482 * IPython/iplib.py (InteractiveShell.__init__): protect the
495 * IPython/iplib.py (InteractiveShell.__init__): protect the
483 FakeModule instances used for __main__ in %run calls from
496 FakeModule instances used for __main__ in %run calls from
484 deletion, so that user code defined in them isn't left with
497 deletion, so that user code defined in them isn't left with
485 dangling references due to the Python module deletion machinery.
498 dangling references due to the Python module deletion machinery.
486 This should fix the problems reported by Darren.
499 This should fix the problems reported by Darren.
487
500
488 2007-09-10 Darren Dale <dd55@cornell.edu>
501 2007-09-10 Darren Dale <dd55@cornell.edu>
489
502
490 * Cleanup of IPShellQt and IPShellQt4
503 * Cleanup of IPShellQt and IPShellQt4
491
504
492 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
505 2007-09-09 Fernando Perez <Fernando.Perez@colorado.edu>
493
506
494 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
507 * IPython/FakeModule.py (FakeModule.__init__): further fixes for
495 doctest support.
508 doctest support.
496
509
497 * IPython/iplib.py (safe_execfile): minor docstring improvements.
510 * IPython/iplib.py (safe_execfile): minor docstring improvements.
498
511
499 2007-09-08 Ville Vainio <vivainio@gmail.com>
512 2007-09-08 Ville Vainio <vivainio@gmail.com>
500
513
501 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
514 * Magic.py (%pushd, %popd, %dirs): Fix dir stack - push *current*
502 directory, not the target directory.
515 directory, not the target directory.
503
516
504 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
517 * ipapi.py, Magic.py, iplib.py: Add ipapi.UsageError, a lighter weight
505 exception that won't print the tracebacks. Switched many magics to
518 exception that won't print the tracebacks. Switched many magics to
506 raise them on error situations, also GetoptError is not printed
519 raise them on error situations, also GetoptError is not printed
507 anymore.
520 anymore.
508
521
509 2007-09-07 Ville Vainio <vivainio@gmail.com>
522 2007-09-07 Ville Vainio <vivainio@gmail.com>
510
523
511 * iplib.py: do not auto-alias "dir", it screws up other dir auto
524 * iplib.py: do not auto-alias "dir", it screws up other dir auto
512 aliases.
525 aliases.
513
526
514 * genutils.py: SList.grep() implemented.
527 * genutils.py: SList.grep() implemented.
515
528
516 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
529 * ipy_editors.py, UserConfig/ipy_user_conf.py: Add some editors
517 for easy "out of the box" setup of several common editors, so that
530 for easy "out of the box" setup of several common editors, so that
518 e.g. '%edit os.path.isfile' will jump to the correct line
531 e.g. '%edit os.path.isfile' will jump to the correct line
519 automatically. Contributions for command lines of your favourite
532 automatically. Contributions for command lines of your favourite
520 editors welcome.
533 editors welcome.
521
534
522 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
535 2007-09-07 Fernando Perez <Fernando.Perez@colorado.edu>
523
536
524 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
537 * IPython/OInspect.py (Inspector.pinfo): fixed bug that was
525 preventing source display in certain cases. In reality I think
538 preventing source display in certain cases. In reality I think
526 the problem is with Ubuntu's Python build, but this change works
539 the problem is with Ubuntu's Python build, but this change works
527 around the issue in some cases (not in all, unfortunately). I'd
540 around the issue in some cases (not in all, unfortunately). I'd
528 filed a Python bug on this with more details, but in the change of
541 filed a Python bug on this with more details, but in the change of
529 bug trackers it seems to have been lost.
542 bug trackers it seems to have been lost.
530
543
531 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
544 * IPython/Magic.py (magic_dhist): restore %dhist. No, cd -TAB is
532 not the same, it's not self-documenting, doesn't allow range
545 not the same, it's not self-documenting, doesn't allow range
533 selection, and sorts alphabetically instead of numerically.
546 selection, and sorts alphabetically instead of numerically.
534 (magic_r): restore %r. No, "up + enter. One char magic" is not
547 (magic_r): restore %r. No, "up + enter. One char magic" is not
535 the same thing, since %r takes parameters to allow fast retrieval
548 the same thing, since %r takes parameters to allow fast retrieval
536 of old commands. I've received emails from users who use this a
549 of old commands. I've received emails from users who use this a
537 LOT, so it stays.
550 LOT, so it stays.
538 (magic_automagic): restore %automagic. "use _ip.option.automagic"
551 (magic_automagic): restore %automagic. "use _ip.option.automagic"
539 is not a valid replacement b/c it doesn't provide an complete
552 is not a valid replacement b/c it doesn't provide an complete
540 explanation (which the automagic docstring does).
553 explanation (which the automagic docstring does).
541 (magic_autocall): restore %autocall, with improved docstring.
554 (magic_autocall): restore %autocall, with improved docstring.
542 Same argument as for others, "use _ip.options.autocall" is not a
555 Same argument as for others, "use _ip.options.autocall" is not a
543 valid replacement.
556 valid replacement.
544 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
557 (magic_pdef): restore %pdef & friends. Used widely, mentioned in
545 tutorials and online docs.
558 tutorials and online docs.
546
559
547 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
560 2007-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
548
561
549 * IPython/usage.py (quick_reference): mention magics in quickref,
562 * IPython/usage.py (quick_reference): mention magics in quickref,
550 modified main banner to mention %quickref.
563 modified main banner to mention %quickref.
551
564
552 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
565 * IPython/FakeModule.py (FakeModule): fixes for doctest compatibility.
553
566
554 2007-09-06 Ville Vainio <vivainio@gmail.com>
567 2007-09-06 Ville Vainio <vivainio@gmail.com>
555
568
556 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
569 * ipy_rehashdir.py, ipy_workdir.py, ipy_fsops.py, iplib.py:
557 Callable aliases now pass the _ip as first arg. This breaks
570 Callable aliases now pass the _ip as first arg. This breaks
558 compatibility with earlier 0.8.2.svn series! (though they should
571 compatibility with earlier 0.8.2.svn series! (though they should
559 not have been in use yet outside these few extensions)
572 not have been in use yet outside these few extensions)
560
573
561 2007-09-05 Ville Vainio <vivainio@gmail.com>
574 2007-09-05 Ville Vainio <vivainio@gmail.com>
562
575
563 * external/mglob.py: expand('dirname') => ['dirname'], instead
576 * external/mglob.py: expand('dirname') => ['dirname'], instead
564 of ['dirname/foo','dirname/bar', ...].
577 of ['dirname/foo','dirname/bar', ...].
565
578
566 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
579 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
567 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
580 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
568 is useful for others as well).
581 is useful for others as well).
569
582
570 * iplib.py: on callable aliases (as opposed to old style aliases),
583 * iplib.py: on callable aliases (as opposed to old style aliases),
571 do var_expand() immediately, and use make_quoted_expr instead
584 do var_expand() immediately, and use make_quoted_expr instead
572 of hardcoded r"""
585 of hardcoded r"""
573
586
574 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
587 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
575 if not available load ipy_fsops.py for cp, mv, etc. replacements
588 if not available load ipy_fsops.py for cp, mv, etc. replacements
576
589
577 * OInspect.py, ipy_which.py: improve %which and obj? for callable
590 * OInspect.py, ipy_which.py: improve %which and obj? for callable
578 aliases
591 aliases
579
592
580 2007-09-04 Ville Vainio <vivainio@gmail.com>
593 2007-09-04 Ville Vainio <vivainio@gmail.com>
581
594
582 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
595 * ipy_profile_zope.py: add zope profile, by Stefan Eletzhofer.
583 Relicensed under BSD with the authors approval.
596 Relicensed under BSD with the authors approval.
584
597
585 * ipmaker.py, usage.py: Remove %magic from default banner, improve
598 * ipmaker.py, usage.py: Remove %magic from default banner, improve
586 %quickref
599 %quickref
587
600
588 2007-09-03 Ville Vainio <vivainio@gmail.com>
601 2007-09-03 Ville Vainio <vivainio@gmail.com>
589
602
590 * Magic.py: %time now passes expression through prefilter,
603 * Magic.py: %time now passes expression through prefilter,
591 allowing IPython syntax.
604 allowing IPython syntax.
592
605
593 2007-09-01 Ville Vainio <vivainio@gmail.com>
606 2007-09-01 Ville Vainio <vivainio@gmail.com>
594
607
595 * ipmaker.py: Always show full traceback when newstyle config fails
608 * ipmaker.py: Always show full traceback when newstyle config fails
596
609
597 2007-08-27 Ville Vainio <vivainio@gmail.com>
610 2007-08-27 Ville Vainio <vivainio@gmail.com>
598
611
599 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
612 * Magic.py: fix %cd for nonexistent dir when dhist is empty, close #180
600
613
601 2007-08-26 Ville Vainio <vivainio@gmail.com>
614 2007-08-26 Ville Vainio <vivainio@gmail.com>
602
615
603 * ipmaker.py: Command line args have the highest priority again
616 * ipmaker.py: Command line args have the highest priority again
604
617
605 * iplib.py, ipmaker.py: -i command line argument now behaves as in
618 * iplib.py, ipmaker.py: -i command line argument now behaves as in
606 normal python, i.e. leaves the IPython session running after -c
619 normal python, i.e. leaves the IPython session running after -c
607 command or running a batch file from command line.
620 command or running a batch file from command line.
608
621
609 2007-08-22 Ville Vainio <vivainio@gmail.com>
622 2007-08-22 Ville Vainio <vivainio@gmail.com>
610
623
611 * iplib.py: no extra empty (last) line in raw hist w/ multiline
624 * iplib.py: no extra empty (last) line in raw hist w/ multiline
612 statements
625 statements
613
626
614 * logger.py: Fix bug where blank lines in history were not
627 * logger.py: Fix bug where blank lines in history were not
615 added until AFTER adding the current line; translated and raw
628 added until AFTER adding the current line; translated and raw
616 history should finally be in sync with prompt now.
629 history should finally be in sync with prompt now.
617
630
618 * ipy_completers.py: quick_completer now makes it easy to create
631 * ipy_completers.py: quick_completer now makes it easy to create
619 trivial custom completers
632 trivial custom completers
620
633
621 * clearcmd.py: shadow history compression & erasing, fixed input hist
634 * clearcmd.py: shadow history compression & erasing, fixed input hist
622 clearing.
635 clearing.
623
636
624 * envpersist.py, history.py: %env (sh profile only), %hist completers
637 * envpersist.py, history.py: %env (sh profile only), %hist completers
625
638
626 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
639 * genutils.py, Prompts.py, Magic.py: win32 - prompt (with \yDEPTH) and
627 term title now include the drive letter, and always use / instead of
640 term title now include the drive letter, and always use / instead of
628 os.sep (as per recommended approach for win32 ipython in general).
641 os.sep (as per recommended approach for win32 ipython in general).
629
642
630 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
643 * ipykit.py, ipy_kitcfg.py: special launcher for ipykit. Allows running
631 plain python scripts from ipykit command line by running
644 plain python scripts from ipykit command line by running
632 "py myscript.py", even w/o installed python.
645 "py myscript.py", even w/o installed python.
633
646
634 2007-08-21 Ville Vainio <vivainio@gmail.com>
647 2007-08-21 Ville Vainio <vivainio@gmail.com>
635
648
636 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
649 * ipmaker.py: finding ipythonrc-PROF now skips ipy_profile_PROF.
637 (for backwards compatibility)
650 (for backwards compatibility)
638
651
639 * history.py: switch back to %hist -t from %hist -r as default.
652 * history.py: switch back to %hist -t from %hist -r as default.
640 At least until raw history is fixed for good.
653 At least until raw history is fixed for good.
641
654
642 2007-08-20 Ville Vainio <vivainio@gmail.com>
655 2007-08-20 Ville Vainio <vivainio@gmail.com>
643
656
644 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
657 * ipapi.py, iplib.py: DebugTools accessible via _ip.dbg, to catch &
645 locate alias redeclarations etc. Also, avoid handling
658 locate alias redeclarations etc. Also, avoid handling
646 _ip.IP.alias_table directly, prefer using _ip.defalias.
659 _ip.IP.alias_table directly, prefer using _ip.defalias.
647
660
648
661
649 2007-08-15 Ville Vainio <vivainio@gmail.com>
662 2007-08-15 Ville Vainio <vivainio@gmail.com>
650
663
651 * prefilter.py: ! is now always served first
664 * prefilter.py: ! is now always served first
652
665
653 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
666 2007-08-15 Fernando Perez <Fernando.Perez@colorado.edu>
654
667
655 * IPython/iplib.py (safe_execfile): fix the SystemExit
668 * IPython/iplib.py (safe_execfile): fix the SystemExit
656 auto-suppression code to work in Python2.4 (the internal structure
669 auto-suppression code to work in Python2.4 (the internal structure
657 of that exception changed and I'd only tested the code with 2.5).
670 of that exception changed and I'd only tested the code with 2.5).
658 Bug reported by a SciPy attendee.
671 Bug reported by a SciPy attendee.
659
672
660 2007-08-13 Ville Vainio <vivainio@gmail.com>
673 2007-08-13 Ville Vainio <vivainio@gmail.com>
661
674
662 * prefilter.py: reverted !c:/bin/foo fix, made % in
675 * prefilter.py: reverted !c:/bin/foo fix, made % in
663 multiline specials work again
676 multiline specials work again
664
677
665 2007-08-13 Ville Vainio <vivainio@gmail.com>
678 2007-08-13 Ville Vainio <vivainio@gmail.com>
666
679
667 * prefilter.py: Take more care to special-case !, so that
680 * prefilter.py: Take more care to special-case !, so that
668 !c:/bin/foo.exe works.
681 !c:/bin/foo.exe works.
669
682
670 * setup.py: if we are building eggs, strip all docs and
683 * setup.py: if we are building eggs, strip all docs and
671 examples (it doesn't make sense to bytecompile examples,
684 examples (it doesn't make sense to bytecompile examples,
672 and docs would be in an awkward place anyway).
685 and docs would be in an awkward place anyway).
673
686
674 * Ryan Krauss' patch fixes start menu shortcuts when IPython
687 * Ryan Krauss' patch fixes start menu shortcuts when IPython
675 is installed into a directory that has spaces in the name.
688 is installed into a directory that has spaces in the name.
676
689
677 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
690 2007-08-13 Fernando Perez <Fernando.Perez@colorado.edu>
678
691
679 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
692 * IPython/Magic.py (magic_doctest_mode): fix prompt separators in
680 doctest profile and %doctest_mode, so they actually generate the
693 doctest profile and %doctest_mode, so they actually generate the
681 blank lines needed by doctest to separate individual tests.
694 blank lines needed by doctest to separate individual tests.
682
695
683 * IPython/iplib.py (safe_execfile): modify so that running code
696 * IPython/iplib.py (safe_execfile): modify so that running code
684 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
697 which calls sys.exit(0) (or equivalently, raise SystemExit(0))
685 doesn't get a printed traceback. Any other value in sys.exit(),
698 doesn't get a printed traceback. Any other value in sys.exit(),
686 including the empty call, still generates a traceback. This
699 including the empty call, still generates a traceback. This
687 enables use of %run without having to pass '-e' for codes that
700 enables use of %run without having to pass '-e' for codes that
688 correctly set the exit status flag.
701 correctly set the exit status flag.
689
702
690 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
703 2007-08-12 Fernando Perez <Fernando.Perez@colorado.edu>
691
704
692 * IPython/iplib.py (InteractiveShell.post_config_initialization):
705 * IPython/iplib.py (InteractiveShell.post_config_initialization):
693 fix problems with doctests failing when run inside IPython due to
706 fix problems with doctests failing when run inside IPython due to
694 IPython's modifications of sys.displayhook.
707 IPython's modifications of sys.displayhook.
695
708
696 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
709 2007-8-9 Fernando Perez <fperez@planck.colorado.edu>
697
710
698 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
711 * IPython/ipapi.py (to_user_ns): update to accept a dict as well as
699 a string with names.
712 a string with names.
700
713
701 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
714 2007-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
702
715
703 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
716 * IPython/Magic.py (magic_doctest_mode): added new %doctest_mode
704 magic to toggle on/off the doctest pasting support without having
717 magic to toggle on/off the doctest pasting support without having
705 to leave a session to switch to a separate profile.
718 to leave a session to switch to a separate profile.
706
719
707 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
720 2007-08-08 Fernando Perez <Fernando.Perez@colorado.edu>
708
721
709 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
722 * IPython/Extensions/ipy_profile_doctest.py (main): fix prompt to
710 introduce a blank line between inputs, to conform to doctest
723 introduce a blank line between inputs, to conform to doctest
711 requirements.
724 requirements.
712
725
713 * IPython/OInspect.py (Inspector.pinfo): fix another part where
726 * IPython/OInspect.py (Inspector.pinfo): fix another part where
714 auto-generated docstrings for new-style classes were showing up.
727 auto-generated docstrings for new-style classes were showing up.
715
728
716 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
729 2007-08-07 Fernando Perez <Fernando.Perez@colorado.edu>
717
730
718 * api_changes: Add new file to track backward-incompatible
731 * api_changes: Add new file to track backward-incompatible
719 user-visible changes.
732 user-visible changes.
720
733
721 2007-08-06 Ville Vainio <vivainio@gmail.com>
734 2007-08-06 Ville Vainio <vivainio@gmail.com>
722
735
723 * ipmaker.py: fix bug where user_config_ns didn't exist at all
736 * ipmaker.py: fix bug where user_config_ns didn't exist at all
724 before all the config files were handled.
737 before all the config files were handled.
725
738
726 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
739 2007-08-04 Fernando Perez <Fernando.Perez@colorado.edu>
727
740
728 * IPython/irunner.py (RunnerFactory): Add new factory class for
741 * IPython/irunner.py (RunnerFactory): Add new factory class for
729 creating reusable runners based on filenames.
742 creating reusable runners based on filenames.
730
743
731 * IPython/Extensions/ipy_profile_doctest.py: New profile for
744 * IPython/Extensions/ipy_profile_doctest.py: New profile for
732 doctest support. It sets prompts/exceptions as similar to
745 doctest support. It sets prompts/exceptions as similar to
733 standard Python as possible, so that ipython sessions in this
746 standard Python as possible, so that ipython sessions in this
734 profile can be easily pasted as doctests with minimal
747 profile can be easily pasted as doctests with minimal
735 modifications. It also enables pasting of doctests from external
748 modifications. It also enables pasting of doctests from external
736 sources (even if they have leading whitespace), so that you can
749 sources (even if they have leading whitespace), so that you can
737 rerun doctests from existing sources.
750 rerun doctests from existing sources.
738
751
739 * IPython/iplib.py (_prefilter): fix a buglet where after entering
752 * IPython/iplib.py (_prefilter): fix a buglet where after entering
740 some whitespace, the prompt would become a continuation prompt
753 some whitespace, the prompt would become a continuation prompt
741 with no way of exiting it other than Ctrl-C. This fix brings us
754 with no way of exiting it other than Ctrl-C. This fix brings us
742 into conformity with how the default python prompt works.
755 into conformity with how the default python prompt works.
743
756
744 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
757 * IPython/Extensions/InterpreterPasteInput.py (prefilter_paste):
745 Add support for pasting not only lines that start with '>>>', but
758 Add support for pasting not only lines that start with '>>>', but
746 also with ' >>>'. That is, arbitrary whitespace can now precede
759 also with ' >>>'. That is, arbitrary whitespace can now precede
747 the prompts. This makes the system useful for pasting doctests
760 the prompts. This makes the system useful for pasting doctests
748 from docstrings back into a normal session.
761 from docstrings back into a normal session.
749
762
750 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
763 2007-08-02 Fernando Perez <Fernando.Perez@colorado.edu>
751
764
752 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
765 * IPython/Shell.py (IPShellEmbed.__call__): fix bug introduced in
753 r1357, which had killed multiple invocations of an embedded
766 r1357, which had killed multiple invocations of an embedded
754 ipython (this means that example-embed has been broken for over 1
767 ipython (this means that example-embed has been broken for over 1
755 year!!!). Rather than possibly breaking the batch stuff for which
768 year!!!). Rather than possibly breaking the batch stuff for which
756 the code in iplib.py/interact was introduced, I worked around the
769 the code in iplib.py/interact was introduced, I worked around the
757 problem in the embedding class in Shell.py. We really need a
770 problem in the embedding class in Shell.py. We really need a
758 bloody test suite for this code, I'm sick of finding stuff that
771 bloody test suite for this code, I'm sick of finding stuff that
759 used to work breaking left and right every time I use an old
772 used to work breaking left and right every time I use an old
760 feature I hadn't touched in a few months.
773 feature I hadn't touched in a few months.
761 (kill_embedded): Add a new magic that only shows up in embedded
774 (kill_embedded): Add a new magic that only shows up in embedded
762 mode, to allow users to permanently deactivate an embedded instance.
775 mode, to allow users to permanently deactivate an embedded instance.
763
776
764 2007-08-01 Ville Vainio <vivainio@gmail.com>
777 2007-08-01 Ville Vainio <vivainio@gmail.com>
765
778
766 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
779 * iplib.py, ipy_profile_sh.py (runlines): Fix the bug where raw
767 history gets out of sync on runlines (e.g. when running macros).
780 history gets out of sync on runlines (e.g. when running macros).
768
781
769 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
782 2007-07-31 Fernando Perez <Fernando.Perez@colorado.edu>
770
783
771 * IPython/Magic.py (magic_colors): fix win32-related error message
784 * IPython/Magic.py (magic_colors): fix win32-related error message
772 that could appear under *nix when readline was missing. Patch by
785 that could appear under *nix when readline was missing. Patch by
773 Scott Jackson, closes #175.
786 Scott Jackson, closes #175.
774
787
775 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
788 2007-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
776
789
777 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
790 * IPython/Extensions/ipy_traits_completer.py: Add a new custom
778 completer that it traits-aware, so that traits objects don't show
791 completer that it traits-aware, so that traits objects don't show
779 all of their internal attributes all the time.
792 all of their internal attributes all the time.
780
793
781 * IPython/genutils.py (dir2): moved this code from inside
794 * IPython/genutils.py (dir2): moved this code from inside
782 completer.py to expose it publicly, so I could use it in the
795 completer.py to expose it publicly, so I could use it in the
783 wildcards bugfix.
796 wildcards bugfix.
784
797
785 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
798 * IPython/wildcard.py (NameSpace.__init__): fix a bug reported by
786 Stefan with Traits.
799 Stefan with Traits.
787
800
788 * IPython/completer.py (Completer.attr_matches): change internal
801 * IPython/completer.py (Completer.attr_matches): change internal
789 var name from 'object' to 'obj', since 'object' is now a builtin
802 var name from 'object' to 'obj', since 'object' is now a builtin
790 and this can lead to weird bugs if reusing this code elsewhere.
803 and this can lead to weird bugs if reusing this code elsewhere.
791
804
792 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
805 2007-07-25 Fernando Perez <Fernando.Perez@colorado.edu>
793
806
794 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
807 * IPython/OInspect.py (Inspector.pinfo): fix small glitches in
795 'foo?' and update the code to prevent printing of default
808 'foo?' and update the code to prevent printing of default
796 docstrings that started appearing after I added support for
809 docstrings that started appearing after I added support for
797 new-style classes. The approach I'm using isn't ideal (I just
810 new-style classes. The approach I'm using isn't ideal (I just
798 special-case those strings) but I'm not sure how to more robustly
811 special-case those strings) but I'm not sure how to more robustly
799 differentiate between truly user-written strings and Python's
812 differentiate between truly user-written strings and Python's
800 automatic ones.
813 automatic ones.
801
814
802 2007-07-09 Ville Vainio <vivainio@gmail.com>
815 2007-07-09 Ville Vainio <vivainio@gmail.com>
803
816
804 * completer.py: Applied Matthew Neeley's patch:
817 * completer.py: Applied Matthew Neeley's patch:
805 Dynamic attributes from trait_names and _getAttributeNames are added
818 Dynamic attributes from trait_names and _getAttributeNames are added
806 to the list of tab completions, but when this happens, the attribute
819 to the list of tab completions, but when this happens, the attribute
807 list is turned into a set, so the attributes are unordered when
820 list is turned into a set, so the attributes are unordered when
808 printed, which makes it hard to find the right completion. This patch
821 printed, which makes it hard to find the right completion. This patch
809 turns this set back into a list and sort it.
822 turns this set back into a list and sort it.
810
823
811 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
824 2007-07-06 Fernando Perez <Fernando.Perez@colorado.edu>
812
825
813 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
826 * IPython/OInspect.py (Inspector.pinfo): Add support for new-style
814 classes in various inspector functions.
827 classes in various inspector functions.
815
828
816 2007-06-28 Ville Vainio <vivainio@gmail.com>
829 2007-06-28 Ville Vainio <vivainio@gmail.com>
817
830
818 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
831 * shadowns.py, iplib.py, ipapi.py, OInspect.py:
819 Implement "shadow" namespace, and callable aliases that reside there.
832 Implement "shadow" namespace, and callable aliases that reside there.
820 Use them by:
833 Use them by:
821
834
822 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
835 _ip.defalias('foo',myfunc) # creates _sh.foo that points to myfunc
823
836
824 foo hello world
837 foo hello world
825 (gets translated to:)
838 (gets translated to:)
826 _sh.foo(r"""hello world""")
839 _sh.foo(r"""hello world""")
827
840
828 In practice, this kind of alias can take the role of a magic function
841 In practice, this kind of alias can take the role of a magic function
829
842
830 * New generic inspect_object, called on obj? and obj??
843 * New generic inspect_object, called on obj? and obj??
831
844
832 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
845 2007-06-15 Fernando Perez <Fernando.Perez@colorado.edu>
833
846
834 * IPython/ultraTB.py (findsource): fix a problem with
847 * IPython/ultraTB.py (findsource): fix a problem with
835 inspect.getfile that can cause crashes during traceback construction.
848 inspect.getfile that can cause crashes during traceback construction.
836
849
837 2007-06-14 Ville Vainio <vivainio@gmail.com>
850 2007-06-14 Ville Vainio <vivainio@gmail.com>
838
851
839 * iplib.py (handle_auto): Try to use ascii for printing "--->"
852 * iplib.py (handle_auto): Try to use ascii for printing "--->"
840 autocall rewrite indication, becausesometimes unicode fails to print
853 autocall rewrite indication, becausesometimes unicode fails to print
841 properly (and you get ' - - - '). Use plain uncoloured ---> for
854 properly (and you get ' - - - '). Use plain uncoloured ---> for
842 unicode.
855 unicode.
843
856
844 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
857 * shadow history. Usable through "%hist -g <pat>" and "%rep 0123".
845
858
846 . pickleshare 'hash' commands (hget, hset, hcompress,
859 . pickleshare 'hash' commands (hget, hset, hcompress,
847 hdict) for efficient shadow history storage.
860 hdict) for efficient shadow history storage.
848
861
849 2007-06-13 Ville Vainio <vivainio@gmail.com>
862 2007-06-13 Ville Vainio <vivainio@gmail.com>
850
863
851 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
864 * ipapi.py: _ip.to_user_ns(vars, interactive = True).
852 Added kw arg 'interactive', tell whether vars should be visible
865 Added kw arg 'interactive', tell whether vars should be visible
853 with %whos.
866 with %whos.
854
867
855 2007-06-11 Ville Vainio <vivainio@gmail.com>
868 2007-06-11 Ville Vainio <vivainio@gmail.com>
856
869
857 * pspersistence.py, Magic.py, iplib.py: directory history now saved
870 * pspersistence.py, Magic.py, iplib.py: directory history now saved
858 to db
871 to db
859
872
860 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
873 * iplib.py: "ipython -c <cmd>" now passes the command through prefilter.
861 Also, it exits IPython immediately after evaluating the command (just like
874 Also, it exits IPython immediately after evaluating the command (just like
862 std python)
875 std python)
863
876
864 2007-06-05 Walter Doerwald <walter@livinglogic.de>
877 2007-06-05 Walter Doerwald <walter@livinglogic.de>
865
878
866 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
879 * IPython/Extensions/ipipe.py: Added a new table icap, which executes a
867 Python string and captures the output. (Idea and original patch by
880 Python string and captures the output. (Idea and original patch by
868 Stefan van der Walt)
881 Stefan van der Walt)
869
882
870 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
883 2007-06-01 Fernando Perez <Fernando.Perez@colorado.edu>
871
884
872 * IPython/ultraTB.py (VerboseTB.text): update printing of
885 * IPython/ultraTB.py (VerboseTB.text): update printing of
873 exception types for Python 2.5 (now all exceptions in the stdlib
886 exception types for Python 2.5 (now all exceptions in the stdlib
874 are new-style classes).
887 are new-style classes).
875
888
876 2007-05-31 Walter Doerwald <walter@livinglogic.de>
889 2007-05-31 Walter Doerwald <walter@livinglogic.de>
877
890
878 * IPython/Extensions/igrid.py: Add new commands refresh and
891 * IPython/Extensions/igrid.py: Add new commands refresh and
879 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
892 refresh_timer (mapped to "R"/"F5" and to the menu) which restarts
880 the iterator once (refresh) or after every x seconds (refresh_timer).
893 the iterator once (refresh) or after every x seconds (refresh_timer).
881 Add a working implementation of "searchexpression", where the text
894 Add a working implementation of "searchexpression", where the text
882 entered is not the text to search for, but an expression that must
895 entered is not the text to search for, but an expression that must
883 be true. Added display of shortcuts to the menu. Added commands "pickinput"
896 be true. Added display of shortcuts to the menu. Added commands "pickinput"
884 and "pickinputattr" that put the object or attribute under the cursor
897 and "pickinputattr" that put the object or attribute under the cursor
885 in the input line. Split the statusbar to be able to display the currently
898 in the input line. Split the statusbar to be able to display the currently
886 active refresh interval. (Patch by Nik Tautenhahn)
899 active refresh interval. (Patch by Nik Tautenhahn)
887
900
888 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
901 2007-05-29 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
889
902
890 * fixing set_term_title to use ctypes as default
903 * fixing set_term_title to use ctypes as default
891
904
892 * fixing set_term_title fallback to work when curent dir
905 * fixing set_term_title fallback to work when curent dir
893 is on a windows network share
906 is on a windows network share
894
907
895 2007-05-28 Ville Vainio <vivainio@gmail.com>
908 2007-05-28 Ville Vainio <vivainio@gmail.com>
896
909
897 * %cpaste: strip + with > from left (diffs).
910 * %cpaste: strip + with > from left (diffs).
898
911
899 * iplib.py: Fix crash when readline not installed
912 * iplib.py: Fix crash when readline not installed
900
913
901 2007-05-26 Ville Vainio <vivainio@gmail.com>
914 2007-05-26 Ville Vainio <vivainio@gmail.com>
902
915
903 * generics.py: introduce easy to extend result_display generic
916 * generics.py: introduce easy to extend result_display generic
904 function (using simplegeneric.py).
917 function (using simplegeneric.py).
905
918
906 * Fixed the append functionality of %set.
919 * Fixed the append functionality of %set.
907
920
908 2007-05-25 Ville Vainio <vivainio@gmail.com>
921 2007-05-25 Ville Vainio <vivainio@gmail.com>
909
922
910 * New magic: %rep (fetch / run old commands from history)
923 * New magic: %rep (fetch / run old commands from history)
911
924
912 * New extension: mglob (%mglob magic), for powerful glob / find /filter
925 * New extension: mglob (%mglob magic), for powerful glob / find /filter
913 like functionality
926 like functionality
914
927
915 % maghistory.py: %hist -g PATTERM greps the history for pattern
928 % maghistory.py: %hist -g PATTERM greps the history for pattern
916
929
917 2007-05-24 Walter Doerwald <walter@livinglogic.de>
930 2007-05-24 Walter Doerwald <walter@livinglogic.de>
918
931
919 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
932 * IPython/Extensions/ipipe.py: Added a Table ihist that can be used to
920 browse the IPython input history
933 browse the IPython input history
921
934
922 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
935 * IPython/Extensions/ibrowse.py: Added two command to ibrowse: pickinput
923 (mapped to "i") can be used to put the object under the curser in the input
936 (mapped to "i") can be used to put the object under the curser in the input
924 line. pickinputattr (mapped to "I") does the same for the attribute under
937 line. pickinputattr (mapped to "I") does the same for the attribute under
925 the cursor.
938 the cursor.
926
939
927 2007-05-24 Ville Vainio <vivainio@gmail.com>
940 2007-05-24 Ville Vainio <vivainio@gmail.com>
928
941
929 * Grand magic cleansing (changeset [2380]):
942 * Grand magic cleansing (changeset [2380]):
930
943
931 * Introduce ipy_legacy.py where the following magics were
944 * Introduce ipy_legacy.py where the following magics were
932 moved:
945 moved:
933
946
934 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
947 pdef pdoc psource pfile rehash dhist Quit p r automagic autocall
935
948
936 If you need them, either use default profile or "import ipy_legacy"
949 If you need them, either use default profile or "import ipy_legacy"
937 in your ipy_user_conf.py
950 in your ipy_user_conf.py
938
951
939 * Move sh and scipy profile to Extensions from UserConfig. this implies
952 * Move sh and scipy profile to Extensions from UserConfig. this implies
940 you should not edit them, but you don't need to run %upgrade when
953 you should not edit them, but you don't need to run %upgrade when
941 upgrading IPython anymore.
954 upgrading IPython anymore.
942
955
943 * %hist/%history now operates in "raw" mode by default. To get the old
956 * %hist/%history now operates in "raw" mode by default. To get the old
944 behaviour, run '%hist -n' (native mode).
957 behaviour, run '%hist -n' (native mode).
945
958
946 * split ipy_stock_completers.py to ipy_stock_completers.py and
959 * split ipy_stock_completers.py to ipy_stock_completers.py and
947 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
960 ipy_app_completers.py. Stock completers (%cd, import, %run) are now
948 installed as default.
961 installed as default.
949
962
950 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
963 * sh profile now installs ipy_signals.py, for (hopefully) better ctrl+c
951 handling.
964 handling.
952
965
953 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
966 * iplib.py, ipapi.py: _ip.set_next_input(s) sets the next ("default")
954 input if readline is available.
967 input if readline is available.
955
968
956 2007-05-23 Ville Vainio <vivainio@gmail.com>
969 2007-05-23 Ville Vainio <vivainio@gmail.com>
957
970
958 * macro.py: %store uses __getstate__ properly
971 * macro.py: %store uses __getstate__ properly
959
972
960 * exesetup.py: added new setup script for creating
973 * exesetup.py: added new setup script for creating
961 standalone IPython executables with py2exe (i.e.
974 standalone IPython executables with py2exe (i.e.
962 no python installation required).
975 no python installation required).
963
976
964 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
977 * Removed ipythonrc-scipy, ipy_profile_scipy.py takes
965 its place.
978 its place.
966
979
967 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
980 * rlineimpl.py, genutils.py (get_home_dir): py2exe support
968
981
969 2007-05-21 Ville Vainio <vivainio@gmail.com>
982 2007-05-21 Ville Vainio <vivainio@gmail.com>
970
983
971 * platutil_win32.py (set_term_title): handle
984 * platutil_win32.py (set_term_title): handle
972 failure of 'title' system call properly.
985 failure of 'title' system call properly.
973
986
974 2007-05-17 Walter Doerwald <walter@livinglogic.de>
987 2007-05-17 Walter Doerwald <walter@livinglogic.de>
975
988
976 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
989 * IPython/Extensions/ipipe.py: Fix xrepr for ifiles.
977 (Bug detected by Paul Mueller).
990 (Bug detected by Paul Mueller).
978
991
979 2007-05-16 Ville Vainio <vivainio@gmail.com>
992 2007-05-16 Ville Vainio <vivainio@gmail.com>
980
993
981 * ipy_profile_sci.py, ipython_win_post_install.py: Create
994 * ipy_profile_sci.py, ipython_win_post_install.py: Create
982 new "sci" profile, effectively a modern version of the old
995 new "sci" profile, effectively a modern version of the old
983 "scipy" profile (which is now slated for deprecation).
996 "scipy" profile (which is now slated for deprecation).
984
997
985 2007-05-15 Ville Vainio <vivainio@gmail.com>
998 2007-05-15 Ville Vainio <vivainio@gmail.com>
986
999
987 * pycolorize.py, pycolor.1: Paul Mueller's patches that
1000 * pycolorize.py, pycolor.1: Paul Mueller's patches that
988 make pycolorize read input from stdin when run without arguments.
1001 make pycolorize read input from stdin when run without arguments.
989
1002
990 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
1003 * Magic.py: do not require 'PATH' in %rehash/%rehashx. Closes #155
991
1004
992 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
1005 * ipy_rehashdir.py: rename ext_rehashdir to ipy_rehashdir, import
993 it in sh profile (instead of ipy_system_conf.py).
1006 it in sh profile (instead of ipy_system_conf.py).
994
1007
995 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
1008 * Magic.py, ipy_rehashdir.py, ipy_profile_sh.py: System command
996 aliases are now lower case on windows (MyCommand.exe => mycommand).
1009 aliases are now lower case on windows (MyCommand.exe => mycommand).
997
1010
998 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
1011 * macro.py, ipapi.py, iplib.py, Prompts.py: Macro system rehaul.
999 Macros are now callable objects that inherit from ipapi.IPyAutocall,
1012 Macros are now callable objects that inherit from ipapi.IPyAutocall,
1000 i.e. get autocalled regardless of system autocall setting.
1013 i.e. get autocalled regardless of system autocall setting.
1001
1014
1002 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
1015 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
1003
1016
1004 * IPython/rlineimpl.py: check for clear_history in readline and
1017 * IPython/rlineimpl.py: check for clear_history in readline and
1005 make it a dummy no-op if not available. This function isn't
1018 make it a dummy no-op if not available. This function isn't
1006 guaranteed to be in the API and appeared in Python 2.4, so we need
1019 guaranteed to be in the API and appeared in Python 2.4, so we need
1007 to check it ourselves. Also, clean up this file quite a bit.
1020 to check it ourselves. Also, clean up this file quite a bit.
1008
1021
1009 * ipython.1: update man page and full manual with information
1022 * ipython.1: update man page and full manual with information
1010 about threads (remove outdated warning). Closes #151.
1023 about threads (remove outdated warning). Closes #151.
1011
1024
1012 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
1025 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
1013
1026
1014 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
1027 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
1015 in trunk (note that this made it into the 0.8.1 release already,
1028 in trunk (note that this made it into the 0.8.1 release already,
1016 but the changelogs didn't get coordinated). Many thanks to Gael
1029 but the changelogs didn't get coordinated). Many thanks to Gael
1017 Varoquaux <gael.varoquaux-AT-normalesup.org>
1030 Varoquaux <gael.varoquaux-AT-normalesup.org>
1018
1031
1019 2007-05-09 *** Released version 0.8.1
1032 2007-05-09 *** Released version 0.8.1
1020
1033
1021 2007-05-10 Walter Doerwald <walter@livinglogic.de>
1034 2007-05-10 Walter Doerwald <walter@livinglogic.de>
1022
1035
1023 * IPython/Extensions/igrid.py: Incorporate html help into
1036 * IPython/Extensions/igrid.py: Incorporate html help into
1024 the module, so we don't have to search for the file.
1037 the module, so we don't have to search for the file.
1025
1038
1026 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
1039 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
1027
1040
1028 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
1041 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
1029
1042
1030 2007-04-30 Ville Vainio <vivainio@gmail.com>
1043 2007-04-30 Ville Vainio <vivainio@gmail.com>
1031
1044
1032 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
1045 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
1033 user has illegal (non-ascii) home directory name
1046 user has illegal (non-ascii) home directory name
1034
1047
1035 2007-04-27 Ville Vainio <vivainio@gmail.com>
1048 2007-04-27 Ville Vainio <vivainio@gmail.com>
1036
1049
1037 * platutils_win32.py: implement set_term_title for windows
1050 * platutils_win32.py: implement set_term_title for windows
1038
1051
1039 * Update version number
1052 * Update version number
1040
1053
1041 * ipy_profile_sh.py: more informative prompt (2 dir levels)
1054 * ipy_profile_sh.py: more informative prompt (2 dir levels)
1042
1055
1043 2007-04-26 Walter Doerwald <walter@livinglogic.de>
1056 2007-04-26 Walter Doerwald <walter@livinglogic.de>
1044
1057
1045 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
1058 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
1046 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
1059 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
1047 bug discovered by Ville).
1060 bug discovered by Ville).
1048
1061
1049 2007-04-26 Ville Vainio <vivainio@gmail.com>
1062 2007-04-26 Ville Vainio <vivainio@gmail.com>
1050
1063
1051 * Extensions/ipy_completers.py: Olivier's module completer now
1064 * Extensions/ipy_completers.py: Olivier's module completer now
1052 saves the list of root modules if it takes > 4 secs on the first run.
1065 saves the list of root modules if it takes > 4 secs on the first run.
1053
1066
1054 * Magic.py (%rehashx): %rehashx now clears the completer cache
1067 * Magic.py (%rehashx): %rehashx now clears the completer cache
1055
1068
1056
1069
1057 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
1070 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
1058
1071
1059 * ipython.el: fix incorrect color scheme, reported by Stefan.
1072 * ipython.el: fix incorrect color scheme, reported by Stefan.
1060 Closes #149.
1073 Closes #149.
1061
1074
1062 * IPython/PyColorize.py (Parser.format2): fix state-handling
1075 * IPython/PyColorize.py (Parser.format2): fix state-handling
1063 logic. I still don't like how that code handles state, but at
1076 logic. I still don't like how that code handles state, but at
1064 least now it should be correct, if inelegant. Closes #146.
1077 least now it should be correct, if inelegant. Closes #146.
1065
1078
1066 2007-04-25 Ville Vainio <vivainio@gmail.com>
1079 2007-04-25 Ville Vainio <vivainio@gmail.com>
1067
1080
1068 * Extensions/ipy_which.py: added extension for %which magic, works
1081 * Extensions/ipy_which.py: added extension for %which magic, works
1069 a lot like unix 'which' but also finds and expands aliases, and
1082 a lot like unix 'which' but also finds and expands aliases, and
1070 allows wildcards.
1083 allows wildcards.
1071
1084
1072 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
1085 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
1073 as opposed to returning nothing.
1086 as opposed to returning nothing.
1074
1087
1075 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
1088 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
1076 ipy_stock_completers on default profile, do import on sh profile.
1089 ipy_stock_completers on default profile, do import on sh profile.
1077
1090
1078 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1091 2007-04-22 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1079
1092
1080 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
1093 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
1081 like ipython.py foo.py which raised a IndexError.
1094 like ipython.py foo.py which raised a IndexError.
1082
1095
1083 2007-04-21 Ville Vainio <vivainio@gmail.com>
1096 2007-04-21 Ville Vainio <vivainio@gmail.com>
1084
1097
1085 * Extensions/ipy_extutil.py: added extension to manage other ipython
1098 * Extensions/ipy_extutil.py: added extension to manage other ipython
1086 extensions. Now only supports 'ls' == list extensions.
1099 extensions. Now only supports 'ls' == list extensions.
1087
1100
1088 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
1101 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
1089
1102
1090 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
1103 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
1091 would prevent use of the exception system outside of a running
1104 would prevent use of the exception system outside of a running
1092 IPython instance.
1105 IPython instance.
1093
1106
1094 2007-04-20 Ville Vainio <vivainio@gmail.com>
1107 2007-04-20 Ville Vainio <vivainio@gmail.com>
1095
1108
1096 * Extensions/ipy_render.py: added extension for easy
1109 * Extensions/ipy_render.py: added extension for easy
1097 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
1110 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
1098 'Iptl' template notation,
1111 'Iptl' template notation,
1099
1112
1100 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
1113 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
1101 safer & faster 'import' completer.
1114 safer & faster 'import' completer.
1102
1115
1103 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
1116 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
1104 and _ip.defalias(name, command).
1117 and _ip.defalias(name, command).
1105
1118
1106 * Extensions/ipy_exportdb.py: New extension for exporting all the
1119 * Extensions/ipy_exportdb.py: New extension for exporting all the
1107 %store'd data in a portable format (normal ipapi calls like
1120 %store'd data in a portable format (normal ipapi calls like
1108 defmacro() etc.)
1121 defmacro() etc.)
1109
1122
1110 2007-04-19 Ville Vainio <vivainio@gmail.com>
1123 2007-04-19 Ville Vainio <vivainio@gmail.com>
1111
1124
1112 * upgrade_dir.py: skip junk files like *.pyc
1125 * upgrade_dir.py: skip junk files like *.pyc
1113
1126
1114 * Release.py: version number to 0.8.1
1127 * Release.py: version number to 0.8.1
1115
1128
1116 2007-04-18 Ville Vainio <vivainio@gmail.com>
1129 2007-04-18 Ville Vainio <vivainio@gmail.com>
1117
1130
1118 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
1131 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
1119 and later on win32.
1132 and later on win32.
1120
1133
1121 2007-04-16 Ville Vainio <vivainio@gmail.com>
1134 2007-04-16 Ville Vainio <vivainio@gmail.com>
1122
1135
1123 * iplib.py (showtraceback): Do not crash when running w/o readline.
1136 * iplib.py (showtraceback): Do not crash when running w/o readline.
1124
1137
1125 2007-04-12 Walter Doerwald <walter@livinglogic.de>
1138 2007-04-12 Walter Doerwald <walter@livinglogic.de>
1126
1139
1127 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
1140 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
1128 sorted (case sensitive with files and dirs mixed).
1141 sorted (case sensitive with files and dirs mixed).
1129
1142
1130 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
1143 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
1131
1144
1132 * IPython/Release.py (version): Open trunk for 0.8.1 development.
1145 * IPython/Release.py (version): Open trunk for 0.8.1 development.
1133
1146
1134 2007-04-10 *** Released version 0.8.0
1147 2007-04-10 *** Released version 0.8.0
1135
1148
1136 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
1149 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
1137
1150
1138 * Tag 0.8.0 for release.
1151 * Tag 0.8.0 for release.
1139
1152
1140 * IPython/iplib.py (reloadhist): add API function to cleanly
1153 * IPython/iplib.py (reloadhist): add API function to cleanly
1141 reload the readline history, which was growing inappropriately on
1154 reload the readline history, which was growing inappropriately on
1142 every %run call.
1155 every %run call.
1143
1156
1144 * win32_manual_post_install.py (run): apply last part of Nicolas
1157 * win32_manual_post_install.py (run): apply last part of Nicolas
1145 Pernetty's patch (I'd accidentally applied it in a different
1158 Pernetty's patch (I'd accidentally applied it in a different
1146 directory and this particular file didn't get patched).
1159 directory and this particular file didn't get patched).
1147
1160
1148 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
1161 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
1149
1162
1150 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
1163 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
1151 find the main thread id and use the proper API call. Thanks to
1164 find the main thread id and use the proper API call. Thanks to
1152 Stefan for the fix.
1165 Stefan for the fix.
1153
1166
1154 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
1167 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
1155 unit tests to reflect fixed ticket #52, and add more tests sent by
1168 unit tests to reflect fixed ticket #52, and add more tests sent by
1156 him.
1169 him.
1157
1170
1158 * IPython/iplib.py (raw_input): restore the readline completer
1171 * IPython/iplib.py (raw_input): restore the readline completer
1159 state on every input, in case third-party code messed it up.
1172 state on every input, in case third-party code messed it up.
1160 (_prefilter): revert recent addition of early-escape checks which
1173 (_prefilter): revert recent addition of early-escape checks which
1161 prevent many valid alias calls from working.
1174 prevent many valid alias calls from working.
1162
1175
1163 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
1176 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
1164 flag for sigint handler so we don't run a full signal() call on
1177 flag for sigint handler so we don't run a full signal() call on
1165 each runcode access.
1178 each runcode access.
1166
1179
1167 * IPython/Magic.py (magic_whos): small improvement to diagnostic
1180 * IPython/Magic.py (magic_whos): small improvement to diagnostic
1168 message.
1181 message.
1169
1182
1170 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
1183 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
1171
1184
1172 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
1185 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
1173 asynchronous exceptions working, i.e., Ctrl-C can actually
1186 asynchronous exceptions working, i.e., Ctrl-C can actually
1174 interrupt long-running code in the multithreaded shells.
1187 interrupt long-running code in the multithreaded shells.
1175
1188
1176 This is using Tomer Filiba's great ctypes-based trick:
1189 This is using Tomer Filiba's great ctypes-based trick:
1177 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
1190 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
1178 this in the past, but hadn't been able to make it work before. So
1191 this in the past, but hadn't been able to make it work before. So
1179 far it looks like it's actually running, but this needs more
1192 far it looks like it's actually running, but this needs more
1180 testing. If it really works, I'll be *very* happy, and we'll owe
1193 testing. If it really works, I'll be *very* happy, and we'll owe
1181 a huge thank you to Tomer. My current implementation is ugly,
1194 a huge thank you to Tomer. My current implementation is ugly,
1182 hackish and uses nasty globals, but I don't want to try and clean
1195 hackish and uses nasty globals, but I don't want to try and clean
1183 anything up until we know if it actually works.
1196 anything up until we know if it actually works.
1184
1197
1185 NOTE: this feature needs ctypes to work. ctypes is included in
1198 NOTE: this feature needs ctypes to work. ctypes is included in
1186 Python2.5, but 2.4 users will need to manually install it. This
1199 Python2.5, but 2.4 users will need to manually install it. This
1187 feature makes multi-threaded shells so much more usable that it's
1200 feature makes multi-threaded shells so much more usable that it's
1188 a minor price to pay (ctypes is very easy to install, already a
1201 a minor price to pay (ctypes is very easy to install, already a
1189 requirement for win32 and available in major linux distros).
1202 requirement for win32 and available in major linux distros).
1190
1203
1191 2007-04-04 Ville Vainio <vivainio@gmail.com>
1204 2007-04-04 Ville Vainio <vivainio@gmail.com>
1192
1205
1193 * Extensions/ipy_completers.py, ipy_stock_completers.py:
1206 * Extensions/ipy_completers.py, ipy_stock_completers.py:
1194 Moved implementations of 'bundled' completers to ipy_completers.py,
1207 Moved implementations of 'bundled' completers to ipy_completers.py,
1195 they are only enabled in ipy_stock_completers.py.
1208 they are only enabled in ipy_stock_completers.py.
1196
1209
1197 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
1210 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
1198
1211
1199 * IPython/PyColorize.py (Parser.format2): Fix identation of
1212 * IPython/PyColorize.py (Parser.format2): Fix identation of
1200 colorzied output and return early if color scheme is NoColor, to
1213 colorzied output and return early if color scheme is NoColor, to
1201 avoid unnecessary and expensive tokenization. Closes #131.
1214 avoid unnecessary and expensive tokenization. Closes #131.
1202
1215
1203 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
1216 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
1204
1217
1205 * IPython/Debugger.py: disable the use of pydb version 1.17. It
1218 * IPython/Debugger.py: disable the use of pydb version 1.17. It
1206 has a critical bug (a missing import that makes post-mortem not
1219 has a critical bug (a missing import that makes post-mortem not
1207 work at all). Unfortunately as of this time, this is the version
1220 work at all). Unfortunately as of this time, this is the version
1208 shipped with Ubuntu Edgy, so quite a few people have this one. I
1221 shipped with Ubuntu Edgy, so quite a few people have this one. I
1209 hope Edgy will update to a more recent package.
1222 hope Edgy will update to a more recent package.
1210
1223
1211 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
1224 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
1212
1225
1213 * IPython/iplib.py (_prefilter): close #52, second part of a patch
1226 * IPython/iplib.py (_prefilter): close #52, second part of a patch
1214 set by Stefan (only the first part had been applied before).
1227 set by Stefan (only the first part had been applied before).
1215
1228
1216 * IPython/Extensions/ipy_stock_completers.py (module_completer):
1229 * IPython/Extensions/ipy_stock_completers.py (module_completer):
1217 remove usage of the dangerous pkgutil.walk_packages(). See
1230 remove usage of the dangerous pkgutil.walk_packages(). See
1218 details in comments left in the code.
1231 details in comments left in the code.
1219
1232
1220 * IPython/Magic.py (magic_whos): add support for numpy arrays
1233 * IPython/Magic.py (magic_whos): add support for numpy arrays
1221 similar to what we had for Numeric.
1234 similar to what we had for Numeric.
1222
1235
1223 * IPython/completer.py (IPCompleter.complete): extend the
1236 * IPython/completer.py (IPCompleter.complete): extend the
1224 complete() call API to support completions by other mechanisms
1237 complete() call API to support completions by other mechanisms
1225 than readline. Closes #109.
1238 than readline. Closes #109.
1226
1239
1227 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
1240 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
1228 protect against a bug in Python's execfile(). Closes #123.
1241 protect against a bug in Python's execfile(). Closes #123.
1229
1242
1230 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
1243 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
1231
1244
1232 * IPython/iplib.py (split_user_input): ensure that when splitting
1245 * IPython/iplib.py (split_user_input): ensure that when splitting
1233 user input, the part that can be treated as a python name is pure
1246 user input, the part that can be treated as a python name is pure
1234 ascii (Python identifiers MUST be pure ascii). Part of the
1247 ascii (Python identifiers MUST be pure ascii). Part of the
1235 ongoing Unicode support work.
1248 ongoing Unicode support work.
1236
1249
1237 * IPython/Prompts.py (prompt_specials_color): Add \N for the
1250 * IPython/Prompts.py (prompt_specials_color): Add \N for the
1238 actual prompt number, without any coloring. This allows users to
1251 actual prompt number, without any coloring. This allows users to
1239 produce numbered prompts with their own colors. Added after a
1252 produce numbered prompts with their own colors. Added after a
1240 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
1253 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
1241
1254
1242 2007-03-31 Walter Doerwald <walter@livinglogic.de>
1255 2007-03-31 Walter Doerwald <walter@livinglogic.de>
1243
1256
1244 * IPython/Extensions/igrid.py: Map the return key
1257 * IPython/Extensions/igrid.py: Map the return key
1245 to enter() and shift-return to enterattr().
1258 to enter() and shift-return to enterattr().
1246
1259
1247 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
1260 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
1248
1261
1249 * IPython/Magic.py (magic_psearch): add unicode support by
1262 * IPython/Magic.py (magic_psearch): add unicode support by
1250 encoding to ascii the input, since this routine also only deals
1263 encoding to ascii the input, since this routine also only deals
1251 with valid Python names. Fixes a bug reported by Stefan.
1264 with valid Python names. Fixes a bug reported by Stefan.
1252
1265
1253 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
1266 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
1254
1267
1255 * IPython/Magic.py (_inspect): convert unicode input into ascii
1268 * IPython/Magic.py (_inspect): convert unicode input into ascii
1256 before trying to evaluate it as a Python identifier. This fixes a
1269 before trying to evaluate it as a Python identifier. This fixes a
1257 problem that the new unicode support had introduced when analyzing
1270 problem that the new unicode support had introduced when analyzing
1258 long definition lines for functions.
1271 long definition lines for functions.
1259
1272
1260 2007-03-24 Walter Doerwald <walter@livinglogic.de>
1273 2007-03-24 Walter Doerwald <walter@livinglogic.de>
1261
1274
1262 * IPython/Extensions/igrid.py: Fix picking. Using
1275 * IPython/Extensions/igrid.py: Fix picking. Using
1263 igrid with wxPython 2.6 and -wthread should work now.
1276 igrid with wxPython 2.6 and -wthread should work now.
1264 igrid.display() simply tries to create a frame without
1277 igrid.display() simply tries to create a frame without
1265 an application. Only if this fails an application is created.
1278 an application. Only if this fails an application is created.
1266
1279
1267 2007-03-23 Walter Doerwald <walter@livinglogic.de>
1280 2007-03-23 Walter Doerwald <walter@livinglogic.de>
1268
1281
1269 * IPython/Extensions/path.py: Updated to version 2.2.
1282 * IPython/Extensions/path.py: Updated to version 2.2.
1270
1283
1271 2007-03-23 Ville Vainio <vivainio@gmail.com>
1284 2007-03-23 Ville Vainio <vivainio@gmail.com>
1272
1285
1273 * iplib.py: recursive alias expansion now works better, so that
1286 * iplib.py: recursive alias expansion now works better, so that
1274 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
1287 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
1275 doesn't trip up the process, if 'd' has been aliased to 'ls'.
1288 doesn't trip up the process, if 'd' has been aliased to 'ls'.
1276
1289
1277 * Extensions/ipy_gnuglobal.py added, provides %global magic
1290 * Extensions/ipy_gnuglobal.py added, provides %global magic
1278 for users of http://www.gnu.org/software/global
1291 for users of http://www.gnu.org/software/global
1279
1292
1280 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
1293 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
1281 Closes #52. Patch by Stefan van der Walt.
1294 Closes #52. Patch by Stefan van der Walt.
1282
1295
1283 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
1296 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
1284
1297
1285 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
1298 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
1286 respect the __file__ attribute when using %run. Thanks to a bug
1299 respect the __file__ attribute when using %run. Thanks to a bug
1287 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
1300 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
1288
1301
1289 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
1302 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
1290
1303
1291 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
1304 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
1292 input. Patch sent by Stefan.
1305 input. Patch sent by Stefan.
1293
1306
1294 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1307 2007-03-20 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1295 * IPython/Extensions/ipy_stock_completer.py
1308 * IPython/Extensions/ipy_stock_completer.py
1296 shlex_split, fix bug in shlex_split. len function
1309 shlex_split, fix bug in shlex_split. len function
1297 call was missing an if statement. Caused shlex_split to
1310 call was missing an if statement. Caused shlex_split to
1298 sometimes return "" as last element.
1311 sometimes return "" as last element.
1299
1312
1300 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
1313 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
1301
1314
1302 * IPython/completer.py
1315 * IPython/completer.py
1303 (IPCompleter.file_matches.single_dir_expand): fix a problem
1316 (IPCompleter.file_matches.single_dir_expand): fix a problem
1304 reported by Stefan, where directories containign a single subdir
1317 reported by Stefan, where directories containign a single subdir
1305 would be completed too early.
1318 would be completed too early.
1306
1319
1307 * IPython/Shell.py (_load_pylab): Make the execution of 'from
1320 * IPython/Shell.py (_load_pylab): Make the execution of 'from
1308 pylab import *' when -pylab is given be optional. A new flag,
1321 pylab import *' when -pylab is given be optional. A new flag,
1309 pylab_import_all controls this behavior, the default is True for
1322 pylab_import_all controls this behavior, the default is True for
1310 backwards compatibility.
1323 backwards compatibility.
1311
1324
1312 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
1325 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
1313 modified) R. Bernstein's patch for fully syntax highlighted
1326 modified) R. Bernstein's patch for fully syntax highlighted
1314 tracebacks. The functionality is also available under ultraTB for
1327 tracebacks. The functionality is also available under ultraTB for
1315 non-ipython users (someone using ultraTB but outside an ipython
1328 non-ipython users (someone using ultraTB but outside an ipython
1316 session). They can select the color scheme by setting the
1329 session). They can select the color scheme by setting the
1317 module-level global DEFAULT_SCHEME. The highlight functionality
1330 module-level global DEFAULT_SCHEME. The highlight functionality
1318 also works when debugging.
1331 also works when debugging.
1319
1332
1320 * IPython/genutils.py (IOStream.close): small patch by
1333 * IPython/genutils.py (IOStream.close): small patch by
1321 R. Bernstein for improved pydb support.
1334 R. Bernstein for improved pydb support.
1322
1335
1323 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
1336 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
1324 DaveS <davls@telus.net> to improve support of debugging under
1337 DaveS <davls@telus.net> to improve support of debugging under
1325 NTEmacs, including improved pydb behavior.
1338 NTEmacs, including improved pydb behavior.
1326
1339
1327 * IPython/Magic.py (magic_prun): Fix saving of profile info for
1340 * IPython/Magic.py (magic_prun): Fix saving of profile info for
1328 Python 2.5, where the stats object API changed a little. Thanks
1341 Python 2.5, where the stats object API changed a little. Thanks
1329 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
1342 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
1330
1343
1331 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
1344 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
1332 Pernetty's patch to improve support for (X)Emacs under Win32.
1345 Pernetty's patch to improve support for (X)Emacs under Win32.
1333
1346
1334 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
1347 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
1335
1348
1336 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
1349 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
1337 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
1350 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
1338 a report by Nik Tautenhahn.
1351 a report by Nik Tautenhahn.
1339
1352
1340 2007-03-16 Walter Doerwald <walter@livinglogic.de>
1353 2007-03-16 Walter Doerwald <walter@livinglogic.de>
1341
1354
1342 * setup.py: Add the igrid help files to the list of data files
1355 * setup.py: Add the igrid help files to the list of data files
1343 to be installed alongside igrid.
1356 to be installed alongside igrid.
1344 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
1357 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
1345 Show the input object of the igrid browser as the window tile.
1358 Show the input object of the igrid browser as the window tile.
1346 Show the object the cursor is on in the statusbar.
1359 Show the object the cursor is on in the statusbar.
1347
1360
1348 2007-03-15 Ville Vainio <vivainio@gmail.com>
1361 2007-03-15 Ville Vainio <vivainio@gmail.com>
1349
1362
1350 * Extensions/ipy_stock_completers.py: Fixed exception
1363 * Extensions/ipy_stock_completers.py: Fixed exception
1351 on mismatching quotes in %run completer. Patch by
1364 on mismatching quotes in %run completer. Patch by
1352 Jorgen Stenarson. Closes #127.
1365 Jorgen Stenarson. Closes #127.
1353
1366
1354 2007-03-14 Ville Vainio <vivainio@gmail.com>
1367 2007-03-14 Ville Vainio <vivainio@gmail.com>
1355
1368
1356 * Extensions/ext_rehashdir.py: Do not do auto_alias
1369 * Extensions/ext_rehashdir.py: Do not do auto_alias
1357 in %rehashdir, it clobbers %store'd aliases.
1370 in %rehashdir, it clobbers %store'd aliases.
1358
1371
1359 * UserConfig/ipy_profile_sh.py: envpersist.py extension
1372 * UserConfig/ipy_profile_sh.py: envpersist.py extension
1360 (beefed up %env) imported for sh profile.
1373 (beefed up %env) imported for sh profile.
1361
1374
1362 2007-03-10 Walter Doerwald <walter@livinglogic.de>
1375 2007-03-10 Walter Doerwald <walter@livinglogic.de>
1363
1376
1364 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
1377 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
1365 as the default browser.
1378 as the default browser.
1366 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
1379 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
1367 As igrid displays all attributes it ever encounters, fetch() (which has
1380 As igrid displays all attributes it ever encounters, fetch() (which has
1368 been renamed to _fetch()) doesn't have to recalculate the display attributes
1381 been renamed to _fetch()) doesn't have to recalculate the display attributes
1369 every time a new item is fetched. This should speed up scrolling.
1382 every time a new item is fetched. This should speed up scrolling.
1370
1383
1371 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
1384 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
1372
1385
1373 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
1386 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
1374 Schmolck's recently reported tab-completion bug (my previous one
1387 Schmolck's recently reported tab-completion bug (my previous one
1375 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
1388 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
1376
1389
1377 2007-03-09 Walter Doerwald <walter@livinglogic.de>
1390 2007-03-09 Walter Doerwald <walter@livinglogic.de>
1378
1391
1379 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
1392 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
1380 Close help window if exiting igrid.
1393 Close help window if exiting igrid.
1381
1394
1382 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1395 2007-03-02 Jorgen Stenarson <jorgen.stenarson@bostream.nu>
1383
1396
1384 * IPython/Extensions/ipy_defaults.py: Check if readline is available
1397 * IPython/Extensions/ipy_defaults.py: Check if readline is available
1385 before calling functions from readline.
1398 before calling functions from readline.
1386
1399
1387 2007-03-02 Walter Doerwald <walter@livinglogic.de>
1400 2007-03-02 Walter Doerwald <walter@livinglogic.de>
1388
1401
1389 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
1402 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
1390 igrid is a wxPython-based display object for ipipe. If your system has
1403 igrid is a wxPython-based display object for ipipe. If your system has
1391 wx installed igrid will be the default display. Without wx ipipe falls
1404 wx installed igrid will be the default display. Without wx ipipe falls
1392 back to ibrowse (which needs curses). If no curses is installed ipipe
1405 back to ibrowse (which needs curses). If no curses is installed ipipe
1393 falls back to idump.
1406 falls back to idump.
1394
1407
1395 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
1408 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
1396
1409
1397 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
1410 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
1398 my changes from yesterday, they introduced bugs. Will reactivate
1411 my changes from yesterday, they introduced bugs. Will reactivate
1399 once I get a correct solution, which will be much easier thanks to
1412 once I get a correct solution, which will be much easier thanks to
1400 Dan Milstein's new prefilter test suite.
1413 Dan Milstein's new prefilter test suite.
1401
1414
1402 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
1415 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
1403
1416
1404 * IPython/iplib.py (split_user_input): fix input splitting so we
1417 * IPython/iplib.py (split_user_input): fix input splitting so we
1405 don't attempt attribute accesses on things that can't possibly be
1418 don't attempt attribute accesses on things that can't possibly be
1406 valid Python attributes. After a bug report by Alex Schmolck.
1419 valid Python attributes. After a bug report by Alex Schmolck.
1407 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
1420 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
1408 %magic with explicit % prefix.
1421 %magic with explicit % prefix.
1409
1422
1410 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
1423 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
1411
1424
1412 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
1425 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
1413 avoid a DeprecationWarning from GTK.
1426 avoid a DeprecationWarning from GTK.
1414
1427
1415 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
1428 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
1416
1429
1417 * IPython/genutils.py (clock): I modified clock() to return total
1430 * IPython/genutils.py (clock): I modified clock() to return total
1418 time, user+system. This is a more commonly needed metric. I also
1431 time, user+system. This is a more commonly needed metric. I also
1419 introduced the new clocku/clocks to get only user/system time if
1432 introduced the new clocku/clocks to get only user/system time if
1420 one wants those instead.
1433 one wants those instead.
1421
1434
1422 ***WARNING: API CHANGE*** clock() used to return only user time,
1435 ***WARNING: API CHANGE*** clock() used to return only user time,
1423 so if you want exactly the same results as before, use clocku
1436 so if you want exactly the same results as before, use clocku
1424 instead.
1437 instead.
1425
1438
1426 2007-02-22 Ville Vainio <vivainio@gmail.com>
1439 2007-02-22 Ville Vainio <vivainio@gmail.com>
1427
1440
1428 * IPython/Extensions/ipy_p4.py: Extension for improved
1441 * IPython/Extensions/ipy_p4.py: Extension for improved
1429 p4 (perforce version control system) experience.
1442 p4 (perforce version control system) experience.
1430 Adds %p4 magic with p4 command completion and
1443 Adds %p4 magic with p4 command completion and
1431 automatic -G argument (marshall output as python dict)
1444 automatic -G argument (marshall output as python dict)
1432
1445
1433 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
1446 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
1434
1447
1435 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
1448 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
1436 stop marks.
1449 stop marks.
1437 (ClearingMixin): a simple mixin to easily make a Demo class clear
1450 (ClearingMixin): a simple mixin to easily make a Demo class clear
1438 the screen in between blocks and have empty marquees. The
1451 the screen in between blocks and have empty marquees. The
1439 ClearDemo and ClearIPDemo classes that use it are included.
1452 ClearDemo and ClearIPDemo classes that use it are included.
1440
1453
1441 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
1454 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
1442
1455
1443 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
1456 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
1444 protect against exceptions at Python shutdown time. Patch
1457 protect against exceptions at Python shutdown time. Patch
1445 sumbmitted to upstream.
1458 sumbmitted to upstream.
1446
1459
1447 2007-02-14 Walter Doerwald <walter@livinglogic.de>
1460 2007-02-14 Walter Doerwald <walter@livinglogic.de>
1448
1461
1449 * IPython/Extensions/ibrowse.py: If entering the first object level
1462 * IPython/Extensions/ibrowse.py: If entering the first object level
1450 (i.e. the object for which the browser has been started) fails,
1463 (i.e. the object for which the browser has been started) fails,
1451 now the error is raised directly (aborting the browser) instead of
1464 now the error is raised directly (aborting the browser) instead of
1452 running into an empty levels list later.
1465 running into an empty levels list later.
1453
1466
1454 2007-02-03 Walter Doerwald <walter@livinglogic.de>
1467 2007-02-03 Walter Doerwald <walter@livinglogic.de>
1455
1468
1456 * IPython/Extensions/ipipe.py: Add an xrepr implementation
1469 * IPython/Extensions/ipipe.py: Add an xrepr implementation
1457 for the noitem object.
1470 for the noitem object.
1458
1471
1459 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
1472 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
1460
1473
1461 * IPython/completer.py (Completer.attr_matches): Fix small
1474 * IPython/completer.py (Completer.attr_matches): Fix small
1462 tab-completion bug with Enthought Traits objects with units.
1475 tab-completion bug with Enthought Traits objects with units.
1463 Thanks to a bug report by Tom Denniston
1476 Thanks to a bug report by Tom Denniston
1464 <tom.denniston-AT-alum.dartmouth.org>.
1477 <tom.denniston-AT-alum.dartmouth.org>.
1465
1478
1466 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1479 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
1467
1480
1468 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1481 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
1469 bug where only .ipy or .py would be completed. Once the first
1482 bug where only .ipy or .py would be completed. Once the first
1470 argument to %run has been given, all completions are valid because
1483 argument to %run has been given, all completions are valid because
1471 they are the arguments to the script, which may well be non-python
1484 they are the arguments to the script, which may well be non-python
1472 filenames.
1485 filenames.
1473
1486
1474 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1487 * IPython/irunner.py (InteractiveRunner.run_source): major updates
1475 to irunner to allow it to correctly support real doctesting of
1488 to irunner to allow it to correctly support real doctesting of
1476 out-of-process ipython code.
1489 out-of-process ipython code.
1477
1490
1478 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1491 * IPython/Magic.py (magic_cd): Make the setting of the terminal
1479 title an option (-noterm_title) because it completely breaks
1492 title an option (-noterm_title) because it completely breaks
1480 doctesting.
1493 doctesting.
1481
1494
1482 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1495 * IPython/demo.py: fix IPythonDemo class that was not actually working.
1483
1496
1484 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1497 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
1485
1498
1486 * IPython/irunner.py (main): fix small bug where extensions were
1499 * IPython/irunner.py (main): fix small bug where extensions were
1487 not being correctly recognized.
1500 not being correctly recognized.
1488
1501
1489 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1502 2007-01-23 Walter Doerwald <walter@livinglogic.de>
1490
1503
1491 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1504 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
1492 a string containing a single line yields the string itself as the
1505 a string containing a single line yields the string itself as the
1493 only item.
1506 only item.
1494
1507
1495 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1508 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
1496 object if it's the same as the one on the last level (This avoids
1509 object if it's the same as the one on the last level (This avoids
1497 infinite recursion for one line strings).
1510 infinite recursion for one line strings).
1498
1511
1499 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1512 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1500
1513
1501 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1514 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
1502 all output streams before printing tracebacks. This ensures that
1515 all output streams before printing tracebacks. This ensures that
1503 user output doesn't end up interleaved with traceback output.
1516 user output doesn't end up interleaved with traceback output.
1504
1517
1505 2007-01-10 Ville Vainio <vivainio@gmail.com>
1518 2007-01-10 Ville Vainio <vivainio@gmail.com>
1506
1519
1507 * Extensions/envpersist.py: Turbocharged %env that remembers
1520 * Extensions/envpersist.py: Turbocharged %env that remembers
1508 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1521 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
1509 "%env VISUAL=jed".
1522 "%env VISUAL=jed".
1510
1523
1511 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1524 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
1512
1525
1513 * IPython/iplib.py (showtraceback): ensure that we correctly call
1526 * IPython/iplib.py (showtraceback): ensure that we correctly call
1514 custom handlers in all cases (some with pdb were slipping through,
1527 custom handlers in all cases (some with pdb were slipping through,
1515 but I'm not exactly sure why).
1528 but I'm not exactly sure why).
1516
1529
1517 * IPython/Debugger.py (Tracer.__init__): added new class to
1530 * IPython/Debugger.py (Tracer.__init__): added new class to
1518 support set_trace-like usage of IPython's enhanced debugger.
1531 support set_trace-like usage of IPython's enhanced debugger.
1519
1532
1520 2006-12-24 Ville Vainio <vivainio@gmail.com>
1533 2006-12-24 Ville Vainio <vivainio@gmail.com>
1521
1534
1522 * ipmaker.py: more informative message when ipy_user_conf
1535 * ipmaker.py: more informative message when ipy_user_conf
1523 import fails (suggest running %upgrade).
1536 import fails (suggest running %upgrade).
1524
1537
1525 * tools/run_ipy_in_profiler.py: Utility to see where
1538 * tools/run_ipy_in_profiler.py: Utility to see where
1526 the time during IPython startup is spent.
1539 the time during IPython startup is spent.
1527
1540
1528 2006-12-20 Ville Vainio <vivainio@gmail.com>
1541 2006-12-20 Ville Vainio <vivainio@gmail.com>
1529
1542
1530 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1543 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
1531
1544
1532 * ipapi.py: Add new ipapi method, expand_alias.
1545 * ipapi.py: Add new ipapi method, expand_alias.
1533
1546
1534 * Release.py: Bump up version to 0.7.4.svn
1547 * Release.py: Bump up version to 0.7.4.svn
1535
1548
1536 2006-12-17 Ville Vainio <vivainio@gmail.com>
1549 2006-12-17 Ville Vainio <vivainio@gmail.com>
1537
1550
1538 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1551 * Extensions/jobctrl.py: Fixed &cmd arg arg...
1539 to work properly on posix too
1552 to work properly on posix too
1540
1553
1541 * Release.py: Update revnum (version is still just 0.7.3).
1554 * Release.py: Update revnum (version is still just 0.7.3).
1542
1555
1543 2006-12-15 Ville Vainio <vivainio@gmail.com>
1556 2006-12-15 Ville Vainio <vivainio@gmail.com>
1544
1557
1545 * scripts/ipython_win_post_install: create ipython.py in
1558 * scripts/ipython_win_post_install: create ipython.py in
1546 prefix + "/scripts".
1559 prefix + "/scripts".
1547
1560
1548 * Release.py: Update version to 0.7.3.
1561 * Release.py: Update version to 0.7.3.
1549
1562
1550 2006-12-14 Ville Vainio <vivainio@gmail.com>
1563 2006-12-14 Ville Vainio <vivainio@gmail.com>
1551
1564
1552 * scripts/ipython_win_post_install: Overwrite old shortcuts
1565 * scripts/ipython_win_post_install: Overwrite old shortcuts
1553 if they already exist
1566 if they already exist
1554
1567
1555 * Release.py: release 0.7.3rc2
1568 * Release.py: release 0.7.3rc2
1556
1569
1557 2006-12-13 Ville Vainio <vivainio@gmail.com>
1570 2006-12-13 Ville Vainio <vivainio@gmail.com>
1558
1571
1559 * Branch and update Release.py for 0.7.3rc1
1572 * Branch and update Release.py for 0.7.3rc1
1560
1573
1561 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1574 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
1562
1575
1563 * IPython/Shell.py (IPShellWX): update for current WX naming
1576 * IPython/Shell.py (IPShellWX): update for current WX naming
1564 conventions, to avoid a deprecation warning with current WX
1577 conventions, to avoid a deprecation warning with current WX
1565 versions. Thanks to a report by Danny Shevitz.
1578 versions. Thanks to a report by Danny Shevitz.
1566
1579
1567 2006-12-12 Ville Vainio <vivainio@gmail.com>
1580 2006-12-12 Ville Vainio <vivainio@gmail.com>
1568
1581
1569 * ipmaker.py: apply david cournapeau's patch to make
1582 * ipmaker.py: apply david cournapeau's patch to make
1570 import_some work properly even when ipythonrc does
1583 import_some work properly even when ipythonrc does
1571 import_some on empty list (it was an old bug!).
1584 import_some on empty list (it was an old bug!).
1572
1585
1573 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1586 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
1574 Add deprecation note to ipythonrc and a url to wiki
1587 Add deprecation note to ipythonrc and a url to wiki
1575 in ipy_user_conf.py
1588 in ipy_user_conf.py
1576
1589
1577
1590
1578 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1591 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
1579 as if it was typed on IPython command prompt, i.e.
1592 as if it was typed on IPython command prompt, i.e.
1580 as IPython script.
1593 as IPython script.
1581
1594
1582 * example-magic.py, magic_grepl.py: remove outdated examples
1595 * example-magic.py, magic_grepl.py: remove outdated examples
1583
1596
1584 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1597 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
1585
1598
1586 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1599 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
1587 is called before any exception has occurred.
1600 is called before any exception has occurred.
1588
1601
1589 2006-12-08 Ville Vainio <vivainio@gmail.com>
1602 2006-12-08 Ville Vainio <vivainio@gmail.com>
1590
1603
1591 * Extensions/ipy_stock_completers.py: fix cd completer
1604 * Extensions/ipy_stock_completers.py: fix cd completer
1592 to translate /'s to \'s again.
1605 to translate /'s to \'s again.
1593
1606
1594 * completer.py: prevent traceback on file completions w/
1607 * completer.py: prevent traceback on file completions w/
1595 backslash.
1608 backslash.
1596
1609
1597 * Release.py: Update release number to 0.7.3b3 for release
1610 * Release.py: Update release number to 0.7.3b3 for release
1598
1611
1599 2006-12-07 Ville Vainio <vivainio@gmail.com>
1612 2006-12-07 Ville Vainio <vivainio@gmail.com>
1600
1613
1601 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1614 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
1602 while executing external code. Provides more shell-like behaviour
1615 while executing external code. Provides more shell-like behaviour
1603 and overall better response to ctrl + C / ctrl + break.
1616 and overall better response to ctrl + C / ctrl + break.
1604
1617
1605 * tools/make_tarball.py: new script to create tarball straight from svn
1618 * tools/make_tarball.py: new script to create tarball straight from svn
1606 (setup.py sdist doesn't work on win32).
1619 (setup.py sdist doesn't work on win32).
1607
1620
1608 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1621 * Extensions/ipy_stock_completers.py: fix cd completer to give up
1609 on dirnames with spaces and use the default completer instead.
1622 on dirnames with spaces and use the default completer instead.
1610
1623
1611 * Revision.py: Change version to 0.7.3b2 for release.
1624 * Revision.py: Change version to 0.7.3b2 for release.
1612
1625
1613 2006-12-05 Ville Vainio <vivainio@gmail.com>
1626 2006-12-05 Ville Vainio <vivainio@gmail.com>
1614
1627
1615 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1628 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
1616 pydb patch 4 (rm debug printing, py 2.5 checking)
1629 pydb patch 4 (rm debug printing, py 2.5 checking)
1617
1630
1618 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1631 2006-11-30 Walter Doerwald <walter@livinglogic.de>
1619 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1632 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
1620 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1633 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
1621 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1634 "refreshfind" (mapped to "R") does the same but tries to go back to the same
1622 object the cursor was on before the refresh. The command "markrange" is
1635 object the cursor was on before the refresh. The command "markrange" is
1623 mapped to "%" now.
1636 mapped to "%" now.
1624 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1637 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
1625
1638
1626 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1639 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
1627
1640
1628 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1641 * IPython/Magic.py (magic_debug): new %debug magic to activate the
1629 interactive debugger on the last traceback, without having to call
1642 interactive debugger on the last traceback, without having to call
1630 %pdb and rerun your code. Made minor changes in various modules,
1643 %pdb and rerun your code. Made minor changes in various modules,
1631 should automatically recognize pydb if available.
1644 should automatically recognize pydb if available.
1632
1645
1633 2006-11-28 Ville Vainio <vivainio@gmail.com>
1646 2006-11-28 Ville Vainio <vivainio@gmail.com>
1634
1647
1635 * completer.py: If the text start with !, show file completions
1648 * completer.py: If the text start with !, show file completions
1636 properly. This helps when trying to complete command name
1649 properly. This helps when trying to complete command name
1637 for shell escapes.
1650 for shell escapes.
1638
1651
1639 2006-11-27 Ville Vainio <vivainio@gmail.com>
1652 2006-11-27 Ville Vainio <vivainio@gmail.com>
1640
1653
1641 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1654 * ipy_stock_completers.py: bzr completer submitted by Stefan van
1642 der Walt. Clean up svn and hg completers by using a common
1655 der Walt. Clean up svn and hg completers by using a common
1643 vcs_completer.
1656 vcs_completer.
1644
1657
1645 2006-11-26 Ville Vainio <vivainio@gmail.com>
1658 2006-11-26 Ville Vainio <vivainio@gmail.com>
1646
1659
1647 * Remove ipconfig and %config; you should use _ip.options structure
1660 * Remove ipconfig and %config; you should use _ip.options structure
1648 directly instead!
1661 directly instead!
1649
1662
1650 * genutils.py: add wrap_deprecated function for deprecating callables
1663 * genutils.py: add wrap_deprecated function for deprecating callables
1651
1664
1652 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1665 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
1653 _ip.system instead. ipalias is redundant.
1666 _ip.system instead. ipalias is redundant.
1654
1667
1655 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1668 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
1656 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1669 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
1657 explicit.
1670 explicit.
1658
1671
1659 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1672 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
1660 completer. Try it by entering 'hg ' and pressing tab.
1673 completer. Try it by entering 'hg ' and pressing tab.
1661
1674
1662 * macro.py: Give Macro a useful __repr__ method
1675 * macro.py: Give Macro a useful __repr__ method
1663
1676
1664 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1677 * Magic.py: %whos abbreviates the typename of Macro for brevity.
1665
1678
1666 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1679 2006-11-24 Walter Doerwald <walter@livinglogic.de>
1667 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1680 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
1668 we don't get a duplicate ipipe module, where registration of the xrepr
1681 we don't get a duplicate ipipe module, where registration of the xrepr
1669 implementation for Text is useless.
1682 implementation for Text is useless.
1670
1683
1671 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1684 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
1672
1685
1673 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1686 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
1674
1687
1675 2006-11-24 Ville Vainio <vivainio@gmail.com>
1688 2006-11-24 Ville Vainio <vivainio@gmail.com>
1676
1689
1677 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1690 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
1678 try to use "cProfile" instead of the slower pure python
1691 try to use "cProfile" instead of the slower pure python
1679 "profile"
1692 "profile"
1680
1693
1681 2006-11-23 Ville Vainio <vivainio@gmail.com>
1694 2006-11-23 Ville Vainio <vivainio@gmail.com>
1682
1695
1683 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1696 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
1684 Qt+IPython+Designer link in documentation.
1697 Qt+IPython+Designer link in documentation.
1685
1698
1686 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1699 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
1687 correct Pdb object to %pydb.
1700 correct Pdb object to %pydb.
1688
1701
1689
1702
1690 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1703 2006-11-22 Walter Doerwald <walter@livinglogic.de>
1691 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1704 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
1692 generic xrepr(), otherwise the list implementation would kick in.
1705 generic xrepr(), otherwise the list implementation would kick in.
1693
1706
1694 2006-11-21 Ville Vainio <vivainio@gmail.com>
1707 2006-11-21 Ville Vainio <vivainio@gmail.com>
1695
1708
1696 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1709 * upgrade_dir.py: Now actually overwrites a nonmodified user file
1697 with one from UserConfig.
1710 with one from UserConfig.
1698
1711
1699 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1712 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
1700 it was missing which broke the sh profile.
1713 it was missing which broke the sh profile.
1701
1714
1702 * completer.py: file completer now uses explicit '/' instead
1715 * completer.py: file completer now uses explicit '/' instead
1703 of os.path.join, expansion of 'foo' was broken on win32
1716 of os.path.join, expansion of 'foo' was broken on win32
1704 if there was one directory with name 'foobar'.
1717 if there was one directory with name 'foobar'.
1705
1718
1706 * A bunch of patches from Kirill Smelkov:
1719 * A bunch of patches from Kirill Smelkov:
1707
1720
1708 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1721 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
1709
1722
1710 * [patch 7/9] Implement %page -r (page in raw mode) -
1723 * [patch 7/9] Implement %page -r (page in raw mode) -
1711
1724
1712 * [patch 5/9] ScientificPython webpage has moved
1725 * [patch 5/9] ScientificPython webpage has moved
1713
1726
1714 * [patch 4/9] The manual mentions %ds, should be %dhist
1727 * [patch 4/9] The manual mentions %ds, should be %dhist
1715
1728
1716 * [patch 3/9] Kill old bits from %prun doc.
1729 * [patch 3/9] Kill old bits from %prun doc.
1717
1730
1718 * [patch 1/9] Fix typos here and there.
1731 * [patch 1/9] Fix typos here and there.
1719
1732
1720 2006-11-08 Ville Vainio <vivainio@gmail.com>
1733 2006-11-08 Ville Vainio <vivainio@gmail.com>
1721
1734
1722 * completer.py (attr_matches): catch all exceptions raised
1735 * completer.py (attr_matches): catch all exceptions raised
1723 by eval of expr with dots.
1736 by eval of expr with dots.
1724
1737
1725 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1738 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
1726
1739
1727 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1740 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
1728 input if it starts with whitespace. This allows you to paste
1741 input if it starts with whitespace. This allows you to paste
1729 indented input from any editor without manually having to type in
1742 indented input from any editor without manually having to type in
1730 the 'if 1:', which is convenient when working interactively.
1743 the 'if 1:', which is convenient when working interactively.
1731 Slightly modifed version of a patch by Bo Peng
1744 Slightly modifed version of a patch by Bo Peng
1732 <bpeng-AT-rice.edu>.
1745 <bpeng-AT-rice.edu>.
1733
1746
1734 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1747 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1735
1748
1736 * IPython/irunner.py (main): modified irunner so it automatically
1749 * IPython/irunner.py (main): modified irunner so it automatically
1737 recognizes the right runner to use based on the extension (.py for
1750 recognizes the right runner to use based on the extension (.py for
1738 python, .ipy for ipython and .sage for sage).
1751 python, .ipy for ipython and .sage for sage).
1739
1752
1740 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1753 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
1741 visible in ipapi as ip.config(), to programatically control the
1754 visible in ipapi as ip.config(), to programatically control the
1742 internal rc object. There's an accompanying %config magic for
1755 internal rc object. There's an accompanying %config magic for
1743 interactive use, which has been enhanced to match the
1756 interactive use, which has been enhanced to match the
1744 funtionality in ipconfig.
1757 funtionality in ipconfig.
1745
1758
1746 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1759 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
1747 so it's not just a toggle, it now takes an argument. Add support
1760 so it's not just a toggle, it now takes an argument. Add support
1748 for a customizable header when making system calls, as the new
1761 for a customizable header when making system calls, as the new
1749 system_header variable in the ipythonrc file.
1762 system_header variable in the ipythonrc file.
1750
1763
1751 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1764 2006-11-03 Walter Doerwald <walter@livinglogic.de>
1752
1765
1753 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1766 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
1754 generic functions (using Philip J. Eby's simplegeneric package).
1767 generic functions (using Philip J. Eby's simplegeneric package).
1755 This makes it possible to customize the display of third-party classes
1768 This makes it possible to customize the display of third-party classes
1756 without having to monkeypatch them. xiter() no longer supports a mode
1769 without having to monkeypatch them. xiter() no longer supports a mode
1757 argument and the XMode class has been removed. The same functionality can
1770 argument and the XMode class has been removed. The same functionality can
1758 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1771 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
1759 One consequence of the switch to generic functions is that xrepr() and
1772 One consequence of the switch to generic functions is that xrepr() and
1760 xattrs() implementation must define the default value for the mode
1773 xattrs() implementation must define the default value for the mode
1761 argument themselves and xattrs() implementations must return real
1774 argument themselves and xattrs() implementations must return real
1762 descriptors.
1775 descriptors.
1763
1776
1764 * IPython/external: This new subpackage will contain all third-party
1777 * IPython/external: This new subpackage will contain all third-party
1765 packages that are bundled with IPython. (The first one is simplegeneric).
1778 packages that are bundled with IPython. (The first one is simplegeneric).
1766
1779
1767 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1780 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
1768 directory which as been dropped in r1703.
1781 directory which as been dropped in r1703.
1769
1782
1770 * IPython/Extensions/ipipe.py (iless): Fixed.
1783 * IPython/Extensions/ipipe.py (iless): Fixed.
1771
1784
1772 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1785 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
1773
1786
1774 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1787 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
1775
1788
1776 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1789 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
1777 handling in variable expansion so that shells and magics recognize
1790 handling in variable expansion so that shells and magics recognize
1778 function local scopes correctly. Bug reported by Brian.
1791 function local scopes correctly. Bug reported by Brian.
1779
1792
1780 * scripts/ipython: remove the very first entry in sys.path which
1793 * scripts/ipython: remove the very first entry in sys.path which
1781 Python auto-inserts for scripts, so that sys.path under IPython is
1794 Python auto-inserts for scripts, so that sys.path under IPython is
1782 as similar as possible to that under plain Python.
1795 as similar as possible to that under plain Python.
1783
1796
1784 * IPython/completer.py (IPCompleter.file_matches): Fix
1797 * IPython/completer.py (IPCompleter.file_matches): Fix
1785 tab-completion so that quotes are not closed unless the completion
1798 tab-completion so that quotes are not closed unless the completion
1786 is unambiguous. After a request by Stefan. Minor cleanups in
1799 is unambiguous. After a request by Stefan. Minor cleanups in
1787 ipy_stock_completers.
1800 ipy_stock_completers.
1788
1801
1789 2006-11-02 Ville Vainio <vivainio@gmail.com>
1802 2006-11-02 Ville Vainio <vivainio@gmail.com>
1790
1803
1791 * ipy_stock_completers.py: Add %run and %cd completers.
1804 * ipy_stock_completers.py: Add %run and %cd completers.
1792
1805
1793 * completer.py: Try running custom completer for both
1806 * completer.py: Try running custom completer for both
1794 "foo" and "%foo" if the command is just "foo". Ignore case
1807 "foo" and "%foo" if the command is just "foo". Ignore case
1795 when filtering possible completions.
1808 when filtering possible completions.
1796
1809
1797 * UserConfig/ipy_user_conf.py: install stock completers as default
1810 * UserConfig/ipy_user_conf.py: install stock completers as default
1798
1811
1799 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1812 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
1800 simplified readline history save / restore through a wrapper
1813 simplified readline history save / restore through a wrapper
1801 function
1814 function
1802
1815
1803
1816
1804 2006-10-31 Ville Vainio <vivainio@gmail.com>
1817 2006-10-31 Ville Vainio <vivainio@gmail.com>
1805
1818
1806 * strdispatch.py, completer.py, ipy_stock_completers.py:
1819 * strdispatch.py, completer.py, ipy_stock_completers.py:
1807 Allow str_key ("command") in completer hooks. Implement
1820 Allow str_key ("command") in completer hooks. Implement
1808 trivial completer for 'import' (stdlib modules only). Rename
1821 trivial completer for 'import' (stdlib modules only). Rename
1809 ipy_linux_package_managers.py to ipy_stock_completers.py.
1822 ipy_linux_package_managers.py to ipy_stock_completers.py.
1810 SVN completer.
1823 SVN completer.
1811
1824
1812 * Extensions/ledit.py: %magic line editor for easily and
1825 * Extensions/ledit.py: %magic line editor for easily and
1813 incrementally manipulating lists of strings. The magic command
1826 incrementally manipulating lists of strings. The magic command
1814 name is %led.
1827 name is %led.
1815
1828
1816 2006-10-30 Ville Vainio <vivainio@gmail.com>
1829 2006-10-30 Ville Vainio <vivainio@gmail.com>
1817
1830
1818 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1831 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
1819 Bernsteins's patches for pydb integration.
1832 Bernsteins's patches for pydb integration.
1820 http://bashdb.sourceforge.net/pydb/
1833 http://bashdb.sourceforge.net/pydb/
1821
1834
1822 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1835 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
1823 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1836 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
1824 custom completer hook to allow the users to implement their own
1837 custom completer hook to allow the users to implement their own
1825 completers. See ipy_linux_package_managers.py for example. The
1838 completers. See ipy_linux_package_managers.py for example. The
1826 hook name is 'complete_command'.
1839 hook name is 'complete_command'.
1827
1840
1828 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1841 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
1829
1842
1830 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1843 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
1831 Numeric leftovers.
1844 Numeric leftovers.
1832
1845
1833 * ipython.el (py-execute-region): apply Stefan's patch to fix
1846 * ipython.el (py-execute-region): apply Stefan's patch to fix
1834 garbled results if the python shell hasn't been previously started.
1847 garbled results if the python shell hasn't been previously started.
1835
1848
1836 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1849 * IPython/genutils.py (arg_split): moved to genutils, since it's a
1837 pretty generic function and useful for other things.
1850 pretty generic function and useful for other things.
1838
1851
1839 * IPython/OInspect.py (getsource): Add customizable source
1852 * IPython/OInspect.py (getsource): Add customizable source
1840 extractor. After a request/patch form W. Stein (SAGE).
1853 extractor. After a request/patch form W. Stein (SAGE).
1841
1854
1842 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1855 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
1843 window size to a more reasonable value from what pexpect does,
1856 window size to a more reasonable value from what pexpect does,
1844 since their choice causes wrapping bugs with long input lines.
1857 since their choice causes wrapping bugs with long input lines.
1845
1858
1846 2006-10-28 Ville Vainio <vivainio@gmail.com>
1859 2006-10-28 Ville Vainio <vivainio@gmail.com>
1847
1860
1848 * Magic.py (%run): Save and restore the readline history from
1861 * Magic.py (%run): Save and restore the readline history from
1849 file around %run commands to prevent side effects from
1862 file around %run commands to prevent side effects from
1850 %runned programs that might use readline (e.g. pydb).
1863 %runned programs that might use readline (e.g. pydb).
1851
1864
1852 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1865 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
1853 invoking the pydb enhanced debugger.
1866 invoking the pydb enhanced debugger.
1854
1867
1855 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1868 2006-10-23 Walter Doerwald <walter@livinglogic.de>
1856
1869
1857 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1870 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
1858 call the base class method and propagate the return value to
1871 call the base class method and propagate the return value to
1859 ifile. This is now done by path itself.
1872 ifile. This is now done by path itself.
1860
1873
1861 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1874 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1862
1875
1863 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1876 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
1864 api: set_crash_handler(), to expose the ability to change the
1877 api: set_crash_handler(), to expose the ability to change the
1865 internal crash handler.
1878 internal crash handler.
1866
1879
1867 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1880 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
1868 the various parameters of the crash handler so that apps using
1881 the various parameters of the crash handler so that apps using
1869 IPython as their engine can customize crash handling. Ipmlemented
1882 IPython as their engine can customize crash handling. Ipmlemented
1870 at the request of SAGE.
1883 at the request of SAGE.
1871
1884
1872 2006-10-14 Ville Vainio <vivainio@gmail.com>
1885 2006-10-14 Ville Vainio <vivainio@gmail.com>
1873
1886
1874 * Magic.py, ipython.el: applied first "safe" part of Rocky
1887 * Magic.py, ipython.el: applied first "safe" part of Rocky
1875 Bernstein's patch set for pydb integration.
1888 Bernstein's patch set for pydb integration.
1876
1889
1877 * Magic.py (%unalias, %alias): %store'd aliases can now be
1890 * Magic.py (%unalias, %alias): %store'd aliases can now be
1878 removed with '%unalias'. %alias w/o args now shows most
1891 removed with '%unalias'. %alias w/o args now shows most
1879 interesting (stored / manually defined) aliases last
1892 interesting (stored / manually defined) aliases last
1880 where they catch the eye w/o scrolling.
1893 where they catch the eye w/o scrolling.
1881
1894
1882 * Magic.py (%rehashx), ext_rehashdir.py: files with
1895 * Magic.py (%rehashx), ext_rehashdir.py: files with
1883 'py' extension are always considered executable, even
1896 'py' extension are always considered executable, even
1884 when not in PATHEXT environment variable.
1897 when not in PATHEXT environment variable.
1885
1898
1886 2006-10-12 Ville Vainio <vivainio@gmail.com>
1899 2006-10-12 Ville Vainio <vivainio@gmail.com>
1887
1900
1888 * jobctrl.py: Add new "jobctrl" extension for spawning background
1901 * jobctrl.py: Add new "jobctrl" extension for spawning background
1889 processes with "&find /". 'import jobctrl' to try it out. Requires
1902 processes with "&find /". 'import jobctrl' to try it out. Requires
1890 'subprocess' module, standard in python 2.4+.
1903 'subprocess' module, standard in python 2.4+.
1891
1904
1892 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1905 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
1893 so if foo -> bar and bar -> baz, then foo -> baz.
1906 so if foo -> bar and bar -> baz, then foo -> baz.
1894
1907
1895 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1908 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
1896
1909
1897 * IPython/Magic.py (Magic.parse_options): add a new posix option
1910 * IPython/Magic.py (Magic.parse_options): add a new posix option
1898 to allow parsing of input args in magics that doesn't strip quotes
1911 to allow parsing of input args in magics that doesn't strip quotes
1899 (if posix=False). This also closes %timeit bug reported by
1912 (if posix=False). This also closes %timeit bug reported by
1900 Stefan.
1913 Stefan.
1901
1914
1902 2006-10-03 Ville Vainio <vivainio@gmail.com>
1915 2006-10-03 Ville Vainio <vivainio@gmail.com>
1903
1916
1904 * iplib.py (raw_input, interact): Return ValueError catching for
1917 * iplib.py (raw_input, interact): Return ValueError catching for
1905 raw_input. Fixes infinite loop for sys.stdin.close() or
1918 raw_input. Fixes infinite loop for sys.stdin.close() or
1906 sys.stdout.close().
1919 sys.stdout.close().
1907
1920
1908 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1921 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1909
1922
1910 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1923 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
1911 to help in handling doctests. irunner is now pretty useful for
1924 to help in handling doctests. irunner is now pretty useful for
1912 running standalone scripts and simulate a full interactive session
1925 running standalone scripts and simulate a full interactive session
1913 in a format that can be then pasted as a doctest.
1926 in a format that can be then pasted as a doctest.
1914
1927
1915 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1928 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
1916 on top of the default (useless) ones. This also fixes the nasty
1929 on top of the default (useless) ones. This also fixes the nasty
1917 way in which 2.5's Quitter() exits (reverted [1785]).
1930 way in which 2.5's Quitter() exits (reverted [1785]).
1918
1931
1919 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1932 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
1920 2.5.
1933 2.5.
1921
1934
1922 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1935 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
1923 color scheme is updated as well when color scheme is changed
1936 color scheme is updated as well when color scheme is changed
1924 interactively.
1937 interactively.
1925
1938
1926 2006-09-27 Ville Vainio <vivainio@gmail.com>
1939 2006-09-27 Ville Vainio <vivainio@gmail.com>
1927
1940
1928 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1941 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
1929 infinite loop and just exit. It's a hack, but will do for a while.
1942 infinite loop and just exit. It's a hack, but will do for a while.
1930
1943
1931 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1944 2006-08-25 Walter Doerwald <walter@livinglogic.de>
1932
1945
1933 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1946 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
1934 the constructor, this makes it possible to get a list of only directories
1947 the constructor, this makes it possible to get a list of only directories
1935 or only files.
1948 or only files.
1936
1949
1937 2006-08-12 Ville Vainio <vivainio@gmail.com>
1950 2006-08-12 Ville Vainio <vivainio@gmail.com>
1938
1951
1939 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1952 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
1940 they broke unittest
1953 they broke unittest
1941
1954
1942 2006-08-11 Ville Vainio <vivainio@gmail.com>
1955 2006-08-11 Ville Vainio <vivainio@gmail.com>
1943
1956
1944 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1957 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
1945 by resolving issue properly, i.e. by inheriting FakeModule
1958 by resolving issue properly, i.e. by inheriting FakeModule
1946 from types.ModuleType. Pickling ipython interactive data
1959 from types.ModuleType. Pickling ipython interactive data
1947 should still work as usual (testing appreciated).
1960 should still work as usual (testing appreciated).
1948
1961
1949 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1962 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
1950
1963
1951 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1964 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
1952 running under python 2.3 with code from 2.4 to fix a bug with
1965 running under python 2.3 with code from 2.4 to fix a bug with
1953 help(). Reported by the Debian maintainers, Norbert Tretkowski
1966 help(). Reported by the Debian maintainers, Norbert Tretkowski
1954 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1967 <norbert-AT-tretkowski.de> and Alexandre Fayolle
1955 <afayolle-AT-debian.org>.
1968 <afayolle-AT-debian.org>.
1956
1969
1957 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1970 2006-08-04 Walter Doerwald <walter@livinglogic.de>
1958
1971
1959 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1972 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
1960 (which was displaying "quit" twice).
1973 (which was displaying "quit" twice).
1961
1974
1962 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1975 2006-07-28 Walter Doerwald <walter@livinglogic.de>
1963
1976
1964 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1977 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
1965 the mode argument).
1978 the mode argument).
1966
1979
1967 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1980 2006-07-27 Walter Doerwald <walter@livinglogic.de>
1968
1981
1969 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1982 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
1970 not running under IPython.
1983 not running under IPython.
1971
1984
1972 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1985 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
1973 and make it iterable (iterating over the attribute itself). Add two new
1986 and make it iterable (iterating over the attribute itself). Add two new
1974 magic strings for __xattrs__(): If the string starts with "-", the attribute
1987 magic strings for __xattrs__(): If the string starts with "-", the attribute
1975 will not be displayed in ibrowse's detail view (but it can still be
1988 will not be displayed in ibrowse's detail view (but it can still be
1976 iterated over). This makes it possible to add attributes that are large
1989 iterated over). This makes it possible to add attributes that are large
1977 lists or generator methods to the detail view. Replace magic attribute names
1990 lists or generator methods to the detail view. Replace magic attribute names
1978 and _attrname() and _getattr() with "descriptors": For each type of magic
1991 and _attrname() and _getattr() with "descriptors": For each type of magic
1979 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1992 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
1980 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1993 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
1981 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1994 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
1982 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1995 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
1983 are still supported.
1996 are still supported.
1984
1997
1985 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1998 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
1986 fails in ibrowse.fetch(), the exception object is added as the last item
1999 fails in ibrowse.fetch(), the exception object is added as the last item
1987 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
2000 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
1988 a generator throws an exception midway through execution.
2001 a generator throws an exception midway through execution.
1989
2002
1990 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
2003 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
1991 encoding into methods.
2004 encoding into methods.
1992
2005
1993 2006-07-26 Ville Vainio <vivainio@gmail.com>
2006 2006-07-26 Ville Vainio <vivainio@gmail.com>
1994
2007
1995 * iplib.py: history now stores multiline input as single
2008 * iplib.py: history now stores multiline input as single
1996 history entries. Patch by Jorgen Cederlof.
2009 history entries. Patch by Jorgen Cederlof.
1997
2010
1998 2006-07-18 Walter Doerwald <walter@livinglogic.de>
2011 2006-07-18 Walter Doerwald <walter@livinglogic.de>
1999
2012
2000 * IPython/Extensions/ibrowse.py: Make cursor visible over
2013 * IPython/Extensions/ibrowse.py: Make cursor visible over
2001 non existing attributes.
2014 non existing attributes.
2002
2015
2003 2006-07-14 Walter Doerwald <walter@livinglogic.de>
2016 2006-07-14 Walter Doerwald <walter@livinglogic.de>
2004
2017
2005 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
2018 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
2006 error output of the running command doesn't mess up the screen.
2019 error output of the running command doesn't mess up the screen.
2007
2020
2008 2006-07-13 Walter Doerwald <walter@livinglogic.de>
2021 2006-07-13 Walter Doerwald <walter@livinglogic.de>
2009
2022
2010 * IPython/Extensions/ipipe.py (isort): Make isort usable without
2023 * IPython/Extensions/ipipe.py (isort): Make isort usable without
2011 argument. This sorts the items themselves.
2024 argument. This sorts the items themselves.
2012
2025
2013 2006-07-12 Walter Doerwald <walter@livinglogic.de>
2026 2006-07-12 Walter Doerwald <walter@livinglogic.de>
2014
2027
2015 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
2028 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
2016 Compile expression strings into code objects. This should speed
2029 Compile expression strings into code objects. This should speed
2017 up ifilter and friends somewhat.
2030 up ifilter and friends somewhat.
2018
2031
2019 2006-07-08 Ville Vainio <vivainio@gmail.com>
2032 2006-07-08 Ville Vainio <vivainio@gmail.com>
2020
2033
2021 * Magic.py: %cpaste now strips > from the beginning of lines
2034 * Magic.py: %cpaste now strips > from the beginning of lines
2022 to ease pasting quoted code from emails. Contributed by
2035 to ease pasting quoted code from emails. Contributed by
2023 Stefan van der Walt.
2036 Stefan van der Walt.
2024
2037
2025 2006-06-29 Ville Vainio <vivainio@gmail.com>
2038 2006-06-29 Ville Vainio <vivainio@gmail.com>
2026
2039
2027 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
2040 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
2028 mode, patch contributed by Darren Dale. NEEDS TESTING!
2041 mode, patch contributed by Darren Dale. NEEDS TESTING!
2029
2042
2030 2006-06-28 Walter Doerwald <walter@livinglogic.de>
2043 2006-06-28 Walter Doerwald <walter@livinglogic.de>
2031
2044
2032 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
2045 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
2033 a blue background. Fix fetching new display rows when the browser
2046 a blue background. Fix fetching new display rows when the browser
2034 scrolls more than a screenful (e.g. by using the goto command).
2047 scrolls more than a screenful (e.g. by using the goto command).
2035
2048
2036 2006-06-27 Ville Vainio <vivainio@gmail.com>
2049 2006-06-27 Ville Vainio <vivainio@gmail.com>
2037
2050
2038 * Magic.py (_inspect, _ofind) Apply David Huard's
2051 * Magic.py (_inspect, _ofind) Apply David Huard's
2039 patch for displaying the correct docstring for 'property'
2052 patch for displaying the correct docstring for 'property'
2040 attributes.
2053 attributes.
2041
2054
2042 2006-06-23 Walter Doerwald <walter@livinglogic.de>
2055 2006-06-23 Walter Doerwald <walter@livinglogic.de>
2043
2056
2044 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
2057 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
2045 commands into the methods implementing them.
2058 commands into the methods implementing them.
2046
2059
2047 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
2060 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
2048
2061
2049 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
2062 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
2050 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
2063 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
2051 autoindent support was authored by Jin Liu.
2064 autoindent support was authored by Jin Liu.
2052
2065
2053 2006-06-22 Walter Doerwald <walter@livinglogic.de>
2066 2006-06-22 Walter Doerwald <walter@livinglogic.de>
2054
2067
2055 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
2068 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
2056 for keymaps with a custom class that simplifies handling.
2069 for keymaps with a custom class that simplifies handling.
2057
2070
2058 2006-06-19 Walter Doerwald <walter@livinglogic.de>
2071 2006-06-19 Walter Doerwald <walter@livinglogic.de>
2059
2072
2060 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
2073 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
2061 resizing. This requires Python 2.5 to work.
2074 resizing. This requires Python 2.5 to work.
2062
2075
2063 2006-06-16 Walter Doerwald <walter@livinglogic.de>
2076 2006-06-16 Walter Doerwald <walter@livinglogic.de>
2064
2077
2065 * IPython/Extensions/ibrowse.py: Add two new commands to
2078 * IPython/Extensions/ibrowse.py: Add two new commands to
2066 ibrowse: "hideattr" (mapped to "h") hides the attribute under
2079 ibrowse: "hideattr" (mapped to "h") hides the attribute under
2067 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
2080 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
2068 attributes again. Remapped the help command to "?". Display
2081 attributes again. Remapped the help command to "?". Display
2069 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
2082 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
2070 as keys for the "home" and "end" commands. Add three new commands
2083 as keys for the "home" and "end" commands. Add three new commands
2071 to the input mode for "find" and friends: "delend" (CTRL-K)
2084 to the input mode for "find" and friends: "delend" (CTRL-K)
2072 deletes to the end of line. "incsearchup" searches upwards in the
2085 deletes to the end of line. "incsearchup" searches upwards in the
2073 command history for an input that starts with the text before the cursor.
2086 command history for an input that starts with the text before the cursor.
2074 "incsearchdown" does the same downwards. Removed a bogus mapping of
2087 "incsearchdown" does the same downwards. Removed a bogus mapping of
2075 the x key to "delete".
2088 the x key to "delete".
2076
2089
2077 2006-06-15 Ville Vainio <vivainio@gmail.com>
2090 2006-06-15 Ville Vainio <vivainio@gmail.com>
2078
2091
2079 * iplib.py, hooks.py: Added new generate_prompt hook that can be
2092 * iplib.py, hooks.py: Added new generate_prompt hook that can be
2080 used to create prompts dynamically, instead of the "old" way of
2093 used to create prompts dynamically, instead of the "old" way of
2081 assigning "magic" strings to prompt_in1 and prompt_in2. The old
2094 assigning "magic" strings to prompt_in1 and prompt_in2. The old
2082 way still works (it's invoked by the default hook), of course.
2095 way still works (it's invoked by the default hook), of course.
2083
2096
2084 * Prompts.py: added generate_output_prompt hook for altering output
2097 * Prompts.py: added generate_output_prompt hook for altering output
2085 prompt
2098 prompt
2086
2099
2087 * Release.py: Changed version string to 0.7.3.svn.
2100 * Release.py: Changed version string to 0.7.3.svn.
2088
2101
2089 2006-06-15 Walter Doerwald <walter@livinglogic.de>
2102 2006-06-15 Walter Doerwald <walter@livinglogic.de>
2090
2103
2091 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
2104 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
2092 the call to fetch() always tries to fetch enough data for at least one
2105 the call to fetch() always tries to fetch enough data for at least one
2093 full screen. This makes it possible to simply call moveto(0,0,True) in
2106 full screen. This makes it possible to simply call moveto(0,0,True) in
2094 the constructor. Fix typos and removed the obsolete goto attribute.
2107 the constructor. Fix typos and removed the obsolete goto attribute.
2095
2108
2096 2006-06-12 Ville Vainio <vivainio@gmail.com>
2109 2006-06-12 Ville Vainio <vivainio@gmail.com>
2097
2110
2098 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
2111 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
2099 allowing $variable interpolation within multiline statements,
2112 allowing $variable interpolation within multiline statements,
2100 though so far only with "sh" profile for a testing period.
2113 though so far only with "sh" profile for a testing period.
2101 The patch also enables splitting long commands with \ but it
2114 The patch also enables splitting long commands with \ but it
2102 doesn't work properly yet.
2115 doesn't work properly yet.
2103
2116
2104 2006-06-12 Walter Doerwald <walter@livinglogic.de>
2117 2006-06-12 Walter Doerwald <walter@livinglogic.de>
2105
2118
2106 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
2119 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
2107 input history and the position of the cursor in the input history for
2120 input history and the position of the cursor in the input history for
2108 the find, findbackwards and goto command.
2121 the find, findbackwards and goto command.
2109
2122
2110 2006-06-10 Walter Doerwald <walter@livinglogic.de>
2123 2006-06-10 Walter Doerwald <walter@livinglogic.de>
2111
2124
2112 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
2125 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
2113 implements the basic functionality of browser commands that require
2126 implements the basic functionality of browser commands that require
2114 input. Reimplement the goto, find and findbackwards commands as
2127 input. Reimplement the goto, find and findbackwards commands as
2115 subclasses of _CommandInput. Add an input history and keymaps to those
2128 subclasses of _CommandInput. Add an input history and keymaps to those
2116 commands. Add "\r" as a keyboard shortcut for the enterdefault and
2129 commands. Add "\r" as a keyboard shortcut for the enterdefault and
2117 execute commands.
2130 execute commands.
2118
2131
2119 2006-06-07 Ville Vainio <vivainio@gmail.com>
2132 2006-06-07 Ville Vainio <vivainio@gmail.com>
2120
2133
2121 * iplib.py: ipython mybatch.ipy exits ipython immediately after
2134 * iplib.py: ipython mybatch.ipy exits ipython immediately after
2122 running the batch files instead of leaving the session open.
2135 running the batch files instead of leaving the session open.
2123
2136
2124 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
2137 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
2125
2138
2126 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
2139 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
2127 the original fix was incomplete. Patch submitted by W. Maier.
2140 the original fix was incomplete. Patch submitted by W. Maier.
2128
2141
2129 2006-06-07 Ville Vainio <vivainio@gmail.com>
2142 2006-06-07 Ville Vainio <vivainio@gmail.com>
2130
2143
2131 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
2144 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
2132 Confirmation prompts can be supressed by 'quiet' option.
2145 Confirmation prompts can be supressed by 'quiet' option.
2133 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
2146 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
2134
2147
2135 2006-06-06 *** Released version 0.7.2
2148 2006-06-06 *** Released version 0.7.2
2136
2149
2137 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
2150 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
2138
2151
2139 * IPython/Release.py (version): Made 0.7.2 final for release.
2152 * IPython/Release.py (version): Made 0.7.2 final for release.
2140 Repo tagged and release cut.
2153 Repo tagged and release cut.
2141
2154
2142 2006-06-05 Ville Vainio <vivainio@gmail.com>
2155 2006-06-05 Ville Vainio <vivainio@gmail.com>
2143
2156
2144 * Magic.py (magic_rehashx): Honor no_alias list earlier in
2157 * Magic.py (magic_rehashx): Honor no_alias list earlier in
2145 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
2158 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
2146
2159
2147 * upgrade_dir.py: try import 'path' module a bit harder
2160 * upgrade_dir.py: try import 'path' module a bit harder
2148 (for %upgrade)
2161 (for %upgrade)
2149
2162
2150 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
2163 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
2151
2164
2152 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
2165 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
2153 instead of looping 20 times.
2166 instead of looping 20 times.
2154
2167
2155 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
2168 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
2156 correctly at initialization time. Bug reported by Krishna Mohan
2169 correctly at initialization time. Bug reported by Krishna Mohan
2157 Gundu <gkmohan-AT-gmail.com> on the user list.
2170 Gundu <gkmohan-AT-gmail.com> on the user list.
2158
2171
2159 * IPython/Release.py (version): Mark 0.7.2 version to start
2172 * IPython/Release.py (version): Mark 0.7.2 version to start
2160 testing for release on 06/06.
2173 testing for release on 06/06.
2161
2174
2162 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
2175 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
2163
2176
2164 * scripts/irunner: thin script interface so users don't have to
2177 * scripts/irunner: thin script interface so users don't have to
2165 find the module and call it as an executable, since modules rarely
2178 find the module and call it as an executable, since modules rarely
2166 live in people's PATH.
2179 live in people's PATH.
2167
2180
2168 * IPython/irunner.py (InteractiveRunner.__init__): added
2181 * IPython/irunner.py (InteractiveRunner.__init__): added
2169 delaybeforesend attribute to control delays with newer versions of
2182 delaybeforesend attribute to control delays with newer versions of
2170 pexpect. Thanks to detailed help from pexpect's author, Noah
2183 pexpect. Thanks to detailed help from pexpect's author, Noah
2171 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
2184 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
2172 correctly (it works in NoColor mode).
2185 correctly (it works in NoColor mode).
2173
2186
2174 * IPython/iplib.py (handle_normal): fix nasty crash reported on
2187 * IPython/iplib.py (handle_normal): fix nasty crash reported on
2175 SAGE list, from improper log() calls.
2188 SAGE list, from improper log() calls.
2176
2189
2177 2006-05-31 Ville Vainio <vivainio@gmail.com>
2190 2006-05-31 Ville Vainio <vivainio@gmail.com>
2178
2191
2179 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
2192 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
2180 with args in parens to work correctly with dirs that have spaces.
2193 with args in parens to work correctly with dirs that have spaces.
2181
2194
2182 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
2195 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
2183
2196
2184 * IPython/Logger.py (Logger.logstart): add option to log raw input
2197 * IPython/Logger.py (Logger.logstart): add option to log raw input
2185 instead of the processed one. A -r flag was added to the
2198 instead of the processed one. A -r flag was added to the
2186 %logstart magic used for controlling logging.
2199 %logstart magic used for controlling logging.
2187
2200
2188 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
2201 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
2189
2202
2190 * IPython/iplib.py (InteractiveShell.__init__): add check for the
2203 * IPython/iplib.py (InteractiveShell.__init__): add check for the
2191 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
2204 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
2192 recognize the option. After a bug report by Will Maier. This
2205 recognize the option. After a bug report by Will Maier. This
2193 closes #64 (will do it after confirmation from W. Maier).
2206 closes #64 (will do it after confirmation from W. Maier).
2194
2207
2195 * IPython/irunner.py: New module to run scripts as if manually
2208 * IPython/irunner.py: New module to run scripts as if manually
2196 typed into an interactive environment, based on pexpect. After a
2209 typed into an interactive environment, based on pexpect. After a
2197 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
2210 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
2198 ipython-user list. Simple unittests in the tests/ directory.
2211 ipython-user list. Simple unittests in the tests/ directory.
2199
2212
2200 * tools/release: add Will Maier, OpenBSD port maintainer, to
2213 * tools/release: add Will Maier, OpenBSD port maintainer, to
2201 recepients list. We are now officially part of the OpenBSD ports:
2214 recepients list. We are now officially part of the OpenBSD ports:
2202 http://www.openbsd.org/ports.html ! Many thanks to Will for the
2215 http://www.openbsd.org/ports.html ! Many thanks to Will for the
2203 work.
2216 work.
2204
2217
2205 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
2218 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
2206
2219
2207 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
2220 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
2208 so that it doesn't break tkinter apps.
2221 so that it doesn't break tkinter apps.
2209
2222
2210 * IPython/iplib.py (_prefilter): fix bug where aliases would
2223 * IPython/iplib.py (_prefilter): fix bug where aliases would
2211 shadow variables when autocall was fully off. Reported by SAGE
2224 shadow variables when autocall was fully off. Reported by SAGE
2212 author William Stein.
2225 author William Stein.
2213
2226
2214 * IPython/OInspect.py (Inspector.__init__): add a flag to control
2227 * IPython/OInspect.py (Inspector.__init__): add a flag to control
2215 at what detail level strings are computed when foo? is requested.
2228 at what detail level strings are computed when foo? is requested.
2216 This allows users to ask for example that the string form of an
2229 This allows users to ask for example that the string form of an
2217 object is only computed when foo?? is called, or even never, by
2230 object is only computed when foo?? is called, or even never, by
2218 setting the object_info_string_level >= 2 in the configuration
2231 setting the object_info_string_level >= 2 in the configuration
2219 file. This new option has been added and documented. After a
2232 file. This new option has been added and documented. After a
2220 request by SAGE to be able to control the printing of very large
2233 request by SAGE to be able to control the printing of very large
2221 objects more easily.
2234 objects more easily.
2222
2235
2223 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
2236 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
2224
2237
2225 * IPython/ipmaker.py (make_IPython): remove the ipython call path
2238 * IPython/ipmaker.py (make_IPython): remove the ipython call path
2226 from sys.argv, to be 100% consistent with how Python itself works
2239 from sys.argv, to be 100% consistent with how Python itself works
2227 (as seen for example with python -i file.py). After a bug report
2240 (as seen for example with python -i file.py). After a bug report
2228 by Jeffrey Collins.
2241 by Jeffrey Collins.
2229
2242
2230 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
2243 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
2231 nasty bug which was preventing custom namespaces with -pylab,
2244 nasty bug which was preventing custom namespaces with -pylab,
2232 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
2245 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
2233 compatibility (long gone from mpl).
2246 compatibility (long gone from mpl).
2234
2247
2235 * IPython/ipapi.py (make_session): name change: create->make. We
2248 * IPython/ipapi.py (make_session): name change: create->make. We
2236 use make in other places (ipmaker,...), it's shorter and easier to
2249 use make in other places (ipmaker,...), it's shorter and easier to
2237 type and say, etc. I'm trying to clean things before 0.7.2 so
2250 type and say, etc. I'm trying to clean things before 0.7.2 so
2238 that I can keep things stable wrt to ipapi in the chainsaw branch.
2251 that I can keep things stable wrt to ipapi in the chainsaw branch.
2239
2252
2240 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
2253 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
2241 python-mode recognizes our debugger mode. Add support for
2254 python-mode recognizes our debugger mode. Add support for
2242 autoindent inside (X)emacs. After a patch sent in by Jin Liu
2255 autoindent inside (X)emacs. After a patch sent in by Jin Liu
2243 <m.liu.jin-AT-gmail.com> originally written by
2256 <m.liu.jin-AT-gmail.com> originally written by
2244 doxgen-AT-newsmth.net (with minor modifications for xemacs
2257 doxgen-AT-newsmth.net (with minor modifications for xemacs
2245 compatibility)
2258 compatibility)
2246
2259
2247 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
2260 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
2248 tracebacks when walking the stack so that the stack tracking system
2261 tracebacks when walking the stack so that the stack tracking system
2249 in emacs' python-mode can identify the frames correctly.
2262 in emacs' python-mode can identify the frames correctly.
2250
2263
2251 * IPython/ipmaker.py (make_IPython): make the internal (and
2264 * IPython/ipmaker.py (make_IPython): make the internal (and
2252 default config) autoedit_syntax value false by default. Too many
2265 default config) autoedit_syntax value false by default. Too many
2253 users have complained to me (both on and off-list) about problems
2266 users have complained to me (both on and off-list) about problems
2254 with this option being on by default, so I'm making it default to
2267 with this option being on by default, so I'm making it default to
2255 off. It can still be enabled by anyone via the usual mechanisms.
2268 off. It can still be enabled by anyone via the usual mechanisms.
2256
2269
2257 * IPython/completer.py (Completer.attr_matches): add support for
2270 * IPython/completer.py (Completer.attr_matches): add support for
2258 PyCrust-style _getAttributeNames magic method. Patch contributed
2271 PyCrust-style _getAttributeNames magic method. Patch contributed
2259 by <mscott-AT-goldenspud.com>. Closes #50.
2272 by <mscott-AT-goldenspud.com>. Closes #50.
2260
2273
2261 * IPython/iplib.py (InteractiveShell.__init__): remove the
2274 * IPython/iplib.py (InteractiveShell.__init__): remove the
2262 deletion of exit/quit from __builtin__, which can break
2275 deletion of exit/quit from __builtin__, which can break
2263 third-party tools like the Zope debugging console. The
2276 third-party tools like the Zope debugging console. The
2264 %exit/%quit magics remain. In general, it's probably a good idea
2277 %exit/%quit magics remain. In general, it's probably a good idea
2265 not to delete anything from __builtin__, since we never know what
2278 not to delete anything from __builtin__, since we never know what
2266 that will break. In any case, python now (for 2.5) will support
2279 that will break. In any case, python now (for 2.5) will support
2267 'real' exit/quit, so this issue is moot. Closes #55.
2280 'real' exit/quit, so this issue is moot. Closes #55.
2268
2281
2269 * IPython/genutils.py (with_obj): rename the 'with' function to
2282 * IPython/genutils.py (with_obj): rename the 'with' function to
2270 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
2283 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
2271 becomes a language keyword. Closes #53.
2284 becomes a language keyword. Closes #53.
2272
2285
2273 * IPython/FakeModule.py (FakeModule.__init__): add a proper
2286 * IPython/FakeModule.py (FakeModule.__init__): add a proper
2274 __file__ attribute to this so it fools more things into thinking
2287 __file__ attribute to this so it fools more things into thinking
2275 it is a real module. Closes #59.
2288 it is a real module. Closes #59.
2276
2289
2277 * IPython/Magic.py (magic_edit): add -n option to open the editor
2290 * IPython/Magic.py (magic_edit): add -n option to open the editor
2278 at a specific line number. After a patch by Stefan van der Walt.
2291 at a specific line number. After a patch by Stefan van der Walt.
2279
2292
2280 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
2293 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
2281
2294
2282 * IPython/iplib.py (edit_syntax_error): fix crash when for some
2295 * IPython/iplib.py (edit_syntax_error): fix crash when for some
2283 reason the file could not be opened. After automatic crash
2296 reason the file could not be opened. After automatic crash
2284 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
2297 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
2285 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
2298 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
2286 (_should_recompile): Don't fire editor if using %bg, since there
2299 (_should_recompile): Don't fire editor if using %bg, since there
2287 is no file in the first place. From the same report as above.
2300 is no file in the first place. From the same report as above.
2288 (raw_input): protect against faulty third-party prefilters. After
2301 (raw_input): protect against faulty third-party prefilters. After
2289 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
2302 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
2290 while running under SAGE.
2303 while running under SAGE.
2291
2304
2292 2006-05-23 Ville Vainio <vivainio@gmail.com>
2305 2006-05-23 Ville Vainio <vivainio@gmail.com>
2293
2306
2294 * ipapi.py: Stripped down ip.to_user_ns() to work only as
2307 * ipapi.py: Stripped down ip.to_user_ns() to work only as
2295 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
2308 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
2296 now returns None (again), unless dummy is specifically allowed by
2309 now returns None (again), unless dummy is specifically allowed by
2297 ipapi.get(allow_dummy=True).
2310 ipapi.get(allow_dummy=True).
2298
2311
2299 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
2312 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
2300
2313
2301 * IPython: remove all 2.2-compatibility objects and hacks from
2314 * IPython: remove all 2.2-compatibility objects and hacks from
2302 everywhere, since we only support 2.3 at this point. Docs
2315 everywhere, since we only support 2.3 at this point. Docs
2303 updated.
2316 updated.
2304
2317
2305 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
2318 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
2306 Anything requiring extra validation can be turned into a Python
2319 Anything requiring extra validation can be turned into a Python
2307 property in the future. I used a property for the db one b/c
2320 property in the future. I used a property for the db one b/c
2308 there was a nasty circularity problem with the initialization
2321 there was a nasty circularity problem with the initialization
2309 order, which right now I don't have time to clean up.
2322 order, which right now I don't have time to clean up.
2310
2323
2311 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
2324 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
2312 another locking bug reported by Jorgen. I'm not 100% sure though,
2325 another locking bug reported by Jorgen. I'm not 100% sure though,
2313 so more testing is needed...
2326 so more testing is needed...
2314
2327
2315 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
2328 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
2316
2329
2317 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
2330 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
2318 local variables from any routine in user code (typically executed
2331 local variables from any routine in user code (typically executed
2319 with %run) directly into the interactive namespace. Very useful
2332 with %run) directly into the interactive namespace. Very useful
2320 when doing complex debugging.
2333 when doing complex debugging.
2321 (IPythonNotRunning): Changed the default None object to a dummy
2334 (IPythonNotRunning): Changed the default None object to a dummy
2322 whose attributes can be queried as well as called without
2335 whose attributes can be queried as well as called without
2323 exploding, to ease writing code which works transparently both in
2336 exploding, to ease writing code which works transparently both in
2324 and out of ipython and uses some of this API.
2337 and out of ipython and uses some of this API.
2325
2338
2326 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
2339 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
2327
2340
2328 * IPython/hooks.py (result_display): Fix the fact that our display
2341 * IPython/hooks.py (result_display): Fix the fact that our display
2329 hook was using str() instead of repr(), as the default python
2342 hook was using str() instead of repr(), as the default python
2330 console does. This had gone unnoticed b/c it only happened if
2343 console does. This had gone unnoticed b/c it only happened if
2331 %Pprint was off, but the inconsistency was there.
2344 %Pprint was off, but the inconsistency was there.
2332
2345
2333 2006-05-15 Ville Vainio <vivainio@gmail.com>
2346 2006-05-15 Ville Vainio <vivainio@gmail.com>
2334
2347
2335 * Oinspect.py: Only show docstring for nonexisting/binary files
2348 * Oinspect.py: Only show docstring for nonexisting/binary files
2336 when doing object??, closing ticket #62
2349 when doing object??, closing ticket #62
2337
2350
2338 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
2351 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
2339
2352
2340 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
2353 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
2341 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
2354 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
2342 was being released in a routine which hadn't checked if it had
2355 was being released in a routine which hadn't checked if it had
2343 been the one to acquire it.
2356 been the one to acquire it.
2344
2357
2345 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
2358 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
2346
2359
2347 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
2360 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
2348
2361
2349 2006-04-11 Ville Vainio <vivainio@gmail.com>
2362 2006-04-11 Ville Vainio <vivainio@gmail.com>
2350
2363
2351 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
2364 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
2352 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
2365 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
2353 prefilters, allowing stuff like magics and aliases in the file.
2366 prefilters, allowing stuff like magics and aliases in the file.
2354
2367
2355 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
2368 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
2356 added. Supported now are "%clear in" and "%clear out" (clear input and
2369 added. Supported now are "%clear in" and "%clear out" (clear input and
2357 output history, respectively). Also fixed CachedOutput.flush to
2370 output history, respectively). Also fixed CachedOutput.flush to
2358 properly flush the output cache.
2371 properly flush the output cache.
2359
2372
2360 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
2373 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
2361 half-success (and fail explicitly).
2374 half-success (and fail explicitly).
2362
2375
2363 2006-03-28 Ville Vainio <vivainio@gmail.com>
2376 2006-03-28 Ville Vainio <vivainio@gmail.com>
2364
2377
2365 * iplib.py: Fix quoting of aliases so that only argless ones
2378 * iplib.py: Fix quoting of aliases so that only argless ones
2366 are quoted
2379 are quoted
2367
2380
2368 2006-03-28 Ville Vainio <vivainio@gmail.com>
2381 2006-03-28 Ville Vainio <vivainio@gmail.com>
2369
2382
2370 * iplib.py: Quote aliases with spaces in the name.
2383 * iplib.py: Quote aliases with spaces in the name.
2371 "c:\program files\blah\bin" is now legal alias target.
2384 "c:\program files\blah\bin" is now legal alias target.
2372
2385
2373 * ext_rehashdir.py: Space no longer allowed as arg
2386 * ext_rehashdir.py: Space no longer allowed as arg
2374 separator, since space is legal in path names.
2387 separator, since space is legal in path names.
2375
2388
2376 2006-03-16 Ville Vainio <vivainio@gmail.com>
2389 2006-03-16 Ville Vainio <vivainio@gmail.com>
2377
2390
2378 * upgrade_dir.py: Take path.py from Extensions, correcting
2391 * upgrade_dir.py: Take path.py from Extensions, correcting
2379 %upgrade magic
2392 %upgrade magic
2380
2393
2381 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
2394 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
2382
2395
2383 * hooks.py: Only enclose editor binary in quotes if legal and
2396 * hooks.py: Only enclose editor binary in quotes if legal and
2384 necessary (space in the name, and is an existing file). Fixes a bug
2397 necessary (space in the name, and is an existing file). Fixes a bug
2385 reported by Zachary Pincus.
2398 reported by Zachary Pincus.
2386
2399
2387 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
2400 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
2388
2401
2389 * Manual: thanks to a tip on proper color handling for Emacs, by
2402 * Manual: thanks to a tip on proper color handling for Emacs, by
2390 Eric J Haywiser <ejh1-AT-MIT.EDU>.
2403 Eric J Haywiser <ejh1-AT-MIT.EDU>.
2391
2404
2392 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
2405 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
2393 by applying the provided patch. Thanks to Liu Jin
2406 by applying the provided patch. Thanks to Liu Jin
2394 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
2407 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
2395 XEmacs/Linux, I'm trusting the submitter that it actually helps
2408 XEmacs/Linux, I'm trusting the submitter that it actually helps
2396 under win32/GNU Emacs. Will revisit if any problems are reported.
2409 under win32/GNU Emacs. Will revisit if any problems are reported.
2397
2410
2398 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2411 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2399
2412
2400 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
2413 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
2401 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
2414 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
2402
2415
2403 2006-03-12 Ville Vainio <vivainio@gmail.com>
2416 2006-03-12 Ville Vainio <vivainio@gmail.com>
2404
2417
2405 * Magic.py (magic_timeit): Added %timeit magic, contributed by
2418 * Magic.py (magic_timeit): Added %timeit magic, contributed by
2406 Torsten Marek.
2419 Torsten Marek.
2407
2420
2408 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2421 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2409
2422
2410 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
2423 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
2411 line ranges works again.
2424 line ranges works again.
2412
2425
2413 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
2426 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
2414
2427
2415 * IPython/iplib.py (showtraceback): add back sys.last_traceback
2428 * IPython/iplib.py (showtraceback): add back sys.last_traceback
2416 and friends, after a discussion with Zach Pincus on ipython-user.
2429 and friends, after a discussion with Zach Pincus on ipython-user.
2417 I'm not 100% sure, but after thinking about it quite a bit, it may
2430 I'm not 100% sure, but after thinking about it quite a bit, it may
2418 be OK. Testing with the multithreaded shells didn't reveal any
2431 be OK. Testing with the multithreaded shells didn't reveal any
2419 problems, but let's keep an eye out.
2432 problems, but let's keep an eye out.
2420
2433
2421 In the process, I fixed a few things which were calling
2434 In the process, I fixed a few things which were calling
2422 self.InteractiveTB() directly (like safe_execfile), which is a
2435 self.InteractiveTB() directly (like safe_execfile), which is a
2423 mistake: ALL exception reporting should be done by calling
2436 mistake: ALL exception reporting should be done by calling
2424 self.showtraceback(), which handles state and tab-completion and
2437 self.showtraceback(), which handles state and tab-completion and
2425 more.
2438 more.
2426
2439
2427 2006-03-01 Ville Vainio <vivainio@gmail.com>
2440 2006-03-01 Ville Vainio <vivainio@gmail.com>
2428
2441
2429 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
2442 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
2430 To use, do "from ipipe import *".
2443 To use, do "from ipipe import *".
2431
2444
2432 2006-02-24 Ville Vainio <vivainio@gmail.com>
2445 2006-02-24 Ville Vainio <vivainio@gmail.com>
2433
2446
2434 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
2447 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
2435 "cleanly" and safely than the older upgrade mechanism.
2448 "cleanly" and safely than the older upgrade mechanism.
2436
2449
2437 2006-02-21 Ville Vainio <vivainio@gmail.com>
2450 2006-02-21 Ville Vainio <vivainio@gmail.com>
2438
2451
2439 * Magic.py: %save works again.
2452 * Magic.py: %save works again.
2440
2453
2441 2006-02-15 Ville Vainio <vivainio@gmail.com>
2454 2006-02-15 Ville Vainio <vivainio@gmail.com>
2442
2455
2443 * Magic.py: %Pprint works again
2456 * Magic.py: %Pprint works again
2444
2457
2445 * Extensions/ipy_sane_defaults.py: Provide everything provided
2458 * Extensions/ipy_sane_defaults.py: Provide everything provided
2446 in default ipythonrc, to make it possible to have a completely empty
2459 in default ipythonrc, to make it possible to have a completely empty
2447 ipythonrc (and thus completely rc-file free configuration)
2460 ipythonrc (and thus completely rc-file free configuration)
2448
2461
2449 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
2462 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
2450
2463
2451 * IPython/hooks.py (editor): quote the call to the editor command,
2464 * IPython/hooks.py (editor): quote the call to the editor command,
2452 to allow commands with spaces in them. Problem noted by watching
2465 to allow commands with spaces in them. Problem noted by watching
2453 Ian Oswald's video about textpad under win32 at
2466 Ian Oswald's video about textpad under win32 at
2454 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
2467 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
2455
2468
2456 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
2469 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
2457 describing magics (we haven't used @ for a loong time).
2470 describing magics (we haven't used @ for a loong time).
2458
2471
2459 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
2472 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
2460 contributed by marienz to close
2473 contributed by marienz to close
2461 http://www.scipy.net/roundup/ipython/issue53.
2474 http://www.scipy.net/roundup/ipython/issue53.
2462
2475
2463 2006-02-10 Ville Vainio <vivainio@gmail.com>
2476 2006-02-10 Ville Vainio <vivainio@gmail.com>
2464
2477
2465 * genutils.py: getoutput now works in win32 too
2478 * genutils.py: getoutput now works in win32 too
2466
2479
2467 * completer.py: alias and magic completion only invoked
2480 * completer.py: alias and magic completion only invoked
2468 at the first "item" in the line, to avoid "cd %store"
2481 at the first "item" in the line, to avoid "cd %store"
2469 nonsense.
2482 nonsense.
2470
2483
2471 2006-02-09 Ville Vainio <vivainio@gmail.com>
2484 2006-02-09 Ville Vainio <vivainio@gmail.com>
2472
2485
2473 * test/*: Added a unit testing framework (finally).
2486 * test/*: Added a unit testing framework (finally).
2474 '%run runtests.py' to run test_*.
2487 '%run runtests.py' to run test_*.
2475
2488
2476 * ipapi.py: Exposed runlines and set_custom_exc
2489 * ipapi.py: Exposed runlines and set_custom_exc
2477
2490
2478 2006-02-07 Ville Vainio <vivainio@gmail.com>
2491 2006-02-07 Ville Vainio <vivainio@gmail.com>
2479
2492
2480 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2493 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
2481 instead use "f(1 2)" as before.
2494 instead use "f(1 2)" as before.
2482
2495
2483 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2496 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
2484
2497
2485 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2498 * IPython/demo.py (IPythonDemo): Add new classes to the demo
2486 facilities, for demos processed by the IPython input filter
2499 facilities, for demos processed by the IPython input filter
2487 (IPythonDemo), and for running a script one-line-at-a-time as a
2500 (IPythonDemo), and for running a script one-line-at-a-time as a
2488 demo, both for pure Python (LineDemo) and for IPython-processed
2501 demo, both for pure Python (LineDemo) and for IPython-processed
2489 input (IPythonLineDemo). After a request by Dave Kohel, from the
2502 input (IPythonLineDemo). After a request by Dave Kohel, from the
2490 SAGE team.
2503 SAGE team.
2491 (Demo.edit): added an edit() method to the demo objects, to edit
2504 (Demo.edit): added an edit() method to the demo objects, to edit
2492 the in-memory copy of the last executed block.
2505 the in-memory copy of the last executed block.
2493
2506
2494 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2507 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
2495 processing to %edit, %macro and %save. These commands can now be
2508 processing to %edit, %macro and %save. These commands can now be
2496 invoked on the unprocessed input as it was typed by the user
2509 invoked on the unprocessed input as it was typed by the user
2497 (without any prefilters applied). After requests by the SAGE team
2510 (without any prefilters applied). After requests by the SAGE team
2498 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2511 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
2499
2512
2500 2006-02-01 Ville Vainio <vivainio@gmail.com>
2513 2006-02-01 Ville Vainio <vivainio@gmail.com>
2501
2514
2502 * setup.py, eggsetup.py: easy_install ipython==dev works
2515 * setup.py, eggsetup.py: easy_install ipython==dev works
2503 correctly now (on Linux)
2516 correctly now (on Linux)
2504
2517
2505 * ipy_user_conf,ipmaker: user config changes, removed spurious
2518 * ipy_user_conf,ipmaker: user config changes, removed spurious
2506 warnings
2519 warnings
2507
2520
2508 * iplib: if rc.banner is string, use it as is.
2521 * iplib: if rc.banner is string, use it as is.
2509
2522
2510 * Magic: %pycat accepts a string argument and pages it's contents.
2523 * Magic: %pycat accepts a string argument and pages it's contents.
2511
2524
2512
2525
2513 2006-01-30 Ville Vainio <vivainio@gmail.com>
2526 2006-01-30 Ville Vainio <vivainio@gmail.com>
2514
2527
2515 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2528 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
2516 Now %store and bookmarks work through PickleShare, meaning that
2529 Now %store and bookmarks work through PickleShare, meaning that
2517 concurrent access is possible and all ipython sessions see the
2530 concurrent access is possible and all ipython sessions see the
2518 same database situation all the time, instead of snapshot of
2531 same database situation all the time, instead of snapshot of
2519 the situation when the session was started. Hence, %bookmark
2532 the situation when the session was started. Hence, %bookmark
2520 results are immediately accessible from othes sessions. The database
2533 results are immediately accessible from othes sessions. The database
2521 is also available for use by user extensions. See:
2534 is also available for use by user extensions. See:
2522 http://www.python.org/pypi/pickleshare
2535 http://www.python.org/pypi/pickleshare
2523
2536
2524 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2537 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
2525
2538
2526 * aliases can now be %store'd
2539 * aliases can now be %store'd
2527
2540
2528 * path.py moved to Extensions so that pickleshare does not need
2541 * path.py moved to Extensions so that pickleshare does not need
2529 IPython-specific import. Extensions added to pythonpath right
2542 IPython-specific import. Extensions added to pythonpath right
2530 at __init__.
2543 at __init__.
2531
2544
2532 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2545 * iplib.py: ipalias deprecated/redundant; aliases are converted and
2533 called with _ip.system and the pre-transformed command string.
2546 called with _ip.system and the pre-transformed command string.
2534
2547
2535 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2548 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
2536
2549
2537 * IPython/iplib.py (interact): Fix that we were not catching
2550 * IPython/iplib.py (interact): Fix that we were not catching
2538 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2551 KeyboardInterrupt exceptions properly. I'm not quite sure why the
2539 logic here had to change, but it's fixed now.
2552 logic here had to change, but it's fixed now.
2540
2553
2541 2006-01-29 Ville Vainio <vivainio@gmail.com>
2554 2006-01-29 Ville Vainio <vivainio@gmail.com>
2542
2555
2543 * iplib.py: Try to import pyreadline on Windows.
2556 * iplib.py: Try to import pyreadline on Windows.
2544
2557
2545 2006-01-27 Ville Vainio <vivainio@gmail.com>
2558 2006-01-27 Ville Vainio <vivainio@gmail.com>
2546
2559
2547 * iplib.py: Expose ipapi as _ip in builtin namespace.
2560 * iplib.py: Expose ipapi as _ip in builtin namespace.
2548 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2561 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
2549 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2562 and ip_set_hook (-> _ip.set_hook) redundant. % and !
2550 syntax now produce _ip.* variant of the commands.
2563 syntax now produce _ip.* variant of the commands.
2551
2564
2552 * "_ip.options().autoedit_syntax = 2" automatically throws
2565 * "_ip.options().autoedit_syntax = 2" automatically throws
2553 user to editor for syntax error correction without prompting.
2566 user to editor for syntax error correction without prompting.
2554
2567
2555 2006-01-27 Ville Vainio <vivainio@gmail.com>
2568 2006-01-27 Ville Vainio <vivainio@gmail.com>
2556
2569
2557 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2570 * ipmaker.py: Give "realistic" sys.argv for scripts (without
2558 'ipython' at argv[0]) executed through command line.
2571 'ipython' at argv[0]) executed through command line.
2559 NOTE: this DEPRECATES calling ipython with multiple scripts
2572 NOTE: this DEPRECATES calling ipython with multiple scripts
2560 ("ipython a.py b.py c.py")
2573 ("ipython a.py b.py c.py")
2561
2574
2562 * iplib.py, hooks.py: Added configurable input prefilter,
2575 * iplib.py, hooks.py: Added configurable input prefilter,
2563 named 'input_prefilter'. See ext_rescapture.py for example
2576 named 'input_prefilter'. See ext_rescapture.py for example
2564 usage.
2577 usage.
2565
2578
2566 * ext_rescapture.py, Magic.py: Better system command output capture
2579 * ext_rescapture.py, Magic.py: Better system command output capture
2567 through 'var = !ls' (deprecates user-visible %sc). Same notation
2580 through 'var = !ls' (deprecates user-visible %sc). Same notation
2568 applies for magics, 'var = %alias' assigns alias list to var.
2581 applies for magics, 'var = %alias' assigns alias list to var.
2569
2582
2570 * ipapi.py: added meta() for accessing extension-usable data store.
2583 * ipapi.py: added meta() for accessing extension-usable data store.
2571
2584
2572 * iplib.py: added InteractiveShell.getapi(). New magics should be
2585 * iplib.py: added InteractiveShell.getapi(). New magics should be
2573 written doing self.getapi() instead of using the shell directly.
2586 written doing self.getapi() instead of using the shell directly.
2574
2587
2575 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2588 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
2576 %store foo >> ~/myfoo.txt to store variables to files (in clean
2589 %store foo >> ~/myfoo.txt to store variables to files (in clean
2577 textual form, not a restorable pickle).
2590 textual form, not a restorable pickle).
2578
2591
2579 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2592 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
2580
2593
2581 * usage.py, Magic.py: added %quickref
2594 * usage.py, Magic.py: added %quickref
2582
2595
2583 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2596 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
2584
2597
2585 * GetoptErrors when invoking magics etc. with wrong args
2598 * GetoptErrors when invoking magics etc. with wrong args
2586 are now more helpful:
2599 are now more helpful:
2587 GetoptError: option -l not recognized (allowed: "qb" )
2600 GetoptError: option -l not recognized (allowed: "qb" )
2588
2601
2589 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2602 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
2590
2603
2591 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2604 * IPython/demo.py (Demo.show): Flush stdout after each block, so
2592 computationally intensive blocks don't appear to stall the demo.
2605 computationally intensive blocks don't appear to stall the demo.
2593
2606
2594 2006-01-24 Ville Vainio <vivainio@gmail.com>
2607 2006-01-24 Ville Vainio <vivainio@gmail.com>
2595
2608
2596 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2609 * iplib.py, hooks.py: 'result_display' hook can return a non-None
2597 value to manipulate resulting history entry.
2610 value to manipulate resulting history entry.
2598
2611
2599 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2612 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
2600 to instance methods of IPApi class, to make extending an embedded
2613 to instance methods of IPApi class, to make extending an embedded
2601 IPython feasible. See ext_rehashdir.py for example usage.
2614 IPython feasible. See ext_rehashdir.py for example usage.
2602
2615
2603 * Merged 1071-1076 from branches/0.7.1
2616 * Merged 1071-1076 from branches/0.7.1
2604
2617
2605
2618
2606 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2619 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
2607
2620
2608 * tools/release (daystamp): Fix build tools to use the new
2621 * tools/release (daystamp): Fix build tools to use the new
2609 eggsetup.py script to build lightweight eggs.
2622 eggsetup.py script to build lightweight eggs.
2610
2623
2611 * Applied changesets 1062 and 1064 before 0.7.1 release.
2624 * Applied changesets 1062 and 1064 before 0.7.1 release.
2612
2625
2613 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2626 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
2614 see the raw input history (without conversions like %ls ->
2627 see the raw input history (without conversions like %ls ->
2615 ipmagic("ls")). After a request from W. Stein, SAGE
2628 ipmagic("ls")). After a request from W. Stein, SAGE
2616 (http://modular.ucsd.edu/sage) developer. This information is
2629 (http://modular.ucsd.edu/sage) developer. This information is
2617 stored in the input_hist_raw attribute of the IPython instance, so
2630 stored in the input_hist_raw attribute of the IPython instance, so
2618 developers can access it if needed (it's an InputList instance).
2631 developers can access it if needed (it's an InputList instance).
2619
2632
2620 * Versionstring = 0.7.2.svn
2633 * Versionstring = 0.7.2.svn
2621
2634
2622 * eggsetup.py: A separate script for constructing eggs, creates
2635 * eggsetup.py: A separate script for constructing eggs, creates
2623 proper launch scripts even on Windows (an .exe file in
2636 proper launch scripts even on Windows (an .exe file in
2624 \python24\scripts).
2637 \python24\scripts).
2625
2638
2626 * ipapi.py: launch_new_instance, launch entry point needed for the
2639 * ipapi.py: launch_new_instance, launch entry point needed for the
2627 egg.
2640 egg.
2628
2641
2629 2006-01-23 Ville Vainio <vivainio@gmail.com>
2642 2006-01-23 Ville Vainio <vivainio@gmail.com>
2630
2643
2631 * Added %cpaste magic for pasting python code
2644 * Added %cpaste magic for pasting python code
2632
2645
2633 2006-01-22 Ville Vainio <vivainio@gmail.com>
2646 2006-01-22 Ville Vainio <vivainio@gmail.com>
2634
2647
2635 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2648 * Merge from branches/0.7.1 into trunk, revs 1052-1057
2636
2649
2637 * Versionstring = 0.7.2.svn
2650 * Versionstring = 0.7.2.svn
2638
2651
2639 * eggsetup.py: A separate script for constructing eggs, creates
2652 * eggsetup.py: A separate script for constructing eggs, creates
2640 proper launch scripts even on Windows (an .exe file in
2653 proper launch scripts even on Windows (an .exe file in
2641 \python24\scripts).
2654 \python24\scripts).
2642
2655
2643 * ipapi.py: launch_new_instance, launch entry point needed for the
2656 * ipapi.py: launch_new_instance, launch entry point needed for the
2644 egg.
2657 egg.
2645
2658
2646 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2659 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
2647
2660
2648 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2661 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
2649 %pfile foo would print the file for foo even if it was a binary.
2662 %pfile foo would print the file for foo even if it was a binary.
2650 Now, extensions '.so' and '.dll' are skipped.
2663 Now, extensions '.so' and '.dll' are skipped.
2651
2664
2652 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2665 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
2653 bug, where macros would fail in all threaded modes. I'm not 100%
2666 bug, where macros would fail in all threaded modes. I'm not 100%
2654 sure, so I'm going to put out an rc instead of making a release
2667 sure, so I'm going to put out an rc instead of making a release
2655 today, and wait for feedback for at least a few days.
2668 today, and wait for feedback for at least a few days.
2656
2669
2657 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2670 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
2658 it...) the handling of pasting external code with autoindent on.
2671 it...) the handling of pasting external code with autoindent on.
2659 To get out of a multiline input, the rule will appear for most
2672 To get out of a multiline input, the rule will appear for most
2660 users unchanged: two blank lines or change the indent level
2673 users unchanged: two blank lines or change the indent level
2661 proposed by IPython. But there is a twist now: you can
2674 proposed by IPython. But there is a twist now: you can
2662 add/subtract only *one or two spaces*. If you add/subtract three
2675 add/subtract only *one or two spaces*. If you add/subtract three
2663 or more (unless you completely delete the line), IPython will
2676 or more (unless you completely delete the line), IPython will
2664 accept that line, and you'll need to enter a second one of pure
2677 accept that line, and you'll need to enter a second one of pure
2665 whitespace. I know it sounds complicated, but I can't find a
2678 whitespace. I know it sounds complicated, but I can't find a
2666 different solution that covers all the cases, with the right
2679 different solution that covers all the cases, with the right
2667 heuristics. Hopefully in actual use, nobody will really notice
2680 heuristics. Hopefully in actual use, nobody will really notice
2668 all these strange rules and things will 'just work'.
2681 all these strange rules and things will 'just work'.
2669
2682
2670 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2683 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
2671
2684
2672 * IPython/iplib.py (interact): catch exceptions which can be
2685 * IPython/iplib.py (interact): catch exceptions which can be
2673 triggered asynchronously by signal handlers. Thanks to an
2686 triggered asynchronously by signal handlers. Thanks to an
2674 automatic crash report, submitted by Colin Kingsley
2687 automatic crash report, submitted by Colin Kingsley
2675 <tercel-AT-gentoo.org>.
2688 <tercel-AT-gentoo.org>.
2676
2689
2677 2006-01-20 Ville Vainio <vivainio@gmail.com>
2690 2006-01-20 Ville Vainio <vivainio@gmail.com>
2678
2691
2679 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2692 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
2680 (%rehashdir, very useful, try it out) of how to extend ipython
2693 (%rehashdir, very useful, try it out) of how to extend ipython
2681 with new magics. Also added Extensions dir to pythonpath to make
2694 with new magics. Also added Extensions dir to pythonpath to make
2682 importing extensions easy.
2695 importing extensions easy.
2683
2696
2684 * %store now complains when trying to store interactively declared
2697 * %store now complains when trying to store interactively declared
2685 classes / instances of those classes.
2698 classes / instances of those classes.
2686
2699
2687 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2700 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
2688 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2701 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
2689 if they exist, and ipy_user_conf.py with some defaults is created for
2702 if they exist, and ipy_user_conf.py with some defaults is created for
2690 the user.
2703 the user.
2691
2704
2692 * Startup rehashing done by the config file, not InterpreterExec.
2705 * Startup rehashing done by the config file, not InterpreterExec.
2693 This means system commands are available even without selecting the
2706 This means system commands are available even without selecting the
2694 pysh profile. It's the sensible default after all.
2707 pysh profile. It's the sensible default after all.
2695
2708
2696 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2709 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
2697
2710
2698 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2711 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
2699 multiline code with autoindent on working. But I am really not
2712 multiline code with autoindent on working. But I am really not
2700 sure, so this needs more testing. Will commit a debug-enabled
2713 sure, so this needs more testing. Will commit a debug-enabled
2701 version for now, while I test it some more, so that Ville and
2714 version for now, while I test it some more, so that Ville and
2702 others may also catch any problems. Also made
2715 others may also catch any problems. Also made
2703 self.indent_current_str() a method, to ensure that there's no
2716 self.indent_current_str() a method, to ensure that there's no
2704 chance of the indent space count and the corresponding string
2717 chance of the indent space count and the corresponding string
2705 falling out of sync. All code needing the string should just call
2718 falling out of sync. All code needing the string should just call
2706 the method.
2719 the method.
2707
2720
2708 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2721 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
2709
2722
2710 * IPython/Magic.py (magic_edit): fix check for when users don't
2723 * IPython/Magic.py (magic_edit): fix check for when users don't
2711 save their output files, the try/except was in the wrong section.
2724 save their output files, the try/except was in the wrong section.
2712
2725
2713 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2726 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2714
2727
2715 * IPython/Magic.py (magic_run): fix __file__ global missing from
2728 * IPython/Magic.py (magic_run): fix __file__ global missing from
2716 script's namespace when executed via %run. After a report by
2729 script's namespace when executed via %run. After a report by
2717 Vivian.
2730 Vivian.
2718
2731
2719 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2732 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
2720 when using python 2.4. The parent constructor changed in 2.4, and
2733 when using python 2.4. The parent constructor changed in 2.4, and
2721 we need to track it directly (we can't call it, as it messes up
2734 we need to track it directly (we can't call it, as it messes up
2722 readline and tab-completion inside our pdb would stop working).
2735 readline and tab-completion inside our pdb would stop working).
2723 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2736 After a bug report by R. Bernstein <rocky-AT-panix.com>.
2724
2737
2725 2006-01-16 Ville Vainio <vivainio@gmail.com>
2738 2006-01-16 Ville Vainio <vivainio@gmail.com>
2726
2739
2727 * Ipython/magic.py: Reverted back to old %edit functionality
2740 * Ipython/magic.py: Reverted back to old %edit functionality
2728 that returns file contents on exit.
2741 that returns file contents on exit.
2729
2742
2730 * IPython/path.py: Added Jason Orendorff's "path" module to
2743 * IPython/path.py: Added Jason Orendorff's "path" module to
2731 IPython tree, http://www.jorendorff.com/articles/python/path/.
2744 IPython tree, http://www.jorendorff.com/articles/python/path/.
2732 You can get path objects conveniently through %sc, and !!, e.g.:
2745 You can get path objects conveniently through %sc, and !!, e.g.:
2733 sc files=ls
2746 sc files=ls
2734 for p in files.paths: # or files.p
2747 for p in files.paths: # or files.p
2735 print p,p.mtime
2748 print p,p.mtime
2736
2749
2737 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2750 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
2738 now work again without considering the exclusion regexp -
2751 now work again without considering the exclusion regexp -
2739 hence, things like ',foo my/path' turn to 'foo("my/path")'
2752 hence, things like ',foo my/path' turn to 'foo("my/path")'
2740 instead of syntax error.
2753 instead of syntax error.
2741
2754
2742
2755
2743 2006-01-14 Ville Vainio <vivainio@gmail.com>
2756 2006-01-14 Ville Vainio <vivainio@gmail.com>
2744
2757
2745 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2758 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
2746 ipapi decorators for python 2.4 users, options() provides access to rc
2759 ipapi decorators for python 2.4 users, options() provides access to rc
2747 data.
2760 data.
2748
2761
2749 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2762 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
2750 as path separators (even on Linux ;-). Space character after
2763 as path separators (even on Linux ;-). Space character after
2751 backslash (as yielded by tab completer) is still space;
2764 backslash (as yielded by tab completer) is still space;
2752 "%cd long\ name" works as expected.
2765 "%cd long\ name" works as expected.
2753
2766
2754 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2767 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
2755 as "chain of command", with priority. API stays the same,
2768 as "chain of command", with priority. API stays the same,
2756 TryNext exception raised by a hook function signals that
2769 TryNext exception raised by a hook function signals that
2757 current hook failed and next hook should try handling it, as
2770 current hook failed and next hook should try handling it, as
2758 suggested by Walter Dörwald <walter@livinglogic.de>. Walter also
2771 suggested by Walter Dörwald <walter@livinglogic.de>. Walter also
2759 requested configurable display hook, which is now implemented.
2772 requested configurable display hook, which is now implemented.
2760
2773
2761 2006-01-13 Ville Vainio <vivainio@gmail.com>
2774 2006-01-13 Ville Vainio <vivainio@gmail.com>
2762
2775
2763 * IPython/platutils*.py: platform specific utility functions,
2776 * IPython/platutils*.py: platform specific utility functions,
2764 so far only set_term_title is implemented (change terminal
2777 so far only set_term_title is implemented (change terminal
2765 label in windowing systems). %cd now changes the title to
2778 label in windowing systems). %cd now changes the title to
2766 current dir.
2779 current dir.
2767
2780
2768 * IPython/Release.py: Added myself to "authors" list,
2781 * IPython/Release.py: Added myself to "authors" list,
2769 had to create new files.
2782 had to create new files.
2770
2783
2771 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2784 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
2772 shell escape; not a known bug but had potential to be one in the
2785 shell escape; not a known bug but had potential to be one in the
2773 future.
2786 future.
2774
2787
2775 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2788 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
2776 extension API for IPython! See the module for usage example. Fix
2789 extension API for IPython! See the module for usage example. Fix
2777 OInspect for docstring-less magic functions.
2790 OInspect for docstring-less magic functions.
2778
2791
2779
2792
2780 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2793 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2781
2794
2782 * IPython/iplib.py (raw_input): temporarily deactivate all
2795 * IPython/iplib.py (raw_input): temporarily deactivate all
2783 attempts at allowing pasting of code with autoindent on. It
2796 attempts at allowing pasting of code with autoindent on. It
2784 introduced bugs (reported by Prabhu) and I can't seem to find a
2797 introduced bugs (reported by Prabhu) and I can't seem to find a
2785 robust combination which works in all cases. Will have to revisit
2798 robust combination which works in all cases. Will have to revisit
2786 later.
2799 later.
2787
2800
2788 * IPython/genutils.py: remove isspace() function. We've dropped
2801 * IPython/genutils.py: remove isspace() function. We've dropped
2789 2.2 compatibility, so it's OK to use the string method.
2802 2.2 compatibility, so it's OK to use the string method.
2790
2803
2791 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2804 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2792
2805
2793 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2806 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
2794 matching what NOT to autocall on, to include all python binary
2807 matching what NOT to autocall on, to include all python binary
2795 operators (including things like 'and', 'or', 'is' and 'in').
2808 operators (including things like 'and', 'or', 'is' and 'in').
2796 Prompted by a bug report on 'foo & bar', but I realized we had
2809 Prompted by a bug report on 'foo & bar', but I realized we had
2797 many more potential bug cases with other operators. The regexp is
2810 many more potential bug cases with other operators. The regexp is
2798 self.re_exclude_auto, it's fairly commented.
2811 self.re_exclude_auto, it's fairly commented.
2799
2812
2800 2006-01-12 Ville Vainio <vivainio@gmail.com>
2813 2006-01-12 Ville Vainio <vivainio@gmail.com>
2801
2814
2802 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2815 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
2803 Prettified and hardened string/backslash quoting with ipsystem(),
2816 Prettified and hardened string/backslash quoting with ipsystem(),
2804 ipalias() and ipmagic(). Now even \ characters are passed to
2817 ipalias() and ipmagic(). Now even \ characters are passed to
2805 %magics, !shell escapes and aliases exactly as they are in the
2818 %magics, !shell escapes and aliases exactly as they are in the
2806 ipython command line. Should improve backslash experience,
2819 ipython command line. Should improve backslash experience,
2807 particularly in Windows (path delimiter for some commands that
2820 particularly in Windows (path delimiter for some commands that
2808 won't understand '/'), but Unix benefits as well (regexps). %cd
2821 won't understand '/'), but Unix benefits as well (regexps). %cd
2809 magic still doesn't support backslash path delimiters, though. Also
2822 magic still doesn't support backslash path delimiters, though. Also
2810 deleted all pretense of supporting multiline command strings in
2823 deleted all pretense of supporting multiline command strings in
2811 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2824 !system or %magic commands. Thanks to Jerry McRae for suggestions.
2812
2825
2813 * doc/build_doc_instructions.txt added. Documentation on how to
2826 * doc/build_doc_instructions.txt added. Documentation on how to
2814 use doc/update_manual.py, added yesterday. Both files contributed
2827 use doc/update_manual.py, added yesterday. Both files contributed
2815 by Jörgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2828 by Jörgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
2816 doc/*.sh for deprecation at a later date.
2829 doc/*.sh for deprecation at a later date.
2817
2830
2818 * /ipython.py Added ipython.py to root directory for
2831 * /ipython.py Added ipython.py to root directory for
2819 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2832 zero-installation (tar xzvf ipython.tgz; cd ipython; python
2820 ipython.py) and development convenience (no need to keep doing
2833 ipython.py) and development convenience (no need to keep doing
2821 "setup.py install" between changes).
2834 "setup.py install" between changes).
2822
2835
2823 * Made ! and !! shell escapes work (again) in multiline expressions:
2836 * Made ! and !! shell escapes work (again) in multiline expressions:
2824 if 1:
2837 if 1:
2825 !ls
2838 !ls
2826 !!ls
2839 !!ls
2827
2840
2828 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2841 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
2829
2842
2830 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2843 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
2831 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2844 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
2832 module in case-insensitive installation. Was causing crashes
2845 module in case-insensitive installation. Was causing crashes
2833 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2846 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
2834
2847
2835 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2848 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
2836 <marienz-AT-gentoo.org>, closes
2849 <marienz-AT-gentoo.org>, closes
2837 http://www.scipy.net/roundup/ipython/issue51.
2850 http://www.scipy.net/roundup/ipython/issue51.
2838
2851
2839 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2852 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
2840
2853
2841 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2854 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
2842 problem of excessive CPU usage under *nix and keyboard lag under
2855 problem of excessive CPU usage under *nix and keyboard lag under
2843 win32.
2856 win32.
2844
2857
2845 2006-01-10 *** Released version 0.7.0
2858 2006-01-10 *** Released version 0.7.0
2846
2859
2847 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2860 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
2848
2861
2849 * IPython/Release.py (revision): tag version number to 0.7.0,
2862 * IPython/Release.py (revision): tag version number to 0.7.0,
2850 ready for release.
2863 ready for release.
2851
2864
2852 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2865 * IPython/Magic.py (magic_edit): Add print statement to %edit so
2853 it informs the user of the name of the temp. file used. This can
2866 it informs the user of the name of the temp. file used. This can
2854 help if you decide later to reuse that same file, so you know
2867 help if you decide later to reuse that same file, so you know
2855 where to copy the info from.
2868 where to copy the info from.
2856
2869
2857 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2870 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2858
2871
2859 * setup_bdist_egg.py: little script to build an egg. Added
2872 * setup_bdist_egg.py: little script to build an egg. Added
2860 support in the release tools as well.
2873 support in the release tools as well.
2861
2874
2862 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2875 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2863
2876
2864 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2877 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
2865 version selection (new -wxversion command line and ipythonrc
2878 version selection (new -wxversion command line and ipythonrc
2866 parameter). Patch contributed by Arnd Baecker
2879 parameter). Patch contributed by Arnd Baecker
2867 <arnd.baecker-AT-web.de>.
2880 <arnd.baecker-AT-web.de>.
2868
2881
2869 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2882 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2870 embedded instances, for variables defined at the interactive
2883 embedded instances, for variables defined at the interactive
2871 prompt of the embedded ipython. Reported by Arnd.
2884 prompt of the embedded ipython. Reported by Arnd.
2872
2885
2873 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2886 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
2874 it can be used as a (stateful) toggle, or with a direct parameter.
2887 it can be used as a (stateful) toggle, or with a direct parameter.
2875
2888
2876 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2889 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
2877 could be triggered in certain cases and cause the traceback
2890 could be triggered in certain cases and cause the traceback
2878 printer not to work.
2891 printer not to work.
2879
2892
2880 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2893 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
2881
2894
2882 * IPython/iplib.py (_should_recompile): Small fix, closes
2895 * IPython/iplib.py (_should_recompile): Small fix, closes
2883 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2896 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
2884
2897
2885 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2898 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
2886
2899
2887 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2900 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
2888 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2901 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
2889 Moad for help with tracking it down.
2902 Moad for help with tracking it down.
2890
2903
2891 * IPython/iplib.py (handle_auto): fix autocall handling for
2904 * IPython/iplib.py (handle_auto): fix autocall handling for
2892 objects which support BOTH __getitem__ and __call__ (so that f [x]
2905 objects which support BOTH __getitem__ and __call__ (so that f [x]
2893 is left alone, instead of becoming f([x]) automatically).
2906 is left alone, instead of becoming f([x]) automatically).
2894
2907
2895 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2908 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
2896 Ville's patch.
2909 Ville's patch.
2897
2910
2898 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2911 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
2899
2912
2900 * IPython/iplib.py (handle_auto): changed autocall semantics to
2913 * IPython/iplib.py (handle_auto): changed autocall semantics to
2901 include 'smart' mode, where the autocall transformation is NOT
2914 include 'smart' mode, where the autocall transformation is NOT
2902 applied if there are no arguments on the line. This allows you to
2915 applied if there are no arguments on the line. This allows you to
2903 just type 'foo' if foo is a callable to see its internal form,
2916 just type 'foo' if foo is a callable to see its internal form,
2904 instead of having it called with no arguments (typically a
2917 instead of having it called with no arguments (typically a
2905 mistake). The old 'full' autocall still exists: for that, you
2918 mistake). The old 'full' autocall still exists: for that, you
2906 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2919 need to set the 'autocall' parameter to 2 in your ipythonrc file.
2907
2920
2908 * IPython/completer.py (Completer.attr_matches): add
2921 * IPython/completer.py (Completer.attr_matches): add
2909 tab-completion support for Enthoughts' traits. After a report by
2922 tab-completion support for Enthoughts' traits. After a report by
2910 Arnd and a patch by Prabhu.
2923 Arnd and a patch by Prabhu.
2911
2924
2912 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2925 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
2913
2926
2914 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2927 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
2915 Schmolck's patch to fix inspect.getinnerframes().
2928 Schmolck's patch to fix inspect.getinnerframes().
2916
2929
2917 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2930 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
2918 for embedded instances, regarding handling of namespaces and items
2931 for embedded instances, regarding handling of namespaces and items
2919 added to the __builtin__ one. Multiple embedded instances and
2932 added to the __builtin__ one. Multiple embedded instances and
2920 recursive embeddings should work better now (though I'm not sure
2933 recursive embeddings should work better now (though I'm not sure
2921 I've got all the corner cases fixed, that code is a bit of a brain
2934 I've got all the corner cases fixed, that code is a bit of a brain
2922 twister).
2935 twister).
2923
2936
2924 * IPython/Magic.py (magic_edit): added support to edit in-memory
2937 * IPython/Magic.py (magic_edit): added support to edit in-memory
2925 macros (automatically creates the necessary temp files). %edit
2938 macros (automatically creates the necessary temp files). %edit
2926 also doesn't return the file contents anymore, it's just noise.
2939 also doesn't return the file contents anymore, it's just noise.
2927
2940
2928 * IPython/completer.py (Completer.attr_matches): revert change to
2941 * IPython/completer.py (Completer.attr_matches): revert change to
2929 complete only on attributes listed in __all__. I realized it
2942 complete only on attributes listed in __all__. I realized it
2930 cripples the tab-completion system as a tool for exploring the
2943 cripples the tab-completion system as a tool for exploring the
2931 internals of unknown libraries (it renders any non-__all__
2944 internals of unknown libraries (it renders any non-__all__
2932 attribute off-limits). I got bit by this when trying to see
2945 attribute off-limits). I got bit by this when trying to see
2933 something inside the dis module.
2946 something inside the dis module.
2934
2947
2935 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2948 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
2936
2949
2937 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2950 * IPython/iplib.py (InteractiveShell.__init__): add .meta
2938 namespace for users and extension writers to hold data in. This
2951 namespace for users and extension writers to hold data in. This
2939 follows the discussion in
2952 follows the discussion in
2940 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2953 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
2941
2954
2942 * IPython/completer.py (IPCompleter.complete): small patch to help
2955 * IPython/completer.py (IPCompleter.complete): small patch to help
2943 tab-completion under Emacs, after a suggestion by John Barnard
2956 tab-completion under Emacs, after a suggestion by John Barnard
2944 <barnarj-AT-ccf.org>.
2957 <barnarj-AT-ccf.org>.
2945
2958
2946 * IPython/Magic.py (Magic.extract_input_slices): added support for
2959 * IPython/Magic.py (Magic.extract_input_slices): added support for
2947 the slice notation in magics to use N-M to represent numbers N...M
2960 the slice notation in magics to use N-M to represent numbers N...M
2948 (closed endpoints). This is used by %macro and %save.
2961 (closed endpoints). This is used by %macro and %save.
2949
2962
2950 * IPython/completer.py (Completer.attr_matches): for modules which
2963 * IPython/completer.py (Completer.attr_matches): for modules which
2951 define __all__, complete only on those. After a patch by Jeffrey
2964 define __all__, complete only on those. After a patch by Jeffrey
2952 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2965 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
2953 speed up this routine.
2966 speed up this routine.
2954
2967
2955 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2968 * IPython/Logger.py (Logger.log): fix a history handling bug. I
2956 don't know if this is the end of it, but the behavior now is
2969 don't know if this is the end of it, but the behavior now is
2957 certainly much more correct. Note that coupled with macros,
2970 certainly much more correct. Note that coupled with macros,
2958 slightly surprising (at first) behavior may occur: a macro will in
2971 slightly surprising (at first) behavior may occur: a macro will in
2959 general expand to multiple lines of input, so upon exiting, the
2972 general expand to multiple lines of input, so upon exiting, the
2960 in/out counters will both be bumped by the corresponding amount
2973 in/out counters will both be bumped by the corresponding amount
2961 (as if the macro's contents had been typed interactively). Typing
2974 (as if the macro's contents had been typed interactively). Typing
2962 %hist will reveal the intermediate (silently processed) lines.
2975 %hist will reveal the intermediate (silently processed) lines.
2963
2976
2964 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2977 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
2965 pickle to fail (%run was overwriting __main__ and not restoring
2978 pickle to fail (%run was overwriting __main__ and not restoring
2966 it, but pickle relies on __main__ to operate).
2979 it, but pickle relies on __main__ to operate).
2967
2980
2968 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2981 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
2969 using properties, but forgot to make the main InteractiveShell
2982 using properties, but forgot to make the main InteractiveShell
2970 class a new-style class. Properties fail silently, and
2983 class a new-style class. Properties fail silently, and
2971 mysteriously, with old-style class (getters work, but
2984 mysteriously, with old-style class (getters work, but
2972 setters don't do anything).
2985 setters don't do anything).
2973
2986
2974 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2987 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2975
2988
2976 * IPython/Magic.py (magic_history): fix history reporting bug (I
2989 * IPython/Magic.py (magic_history): fix history reporting bug (I
2977 know some nasties are still there, I just can't seem to find a
2990 know some nasties are still there, I just can't seem to find a
2978 reproducible test case to track them down; the input history is
2991 reproducible test case to track them down; the input history is
2979 falling out of sync...)
2992 falling out of sync...)
2980
2993
2981 * IPython/iplib.py (handle_shell_escape): fix bug where both
2994 * IPython/iplib.py (handle_shell_escape): fix bug where both
2982 aliases and system accesses where broken for indented code (such
2995 aliases and system accesses where broken for indented code (such
2983 as loops).
2996 as loops).
2984
2997
2985 * IPython/genutils.py (shell): fix small but critical bug for
2998 * IPython/genutils.py (shell): fix small but critical bug for
2986 win32 system access.
2999 win32 system access.
2987
3000
2988 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
3001 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
2989
3002
2990 * IPython/iplib.py (showtraceback): remove use of the
3003 * IPython/iplib.py (showtraceback): remove use of the
2991 sys.last_{type/value/traceback} structures, which are non
3004 sys.last_{type/value/traceback} structures, which are non
2992 thread-safe.
3005 thread-safe.
2993 (_prefilter): change control flow to ensure that we NEVER
3006 (_prefilter): change control flow to ensure that we NEVER
2994 introspect objects when autocall is off. This will guarantee that
3007 introspect objects when autocall is off. This will guarantee that
2995 having an input line of the form 'x.y', where access to attribute
3008 having an input line of the form 'x.y', where access to attribute
2996 'y' has side effects, doesn't trigger the side effect TWICE. It
3009 'y' has side effects, doesn't trigger the side effect TWICE. It
2997 is important to note that, with autocall on, these side effects
3010 is important to note that, with autocall on, these side effects
2998 can still happen.
3011 can still happen.
2999 (ipsystem): new builtin, to complete the ip{magic/alias/system}
3012 (ipsystem): new builtin, to complete the ip{magic/alias/system}
3000 trio. IPython offers these three kinds of special calls which are
3013 trio. IPython offers these three kinds of special calls which are
3001 not python code, and it's a good thing to have their call method
3014 not python code, and it's a good thing to have their call method
3002 be accessible as pure python functions (not just special syntax at
3015 be accessible as pure python functions (not just special syntax at
3003 the command line). It gives us a better internal implementation
3016 the command line). It gives us a better internal implementation
3004 structure, as well as exposing these for user scripting more
3017 structure, as well as exposing these for user scripting more
3005 cleanly.
3018 cleanly.
3006
3019
3007 * IPython/macro.py (Macro.__init__): moved macros to a standalone
3020 * IPython/macro.py (Macro.__init__): moved macros to a standalone
3008 file. Now that they'll be more likely to be used with the
3021 file. Now that they'll be more likely to be used with the
3009 persistance system (%store), I want to make sure their module path
3022 persistance system (%store), I want to make sure their module path
3010 doesn't change in the future, so that we don't break things for
3023 doesn't change in the future, so that we don't break things for
3011 users' persisted data.
3024 users' persisted data.
3012
3025
3013 * IPython/iplib.py (autoindent_update): move indentation
3026 * IPython/iplib.py (autoindent_update): move indentation
3014 management into the _text_ processing loop, not the keyboard
3027 management into the _text_ processing loop, not the keyboard
3015 interactive one. This is necessary to correctly process non-typed
3028 interactive one. This is necessary to correctly process non-typed
3016 multiline input (such as macros).
3029 multiline input (such as macros).
3017
3030
3018 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
3031 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
3019 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
3032 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
3020 which was producing problems in the resulting manual.
3033 which was producing problems in the resulting manual.
3021 (magic_whos): improve reporting of instances (show their class,
3034 (magic_whos): improve reporting of instances (show their class,
3022 instead of simply printing 'instance' which isn't terribly
3035 instead of simply printing 'instance' which isn't terribly
3023 informative).
3036 informative).
3024
3037
3025 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
3038 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
3026 (minor mods) to support network shares under win32.
3039 (minor mods) to support network shares under win32.
3027
3040
3028 * IPython/winconsole.py (get_console_size): add new winconsole
3041 * IPython/winconsole.py (get_console_size): add new winconsole
3029 module and fixes to page_dumb() to improve its behavior under
3042 module and fixes to page_dumb() to improve its behavior under
3030 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
3043 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
3031
3044
3032 * IPython/Magic.py (Macro): simplified Macro class to just
3045 * IPython/Magic.py (Macro): simplified Macro class to just
3033 subclass list. We've had only 2.2 compatibility for a very long
3046 subclass list. We've had only 2.2 compatibility for a very long
3034 time, yet I was still avoiding subclassing the builtin types. No
3047 time, yet I was still avoiding subclassing the builtin types. No
3035 more (I'm also starting to use properties, though I won't shift to
3048 more (I'm also starting to use properties, though I won't shift to
3036 2.3-specific features quite yet).
3049 2.3-specific features quite yet).
3037 (magic_store): added Ville's patch for lightweight variable
3050 (magic_store): added Ville's patch for lightweight variable
3038 persistence, after a request on the user list by Matt Wilkie
3051 persistence, after a request on the user list by Matt Wilkie
3039 <maphew-AT-gmail.com>. The new %store magic's docstring has full
3052 <maphew-AT-gmail.com>. The new %store magic's docstring has full
3040 details.
3053 details.
3041
3054
3042 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3055 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3043 changed the default logfile name from 'ipython.log' to
3056 changed the default logfile name from 'ipython.log' to
3044 'ipython_log.py'. These logs are real python files, and now that
3057 'ipython_log.py'. These logs are real python files, and now that
3045 we have much better multiline support, people are more likely to
3058 we have much better multiline support, people are more likely to
3046 want to use them as such. Might as well name them correctly.
3059 want to use them as such. Might as well name them correctly.
3047
3060
3048 * IPython/Magic.py: substantial cleanup. While we can't stop
3061 * IPython/Magic.py: substantial cleanup. While we can't stop
3049 using magics as mixins, due to the existing customizations 'out
3062 using magics as mixins, due to the existing customizations 'out
3050 there' which rely on the mixin naming conventions, at least I
3063 there' which rely on the mixin naming conventions, at least I
3051 cleaned out all cross-class name usage. So once we are OK with
3064 cleaned out all cross-class name usage. So once we are OK with
3052 breaking compatibility, the two systems can be separated.
3065 breaking compatibility, the two systems can be separated.
3053
3066
3054 * IPython/Logger.py: major cleanup. This one is NOT a mixin
3067 * IPython/Logger.py: major cleanup. This one is NOT a mixin
3055 anymore, and the class is a fair bit less hideous as well. New
3068 anymore, and the class is a fair bit less hideous as well. New
3056 features were also introduced: timestamping of input, and logging
3069 features were also introduced: timestamping of input, and logging
3057 of output results. These are user-visible with the -t and -o
3070 of output results. These are user-visible with the -t and -o
3058 options to %logstart. Closes
3071 options to %logstart. Closes
3059 http://www.scipy.net/roundup/ipython/issue11 and a request by
3072 http://www.scipy.net/roundup/ipython/issue11 and a request by
3060 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
3073 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
3061
3074
3062 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
3075 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
3063
3076
3064 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
3077 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
3065 better handle backslashes in paths. See the thread 'More Windows
3078 better handle backslashes in paths. See the thread 'More Windows
3066 questions part 2 - \/ characters revisited' on the iypthon user
3079 questions part 2 - \/ characters revisited' on the iypthon user
3067 list:
3080 list:
3068 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
3081 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
3069
3082
3070 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
3083 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
3071
3084
3072 (InteractiveShell.__init__): change threaded shells to not use the
3085 (InteractiveShell.__init__): change threaded shells to not use the
3073 ipython crash handler. This was causing more problems than not,
3086 ipython crash handler. This was causing more problems than not,
3074 as exceptions in the main thread (GUI code, typically) would
3087 as exceptions in the main thread (GUI code, typically) would
3075 always show up as a 'crash', when they really weren't.
3088 always show up as a 'crash', when they really weren't.
3076
3089
3077 The colors and exception mode commands (%colors/%xmode) have been
3090 The colors and exception mode commands (%colors/%xmode) have been
3078 synchronized to also take this into account, so users can get
3091 synchronized to also take this into account, so users can get
3079 verbose exceptions for their threaded code as well. I also added
3092 verbose exceptions for their threaded code as well. I also added
3080 support for activating pdb inside this exception handler as well,
3093 support for activating pdb inside this exception handler as well,
3081 so now GUI authors can use IPython's enhanced pdb at runtime.
3094 so now GUI authors can use IPython's enhanced pdb at runtime.
3082
3095
3083 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
3096 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
3084 true by default, and add it to the shipped ipythonrc file. Since
3097 true by default, and add it to the shipped ipythonrc file. Since
3085 this asks the user before proceeding, I think it's OK to make it
3098 this asks the user before proceeding, I think it's OK to make it
3086 true by default.
3099 true by default.
3087
3100
3088 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
3101 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
3089 of the previous special-casing of input in the eval loop. I think
3102 of the previous special-casing of input in the eval loop. I think
3090 this is cleaner, as they really are commands and shouldn't have
3103 this is cleaner, as they really are commands and shouldn't have
3091 a special role in the middle of the core code.
3104 a special role in the middle of the core code.
3092
3105
3093 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
3106 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
3094
3107
3095 * IPython/iplib.py (edit_syntax_error): added support for
3108 * IPython/iplib.py (edit_syntax_error): added support for
3096 automatically reopening the editor if the file had a syntax error
3109 automatically reopening the editor if the file had a syntax error
3097 in it. Thanks to scottt who provided the patch at:
3110 in it. Thanks to scottt who provided the patch at:
3098 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
3111 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
3099 version committed).
3112 version committed).
3100
3113
3101 * IPython/iplib.py (handle_normal): add suport for multi-line
3114 * IPython/iplib.py (handle_normal): add suport for multi-line
3102 input with emtpy lines. This fixes
3115 input with emtpy lines. This fixes
3103 http://www.scipy.net/roundup/ipython/issue43 and a similar
3116 http://www.scipy.net/roundup/ipython/issue43 and a similar
3104 discussion on the user list.
3117 discussion on the user list.
3105
3118
3106 WARNING: a behavior change is necessarily introduced to support
3119 WARNING: a behavior change is necessarily introduced to support
3107 blank lines: now a single blank line with whitespace does NOT
3120 blank lines: now a single blank line with whitespace does NOT
3108 break the input loop, which means that when autoindent is on, by
3121 break the input loop, which means that when autoindent is on, by
3109 default hitting return on the next (indented) line does NOT exit.
3122 default hitting return on the next (indented) line does NOT exit.
3110
3123
3111 Instead, to exit a multiline input you can either have:
3124 Instead, to exit a multiline input you can either have:
3112
3125
3113 - TWO whitespace lines (just hit return again), or
3126 - TWO whitespace lines (just hit return again), or
3114 - a single whitespace line of a different length than provided
3127 - a single whitespace line of a different length than provided
3115 by the autoindent (add or remove a space).
3128 by the autoindent (add or remove a space).
3116
3129
3117 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
3130 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
3118 module to better organize all readline-related functionality.
3131 module to better organize all readline-related functionality.
3119 I've deleted FlexCompleter and put all completion clases here.
3132 I've deleted FlexCompleter and put all completion clases here.
3120
3133
3121 * IPython/iplib.py (raw_input): improve indentation management.
3134 * IPython/iplib.py (raw_input): improve indentation management.
3122 It is now possible to paste indented code with autoindent on, and
3135 It is now possible to paste indented code with autoindent on, and
3123 the code is interpreted correctly (though it still looks bad on
3136 the code is interpreted correctly (though it still looks bad on
3124 screen, due to the line-oriented nature of ipython).
3137 screen, due to the line-oriented nature of ipython).
3125 (MagicCompleter.complete): change behavior so that a TAB key on an
3138 (MagicCompleter.complete): change behavior so that a TAB key on an
3126 otherwise empty line actually inserts a tab, instead of completing
3139 otherwise empty line actually inserts a tab, instead of completing
3127 on the entire global namespace. This makes it easier to use the
3140 on the entire global namespace. This makes it easier to use the
3128 TAB key for indentation. After a request by Hans Meine
3141 TAB key for indentation. After a request by Hans Meine
3129 <hans_meine-AT-gmx.net>
3142 <hans_meine-AT-gmx.net>
3130 (_prefilter): add support so that typing plain 'exit' or 'quit'
3143 (_prefilter): add support so that typing plain 'exit' or 'quit'
3131 does a sensible thing. Originally I tried to deviate as little as
3144 does a sensible thing. Originally I tried to deviate as little as
3132 possible from the default python behavior, but even that one may
3145 possible from the default python behavior, but even that one may
3133 change in this direction (thread on python-dev to that effect).
3146 change in this direction (thread on python-dev to that effect).
3134 Regardless, ipython should do the right thing even if CPython's
3147 Regardless, ipython should do the right thing even if CPython's
3135 '>>>' prompt doesn't.
3148 '>>>' prompt doesn't.
3136 (InteractiveShell): removed subclassing code.InteractiveConsole
3149 (InteractiveShell): removed subclassing code.InteractiveConsole
3137 class. By now we'd overridden just about all of its methods: I've
3150 class. By now we'd overridden just about all of its methods: I've
3138 copied the remaining two over, and now ipython is a standalone
3151 copied the remaining two over, and now ipython is a standalone
3139 class. This will provide a clearer picture for the chainsaw
3152 class. This will provide a clearer picture for the chainsaw
3140 branch refactoring.
3153 branch refactoring.
3141
3154
3142 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
3155 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
3143
3156
3144 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
3157 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
3145 failures for objects which break when dir() is called on them.
3158 failures for objects which break when dir() is called on them.
3146
3159
3147 * IPython/FlexCompleter.py (Completer.__init__): Added support for
3160 * IPython/FlexCompleter.py (Completer.__init__): Added support for
3148 distinct local and global namespaces in the completer API. This
3161 distinct local and global namespaces in the completer API. This
3149 change allows us to properly handle completion with distinct
3162 change allows us to properly handle completion with distinct
3150 scopes, including in embedded instances (this had never really
3163 scopes, including in embedded instances (this had never really
3151 worked correctly).
3164 worked correctly).
3152
3165
3153 Note: this introduces a change in the constructor for
3166 Note: this introduces a change in the constructor for
3154 MagicCompleter, as a new global_namespace parameter is now the
3167 MagicCompleter, as a new global_namespace parameter is now the
3155 second argument (the others were bumped one position).
3168 second argument (the others were bumped one position).
3156
3169
3157 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
3170 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
3158
3171
3159 * IPython/iplib.py (embed_mainloop): fix tab-completion in
3172 * IPython/iplib.py (embed_mainloop): fix tab-completion in
3160 embedded instances (which can be done now thanks to Vivian's
3173 embedded instances (which can be done now thanks to Vivian's
3161 frame-handling fixes for pdb).
3174 frame-handling fixes for pdb).
3162 (InteractiveShell.__init__): Fix namespace handling problem in
3175 (InteractiveShell.__init__): Fix namespace handling problem in
3163 embedded instances. We were overwriting __main__ unconditionally,
3176 embedded instances. We were overwriting __main__ unconditionally,
3164 and this should only be done for 'full' (non-embedded) IPython;
3177 and this should only be done for 'full' (non-embedded) IPython;
3165 embedded instances must respect the caller's __main__. Thanks to
3178 embedded instances must respect the caller's __main__. Thanks to
3166 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
3179 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
3167
3180
3168 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
3181 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
3169
3182
3170 * setup.py: added download_url to setup(). This registers the
3183 * setup.py: added download_url to setup(). This registers the
3171 download address at PyPI, which is not only useful to humans
3184 download address at PyPI, which is not only useful to humans
3172 browsing the site, but is also picked up by setuptools (the Eggs
3185 browsing the site, but is also picked up by setuptools (the Eggs
3173 machinery). Thanks to Ville and R. Kern for the info/discussion
3186 machinery). Thanks to Ville and R. Kern for the info/discussion
3174 on this.
3187 on this.
3175
3188
3176 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
3189 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
3177
3190
3178 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
3191 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
3179 This brings a lot of nice functionality to the pdb mode, which now
3192 This brings a lot of nice functionality to the pdb mode, which now
3180 has tab-completion, syntax highlighting, and better stack handling
3193 has tab-completion, syntax highlighting, and better stack handling
3181 than before. Many thanks to Vivian De Smedt
3194 than before. Many thanks to Vivian De Smedt
3182 <vivian-AT-vdesmedt.com> for the original patches.
3195 <vivian-AT-vdesmedt.com> for the original patches.
3183
3196
3184 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
3197 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
3185
3198
3186 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
3199 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
3187 sequence to consistently accept the banner argument. The
3200 sequence to consistently accept the banner argument. The
3188 inconsistency was tripping SAGE, thanks to Gary Zablackis
3201 inconsistency was tripping SAGE, thanks to Gary Zablackis
3189 <gzabl-AT-yahoo.com> for the report.
3202 <gzabl-AT-yahoo.com> for the report.
3190
3203
3191 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
3204 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
3192
3205
3193 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3206 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3194 Fix bug where a naked 'alias' call in the ipythonrc file would
3207 Fix bug where a naked 'alias' call in the ipythonrc file would
3195 cause a crash. Bug reported by Jorgen Stenarson.
3208 cause a crash. Bug reported by Jorgen Stenarson.
3196
3209
3197 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
3210 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
3198
3211
3199 * IPython/ipmaker.py (make_IPython): cleanups which should improve
3212 * IPython/ipmaker.py (make_IPython): cleanups which should improve
3200 startup time.
3213 startup time.
3201
3214
3202 * IPython/iplib.py (runcode): my globals 'fix' for embedded
3215 * IPython/iplib.py (runcode): my globals 'fix' for embedded
3203 instances had introduced a bug with globals in normal code. Now
3216 instances had introduced a bug with globals in normal code. Now
3204 it's working in all cases.
3217 it's working in all cases.
3205
3218
3206 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
3219 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
3207 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
3220 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
3208 has been introduced to set the default case sensitivity of the
3221 has been introduced to set the default case sensitivity of the
3209 searches. Users can still select either mode at runtime on a
3222 searches. Users can still select either mode at runtime on a
3210 per-search basis.
3223 per-search basis.
3211
3224
3212 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
3225 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
3213
3226
3214 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
3227 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
3215 attributes in wildcard searches for subclasses. Modified version
3228 attributes in wildcard searches for subclasses. Modified version
3216 of a patch by Jorgen.
3229 of a patch by Jorgen.
3217
3230
3218 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
3231 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
3219
3232
3220 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
3233 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
3221 embedded instances. I added a user_global_ns attribute to the
3234 embedded instances. I added a user_global_ns attribute to the
3222 InteractiveShell class to handle this.
3235 InteractiveShell class to handle this.
3223
3236
3224 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
3237 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
3225
3238
3226 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
3239 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
3227 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
3240 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
3228 (reported under win32, but may happen also in other platforms).
3241 (reported under win32, but may happen also in other platforms).
3229 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
3242 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
3230
3243
3231 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
3244 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
3232
3245
3233 * IPython/Magic.py (magic_psearch): new support for wildcard
3246 * IPython/Magic.py (magic_psearch): new support for wildcard
3234 patterns. Now, typing ?a*b will list all names which begin with a
3247 patterns. Now, typing ?a*b will list all names which begin with a
3235 and end in b, for example. The %psearch magic has full
3248 and end in b, for example. The %psearch magic has full
3236 docstrings. Many thanks to Jörgen Stenarson
3249 docstrings. Many thanks to Jörgen Stenarson
3237 <jorgen.stenarson-AT-bostream.nu>, author of the patches
3250 <jorgen.stenarson-AT-bostream.nu>, author of the patches
3238 implementing this functionality.
3251 implementing this functionality.
3239
3252
3240 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
3253 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
3241
3254
3242 * Manual: fixed long-standing annoyance of double-dashes (as in
3255 * Manual: fixed long-standing annoyance of double-dashes (as in
3243 --prefix=~, for example) being stripped in the HTML version. This
3256 --prefix=~, for example) being stripped in the HTML version. This
3244 is a latex2html bug, but a workaround was provided. Many thanks
3257 is a latex2html bug, but a workaround was provided. Many thanks
3245 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
3258 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
3246 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
3259 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
3247 rolling. This seemingly small issue had tripped a number of users
3260 rolling. This seemingly small issue had tripped a number of users
3248 when first installing, so I'm glad to see it gone.
3261 when first installing, so I'm glad to see it gone.
3249
3262
3250 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
3263 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
3251
3264
3252 * IPython/Extensions/numeric_formats.py: fix missing import,
3265 * IPython/Extensions/numeric_formats.py: fix missing import,
3253 reported by Stephen Walton.
3266 reported by Stephen Walton.
3254
3267
3255 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
3268 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
3256
3269
3257 * IPython/demo.py: finish demo module, fully documented now.
3270 * IPython/demo.py: finish demo module, fully documented now.
3258
3271
3259 * IPython/genutils.py (file_read): simple little utility to read a
3272 * IPython/genutils.py (file_read): simple little utility to read a
3260 file and ensure it's closed afterwards.
3273 file and ensure it's closed afterwards.
3261
3274
3262 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
3275 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
3263
3276
3264 * IPython/demo.py (Demo.__init__): added support for individually
3277 * IPython/demo.py (Demo.__init__): added support for individually
3265 tagging blocks for automatic execution.
3278 tagging blocks for automatic execution.
3266
3279
3267 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
3280 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
3268 syntax-highlighted python sources, requested by John.
3281 syntax-highlighted python sources, requested by John.
3269
3282
3270 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
3283 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
3271
3284
3272 * IPython/demo.py (Demo.again): fix bug where again() blocks after
3285 * IPython/demo.py (Demo.again): fix bug where again() blocks after
3273 finishing.
3286 finishing.
3274
3287
3275 * IPython/genutils.py (shlex_split): moved from Magic to here,
3288 * IPython/genutils.py (shlex_split): moved from Magic to here,
3276 where all 2.2 compatibility stuff lives. I needed it for demo.py.
3289 where all 2.2 compatibility stuff lives. I needed it for demo.py.
3277
3290
3278 * IPython/demo.py (Demo.__init__): added support for silent
3291 * IPython/demo.py (Demo.__init__): added support for silent
3279 blocks, improved marks as regexps, docstrings written.
3292 blocks, improved marks as regexps, docstrings written.
3280 (Demo.__init__): better docstring, added support for sys.argv.
3293 (Demo.__init__): better docstring, added support for sys.argv.
3281
3294
3282 * IPython/genutils.py (marquee): little utility used by the demo
3295 * IPython/genutils.py (marquee): little utility used by the demo
3283 code, handy in general.
3296 code, handy in general.
3284
3297
3285 * IPython/demo.py (Demo.__init__): new class for interactive
3298 * IPython/demo.py (Demo.__init__): new class for interactive
3286 demos. Not documented yet, I just wrote it in a hurry for
3299 demos. Not documented yet, I just wrote it in a hurry for
3287 scipy'05. Will docstring later.
3300 scipy'05. Will docstring later.
3288
3301
3289 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
3302 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
3290
3303
3291 * IPython/Shell.py (sigint_handler): Drastic simplification which
3304 * IPython/Shell.py (sigint_handler): Drastic simplification which
3292 also seems to make Ctrl-C work correctly across threads! This is
3305 also seems to make Ctrl-C work correctly across threads! This is
3293 so simple, that I can't beleive I'd missed it before. Needs more
3306 so simple, that I can't beleive I'd missed it before. Needs more
3294 testing, though.
3307 testing, though.
3295 (KBINT): Never mind, revert changes. I'm sure I'd tried something
3308 (KBINT): Never mind, revert changes. I'm sure I'd tried something
3296 like this before...
3309 like this before...
3297
3310
3298 * IPython/genutils.py (get_home_dir): add protection against
3311 * IPython/genutils.py (get_home_dir): add protection against
3299 non-dirs in win32 registry.
3312 non-dirs in win32 registry.
3300
3313
3301 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
3314 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
3302 bug where dict was mutated while iterating (pysh crash).
3315 bug where dict was mutated while iterating (pysh crash).
3303
3316
3304 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
3317 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
3305
3318
3306 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
3319 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
3307 spurious newlines added by this routine. After a report by
3320 spurious newlines added by this routine. After a report by
3308 F. Mantegazza.
3321 F. Mantegazza.
3309
3322
3310 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
3323 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
3311
3324
3312 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
3325 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
3313 calls. These were a leftover from the GTK 1.x days, and can cause
3326 calls. These were a leftover from the GTK 1.x days, and can cause
3314 problems in certain cases (after a report by John Hunter).
3327 problems in certain cases (after a report by John Hunter).
3315
3328
3316 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
3329 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
3317 os.getcwd() fails at init time. Thanks to patch from David Remahl
3330 os.getcwd() fails at init time. Thanks to patch from David Remahl
3318 <chmod007-AT-mac.com>.
3331 <chmod007-AT-mac.com>.
3319 (InteractiveShell.__init__): prevent certain special magics from
3332 (InteractiveShell.__init__): prevent certain special magics from
3320 being shadowed by aliases. Closes
3333 being shadowed by aliases. Closes
3321 http://www.scipy.net/roundup/ipython/issue41.
3334 http://www.scipy.net/roundup/ipython/issue41.
3322
3335
3323 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
3336 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
3324
3337
3325 * IPython/iplib.py (InteractiveShell.complete): Added new
3338 * IPython/iplib.py (InteractiveShell.complete): Added new
3326 top-level completion method to expose the completion mechanism
3339 top-level completion method to expose the completion mechanism
3327 beyond readline-based environments.
3340 beyond readline-based environments.
3328
3341
3329 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
3342 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
3330
3343
3331 * tools/ipsvnc (svnversion): fix svnversion capture.
3344 * tools/ipsvnc (svnversion): fix svnversion capture.
3332
3345
3333 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
3346 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
3334 attribute to self, which was missing. Before, it was set by a
3347 attribute to self, which was missing. Before, it was set by a
3335 routine which in certain cases wasn't being called, so the
3348 routine which in certain cases wasn't being called, so the
3336 instance could end up missing the attribute. This caused a crash.
3349 instance could end up missing the attribute. This caused a crash.
3337 Closes http://www.scipy.net/roundup/ipython/issue40.
3350 Closes http://www.scipy.net/roundup/ipython/issue40.
3338
3351
3339 2005-08-16 Fernando Perez <fperez@colorado.edu>
3352 2005-08-16 Fernando Perez <fperez@colorado.edu>
3340
3353
3341 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
3354 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
3342 contains non-string attribute. Closes
3355 contains non-string attribute. Closes
3343 http://www.scipy.net/roundup/ipython/issue38.
3356 http://www.scipy.net/roundup/ipython/issue38.
3344
3357
3345 2005-08-14 Fernando Perez <fperez@colorado.edu>
3358 2005-08-14 Fernando Perez <fperez@colorado.edu>
3346
3359
3347 * tools/ipsvnc: Minor improvements, to add changeset info.
3360 * tools/ipsvnc: Minor improvements, to add changeset info.
3348
3361
3349 2005-08-12 Fernando Perez <fperez@colorado.edu>
3362 2005-08-12 Fernando Perez <fperez@colorado.edu>
3350
3363
3351 * IPython/iplib.py (runsource): remove self.code_to_run_src
3364 * IPython/iplib.py (runsource): remove self.code_to_run_src
3352 attribute. I realized this is nothing more than
3365 attribute. I realized this is nothing more than
3353 '\n'.join(self.buffer), and having the same data in two different
3366 '\n'.join(self.buffer), and having the same data in two different
3354 places is just asking for synchronization bugs. This may impact
3367 places is just asking for synchronization bugs. This may impact
3355 people who have custom exception handlers, so I need to warn
3368 people who have custom exception handlers, so I need to warn
3356 ipython-dev about it (F. Mantegazza may use them).
3369 ipython-dev about it (F. Mantegazza may use them).
3357
3370
3358 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
3371 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
3359
3372
3360 * IPython/genutils.py: fix 2.2 compatibility (generators)
3373 * IPython/genutils.py: fix 2.2 compatibility (generators)
3361
3374
3362 2005-07-18 Fernando Perez <fperez@colorado.edu>
3375 2005-07-18 Fernando Perez <fperez@colorado.edu>
3363
3376
3364 * IPython/genutils.py (get_home_dir): fix to help users with
3377 * IPython/genutils.py (get_home_dir): fix to help users with
3365 invalid $HOME under win32.
3378 invalid $HOME under win32.
3366
3379
3367 2005-07-17 Fernando Perez <fperez@colorado.edu>
3380 2005-07-17 Fernando Perez <fperez@colorado.edu>
3368
3381
3369 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
3382 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
3370 some old hacks and clean up a bit other routines; code should be
3383 some old hacks and clean up a bit other routines; code should be
3371 simpler and a bit faster.
3384 simpler and a bit faster.
3372
3385
3373 * IPython/iplib.py (interact): removed some last-resort attempts
3386 * IPython/iplib.py (interact): removed some last-resort attempts
3374 to survive broken stdout/stderr. That code was only making it
3387 to survive broken stdout/stderr. That code was only making it
3375 harder to abstract out the i/o (necessary for gui integration),
3388 harder to abstract out the i/o (necessary for gui integration),
3376 and the crashes it could prevent were extremely rare in practice
3389 and the crashes it could prevent were extremely rare in practice
3377 (besides being fully user-induced in a pretty violent manner).
3390 (besides being fully user-induced in a pretty violent manner).
3378
3391
3379 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
3392 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
3380 Nothing major yet, but the code is simpler to read; this should
3393 Nothing major yet, but the code is simpler to read; this should
3381 make it easier to do more serious modifications in the future.
3394 make it easier to do more serious modifications in the future.
3382
3395
3383 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
3396 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
3384 which broke in .15 (thanks to a report by Ville).
3397 which broke in .15 (thanks to a report by Ville).
3385
3398
3386 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
3399 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
3387 be quite correct, I know next to nothing about unicode). This
3400 be quite correct, I know next to nothing about unicode). This
3388 will allow unicode strings to be used in prompts, amongst other
3401 will allow unicode strings to be used in prompts, amongst other
3389 cases. It also will prevent ipython from crashing when unicode
3402 cases. It also will prevent ipython from crashing when unicode
3390 shows up unexpectedly in many places. If ascii encoding fails, we
3403 shows up unexpectedly in many places. If ascii encoding fails, we
3391 assume utf_8. Currently the encoding is not a user-visible
3404 assume utf_8. Currently the encoding is not a user-visible
3392 setting, though it could be made so if there is demand for it.
3405 setting, though it could be made so if there is demand for it.
3393
3406
3394 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
3407 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
3395
3408
3396 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
3409 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
3397
3410
3398 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
3411 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
3399
3412
3400 * IPython/genutils.py: Add 2.2 compatibility here, so all other
3413 * IPython/genutils.py: Add 2.2 compatibility here, so all other
3401 code can work transparently for 2.2/2.3.
3414 code can work transparently for 2.2/2.3.
3402
3415
3403 2005-07-16 Fernando Perez <fperez@colorado.edu>
3416 2005-07-16 Fernando Perez <fperez@colorado.edu>
3404
3417
3405 * IPython/ultraTB.py (ExceptionColors): Make a global variable
3418 * IPython/ultraTB.py (ExceptionColors): Make a global variable
3406 out of the color scheme table used for coloring exception
3419 out of the color scheme table used for coloring exception
3407 tracebacks. This allows user code to add new schemes at runtime.
3420 tracebacks. This allows user code to add new schemes at runtime.
3408 This is a minimally modified version of the patch at
3421 This is a minimally modified version of the patch at
3409 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
3422 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
3410 for the contribution.
3423 for the contribution.
3411
3424
3412 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
3425 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
3413 slightly modified version of the patch in
3426 slightly modified version of the patch in
3414 http://www.scipy.net/roundup/ipython/issue34, which also allows me
3427 http://www.scipy.net/roundup/ipython/issue34, which also allows me
3415 to remove the previous try/except solution (which was costlier).
3428 to remove the previous try/except solution (which was costlier).
3416 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
3429 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
3417
3430
3418 2005-06-08 Fernando Perez <fperez@colorado.edu>
3431 2005-06-08 Fernando Perez <fperez@colorado.edu>
3419
3432
3420 * IPython/iplib.py (write/write_err): Add methods to abstract all
3433 * IPython/iplib.py (write/write_err): Add methods to abstract all
3421 I/O a bit more.
3434 I/O a bit more.
3422
3435
3423 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
3436 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
3424 warning, reported by Aric Hagberg, fix by JD Hunter.
3437 warning, reported by Aric Hagberg, fix by JD Hunter.
3425
3438
3426 2005-06-02 *** Released version 0.6.15
3439 2005-06-02 *** Released version 0.6.15
3427
3440
3428 2005-06-01 Fernando Perez <fperez@colorado.edu>
3441 2005-06-01 Fernando Perez <fperez@colorado.edu>
3429
3442
3430 * IPython/iplib.py (MagicCompleter.file_matches): Fix
3443 * IPython/iplib.py (MagicCompleter.file_matches): Fix
3431 tab-completion of filenames within open-quoted strings. Note that
3444 tab-completion of filenames within open-quoted strings. Note that
3432 this requires that in ~/.ipython/ipythonrc, users change the
3445 this requires that in ~/.ipython/ipythonrc, users change the
3433 readline delimiters configuration to read:
3446 readline delimiters configuration to read:
3434
3447
3435 readline_remove_delims -/~
3448 readline_remove_delims -/~
3436
3449
3437
3450
3438 2005-05-31 *** Released version 0.6.14
3451 2005-05-31 *** Released version 0.6.14
3439
3452
3440 2005-05-29 Fernando Perez <fperez@colorado.edu>
3453 2005-05-29 Fernando Perez <fperez@colorado.edu>
3441
3454
3442 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
3455 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
3443 with files not on the filesystem. Reported by Eliyahu Sandler
3456 with files not on the filesystem. Reported by Eliyahu Sandler
3444 <eli@gondolin.net>
3457 <eli@gondolin.net>
3445
3458
3446 2005-05-22 Fernando Perez <fperez@colorado.edu>
3459 2005-05-22 Fernando Perez <fperez@colorado.edu>
3447
3460
3448 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
3461 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
3449 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
3462 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
3450
3463
3451 2005-05-19 Fernando Perez <fperez@colorado.edu>
3464 2005-05-19 Fernando Perez <fperez@colorado.edu>
3452
3465
3453 * IPython/iplib.py (safe_execfile): close a file which could be
3466 * IPython/iplib.py (safe_execfile): close a file which could be
3454 left open (causing problems in win32, which locks open files).
3467 left open (causing problems in win32, which locks open files).
3455 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
3468 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
3456
3469
3457 2005-05-18 Fernando Perez <fperez@colorado.edu>
3470 2005-05-18 Fernando Perez <fperez@colorado.edu>
3458
3471
3459 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
3472 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
3460 keyword arguments correctly to safe_execfile().
3473 keyword arguments correctly to safe_execfile().
3461
3474
3462 2005-05-13 Fernando Perez <fperez@colorado.edu>
3475 2005-05-13 Fernando Perez <fperez@colorado.edu>
3463
3476
3464 * ipython.1: Added info about Qt to manpage, and threads warning
3477 * ipython.1: Added info about Qt to manpage, and threads warning
3465 to usage page (invoked with --help).
3478 to usage page (invoked with --help).
3466
3479
3467 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3480 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
3468 new matcher (it goes at the end of the priority list) to do
3481 new matcher (it goes at the end of the priority list) to do
3469 tab-completion on named function arguments. Submitted by George
3482 tab-completion on named function arguments. Submitted by George
3470 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3483 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
3471 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3484 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
3472 for more details.
3485 for more details.
3473
3486
3474 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3487 * IPython/Magic.py (magic_run): Added new -e flag to ignore
3475 SystemExit exceptions in the script being run. Thanks to a report
3488 SystemExit exceptions in the script being run. Thanks to a report
3476 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3489 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
3477 producing very annoying behavior when running unit tests.
3490 producing very annoying behavior when running unit tests.
3478
3491
3479 2005-05-12 Fernando Perez <fperez@colorado.edu>
3492 2005-05-12 Fernando Perez <fperez@colorado.edu>
3480
3493
3481 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3494 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
3482 which I'd broken (again) due to a changed regexp. In the process,
3495 which I'd broken (again) due to a changed regexp. In the process,
3483 added ';' as an escape to auto-quote the whole line without
3496 added ';' as an escape to auto-quote the whole line without
3484 splitting its arguments. Thanks to a report by Jerry McRae
3497 splitting its arguments. Thanks to a report by Jerry McRae
3485 <qrs0xyc02-AT-sneakemail.com>.
3498 <qrs0xyc02-AT-sneakemail.com>.
3486
3499
3487 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3500 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
3488 possible crashes caused by a TokenError. Reported by Ed Schofield
3501 possible crashes caused by a TokenError. Reported by Ed Schofield
3489 <schofield-AT-ftw.at>.
3502 <schofield-AT-ftw.at>.
3490
3503
3491 2005-05-06 Fernando Perez <fperez@colorado.edu>
3504 2005-05-06 Fernando Perez <fperez@colorado.edu>
3492
3505
3493 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3506 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
3494
3507
3495 2005-04-29 Fernando Perez <fperez@colorado.edu>
3508 2005-04-29 Fernando Perez <fperez@colorado.edu>
3496
3509
3497 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3510 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
3498 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3511 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
3499 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3512 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
3500 which provides support for Qt interactive usage (similar to the
3513 which provides support for Qt interactive usage (similar to the
3501 existing one for WX and GTK). This had been often requested.
3514 existing one for WX and GTK). This had been often requested.
3502
3515
3503 2005-04-14 *** Released version 0.6.13
3516 2005-04-14 *** Released version 0.6.13
3504
3517
3505 2005-04-08 Fernando Perez <fperez@colorado.edu>
3518 2005-04-08 Fernando Perez <fperez@colorado.edu>
3506
3519
3507 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3520 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
3508 from _ofind, which gets called on almost every input line. Now,
3521 from _ofind, which gets called on almost every input line. Now,
3509 we only try to get docstrings if they are actually going to be
3522 we only try to get docstrings if they are actually going to be
3510 used (the overhead of fetching unnecessary docstrings can be
3523 used (the overhead of fetching unnecessary docstrings can be
3511 noticeable for certain objects, such as Pyro proxies).
3524 noticeable for certain objects, such as Pyro proxies).
3512
3525
3513 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3526 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
3514 for completers. For some reason I had been passing them the state
3527 for completers. For some reason I had been passing them the state
3515 variable, which completers never actually need, and was in
3528 variable, which completers never actually need, and was in
3516 conflict with the rlcompleter API. Custom completers ONLY need to
3529 conflict with the rlcompleter API. Custom completers ONLY need to
3517 take the text parameter.
3530 take the text parameter.
3518
3531
3519 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3532 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
3520 work correctly in pysh. I've also moved all the logic which used
3533 work correctly in pysh. I've also moved all the logic which used
3521 to be in pysh.py here, which will prevent problems with future
3534 to be in pysh.py here, which will prevent problems with future
3522 upgrades. However, this time I must warn users to update their
3535 upgrades. However, this time I must warn users to update their
3523 pysh profile to include the line
3536 pysh profile to include the line
3524
3537
3525 import_all IPython.Extensions.InterpreterExec
3538 import_all IPython.Extensions.InterpreterExec
3526
3539
3527 because otherwise things won't work for them. They MUST also
3540 because otherwise things won't work for them. They MUST also
3528 delete pysh.py and the line
3541 delete pysh.py and the line
3529
3542
3530 execfile pysh.py
3543 execfile pysh.py
3531
3544
3532 from their ipythonrc-pysh.
3545 from their ipythonrc-pysh.
3533
3546
3534 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3547 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
3535 robust in the face of objects whose dir() returns non-strings
3548 robust in the face of objects whose dir() returns non-strings
3536 (which it shouldn't, but some broken libs like ITK do). Thanks to
3549 (which it shouldn't, but some broken libs like ITK do). Thanks to
3537 a patch by John Hunter (implemented differently, though). Also
3550 a patch by John Hunter (implemented differently, though). Also
3538 minor improvements by using .extend instead of + on lists.
3551 minor improvements by using .extend instead of + on lists.
3539
3552
3540 * pysh.py:
3553 * pysh.py:
3541
3554
3542 2005-04-06 Fernando Perez <fperez@colorado.edu>
3555 2005-04-06 Fernando Perez <fperez@colorado.edu>
3543
3556
3544 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3557 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
3545 by default, so that all users benefit from it. Those who don't
3558 by default, so that all users benefit from it. Those who don't
3546 want it can still turn it off.
3559 want it can still turn it off.
3547
3560
3548 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3561 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
3549 config file, I'd forgotten about this, so users were getting it
3562 config file, I'd forgotten about this, so users were getting it
3550 off by default.
3563 off by default.
3551
3564
3552 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3565 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
3553 consistency. Now magics can be called in multiline statements,
3566 consistency. Now magics can be called in multiline statements,
3554 and python variables can be expanded in magic calls via $var.
3567 and python variables can be expanded in magic calls via $var.
3555 This makes the magic system behave just like aliases or !system
3568 This makes the magic system behave just like aliases or !system
3556 calls.
3569 calls.
3557
3570
3558 2005-03-28 Fernando Perez <fperez@colorado.edu>
3571 2005-03-28 Fernando Perez <fperez@colorado.edu>
3559
3572
3560 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3573 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
3561 expensive string additions for building command. Add support for
3574 expensive string additions for building command. Add support for
3562 trailing ';' when autocall is used.
3575 trailing ';' when autocall is used.
3563
3576
3564 2005-03-26 Fernando Perez <fperez@colorado.edu>
3577 2005-03-26 Fernando Perez <fperez@colorado.edu>
3565
3578
3566 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3579 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
3567 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3580 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
3568 ipython.el robust against prompts with any number of spaces
3581 ipython.el robust against prompts with any number of spaces
3569 (including 0) after the ':' character.
3582 (including 0) after the ':' character.
3570
3583
3571 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3584 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
3572 continuation prompt, which misled users to think the line was
3585 continuation prompt, which misled users to think the line was
3573 already indented. Closes debian Bug#300847, reported to me by
3586 already indented. Closes debian Bug#300847, reported to me by
3574 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3587 Norbert Tretkowski <tretkowski-AT-inittab.de>.
3575
3588
3576 2005-03-23 Fernando Perez <fperez@colorado.edu>
3589 2005-03-23 Fernando Perez <fperez@colorado.edu>
3577
3590
3578 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3591 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
3579 properly aligned if they have embedded newlines.
3592 properly aligned if they have embedded newlines.
3580
3593
3581 * IPython/iplib.py (runlines): Add a public method to expose
3594 * IPython/iplib.py (runlines): Add a public method to expose
3582 IPython's code execution machinery, so that users can run strings
3595 IPython's code execution machinery, so that users can run strings
3583 as if they had been typed at the prompt interactively.
3596 as if they had been typed at the prompt interactively.
3584 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3597 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
3585 methods which can call the system shell, but with python variable
3598 methods which can call the system shell, but with python variable
3586 expansion. The three such methods are: __IPYTHON__.system,
3599 expansion. The three such methods are: __IPYTHON__.system,
3587 .getoutput and .getoutputerror. These need to be documented in a
3600 .getoutput and .getoutputerror. These need to be documented in a
3588 'public API' section (to be written) of the manual.
3601 'public API' section (to be written) of the manual.
3589
3602
3590 2005-03-20 Fernando Perez <fperez@colorado.edu>
3603 2005-03-20 Fernando Perez <fperez@colorado.edu>
3591
3604
3592 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3605 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
3593 for custom exception handling. This is quite powerful, and it
3606 for custom exception handling. This is quite powerful, and it
3594 allows for user-installable exception handlers which can trap
3607 allows for user-installable exception handlers which can trap
3595 custom exceptions at runtime and treat them separately from
3608 custom exceptions at runtime and treat them separately from
3596 IPython's default mechanisms. At the request of Frédéric
3609 IPython's default mechanisms. At the request of Frédéric
3597 Mantegazza <mantegazza-AT-ill.fr>.
3610 Mantegazza <mantegazza-AT-ill.fr>.
3598 (InteractiveShell.set_custom_completer): public API function to
3611 (InteractiveShell.set_custom_completer): public API function to
3599 add new completers at runtime.
3612 add new completers at runtime.
3600
3613
3601 2005-03-19 Fernando Perez <fperez@colorado.edu>
3614 2005-03-19 Fernando Perez <fperez@colorado.edu>
3602
3615
3603 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3616 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
3604 allow objects which provide their docstrings via non-standard
3617 allow objects which provide their docstrings via non-standard
3605 mechanisms (like Pyro proxies) to still be inspected by ipython's
3618 mechanisms (like Pyro proxies) to still be inspected by ipython's
3606 ? system.
3619 ? system.
3607
3620
3608 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3621 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
3609 automatic capture system. I tried quite hard to make it work
3622 automatic capture system. I tried quite hard to make it work
3610 reliably, and simply failed. I tried many combinations with the
3623 reliably, and simply failed. I tried many combinations with the
3611 subprocess module, but eventually nothing worked in all needed
3624 subprocess module, but eventually nothing worked in all needed
3612 cases (not blocking stdin for the child, duplicating stdout
3625 cases (not blocking stdin for the child, duplicating stdout
3613 without blocking, etc). The new %sc/%sx still do capture to these
3626 without blocking, etc). The new %sc/%sx still do capture to these
3614 magical list/string objects which make shell use much more
3627 magical list/string objects which make shell use much more
3615 conveninent, so not all is lost.
3628 conveninent, so not all is lost.
3616
3629
3617 XXX - FIX MANUAL for the change above!
3630 XXX - FIX MANUAL for the change above!
3618
3631
3619 (runsource): I copied code.py's runsource() into ipython to modify
3632 (runsource): I copied code.py's runsource() into ipython to modify
3620 it a bit. Now the code object and source to be executed are
3633 it a bit. Now the code object and source to be executed are
3621 stored in ipython. This makes this info accessible to third-party
3634 stored in ipython. This makes this info accessible to third-party
3622 tools, like custom exception handlers. After a request by Frédéric
3635 tools, like custom exception handlers. After a request by Frédéric
3623 Mantegazza <mantegazza-AT-ill.fr>.
3636 Mantegazza <mantegazza-AT-ill.fr>.
3624
3637
3625 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3638 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
3626 history-search via readline (like C-p/C-n). I'd wanted this for a
3639 history-search via readline (like C-p/C-n). I'd wanted this for a
3627 long time, but only recently found out how to do it. For users
3640 long time, but only recently found out how to do it. For users
3628 who already have their ipythonrc files made and want this, just
3641 who already have their ipythonrc files made and want this, just
3629 add:
3642 add:
3630
3643
3631 readline_parse_and_bind "\e[A": history-search-backward
3644 readline_parse_and_bind "\e[A": history-search-backward
3632 readline_parse_and_bind "\e[B": history-search-forward
3645 readline_parse_and_bind "\e[B": history-search-forward
3633
3646
3634 2005-03-18 Fernando Perez <fperez@colorado.edu>
3647 2005-03-18 Fernando Perez <fperez@colorado.edu>
3635
3648
3636 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3649 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
3637 LSString and SList classes which allow transparent conversions
3650 LSString and SList classes which allow transparent conversions
3638 between list mode and whitespace-separated string.
3651 between list mode and whitespace-separated string.
3639 (magic_r): Fix recursion problem in %r.
3652 (magic_r): Fix recursion problem in %r.
3640
3653
3641 * IPython/genutils.py (LSString): New class to be used for
3654 * IPython/genutils.py (LSString): New class to be used for
3642 automatic storage of the results of all alias/system calls in _o
3655 automatic storage of the results of all alias/system calls in _o
3643 and _e (stdout/err). These provide a .l/.list attribute which
3656 and _e (stdout/err). These provide a .l/.list attribute which
3644 does automatic splitting on newlines. This means that for most
3657 does automatic splitting on newlines. This means that for most
3645 uses, you'll never need to do capturing of output with %sc/%sx
3658 uses, you'll never need to do capturing of output with %sc/%sx
3646 anymore, since ipython keeps this always done for you. Note that
3659 anymore, since ipython keeps this always done for you. Note that
3647 only the LAST results are stored, the _o/e variables are
3660 only the LAST results are stored, the _o/e variables are
3648 overwritten on each call. If you need to save their contents
3661 overwritten on each call. If you need to save their contents
3649 further, simply bind them to any other name.
3662 further, simply bind them to any other name.
3650
3663
3651 2005-03-17 Fernando Perez <fperez@colorado.edu>
3664 2005-03-17 Fernando Perez <fperez@colorado.edu>
3652
3665
3653 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3666 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
3654 prompt namespace handling.
3667 prompt namespace handling.
3655
3668
3656 2005-03-16 Fernando Perez <fperez@colorado.edu>
3669 2005-03-16 Fernando Perez <fperez@colorado.edu>
3657
3670
3658 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3671 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
3659 classic prompts to be '>>> ' (final space was missing, and it
3672 classic prompts to be '>>> ' (final space was missing, and it
3660 trips the emacs python mode).
3673 trips the emacs python mode).
3661 (BasePrompt.__str__): Added safe support for dynamic prompt
3674 (BasePrompt.__str__): Added safe support for dynamic prompt
3662 strings. Now you can set your prompt string to be '$x', and the
3675 strings. Now you can set your prompt string to be '$x', and the
3663 value of x will be printed from your interactive namespace. The
3676 value of x will be printed from your interactive namespace. The
3664 interpolation syntax includes the full Itpl support, so
3677 interpolation syntax includes the full Itpl support, so
3665 ${foo()+x+bar()} is a valid prompt string now, and the function
3678 ${foo()+x+bar()} is a valid prompt string now, and the function
3666 calls will be made at runtime.
3679 calls will be made at runtime.
3667
3680
3668 2005-03-15 Fernando Perez <fperez@colorado.edu>
3681 2005-03-15 Fernando Perez <fperez@colorado.edu>
3669
3682
3670 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3683 * IPython/Magic.py (magic_history): renamed %hist to %history, to
3671 avoid name clashes in pylab. %hist still works, it just forwards
3684 avoid name clashes in pylab. %hist still works, it just forwards
3672 the call to %history.
3685 the call to %history.
3673
3686
3674 2005-03-02 *** Released version 0.6.12
3687 2005-03-02 *** Released version 0.6.12
3675
3688
3676 2005-03-02 Fernando Perez <fperez@colorado.edu>
3689 2005-03-02 Fernando Perez <fperez@colorado.edu>
3677
3690
3678 * IPython/iplib.py (handle_magic): log magic calls properly as
3691 * IPython/iplib.py (handle_magic): log magic calls properly as
3679 ipmagic() function calls.
3692 ipmagic() function calls.
3680
3693
3681 * IPython/Magic.py (magic_time): Improved %time to support
3694 * IPython/Magic.py (magic_time): Improved %time to support
3682 statements and provide wall-clock as well as CPU time.
3695 statements and provide wall-clock as well as CPU time.
3683
3696
3684 2005-02-27 Fernando Perez <fperez@colorado.edu>
3697 2005-02-27 Fernando Perez <fperez@colorado.edu>
3685
3698
3686 * IPython/hooks.py: New hooks module, to expose user-modifiable
3699 * IPython/hooks.py: New hooks module, to expose user-modifiable
3687 IPython functionality in a clean manner. For now only the editor
3700 IPython functionality in a clean manner. For now only the editor
3688 hook is actually written, and other thigns which I intend to turn
3701 hook is actually written, and other thigns which I intend to turn
3689 into proper hooks aren't yet there. The display and prefilter
3702 into proper hooks aren't yet there. The display and prefilter
3690 stuff, for example, should be hooks. But at least now the
3703 stuff, for example, should be hooks. But at least now the
3691 framework is in place, and the rest can be moved here with more
3704 framework is in place, and the rest can be moved here with more
3692 time later. IPython had had a .hooks variable for a long time for
3705 time later. IPython had had a .hooks variable for a long time for
3693 this purpose, but I'd never actually used it for anything.
3706 this purpose, but I'd never actually used it for anything.
3694
3707
3695 2005-02-26 Fernando Perez <fperez@colorado.edu>
3708 2005-02-26 Fernando Perez <fperez@colorado.edu>
3696
3709
3697 * IPython/ipmaker.py (make_IPython): make the default ipython
3710 * IPython/ipmaker.py (make_IPython): make the default ipython
3698 directory be called _ipython under win32, to follow more the
3711 directory be called _ipython under win32, to follow more the
3699 naming peculiarities of that platform (where buggy software like
3712 naming peculiarities of that platform (where buggy software like
3700 Visual Sourcesafe breaks with .named directories). Reported by
3713 Visual Sourcesafe breaks with .named directories). Reported by
3701 Ville Vainio.
3714 Ville Vainio.
3702
3715
3703 2005-02-23 Fernando Perez <fperez@colorado.edu>
3716 2005-02-23 Fernando Perez <fperez@colorado.edu>
3704
3717
3705 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3718 * IPython/iplib.py (InteractiveShell.__init__): removed a few
3706 auto_aliases for win32 which were causing problems. Users can
3719 auto_aliases for win32 which were causing problems. Users can
3707 define the ones they personally like.
3720 define the ones they personally like.
3708
3721
3709 2005-02-21 Fernando Perez <fperez@colorado.edu>
3722 2005-02-21 Fernando Perez <fperez@colorado.edu>
3710
3723
3711 * IPython/Magic.py (magic_time): new magic to time execution of
3724 * IPython/Magic.py (magic_time): new magic to time execution of
3712 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3725 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
3713
3726
3714 2005-02-19 Fernando Perez <fperez@colorado.edu>
3727 2005-02-19 Fernando Perez <fperez@colorado.edu>
3715
3728
3716 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3729 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
3717 into keys (for prompts, for example).
3730 into keys (for prompts, for example).
3718
3731
3719 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3732 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
3720 prompts in case users want them. This introduces a small behavior
3733 prompts in case users want them. This introduces a small behavior
3721 change: ipython does not automatically add a space to all prompts
3734 change: ipython does not automatically add a space to all prompts
3722 anymore. To get the old prompts with a space, users should add it
3735 anymore. To get the old prompts with a space, users should add it
3723 manually to their ipythonrc file, so for example prompt_in1 should
3736 manually to their ipythonrc file, so for example prompt_in1 should
3724 now read 'In [\#]: ' instead of 'In [\#]:'.
3737 now read 'In [\#]: ' instead of 'In [\#]:'.
3725 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3738 (BasePrompt.__init__): New option prompts_pad_left (only in rc
3726 file) to control left-padding of secondary prompts.
3739 file) to control left-padding of secondary prompts.
3727
3740
3728 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3741 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
3729 the profiler can't be imported. Fix for Debian, which removed
3742 the profiler can't be imported. Fix for Debian, which removed
3730 profile.py because of License issues. I applied a slightly
3743 profile.py because of License issues. I applied a slightly
3731 modified version of the original Debian patch at
3744 modified version of the original Debian patch at
3732 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3745 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
3733
3746
3734 2005-02-17 Fernando Perez <fperez@colorado.edu>
3747 2005-02-17 Fernando Perez <fperez@colorado.edu>
3735
3748
3736 * IPython/genutils.py (native_line_ends): Fix bug which would
3749 * IPython/genutils.py (native_line_ends): Fix bug which would
3737 cause improper line-ends under win32 b/c I was not opening files
3750 cause improper line-ends under win32 b/c I was not opening files
3738 in binary mode. Bug report and fix thanks to Ville.
3751 in binary mode. Bug report and fix thanks to Ville.
3739
3752
3740 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3753 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
3741 trying to catch spurious foo[1] autocalls. My fix actually broke
3754 trying to catch spurious foo[1] autocalls. My fix actually broke
3742 ',/' autoquote/call with explicit escape (bad regexp).
3755 ',/' autoquote/call with explicit escape (bad regexp).
3743
3756
3744 2005-02-15 *** Released version 0.6.11
3757 2005-02-15 *** Released version 0.6.11
3745
3758
3746 2005-02-14 Fernando Perez <fperez@colorado.edu>
3759 2005-02-14 Fernando Perez <fperez@colorado.edu>
3747
3760
3748 * IPython/background_jobs.py: New background job management
3761 * IPython/background_jobs.py: New background job management
3749 subsystem. This is implemented via a new set of classes, and
3762 subsystem. This is implemented via a new set of classes, and
3750 IPython now provides a builtin 'jobs' object for background job
3763 IPython now provides a builtin 'jobs' object for background job
3751 execution. A convenience %bg magic serves as a lightweight
3764 execution. A convenience %bg magic serves as a lightweight
3752 frontend for starting the more common type of calls. This was
3765 frontend for starting the more common type of calls. This was
3753 inspired by discussions with B. Granger and the BackgroundCommand
3766 inspired by discussions with B. Granger and the BackgroundCommand
3754 class described in the book Python Scripting for Computational
3767 class described in the book Python Scripting for Computational
3755 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3768 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
3756 (although ultimately no code from this text was used, as IPython's
3769 (although ultimately no code from this text was used, as IPython's
3757 system is a separate implementation).
3770 system is a separate implementation).
3758
3771
3759 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3772 * IPython/iplib.py (MagicCompleter.python_matches): add new option
3760 to control the completion of single/double underscore names
3773 to control the completion of single/double underscore names
3761 separately. As documented in the example ipytonrc file, the
3774 separately. As documented in the example ipytonrc file, the
3762 readline_omit__names variable can now be set to 2, to omit even
3775 readline_omit__names variable can now be set to 2, to omit even
3763 single underscore names. Thanks to a patch by Brian Wong
3776 single underscore names. Thanks to a patch by Brian Wong
3764 <BrianWong-AT-AirgoNetworks.Com>.
3777 <BrianWong-AT-AirgoNetworks.Com>.
3765 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3778 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
3766 be autocalled as foo([1]) if foo were callable. A problem for
3779 be autocalled as foo([1]) if foo were callable. A problem for
3767 things which are both callable and implement __getitem__.
3780 things which are both callable and implement __getitem__.
3768 (init_readline): Fix autoindentation for win32. Thanks to a patch
3781 (init_readline): Fix autoindentation for win32. Thanks to a patch
3769 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3782 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
3770
3783
3771 2005-02-12 Fernando Perez <fperez@colorado.edu>
3784 2005-02-12 Fernando Perez <fperez@colorado.edu>
3772
3785
3773 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3786 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
3774 which I had written long ago to sort out user error messages which
3787 which I had written long ago to sort out user error messages which
3775 may occur during startup. This seemed like a good idea initially,
3788 may occur during startup. This seemed like a good idea initially,
3776 but it has proven a disaster in retrospect. I don't want to
3789 but it has proven a disaster in retrospect. I don't want to
3777 change much code for now, so my fix is to set the internal 'debug'
3790 change much code for now, so my fix is to set the internal 'debug'
3778 flag to true everywhere, whose only job was precisely to control
3791 flag to true everywhere, whose only job was precisely to control
3779 this subsystem. This closes issue 28 (as well as avoiding all
3792 this subsystem. This closes issue 28 (as well as avoiding all
3780 sorts of strange hangups which occur from time to time).
3793 sorts of strange hangups which occur from time to time).
3781
3794
3782 2005-02-07 Fernando Perez <fperez@colorado.edu>
3795 2005-02-07 Fernando Perez <fperez@colorado.edu>
3783
3796
3784 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3797 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
3785 previous call produced a syntax error.
3798 previous call produced a syntax error.
3786
3799
3787 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3800 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3788 classes without constructor.
3801 classes without constructor.
3789
3802
3790 2005-02-06 Fernando Perez <fperez@colorado.edu>
3803 2005-02-06 Fernando Perez <fperez@colorado.edu>
3791
3804
3792 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3805 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
3793 completions with the results of each matcher, so we return results
3806 completions with the results of each matcher, so we return results
3794 to the user from all namespaces. This breaks with ipython
3807 to the user from all namespaces. This breaks with ipython
3795 tradition, but I think it's a nicer behavior. Now you get all
3808 tradition, but I think it's a nicer behavior. Now you get all
3796 possible completions listed, from all possible namespaces (python,
3809 possible completions listed, from all possible namespaces (python,
3797 filesystem, magics...) After a request by John Hunter
3810 filesystem, magics...) After a request by John Hunter
3798 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3811 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3799
3812
3800 2005-02-05 Fernando Perez <fperez@colorado.edu>
3813 2005-02-05 Fernando Perez <fperez@colorado.edu>
3801
3814
3802 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3815 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
3803 the call had quote characters in it (the quotes were stripped).
3816 the call had quote characters in it (the quotes were stripped).
3804
3817
3805 2005-01-31 Fernando Perez <fperez@colorado.edu>
3818 2005-01-31 Fernando Perez <fperez@colorado.edu>
3806
3819
3807 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3820 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
3808 Itpl.itpl() to make the code more robust against psyco
3821 Itpl.itpl() to make the code more robust against psyco
3809 optimizations.
3822 optimizations.
3810
3823
3811 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3824 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
3812 of causing an exception. Quicker, cleaner.
3825 of causing an exception. Quicker, cleaner.
3813
3826
3814 2005-01-28 Fernando Perez <fperez@colorado.edu>
3827 2005-01-28 Fernando Perez <fperez@colorado.edu>
3815
3828
3816 * scripts/ipython_win_post_install.py (install): hardcode
3829 * scripts/ipython_win_post_install.py (install): hardcode
3817 sys.prefix+'python.exe' as the executable path. It turns out that
3830 sys.prefix+'python.exe' as the executable path. It turns out that
3818 during the post-installation run, sys.executable resolves to the
3831 during the post-installation run, sys.executable resolves to the
3819 name of the binary installer! I should report this as a distutils
3832 name of the binary installer! I should report this as a distutils
3820 bug, I think. I updated the .10 release with this tiny fix, to
3833 bug, I think. I updated the .10 release with this tiny fix, to
3821 avoid annoying the lists further.
3834 avoid annoying the lists further.
3822
3835
3823 2005-01-27 *** Released version 0.6.10
3836 2005-01-27 *** Released version 0.6.10
3824
3837
3825 2005-01-27 Fernando Perez <fperez@colorado.edu>
3838 2005-01-27 Fernando Perez <fperez@colorado.edu>
3826
3839
3827 * IPython/numutils.py (norm): Added 'inf' as optional name for
3840 * IPython/numutils.py (norm): Added 'inf' as optional name for
3828 L-infinity norm, included references to mathworld.com for vector
3841 L-infinity norm, included references to mathworld.com for vector
3829 norm definitions.
3842 norm definitions.
3830 (amin/amax): added amin/amax for array min/max. Similar to what
3843 (amin/amax): added amin/amax for array min/max. Similar to what
3831 pylab ships with after the recent reorganization of names.
3844 pylab ships with after the recent reorganization of names.
3832 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3845 (spike/spike_odd): removed deprecated spike/spike_odd functions.
3833
3846
3834 * ipython.el: committed Alex's recent fixes and improvements.
3847 * ipython.el: committed Alex's recent fixes and improvements.
3835 Tested with python-mode from CVS, and it looks excellent. Since
3848 Tested with python-mode from CVS, and it looks excellent. Since
3836 python-mode hasn't released anything in a while, I'm temporarily
3849 python-mode hasn't released anything in a while, I'm temporarily
3837 putting a copy of today's CVS (v 4.70) of python-mode in:
3850 putting a copy of today's CVS (v 4.70) of python-mode in:
3838 http://ipython.scipy.org/tmp/python-mode.el
3851 http://ipython.scipy.org/tmp/python-mode.el
3839
3852
3840 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3853 * scripts/ipython_win_post_install.py (install): Win32 fix to use
3841 sys.executable for the executable name, instead of assuming it's
3854 sys.executable for the executable name, instead of assuming it's
3842 called 'python.exe' (the post-installer would have produced broken
3855 called 'python.exe' (the post-installer would have produced broken
3843 setups on systems with a differently named python binary).
3856 setups on systems with a differently named python binary).
3844
3857
3845 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3858 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
3846 references to os.linesep, to make the code more
3859 references to os.linesep, to make the code more
3847 platform-independent. This is also part of the win32 coloring
3860 platform-independent. This is also part of the win32 coloring
3848 fixes.
3861 fixes.
3849
3862
3850 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3863 * IPython/genutils.py (page_dumb): Remove attempts to chop long
3851 lines, which actually cause coloring bugs because the length of
3864 lines, which actually cause coloring bugs because the length of
3852 the line is very difficult to correctly compute with embedded
3865 the line is very difficult to correctly compute with embedded
3853 escapes. This was the source of all the coloring problems under
3866 escapes. This was the source of all the coloring problems under
3854 Win32. I think that _finally_, Win32 users have a properly
3867 Win32. I think that _finally_, Win32 users have a properly
3855 working ipython in all respects. This would never have happened
3868 working ipython in all respects. This would never have happened
3856 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3869 if not for Gary Bishop and Viktor Ransmayr's great help and work.
3857
3870
3858 2005-01-26 *** Released version 0.6.9
3871 2005-01-26 *** Released version 0.6.9
3859
3872
3860 2005-01-25 Fernando Perez <fperez@colorado.edu>
3873 2005-01-25 Fernando Perez <fperez@colorado.edu>
3861
3874
3862 * setup.py: finally, we have a true Windows installer, thanks to
3875 * setup.py: finally, we have a true Windows installer, thanks to
3863 the excellent work of Viktor Ransmayr
3876 the excellent work of Viktor Ransmayr
3864 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3877 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
3865 Windows users. The setup routine is quite a bit cleaner thanks to
3878 Windows users. The setup routine is quite a bit cleaner thanks to
3866 this, and the post-install script uses the proper functions to
3879 this, and the post-install script uses the proper functions to
3867 allow a clean de-installation using the standard Windows Control
3880 allow a clean de-installation using the standard Windows Control
3868 Panel.
3881 Panel.
3869
3882
3870 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3883 * IPython/genutils.py (get_home_dir): changed to use the $HOME
3871 environment variable under all OSes (including win32) if
3884 environment variable under all OSes (including win32) if
3872 available. This will give consistency to win32 users who have set
3885 available. This will give consistency to win32 users who have set
3873 this variable for any reason. If os.environ['HOME'] fails, the
3886 this variable for any reason. If os.environ['HOME'] fails, the
3874 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3887 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
3875
3888
3876 2005-01-24 Fernando Perez <fperez@colorado.edu>
3889 2005-01-24 Fernando Perez <fperez@colorado.edu>
3877
3890
3878 * IPython/numutils.py (empty_like): add empty_like(), similar to
3891 * IPython/numutils.py (empty_like): add empty_like(), similar to
3879 zeros_like() but taking advantage of the new empty() Numeric routine.
3892 zeros_like() but taking advantage of the new empty() Numeric routine.
3880
3893
3881 2005-01-23 *** Released version 0.6.8
3894 2005-01-23 *** Released version 0.6.8
3882
3895
3883 2005-01-22 Fernando Perez <fperez@colorado.edu>
3896 2005-01-22 Fernando Perez <fperez@colorado.edu>
3884
3897
3885 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3898 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
3886 automatic show() calls. After discussing things with JDH, it
3899 automatic show() calls. After discussing things with JDH, it
3887 turns out there are too many corner cases where this can go wrong.
3900 turns out there are too many corner cases where this can go wrong.
3888 It's best not to try to be 'too smart', and simply have ipython
3901 It's best not to try to be 'too smart', and simply have ipython
3889 reproduce as much as possible the default behavior of a normal
3902 reproduce as much as possible the default behavior of a normal
3890 python shell.
3903 python shell.
3891
3904
3892 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3905 * IPython/iplib.py (InteractiveShell.__init__): Modified the
3893 line-splitting regexp and _prefilter() to avoid calling getattr()
3906 line-splitting regexp and _prefilter() to avoid calling getattr()
3894 on assignments. This closes
3907 on assignments. This closes
3895 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3908 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
3896 readline uses getattr(), so a simple <TAB> keypress is still
3909 readline uses getattr(), so a simple <TAB> keypress is still
3897 enough to trigger getattr() calls on an object.
3910 enough to trigger getattr() calls on an object.
3898
3911
3899 2005-01-21 Fernando Perez <fperez@colorado.edu>
3912 2005-01-21 Fernando Perez <fperez@colorado.edu>
3900
3913
3901 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3914 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
3902 docstring under pylab so it doesn't mask the original.
3915 docstring under pylab so it doesn't mask the original.
3903
3916
3904 2005-01-21 *** Released version 0.6.7
3917 2005-01-21 *** Released version 0.6.7
3905
3918
3906 2005-01-21 Fernando Perez <fperez@colorado.edu>
3919 2005-01-21 Fernando Perez <fperez@colorado.edu>
3907
3920
3908 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3921 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
3909 signal handling for win32 users in multithreaded mode.
3922 signal handling for win32 users in multithreaded mode.
3910
3923
3911 2005-01-17 Fernando Perez <fperez@colorado.edu>
3924 2005-01-17 Fernando Perez <fperez@colorado.edu>
3912
3925
3913 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3926 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
3914 instances with no __init__. After a crash report by Norbert Nemec
3927 instances with no __init__. After a crash report by Norbert Nemec
3915 <Norbert-AT-nemec-online.de>.
3928 <Norbert-AT-nemec-online.de>.
3916
3929
3917 2005-01-14 Fernando Perez <fperez@colorado.edu>
3930 2005-01-14 Fernando Perez <fperez@colorado.edu>
3918
3931
3919 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3932 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
3920 names for verbose exceptions, when multiple dotted names and the
3933 names for verbose exceptions, when multiple dotted names and the
3921 'parent' object were present on the same line.
3934 'parent' object were present on the same line.
3922
3935
3923 2005-01-11 Fernando Perez <fperez@colorado.edu>
3936 2005-01-11 Fernando Perez <fperez@colorado.edu>
3924
3937
3925 * IPython/genutils.py (flag_calls): new utility to trap and flag
3938 * IPython/genutils.py (flag_calls): new utility to trap and flag
3926 calls in functions. I need it to clean up matplotlib support.
3939 calls in functions. I need it to clean up matplotlib support.
3927 Also removed some deprecated code in genutils.
3940 Also removed some deprecated code in genutils.
3928
3941
3929 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3942 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
3930 that matplotlib scripts called with %run, which don't call show()
3943 that matplotlib scripts called with %run, which don't call show()
3931 themselves, still have their plotting windows open.
3944 themselves, still have their plotting windows open.
3932
3945
3933 2005-01-05 Fernando Perez <fperez@colorado.edu>
3946 2005-01-05 Fernando Perez <fperez@colorado.edu>
3934
3947
3935 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3948 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
3936 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3949 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
3937
3950
3938 2004-12-19 Fernando Perez <fperez@colorado.edu>
3951 2004-12-19 Fernando Perez <fperez@colorado.edu>
3939
3952
3940 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3953 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
3941 parent_runcode, which was an eyesore. The same result can be
3954 parent_runcode, which was an eyesore. The same result can be
3942 obtained with Python's regular superclass mechanisms.
3955 obtained with Python's regular superclass mechanisms.
3943
3956
3944 2004-12-17 Fernando Perez <fperez@colorado.edu>
3957 2004-12-17 Fernando Perez <fperez@colorado.edu>
3945
3958
3946 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3959 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
3947 reported by Prabhu.
3960 reported by Prabhu.
3948 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3961 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
3949 sys.stderr) instead of explicitly calling sys.stderr. This helps
3962 sys.stderr) instead of explicitly calling sys.stderr. This helps
3950 maintain our I/O abstractions clean, for future GUI embeddings.
3963 maintain our I/O abstractions clean, for future GUI embeddings.
3951
3964
3952 * IPython/genutils.py (info): added new utility for sys.stderr
3965 * IPython/genutils.py (info): added new utility for sys.stderr
3953 unified info message handling (thin wrapper around warn()).
3966 unified info message handling (thin wrapper around warn()).
3954
3967
3955 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3968 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
3956 composite (dotted) names on verbose exceptions.
3969 composite (dotted) names on verbose exceptions.
3957 (VerboseTB.nullrepr): harden against another kind of errors which
3970 (VerboseTB.nullrepr): harden against another kind of errors which
3958 Python's inspect module can trigger, and which were crashing
3971 Python's inspect module can trigger, and which were crashing
3959 IPython. Thanks to a report by Marco Lombardi
3972 IPython. Thanks to a report by Marco Lombardi
3960 <mlombard-AT-ma010192.hq.eso.org>.
3973 <mlombard-AT-ma010192.hq.eso.org>.
3961
3974
3962 2004-12-13 *** Released version 0.6.6
3975 2004-12-13 *** Released version 0.6.6
3963
3976
3964 2004-12-12 Fernando Perez <fperez@colorado.edu>
3977 2004-12-12 Fernando Perez <fperez@colorado.edu>
3965
3978
3966 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3979 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
3967 generated by pygtk upon initialization if it was built without
3980 generated by pygtk upon initialization if it was built without
3968 threads (for matplotlib users). After a crash reported by
3981 threads (for matplotlib users). After a crash reported by
3969 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3982 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
3970
3983
3971 * IPython/ipmaker.py (make_IPython): fix small bug in the
3984 * IPython/ipmaker.py (make_IPython): fix small bug in the
3972 import_some parameter for multiple imports.
3985 import_some parameter for multiple imports.
3973
3986
3974 * IPython/iplib.py (ipmagic): simplified the interface of
3987 * IPython/iplib.py (ipmagic): simplified the interface of
3975 ipmagic() to take a single string argument, just as it would be
3988 ipmagic() to take a single string argument, just as it would be
3976 typed at the IPython cmd line.
3989 typed at the IPython cmd line.
3977 (ipalias): Added new ipalias() with an interface identical to
3990 (ipalias): Added new ipalias() with an interface identical to
3978 ipmagic(). This completes exposing a pure python interface to the
3991 ipmagic(). This completes exposing a pure python interface to the
3979 alias and magic system, which can be used in loops or more complex
3992 alias and magic system, which can be used in loops or more complex
3980 code where IPython's automatic line mangling is not active.
3993 code where IPython's automatic line mangling is not active.
3981
3994
3982 * IPython/genutils.py (timing): changed interface of timing to
3995 * IPython/genutils.py (timing): changed interface of timing to
3983 simply run code once, which is the most common case. timings()
3996 simply run code once, which is the most common case. timings()
3984 remains unchanged, for the cases where you want multiple runs.
3997 remains unchanged, for the cases where you want multiple runs.
3985
3998
3986 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3999 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
3987 bug where Python2.2 crashes with exec'ing code which does not end
4000 bug where Python2.2 crashes with exec'ing code which does not end
3988 in a single newline. Python 2.3 is OK, so I hadn't noticed this
4001 in a single newline. Python 2.3 is OK, so I hadn't noticed this
3989 before.
4002 before.
3990
4003
3991 2004-12-10 Fernando Perez <fperez@colorado.edu>
4004 2004-12-10 Fernando Perez <fperez@colorado.edu>
3992
4005
3993 * IPython/Magic.py (Magic.magic_prun): changed name of option from
4006 * IPython/Magic.py (Magic.magic_prun): changed name of option from
3994 -t to -T, to accomodate the new -t flag in %run (the %run and
4007 -t to -T, to accomodate the new -t flag in %run (the %run and
3995 %prun options are kind of intermixed, and it's not easy to change
4008 %prun options are kind of intermixed, and it's not easy to change
3996 this with the limitations of python's getopt).
4009 this with the limitations of python's getopt).
3997
4010
3998 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
4011 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
3999 the execution of scripts. It's not as fine-tuned as timeit.py,
4012 the execution of scripts. It's not as fine-tuned as timeit.py,
4000 but it works from inside ipython (and under 2.2, which lacks
4013 but it works from inside ipython (and under 2.2, which lacks
4001 timeit.py). Optionally a number of runs > 1 can be given for
4014 timeit.py). Optionally a number of runs > 1 can be given for
4002 timing very short-running code.
4015 timing very short-running code.
4003
4016
4004 * IPython/genutils.py (uniq_stable): new routine which returns a
4017 * IPython/genutils.py (uniq_stable): new routine which returns a
4005 list of unique elements in any iterable, but in stable order of
4018 list of unique elements in any iterable, but in stable order of
4006 appearance. I needed this for the ultraTB fixes, and it's a handy
4019 appearance. I needed this for the ultraTB fixes, and it's a handy
4007 utility.
4020 utility.
4008
4021
4009 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
4022 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
4010 dotted names in Verbose exceptions. This had been broken since
4023 dotted names in Verbose exceptions. This had been broken since
4011 the very start, now x.y will properly be printed in a Verbose
4024 the very start, now x.y will properly be printed in a Verbose
4012 traceback, instead of x being shown and y appearing always as an
4025 traceback, instead of x being shown and y appearing always as an
4013 'undefined global'. Getting this to work was a bit tricky,
4026 'undefined global'. Getting this to work was a bit tricky,
4014 because by default python tokenizers are stateless. Saved by
4027 because by default python tokenizers are stateless. Saved by
4015 python's ability to easily add a bit of state to an arbitrary
4028 python's ability to easily add a bit of state to an arbitrary
4016 function (without needing to build a full-blown callable object).
4029 function (without needing to build a full-blown callable object).
4017
4030
4018 Also big cleanup of this code, which had horrendous runtime
4031 Also big cleanup of this code, which had horrendous runtime
4019 lookups of zillions of attributes for colorization. Moved all
4032 lookups of zillions of attributes for colorization. Moved all
4020 this code into a few templates, which make it cleaner and quicker.
4033 this code into a few templates, which make it cleaner and quicker.
4021
4034
4022 Printout quality was also improved for Verbose exceptions: one
4035 Printout quality was also improved for Verbose exceptions: one
4023 variable per line, and memory addresses are printed (this can be
4036 variable per line, and memory addresses are printed (this can be
4024 quite handy in nasty debugging situations, which is what Verbose
4037 quite handy in nasty debugging situations, which is what Verbose
4025 is for).
4038 is for).
4026
4039
4027 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
4040 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
4028 the command line as scripts to be loaded by embedded instances.
4041 the command line as scripts to be loaded by embedded instances.
4029 Doing so has the potential for an infinite recursion if there are
4042 Doing so has the potential for an infinite recursion if there are
4030 exceptions thrown in the process. This fixes a strange crash
4043 exceptions thrown in the process. This fixes a strange crash
4031 reported by Philippe MULLER <muller-AT-irit.fr>.
4044 reported by Philippe MULLER <muller-AT-irit.fr>.
4032
4045
4033 2004-12-09 Fernando Perez <fperez@colorado.edu>
4046 2004-12-09 Fernando Perez <fperez@colorado.edu>
4034
4047
4035 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
4048 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
4036 to reflect new names in matplotlib, which now expose the
4049 to reflect new names in matplotlib, which now expose the
4037 matlab-compatible interface via a pylab module instead of the
4050 matlab-compatible interface via a pylab module instead of the
4038 'matlab' name. The new code is backwards compatible, so users of
4051 'matlab' name. The new code is backwards compatible, so users of
4039 all matplotlib versions are OK. Patch by J. Hunter.
4052 all matplotlib versions are OK. Patch by J. Hunter.
4040
4053
4041 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
4054 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
4042 of __init__ docstrings for instances (class docstrings are already
4055 of __init__ docstrings for instances (class docstrings are already
4043 automatically printed). Instances with customized docstrings
4056 automatically printed). Instances with customized docstrings
4044 (indep. of the class) are also recognized and all 3 separate
4057 (indep. of the class) are also recognized and all 3 separate
4045 docstrings are printed (instance, class, constructor). After some
4058 docstrings are printed (instance, class, constructor). After some
4046 comments/suggestions by J. Hunter.
4059 comments/suggestions by J. Hunter.
4047
4060
4048 2004-12-05 Fernando Perez <fperez@colorado.edu>
4061 2004-12-05 Fernando Perez <fperez@colorado.edu>
4049
4062
4050 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
4063 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
4051 warnings when tab-completion fails and triggers an exception.
4064 warnings when tab-completion fails and triggers an exception.
4052
4065
4053 2004-12-03 Fernando Perez <fperez@colorado.edu>
4066 2004-12-03 Fernando Perez <fperez@colorado.edu>
4054
4067
4055 * IPython/Magic.py (magic_prun): Fix bug where an exception would
4068 * IPython/Magic.py (magic_prun): Fix bug where an exception would
4056 be triggered when using 'run -p'. An incorrect option flag was
4069 be triggered when using 'run -p'. An incorrect option flag was
4057 being set ('d' instead of 'D').
4070 being set ('d' instead of 'D').
4058 (manpage): fix missing escaped \- sign.
4071 (manpage): fix missing escaped \- sign.
4059
4072
4060 2004-11-30 *** Released version 0.6.5
4073 2004-11-30 *** Released version 0.6.5
4061
4074
4062 2004-11-30 Fernando Perez <fperez@colorado.edu>
4075 2004-11-30 Fernando Perez <fperez@colorado.edu>
4063
4076
4064 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
4077 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
4065 setting with -d option.
4078 setting with -d option.
4066
4079
4067 * setup.py (docfiles): Fix problem where the doc glob I was using
4080 * setup.py (docfiles): Fix problem where the doc glob I was using
4068 was COMPLETELY BROKEN. It was giving the right files by pure
4081 was COMPLETELY BROKEN. It was giving the right files by pure
4069 accident, but failed once I tried to include ipython.el. Note:
4082 accident, but failed once I tried to include ipython.el. Note:
4070 glob() does NOT allow you to do exclusion on multiple endings!
4083 glob() does NOT allow you to do exclusion on multiple endings!
4071
4084
4072 2004-11-29 Fernando Perez <fperez@colorado.edu>
4085 2004-11-29 Fernando Perez <fperez@colorado.edu>
4073
4086
4074 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
4087 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
4075 the manpage as the source. Better formatting & consistency.
4088 the manpage as the source. Better formatting & consistency.
4076
4089
4077 * IPython/Magic.py (magic_run): Added new -d option, to run
4090 * IPython/Magic.py (magic_run): Added new -d option, to run
4078 scripts under the control of the python pdb debugger. Note that
4091 scripts under the control of the python pdb debugger. Note that
4079 this required changing the %prun option -d to -D, to avoid a clash
4092 this required changing the %prun option -d to -D, to avoid a clash
4080 (since %run must pass options to %prun, and getopt is too dumb to
4093 (since %run must pass options to %prun, and getopt is too dumb to
4081 handle options with string values with embedded spaces). Thanks
4094 handle options with string values with embedded spaces). Thanks
4082 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
4095 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
4083 (magic_who_ls): added type matching to %who and %whos, so that one
4096 (magic_who_ls): added type matching to %who and %whos, so that one
4084 can filter their output to only include variables of certain
4097 can filter their output to only include variables of certain
4085 types. Another suggestion by Matthew.
4098 types. Another suggestion by Matthew.
4086 (magic_whos): Added memory summaries in kb and Mb for arrays.
4099 (magic_whos): Added memory summaries in kb and Mb for arrays.
4087 (magic_who): Improve formatting (break lines every 9 vars).
4100 (magic_who): Improve formatting (break lines every 9 vars).
4088
4101
4089 2004-11-28 Fernando Perez <fperez@colorado.edu>
4102 2004-11-28 Fernando Perez <fperez@colorado.edu>
4090
4103
4091 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
4104 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
4092 cache when empty lines were present.
4105 cache when empty lines were present.
4093
4106
4094 2004-11-24 Fernando Perez <fperez@colorado.edu>
4107 2004-11-24 Fernando Perez <fperez@colorado.edu>
4095
4108
4096 * IPython/usage.py (__doc__): document the re-activated threading
4109 * IPython/usage.py (__doc__): document the re-activated threading
4097 options for WX and GTK.
4110 options for WX and GTK.
4098
4111
4099 2004-11-23 Fernando Perez <fperez@colorado.edu>
4112 2004-11-23 Fernando Perez <fperez@colorado.edu>
4100
4113
4101 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
4114 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
4102 the -wthread and -gthread options, along with a new -tk one to try
4115 the -wthread and -gthread options, along with a new -tk one to try
4103 and coordinate Tk threading with wx/gtk. The tk support is very
4116 and coordinate Tk threading with wx/gtk. The tk support is very
4104 platform dependent, since it seems to require Tcl and Tk to be
4117 platform dependent, since it seems to require Tcl and Tk to be
4105 built with threads (Fedora1/2 appears NOT to have it, but in
4118 built with threads (Fedora1/2 appears NOT to have it, but in
4106 Prabhu's Debian boxes it works OK). But even with some Tk
4119 Prabhu's Debian boxes it works OK). But even with some Tk
4107 limitations, this is a great improvement.
4120 limitations, this is a great improvement.
4108
4121
4109 * IPython/Prompts.py (prompt_specials_color): Added \t for time
4122 * IPython/Prompts.py (prompt_specials_color): Added \t for time
4110 info in user prompts. Patch by Prabhu.
4123 info in user prompts. Patch by Prabhu.
4111
4124
4112 2004-11-18 Fernando Perez <fperez@colorado.edu>
4125 2004-11-18 Fernando Perez <fperez@colorado.edu>
4113
4126
4114 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
4127 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
4115 EOFErrors and bail, to avoid infinite loops if a non-terminating
4128 EOFErrors and bail, to avoid infinite loops if a non-terminating
4116 file is fed into ipython. Patch submitted in issue 19 by user,
4129 file is fed into ipython. Patch submitted in issue 19 by user,
4117 many thanks.
4130 many thanks.
4118
4131
4119 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
4132 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
4120 autoquote/parens in continuation prompts, which can cause lots of
4133 autoquote/parens in continuation prompts, which can cause lots of
4121 problems. Closes roundup issue 20.
4134 problems. Closes roundup issue 20.
4122
4135
4123 2004-11-17 Fernando Perez <fperez@colorado.edu>
4136 2004-11-17 Fernando Perez <fperez@colorado.edu>
4124
4137
4125 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
4138 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
4126 reported as debian bug #280505. I'm not sure my local changelog
4139 reported as debian bug #280505. I'm not sure my local changelog
4127 entry has the proper debian format (Jack?).
4140 entry has the proper debian format (Jack?).
4128
4141
4129 2004-11-08 *** Released version 0.6.4
4142 2004-11-08 *** Released version 0.6.4
4130
4143
4131 2004-11-08 Fernando Perez <fperez@colorado.edu>
4144 2004-11-08 Fernando Perez <fperez@colorado.edu>
4132
4145
4133 * IPython/iplib.py (init_readline): Fix exit message for Windows
4146 * IPython/iplib.py (init_readline): Fix exit message for Windows
4134 when readline is active. Thanks to a report by Eric Jones
4147 when readline is active. Thanks to a report by Eric Jones
4135 <eric-AT-enthought.com>.
4148 <eric-AT-enthought.com>.
4136
4149
4137 2004-11-07 Fernando Perez <fperez@colorado.edu>
4150 2004-11-07 Fernando Perez <fperez@colorado.edu>
4138
4151
4139 * IPython/genutils.py (page): Add a trap for OSError exceptions,
4152 * IPython/genutils.py (page): Add a trap for OSError exceptions,
4140 sometimes seen by win2k/cygwin users.
4153 sometimes seen by win2k/cygwin users.
4141
4154
4142 2004-11-06 Fernando Perez <fperez@colorado.edu>
4155 2004-11-06 Fernando Perez <fperez@colorado.edu>
4143
4156
4144 * IPython/iplib.py (interact): Change the handling of %Exit from
4157 * IPython/iplib.py (interact): Change the handling of %Exit from
4145 trying to propagate a SystemExit to an internal ipython flag.
4158 trying to propagate a SystemExit to an internal ipython flag.
4146 This is less elegant than using Python's exception mechanism, but
4159 This is less elegant than using Python's exception mechanism, but
4147 I can't get that to work reliably with threads, so under -pylab
4160 I can't get that to work reliably with threads, so under -pylab
4148 %Exit was hanging IPython. Cross-thread exception handling is
4161 %Exit was hanging IPython. Cross-thread exception handling is
4149 really a bitch. Thaks to a bug report by Stephen Walton
4162 really a bitch. Thaks to a bug report by Stephen Walton
4150 <stephen.walton-AT-csun.edu>.
4163 <stephen.walton-AT-csun.edu>.
4151
4164
4152 2004-11-04 Fernando Perez <fperez@colorado.edu>
4165 2004-11-04 Fernando Perez <fperez@colorado.edu>
4153
4166
4154 * IPython/iplib.py (raw_input_original): store a pointer to the
4167 * IPython/iplib.py (raw_input_original): store a pointer to the
4155 true raw_input to harden against code which can modify it
4168 true raw_input to harden against code which can modify it
4156 (wx.py.PyShell does this and would otherwise crash ipython).
4169 (wx.py.PyShell does this and would otherwise crash ipython).
4157 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
4170 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
4158
4171
4159 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
4172 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
4160 Ctrl-C problem, which does not mess up the input line.
4173 Ctrl-C problem, which does not mess up the input line.
4161
4174
4162 2004-11-03 Fernando Perez <fperez@colorado.edu>
4175 2004-11-03 Fernando Perez <fperez@colorado.edu>
4163
4176
4164 * IPython/Release.py: Changed licensing to BSD, in all files.
4177 * IPython/Release.py: Changed licensing to BSD, in all files.
4165 (name): lowercase name for tarball/RPM release.
4178 (name): lowercase name for tarball/RPM release.
4166
4179
4167 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
4180 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
4168 use throughout ipython.
4181 use throughout ipython.
4169
4182
4170 * IPython/Magic.py (Magic._ofind): Switch to using the new
4183 * IPython/Magic.py (Magic._ofind): Switch to using the new
4171 OInspect.getdoc() function.
4184 OInspect.getdoc() function.
4172
4185
4173 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
4186 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
4174 of the line currently being canceled via Ctrl-C. It's extremely
4187 of the line currently being canceled via Ctrl-C. It's extremely
4175 ugly, but I don't know how to do it better (the problem is one of
4188 ugly, but I don't know how to do it better (the problem is one of
4176 handling cross-thread exceptions).
4189 handling cross-thread exceptions).
4177
4190
4178 2004-10-28 Fernando Perez <fperez@colorado.edu>
4191 2004-10-28 Fernando Perez <fperez@colorado.edu>
4179
4192
4180 * IPython/Shell.py (signal_handler): add signal handlers to trap
4193 * IPython/Shell.py (signal_handler): add signal handlers to trap
4181 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
4194 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
4182 report by Francesc Alted.
4195 report by Francesc Alted.
4183
4196
4184 2004-10-21 Fernando Perez <fperez@colorado.edu>
4197 2004-10-21 Fernando Perez <fperez@colorado.edu>
4185
4198
4186 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
4199 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
4187 to % for pysh syntax extensions.
4200 to % for pysh syntax extensions.
4188
4201
4189 2004-10-09 Fernando Perez <fperez@colorado.edu>
4202 2004-10-09 Fernando Perez <fperez@colorado.edu>
4190
4203
4191 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
4204 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
4192 arrays to print a more useful summary, without calling str(arr).
4205 arrays to print a more useful summary, without calling str(arr).
4193 This avoids the problem of extremely lengthy computations which
4206 This avoids the problem of extremely lengthy computations which
4194 occur if arr is large, and appear to the user as a system lockup
4207 occur if arr is large, and appear to the user as a system lockup
4195 with 100% cpu activity. After a suggestion by Kristian Sandberg
4208 with 100% cpu activity. After a suggestion by Kristian Sandberg
4196 <Kristian.Sandberg@colorado.edu>.
4209 <Kristian.Sandberg@colorado.edu>.
4197 (Magic.__init__): fix bug in global magic escapes not being
4210 (Magic.__init__): fix bug in global magic escapes not being
4198 correctly set.
4211 correctly set.
4199
4212
4200 2004-10-08 Fernando Perez <fperez@colorado.edu>
4213 2004-10-08 Fernando Perez <fperez@colorado.edu>
4201
4214
4202 * IPython/Magic.py (__license__): change to absolute imports of
4215 * IPython/Magic.py (__license__): change to absolute imports of
4203 ipython's own internal packages, to start adapting to the absolute
4216 ipython's own internal packages, to start adapting to the absolute
4204 import requirement of PEP-328.
4217 import requirement of PEP-328.
4205
4218
4206 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
4219 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
4207 files, and standardize author/license marks through the Release
4220 files, and standardize author/license marks through the Release
4208 module instead of having per/file stuff (except for files with
4221 module instead of having per/file stuff (except for files with
4209 particular licenses, like the MIT/PSF-licensed codes).
4222 particular licenses, like the MIT/PSF-licensed codes).
4210
4223
4211 * IPython/Debugger.py: remove dead code for python 2.1
4224 * IPython/Debugger.py: remove dead code for python 2.1
4212
4225
4213 2004-10-04 Fernando Perez <fperez@colorado.edu>
4226 2004-10-04 Fernando Perez <fperez@colorado.edu>
4214
4227
4215 * IPython/iplib.py (ipmagic): New function for accessing magics
4228 * IPython/iplib.py (ipmagic): New function for accessing magics
4216 via a normal python function call.
4229 via a normal python function call.
4217
4230
4218 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
4231 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
4219 from '@' to '%', to accomodate the new @decorator syntax of python
4232 from '@' to '%', to accomodate the new @decorator syntax of python
4220 2.4.
4233 2.4.
4221
4234
4222 2004-09-29 Fernando Perez <fperez@colorado.edu>
4235 2004-09-29 Fernando Perez <fperez@colorado.edu>
4223
4236
4224 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
4237 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
4225 matplotlib.use to prevent running scripts which try to switch
4238 matplotlib.use to prevent running scripts which try to switch
4226 interactive backends from within ipython. This will just crash
4239 interactive backends from within ipython. This will just crash
4227 the python interpreter, so we can't allow it (but a detailed error
4240 the python interpreter, so we can't allow it (but a detailed error
4228 is given to the user).
4241 is given to the user).
4229
4242
4230 2004-09-28 Fernando Perez <fperez@colorado.edu>
4243 2004-09-28 Fernando Perez <fperez@colorado.edu>
4231
4244
4232 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
4245 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
4233 matplotlib-related fixes so that using @run with non-matplotlib
4246 matplotlib-related fixes so that using @run with non-matplotlib
4234 scripts doesn't pop up spurious plot windows. This requires
4247 scripts doesn't pop up spurious plot windows. This requires
4235 matplotlib >= 0.63, where I had to make some changes as well.
4248 matplotlib >= 0.63, where I had to make some changes as well.
4236
4249
4237 * IPython/ipmaker.py (make_IPython): update version requirement to
4250 * IPython/ipmaker.py (make_IPython): update version requirement to
4238 python 2.2.
4251 python 2.2.
4239
4252
4240 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
4253 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
4241 banner arg for embedded customization.
4254 banner arg for embedded customization.
4242
4255
4243 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
4256 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
4244 explicit uses of __IP as the IPython's instance name. Now things
4257 explicit uses of __IP as the IPython's instance name. Now things
4245 are properly handled via the shell.name value. The actual code
4258 are properly handled via the shell.name value. The actual code
4246 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
4259 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
4247 is much better than before. I'll clean things completely when the
4260 is much better than before. I'll clean things completely when the
4248 magic stuff gets a real overhaul.
4261 magic stuff gets a real overhaul.
4249
4262
4250 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
4263 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
4251 minor changes to debian dir.
4264 minor changes to debian dir.
4252
4265
4253 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
4266 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
4254 pointer to the shell itself in the interactive namespace even when
4267 pointer to the shell itself in the interactive namespace even when
4255 a user-supplied dict is provided. This is needed for embedding
4268 a user-supplied dict is provided. This is needed for embedding
4256 purposes (found by tests with Michel Sanner).
4269 purposes (found by tests with Michel Sanner).
4257
4270
4258 2004-09-27 Fernando Perez <fperez@colorado.edu>
4271 2004-09-27 Fernando Perez <fperez@colorado.edu>
4259
4272
4260 * IPython/UserConfig/ipythonrc: remove []{} from
4273 * IPython/UserConfig/ipythonrc: remove []{} from
4261 readline_remove_delims, so that things like [modname.<TAB> do
4274 readline_remove_delims, so that things like [modname.<TAB> do
4262 proper completion. This disables [].TAB, but that's a less common
4275 proper completion. This disables [].TAB, but that's a less common
4263 case than module names in list comprehensions, for example.
4276 case than module names in list comprehensions, for example.
4264 Thanks to a report by Andrea Riciputi.
4277 Thanks to a report by Andrea Riciputi.
4265
4278
4266 2004-09-09 Fernando Perez <fperez@colorado.edu>
4279 2004-09-09 Fernando Perez <fperez@colorado.edu>
4267
4280
4268 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
4281 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
4269 blocking problems in win32 and osx. Fix by John.
4282 blocking problems in win32 and osx. Fix by John.
4270
4283
4271 2004-09-08 Fernando Perez <fperez@colorado.edu>
4284 2004-09-08 Fernando Perez <fperez@colorado.edu>
4272
4285
4273 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
4286 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
4274 for Win32 and OSX. Fix by John Hunter.
4287 for Win32 and OSX. Fix by John Hunter.
4275
4288
4276 2004-08-30 *** Released version 0.6.3
4289 2004-08-30 *** Released version 0.6.3
4277
4290
4278 2004-08-30 Fernando Perez <fperez@colorado.edu>
4291 2004-08-30 Fernando Perez <fperez@colorado.edu>
4279
4292
4280 * setup.py (isfile): Add manpages to list of dependent files to be
4293 * setup.py (isfile): Add manpages to list of dependent files to be
4281 updated.
4294 updated.
4282
4295
4283 2004-08-27 Fernando Perez <fperez@colorado.edu>
4296 2004-08-27 Fernando Perez <fperez@colorado.edu>
4284
4297
4285 * IPython/Shell.py (start): I've disabled -wthread and -gthread
4298 * IPython/Shell.py (start): I've disabled -wthread and -gthread
4286 for now. They don't really work with standalone WX/GTK code
4299 for now. They don't really work with standalone WX/GTK code
4287 (though matplotlib IS working fine with both of those backends).
4300 (though matplotlib IS working fine with both of those backends).
4288 This will neeed much more testing. I disabled most things with
4301 This will neeed much more testing. I disabled most things with
4289 comments, so turning it back on later should be pretty easy.
4302 comments, so turning it back on later should be pretty easy.
4290
4303
4291 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
4304 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
4292 autocalling of expressions like r'foo', by modifying the line
4305 autocalling of expressions like r'foo', by modifying the line
4293 split regexp. Closes
4306 split regexp. Closes
4294 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
4307 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
4295 Riley <ipythonbugs-AT-sabi.net>.
4308 Riley <ipythonbugs-AT-sabi.net>.
4296 (InteractiveShell.mainloop): honor --nobanner with banner
4309 (InteractiveShell.mainloop): honor --nobanner with banner
4297 extensions.
4310 extensions.
4298
4311
4299 * IPython/Shell.py: Significant refactoring of all classes, so
4312 * IPython/Shell.py: Significant refactoring of all classes, so
4300 that we can really support ALL matplotlib backends and threading
4313 that we can really support ALL matplotlib backends and threading
4301 models (John spotted a bug with Tk which required this). Now we
4314 models (John spotted a bug with Tk which required this). Now we
4302 should support single-threaded, WX-threads and GTK-threads, both
4315 should support single-threaded, WX-threads and GTK-threads, both
4303 for generic code and for matplotlib.
4316 for generic code and for matplotlib.
4304
4317
4305 * IPython/ipmaker.py (__call__): Changed -mpthread option to
4318 * IPython/ipmaker.py (__call__): Changed -mpthread option to
4306 -pylab, to simplify things for users. Will also remove the pylab
4319 -pylab, to simplify things for users. Will also remove the pylab
4307 profile, since now all of matplotlib configuration is directly
4320 profile, since now all of matplotlib configuration is directly
4308 handled here. This also reduces startup time.
4321 handled here. This also reduces startup time.
4309
4322
4310 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
4323 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
4311 shell wasn't being correctly called. Also in IPShellWX.
4324 shell wasn't being correctly called. Also in IPShellWX.
4312
4325
4313 * IPython/iplib.py (InteractiveShell.__init__): Added option to
4326 * IPython/iplib.py (InteractiveShell.__init__): Added option to
4314 fine-tune banner.
4327 fine-tune banner.
4315
4328
4316 * IPython/numutils.py (spike): Deprecate these spike functions,
4329 * IPython/numutils.py (spike): Deprecate these spike functions,
4317 delete (long deprecated) gnuplot_exec handler.
4330 delete (long deprecated) gnuplot_exec handler.
4318
4331
4319 2004-08-26 Fernando Perez <fperez@colorado.edu>
4332 2004-08-26 Fernando Perez <fperez@colorado.edu>
4320
4333
4321 * ipython.1: Update for threading options, plus some others which
4334 * ipython.1: Update for threading options, plus some others which
4322 were missing.
4335 were missing.
4323
4336
4324 * IPython/ipmaker.py (__call__): Added -wthread option for
4337 * IPython/ipmaker.py (__call__): Added -wthread option for
4325 wxpython thread handling. Make sure threading options are only
4338 wxpython thread handling. Make sure threading options are only
4326 valid at the command line.
4339 valid at the command line.
4327
4340
4328 * scripts/ipython: moved shell selection into a factory function
4341 * scripts/ipython: moved shell selection into a factory function
4329 in Shell.py, to keep the starter script to a minimum.
4342 in Shell.py, to keep the starter script to a minimum.
4330
4343
4331 2004-08-25 Fernando Perez <fperez@colorado.edu>
4344 2004-08-25 Fernando Perez <fperez@colorado.edu>
4332
4345
4333 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
4346 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
4334 John. Along with some recent changes he made to matplotlib, the
4347 John. Along with some recent changes he made to matplotlib, the
4335 next versions of both systems should work very well together.
4348 next versions of both systems should work very well together.
4336
4349
4337 2004-08-24 Fernando Perez <fperez@colorado.edu>
4350 2004-08-24 Fernando Perez <fperez@colorado.edu>
4338
4351
4339 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
4352 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
4340 tried to switch the profiling to using hotshot, but I'm getting
4353 tried to switch the profiling to using hotshot, but I'm getting
4341 strange errors from prof.runctx() there. I may be misreading the
4354 strange errors from prof.runctx() there. I may be misreading the
4342 docs, but it looks weird. For now the profiling code will
4355 docs, but it looks weird. For now the profiling code will
4343 continue to use the standard profiler.
4356 continue to use the standard profiler.
4344
4357
4345 2004-08-23 Fernando Perez <fperez@colorado.edu>
4358 2004-08-23 Fernando Perez <fperez@colorado.edu>
4346
4359
4347 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
4360 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
4348 threaded shell, by John Hunter. It's not quite ready yet, but
4361 threaded shell, by John Hunter. It's not quite ready yet, but
4349 close.
4362 close.
4350
4363
4351 2004-08-22 Fernando Perez <fperez@colorado.edu>
4364 2004-08-22 Fernando Perez <fperez@colorado.edu>
4352
4365
4353 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
4366 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
4354 in Magic and ultraTB.
4367 in Magic and ultraTB.
4355
4368
4356 * ipython.1: document threading options in manpage.
4369 * ipython.1: document threading options in manpage.
4357
4370
4358 * scripts/ipython: Changed name of -thread option to -gthread,
4371 * scripts/ipython: Changed name of -thread option to -gthread,
4359 since this is GTK specific. I want to leave the door open for a
4372 since this is GTK specific. I want to leave the door open for a
4360 -wthread option for WX, which will most likely be necessary. This
4373 -wthread option for WX, which will most likely be necessary. This
4361 change affects usage and ipmaker as well.
4374 change affects usage and ipmaker as well.
4362
4375
4363 * IPython/Shell.py (matplotlib_shell): Add a factory function to
4376 * IPython/Shell.py (matplotlib_shell): Add a factory function to
4364 handle the matplotlib shell issues. Code by John Hunter
4377 handle the matplotlib shell issues. Code by John Hunter
4365 <jdhunter-AT-nitace.bsd.uchicago.edu>.
4378 <jdhunter-AT-nitace.bsd.uchicago.edu>.
4366 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
4379 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
4367 broken (and disabled for end users) for now, but it puts the
4380 broken (and disabled for end users) for now, but it puts the
4368 infrastructure in place.
4381 infrastructure in place.
4369
4382
4370 2004-08-21 Fernando Perez <fperez@colorado.edu>
4383 2004-08-21 Fernando Perez <fperez@colorado.edu>
4371
4384
4372 * ipythonrc-pylab: Add matplotlib support.
4385 * ipythonrc-pylab: Add matplotlib support.
4373
4386
4374 * matplotlib_config.py: new files for matplotlib support, part of
4387 * matplotlib_config.py: new files for matplotlib support, part of
4375 the pylab profile.
4388 the pylab profile.
4376
4389
4377 * IPython/usage.py (__doc__): documented the threading options.
4390 * IPython/usage.py (__doc__): documented the threading options.
4378
4391
4379 2004-08-20 Fernando Perez <fperez@colorado.edu>
4392 2004-08-20 Fernando Perez <fperez@colorado.edu>
4380
4393
4381 * ipython: Modified the main calling routine to handle the -thread
4394 * ipython: Modified the main calling routine to handle the -thread
4382 and -mpthread options. This needs to be done as a top-level hack,
4395 and -mpthread options. This needs to be done as a top-level hack,
4383 because it determines which class to instantiate for IPython
4396 because it determines which class to instantiate for IPython
4384 itself.
4397 itself.
4385
4398
4386 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
4399 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
4387 classes to support multithreaded GTK operation without blocking,
4400 classes to support multithreaded GTK operation without blocking,
4388 and matplotlib with all backends. This is a lot of still very
4401 and matplotlib with all backends. This is a lot of still very
4389 experimental code, and threads are tricky. So it may still have a
4402 experimental code, and threads are tricky. So it may still have a
4390 few rough edges... This code owes a lot to
4403 few rough edges... This code owes a lot to
4391 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
4404 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
4392 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
4405 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
4393 to John Hunter for all the matplotlib work.
4406 to John Hunter for all the matplotlib work.
4394
4407
4395 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
4408 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
4396 options for gtk thread and matplotlib support.
4409 options for gtk thread and matplotlib support.
4397
4410
4398 2004-08-16 Fernando Perez <fperez@colorado.edu>
4411 2004-08-16 Fernando Perez <fperez@colorado.edu>
4399
4412
4400 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
4413 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
4401 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
4414 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
4402 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
4415 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
4403
4416
4404 2004-08-11 Fernando Perez <fperez@colorado.edu>
4417 2004-08-11 Fernando Perez <fperez@colorado.edu>
4405
4418
4406 * setup.py (isfile): Fix build so documentation gets updated for
4419 * setup.py (isfile): Fix build so documentation gets updated for
4407 rpms (it was only done for .tgz builds).
4420 rpms (it was only done for .tgz builds).
4408
4421
4409 2004-08-10 Fernando Perez <fperez@colorado.edu>
4422 2004-08-10 Fernando Perez <fperez@colorado.edu>
4410
4423
4411 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
4424 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
4412
4425
4413 * iplib.py : Silence syntax error exceptions in tab-completion.
4426 * iplib.py : Silence syntax error exceptions in tab-completion.
4414
4427
4415 2004-08-05 Fernando Perez <fperez@colorado.edu>
4428 2004-08-05 Fernando Perez <fperez@colorado.edu>
4416
4429
4417 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
4430 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
4418 'color off' mark for continuation prompts. This was causing long
4431 'color off' mark for continuation prompts. This was causing long
4419 continuation lines to mis-wrap.
4432 continuation lines to mis-wrap.
4420
4433
4421 2004-08-01 Fernando Perez <fperez@colorado.edu>
4434 2004-08-01 Fernando Perez <fperez@colorado.edu>
4422
4435
4423 * IPython/ipmaker.py (make_IPython): Allow the shell class used
4436 * IPython/ipmaker.py (make_IPython): Allow the shell class used
4424 for building ipython to be a parameter. All this is necessary
4437 for building ipython to be a parameter. All this is necessary
4425 right now to have a multithreaded version, but this insane
4438 right now to have a multithreaded version, but this insane
4426 non-design will be cleaned up soon. For now, it's a hack that
4439 non-design will be cleaned up soon. For now, it's a hack that
4427 works.
4440 works.
4428
4441
4429 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
4442 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
4430 args in various places. No bugs so far, but it's a dangerous
4443 args in various places. No bugs so far, but it's a dangerous
4431 practice.
4444 practice.
4432
4445
4433 2004-07-31 Fernando Perez <fperez@colorado.edu>
4446 2004-07-31 Fernando Perez <fperez@colorado.edu>
4434
4447
4435 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
4448 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
4436 fix completion of files with dots in their names under most
4449 fix completion of files with dots in their names under most
4437 profiles (pysh was OK because the completion order is different).
4450 profiles (pysh was OK because the completion order is different).
4438
4451
4439 2004-07-27 Fernando Perez <fperez@colorado.edu>
4452 2004-07-27 Fernando Perez <fperez@colorado.edu>
4440
4453
4441 * IPython/iplib.py (InteractiveShell.__init__): build dict of
4454 * IPython/iplib.py (InteractiveShell.__init__): build dict of
4442 keywords manually, b/c the one in keyword.py was removed in python
4455 keywords manually, b/c the one in keyword.py was removed in python
4443 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
4456 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
4444 This is NOT a bug under python 2.3 and earlier.
4457 This is NOT a bug under python 2.3 and earlier.
4445
4458
4446 2004-07-26 Fernando Perez <fperez@colorado.edu>
4459 2004-07-26 Fernando Perez <fperez@colorado.edu>
4447
4460
4448 * IPython/ultraTB.py (VerboseTB.text): Add another
4461 * IPython/ultraTB.py (VerboseTB.text): Add another
4449 linecache.checkcache() call to try to prevent inspect.py from
4462 linecache.checkcache() call to try to prevent inspect.py from
4450 crashing under python 2.3. I think this fixes
4463 crashing under python 2.3. I think this fixes
4451 http://www.scipy.net/roundup/ipython/issue17.
4464 http://www.scipy.net/roundup/ipython/issue17.
4452
4465
4453 2004-07-26 *** Released version 0.6.2
4466 2004-07-26 *** Released version 0.6.2
4454
4467
4455 2004-07-26 Fernando Perez <fperez@colorado.edu>
4468 2004-07-26 Fernando Perez <fperez@colorado.edu>
4456
4469
4457 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
4470 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
4458 fail for any number.
4471 fail for any number.
4459 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
4472 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
4460 empty bookmarks.
4473 empty bookmarks.
4461
4474
4462 2004-07-26 *** Released version 0.6.1
4475 2004-07-26 *** Released version 0.6.1
4463
4476
4464 2004-07-26 Fernando Perez <fperez@colorado.edu>
4477 2004-07-26 Fernando Perez <fperez@colorado.edu>
4465
4478
4466 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4479 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
4467
4480
4468 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4481 * IPython/iplib.py (protect_filename): Applied Ville's patch for
4469 escaping '()[]{}' in filenames.
4482 escaping '()[]{}' in filenames.
4470
4483
4471 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4484 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
4472 Python 2.2 users who lack a proper shlex.split.
4485 Python 2.2 users who lack a proper shlex.split.
4473
4486
4474 2004-07-19 Fernando Perez <fperez@colorado.edu>
4487 2004-07-19 Fernando Perez <fperez@colorado.edu>
4475
4488
4476 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4489 * IPython/iplib.py (InteractiveShell.init_readline): Add support
4477 for reading readline's init file. I follow the normal chain:
4490 for reading readline's init file. I follow the normal chain:
4478 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4491 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
4479 report by Mike Heeter. This closes
4492 report by Mike Heeter. This closes
4480 http://www.scipy.net/roundup/ipython/issue16.
4493 http://www.scipy.net/roundup/ipython/issue16.
4481
4494
4482 2004-07-18 Fernando Perez <fperez@colorado.edu>
4495 2004-07-18 Fernando Perez <fperez@colorado.edu>
4483
4496
4484 * IPython/iplib.py (__init__): Add better handling of '\' under
4497 * IPython/iplib.py (__init__): Add better handling of '\' under
4485 Win32 for filenames. After a patch by Ville.
4498 Win32 for filenames. After a patch by Ville.
4486
4499
4487 2004-07-17 Fernando Perez <fperez@colorado.edu>
4500 2004-07-17 Fernando Perez <fperez@colorado.edu>
4488
4501
4489 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4502 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4490 autocalling would be triggered for 'foo is bar' if foo is
4503 autocalling would be triggered for 'foo is bar' if foo is
4491 callable. I also cleaned up the autocall detection code to use a
4504 callable. I also cleaned up the autocall detection code to use a
4492 regexp, which is faster. Bug reported by Alexander Schmolck.
4505 regexp, which is faster. Bug reported by Alexander Schmolck.
4493
4506
4494 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4507 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
4495 '?' in them would confuse the help system. Reported by Alex
4508 '?' in them would confuse the help system. Reported by Alex
4496 Schmolck.
4509 Schmolck.
4497
4510
4498 2004-07-16 Fernando Perez <fperez@colorado.edu>
4511 2004-07-16 Fernando Perez <fperez@colorado.edu>
4499
4512
4500 * IPython/GnuplotInteractive.py (__all__): added plot2.
4513 * IPython/GnuplotInteractive.py (__all__): added plot2.
4501
4514
4502 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4515 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
4503 plotting dictionaries, lists or tuples of 1d arrays.
4516 plotting dictionaries, lists or tuples of 1d arrays.
4504
4517
4505 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4518 * IPython/Magic.py (Magic.magic_hist): small clenaups and
4506 optimizations.
4519 optimizations.
4507
4520
4508 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4521 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
4509 the information which was there from Janko's original IPP code:
4522 the information which was there from Janko's original IPP code:
4510
4523
4511 03.05.99 20:53 porto.ifm.uni-kiel.de
4524 03.05.99 20:53 porto.ifm.uni-kiel.de
4512 --Started changelog.
4525 --Started changelog.
4513 --make clear do what it say it does
4526 --make clear do what it say it does
4514 --added pretty output of lines from inputcache
4527 --added pretty output of lines from inputcache
4515 --Made Logger a mixin class, simplifies handling of switches
4528 --Made Logger a mixin class, simplifies handling of switches
4516 --Added own completer class. .string<TAB> expands to last history
4529 --Added own completer class. .string<TAB> expands to last history
4517 line which starts with string. The new expansion is also present
4530 line which starts with string. The new expansion is also present
4518 with Ctrl-r from the readline library. But this shows, who this
4531 with Ctrl-r from the readline library. But this shows, who this
4519 can be done for other cases.
4532 can be done for other cases.
4520 --Added convention that all shell functions should accept a
4533 --Added convention that all shell functions should accept a
4521 parameter_string This opens the door for different behaviour for
4534 parameter_string This opens the door for different behaviour for
4522 each function. @cd is a good example of this.
4535 each function. @cd is a good example of this.
4523
4536
4524 04.05.99 12:12 porto.ifm.uni-kiel.de
4537 04.05.99 12:12 porto.ifm.uni-kiel.de
4525 --added logfile rotation
4538 --added logfile rotation
4526 --added new mainloop method which freezes first the namespace
4539 --added new mainloop method which freezes first the namespace
4527
4540
4528 07.05.99 21:24 porto.ifm.uni-kiel.de
4541 07.05.99 21:24 porto.ifm.uni-kiel.de
4529 --added the docreader classes. Now there is a help system.
4542 --added the docreader classes. Now there is a help system.
4530 -This is only a first try. Currently it's not easy to put new
4543 -This is only a first try. Currently it's not easy to put new
4531 stuff in the indices. But this is the way to go. Info would be
4544 stuff in the indices. But this is the way to go. Info would be
4532 better, but HTML is every where and not everybody has an info
4545 better, but HTML is every where and not everybody has an info
4533 system installed and it's not so easy to change html-docs to info.
4546 system installed and it's not so easy to change html-docs to info.
4534 --added global logfile option
4547 --added global logfile option
4535 --there is now a hook for object inspection method pinfo needs to
4548 --there is now a hook for object inspection method pinfo needs to
4536 be provided for this. Can be reached by two '??'.
4549 be provided for this. Can be reached by two '??'.
4537
4550
4538 08.05.99 20:51 porto.ifm.uni-kiel.de
4551 08.05.99 20:51 porto.ifm.uni-kiel.de
4539 --added a README
4552 --added a README
4540 --bug in rc file. Something has changed so functions in the rc
4553 --bug in rc file. Something has changed so functions in the rc
4541 file need to reference the shell and not self. Not clear if it's a
4554 file need to reference the shell and not self. Not clear if it's a
4542 bug or feature.
4555 bug or feature.
4543 --changed rc file for new behavior
4556 --changed rc file for new behavior
4544
4557
4545 2004-07-15 Fernando Perez <fperez@colorado.edu>
4558 2004-07-15 Fernando Perez <fperez@colorado.edu>
4546
4559
4547 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4560 * IPython/Logger.py (Logger.log): fixed recent bug where the input
4548 cache was falling out of sync in bizarre manners when multi-line
4561 cache was falling out of sync in bizarre manners when multi-line
4549 input was present. Minor optimizations and cleanup.
4562 input was present. Minor optimizations and cleanup.
4550
4563
4551 (Logger): Remove old Changelog info for cleanup. This is the
4564 (Logger): Remove old Changelog info for cleanup. This is the
4552 information which was there from Janko's original code:
4565 information which was there from Janko's original code:
4553
4566
4554 Changes to Logger: - made the default log filename a parameter
4567 Changes to Logger: - made the default log filename a parameter
4555
4568
4556 - put a check for lines beginning with !@? in log(). Needed
4569 - put a check for lines beginning with !@? in log(). Needed
4557 (even if the handlers properly log their lines) for mid-session
4570 (even if the handlers properly log their lines) for mid-session
4558 logging activation to work properly. Without this, lines logged
4571 logging activation to work properly. Without this, lines logged
4559 in mid session, which get read from the cache, would end up
4572 in mid session, which get read from the cache, would end up
4560 'bare' (with !@? in the open) in the log. Now they are caught
4573 'bare' (with !@? in the open) in the log. Now they are caught
4561 and prepended with a #.
4574 and prepended with a #.
4562
4575
4563 * IPython/iplib.py (InteractiveShell.init_readline): added check
4576 * IPython/iplib.py (InteractiveShell.init_readline): added check
4564 in case MagicCompleter fails to be defined, so we don't crash.
4577 in case MagicCompleter fails to be defined, so we don't crash.
4565
4578
4566 2004-07-13 Fernando Perez <fperez@colorado.edu>
4579 2004-07-13 Fernando Perez <fperez@colorado.edu>
4567
4580
4568 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4581 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
4569 of EPS if the requested filename ends in '.eps'.
4582 of EPS if the requested filename ends in '.eps'.
4570
4583
4571 2004-07-04 Fernando Perez <fperez@colorado.edu>
4584 2004-07-04 Fernando Perez <fperez@colorado.edu>
4572
4585
4573 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4586 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
4574 escaping of quotes when calling the shell.
4587 escaping of quotes when calling the shell.
4575
4588
4576 2004-07-02 Fernando Perez <fperez@colorado.edu>
4589 2004-07-02 Fernando Perez <fperez@colorado.edu>
4577
4590
4578 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4591 * IPython/Prompts.py (CachedOutput.update): Fix problem with
4579 gettext not working because we were clobbering '_'. Fixes
4592 gettext not working because we were clobbering '_'. Fixes
4580 http://www.scipy.net/roundup/ipython/issue6.
4593 http://www.scipy.net/roundup/ipython/issue6.
4581
4594
4582 2004-07-01 Fernando Perez <fperez@colorado.edu>
4595 2004-07-01 Fernando Perez <fperez@colorado.edu>
4583
4596
4584 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4597 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
4585 into @cd. Patch by Ville.
4598 into @cd. Patch by Ville.
4586
4599
4587 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4600 * IPython/iplib.py (InteractiveShell.post_config_initialization):
4588 new function to store things after ipmaker runs. Patch by Ville.
4601 new function to store things after ipmaker runs. Patch by Ville.
4589 Eventually this will go away once ipmaker is removed and the class
4602 Eventually this will go away once ipmaker is removed and the class
4590 gets cleaned up, but for now it's ok. Key functionality here is
4603 gets cleaned up, but for now it's ok. Key functionality here is
4591 the addition of the persistent storage mechanism, a dict for
4604 the addition of the persistent storage mechanism, a dict for
4592 keeping data across sessions (for now just bookmarks, but more can
4605 keeping data across sessions (for now just bookmarks, but more can
4593 be implemented later).
4606 be implemented later).
4594
4607
4595 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4608 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
4596 persistent across sections. Patch by Ville, I modified it
4609 persistent across sections. Patch by Ville, I modified it
4597 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4610 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
4598 added a '-l' option to list all bookmarks.
4611 added a '-l' option to list all bookmarks.
4599
4612
4600 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4613 * IPython/iplib.py (InteractiveShell.atexit_operations): new
4601 center for cleanup. Registered with atexit.register(). I moved
4614 center for cleanup. Registered with atexit.register(). I moved
4602 here the old exit_cleanup(). After a patch by Ville.
4615 here the old exit_cleanup(). After a patch by Ville.
4603
4616
4604 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4617 * IPython/Magic.py (get_py_filename): added '~' to the accepted
4605 characters in the hacked shlex_split for python 2.2.
4618 characters in the hacked shlex_split for python 2.2.
4606
4619
4607 * IPython/iplib.py (file_matches): more fixes to filenames with
4620 * IPython/iplib.py (file_matches): more fixes to filenames with
4608 whitespace in them. It's not perfect, but limitations in python's
4621 whitespace in them. It's not perfect, but limitations in python's
4609 readline make it impossible to go further.
4622 readline make it impossible to go further.
4610
4623
4611 2004-06-29 Fernando Perez <fperez@colorado.edu>
4624 2004-06-29 Fernando Perez <fperez@colorado.edu>
4612
4625
4613 * IPython/iplib.py (file_matches): escape whitespace correctly in
4626 * IPython/iplib.py (file_matches): escape whitespace correctly in
4614 filename completions. Bug reported by Ville.
4627 filename completions. Bug reported by Ville.
4615
4628
4616 2004-06-28 Fernando Perez <fperez@colorado.edu>
4629 2004-06-28 Fernando Perez <fperez@colorado.edu>
4617
4630
4618 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4631 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
4619 the history file will be called 'history-PROFNAME' (or just
4632 the history file will be called 'history-PROFNAME' (or just
4620 'history' if no profile is loaded). I was getting annoyed at
4633 'history' if no profile is loaded). I was getting annoyed at
4621 getting my Numerical work history clobbered by pysh sessions.
4634 getting my Numerical work history clobbered by pysh sessions.
4622
4635
4623 * IPython/iplib.py (InteractiveShell.__init__): Internal
4636 * IPython/iplib.py (InteractiveShell.__init__): Internal
4624 getoutputerror() function so that we can honor the system_verbose
4637 getoutputerror() function so that we can honor the system_verbose
4625 flag for _all_ system calls. I also added escaping of #
4638 flag for _all_ system calls. I also added escaping of #
4626 characters here to avoid confusing Itpl.
4639 characters here to avoid confusing Itpl.
4627
4640
4628 * IPython/Magic.py (shlex_split): removed call to shell in
4641 * IPython/Magic.py (shlex_split): removed call to shell in
4629 parse_options and replaced it with shlex.split(). The annoying
4642 parse_options and replaced it with shlex.split(). The annoying
4630 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4643 part was that in Python 2.2, shlex.split() doesn't exist, so I had
4631 to backport it from 2.3, with several frail hacks (the shlex
4644 to backport it from 2.3, with several frail hacks (the shlex
4632 module is rather limited in 2.2). Thanks to a suggestion by Ville
4645 module is rather limited in 2.2). Thanks to a suggestion by Ville
4633 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4646 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
4634 problem.
4647 problem.
4635
4648
4636 (Magic.magic_system_verbose): new toggle to print the actual
4649 (Magic.magic_system_verbose): new toggle to print the actual
4637 system calls made by ipython. Mainly for debugging purposes.
4650 system calls made by ipython. Mainly for debugging purposes.
4638
4651
4639 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4652 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
4640 doesn't support persistence. Reported (and fix suggested) by
4653 doesn't support persistence. Reported (and fix suggested) by
4641 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4654 Travis Caldwell <travis_caldwell2000@yahoo.com>.
4642
4655
4643 2004-06-26 Fernando Perez <fperez@colorado.edu>
4656 2004-06-26 Fernando Perez <fperez@colorado.edu>
4644
4657
4645 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4658 * IPython/Logger.py (Logger.log): fix to handle correctly empty
4646 continue prompts.
4659 continue prompts.
4647
4660
4648 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4661 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
4649 function (basically a big docstring) and a few more things here to
4662 function (basically a big docstring) and a few more things here to
4650 speedup startup. pysh.py is now very lightweight. We want because
4663 speedup startup. pysh.py is now very lightweight. We want because
4651 it gets execfile'd, while InterpreterExec gets imported, so
4664 it gets execfile'd, while InterpreterExec gets imported, so
4652 byte-compilation saves time.
4665 byte-compilation saves time.
4653
4666
4654 2004-06-25 Fernando Perez <fperez@colorado.edu>
4667 2004-06-25 Fernando Perez <fperez@colorado.edu>
4655
4668
4656 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4669 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
4657 -NUM', which was recently broken.
4670 -NUM', which was recently broken.
4658
4671
4659 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4672 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
4660 in multi-line input (but not !!, which doesn't make sense there).
4673 in multi-line input (but not !!, which doesn't make sense there).
4661
4674
4662 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4675 * IPython/UserConfig/ipythonrc: made autoindent on by default.
4663 It's just too useful, and people can turn it off in the less
4676 It's just too useful, and people can turn it off in the less
4664 common cases where it's a problem.
4677 common cases where it's a problem.
4665
4678
4666 2004-06-24 Fernando Perez <fperez@colorado.edu>
4679 2004-06-24 Fernando Perez <fperez@colorado.edu>
4667
4680
4668 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4681 * IPython/iplib.py (InteractiveShell._prefilter): big change -
4669 special syntaxes (like alias calling) is now allied in multi-line
4682 special syntaxes (like alias calling) is now allied in multi-line
4670 input. This is still _very_ experimental, but it's necessary for
4683 input. This is still _very_ experimental, but it's necessary for
4671 efficient shell usage combining python looping syntax with system
4684 efficient shell usage combining python looping syntax with system
4672 calls. For now it's restricted to aliases, I don't think it
4685 calls. For now it's restricted to aliases, I don't think it
4673 really even makes sense to have this for magics.
4686 really even makes sense to have this for magics.
4674
4687
4675 2004-06-23 Fernando Perez <fperez@colorado.edu>
4688 2004-06-23 Fernando Perez <fperez@colorado.edu>
4676
4689
4677 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4690 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
4678 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4691 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
4679
4692
4680 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4693 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
4681 extensions under Windows (after code sent by Gary Bishop). The
4694 extensions under Windows (after code sent by Gary Bishop). The
4682 extensions considered 'executable' are stored in IPython's rc
4695 extensions considered 'executable' are stored in IPython's rc
4683 structure as win_exec_ext.
4696 structure as win_exec_ext.
4684
4697
4685 * IPython/genutils.py (shell): new function, like system() but
4698 * IPython/genutils.py (shell): new function, like system() but
4686 without return value. Very useful for interactive shell work.
4699 without return value. Very useful for interactive shell work.
4687
4700
4688 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4701 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
4689 delete aliases.
4702 delete aliases.
4690
4703
4691 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4704 * IPython/iplib.py (InteractiveShell.alias_table_update): make
4692 sure that the alias table doesn't contain python keywords.
4705 sure that the alias table doesn't contain python keywords.
4693
4706
4694 2004-06-21 Fernando Perez <fperez@colorado.edu>
4707 2004-06-21 Fernando Perez <fperez@colorado.edu>
4695
4708
4696 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4709 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
4697 non-existent items are found in $PATH. Reported by Thorsten.
4710 non-existent items are found in $PATH. Reported by Thorsten.
4698
4711
4699 2004-06-20 Fernando Perez <fperez@colorado.edu>
4712 2004-06-20 Fernando Perez <fperez@colorado.edu>
4700
4713
4701 * IPython/iplib.py (complete): modified the completer so that the
4714 * IPython/iplib.py (complete): modified the completer so that the
4702 order of priorities can be easily changed at runtime.
4715 order of priorities can be easily changed at runtime.
4703
4716
4704 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4717 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
4705 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4718 Modified to auto-execute all lines beginning with '~', '/' or '.'.
4706
4719
4707 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4720 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
4708 expand Python variables prepended with $ in all system calls. The
4721 expand Python variables prepended with $ in all system calls. The
4709 same was done to InteractiveShell.handle_shell_escape. Now all
4722 same was done to InteractiveShell.handle_shell_escape. Now all
4710 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4723 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
4711 expansion of python variables and expressions according to the
4724 expansion of python variables and expressions according to the
4712 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4725 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
4713
4726
4714 Though PEP-215 has been rejected, a similar (but simpler) one
4727 Though PEP-215 has been rejected, a similar (but simpler) one
4715 seems like it will go into Python 2.4, PEP-292 -
4728 seems like it will go into Python 2.4, PEP-292 -
4716 http://www.python.org/peps/pep-0292.html.
4729 http://www.python.org/peps/pep-0292.html.
4717
4730
4718 I'll keep the full syntax of PEP-215, since IPython has since the
4731 I'll keep the full syntax of PEP-215, since IPython has since the
4719 start used Ka-Ping Yee's reference implementation discussed there
4732 start used Ka-Ping Yee's reference implementation discussed there
4720 (Itpl), and I actually like the powerful semantics it offers.
4733 (Itpl), and I actually like the powerful semantics it offers.
4721
4734
4722 In order to access normal shell variables, the $ has to be escaped
4735 In order to access normal shell variables, the $ has to be escaped
4723 via an extra $. For example:
4736 via an extra $. For example:
4724
4737
4725 In [7]: PATH='a python variable'
4738 In [7]: PATH='a python variable'
4726
4739
4727 In [8]: !echo $PATH
4740 In [8]: !echo $PATH
4728 a python variable
4741 a python variable
4729
4742
4730 In [9]: !echo $$PATH
4743 In [9]: !echo $$PATH
4731 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4744 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
4732
4745
4733 (Magic.parse_options): escape $ so the shell doesn't evaluate
4746 (Magic.parse_options): escape $ so the shell doesn't evaluate
4734 things prematurely.
4747 things prematurely.
4735
4748
4736 * IPython/iplib.py (InteractiveShell.call_alias): added the
4749 * IPython/iplib.py (InteractiveShell.call_alias): added the
4737 ability for aliases to expand python variables via $.
4750 ability for aliases to expand python variables via $.
4738
4751
4739 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4752 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
4740 system, now there's a @rehash/@rehashx pair of magics. These work
4753 system, now there's a @rehash/@rehashx pair of magics. These work
4741 like the csh rehash command, and can be invoked at any time. They
4754 like the csh rehash command, and can be invoked at any time. They
4742 build a table of aliases to everything in the user's $PATH
4755 build a table of aliases to everything in the user's $PATH
4743 (@rehash uses everything, @rehashx is slower but only adds
4756 (@rehash uses everything, @rehashx is slower but only adds
4744 executable files). With this, the pysh.py-based shell profile can
4757 executable files). With this, the pysh.py-based shell profile can
4745 now simply call rehash upon startup, and full access to all
4758 now simply call rehash upon startup, and full access to all
4746 programs in the user's path is obtained.
4759 programs in the user's path is obtained.
4747
4760
4748 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4761 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
4749 functionality is now fully in place. I removed the old dynamic
4762 functionality is now fully in place. I removed the old dynamic
4750 code generation based approach, in favor of a much lighter one
4763 code generation based approach, in favor of a much lighter one
4751 based on a simple dict. The advantage is that this allows me to
4764 based on a simple dict. The advantage is that this allows me to
4752 now have thousands of aliases with negligible cost (unthinkable
4765 now have thousands of aliases with negligible cost (unthinkable
4753 with the old system).
4766 with the old system).
4754
4767
4755 2004-06-19 Fernando Perez <fperez@colorado.edu>
4768 2004-06-19 Fernando Perez <fperez@colorado.edu>
4756
4769
4757 * IPython/iplib.py (__init__): extended MagicCompleter class to
4770 * IPython/iplib.py (__init__): extended MagicCompleter class to
4758 also complete (last in priority) on user aliases.
4771 also complete (last in priority) on user aliases.
4759
4772
4760 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4773 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
4761 call to eval.
4774 call to eval.
4762 (ItplNS.__init__): Added a new class which functions like Itpl,
4775 (ItplNS.__init__): Added a new class which functions like Itpl,
4763 but allows configuring the namespace for the evaluation to occur
4776 but allows configuring the namespace for the evaluation to occur
4764 in.
4777 in.
4765
4778
4766 2004-06-18 Fernando Perez <fperez@colorado.edu>
4779 2004-06-18 Fernando Perez <fperez@colorado.edu>
4767
4780
4768 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4781 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
4769 better message when 'exit' or 'quit' are typed (a common newbie
4782 better message when 'exit' or 'quit' are typed (a common newbie
4770 confusion).
4783 confusion).
4771
4784
4772 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4785 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
4773 check for Windows users.
4786 check for Windows users.
4774
4787
4775 * IPython/iplib.py (InteractiveShell.user_setup): removed
4788 * IPython/iplib.py (InteractiveShell.user_setup): removed
4776 disabling of colors for Windows. I'll test at runtime and issue a
4789 disabling of colors for Windows. I'll test at runtime and issue a
4777 warning if Gary's readline isn't found, as to nudge users to
4790 warning if Gary's readline isn't found, as to nudge users to
4778 download it.
4791 download it.
4779
4792
4780 2004-06-16 Fernando Perez <fperez@colorado.edu>
4793 2004-06-16 Fernando Perez <fperez@colorado.edu>
4781
4794
4782 * IPython/genutils.py (Stream.__init__): changed to print errors
4795 * IPython/genutils.py (Stream.__init__): changed to print errors
4783 to sys.stderr. I had a circular dependency here. Now it's
4796 to sys.stderr. I had a circular dependency here. Now it's
4784 possible to run ipython as IDLE's shell (consider this pre-alpha,
4797 possible to run ipython as IDLE's shell (consider this pre-alpha,
4785 since true stdout things end up in the starting terminal instead
4798 since true stdout things end up in the starting terminal instead
4786 of IDLE's out).
4799 of IDLE's out).
4787
4800
4788 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4801 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
4789 users who haven't # updated their prompt_in2 definitions. Remove
4802 users who haven't # updated their prompt_in2 definitions. Remove
4790 eventually.
4803 eventually.
4791 (multiple_replace): added credit to original ASPN recipe.
4804 (multiple_replace): added credit to original ASPN recipe.
4792
4805
4793 2004-06-15 Fernando Perez <fperez@colorado.edu>
4806 2004-06-15 Fernando Perez <fperez@colorado.edu>
4794
4807
4795 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4808 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
4796 list of auto-defined aliases.
4809 list of auto-defined aliases.
4797
4810
4798 2004-06-13 Fernando Perez <fperez@colorado.edu>
4811 2004-06-13 Fernando Perez <fperez@colorado.edu>
4799
4812
4800 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4813 * setup.py (scriptfiles): Don't trigger win_post_install unless an
4801 install was really requested (so setup.py can be used for other
4814 install was really requested (so setup.py can be used for other
4802 things under Windows).
4815 things under Windows).
4803
4816
4804 2004-06-10 Fernando Perez <fperez@colorado.edu>
4817 2004-06-10 Fernando Perez <fperez@colorado.edu>
4805
4818
4806 * IPython/Logger.py (Logger.create_log): Manually remove any old
4819 * IPython/Logger.py (Logger.create_log): Manually remove any old
4807 backup, since os.remove may fail under Windows. Fixes bug
4820 backup, since os.remove may fail under Windows. Fixes bug
4808 reported by Thorsten.
4821 reported by Thorsten.
4809
4822
4810 2004-06-09 Fernando Perez <fperez@colorado.edu>
4823 2004-06-09 Fernando Perez <fperez@colorado.edu>
4811
4824
4812 * examples/example-embed.py: fixed all references to %n (replaced
4825 * examples/example-embed.py: fixed all references to %n (replaced
4813 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4826 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
4814 for all examples and the manual as well.
4827 for all examples and the manual as well.
4815
4828
4816 2004-06-08 Fernando Perez <fperez@colorado.edu>
4829 2004-06-08 Fernando Perez <fperez@colorado.edu>
4817
4830
4818 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4831 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
4819 alignment and color management. All 3 prompt subsystems now
4832 alignment and color management. All 3 prompt subsystems now
4820 inherit from BasePrompt.
4833 inherit from BasePrompt.
4821
4834
4822 * tools/release: updates for windows installer build and tag rpms
4835 * tools/release: updates for windows installer build and tag rpms
4823 with python version (since paths are fixed).
4836 with python version (since paths are fixed).
4824
4837
4825 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4838 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
4826 which will become eventually obsolete. Also fixed the default
4839 which will become eventually obsolete. Also fixed the default
4827 prompt_in2 to use \D, so at least new users start with the correct
4840 prompt_in2 to use \D, so at least new users start with the correct
4828 defaults.
4841 defaults.
4829 WARNING: Users with existing ipythonrc files will need to apply
4842 WARNING: Users with existing ipythonrc files will need to apply
4830 this fix manually!
4843 this fix manually!
4831
4844
4832 * setup.py: make windows installer (.exe). This is finally the
4845 * setup.py: make windows installer (.exe). This is finally the
4833 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4846 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
4834 which I hadn't included because it required Python 2.3 (or recent
4847 which I hadn't included because it required Python 2.3 (or recent
4835 distutils).
4848 distutils).
4836
4849
4837 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4850 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
4838 usage of new '\D' escape.
4851 usage of new '\D' escape.
4839
4852
4840 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4853 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
4841 lacks os.getuid())
4854 lacks os.getuid())
4842 (CachedOutput.set_colors): Added the ability to turn coloring
4855 (CachedOutput.set_colors): Added the ability to turn coloring
4843 on/off with @colors even for manually defined prompt colors. It
4856 on/off with @colors even for manually defined prompt colors. It
4844 uses a nasty global, but it works safely and via the generic color
4857 uses a nasty global, but it works safely and via the generic color
4845 handling mechanism.
4858 handling mechanism.
4846 (Prompt2.__init__): Introduced new escape '\D' for continuation
4859 (Prompt2.__init__): Introduced new escape '\D' for continuation
4847 prompts. It represents the counter ('\#') as dots.
4860 prompts. It represents the counter ('\#') as dots.
4848 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4861 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
4849 need to update their ipythonrc files and replace '%n' with '\D' in
4862 need to update their ipythonrc files and replace '%n' with '\D' in
4850 their prompt_in2 settings everywhere. Sorry, but there's
4863 their prompt_in2 settings everywhere. Sorry, but there's
4851 otherwise no clean way to get all prompts to properly align. The
4864 otherwise no clean way to get all prompts to properly align. The
4852 ipythonrc shipped with IPython has been updated.
4865 ipythonrc shipped with IPython has been updated.
4853
4866
4854 2004-06-07 Fernando Perez <fperez@colorado.edu>
4867 2004-06-07 Fernando Perez <fperez@colorado.edu>
4855
4868
4856 * setup.py (isfile): Pass local_icons option to latex2html, so the
4869 * setup.py (isfile): Pass local_icons option to latex2html, so the
4857 resulting HTML file is self-contained. Thanks to
4870 resulting HTML file is self-contained. Thanks to
4858 dryice-AT-liu.com.cn for the tip.
4871 dryice-AT-liu.com.cn for the tip.
4859
4872
4860 * pysh.py: I created a new profile 'shell', which implements a
4873 * pysh.py: I created a new profile 'shell', which implements a
4861 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4874 _rudimentary_ IPython-based shell. This is in NO WAY a realy
4862 system shell, nor will it become one anytime soon. It's mainly
4875 system shell, nor will it become one anytime soon. It's mainly
4863 meant to illustrate the use of the new flexible bash-like prompts.
4876 meant to illustrate the use of the new flexible bash-like prompts.
4864 I guess it could be used by hardy souls for true shell management,
4877 I guess it could be used by hardy souls for true shell management,
4865 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4878 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
4866 profile. This uses the InterpreterExec extension provided by
4879 profile. This uses the InterpreterExec extension provided by
4867 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4880 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
4868
4881
4869 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4882 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
4870 auto-align itself with the length of the previous input prompt
4883 auto-align itself with the length of the previous input prompt
4871 (taking into account the invisible color escapes).
4884 (taking into account the invisible color escapes).
4872 (CachedOutput.__init__): Large restructuring of this class. Now
4885 (CachedOutput.__init__): Large restructuring of this class. Now
4873 all three prompts (primary1, primary2, output) are proper objects,
4886 all three prompts (primary1, primary2, output) are proper objects,
4874 managed by the 'parent' CachedOutput class. The code is still a
4887 managed by the 'parent' CachedOutput class. The code is still a
4875 bit hackish (all prompts share state via a pointer to the cache),
4888 bit hackish (all prompts share state via a pointer to the cache),
4876 but it's overall far cleaner than before.
4889 but it's overall far cleaner than before.
4877
4890
4878 * IPython/genutils.py (getoutputerror): modified to add verbose,
4891 * IPython/genutils.py (getoutputerror): modified to add verbose,
4879 debug and header options. This makes the interface of all getout*
4892 debug and header options. This makes the interface of all getout*
4880 functions uniform.
4893 functions uniform.
4881 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4894 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
4882
4895
4883 * IPython/Magic.py (Magic.default_option): added a function to
4896 * IPython/Magic.py (Magic.default_option): added a function to
4884 allow registering default options for any magic command. This
4897 allow registering default options for any magic command. This
4885 makes it easy to have profiles which customize the magics globally
4898 makes it easy to have profiles which customize the magics globally
4886 for a certain use. The values set through this function are
4899 for a certain use. The values set through this function are
4887 picked up by the parse_options() method, which all magics should
4900 picked up by the parse_options() method, which all magics should
4888 use to parse their options.
4901 use to parse their options.
4889
4902
4890 * IPython/genutils.py (warn): modified the warnings framework to
4903 * IPython/genutils.py (warn): modified the warnings framework to
4891 use the Term I/O class. I'm trying to slowly unify all of
4904 use the Term I/O class. I'm trying to slowly unify all of
4892 IPython's I/O operations to pass through Term.
4905 IPython's I/O operations to pass through Term.
4893
4906
4894 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4907 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
4895 the secondary prompt to correctly match the length of the primary
4908 the secondary prompt to correctly match the length of the primary
4896 one for any prompt. Now multi-line code will properly line up
4909 one for any prompt. Now multi-line code will properly line up
4897 even for path dependent prompts, such as the new ones available
4910 even for path dependent prompts, such as the new ones available
4898 via the prompt_specials.
4911 via the prompt_specials.
4899
4912
4900 2004-06-06 Fernando Perez <fperez@colorado.edu>
4913 2004-06-06 Fernando Perez <fperez@colorado.edu>
4901
4914
4902 * IPython/Prompts.py (prompt_specials): Added the ability to have
4915 * IPython/Prompts.py (prompt_specials): Added the ability to have
4903 bash-like special sequences in the prompts, which get
4916 bash-like special sequences in the prompts, which get
4904 automatically expanded. Things like hostname, current working
4917 automatically expanded. Things like hostname, current working
4905 directory and username are implemented already, but it's easy to
4918 directory and username are implemented already, but it's easy to
4906 add more in the future. Thanks to a patch by W.J. van der Laan
4919 add more in the future. Thanks to a patch by W.J. van der Laan
4907 <gnufnork-AT-hetdigitalegat.nl>
4920 <gnufnork-AT-hetdigitalegat.nl>
4908 (prompt_specials): Added color support for prompt strings, so
4921 (prompt_specials): Added color support for prompt strings, so
4909 users can define arbitrary color setups for their prompts.
4922 users can define arbitrary color setups for their prompts.
4910
4923
4911 2004-06-05 Fernando Perez <fperez@colorado.edu>
4924 2004-06-05 Fernando Perez <fperez@colorado.edu>
4912
4925
4913 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4926 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
4914 code to load Gary Bishop's readline and configure it
4927 code to load Gary Bishop's readline and configure it
4915 automatically. Thanks to Gary for help on this.
4928 automatically. Thanks to Gary for help on this.
4916
4929
4917 2004-06-01 Fernando Perez <fperez@colorado.edu>
4930 2004-06-01 Fernando Perez <fperez@colorado.edu>
4918
4931
4919 * IPython/Logger.py (Logger.create_log): fix bug for logging
4932 * IPython/Logger.py (Logger.create_log): fix bug for logging
4920 with no filename (previous fix was incomplete).
4933 with no filename (previous fix was incomplete).
4921
4934
4922 2004-05-25 Fernando Perez <fperez@colorado.edu>
4935 2004-05-25 Fernando Perez <fperez@colorado.edu>
4923
4936
4924 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4937 * IPython/Magic.py (Magic.parse_options): fix bug where naked
4925 parens would get passed to the shell.
4938 parens would get passed to the shell.
4926
4939
4927 2004-05-20 Fernando Perez <fperez@colorado.edu>
4940 2004-05-20 Fernando Perez <fperez@colorado.edu>
4928
4941
4929 * IPython/Magic.py (Magic.magic_prun): changed default profile
4942 * IPython/Magic.py (Magic.magic_prun): changed default profile
4930 sort order to 'time' (the more common profiling need).
4943 sort order to 'time' (the more common profiling need).
4931
4944
4932 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4945 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
4933 so that source code shown is guaranteed in sync with the file on
4946 so that source code shown is guaranteed in sync with the file on
4934 disk (also changed in psource). Similar fix to the one for
4947 disk (also changed in psource). Similar fix to the one for
4935 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4948 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
4936 <yann.ledu-AT-noos.fr>.
4949 <yann.ledu-AT-noos.fr>.
4937
4950
4938 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4951 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
4939 with a single option would not be correctly parsed. Closes
4952 with a single option would not be correctly parsed. Closes
4940 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4953 http://www.scipy.net/roundup/ipython/issue14. This bug had been
4941 introduced in 0.6.0 (on 2004-05-06).
4954 introduced in 0.6.0 (on 2004-05-06).
4942
4955
4943 2004-05-13 *** Released version 0.6.0
4956 2004-05-13 *** Released version 0.6.0
4944
4957
4945 2004-05-13 Fernando Perez <fperez@colorado.edu>
4958 2004-05-13 Fernando Perez <fperez@colorado.edu>
4946
4959
4947 * debian/: Added debian/ directory to CVS, so that debian support
4960 * debian/: Added debian/ directory to CVS, so that debian support
4948 is publicly accessible. The debian package is maintained by Jack
4961 is publicly accessible. The debian package is maintained by Jack
4949 Moffit <jack-AT-xiph.org>.
4962 Moffit <jack-AT-xiph.org>.
4950
4963
4951 * Documentation: included the notes about an ipython-based system
4964 * Documentation: included the notes about an ipython-based system
4952 shell (the hypothetical 'pysh') into the new_design.pdf document,
4965 shell (the hypothetical 'pysh') into the new_design.pdf document,
4953 so that these ideas get distributed to users along with the
4966 so that these ideas get distributed to users along with the
4954 official documentation.
4967 official documentation.
4955
4968
4956 2004-05-10 Fernando Perez <fperez@colorado.edu>
4969 2004-05-10 Fernando Perez <fperez@colorado.edu>
4957
4970
4958 * IPython/Logger.py (Logger.create_log): fix recently introduced
4971 * IPython/Logger.py (Logger.create_log): fix recently introduced
4959 bug (misindented line) where logstart would fail when not given an
4972 bug (misindented line) where logstart would fail when not given an
4960 explicit filename.
4973 explicit filename.
4961
4974
4962 2004-05-09 Fernando Perez <fperez@colorado.edu>
4975 2004-05-09 Fernando Perez <fperez@colorado.edu>
4963
4976
4964 * IPython/Magic.py (Magic.parse_options): skip system call when
4977 * IPython/Magic.py (Magic.parse_options): skip system call when
4965 there are no options to look for. Faster, cleaner for the common
4978 there are no options to look for. Faster, cleaner for the common
4966 case.
4979 case.
4967
4980
4968 * Documentation: many updates to the manual: describing Windows
4981 * Documentation: many updates to the manual: describing Windows
4969 support better, Gnuplot updates, credits, misc small stuff. Also
4982 support better, Gnuplot updates, credits, misc small stuff. Also
4970 updated the new_design doc a bit.
4983 updated the new_design doc a bit.
4971
4984
4972 2004-05-06 *** Released version 0.6.0.rc1
4985 2004-05-06 *** Released version 0.6.0.rc1
4973
4986
4974 2004-05-06 Fernando Perez <fperez@colorado.edu>
4987 2004-05-06 Fernando Perez <fperez@colorado.edu>
4975
4988
4976 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4989 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
4977 operations to use the vastly more efficient list/''.join() method.
4990 operations to use the vastly more efficient list/''.join() method.
4978 (FormattedTB.text): Fix
4991 (FormattedTB.text): Fix
4979 http://www.scipy.net/roundup/ipython/issue12 - exception source
4992 http://www.scipy.net/roundup/ipython/issue12 - exception source
4980 extract not updated after reload. Thanks to Mike Salib
4993 extract not updated after reload. Thanks to Mike Salib
4981 <msalib-AT-mit.edu> for pinning the source of the problem.
4994 <msalib-AT-mit.edu> for pinning the source of the problem.
4982 Fortunately, the solution works inside ipython and doesn't require
4995 Fortunately, the solution works inside ipython and doesn't require
4983 any changes to python proper.
4996 any changes to python proper.
4984
4997
4985 * IPython/Magic.py (Magic.parse_options): Improved to process the
4998 * IPython/Magic.py (Magic.parse_options): Improved to process the
4986 argument list as a true shell would (by actually using the
4999 argument list as a true shell would (by actually using the
4987 underlying system shell). This way, all @magics automatically get
5000 underlying system shell). This way, all @magics automatically get
4988 shell expansion for variables. Thanks to a comment by Alex
5001 shell expansion for variables. Thanks to a comment by Alex
4989 Schmolck.
5002 Schmolck.
4990
5003
4991 2004-04-04 Fernando Perez <fperez@colorado.edu>
5004 2004-04-04 Fernando Perez <fperez@colorado.edu>
4992
5005
4993 * IPython/iplib.py (InteractiveShell.interact): Added a special
5006 * IPython/iplib.py (InteractiveShell.interact): Added a special
4994 trap for a debugger quit exception, which is basically impossible
5007 trap for a debugger quit exception, which is basically impossible
4995 to handle by normal mechanisms, given what pdb does to the stack.
5008 to handle by normal mechanisms, given what pdb does to the stack.
4996 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
5009 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
4997
5010
4998 2004-04-03 Fernando Perez <fperez@colorado.edu>
5011 2004-04-03 Fernando Perez <fperez@colorado.edu>
4999
5012
5000 * IPython/genutils.py (Term): Standardized the names of the Term
5013 * IPython/genutils.py (Term): Standardized the names of the Term
5001 class streams to cin/cout/cerr, following C++ naming conventions
5014 class streams to cin/cout/cerr, following C++ naming conventions
5002 (I can't use in/out/err because 'in' is not a valid attribute
5015 (I can't use in/out/err because 'in' is not a valid attribute
5003 name).
5016 name).
5004
5017
5005 * IPython/iplib.py (InteractiveShell.interact): don't increment
5018 * IPython/iplib.py (InteractiveShell.interact): don't increment
5006 the prompt if there's no user input. By Daniel 'Dang' Griffith
5019 the prompt if there's no user input. By Daniel 'Dang' Griffith
5007 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
5020 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
5008 Francois Pinard.
5021 Francois Pinard.
5009
5022
5010 2004-04-02 Fernando Perez <fperez@colorado.edu>
5023 2004-04-02 Fernando Perez <fperez@colorado.edu>
5011
5024
5012 * IPython/genutils.py (Stream.__init__): Modified to survive at
5025 * IPython/genutils.py (Stream.__init__): Modified to survive at
5013 least importing in contexts where stdin/out/err aren't true file
5026 least importing in contexts where stdin/out/err aren't true file
5014 objects, such as PyCrust (they lack fileno() and mode). However,
5027 objects, such as PyCrust (they lack fileno() and mode). However,
5015 the recovery facilities which rely on these things existing will
5028 the recovery facilities which rely on these things existing will
5016 not work.
5029 not work.
5017
5030
5018 2004-04-01 Fernando Perez <fperez@colorado.edu>
5031 2004-04-01 Fernando Perez <fperez@colorado.edu>
5019
5032
5020 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
5033 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
5021 use the new getoutputerror() function, so it properly
5034 use the new getoutputerror() function, so it properly
5022 distinguishes stdout/err.
5035 distinguishes stdout/err.
5023
5036
5024 * IPython/genutils.py (getoutputerror): added a function to
5037 * IPython/genutils.py (getoutputerror): added a function to
5025 capture separately the standard output and error of a command.
5038 capture separately the standard output and error of a command.
5026 After a comment from dang on the mailing lists. This code is
5039 After a comment from dang on the mailing lists. This code is
5027 basically a modified version of commands.getstatusoutput(), from
5040 basically a modified version of commands.getstatusoutput(), from
5028 the standard library.
5041 the standard library.
5029
5042
5030 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
5043 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
5031 '!!' as a special syntax (shorthand) to access @sx.
5044 '!!' as a special syntax (shorthand) to access @sx.
5032
5045
5033 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
5046 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
5034 command and return its output as a list split on '\n'.
5047 command and return its output as a list split on '\n'.
5035
5048
5036 2004-03-31 Fernando Perez <fperez@colorado.edu>
5049 2004-03-31 Fernando Perez <fperez@colorado.edu>
5037
5050
5038 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
5051 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
5039 method to dictionaries used as FakeModule instances if they lack
5052 method to dictionaries used as FakeModule instances if they lack
5040 it. At least pydoc in python2.3 breaks for runtime-defined
5053 it. At least pydoc in python2.3 breaks for runtime-defined
5041 functions without this hack. At some point I need to _really_
5054 functions without this hack. At some point I need to _really_
5042 understand what FakeModule is doing, because it's a gross hack.
5055 understand what FakeModule is doing, because it's a gross hack.
5043 But it solves Arnd's problem for now...
5056 But it solves Arnd's problem for now...
5044
5057
5045 2004-02-27 Fernando Perez <fperez@colorado.edu>
5058 2004-02-27 Fernando Perez <fperez@colorado.edu>
5046
5059
5047 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
5060 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
5048 mode would behave erratically. Also increased the number of
5061 mode would behave erratically. Also increased the number of
5049 possible logs in rotate mod to 999. Thanks to Rod Holland
5062 possible logs in rotate mod to 999. Thanks to Rod Holland
5050 <rhh@StructureLABS.com> for the report and fixes.
5063 <rhh@StructureLABS.com> for the report and fixes.
5051
5064
5052 2004-02-26 Fernando Perez <fperez@colorado.edu>
5065 2004-02-26 Fernando Perez <fperez@colorado.edu>
5053
5066
5054 * IPython/genutils.py (page): Check that the curses module really
5067 * IPython/genutils.py (page): Check that the curses module really
5055 has the initscr attribute before trying to use it. For some
5068 has the initscr attribute before trying to use it. For some
5056 reason, the Solaris curses module is missing this. I think this
5069 reason, the Solaris curses module is missing this. I think this
5057 should be considered a Solaris python bug, but I'm not sure.
5070 should be considered a Solaris python bug, but I'm not sure.
5058
5071
5059 2004-01-17 Fernando Perez <fperez@colorado.edu>
5072 2004-01-17 Fernando Perez <fperez@colorado.edu>
5060
5073
5061 * IPython/genutils.py (Stream.__init__): Changes to try to make
5074 * IPython/genutils.py (Stream.__init__): Changes to try to make
5062 ipython robust against stdin/out/err being closed by the user.
5075 ipython robust against stdin/out/err being closed by the user.
5063 This is 'user error' (and blocks a normal python session, at least
5076 This is 'user error' (and blocks a normal python session, at least
5064 the stdout case). However, Ipython should be able to survive such
5077 the stdout case). However, Ipython should be able to survive such
5065 instances of abuse as gracefully as possible. To simplify the
5078 instances of abuse as gracefully as possible. To simplify the
5066 coding and maintain compatibility with Gary Bishop's Term
5079 coding and maintain compatibility with Gary Bishop's Term
5067 contributions, I've made use of classmethods for this. I think
5080 contributions, I've made use of classmethods for this. I think
5068 this introduces a dependency on python 2.2.
5081 this introduces a dependency on python 2.2.
5069
5082
5070 2004-01-13 Fernando Perez <fperez@colorado.edu>
5083 2004-01-13 Fernando Perez <fperez@colorado.edu>
5071
5084
5072 * IPython/numutils.py (exp_safe): simplified the code a bit and
5085 * IPython/numutils.py (exp_safe): simplified the code a bit and
5073 removed the need for importing the kinds module altogether.
5086 removed the need for importing the kinds module altogether.
5074
5087
5075 2004-01-06 Fernando Perez <fperez@colorado.edu>
5088 2004-01-06 Fernando Perez <fperez@colorado.edu>
5076
5089
5077 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
5090 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
5078 a magic function instead, after some community feedback. No
5091 a magic function instead, after some community feedback. No
5079 special syntax will exist for it, but its name is deliberately
5092 special syntax will exist for it, but its name is deliberately
5080 very short.
5093 very short.
5081
5094
5082 2003-12-20 Fernando Perez <fperez@colorado.edu>
5095 2003-12-20 Fernando Perez <fperez@colorado.edu>
5083
5096
5084 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
5097 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
5085 new functionality, to automagically assign the result of a shell
5098 new functionality, to automagically assign the result of a shell
5086 command to a variable. I'll solicit some community feedback on
5099 command to a variable. I'll solicit some community feedback on
5087 this before making it permanent.
5100 this before making it permanent.
5088
5101
5089 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
5102 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
5090 requested about callables for which inspect couldn't obtain a
5103 requested about callables for which inspect couldn't obtain a
5091 proper argspec. Thanks to a crash report sent by Etienne
5104 proper argspec. Thanks to a crash report sent by Etienne
5092 Posthumus <etienne-AT-apple01.cs.vu.nl>.
5105 Posthumus <etienne-AT-apple01.cs.vu.nl>.
5093
5106
5094 2003-12-09 Fernando Perez <fperez@colorado.edu>
5107 2003-12-09 Fernando Perez <fperez@colorado.edu>
5095
5108
5096 * IPython/genutils.py (page): patch for the pager to work across
5109 * IPython/genutils.py (page): patch for the pager to work across
5097 various versions of Windows. By Gary Bishop.
5110 various versions of Windows. By Gary Bishop.
5098
5111
5099 2003-12-04 Fernando Perez <fperez@colorado.edu>
5112 2003-12-04 Fernando Perez <fperez@colorado.edu>
5100
5113
5101 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
5114 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
5102 Gnuplot.py version 1.7, whose internal names changed quite a bit.
5115 Gnuplot.py version 1.7, whose internal names changed quite a bit.
5103 While I tested this and it looks ok, there may still be corner
5116 While I tested this and it looks ok, there may still be corner
5104 cases I've missed.
5117 cases I've missed.
5105
5118
5106 2003-12-01 Fernando Perez <fperez@colorado.edu>
5119 2003-12-01 Fernando Perez <fperez@colorado.edu>
5107
5120
5108 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
5121 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
5109 where a line like 'p,q=1,2' would fail because the automagic
5122 where a line like 'p,q=1,2' would fail because the automagic
5110 system would be triggered for @p.
5123 system would be triggered for @p.
5111
5124
5112 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
5125 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
5113 cleanups, code unmodified.
5126 cleanups, code unmodified.
5114
5127
5115 * IPython/genutils.py (Term): added a class for IPython to handle
5128 * IPython/genutils.py (Term): added a class for IPython to handle
5116 output. In most cases it will just be a proxy for stdout/err, but
5129 output. In most cases it will just be a proxy for stdout/err, but
5117 having this allows modifications to be made for some platforms,
5130 having this allows modifications to be made for some platforms,
5118 such as handling color escapes under Windows. All of this code
5131 such as handling color escapes under Windows. All of this code
5119 was contributed by Gary Bishop, with minor modifications by me.
5132 was contributed by Gary Bishop, with minor modifications by me.
5120 The actual changes affect many files.
5133 The actual changes affect many files.
5121
5134
5122 2003-11-30 Fernando Perez <fperez@colorado.edu>
5135 2003-11-30 Fernando Perez <fperez@colorado.edu>
5123
5136
5124 * IPython/iplib.py (file_matches): new completion code, courtesy
5137 * IPython/iplib.py (file_matches): new completion code, courtesy
5125 of Jeff Collins. This enables filename completion again under
5138 of Jeff Collins. This enables filename completion again under
5126 python 2.3, which disabled it at the C level.
5139 python 2.3, which disabled it at the C level.
5127
5140
5128 2003-11-11 Fernando Perez <fperez@colorado.edu>
5141 2003-11-11 Fernando Perez <fperez@colorado.edu>
5129
5142
5130 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
5143 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
5131 for Numeric.array(map(...)), but often convenient.
5144 for Numeric.array(map(...)), but often convenient.
5132
5145
5133 2003-11-05 Fernando Perez <fperez@colorado.edu>
5146 2003-11-05 Fernando Perez <fperez@colorado.edu>
5134
5147
5135 * IPython/numutils.py (frange): Changed a call from int() to
5148 * IPython/numutils.py (frange): Changed a call from int() to
5136 int(round()) to prevent a problem reported with arange() in the
5149 int(round()) to prevent a problem reported with arange() in the
5137 numpy list.
5150 numpy list.
5138
5151
5139 2003-10-06 Fernando Perez <fperez@colorado.edu>
5152 2003-10-06 Fernando Perez <fperez@colorado.edu>
5140
5153
5141 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
5154 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
5142 prevent crashes if sys lacks an argv attribute (it happens with
5155 prevent crashes if sys lacks an argv attribute (it happens with
5143 embedded interpreters which build a bare-bones sys module).
5156 embedded interpreters which build a bare-bones sys module).
5144 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
5157 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
5145
5158
5146 2003-09-24 Fernando Perez <fperez@colorado.edu>
5159 2003-09-24 Fernando Perez <fperez@colorado.edu>
5147
5160
5148 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
5161 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
5149 to protect against poorly written user objects where __getattr__
5162 to protect against poorly written user objects where __getattr__
5150 raises exceptions other than AttributeError. Thanks to a bug
5163 raises exceptions other than AttributeError. Thanks to a bug
5151 report by Oliver Sander <osander-AT-gmx.de>.
5164 report by Oliver Sander <osander-AT-gmx.de>.
5152
5165
5153 * IPython/FakeModule.py (FakeModule.__repr__): this method was
5166 * IPython/FakeModule.py (FakeModule.__repr__): this method was
5154 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
5167 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
5155
5168
5156 2003-09-09 Fernando Perez <fperez@colorado.edu>
5169 2003-09-09 Fernando Perez <fperez@colorado.edu>
5157
5170
5158 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
5171 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
5159 unpacking a list whith a callable as first element would
5172 unpacking a list whith a callable as first element would
5160 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
5173 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
5161 Collins.
5174 Collins.
5162
5175
5163 2003-08-25 *** Released version 0.5.0
5176 2003-08-25 *** Released version 0.5.0
5164
5177
5165 2003-08-22 Fernando Perez <fperez@colorado.edu>
5178 2003-08-22 Fernando Perez <fperez@colorado.edu>
5166
5179
5167 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
5180 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
5168 improperly defined user exceptions. Thanks to feedback from Mark
5181 improperly defined user exceptions. Thanks to feedback from Mark
5169 Russell <mrussell-AT-verio.net>.
5182 Russell <mrussell-AT-verio.net>.
5170
5183
5171 2003-08-20 Fernando Perez <fperez@colorado.edu>
5184 2003-08-20 Fernando Perez <fperez@colorado.edu>
5172
5185
5173 * IPython/OInspect.py (Inspector.pinfo): changed String Form
5186 * IPython/OInspect.py (Inspector.pinfo): changed String Form
5174 printing so that it would print multi-line string forms starting
5187 printing so that it would print multi-line string forms starting
5175 with a new line. This way the formatting is better respected for
5188 with a new line. This way the formatting is better respected for
5176 objects which work hard to make nice string forms.
5189 objects which work hard to make nice string forms.
5177
5190
5178 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
5191 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
5179 autocall would overtake data access for objects with both
5192 autocall would overtake data access for objects with both
5180 __getitem__ and __call__.
5193 __getitem__ and __call__.
5181
5194
5182 2003-08-19 *** Released version 0.5.0-rc1
5195 2003-08-19 *** Released version 0.5.0-rc1
5183
5196
5184 2003-08-19 Fernando Perez <fperez@colorado.edu>
5197 2003-08-19 Fernando Perez <fperez@colorado.edu>
5185
5198
5186 * IPython/deep_reload.py (load_tail): single tiny change here
5199 * IPython/deep_reload.py (load_tail): single tiny change here
5187 seems to fix the long-standing bug of dreload() failing to work
5200 seems to fix the long-standing bug of dreload() failing to work
5188 for dotted names. But this module is pretty tricky, so I may have
5201 for dotted names. But this module is pretty tricky, so I may have
5189 missed some subtlety. Needs more testing!.
5202 missed some subtlety. Needs more testing!.
5190
5203
5191 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
5204 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
5192 exceptions which have badly implemented __str__ methods.
5205 exceptions which have badly implemented __str__ methods.
5193 (VerboseTB.text): harden against inspect.getinnerframes crashing,
5206 (VerboseTB.text): harden against inspect.getinnerframes crashing,
5194 which I've been getting reports about from Python 2.3 users. I
5207 which I've been getting reports about from Python 2.3 users. I
5195 wish I had a simple test case to reproduce the problem, so I could
5208 wish I had a simple test case to reproduce the problem, so I could
5196 either write a cleaner workaround or file a bug report if
5209 either write a cleaner workaround or file a bug report if
5197 necessary.
5210 necessary.
5198
5211
5199 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
5212 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
5200 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
5213 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
5201 a bug report by Tjabo Kloppenburg.
5214 a bug report by Tjabo Kloppenburg.
5202
5215
5203 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
5216 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
5204 crashes. Wrapped the pdb call in a blanket try/except, since pdb
5217 crashes. Wrapped the pdb call in a blanket try/except, since pdb
5205 seems rather unstable. Thanks to a bug report by Tjabo
5218 seems rather unstable. Thanks to a bug report by Tjabo
5206 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
5219 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
5207
5220
5208 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
5221 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
5209 this out soon because of the critical fixes in the inner loop for
5222 this out soon because of the critical fixes in the inner loop for
5210 generators.
5223 generators.
5211
5224
5212 * IPython/Magic.py (Magic.getargspec): removed. This (and
5225 * IPython/Magic.py (Magic.getargspec): removed. This (and
5213 _get_def) have been obsoleted by OInspect for a long time, I
5226 _get_def) have been obsoleted by OInspect for a long time, I
5214 hadn't noticed that they were dead code.
5227 hadn't noticed that they were dead code.
5215 (Magic._ofind): restored _ofind functionality for a few literals
5228 (Magic._ofind): restored _ofind functionality for a few literals
5216 (those in ["''",'""','[]','{}','()']). But it won't work anymore
5229 (those in ["''",'""','[]','{}','()']). But it won't work anymore
5217 for things like "hello".capitalize?, since that would require a
5230 for things like "hello".capitalize?, since that would require a
5218 potentially dangerous eval() again.
5231 potentially dangerous eval() again.
5219
5232
5220 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
5233 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
5221 logic a bit more to clean up the escapes handling and minimize the
5234 logic a bit more to clean up the escapes handling and minimize the
5222 use of _ofind to only necessary cases. The interactive 'feel' of
5235 use of _ofind to only necessary cases. The interactive 'feel' of
5223 IPython should have improved quite a bit with the changes in
5236 IPython should have improved quite a bit with the changes in
5224 _prefilter and _ofind (besides being far safer than before).
5237 _prefilter and _ofind (besides being far safer than before).
5225
5238
5226 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
5239 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
5227 obscure, never reported). Edit would fail to find the object to
5240 obscure, never reported). Edit would fail to find the object to
5228 edit under some circumstances.
5241 edit under some circumstances.
5229 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
5242 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
5230 which were causing double-calling of generators. Those eval calls
5243 which were causing double-calling of generators. Those eval calls
5231 were _very_ dangerous, since code with side effects could be
5244 were _very_ dangerous, since code with side effects could be
5232 triggered. As they say, 'eval is evil'... These were the
5245 triggered. As they say, 'eval is evil'... These were the
5233 nastiest evals in IPython. Besides, _ofind is now far simpler,
5246 nastiest evals in IPython. Besides, _ofind is now far simpler,
5234 and it should also be quite a bit faster. Its use of inspect is
5247 and it should also be quite a bit faster. Its use of inspect is
5235 also safer, so perhaps some of the inspect-related crashes I've
5248 also safer, so perhaps some of the inspect-related crashes I've
5236 seen lately with Python 2.3 might be taken care of. That will
5249 seen lately with Python 2.3 might be taken care of. That will
5237 need more testing.
5250 need more testing.
5238
5251
5239 2003-08-17 Fernando Perez <fperez@colorado.edu>
5252 2003-08-17 Fernando Perez <fperez@colorado.edu>
5240
5253
5241 * IPython/iplib.py (InteractiveShell._prefilter): significant
5254 * IPython/iplib.py (InteractiveShell._prefilter): significant
5242 simplifications to the logic for handling user escapes. Faster
5255 simplifications to the logic for handling user escapes. Faster
5243 and simpler code.
5256 and simpler code.
5244
5257
5245 2003-08-14 Fernando Perez <fperez@colorado.edu>
5258 2003-08-14 Fernando Perez <fperez@colorado.edu>
5246
5259
5247 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
5260 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
5248 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
5261 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
5249 but it should be quite a bit faster. And the recursive version
5262 but it should be quite a bit faster. And the recursive version
5250 generated O(log N) intermediate storage for all rank>1 arrays,
5263 generated O(log N) intermediate storage for all rank>1 arrays,
5251 even if they were contiguous.
5264 even if they were contiguous.
5252 (l1norm): Added this function.
5265 (l1norm): Added this function.
5253 (norm): Added this function for arbitrary norms (including
5266 (norm): Added this function for arbitrary norms (including
5254 l-infinity). l1 and l2 are still special cases for convenience
5267 l-infinity). l1 and l2 are still special cases for convenience
5255 and speed.
5268 and speed.
5256
5269
5257 2003-08-03 Fernando Perez <fperez@colorado.edu>
5270 2003-08-03 Fernando Perez <fperez@colorado.edu>
5258
5271
5259 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
5272 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
5260 exceptions, which now raise PendingDeprecationWarnings in Python
5273 exceptions, which now raise PendingDeprecationWarnings in Python
5261 2.3. There were some in Magic and some in Gnuplot2.
5274 2.3. There were some in Magic and some in Gnuplot2.
5262
5275
5263 2003-06-30 Fernando Perez <fperez@colorado.edu>
5276 2003-06-30 Fernando Perez <fperez@colorado.edu>
5264
5277
5265 * IPython/genutils.py (page): modified to call curses only for
5278 * IPython/genutils.py (page): modified to call curses only for
5266 terminals where TERM=='xterm'. After problems under many other
5279 terminals where TERM=='xterm'. After problems under many other
5267 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
5280 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
5268
5281
5269 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
5282 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
5270 would be triggered when readline was absent. This was just an old
5283 would be triggered when readline was absent. This was just an old
5271 debugging statement I'd forgotten to take out.
5284 debugging statement I'd forgotten to take out.
5272
5285
5273 2003-06-20 Fernando Perez <fperez@colorado.edu>
5286 2003-06-20 Fernando Perez <fperez@colorado.edu>
5274
5287
5275 * IPython/genutils.py (clock): modified to return only user time
5288 * IPython/genutils.py (clock): modified to return only user time
5276 (not counting system time), after a discussion on scipy. While
5289 (not counting system time), after a discussion on scipy. While
5277 system time may be a useful quantity occasionally, it may much
5290 system time may be a useful quantity occasionally, it may much
5278 more easily be skewed by occasional swapping or other similar
5291 more easily be skewed by occasional swapping or other similar
5279 activity.
5292 activity.
5280
5293
5281 2003-06-05 Fernando Perez <fperez@colorado.edu>
5294 2003-06-05 Fernando Perez <fperez@colorado.edu>
5282
5295
5283 * IPython/numutils.py (identity): new function, for building
5296 * IPython/numutils.py (identity): new function, for building
5284 arbitrary rank Kronecker deltas (mostly backwards compatible with
5297 arbitrary rank Kronecker deltas (mostly backwards compatible with
5285 Numeric.identity)
5298 Numeric.identity)
5286
5299
5287 2003-06-03 Fernando Perez <fperez@colorado.edu>
5300 2003-06-03 Fernando Perez <fperez@colorado.edu>
5288
5301
5289 * IPython/iplib.py (InteractiveShell.handle_magic): protect
5302 * IPython/iplib.py (InteractiveShell.handle_magic): protect
5290 arguments passed to magics with spaces, to allow trailing '\' to
5303 arguments passed to magics with spaces, to allow trailing '\' to
5291 work normally (mainly for Windows users).
5304 work normally (mainly for Windows users).
5292
5305
5293 2003-05-29 Fernando Perez <fperez@colorado.edu>
5306 2003-05-29 Fernando Perez <fperez@colorado.edu>
5294
5307
5295 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
5308 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
5296 instead of pydoc.help. This fixes a bizarre behavior where
5309 instead of pydoc.help. This fixes a bizarre behavior where
5297 printing '%s' % locals() would trigger the help system. Now
5310 printing '%s' % locals() would trigger the help system. Now
5298 ipython behaves like normal python does.
5311 ipython behaves like normal python does.
5299
5312
5300 Note that if one does 'from pydoc import help', the bizarre
5313 Note that if one does 'from pydoc import help', the bizarre
5301 behavior returns, but this will also happen in normal python, so
5314 behavior returns, but this will also happen in normal python, so
5302 it's not an ipython bug anymore (it has to do with how pydoc.help
5315 it's not an ipython bug anymore (it has to do with how pydoc.help
5303 is implemented).
5316 is implemented).
5304
5317
5305 2003-05-22 Fernando Perez <fperez@colorado.edu>
5318 2003-05-22 Fernando Perez <fperez@colorado.edu>
5306
5319
5307 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
5320 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
5308 return [] instead of None when nothing matches, also match to end
5321 return [] instead of None when nothing matches, also match to end
5309 of line. Patch by Gary Bishop.
5322 of line. Patch by Gary Bishop.
5310
5323
5311 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
5324 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
5312 protection as before, for files passed on the command line. This
5325 protection as before, for files passed on the command line. This
5313 prevents the CrashHandler from kicking in if user files call into
5326 prevents the CrashHandler from kicking in if user files call into
5314 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
5327 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
5315 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
5328 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
5316
5329
5317 2003-05-20 *** Released version 0.4.0
5330 2003-05-20 *** Released version 0.4.0
5318
5331
5319 2003-05-20 Fernando Perez <fperez@colorado.edu>
5332 2003-05-20 Fernando Perez <fperez@colorado.edu>
5320
5333
5321 * setup.py: added support for manpages. It's a bit hackish b/c of
5334 * setup.py: added support for manpages. It's a bit hackish b/c of
5322 a bug in the way the bdist_rpm distutils target handles gzipped
5335 a bug in the way the bdist_rpm distutils target handles gzipped
5323 manpages, but it works. After a patch by Jack.
5336 manpages, but it works. After a patch by Jack.
5324
5337
5325 2003-05-19 Fernando Perez <fperez@colorado.edu>
5338 2003-05-19 Fernando Perez <fperez@colorado.edu>
5326
5339
5327 * IPython/numutils.py: added a mockup of the kinds module, since
5340 * IPython/numutils.py: added a mockup of the kinds module, since
5328 it was recently removed from Numeric. This way, numutils will
5341 it was recently removed from Numeric. This way, numutils will
5329 work for all users even if they are missing kinds.
5342 work for all users even if they are missing kinds.
5330
5343
5331 * IPython/Magic.py (Magic._ofind): Harden against an inspect
5344 * IPython/Magic.py (Magic._ofind): Harden against an inspect
5332 failure, which can occur with SWIG-wrapped extensions. After a
5345 failure, which can occur with SWIG-wrapped extensions. After a
5333 crash report from Prabhu.
5346 crash report from Prabhu.
5334
5347
5335 2003-05-16 Fernando Perez <fperez@colorado.edu>
5348 2003-05-16 Fernando Perez <fperez@colorado.edu>
5336
5349
5337 * IPython/iplib.py (InteractiveShell.excepthook): New method to
5350 * IPython/iplib.py (InteractiveShell.excepthook): New method to
5338 protect ipython from user code which may call directly
5351 protect ipython from user code which may call directly
5339 sys.excepthook (this looks like an ipython crash to the user, even
5352 sys.excepthook (this looks like an ipython crash to the user, even
5340 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
5353 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
5341 This is especially important to help users of WxWindows, but may
5354 This is especially important to help users of WxWindows, but may
5342 also be useful in other cases.
5355 also be useful in other cases.
5343
5356
5344 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
5357 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
5345 an optional tb_offset to be specified, and to preserve exception
5358 an optional tb_offset to be specified, and to preserve exception
5346 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
5359 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
5347
5360
5348 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
5361 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
5349
5362
5350 2003-05-15 Fernando Perez <fperez@colorado.edu>
5363 2003-05-15 Fernando Perez <fperez@colorado.edu>
5351
5364
5352 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
5365 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
5353 installing for a new user under Windows.
5366 installing for a new user under Windows.
5354
5367
5355 2003-05-12 Fernando Perez <fperez@colorado.edu>
5368 2003-05-12 Fernando Perez <fperez@colorado.edu>
5356
5369
5357 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
5370 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
5358 handler for Emacs comint-based lines. Currently it doesn't do
5371 handler for Emacs comint-based lines. Currently it doesn't do
5359 much (but importantly, it doesn't update the history cache). In
5372 much (but importantly, it doesn't update the history cache). In
5360 the future it may be expanded if Alex needs more functionality
5373 the future it may be expanded if Alex needs more functionality
5361 there.
5374 there.
5362
5375
5363 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
5376 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
5364 info to crash reports.
5377 info to crash reports.
5365
5378
5366 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
5379 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
5367 just like Python's -c. Also fixed crash with invalid -color
5380 just like Python's -c. Also fixed crash with invalid -color
5368 option value at startup. Thanks to Will French
5381 option value at startup. Thanks to Will French
5369 <wfrench-AT-bestweb.net> for the bug report.
5382 <wfrench-AT-bestweb.net> for the bug report.
5370
5383
5371 2003-05-09 Fernando Perez <fperez@colorado.edu>
5384 2003-05-09 Fernando Perez <fperez@colorado.edu>
5372
5385
5373 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
5386 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
5374 to EvalDict (it's a mapping, after all) and simplified its code
5387 to EvalDict (it's a mapping, after all) and simplified its code
5375 quite a bit, after a nice discussion on c.l.py where Gustavo
5388 quite a bit, after a nice discussion on c.l.py where Gustavo
5376 Córdova <gcordova-AT-sismex.com> suggested the new version.
5389 Córdova <gcordova-AT-sismex.com> suggested the new version.
5377
5390
5378 2003-04-30 Fernando Perez <fperez@colorado.edu>
5391 2003-04-30 Fernando Perez <fperez@colorado.edu>
5379
5392
5380 * IPython/genutils.py (timings_out): modified it to reduce its
5393 * IPython/genutils.py (timings_out): modified it to reduce its
5381 overhead in the common reps==1 case.
5394 overhead in the common reps==1 case.
5382
5395
5383 2003-04-29 Fernando Perez <fperez@colorado.edu>
5396 2003-04-29 Fernando Perez <fperez@colorado.edu>
5384
5397
5385 * IPython/genutils.py (timings_out): Modified to use the resource
5398 * IPython/genutils.py (timings_out): Modified to use the resource
5386 module, which avoids the wraparound problems of time.clock().
5399 module, which avoids the wraparound problems of time.clock().
5387
5400
5388 2003-04-17 *** Released version 0.2.15pre4
5401 2003-04-17 *** Released version 0.2.15pre4
5389
5402
5390 2003-04-17 Fernando Perez <fperez@colorado.edu>
5403 2003-04-17 Fernando Perez <fperez@colorado.edu>
5391
5404
5392 * setup.py (scriptfiles): Split windows-specific stuff over to a
5405 * setup.py (scriptfiles): Split windows-specific stuff over to a
5393 separate file, in an attempt to have a Windows GUI installer.
5406 separate file, in an attempt to have a Windows GUI installer.
5394 That didn't work, but part of the groundwork is done.
5407 That didn't work, but part of the groundwork is done.
5395
5408
5396 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
5409 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
5397 indent/unindent with 4 spaces. Particularly useful in combination
5410 indent/unindent with 4 spaces. Particularly useful in combination
5398 with the new auto-indent option.
5411 with the new auto-indent option.
5399
5412
5400 2003-04-16 Fernando Perez <fperez@colorado.edu>
5413 2003-04-16 Fernando Perez <fperez@colorado.edu>
5401
5414
5402 * IPython/Magic.py: various replacements of self.rc for
5415 * IPython/Magic.py: various replacements of self.rc for
5403 self.shell.rc. A lot more remains to be done to fully disentangle
5416 self.shell.rc. A lot more remains to be done to fully disentangle
5404 this class from the main Shell class.
5417 this class from the main Shell class.
5405
5418
5406 * IPython/GnuplotRuntime.py: added checks for mouse support so
5419 * IPython/GnuplotRuntime.py: added checks for mouse support so
5407 that we don't try to enable it if the current gnuplot doesn't
5420 that we don't try to enable it if the current gnuplot doesn't
5408 really support it. Also added checks so that we don't try to
5421 really support it. Also added checks so that we don't try to
5409 enable persist under Windows (where Gnuplot doesn't recognize the
5422 enable persist under Windows (where Gnuplot doesn't recognize the
5410 option).
5423 option).
5411
5424
5412 * IPython/iplib.py (InteractiveShell.interact): Added optional
5425 * IPython/iplib.py (InteractiveShell.interact): Added optional
5413 auto-indenting code, after a patch by King C. Shu
5426 auto-indenting code, after a patch by King C. Shu
5414 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
5427 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
5415 get along well with pasting indented code. If I ever figure out
5428 get along well with pasting indented code. If I ever figure out
5416 how to make that part go well, it will become on by default.
5429 how to make that part go well, it will become on by default.
5417
5430
5418 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
5431 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
5419 crash ipython if there was an unmatched '%' in the user's prompt
5432 crash ipython if there was an unmatched '%' in the user's prompt
5420 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5433 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5421
5434
5422 * IPython/iplib.py (InteractiveShell.interact): removed the
5435 * IPython/iplib.py (InteractiveShell.interact): removed the
5423 ability to ask the user whether he wants to crash or not at the
5436 ability to ask the user whether he wants to crash or not at the
5424 'last line' exception handler. Calling functions at that point
5437 'last line' exception handler. Calling functions at that point
5425 changes the stack, and the error reports would have incorrect
5438 changes the stack, and the error reports would have incorrect
5426 tracebacks.
5439 tracebacks.
5427
5440
5428 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
5441 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
5429 pass through a peger a pretty-printed form of any object. After a
5442 pass through a peger a pretty-printed form of any object. After a
5430 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
5443 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
5431
5444
5432 2003-04-14 Fernando Perez <fperez@colorado.edu>
5445 2003-04-14 Fernando Perez <fperez@colorado.edu>
5433
5446
5434 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
5447 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
5435 all files in ~ would be modified at first install (instead of
5448 all files in ~ would be modified at first install (instead of
5436 ~/.ipython). This could be potentially disastrous, as the
5449 ~/.ipython). This could be potentially disastrous, as the
5437 modification (make line-endings native) could damage binary files.
5450 modification (make line-endings native) could damage binary files.
5438
5451
5439 2003-04-10 Fernando Perez <fperez@colorado.edu>
5452 2003-04-10 Fernando Perez <fperez@colorado.edu>
5440
5453
5441 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
5454 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
5442 handle only lines which are invalid python. This now means that
5455 handle only lines which are invalid python. This now means that
5443 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
5456 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
5444 for the bug report.
5457 for the bug report.
5445
5458
5446 2003-04-01 Fernando Perez <fperez@colorado.edu>
5459 2003-04-01 Fernando Perez <fperez@colorado.edu>
5447
5460
5448 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
5461 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
5449 where failing to set sys.last_traceback would crash pdb.pm().
5462 where failing to set sys.last_traceback would crash pdb.pm().
5450 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
5463 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
5451 report.
5464 report.
5452
5465
5453 2003-03-25 Fernando Perez <fperez@colorado.edu>
5466 2003-03-25 Fernando Perez <fperez@colorado.edu>
5454
5467
5455 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
5468 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
5456 before printing it (it had a lot of spurious blank lines at the
5469 before printing it (it had a lot of spurious blank lines at the
5457 end).
5470 end).
5458
5471
5459 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
5472 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
5460 output would be sent 21 times! Obviously people don't use this
5473 output would be sent 21 times! Obviously people don't use this
5461 too often, or I would have heard about it.
5474 too often, or I would have heard about it.
5462
5475
5463 2003-03-24 Fernando Perez <fperez@colorado.edu>
5476 2003-03-24 Fernando Perez <fperez@colorado.edu>
5464
5477
5465 * setup.py (scriptfiles): renamed the data_files parameter from
5478 * setup.py (scriptfiles): renamed the data_files parameter from
5466 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5479 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
5467 for the patch.
5480 for the patch.
5468
5481
5469 2003-03-20 Fernando Perez <fperez@colorado.edu>
5482 2003-03-20 Fernando Perez <fperez@colorado.edu>
5470
5483
5471 * IPython/genutils.py (error): added error() and fatal()
5484 * IPython/genutils.py (error): added error() and fatal()
5472 functions.
5485 functions.
5473
5486
5474 2003-03-18 *** Released version 0.2.15pre3
5487 2003-03-18 *** Released version 0.2.15pre3
5475
5488
5476 2003-03-18 Fernando Perez <fperez@colorado.edu>
5489 2003-03-18 Fernando Perez <fperez@colorado.edu>
5477
5490
5478 * setupext/install_data_ext.py
5491 * setupext/install_data_ext.py
5479 (install_data_ext.initialize_options): Class contributed by Jack
5492 (install_data_ext.initialize_options): Class contributed by Jack
5480 Moffit for fixing the old distutils hack. He is sending this to
5493 Moffit for fixing the old distutils hack. He is sending this to
5481 the distutils folks so in the future we may not need it as a
5494 the distutils folks so in the future we may not need it as a
5482 private fix.
5495 private fix.
5483
5496
5484 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5497 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
5485 changes for Debian packaging. See his patch for full details.
5498 changes for Debian packaging. See his patch for full details.
5486 The old distutils hack of making the ipythonrc* files carry a
5499 The old distutils hack of making the ipythonrc* files carry a
5487 bogus .py extension is gone, at last. Examples were moved to a
5500 bogus .py extension is gone, at last. Examples were moved to a
5488 separate subdir under doc/, and the separate executable scripts
5501 separate subdir under doc/, and the separate executable scripts
5489 now live in their own directory. Overall a great cleanup. The
5502 now live in their own directory. Overall a great cleanup. The
5490 manual was updated to use the new files, and setup.py has been
5503 manual was updated to use the new files, and setup.py has been
5491 fixed for this setup.
5504 fixed for this setup.
5492
5505
5493 * IPython/PyColorize.py (Parser.usage): made non-executable and
5506 * IPython/PyColorize.py (Parser.usage): made non-executable and
5494 created a pycolor wrapper around it to be included as a script.
5507 created a pycolor wrapper around it to be included as a script.
5495
5508
5496 2003-03-12 *** Released version 0.2.15pre2
5509 2003-03-12 *** Released version 0.2.15pre2
5497
5510
5498 2003-03-12 Fernando Perez <fperez@colorado.edu>
5511 2003-03-12 Fernando Perez <fperez@colorado.edu>
5499
5512
5500 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5513 * IPython/ColorANSI.py (make_color_table): Finally fixed the
5501 long-standing problem with garbage characters in some terminals.
5514 long-standing problem with garbage characters in some terminals.
5502 The issue was really that the \001 and \002 escapes must _only_ be
5515 The issue was really that the \001 and \002 escapes must _only_ be
5503 passed to input prompts (which call readline), but _never_ to
5516 passed to input prompts (which call readline), but _never_ to
5504 normal text to be printed on screen. I changed ColorANSI to have
5517 normal text to be printed on screen. I changed ColorANSI to have
5505 two classes: TermColors and InputTermColors, each with the
5518 two classes: TermColors and InputTermColors, each with the
5506 appropriate escapes for input prompts or normal text. The code in
5519 appropriate escapes for input prompts or normal text. The code in
5507 Prompts.py got slightly more complicated, but this very old and
5520 Prompts.py got slightly more complicated, but this very old and
5508 annoying bug is finally fixed.
5521 annoying bug is finally fixed.
5509
5522
5510 All the credit for nailing down the real origin of this problem
5523 All the credit for nailing down the real origin of this problem
5511 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5524 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
5512 *Many* thanks to him for spending quite a bit of effort on this.
5525 *Many* thanks to him for spending quite a bit of effort on this.
5513
5526
5514 2003-03-05 *** Released version 0.2.15pre1
5527 2003-03-05 *** Released version 0.2.15pre1
5515
5528
5516 2003-03-03 Fernando Perez <fperez@colorado.edu>
5529 2003-03-03 Fernando Perez <fperez@colorado.edu>
5517
5530
5518 * IPython/FakeModule.py: Moved the former _FakeModule to a
5531 * IPython/FakeModule.py: Moved the former _FakeModule to a
5519 separate file, because it's also needed by Magic (to fix a similar
5532 separate file, because it's also needed by Magic (to fix a similar
5520 pickle-related issue in @run).
5533 pickle-related issue in @run).
5521
5534
5522 2003-03-02 Fernando Perez <fperez@colorado.edu>
5535 2003-03-02 Fernando Perez <fperez@colorado.edu>
5523
5536
5524 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5537 * IPython/Magic.py (Magic.magic_autocall): new magic to control
5525 the autocall option at runtime.
5538 the autocall option at runtime.
5526 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5539 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
5527 across Magic.py to start separating Magic from InteractiveShell.
5540 across Magic.py to start separating Magic from InteractiveShell.
5528 (Magic._ofind): Fixed to return proper namespace for dotted
5541 (Magic._ofind): Fixed to return proper namespace for dotted
5529 names. Before, a dotted name would always return 'not currently
5542 names. Before, a dotted name would always return 'not currently
5530 defined', because it would find the 'parent'. s.x would be found,
5543 defined', because it would find the 'parent'. s.x would be found,
5531 but since 'x' isn't defined by itself, it would get confused.
5544 but since 'x' isn't defined by itself, it would get confused.
5532 (Magic.magic_run): Fixed pickling problems reported by Ralf
5545 (Magic.magic_run): Fixed pickling problems reported by Ralf
5533 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5546 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
5534 that I'd used when Mike Heeter reported similar issues at the
5547 that I'd used when Mike Heeter reported similar issues at the
5535 top-level, but now for @run. It boils down to injecting the
5548 top-level, but now for @run. It boils down to injecting the
5536 namespace where code is being executed with something that looks
5549 namespace where code is being executed with something that looks
5537 enough like a module to fool pickle.dump(). Since a pickle stores
5550 enough like a module to fool pickle.dump(). Since a pickle stores
5538 a named reference to the importing module, we need this for
5551 a named reference to the importing module, we need this for
5539 pickles to save something sensible.
5552 pickles to save something sensible.
5540
5553
5541 * IPython/ipmaker.py (make_IPython): added an autocall option.
5554 * IPython/ipmaker.py (make_IPython): added an autocall option.
5542
5555
5543 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5556 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
5544 the auto-eval code. Now autocalling is an option, and the code is
5557 the auto-eval code. Now autocalling is an option, and the code is
5545 also vastly safer. There is no more eval() involved at all.
5558 also vastly safer. There is no more eval() involved at all.
5546
5559
5547 2003-03-01 Fernando Perez <fperez@colorado.edu>
5560 2003-03-01 Fernando Perez <fperez@colorado.edu>
5548
5561
5549 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5562 * IPython/Magic.py (Magic._ofind): Changed interface to return a
5550 dict with named keys instead of a tuple.
5563 dict with named keys instead of a tuple.
5551
5564
5552 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5565 * IPython: Started using CVS for IPython as of 0.2.15pre1.
5553
5566
5554 * setup.py (make_shortcut): Fixed message about directories
5567 * setup.py (make_shortcut): Fixed message about directories
5555 created during Windows installation (the directories were ok, just
5568 created during Windows installation (the directories were ok, just
5556 the printed message was misleading). Thanks to Chris Liechti
5569 the printed message was misleading). Thanks to Chris Liechti
5557 <cliechti-AT-gmx.net> for the heads up.
5570 <cliechti-AT-gmx.net> for the heads up.
5558
5571
5559 2003-02-21 Fernando Perez <fperez@colorado.edu>
5572 2003-02-21 Fernando Perez <fperez@colorado.edu>
5560
5573
5561 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5574 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
5562 of ValueError exception when checking for auto-execution. This
5575 of ValueError exception when checking for auto-execution. This
5563 one is raised by things like Numeric arrays arr.flat when the
5576 one is raised by things like Numeric arrays arr.flat when the
5564 array is non-contiguous.
5577 array is non-contiguous.
5565
5578
5566 2003-01-31 Fernando Perez <fperez@colorado.edu>
5579 2003-01-31 Fernando Perez <fperez@colorado.edu>
5567
5580
5568 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5581 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
5569 not return any value at all (even though the command would get
5582 not return any value at all (even though the command would get
5570 executed).
5583 executed).
5571 (xsys): Flush stdout right after printing the command to ensure
5584 (xsys): Flush stdout right after printing the command to ensure
5572 proper ordering of commands and command output in the total
5585 proper ordering of commands and command output in the total
5573 output.
5586 output.
5574 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5587 (SystemExec/xsys/bq): Switched the names of xsys/bq and
5575 system/getoutput as defaults. The old ones are kept for
5588 system/getoutput as defaults. The old ones are kept for
5576 compatibility reasons, so no code which uses this library needs
5589 compatibility reasons, so no code which uses this library needs
5577 changing.
5590 changing.
5578
5591
5579 2003-01-27 *** Released version 0.2.14
5592 2003-01-27 *** Released version 0.2.14
5580
5593
5581 2003-01-25 Fernando Perez <fperez@colorado.edu>
5594 2003-01-25 Fernando Perez <fperez@colorado.edu>
5582
5595
5583 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5596 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
5584 functions defined in previous edit sessions could not be re-edited
5597 functions defined in previous edit sessions could not be re-edited
5585 (because the temp files were immediately removed). Now temp files
5598 (because the temp files were immediately removed). Now temp files
5586 are removed only at IPython's exit.
5599 are removed only at IPython's exit.
5587 (Magic.magic_run): Improved @run to perform shell-like expansions
5600 (Magic.magic_run): Improved @run to perform shell-like expansions
5588 on its arguments (~users and $VARS). With this, @run becomes more
5601 on its arguments (~users and $VARS). With this, @run becomes more
5589 like a normal command-line.
5602 like a normal command-line.
5590
5603
5591 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5604 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
5592 bugs related to embedding and cleaned up that code. A fairly
5605 bugs related to embedding and cleaned up that code. A fairly
5593 important one was the impossibility to access the global namespace
5606 important one was the impossibility to access the global namespace
5594 through the embedded IPython (only local variables were visible).
5607 through the embedded IPython (only local variables were visible).
5595
5608
5596 2003-01-14 Fernando Perez <fperez@colorado.edu>
5609 2003-01-14 Fernando Perez <fperez@colorado.edu>
5597
5610
5598 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5611 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
5599 auto-calling to be a bit more conservative. Now it doesn't get
5612 auto-calling to be a bit more conservative. Now it doesn't get
5600 triggered if any of '!=()<>' are in the rest of the input line, to
5613 triggered if any of '!=()<>' are in the rest of the input line, to
5601 allow comparing callables. Thanks to Alex for the heads up.
5614 allow comparing callables. Thanks to Alex for the heads up.
5602
5615
5603 2003-01-07 Fernando Perez <fperez@colorado.edu>
5616 2003-01-07 Fernando Perez <fperez@colorado.edu>
5604
5617
5605 * IPython/genutils.py (page): fixed estimation of the number of
5618 * IPython/genutils.py (page): fixed estimation of the number of
5606 lines in a string to be paged to simply count newlines. This
5619 lines in a string to be paged to simply count newlines. This
5607 prevents over-guessing due to embedded escape sequences. A better
5620 prevents over-guessing due to embedded escape sequences. A better
5608 long-term solution would involve stripping out the control chars
5621 long-term solution would involve stripping out the control chars
5609 for the count, but it's potentially so expensive I just don't
5622 for the count, but it's potentially so expensive I just don't
5610 think it's worth doing.
5623 think it's worth doing.
5611
5624
5612 2002-12-19 *** Released version 0.2.14pre50
5625 2002-12-19 *** Released version 0.2.14pre50
5613
5626
5614 2002-12-19 Fernando Perez <fperez@colorado.edu>
5627 2002-12-19 Fernando Perez <fperez@colorado.edu>
5615
5628
5616 * tools/release (version): Changed release scripts to inform
5629 * tools/release (version): Changed release scripts to inform
5617 Andrea and build a NEWS file with a list of recent changes.
5630 Andrea and build a NEWS file with a list of recent changes.
5618
5631
5619 * IPython/ColorANSI.py (__all__): changed terminal detection
5632 * IPython/ColorANSI.py (__all__): changed terminal detection
5620 code. Seems to work better for xterms without breaking
5633 code. Seems to work better for xterms without breaking
5621 konsole. Will need more testing to determine if WinXP and Mac OSX
5634 konsole. Will need more testing to determine if WinXP and Mac OSX
5622 also work ok.
5635 also work ok.
5623
5636
5624 2002-12-18 *** Released version 0.2.14pre49
5637 2002-12-18 *** Released version 0.2.14pre49
5625
5638
5626 2002-12-18 Fernando Perez <fperez@colorado.edu>
5639 2002-12-18 Fernando Perez <fperez@colorado.edu>
5627
5640
5628 * Docs: added new info about Mac OSX, from Andrea.
5641 * Docs: added new info about Mac OSX, from Andrea.
5629
5642
5630 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5643 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
5631 allow direct plotting of python strings whose format is the same
5644 allow direct plotting of python strings whose format is the same
5632 of gnuplot data files.
5645 of gnuplot data files.
5633
5646
5634 2002-12-16 Fernando Perez <fperez@colorado.edu>
5647 2002-12-16 Fernando Perez <fperez@colorado.edu>
5635
5648
5636 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5649 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
5637 value of exit question to be acknowledged.
5650 value of exit question to be acknowledged.
5638
5651
5639 2002-12-03 Fernando Perez <fperez@colorado.edu>
5652 2002-12-03 Fernando Perez <fperez@colorado.edu>
5640
5653
5641 * IPython/ipmaker.py: removed generators, which had been added
5654 * IPython/ipmaker.py: removed generators, which had been added
5642 by mistake in an earlier debugging run. This was causing trouble
5655 by mistake in an earlier debugging run. This was causing trouble
5643 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5656 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
5644 for pointing this out.
5657 for pointing this out.
5645
5658
5646 2002-11-17 Fernando Perez <fperez@colorado.edu>
5659 2002-11-17 Fernando Perez <fperez@colorado.edu>
5647
5660
5648 * Manual: updated the Gnuplot section.
5661 * Manual: updated the Gnuplot section.
5649
5662
5650 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5663 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
5651 a much better split of what goes in Runtime and what goes in
5664 a much better split of what goes in Runtime and what goes in
5652 Interactive.
5665 Interactive.
5653
5666
5654 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5667 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
5655 being imported from iplib.
5668 being imported from iplib.
5656
5669
5657 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5670 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
5658 for command-passing. Now the global Gnuplot instance is called
5671 for command-passing. Now the global Gnuplot instance is called
5659 'gp' instead of 'g', which was really a far too fragile and
5672 'gp' instead of 'g', which was really a far too fragile and
5660 common name.
5673 common name.
5661
5674
5662 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5675 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
5663 bounding boxes generated by Gnuplot for square plots.
5676 bounding boxes generated by Gnuplot for square plots.
5664
5677
5665 * IPython/genutils.py (popkey): new function added. I should
5678 * IPython/genutils.py (popkey): new function added. I should
5666 suggest this on c.l.py as a dict method, it seems useful.
5679 suggest this on c.l.py as a dict method, it seems useful.
5667
5680
5668 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5681 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
5669 to transparently handle PostScript generation. MUCH better than
5682 to transparently handle PostScript generation. MUCH better than
5670 the previous plot_eps/replot_eps (which I removed now). The code
5683 the previous plot_eps/replot_eps (which I removed now). The code
5671 is also fairly clean and well documented now (including
5684 is also fairly clean and well documented now (including
5672 docstrings).
5685 docstrings).
5673
5686
5674 2002-11-13 Fernando Perez <fperez@colorado.edu>
5687 2002-11-13 Fernando Perez <fperez@colorado.edu>
5675
5688
5676 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5689 * IPython/Magic.py (Magic.magic_edit): fixed docstring
5677 (inconsistent with options).
5690 (inconsistent with options).
5678
5691
5679 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5692 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
5680 manually disabled, I don't know why. Fixed it.
5693 manually disabled, I don't know why. Fixed it.
5681 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5694 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
5682 eps output.
5695 eps output.
5683
5696
5684 2002-11-12 Fernando Perez <fperez@colorado.edu>
5697 2002-11-12 Fernando Perez <fperez@colorado.edu>
5685
5698
5686 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5699 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
5687 don't propagate up to caller. Fixes crash reported by François
5700 don't propagate up to caller. Fixes crash reported by François
5688 Pinard.
5701 Pinard.
5689
5702
5690 2002-11-09 Fernando Perez <fperez@colorado.edu>
5703 2002-11-09 Fernando Perez <fperez@colorado.edu>
5691
5704
5692 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5705 * IPython/ipmaker.py (make_IPython): fixed problem with writing
5693 history file for new users.
5706 history file for new users.
5694 (make_IPython): fixed bug where initial install would leave the
5707 (make_IPython): fixed bug where initial install would leave the
5695 user running in the .ipython dir.
5708 user running in the .ipython dir.
5696 (make_IPython): fixed bug where config dir .ipython would be
5709 (make_IPython): fixed bug where config dir .ipython would be
5697 created regardless of the given -ipythondir option. Thanks to Cory
5710 created regardless of the given -ipythondir option. Thanks to Cory
5698 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5711 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
5699
5712
5700 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5713 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
5701 type confirmations. Will need to use it in all of IPython's code
5714 type confirmations. Will need to use it in all of IPython's code
5702 consistently.
5715 consistently.
5703
5716
5704 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5717 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
5705 context to print 31 lines instead of the default 5. This will make
5718 context to print 31 lines instead of the default 5. This will make
5706 the crash reports extremely detailed in case the problem is in
5719 the crash reports extremely detailed in case the problem is in
5707 libraries I don't have access to.
5720 libraries I don't have access to.
5708
5721
5709 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5722 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
5710 line of defense' code to still crash, but giving users fair
5723 line of defense' code to still crash, but giving users fair
5711 warning. I don't want internal errors to go unreported: if there's
5724 warning. I don't want internal errors to go unreported: if there's
5712 an internal problem, IPython should crash and generate a full
5725 an internal problem, IPython should crash and generate a full
5713 report.
5726 report.
5714
5727
5715 2002-11-08 Fernando Perez <fperez@colorado.edu>
5728 2002-11-08 Fernando Perez <fperez@colorado.edu>
5716
5729
5717 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5730 * IPython/iplib.py (InteractiveShell.interact): added code to trap
5718 otherwise uncaught exceptions which can appear if people set
5731 otherwise uncaught exceptions which can appear if people set
5719 sys.stdout to something badly broken. Thanks to a crash report
5732 sys.stdout to something badly broken. Thanks to a crash report
5720 from henni-AT-mail.brainbot.com.
5733 from henni-AT-mail.brainbot.com.
5721
5734
5722 2002-11-04 Fernando Perez <fperez@colorado.edu>
5735 2002-11-04 Fernando Perez <fperez@colorado.edu>
5723
5736
5724 * IPython/iplib.py (InteractiveShell.interact): added
5737 * IPython/iplib.py (InteractiveShell.interact): added
5725 __IPYTHON__active to the builtins. It's a flag which goes on when
5738 __IPYTHON__active to the builtins. It's a flag which goes on when
5726 the interaction starts and goes off again when it stops. This
5739 the interaction starts and goes off again when it stops. This
5727 allows embedding code to detect being inside IPython. Before this
5740 allows embedding code to detect being inside IPython. Before this
5728 was done via __IPYTHON__, but that only shows that an IPython
5741 was done via __IPYTHON__, but that only shows that an IPython
5729 instance has been created.
5742 instance has been created.
5730
5743
5731 * IPython/Magic.py (Magic.magic_env): I realized that in a
5744 * IPython/Magic.py (Magic.magic_env): I realized that in a
5732 UserDict, instance.data holds the data as a normal dict. So I
5745 UserDict, instance.data holds the data as a normal dict. So I
5733 modified @env to return os.environ.data instead of rebuilding a
5746 modified @env to return os.environ.data instead of rebuilding a
5734 dict by hand.
5747 dict by hand.
5735
5748
5736 2002-11-02 Fernando Perez <fperez@colorado.edu>
5749 2002-11-02 Fernando Perez <fperez@colorado.edu>
5737
5750
5738 * IPython/genutils.py (warn): changed so that level 1 prints no
5751 * IPython/genutils.py (warn): changed so that level 1 prints no
5739 header. Level 2 is now the default (with 'WARNING' header, as
5752 header. Level 2 is now the default (with 'WARNING' header, as
5740 before). I think I tracked all places where changes were needed in
5753 before). I think I tracked all places where changes were needed in
5741 IPython, but outside code using the old level numbering may have
5754 IPython, but outside code using the old level numbering may have
5742 broken.
5755 broken.
5743
5756
5744 * IPython/iplib.py (InteractiveShell.runcode): added this to
5757 * IPython/iplib.py (InteractiveShell.runcode): added this to
5745 handle the tracebacks in SystemExit traps correctly. The previous
5758 handle the tracebacks in SystemExit traps correctly. The previous
5746 code (through interact) was printing more of the stack than
5759 code (through interact) was printing more of the stack than
5747 necessary, showing IPython internal code to the user.
5760 necessary, showing IPython internal code to the user.
5748
5761
5749 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5762 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
5750 default. Now that the default at the confirmation prompt is yes,
5763 default. Now that the default at the confirmation prompt is yes,
5751 it's not so intrusive. François' argument that ipython sessions
5764 it's not so intrusive. François' argument that ipython sessions
5752 tend to be complex enough not to lose them from an accidental C-d,
5765 tend to be complex enough not to lose them from an accidental C-d,
5753 is a valid one.
5766 is a valid one.
5754
5767
5755 * IPython/iplib.py (InteractiveShell.interact): added a
5768 * IPython/iplib.py (InteractiveShell.interact): added a
5756 showtraceback() call to the SystemExit trap, and modified the exit
5769 showtraceback() call to the SystemExit trap, and modified the exit
5757 confirmation to have yes as the default.
5770 confirmation to have yes as the default.
5758
5771
5759 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5772 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
5760 this file. It's been gone from the code for a long time, this was
5773 this file. It's been gone from the code for a long time, this was
5761 simply leftover junk.
5774 simply leftover junk.
5762
5775
5763 2002-11-01 Fernando Perez <fperez@colorado.edu>
5776 2002-11-01 Fernando Perez <fperez@colorado.edu>
5764
5777
5765 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5778 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
5766 added. If set, IPython now traps EOF and asks for
5779 added. If set, IPython now traps EOF and asks for
5767 confirmation. After a request by François Pinard.
5780 confirmation. After a request by François Pinard.
5768
5781
5769 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5782 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
5770 of @abort, and with a new (better) mechanism for handling the
5783 of @abort, and with a new (better) mechanism for handling the
5771 exceptions.
5784 exceptions.
5772
5785
5773 2002-10-27 Fernando Perez <fperez@colorado.edu>
5786 2002-10-27 Fernando Perez <fperez@colorado.edu>
5774
5787
5775 * IPython/usage.py (__doc__): updated the --help information and
5788 * IPython/usage.py (__doc__): updated the --help information and
5776 the ipythonrc file to indicate that -log generates
5789 the ipythonrc file to indicate that -log generates
5777 ./ipython.log. Also fixed the corresponding info in @logstart.
5790 ./ipython.log. Also fixed the corresponding info in @logstart.
5778 This and several other fixes in the manuals thanks to reports by
5791 This and several other fixes in the manuals thanks to reports by
5779 François Pinard <pinard-AT-iro.umontreal.ca>.
5792 François Pinard <pinard-AT-iro.umontreal.ca>.
5780
5793
5781 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5794 * IPython/Logger.py (Logger.switch_log): Fixed error message to
5782 refer to @logstart (instead of @log, which doesn't exist).
5795 refer to @logstart (instead of @log, which doesn't exist).
5783
5796
5784 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5797 * IPython/iplib.py (InteractiveShell._prefilter): fixed
5785 AttributeError crash. Thanks to Christopher Armstrong
5798 AttributeError crash. Thanks to Christopher Armstrong
5786 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5799 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
5787 introduced recently (in 0.2.14pre37) with the fix to the eval
5800 introduced recently (in 0.2.14pre37) with the fix to the eval
5788 problem mentioned below.
5801 problem mentioned below.
5789
5802
5790 2002-10-17 Fernando Perez <fperez@colorado.edu>
5803 2002-10-17 Fernando Perez <fperez@colorado.edu>
5791
5804
5792 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5805 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
5793 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5806 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
5794
5807
5795 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5808 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
5796 this function to fix a problem reported by Alex Schmolck. He saw
5809 this function to fix a problem reported by Alex Schmolck. He saw
5797 it with list comprehensions and generators, which were getting
5810 it with list comprehensions and generators, which were getting
5798 called twice. The real problem was an 'eval' call in testing for
5811 called twice. The real problem was an 'eval' call in testing for
5799 automagic which was evaluating the input line silently.
5812 automagic which was evaluating the input line silently.
5800
5813
5801 This is a potentially very nasty bug, if the input has side
5814 This is a potentially very nasty bug, if the input has side
5802 effects which must not be repeated. The code is much cleaner now,
5815 effects which must not be repeated. The code is much cleaner now,
5803 without any blanket 'except' left and with a regexp test for
5816 without any blanket 'except' left and with a regexp test for
5804 actual function names.
5817 actual function names.
5805
5818
5806 But an eval remains, which I'm not fully comfortable with. I just
5819 But an eval remains, which I'm not fully comfortable with. I just
5807 don't know how to find out if an expression could be a callable in
5820 don't know how to find out if an expression could be a callable in
5808 the user's namespace without doing an eval on the string. However
5821 the user's namespace without doing an eval on the string. However
5809 that string is now much more strictly checked so that no code
5822 that string is now much more strictly checked so that no code
5810 slips by, so the eval should only happen for things that can
5823 slips by, so the eval should only happen for things that can
5811 really be only function/method names.
5824 really be only function/method names.
5812
5825
5813 2002-10-15 Fernando Perez <fperez@colorado.edu>
5826 2002-10-15 Fernando Perez <fperez@colorado.edu>
5814
5827
5815 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5828 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
5816 OSX information to main manual, removed README_Mac_OSX file from
5829 OSX information to main manual, removed README_Mac_OSX file from
5817 distribution. Also updated credits for recent additions.
5830 distribution. Also updated credits for recent additions.
5818
5831
5819 2002-10-10 Fernando Perez <fperez@colorado.edu>
5832 2002-10-10 Fernando Perez <fperez@colorado.edu>
5820
5833
5821 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5834 * README_Mac_OSX: Added a README for Mac OSX users for fixing
5822 terminal-related issues. Many thanks to Andrea Riciputi
5835 terminal-related issues. Many thanks to Andrea Riciputi
5823 <andrea.riciputi-AT-libero.it> for writing it.
5836 <andrea.riciputi-AT-libero.it> for writing it.
5824
5837
5825 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5838 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
5826 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5839 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
5827
5840
5828 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5841 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
5829 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5842 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
5830 <syver-en-AT-online.no> who both submitted patches for this problem.
5843 <syver-en-AT-online.no> who both submitted patches for this problem.
5831
5844
5832 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5845 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
5833 global embedding to make sure that things don't overwrite user
5846 global embedding to make sure that things don't overwrite user
5834 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5847 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
5835
5848
5836 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5849 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
5837 compatibility. Thanks to Hayden Callow
5850 compatibility. Thanks to Hayden Callow
5838 <h.callow-AT-elec.canterbury.ac.nz>
5851 <h.callow-AT-elec.canterbury.ac.nz>
5839
5852
5840 2002-10-04 Fernando Perez <fperez@colorado.edu>
5853 2002-10-04 Fernando Perez <fperez@colorado.edu>
5841
5854
5842 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5855 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
5843 Gnuplot.File objects.
5856 Gnuplot.File objects.
5844
5857
5845 2002-07-23 Fernando Perez <fperez@colorado.edu>
5858 2002-07-23 Fernando Perez <fperez@colorado.edu>
5846
5859
5847 * IPython/genutils.py (timing): Added timings() and timing() for
5860 * IPython/genutils.py (timing): Added timings() and timing() for
5848 quick access to the most commonly needed data, the execution
5861 quick access to the most commonly needed data, the execution
5849 times. Old timing() renamed to timings_out().
5862 times. Old timing() renamed to timings_out().
5850
5863
5851 2002-07-18 Fernando Perez <fperez@colorado.edu>
5864 2002-07-18 Fernando Perez <fperez@colorado.edu>
5852
5865
5853 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5866 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
5854 bug with nested instances disrupting the parent's tab completion.
5867 bug with nested instances disrupting the parent's tab completion.
5855
5868
5856 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5869 * IPython/iplib.py (all_completions): Added Alex Schmolck's
5857 all_completions code to begin the emacs integration.
5870 all_completions code to begin the emacs integration.
5858
5871
5859 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5872 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
5860 argument to allow titling individual arrays when plotting.
5873 argument to allow titling individual arrays when plotting.
5861
5874
5862 2002-07-15 Fernando Perez <fperez@colorado.edu>
5875 2002-07-15 Fernando Perez <fperez@colorado.edu>
5863
5876
5864 * setup.py (make_shortcut): changed to retrieve the value of
5877 * setup.py (make_shortcut): changed to retrieve the value of
5865 'Program Files' directory from the registry (this value changes in
5878 'Program Files' directory from the registry (this value changes in
5866 non-english versions of Windows). Thanks to Thomas Fanslau
5879 non-english versions of Windows). Thanks to Thomas Fanslau
5867 <tfanslau-AT-gmx.de> for the report.
5880 <tfanslau-AT-gmx.de> for the report.
5868
5881
5869 2002-07-10 Fernando Perez <fperez@colorado.edu>
5882 2002-07-10 Fernando Perez <fperez@colorado.edu>
5870
5883
5871 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5884 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
5872 a bug in pdb, which crashes if a line with only whitespace is
5885 a bug in pdb, which crashes if a line with only whitespace is
5873 entered. Bug report submitted to sourceforge.
5886 entered. Bug report submitted to sourceforge.
5874
5887
5875 2002-07-09 Fernando Perez <fperez@colorado.edu>
5888 2002-07-09 Fernando Perez <fperez@colorado.edu>
5876
5889
5877 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5890 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
5878 reporting exceptions (it's a bug in inspect.py, I just set a
5891 reporting exceptions (it's a bug in inspect.py, I just set a
5879 workaround).
5892 workaround).
5880
5893
5881 2002-07-08 Fernando Perez <fperez@colorado.edu>
5894 2002-07-08 Fernando Perez <fperez@colorado.edu>
5882
5895
5883 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5896 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
5884 __IPYTHON__ in __builtins__ to show up in user_ns.
5897 __IPYTHON__ in __builtins__ to show up in user_ns.
5885
5898
5886 2002-07-03 Fernando Perez <fperez@colorado.edu>
5899 2002-07-03 Fernando Perez <fperez@colorado.edu>
5887
5900
5888 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5901 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
5889 name from @gp_set_instance to @gp_set_default.
5902 name from @gp_set_instance to @gp_set_default.
5890
5903
5891 * IPython/ipmaker.py (make_IPython): default editor value set to
5904 * IPython/ipmaker.py (make_IPython): default editor value set to
5892 '0' (a string), to match the rc file. Otherwise will crash when
5905 '0' (a string), to match the rc file. Otherwise will crash when
5893 .strip() is called on it.
5906 .strip() is called on it.
5894
5907
5895
5908
5896 2002-06-28 Fernando Perez <fperez@colorado.edu>
5909 2002-06-28 Fernando Perez <fperez@colorado.edu>
5897
5910
5898 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5911 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
5899 of files in current directory when a file is executed via
5912 of files in current directory when a file is executed via
5900 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5913 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
5901
5914
5902 * setup.py (manfiles): fix for rpm builds, submitted by RA
5915 * setup.py (manfiles): fix for rpm builds, submitted by RA
5903 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5916 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
5904
5917
5905 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5918 * IPython/ipmaker.py (make_IPython): fixed lookup of default
5906 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5919 editor when set to '0'. Problem was, '0' evaluates to True (it's a
5907 string!). A. Schmolck caught this one.
5920 string!). A. Schmolck caught this one.
5908
5921
5909 2002-06-27 Fernando Perez <fperez@colorado.edu>
5922 2002-06-27 Fernando Perez <fperez@colorado.edu>
5910
5923
5911 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5924 * IPython/ipmaker.py (make_IPython): fixed bug when running user
5912 defined files at the cmd line. __name__ wasn't being set to
5925 defined files at the cmd line. __name__ wasn't being set to
5913 __main__.
5926 __main__.
5914
5927
5915 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5928 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
5916 regular lists and tuples besides Numeric arrays.
5929 regular lists and tuples besides Numeric arrays.
5917
5930
5918 * IPython/Prompts.py (CachedOutput.__call__): Added output
5931 * IPython/Prompts.py (CachedOutput.__call__): Added output
5919 supression for input ending with ';'. Similar to Mathematica and
5932 supression for input ending with ';'. Similar to Mathematica and
5920 Matlab. The _* vars and Out[] list are still updated, just like
5933 Matlab. The _* vars and Out[] list are still updated, just like
5921 Mathematica behaves.
5934 Mathematica behaves.
5922
5935
5923 2002-06-25 Fernando Perez <fperez@colorado.edu>
5936 2002-06-25 Fernando Perez <fperez@colorado.edu>
5924
5937
5925 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5938 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
5926 .ini extensions for profiels under Windows.
5939 .ini extensions for profiels under Windows.
5927
5940
5928 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5941 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
5929 string form. Fix contributed by Alexander Schmolck
5942 string form. Fix contributed by Alexander Schmolck
5930 <a.schmolck-AT-gmx.net>
5943 <a.schmolck-AT-gmx.net>
5931
5944
5932 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5945 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
5933 pre-configured Gnuplot instance.
5946 pre-configured Gnuplot instance.
5934
5947
5935 2002-06-21 Fernando Perez <fperez@colorado.edu>
5948 2002-06-21 Fernando Perez <fperez@colorado.edu>
5936
5949
5937 * IPython/numutils.py (exp_safe): new function, works around the
5950 * IPython/numutils.py (exp_safe): new function, works around the
5938 underflow problems in Numeric.
5951 underflow problems in Numeric.
5939 (log2): New fn. Safe log in base 2: returns exact integer answer
5952 (log2): New fn. Safe log in base 2: returns exact integer answer
5940 for exact integer powers of 2.
5953 for exact integer powers of 2.
5941
5954
5942 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5955 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
5943 properly.
5956 properly.
5944
5957
5945 2002-06-20 Fernando Perez <fperez@colorado.edu>
5958 2002-06-20 Fernando Perez <fperez@colorado.edu>
5946
5959
5947 * IPython/genutils.py (timing): new function like
5960 * IPython/genutils.py (timing): new function like
5948 Mathematica's. Similar to time_test, but returns more info.
5961 Mathematica's. Similar to time_test, but returns more info.
5949
5962
5950 2002-06-18 Fernando Perez <fperez@colorado.edu>
5963 2002-06-18 Fernando Perez <fperez@colorado.edu>
5951
5964
5952 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5965 * IPython/Magic.py (Magic.magic_save): modified @save and @r
5953 according to Mike Heeter's suggestions.
5966 according to Mike Heeter's suggestions.
5954
5967
5955 2002-06-16 Fernando Perez <fperez@colorado.edu>
5968 2002-06-16 Fernando Perez <fperez@colorado.edu>
5956
5969
5957 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5970 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
5958 system. GnuplotMagic is gone as a user-directory option. New files
5971 system. GnuplotMagic is gone as a user-directory option. New files
5959 make it easier to use all the gnuplot stuff both from external
5972 make it easier to use all the gnuplot stuff both from external
5960 programs as well as from IPython. Had to rewrite part of
5973 programs as well as from IPython. Had to rewrite part of
5961 hardcopy() b/c of a strange bug: often the ps files simply don't
5974 hardcopy() b/c of a strange bug: often the ps files simply don't
5962 get created, and require a repeat of the command (often several
5975 get created, and require a repeat of the command (often several
5963 times).
5976 times).
5964
5977
5965 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5978 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
5966 resolve output channel at call time, so that if sys.stderr has
5979 resolve output channel at call time, so that if sys.stderr has
5967 been redirected by user this gets honored.
5980 been redirected by user this gets honored.
5968
5981
5969 2002-06-13 Fernando Perez <fperez@colorado.edu>
5982 2002-06-13 Fernando Perez <fperez@colorado.edu>
5970
5983
5971 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5984 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
5972 IPShell. Kept a copy with the old names to avoid breaking people's
5985 IPShell. Kept a copy with the old names to avoid breaking people's
5973 embedded code.
5986 embedded code.
5974
5987
5975 * IPython/ipython: simplified it to the bare minimum after
5988 * IPython/ipython: simplified it to the bare minimum after
5976 Holger's suggestions. Added info about how to use it in
5989 Holger's suggestions. Added info about how to use it in
5977 PYTHONSTARTUP.
5990 PYTHONSTARTUP.
5978
5991
5979 * IPython/Shell.py (IPythonShell): changed the options passing
5992 * IPython/Shell.py (IPythonShell): changed the options passing
5980 from a string with funky %s replacements to a straight list. Maybe
5993 from a string with funky %s replacements to a straight list. Maybe
5981 a bit more typing, but it follows sys.argv conventions, so there's
5994 a bit more typing, but it follows sys.argv conventions, so there's
5982 less special-casing to remember.
5995 less special-casing to remember.
5983
5996
5984 2002-06-12 Fernando Perez <fperez@colorado.edu>
5997 2002-06-12 Fernando Perez <fperez@colorado.edu>
5985
5998
5986 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5999 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
5987 command. Thanks to a suggestion by Mike Heeter.
6000 command. Thanks to a suggestion by Mike Heeter.
5988 (Magic.magic_pfile): added behavior to look at filenames if given
6001 (Magic.magic_pfile): added behavior to look at filenames if given
5989 arg is not a defined object.
6002 arg is not a defined object.
5990 (Magic.magic_save): New @save function to save code snippets. Also
6003 (Magic.magic_save): New @save function to save code snippets. Also
5991 a Mike Heeter idea.
6004 a Mike Heeter idea.
5992
6005
5993 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
6006 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
5994 plot() and replot(). Much more convenient now, especially for
6007 plot() and replot(). Much more convenient now, especially for
5995 interactive use.
6008 interactive use.
5996
6009
5997 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
6010 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
5998 filenames.
6011 filenames.
5999
6012
6000 2002-06-02 Fernando Perez <fperez@colorado.edu>
6013 2002-06-02 Fernando Perez <fperez@colorado.edu>
6001
6014
6002 * IPython/Struct.py (Struct.__init__): modified to admit
6015 * IPython/Struct.py (Struct.__init__): modified to admit
6003 initialization via another struct.
6016 initialization via another struct.
6004
6017
6005 * IPython/genutils.py (SystemExec.__init__): New stateful
6018 * IPython/genutils.py (SystemExec.__init__): New stateful
6006 interface to xsys and bq. Useful for writing system scripts.
6019 interface to xsys and bq. Useful for writing system scripts.
6007
6020
6008 2002-05-30 Fernando Perez <fperez@colorado.edu>
6021 2002-05-30 Fernando Perez <fperez@colorado.edu>
6009
6022
6010 * MANIFEST.in: Changed docfile selection to exclude all the lyx
6023 * MANIFEST.in: Changed docfile selection to exclude all the lyx
6011 documents. This will make the user download smaller (it's getting
6024 documents. This will make the user download smaller (it's getting
6012 too big).
6025 too big).
6013
6026
6014 2002-05-29 Fernando Perez <fperez@colorado.edu>
6027 2002-05-29 Fernando Perez <fperez@colorado.edu>
6015
6028
6016 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
6029 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
6017 fix problems with shelve and pickle. Seems to work, but I don't
6030 fix problems with shelve and pickle. Seems to work, but I don't
6018 know if corner cases break it. Thanks to Mike Heeter
6031 know if corner cases break it. Thanks to Mike Heeter
6019 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
6032 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
6020
6033
6021 2002-05-24 Fernando Perez <fperez@colorado.edu>
6034 2002-05-24 Fernando Perez <fperez@colorado.edu>
6022
6035
6023 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
6036 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
6024 macros having broken.
6037 macros having broken.
6025
6038
6026 2002-05-21 Fernando Perez <fperez@colorado.edu>
6039 2002-05-21 Fernando Perez <fperez@colorado.edu>
6027
6040
6028 * IPython/Magic.py (Magic.magic_logstart): fixed recently
6041 * IPython/Magic.py (Magic.magic_logstart): fixed recently
6029 introduced logging bug: all history before logging started was
6042 introduced logging bug: all history before logging started was
6030 being written one character per line! This came from the redesign
6043 being written one character per line! This came from the redesign
6031 of the input history as a special list which slices to strings,
6044 of the input history as a special list which slices to strings,
6032 not to lists.
6045 not to lists.
6033
6046
6034 2002-05-20 Fernando Perez <fperez@colorado.edu>
6047 2002-05-20 Fernando Perez <fperez@colorado.edu>
6035
6048
6036 * IPython/Prompts.py (CachedOutput.__init__): made the color table
6049 * IPython/Prompts.py (CachedOutput.__init__): made the color table
6037 be an attribute of all classes in this module. The design of these
6050 be an attribute of all classes in this module. The design of these
6038 classes needs some serious overhauling.
6051 classes needs some serious overhauling.
6039
6052
6040 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
6053 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
6041 which was ignoring '_' in option names.
6054 which was ignoring '_' in option names.
6042
6055
6043 * IPython/ultraTB.py (FormattedTB.__init__): Changed
6056 * IPython/ultraTB.py (FormattedTB.__init__): Changed
6044 'Verbose_novars' to 'Context' and made it the new default. It's a
6057 'Verbose_novars' to 'Context' and made it the new default. It's a
6045 bit more readable and also safer than verbose.
6058 bit more readable and also safer than verbose.
6046
6059
6047 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
6060 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
6048 triple-quoted strings.
6061 triple-quoted strings.
6049
6062
6050 * IPython/OInspect.py (__all__): new module exposing the object
6063 * IPython/OInspect.py (__all__): new module exposing the object
6051 introspection facilities. Now the corresponding magics are dummy
6064 introspection facilities. Now the corresponding magics are dummy
6052 wrappers around this. Having this module will make it much easier
6065 wrappers around this. Having this module will make it much easier
6053 to put these functions into our modified pdb.
6066 to put these functions into our modified pdb.
6054 This new object inspector system uses the new colorizing module,
6067 This new object inspector system uses the new colorizing module,
6055 so source code and other things are nicely syntax highlighted.
6068 so source code and other things are nicely syntax highlighted.
6056
6069
6057 2002-05-18 Fernando Perez <fperez@colorado.edu>
6070 2002-05-18 Fernando Perez <fperez@colorado.edu>
6058
6071
6059 * IPython/ColorANSI.py: Split the coloring tools into a separate
6072 * IPython/ColorANSI.py: Split the coloring tools into a separate
6060 module so I can use them in other code easier (they were part of
6073 module so I can use them in other code easier (they were part of
6061 ultraTB).
6074 ultraTB).
6062
6075
6063 2002-05-17 Fernando Perez <fperez@colorado.edu>
6076 2002-05-17 Fernando Perez <fperez@colorado.edu>
6064
6077
6065 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
6078 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
6066 fixed it to set the global 'g' also to the called instance, as
6079 fixed it to set the global 'g' also to the called instance, as
6067 long as 'g' was still a gnuplot instance (so it doesn't overwrite
6080 long as 'g' was still a gnuplot instance (so it doesn't overwrite
6068 user's 'g' variables).
6081 user's 'g' variables).
6069
6082
6070 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
6083 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
6071 global variables (aliases to _ih,_oh) so that users which expect
6084 global variables (aliases to _ih,_oh) so that users which expect
6072 In[5] or Out[7] to work aren't unpleasantly surprised.
6085 In[5] or Out[7] to work aren't unpleasantly surprised.
6073 (InputList.__getslice__): new class to allow executing slices of
6086 (InputList.__getslice__): new class to allow executing slices of
6074 input history directly. Very simple class, complements the use of
6087 input history directly. Very simple class, complements the use of
6075 macros.
6088 macros.
6076
6089
6077 2002-05-16 Fernando Perez <fperez@colorado.edu>
6090 2002-05-16 Fernando Perez <fperez@colorado.edu>
6078
6091
6079 * setup.py (docdirbase): make doc directory be just doc/IPython
6092 * setup.py (docdirbase): make doc directory be just doc/IPython
6080 without version numbers, it will reduce clutter for users.
6093 without version numbers, it will reduce clutter for users.
6081
6094
6082 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
6095 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
6083 execfile call to prevent possible memory leak. See for details:
6096 execfile call to prevent possible memory leak. See for details:
6084 http://mail.python.org/pipermail/python-list/2002-February/088476.html
6097 http://mail.python.org/pipermail/python-list/2002-February/088476.html
6085
6098
6086 2002-05-15 Fernando Perez <fperez@colorado.edu>
6099 2002-05-15 Fernando Perez <fperez@colorado.edu>
6087
6100
6088 * IPython/Magic.py (Magic.magic_psource): made the object
6101 * IPython/Magic.py (Magic.magic_psource): made the object
6089 introspection names be more standard: pdoc, pdef, pfile and
6102 introspection names be more standard: pdoc, pdef, pfile and
6090 psource. They all print/page their output, and it makes
6103 psource. They all print/page their output, and it makes
6091 remembering them easier. Kept old names for compatibility as
6104 remembering them easier. Kept old names for compatibility as
6092 aliases.
6105 aliases.
6093
6106
6094 2002-05-14 Fernando Perez <fperez@colorado.edu>
6107 2002-05-14 Fernando Perez <fperez@colorado.edu>
6095
6108
6096 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
6109 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
6097 what the mouse problem was. The trick is to use gnuplot with temp
6110 what the mouse problem was. The trick is to use gnuplot with temp
6098 files and NOT with pipes (for data communication), because having
6111 files and NOT with pipes (for data communication), because having
6099 both pipes and the mouse on is bad news.
6112 both pipes and the mouse on is bad news.
6100
6113
6101 2002-05-13 Fernando Perez <fperez@colorado.edu>
6114 2002-05-13 Fernando Perez <fperez@colorado.edu>
6102
6115
6103 * IPython/Magic.py (Magic._ofind): fixed namespace order search
6116 * IPython/Magic.py (Magic._ofind): fixed namespace order search
6104 bug. Information would be reported about builtins even when
6117 bug. Information would be reported about builtins even when
6105 user-defined functions overrode them.
6118 user-defined functions overrode them.
6106
6119
6107 2002-05-11 Fernando Perez <fperez@colorado.edu>
6120 2002-05-11 Fernando Perez <fperez@colorado.edu>
6108
6121
6109 * IPython/__init__.py (__all__): removed FlexCompleter from
6122 * IPython/__init__.py (__all__): removed FlexCompleter from
6110 __all__ so that things don't fail in platforms without readline.
6123 __all__ so that things don't fail in platforms without readline.
6111
6124
6112 2002-05-10 Fernando Perez <fperez@colorado.edu>
6125 2002-05-10 Fernando Perez <fperez@colorado.edu>
6113
6126
6114 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
6127 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
6115 it requires Numeric, effectively making Numeric a dependency for
6128 it requires Numeric, effectively making Numeric a dependency for
6116 IPython.
6129 IPython.
6117
6130
6118 * Released 0.2.13
6131 * Released 0.2.13
6119
6132
6120 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
6133 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
6121 profiler interface. Now all the major options from the profiler
6134 profiler interface. Now all the major options from the profiler
6122 module are directly supported in IPython, both for single
6135 module are directly supported in IPython, both for single
6123 expressions (@prun) and for full programs (@run -p).
6136 expressions (@prun) and for full programs (@run -p).
6124
6137
6125 2002-05-09 Fernando Perez <fperez@colorado.edu>
6138 2002-05-09 Fernando Perez <fperez@colorado.edu>
6126
6139
6127 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
6140 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
6128 magic properly formatted for screen.
6141 magic properly formatted for screen.
6129
6142
6130 * setup.py (make_shortcut): Changed things to put pdf version in
6143 * setup.py (make_shortcut): Changed things to put pdf version in
6131 doc/ instead of doc/manual (had to change lyxport a bit).
6144 doc/ instead of doc/manual (had to change lyxport a bit).
6132
6145
6133 * IPython/Magic.py (Profile.string_stats): made profile runs go
6146 * IPython/Magic.py (Profile.string_stats): made profile runs go
6134 through pager (they are long and a pager allows searching, saving,
6147 through pager (they are long and a pager allows searching, saving,
6135 etc.)
6148 etc.)
6136
6149
6137 2002-05-08 Fernando Perez <fperez@colorado.edu>
6150 2002-05-08 Fernando Perez <fperez@colorado.edu>
6138
6151
6139 * Released 0.2.12
6152 * Released 0.2.12
6140
6153
6141 2002-05-06 Fernando Perez <fperez@colorado.edu>
6154 2002-05-06 Fernando Perez <fperez@colorado.edu>
6142
6155
6143 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
6156 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
6144 introduced); 'hist n1 n2' was broken.
6157 introduced); 'hist n1 n2' was broken.
6145 (Magic.magic_pdb): added optional on/off arguments to @pdb
6158 (Magic.magic_pdb): added optional on/off arguments to @pdb
6146 (Magic.magic_run): added option -i to @run, which executes code in
6159 (Magic.magic_run): added option -i to @run, which executes code in
6147 the IPython namespace instead of a clean one. Also added @irun as
6160 the IPython namespace instead of a clean one. Also added @irun as
6148 an alias to @run -i.
6161 an alias to @run -i.
6149
6162
6150 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
6163 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
6151 fixed (it didn't really do anything, the namespaces were wrong).
6164 fixed (it didn't really do anything, the namespaces were wrong).
6152
6165
6153 * IPython/Debugger.py (__init__): Added workaround for python 2.1
6166 * IPython/Debugger.py (__init__): Added workaround for python 2.1
6154
6167
6155 * IPython/__init__.py (__all__): Fixed package namespace, now
6168 * IPython/__init__.py (__all__): Fixed package namespace, now
6156 'import IPython' does give access to IPython.<all> as
6169 'import IPython' does give access to IPython.<all> as
6157 expected. Also renamed __release__ to Release.
6170 expected. Also renamed __release__ to Release.
6158
6171
6159 * IPython/Debugger.py (__license__): created new Pdb class which
6172 * IPython/Debugger.py (__license__): created new Pdb class which
6160 functions like a drop-in for the normal pdb.Pdb but does NOT
6173 functions like a drop-in for the normal pdb.Pdb but does NOT
6161 import readline by default. This way it doesn't muck up IPython's
6174 import readline by default. This way it doesn't muck up IPython's
6162 readline handling, and now tab-completion finally works in the
6175 readline handling, and now tab-completion finally works in the
6163 debugger -- sort of. It completes things globally visible, but the
6176 debugger -- sort of. It completes things globally visible, but the
6164 completer doesn't track the stack as pdb walks it. That's a bit
6177 completer doesn't track the stack as pdb walks it. That's a bit
6165 tricky, and I'll have to implement it later.
6178 tricky, and I'll have to implement it later.
6166
6179
6167 2002-05-05 Fernando Perez <fperez@colorado.edu>
6180 2002-05-05 Fernando Perez <fperez@colorado.edu>
6168
6181
6169 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
6182 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
6170 magic docstrings when printed via ? (explicit \'s were being
6183 magic docstrings when printed via ? (explicit \'s were being
6171 printed).
6184 printed).
6172
6185
6173 * IPython/ipmaker.py (make_IPython): fixed namespace
6186 * IPython/ipmaker.py (make_IPython): fixed namespace
6174 identification bug. Now variables loaded via logs or command-line
6187 identification bug. Now variables loaded via logs or command-line
6175 files are recognized in the interactive namespace by @who.
6188 files are recognized in the interactive namespace by @who.
6176
6189
6177 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
6190 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
6178 log replay system stemming from the string form of Structs.
6191 log replay system stemming from the string form of Structs.
6179
6192
6180 * IPython/Magic.py (Macro.__init__): improved macros to properly
6193 * IPython/Magic.py (Macro.__init__): improved macros to properly
6181 handle magic commands in them.
6194 handle magic commands in them.
6182 (Magic.magic_logstart): usernames are now expanded so 'logstart
6195 (Magic.magic_logstart): usernames are now expanded so 'logstart
6183 ~/mylog' now works.
6196 ~/mylog' now works.
6184
6197
6185 * IPython/iplib.py (complete): fixed bug where paths starting with
6198 * IPython/iplib.py (complete): fixed bug where paths starting with
6186 '/' would be completed as magic names.
6199 '/' would be completed as magic names.
6187
6200
6188 2002-05-04 Fernando Perez <fperez@colorado.edu>
6201 2002-05-04 Fernando Perez <fperez@colorado.edu>
6189
6202
6190 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
6203 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
6191 allow running full programs under the profiler's control.
6204 allow running full programs under the profiler's control.
6192
6205
6193 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
6206 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
6194 mode to report exceptions verbosely but without formatting
6207 mode to report exceptions verbosely but without formatting
6195 variables. This addresses the issue of ipython 'freezing' (it's
6208 variables. This addresses the issue of ipython 'freezing' (it's
6196 not frozen, but caught in an expensive formatting loop) when huge
6209 not frozen, but caught in an expensive formatting loop) when huge
6197 variables are in the context of an exception.
6210 variables are in the context of an exception.
6198 (VerboseTB.text): Added '--->' markers at line where exception was
6211 (VerboseTB.text): Added '--->' markers at line where exception was
6199 triggered. Much clearer to read, especially in NoColor modes.
6212 triggered. Much clearer to read, especially in NoColor modes.
6200
6213
6201 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
6214 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
6202 implemented in reverse when changing to the new parse_options().
6215 implemented in reverse when changing to the new parse_options().
6203
6216
6204 2002-05-03 Fernando Perez <fperez@colorado.edu>
6217 2002-05-03 Fernando Perez <fperez@colorado.edu>
6205
6218
6206 * IPython/Magic.py (Magic.parse_options): new function so that
6219 * IPython/Magic.py (Magic.parse_options): new function so that
6207 magics can parse options easier.
6220 magics can parse options easier.
6208 (Magic.magic_prun): new function similar to profile.run(),
6221 (Magic.magic_prun): new function similar to profile.run(),
6209 suggested by Chris Hart.
6222 suggested by Chris Hart.
6210 (Magic.magic_cd): fixed behavior so that it only changes if
6223 (Magic.magic_cd): fixed behavior so that it only changes if
6211 directory actually is in history.
6224 directory actually is in history.
6212
6225
6213 * IPython/usage.py (__doc__): added information about potential
6226 * IPython/usage.py (__doc__): added information about potential
6214 slowness of Verbose exception mode when there are huge data
6227 slowness of Verbose exception mode when there are huge data
6215 structures to be formatted (thanks to Archie Paulson).
6228 structures to be formatted (thanks to Archie Paulson).
6216
6229
6217 * IPython/ipmaker.py (make_IPython): Changed default logging
6230 * IPython/ipmaker.py (make_IPython): Changed default logging
6218 (when simply called with -log) to use curr_dir/ipython.log in
6231 (when simply called with -log) to use curr_dir/ipython.log in
6219 rotate mode. Fixed crash which was occuring with -log before
6232 rotate mode. Fixed crash which was occuring with -log before
6220 (thanks to Jim Boyle).
6233 (thanks to Jim Boyle).
6221
6234
6222 2002-05-01 Fernando Perez <fperez@colorado.edu>
6235 2002-05-01 Fernando Perez <fperez@colorado.edu>
6223
6236
6224 * Released 0.2.11 for these fixes (mainly the ultraTB one which
6237 * Released 0.2.11 for these fixes (mainly the ultraTB one which
6225 was nasty -- though somewhat of a corner case).
6238 was nasty -- though somewhat of a corner case).
6226
6239
6227 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
6240 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
6228 text (was a bug).
6241 text (was a bug).
6229
6242
6230 2002-04-30 Fernando Perez <fperez@colorado.edu>
6243 2002-04-30 Fernando Perez <fperez@colorado.edu>
6231
6244
6232 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
6245 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
6233 a print after ^D or ^C from the user so that the In[] prompt
6246 a print after ^D or ^C from the user so that the In[] prompt
6234 doesn't over-run the gnuplot one.
6247 doesn't over-run the gnuplot one.
6235
6248
6236 2002-04-29 Fernando Perez <fperez@colorado.edu>
6249 2002-04-29 Fernando Perez <fperez@colorado.edu>
6237
6250
6238 * Released 0.2.10
6251 * Released 0.2.10
6239
6252
6240 * IPython/__release__.py (version): get date dynamically.
6253 * IPython/__release__.py (version): get date dynamically.
6241
6254
6242 * Misc. documentation updates thanks to Arnd's comments. Also ran
6255 * Misc. documentation updates thanks to Arnd's comments. Also ran
6243 a full spellcheck on the manual (hadn't been done in a while).
6256 a full spellcheck on the manual (hadn't been done in a while).
6244
6257
6245 2002-04-27 Fernando Perez <fperez@colorado.edu>
6258 2002-04-27 Fernando Perez <fperez@colorado.edu>
6246
6259
6247 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
6260 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
6248 starting a log in mid-session would reset the input history list.
6261 starting a log in mid-session would reset the input history list.
6249
6262
6250 2002-04-26 Fernando Perez <fperez@colorado.edu>
6263 2002-04-26 Fernando Perez <fperez@colorado.edu>
6251
6264
6252 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
6265 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
6253 all files were being included in an update. Now anything in
6266 all files were being included in an update. Now anything in
6254 UserConfig that matches [A-Za-z]*.py will go (this excludes
6267 UserConfig that matches [A-Za-z]*.py will go (this excludes
6255 __init__.py)
6268 __init__.py)
6256
6269
6257 2002-04-25 Fernando Perez <fperez@colorado.edu>
6270 2002-04-25 Fernando Perez <fperez@colorado.edu>
6258
6271
6259 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
6272 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
6260 to __builtins__ so that any form of embedded or imported code can
6273 to __builtins__ so that any form of embedded or imported code can
6261 test for being inside IPython.
6274 test for being inside IPython.
6262
6275
6263 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
6276 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
6264 changed to GnuplotMagic because it's now an importable module,
6277 changed to GnuplotMagic because it's now an importable module,
6265 this makes the name follow that of the standard Gnuplot module.
6278 this makes the name follow that of the standard Gnuplot module.
6266 GnuplotMagic can now be loaded at any time in mid-session.
6279 GnuplotMagic can now be loaded at any time in mid-session.
6267
6280
6268 2002-04-24 Fernando Perez <fperez@colorado.edu>
6281 2002-04-24 Fernando Perez <fperez@colorado.edu>
6269
6282
6270 * IPython/numutils.py: removed SIUnits. It doesn't properly set
6283 * IPython/numutils.py: removed SIUnits. It doesn't properly set
6271 the globals (IPython has its own namespace) and the
6284 the globals (IPython has its own namespace) and the
6272 PhysicalQuantity stuff is much better anyway.
6285 PhysicalQuantity stuff is much better anyway.
6273
6286
6274 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
6287 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
6275 embedding example to standard user directory for
6288 embedding example to standard user directory for
6276 distribution. Also put it in the manual.
6289 distribution. Also put it in the manual.
6277
6290
6278 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
6291 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
6279 instance as first argument (so it doesn't rely on some obscure
6292 instance as first argument (so it doesn't rely on some obscure
6280 hidden global).
6293 hidden global).
6281
6294
6282 * IPython/UserConfig/ipythonrc.py: put () back in accepted
6295 * IPython/UserConfig/ipythonrc.py: put () back in accepted
6283 delimiters. While it prevents ().TAB from working, it allows
6296 delimiters. While it prevents ().TAB from working, it allows
6284 completions in open (... expressions. This is by far a more common
6297 completions in open (... expressions. This is by far a more common
6285 case.
6298 case.
6286
6299
6287 2002-04-23 Fernando Perez <fperez@colorado.edu>
6300 2002-04-23 Fernando Perez <fperez@colorado.edu>
6288
6301
6289 * IPython/Extensions/InterpreterPasteInput.py: new
6302 * IPython/Extensions/InterpreterPasteInput.py: new
6290 syntax-processing module for pasting lines with >>> or ... at the
6303 syntax-processing module for pasting lines with >>> or ... at the
6291 start.
6304 start.
6292
6305
6293 * IPython/Extensions/PhysicalQ_Interactive.py
6306 * IPython/Extensions/PhysicalQ_Interactive.py
6294 (PhysicalQuantityInteractive.__int__): fixed to work with either
6307 (PhysicalQuantityInteractive.__int__): fixed to work with either
6295 Numeric or math.
6308 Numeric or math.
6296
6309
6297 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
6310 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
6298 provided profiles. Now we have:
6311 provided profiles. Now we have:
6299 -math -> math module as * and cmath with its own namespace.
6312 -math -> math module as * and cmath with its own namespace.
6300 -numeric -> Numeric as *, plus gnuplot & grace
6313 -numeric -> Numeric as *, plus gnuplot & grace
6301 -physics -> same as before
6314 -physics -> same as before
6302
6315
6303 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
6316 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
6304 user-defined magics wouldn't be found by @magic if they were
6317 user-defined magics wouldn't be found by @magic if they were
6305 defined as class methods. Also cleaned up the namespace search
6318 defined as class methods. Also cleaned up the namespace search
6306 logic and the string building (to use %s instead of many repeated
6319 logic and the string building (to use %s instead of many repeated
6307 string adds).
6320 string adds).
6308
6321
6309 * IPython/UserConfig/example-magic.py (magic_foo): updated example
6322 * IPython/UserConfig/example-magic.py (magic_foo): updated example
6310 of user-defined magics to operate with class methods (cleaner, in
6323 of user-defined magics to operate with class methods (cleaner, in
6311 line with the gnuplot code).
6324 line with the gnuplot code).
6312
6325
6313 2002-04-22 Fernando Perez <fperez@colorado.edu>
6326 2002-04-22 Fernando Perez <fperez@colorado.edu>
6314
6327
6315 * setup.py: updated dependency list so that manual is updated when
6328 * setup.py: updated dependency list so that manual is updated when
6316 all included files change.
6329 all included files change.
6317
6330
6318 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
6331 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
6319 the delimiter removal option (the fix is ugly right now).
6332 the delimiter removal option (the fix is ugly right now).
6320
6333
6321 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
6334 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
6322 all of the math profile (quicker loading, no conflict between
6335 all of the math profile (quicker loading, no conflict between
6323 g-9.8 and g-gnuplot).
6336 g-9.8 and g-gnuplot).
6324
6337
6325 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
6338 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
6326 name of post-mortem files to IPython_crash_report.txt.
6339 name of post-mortem files to IPython_crash_report.txt.
6327
6340
6328 * Cleanup/update of the docs. Added all the new readline info and
6341 * Cleanup/update of the docs. Added all the new readline info and
6329 formatted all lists as 'real lists'.
6342 formatted all lists as 'real lists'.
6330
6343
6331 * IPython/ipmaker.py (make_IPython): removed now-obsolete
6344 * IPython/ipmaker.py (make_IPython): removed now-obsolete
6332 tab-completion options, since the full readline parse_and_bind is
6345 tab-completion options, since the full readline parse_and_bind is
6333 now accessible.
6346 now accessible.
6334
6347
6335 * IPython/iplib.py (InteractiveShell.init_readline): Changed
6348 * IPython/iplib.py (InteractiveShell.init_readline): Changed
6336 handling of readline options. Now users can specify any string to
6349 handling of readline options. Now users can specify any string to
6337 be passed to parse_and_bind(), as well as the delimiters to be
6350 be passed to parse_and_bind(), as well as the delimiters to be
6338 removed.
6351 removed.
6339 (InteractiveShell.__init__): Added __name__ to the global
6352 (InteractiveShell.__init__): Added __name__ to the global
6340 namespace so that things like Itpl which rely on its existence
6353 namespace so that things like Itpl which rely on its existence
6341 don't crash.
6354 don't crash.
6342 (InteractiveShell._prefilter): Defined the default with a _ so
6355 (InteractiveShell._prefilter): Defined the default with a _ so
6343 that prefilter() is easier to override, while the default one
6356 that prefilter() is easier to override, while the default one
6344 remains available.
6357 remains available.
6345
6358
6346 2002-04-18 Fernando Perez <fperez@colorado.edu>
6359 2002-04-18 Fernando Perez <fperez@colorado.edu>
6347
6360
6348 * Added information about pdb in the docs.
6361 * Added information about pdb in the docs.
6349
6362
6350 2002-04-17 Fernando Perez <fperez@colorado.edu>
6363 2002-04-17 Fernando Perez <fperez@colorado.edu>
6351
6364
6352 * IPython/ipmaker.py (make_IPython): added rc_override option to
6365 * IPython/ipmaker.py (make_IPython): added rc_override option to
6353 allow passing config options at creation time which may override
6366 allow passing config options at creation time which may override
6354 anything set in the config files or command line. This is
6367 anything set in the config files or command line. This is
6355 particularly useful for configuring embedded instances.
6368 particularly useful for configuring embedded instances.
6356
6369
6357 2002-04-15 Fernando Perez <fperez@colorado.edu>
6370 2002-04-15 Fernando Perez <fperez@colorado.edu>
6358
6371
6359 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
6372 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
6360 crash embedded instances because of the input cache falling out of
6373 crash embedded instances because of the input cache falling out of
6361 sync with the output counter.
6374 sync with the output counter.
6362
6375
6363 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
6376 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
6364 mode which calls pdb after an uncaught exception in IPython itself.
6377 mode which calls pdb after an uncaught exception in IPython itself.
6365
6378
6366 2002-04-14 Fernando Perez <fperez@colorado.edu>
6379 2002-04-14 Fernando Perez <fperez@colorado.edu>
6367
6380
6368 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
6381 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
6369 readline, fix it back after each call.
6382 readline, fix it back after each call.
6370
6383
6371 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
6384 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
6372 method to force all access via __call__(), which guarantees that
6385 method to force all access via __call__(), which guarantees that
6373 traceback references are properly deleted.
6386 traceback references are properly deleted.
6374
6387
6375 * IPython/Prompts.py (CachedOutput._display): minor fixes to
6388 * IPython/Prompts.py (CachedOutput._display): minor fixes to
6376 improve printing when pprint is in use.
6389 improve printing when pprint is in use.
6377
6390
6378 2002-04-13 Fernando Perez <fperez@colorado.edu>
6391 2002-04-13 Fernando Perez <fperez@colorado.edu>
6379
6392
6380 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
6393 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
6381 exceptions aren't caught anymore. If the user triggers one, he
6394 exceptions aren't caught anymore. If the user triggers one, he
6382 should know why he's doing it and it should go all the way up,
6395 should know why he's doing it and it should go all the way up,
6383 just like any other exception. So now @abort will fully kill the
6396 just like any other exception. So now @abort will fully kill the
6384 embedded interpreter and the embedding code (unless that happens
6397 embedded interpreter and the embedding code (unless that happens
6385 to catch SystemExit).
6398 to catch SystemExit).
6386
6399
6387 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
6400 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
6388 and a debugger() method to invoke the interactive pdb debugger
6401 and a debugger() method to invoke the interactive pdb debugger
6389 after printing exception information. Also added the corresponding
6402 after printing exception information. Also added the corresponding
6390 -pdb option and @pdb magic to control this feature, and updated
6403 -pdb option and @pdb magic to control this feature, and updated
6391 the docs. After a suggestion from Christopher Hart
6404 the docs. After a suggestion from Christopher Hart
6392 (hart-AT-caltech.edu).
6405 (hart-AT-caltech.edu).
6393
6406
6394 2002-04-12 Fernando Perez <fperez@colorado.edu>
6407 2002-04-12 Fernando Perez <fperez@colorado.edu>
6395
6408
6396 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
6409 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
6397 the exception handlers defined by the user (not the CrashHandler)
6410 the exception handlers defined by the user (not the CrashHandler)
6398 so that user exceptions don't trigger an ipython bug report.
6411 so that user exceptions don't trigger an ipython bug report.
6399
6412
6400 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
6413 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
6401 configurable (it should have always been so).
6414 configurable (it should have always been so).
6402
6415
6403 2002-03-26 Fernando Perez <fperez@colorado.edu>
6416 2002-03-26 Fernando Perez <fperez@colorado.edu>
6404
6417
6405 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
6418 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
6406 and there to fix embedding namespace issues. This should all be
6419 and there to fix embedding namespace issues. This should all be
6407 done in a more elegant way.
6420 done in a more elegant way.
6408
6421
6409 2002-03-25 Fernando Perez <fperez@colorado.edu>
6422 2002-03-25 Fernando Perez <fperez@colorado.edu>
6410
6423
6411 * IPython/genutils.py (get_home_dir): Try to make it work under
6424 * IPython/genutils.py (get_home_dir): Try to make it work under
6412 win9x also.
6425 win9x also.
6413
6426
6414 2002-03-20 Fernando Perez <fperez@colorado.edu>
6427 2002-03-20 Fernando Perez <fperez@colorado.edu>
6415
6428
6416 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
6429 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
6417 sys.displayhook untouched upon __init__.
6430 sys.displayhook untouched upon __init__.
6418
6431
6419 2002-03-19 Fernando Perez <fperez@colorado.edu>
6432 2002-03-19 Fernando Perez <fperez@colorado.edu>
6420
6433
6421 * Released 0.2.9 (for embedding bug, basically).
6434 * Released 0.2.9 (for embedding bug, basically).
6422
6435
6423 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
6436 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
6424 exceptions so that enclosing shell's state can be restored.
6437 exceptions so that enclosing shell's state can be restored.
6425
6438
6426 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
6439 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
6427 naming conventions in the .ipython/ dir.
6440 naming conventions in the .ipython/ dir.
6428
6441
6429 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
6442 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
6430 from delimiters list so filenames with - in them get expanded.
6443 from delimiters list so filenames with - in them get expanded.
6431
6444
6432 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
6445 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
6433 sys.displayhook not being properly restored after an embedded call.
6446 sys.displayhook not being properly restored after an embedded call.
6434
6447
6435 2002-03-18 Fernando Perez <fperez@colorado.edu>
6448 2002-03-18 Fernando Perez <fperez@colorado.edu>
6436
6449
6437 * Released 0.2.8
6450 * Released 0.2.8
6438
6451
6439 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
6452 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
6440 some files weren't being included in a -upgrade.
6453 some files weren't being included in a -upgrade.
6441 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
6454 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
6442 on' so that the first tab completes.
6455 on' so that the first tab completes.
6443 (InteractiveShell.handle_magic): fixed bug with spaces around
6456 (InteractiveShell.handle_magic): fixed bug with spaces around
6444 quotes breaking many magic commands.
6457 quotes breaking many magic commands.
6445
6458
6446 * setup.py: added note about ignoring the syntax error messages at
6459 * setup.py: added note about ignoring the syntax error messages at
6447 installation.
6460 installation.
6448
6461
6449 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
6462 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
6450 streamlining the gnuplot interface, now there's only one magic @gp.
6463 streamlining the gnuplot interface, now there's only one magic @gp.
6451
6464
6452 2002-03-17 Fernando Perez <fperez@colorado.edu>
6465 2002-03-17 Fernando Perez <fperez@colorado.edu>
6453
6466
6454 * IPython/UserConfig/magic_gnuplot.py: new name for the
6467 * IPython/UserConfig/magic_gnuplot.py: new name for the
6455 example-magic_pm.py file. Much enhanced system, now with a shell
6468 example-magic_pm.py file. Much enhanced system, now with a shell
6456 for communicating directly with gnuplot, one command at a time.
6469 for communicating directly with gnuplot, one command at a time.
6457
6470
6458 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
6471 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
6459 setting __name__=='__main__'.
6472 setting __name__=='__main__'.
6460
6473
6461 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
6474 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
6462 mini-shell for accessing gnuplot from inside ipython. Should
6475 mini-shell for accessing gnuplot from inside ipython. Should
6463 extend it later for grace access too. Inspired by Arnd's
6476 extend it later for grace access too. Inspired by Arnd's
6464 suggestion.
6477 suggestion.
6465
6478
6466 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6479 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
6467 calling magic functions with () in their arguments. Thanks to Arnd
6480 calling magic functions with () in their arguments. Thanks to Arnd
6468 Baecker for pointing this to me.
6481 Baecker for pointing this to me.
6469
6482
6470 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6483 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
6471 infinitely for integer or complex arrays (only worked with floats).
6484 infinitely for integer or complex arrays (only worked with floats).
6472
6485
6473 2002-03-16 Fernando Perez <fperez@colorado.edu>
6486 2002-03-16 Fernando Perez <fperez@colorado.edu>
6474
6487
6475 * setup.py: Merged setup and setup_windows into a single script
6488 * setup.py: Merged setup and setup_windows into a single script
6476 which properly handles things for windows users.
6489 which properly handles things for windows users.
6477
6490
6478 2002-03-15 Fernando Perez <fperez@colorado.edu>
6491 2002-03-15 Fernando Perez <fperez@colorado.edu>
6479
6492
6480 * Big change to the manual: now the magics are all automatically
6493 * Big change to the manual: now the magics are all automatically
6481 documented. This information is generated from their docstrings
6494 documented. This information is generated from their docstrings
6482 and put in a latex file included by the manual lyx file. This way
6495 and put in a latex file included by the manual lyx file. This way
6483 we get always up to date information for the magics. The manual
6496 we get always up to date information for the magics. The manual
6484 now also has proper version information, also auto-synced.
6497 now also has proper version information, also auto-synced.
6485
6498
6486 For this to work, an undocumented --magic_docstrings option was added.
6499 For this to work, an undocumented --magic_docstrings option was added.
6487
6500
6488 2002-03-13 Fernando Perez <fperez@colorado.edu>
6501 2002-03-13 Fernando Perez <fperez@colorado.edu>
6489
6502
6490 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6503 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
6491 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6504 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
6492
6505
6493 2002-03-12 Fernando Perez <fperez@colorado.edu>
6506 2002-03-12 Fernando Perez <fperez@colorado.edu>
6494
6507
6495 * IPython/ultraTB.py (TermColors): changed color escapes again to
6508 * IPython/ultraTB.py (TermColors): changed color escapes again to
6496 fix the (old, reintroduced) line-wrapping bug. Basically, if
6509 fix the (old, reintroduced) line-wrapping bug. Basically, if
6497 \001..\002 aren't given in the color escapes, lines get wrapped
6510 \001..\002 aren't given in the color escapes, lines get wrapped
6498 weirdly. But giving those screws up old xterms and emacs terms. So
6511 weirdly. But giving those screws up old xterms and emacs terms. So
6499 I added some logic for emacs terms to be ok, but I can't identify old
6512 I added some logic for emacs terms to be ok, but I can't identify old
6500 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6513 xterms separately ($TERM=='xterm' for many terminals, like konsole).
6501
6514
6502 2002-03-10 Fernando Perez <fperez@colorado.edu>
6515 2002-03-10 Fernando Perez <fperez@colorado.edu>
6503
6516
6504 * IPython/usage.py (__doc__): Various documentation cleanups and
6517 * IPython/usage.py (__doc__): Various documentation cleanups and
6505 updates, both in usage docstrings and in the manual.
6518 updates, both in usage docstrings and in the manual.
6506
6519
6507 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6520 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
6508 handling of caching. Set minimum acceptabe value for having a
6521 handling of caching. Set minimum acceptabe value for having a
6509 cache at 20 values.
6522 cache at 20 values.
6510
6523
6511 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6524 * IPython/iplib.py (InteractiveShell.user_setup): moved the
6512 install_first_time function to a method, renamed it and added an
6525 install_first_time function to a method, renamed it and added an
6513 'upgrade' mode. Now people can update their config directory with
6526 'upgrade' mode. Now people can update their config directory with
6514 a simple command line switch (-upgrade, also new).
6527 a simple command line switch (-upgrade, also new).
6515
6528
6516 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6529 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
6517 @file (convenient for automagic users under Python >= 2.2).
6530 @file (convenient for automagic users under Python >= 2.2).
6518 Removed @files (it seemed more like a plural than an abbrev. of
6531 Removed @files (it seemed more like a plural than an abbrev. of
6519 'file show').
6532 'file show').
6520
6533
6521 * IPython/iplib.py (install_first_time): Fixed crash if there were
6534 * IPython/iplib.py (install_first_time): Fixed crash if there were
6522 backup files ('~') in .ipython/ install directory.
6535 backup files ('~') in .ipython/ install directory.
6523
6536
6524 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6537 * IPython/ipmaker.py (make_IPython): fixes for new prompt
6525 system. Things look fine, but these changes are fairly
6538 system. Things look fine, but these changes are fairly
6526 intrusive. Test them for a few days.
6539 intrusive. Test them for a few days.
6527
6540
6528 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6541 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
6529 the prompts system. Now all in/out prompt strings are user
6542 the prompts system. Now all in/out prompt strings are user
6530 controllable. This is particularly useful for embedding, as one
6543 controllable. This is particularly useful for embedding, as one
6531 can tag embedded instances with particular prompts.
6544 can tag embedded instances with particular prompts.
6532
6545
6533 Also removed global use of sys.ps1/2, which now allows nested
6546 Also removed global use of sys.ps1/2, which now allows nested
6534 embeddings without any problems. Added command-line options for
6547 embeddings without any problems. Added command-line options for
6535 the prompt strings.
6548 the prompt strings.
6536
6549
6537 2002-03-08 Fernando Perez <fperez@colorado.edu>
6550 2002-03-08 Fernando Perez <fperez@colorado.edu>
6538
6551
6539 * IPython/UserConfig/example-embed-short.py (ipshell): added
6552 * IPython/UserConfig/example-embed-short.py (ipshell): added
6540 example file with the bare minimum code for embedding.
6553 example file with the bare minimum code for embedding.
6541
6554
6542 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6555 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
6543 functionality for the embeddable shell to be activated/deactivated
6556 functionality for the embeddable shell to be activated/deactivated
6544 either globally or at each call.
6557 either globally or at each call.
6545
6558
6546 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6559 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
6547 rewriting the prompt with '--->' for auto-inputs with proper
6560 rewriting the prompt with '--->' for auto-inputs with proper
6548 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6561 coloring. Now the previous UGLY hack in handle_auto() is gone, and
6549 this is handled by the prompts class itself, as it should.
6562 this is handled by the prompts class itself, as it should.
6550
6563
6551 2002-03-05 Fernando Perez <fperez@colorado.edu>
6564 2002-03-05 Fernando Perez <fperez@colorado.edu>
6552
6565
6553 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6566 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
6554 @logstart to avoid name clashes with the math log function.
6567 @logstart to avoid name clashes with the math log function.
6555
6568
6556 * Big updates to X/Emacs section of the manual.
6569 * Big updates to X/Emacs section of the manual.
6557
6570
6558 * Removed ipython_emacs. Milan explained to me how to pass
6571 * Removed ipython_emacs. Milan explained to me how to pass
6559 arguments to ipython through Emacs. Some day I'm going to end up
6572 arguments to ipython through Emacs. Some day I'm going to end up
6560 learning some lisp...
6573 learning some lisp...
6561
6574
6562 2002-03-04 Fernando Perez <fperez@colorado.edu>
6575 2002-03-04 Fernando Perez <fperez@colorado.edu>
6563
6576
6564 * IPython/ipython_emacs: Created script to be used as the
6577 * IPython/ipython_emacs: Created script to be used as the
6565 py-python-command Emacs variable so we can pass IPython
6578 py-python-command Emacs variable so we can pass IPython
6566 parameters. I can't figure out how to tell Emacs directly to pass
6579 parameters. I can't figure out how to tell Emacs directly to pass
6567 parameters to IPython, so a dummy shell script will do it.
6580 parameters to IPython, so a dummy shell script will do it.
6568
6581
6569 Other enhancements made for things to work better under Emacs'
6582 Other enhancements made for things to work better under Emacs'
6570 various types of terminals. Many thanks to Milan Zamazal
6583 various types of terminals. Many thanks to Milan Zamazal
6571 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6584 <pdm-AT-zamazal.org> for all the suggestions and pointers.
6572
6585
6573 2002-03-01 Fernando Perez <fperez@colorado.edu>
6586 2002-03-01 Fernando Perez <fperez@colorado.edu>
6574
6587
6575 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6588 * IPython/ipmaker.py (make_IPython): added a --readline! option so
6576 that loading of readline is now optional. This gives better
6589 that loading of readline is now optional. This gives better
6577 control to emacs users.
6590 control to emacs users.
6578
6591
6579 * IPython/ultraTB.py (__date__): Modified color escape sequences
6592 * IPython/ultraTB.py (__date__): Modified color escape sequences
6580 and now things work fine under xterm and in Emacs' term buffers
6593 and now things work fine under xterm and in Emacs' term buffers
6581 (though not shell ones). Well, in emacs you get colors, but all
6594 (though not shell ones). Well, in emacs you get colors, but all
6582 seem to be 'light' colors (no difference between dark and light
6595 seem to be 'light' colors (no difference between dark and light
6583 ones). But the garbage chars are gone, and also in xterms. It
6596 ones). But the garbage chars are gone, and also in xterms. It
6584 seems that now I'm using 'cleaner' ansi sequences.
6597 seems that now I'm using 'cleaner' ansi sequences.
6585
6598
6586 2002-02-21 Fernando Perez <fperez@colorado.edu>
6599 2002-02-21 Fernando Perez <fperez@colorado.edu>
6587
6600
6588 * Released 0.2.7 (mainly to publish the scoping fix).
6601 * Released 0.2.7 (mainly to publish the scoping fix).
6589
6602
6590 * IPython/Logger.py (Logger.logstate): added. A corresponding
6603 * IPython/Logger.py (Logger.logstate): added. A corresponding
6591 @logstate magic was created.
6604 @logstate magic was created.
6592
6605
6593 * IPython/Magic.py: fixed nested scoping problem under Python
6606 * IPython/Magic.py: fixed nested scoping problem under Python
6594 2.1.x (automagic wasn't working).
6607 2.1.x (automagic wasn't working).
6595
6608
6596 2002-02-20 Fernando Perez <fperez@colorado.edu>
6609 2002-02-20 Fernando Perez <fperez@colorado.edu>
6597
6610
6598 * Released 0.2.6.
6611 * Released 0.2.6.
6599
6612
6600 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6613 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
6601 option so that logs can come out without any headers at all.
6614 option so that logs can come out without any headers at all.
6602
6615
6603 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6616 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
6604 SciPy.
6617 SciPy.
6605
6618
6606 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6619 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
6607 that embedded IPython calls don't require vars() to be explicitly
6620 that embedded IPython calls don't require vars() to be explicitly
6608 passed. Now they are extracted from the caller's frame (code
6621 passed. Now they are extracted from the caller's frame (code
6609 snatched from Eric Jones' weave). Added better documentation to
6622 snatched from Eric Jones' weave). Added better documentation to
6610 the section on embedding and the example file.
6623 the section on embedding and the example file.
6611
6624
6612 * IPython/genutils.py (page): Changed so that under emacs, it just
6625 * IPython/genutils.py (page): Changed so that under emacs, it just
6613 prints the string. You can then page up and down in the emacs
6626 prints the string. You can then page up and down in the emacs
6614 buffer itself. This is how the builtin help() works.
6627 buffer itself. This is how the builtin help() works.
6615
6628
6616 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6629 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
6617 macro scoping: macros need to be executed in the user's namespace
6630 macro scoping: macros need to be executed in the user's namespace
6618 to work as if they had been typed by the user.
6631 to work as if they had been typed by the user.
6619
6632
6620 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6633 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
6621 execute automatically (no need to type 'exec...'). They then
6634 execute automatically (no need to type 'exec...'). They then
6622 behave like 'true macros'. The printing system was also modified
6635 behave like 'true macros'. The printing system was also modified
6623 for this to work.
6636 for this to work.
6624
6637
6625 2002-02-19 Fernando Perez <fperez@colorado.edu>
6638 2002-02-19 Fernando Perez <fperez@colorado.edu>
6626
6639
6627 * IPython/genutils.py (page_file): new function for paging files
6640 * IPython/genutils.py (page_file): new function for paging files
6628 in an OS-independent way. Also necessary for file viewing to work
6641 in an OS-independent way. Also necessary for file viewing to work
6629 well inside Emacs buffers.
6642 well inside Emacs buffers.
6630 (page): Added checks for being in an emacs buffer.
6643 (page): Added checks for being in an emacs buffer.
6631 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6644 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
6632 same bug in iplib.
6645 same bug in iplib.
6633
6646
6634 2002-02-18 Fernando Perez <fperez@colorado.edu>
6647 2002-02-18 Fernando Perez <fperez@colorado.edu>
6635
6648
6636 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6649 * IPython/iplib.py (InteractiveShell.init_readline): modified use
6637 of readline so that IPython can work inside an Emacs buffer.
6650 of readline so that IPython can work inside an Emacs buffer.
6638
6651
6639 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6652 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
6640 method signatures (they weren't really bugs, but it looks cleaner
6653 method signatures (they weren't really bugs, but it looks cleaner
6641 and keeps PyChecker happy).
6654 and keeps PyChecker happy).
6642
6655
6643 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6656 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
6644 for implementing various user-defined hooks. Currently only
6657 for implementing various user-defined hooks. Currently only
6645 display is done.
6658 display is done.
6646
6659
6647 * IPython/Prompts.py (CachedOutput._display): changed display
6660 * IPython/Prompts.py (CachedOutput._display): changed display
6648 functions so that they can be dynamically changed by users easily.
6661 functions so that they can be dynamically changed by users easily.
6649
6662
6650 * IPython/Extensions/numeric_formats.py (num_display): added an
6663 * IPython/Extensions/numeric_formats.py (num_display): added an
6651 extension for printing NumPy arrays in flexible manners. It
6664 extension for printing NumPy arrays in flexible manners. It
6652 doesn't do anything yet, but all the structure is in
6665 doesn't do anything yet, but all the structure is in
6653 place. Ultimately the plan is to implement output format control
6666 place. Ultimately the plan is to implement output format control
6654 like in Octave.
6667 like in Octave.
6655
6668
6656 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6669 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
6657 methods are found at run-time by all the automatic machinery.
6670 methods are found at run-time by all the automatic machinery.
6658
6671
6659 2002-02-17 Fernando Perez <fperez@colorado.edu>
6672 2002-02-17 Fernando Perez <fperez@colorado.edu>
6660
6673
6661 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6674 * setup_Windows.py (make_shortcut): documented. Cleaned up the
6662 whole file a little.
6675 whole file a little.
6663
6676
6664 * ToDo: closed this document. Now there's a new_design.lyx
6677 * ToDo: closed this document. Now there's a new_design.lyx
6665 document for all new ideas. Added making a pdf of it for the
6678 document for all new ideas. Added making a pdf of it for the
6666 end-user distro.
6679 end-user distro.
6667
6680
6668 * IPython/Logger.py (Logger.switch_log): Created this to replace
6681 * IPython/Logger.py (Logger.switch_log): Created this to replace
6669 logon() and logoff(). It also fixes a nasty crash reported by
6682 logon() and logoff(). It also fixes a nasty crash reported by
6670 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6683 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
6671
6684
6672 * IPython/iplib.py (complete): got auto-completion to work with
6685 * IPython/iplib.py (complete): got auto-completion to work with
6673 automagic (I had wanted this for a long time).
6686 automagic (I had wanted this for a long time).
6674
6687
6675 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6688 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
6676 to @file, since file() is now a builtin and clashes with automagic
6689 to @file, since file() is now a builtin and clashes with automagic
6677 for @file.
6690 for @file.
6678
6691
6679 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6692 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
6680 of this was previously in iplib, which had grown to more than 2000
6693 of this was previously in iplib, which had grown to more than 2000
6681 lines, way too long. No new functionality, but it makes managing
6694 lines, way too long. No new functionality, but it makes managing
6682 the code a bit easier.
6695 the code a bit easier.
6683
6696
6684 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6697 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
6685 information to crash reports.
6698 information to crash reports.
6686
6699
6687 2002-02-12 Fernando Perez <fperez@colorado.edu>
6700 2002-02-12 Fernando Perez <fperez@colorado.edu>
6688
6701
6689 * Released 0.2.5.
6702 * Released 0.2.5.
6690
6703
6691 2002-02-11 Fernando Perez <fperez@colorado.edu>
6704 2002-02-11 Fernando Perez <fperez@colorado.edu>
6692
6705
6693 * Wrote a relatively complete Windows installer. It puts
6706 * Wrote a relatively complete Windows installer. It puts
6694 everything in place, creates Start Menu entries and fixes the
6707 everything in place, creates Start Menu entries and fixes the
6695 color issues. Nothing fancy, but it works.
6708 color issues. Nothing fancy, but it works.
6696
6709
6697 2002-02-10 Fernando Perez <fperez@colorado.edu>
6710 2002-02-10 Fernando Perez <fperez@colorado.edu>
6698
6711
6699 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6712 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
6700 os.path.expanduser() call so that we can type @run ~/myfile.py and
6713 os.path.expanduser() call so that we can type @run ~/myfile.py and
6701 have thigs work as expected.
6714 have thigs work as expected.
6702
6715
6703 * IPython/genutils.py (page): fixed exception handling so things
6716 * IPython/genutils.py (page): fixed exception handling so things
6704 work both in Unix and Windows correctly. Quitting a pager triggers
6717 work both in Unix and Windows correctly. Quitting a pager triggers
6705 an IOError/broken pipe in Unix, and in windows not finding a pager
6718 an IOError/broken pipe in Unix, and in windows not finding a pager
6706 is also an IOError, so I had to actually look at the return value
6719 is also an IOError, so I had to actually look at the return value
6707 of the exception, not just the exception itself. Should be ok now.
6720 of the exception, not just the exception itself. Should be ok now.
6708
6721
6709 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6722 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
6710 modified to allow case-insensitive color scheme changes.
6723 modified to allow case-insensitive color scheme changes.
6711
6724
6712 2002-02-09 Fernando Perez <fperez@colorado.edu>
6725 2002-02-09 Fernando Perez <fperez@colorado.edu>
6713
6726
6714 * IPython/genutils.py (native_line_ends): new function to leave
6727 * IPython/genutils.py (native_line_ends): new function to leave
6715 user config files with os-native line-endings.
6728 user config files with os-native line-endings.
6716
6729
6717 * README and manual updates.
6730 * README and manual updates.
6718
6731
6719 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6732 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
6720 instead of StringType to catch Unicode strings.
6733 instead of StringType to catch Unicode strings.
6721
6734
6722 * IPython/genutils.py (filefind): fixed bug for paths with
6735 * IPython/genutils.py (filefind): fixed bug for paths with
6723 embedded spaces (very common in Windows).
6736 embedded spaces (very common in Windows).
6724
6737
6725 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6738 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
6726 files under Windows, so that they get automatically associated
6739 files under Windows, so that they get automatically associated
6727 with a text editor. Windows makes it a pain to handle
6740 with a text editor. Windows makes it a pain to handle
6728 extension-less files.
6741 extension-less files.
6729
6742
6730 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6743 * IPython/iplib.py (InteractiveShell.init_readline): Made the
6731 warning about readline only occur for Posix. In Windows there's no
6744 warning about readline only occur for Posix. In Windows there's no
6732 way to get readline, so why bother with the warning.
6745 way to get readline, so why bother with the warning.
6733
6746
6734 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6747 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
6735 for __str__ instead of dir(self), since dir() changed in 2.2.
6748 for __str__ instead of dir(self), since dir() changed in 2.2.
6736
6749
6737 * Ported to Windows! Tested on XP, I suspect it should work fine
6750 * Ported to Windows! Tested on XP, I suspect it should work fine
6738 on NT/2000, but I don't think it will work on 98 et al. That
6751 on NT/2000, but I don't think it will work on 98 et al. That
6739 series of Windows is such a piece of junk anyway that I won't try
6752 series of Windows is such a piece of junk anyway that I won't try
6740 porting it there. The XP port was straightforward, showed a few
6753 porting it there. The XP port was straightforward, showed a few
6741 bugs here and there (fixed all), in particular some string
6754 bugs here and there (fixed all), in particular some string
6742 handling stuff which required considering Unicode strings (which
6755 handling stuff which required considering Unicode strings (which
6743 Windows uses). This is good, but hasn't been too tested :) No
6756 Windows uses). This is good, but hasn't been too tested :) No
6744 fancy installer yet, I'll put a note in the manual so people at
6757 fancy installer yet, I'll put a note in the manual so people at
6745 least make manually a shortcut.
6758 least make manually a shortcut.
6746
6759
6747 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6760 * IPython/iplib.py (Magic.magic_colors): Unified the color options
6748 into a single one, "colors". This now controls both prompt and
6761 into a single one, "colors". This now controls both prompt and
6749 exception color schemes, and can be changed both at startup
6762 exception color schemes, and can be changed both at startup
6750 (either via command-line switches or via ipythonrc files) and at
6763 (either via command-line switches or via ipythonrc files) and at
6751 runtime, with @colors.
6764 runtime, with @colors.
6752 (Magic.magic_run): renamed @prun to @run and removed the old
6765 (Magic.magic_run): renamed @prun to @run and removed the old
6753 @run. The two were too similar to warrant keeping both.
6766 @run. The two were too similar to warrant keeping both.
6754
6767
6755 2002-02-03 Fernando Perez <fperez@colorado.edu>
6768 2002-02-03 Fernando Perez <fperez@colorado.edu>
6756
6769
6757 * IPython/iplib.py (install_first_time): Added comment on how to
6770 * IPython/iplib.py (install_first_time): Added comment on how to
6758 configure the color options for first-time users. Put a <return>
6771 configure the color options for first-time users. Put a <return>
6759 request at the end so that small-terminal users get a chance to
6772 request at the end so that small-terminal users get a chance to
6760 read the startup info.
6773 read the startup info.
6761
6774
6762 2002-01-23 Fernando Perez <fperez@colorado.edu>
6775 2002-01-23 Fernando Perez <fperez@colorado.edu>
6763
6776
6764 * IPython/iplib.py (CachedOutput.update): Changed output memory
6777 * IPython/iplib.py (CachedOutput.update): Changed output memory
6765 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6778 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
6766 input history we still use _i. Did this b/c these variable are
6779 input history we still use _i. Did this b/c these variable are
6767 very commonly used in interactive work, so the less we need to
6780 very commonly used in interactive work, so the less we need to
6768 type the better off we are.
6781 type the better off we are.
6769 (Magic.magic_prun): updated @prun to better handle the namespaces
6782 (Magic.magic_prun): updated @prun to better handle the namespaces
6770 the file will run in, including a fix for __name__ not being set
6783 the file will run in, including a fix for __name__ not being set
6771 before.
6784 before.
6772
6785
6773 2002-01-20 Fernando Perez <fperez@colorado.edu>
6786 2002-01-20 Fernando Perez <fperez@colorado.edu>
6774
6787
6775 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6788 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
6776 extra garbage for Python 2.2. Need to look more carefully into
6789 extra garbage for Python 2.2. Need to look more carefully into
6777 this later.
6790 this later.
6778
6791
6779 2002-01-19 Fernando Perez <fperez@colorado.edu>
6792 2002-01-19 Fernando Perez <fperez@colorado.edu>
6780
6793
6781 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6794 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
6782 display SyntaxError exceptions properly formatted when they occur
6795 display SyntaxError exceptions properly formatted when they occur
6783 (they can be triggered by imported code).
6796 (they can be triggered by imported code).
6784
6797
6785 2002-01-18 Fernando Perez <fperez@colorado.edu>
6798 2002-01-18 Fernando Perez <fperez@colorado.edu>
6786
6799
6787 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6800 * IPython/iplib.py (InteractiveShell.safe_execfile): now
6788 SyntaxError exceptions are reported nicely formatted, instead of
6801 SyntaxError exceptions are reported nicely formatted, instead of
6789 spitting out only offset information as before.
6802 spitting out only offset information as before.
6790 (Magic.magic_prun): Added the @prun function for executing
6803 (Magic.magic_prun): Added the @prun function for executing
6791 programs with command line args inside IPython.
6804 programs with command line args inside IPython.
6792
6805
6793 2002-01-16 Fernando Perez <fperez@colorado.edu>
6806 2002-01-16 Fernando Perez <fperez@colorado.edu>
6794
6807
6795 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6808 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
6796 to *not* include the last item given in a range. This brings their
6809 to *not* include the last item given in a range. This brings their
6797 behavior in line with Python's slicing:
6810 behavior in line with Python's slicing:
6798 a[n1:n2] -> a[n1]...a[n2-1]
6811 a[n1:n2] -> a[n1]...a[n2-1]
6799 It may be a bit less convenient, but I prefer to stick to Python's
6812 It may be a bit less convenient, but I prefer to stick to Python's
6800 conventions *everywhere*, so users never have to wonder.
6813 conventions *everywhere*, so users never have to wonder.
6801 (Magic.magic_macro): Added @macro function to ease the creation of
6814 (Magic.magic_macro): Added @macro function to ease the creation of
6802 macros.
6815 macros.
6803
6816
6804 2002-01-05 Fernando Perez <fperez@colorado.edu>
6817 2002-01-05 Fernando Perez <fperez@colorado.edu>
6805
6818
6806 * Released 0.2.4.
6819 * Released 0.2.4.
6807
6820
6808 * IPython/iplib.py (Magic.magic_pdef):
6821 * IPython/iplib.py (Magic.magic_pdef):
6809 (InteractiveShell.safe_execfile): report magic lines and error
6822 (InteractiveShell.safe_execfile): report magic lines and error
6810 lines without line numbers so one can easily copy/paste them for
6823 lines without line numbers so one can easily copy/paste them for
6811 re-execution.
6824 re-execution.
6812
6825
6813 * Updated manual with recent changes.
6826 * Updated manual with recent changes.
6814
6827
6815 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6828 * IPython/iplib.py (Magic.magic_oinfo): added constructor
6816 docstring printing when class? is called. Very handy for knowing
6829 docstring printing when class? is called. Very handy for knowing
6817 how to create class instances (as long as __init__ is well
6830 how to create class instances (as long as __init__ is well
6818 documented, of course :)
6831 documented, of course :)
6819 (Magic.magic_doc): print both class and constructor docstrings.
6832 (Magic.magic_doc): print both class and constructor docstrings.
6820 (Magic.magic_pdef): give constructor info if passed a class and
6833 (Magic.magic_pdef): give constructor info if passed a class and
6821 __call__ info for callable object instances.
6834 __call__ info for callable object instances.
6822
6835
6823 2002-01-04 Fernando Perez <fperez@colorado.edu>
6836 2002-01-04 Fernando Perez <fperez@colorado.edu>
6824
6837
6825 * Made deep_reload() off by default. It doesn't always work
6838 * Made deep_reload() off by default. It doesn't always work
6826 exactly as intended, so it's probably safer to have it off. It's
6839 exactly as intended, so it's probably safer to have it off. It's
6827 still available as dreload() anyway, so nothing is lost.
6840 still available as dreload() anyway, so nothing is lost.
6828
6841
6829 2002-01-02 Fernando Perez <fperez@colorado.edu>
6842 2002-01-02 Fernando Perez <fperez@colorado.edu>
6830
6843
6831 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6844 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
6832 so I wanted an updated release).
6845 so I wanted an updated release).
6833
6846
6834 2001-12-27 Fernando Perez <fperez@colorado.edu>
6847 2001-12-27 Fernando Perez <fperez@colorado.edu>
6835
6848
6836 * IPython/iplib.py (InteractiveShell.interact): Added the original
6849 * IPython/iplib.py (InteractiveShell.interact): Added the original
6837 code from 'code.py' for this module in order to change the
6850 code from 'code.py' for this module in order to change the
6838 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6851 handling of a KeyboardInterrupt. This was necessary b/c otherwise
6839 the history cache would break when the user hit Ctrl-C, and
6852 the history cache would break when the user hit Ctrl-C, and
6840 interact() offers no way to add any hooks to it.
6853 interact() offers no way to add any hooks to it.
6841
6854
6842 2001-12-23 Fernando Perez <fperez@colorado.edu>
6855 2001-12-23 Fernando Perez <fperez@colorado.edu>
6843
6856
6844 * setup.py: added check for 'MANIFEST' before trying to remove
6857 * setup.py: added check for 'MANIFEST' before trying to remove
6845 it. Thanks to Sean Reifschneider.
6858 it. Thanks to Sean Reifschneider.
6846
6859
6847 2001-12-22 Fernando Perez <fperez@colorado.edu>
6860 2001-12-22 Fernando Perez <fperez@colorado.edu>
6848
6861
6849 * Released 0.2.2.
6862 * Released 0.2.2.
6850
6863
6851 * Finished (reasonably) writing the manual. Later will add the
6864 * Finished (reasonably) writing the manual. Later will add the
6852 python-standard navigation stylesheets, but for the time being
6865 python-standard navigation stylesheets, but for the time being
6853 it's fairly complete. Distribution will include html and pdf
6866 it's fairly complete. Distribution will include html and pdf
6854 versions.
6867 versions.
6855
6868
6856 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6869 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
6857 (MayaVi author).
6870 (MayaVi author).
6858
6871
6859 2001-12-21 Fernando Perez <fperez@colorado.edu>
6872 2001-12-21 Fernando Perez <fperez@colorado.edu>
6860
6873
6861 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6874 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
6862 good public release, I think (with the manual and the distutils
6875 good public release, I think (with the manual and the distutils
6863 installer). The manual can use some work, but that can go
6876 installer). The manual can use some work, but that can go
6864 slowly. Otherwise I think it's quite nice for end users. Next
6877 slowly. Otherwise I think it's quite nice for end users. Next
6865 summer, rewrite the guts of it...
6878 summer, rewrite the guts of it...
6866
6879
6867 * Changed format of ipythonrc files to use whitespace as the
6880 * Changed format of ipythonrc files to use whitespace as the
6868 separator instead of an explicit '='. Cleaner.
6881 separator instead of an explicit '='. Cleaner.
6869
6882
6870 2001-12-20 Fernando Perez <fperez@colorado.edu>
6883 2001-12-20 Fernando Perez <fperez@colorado.edu>
6871
6884
6872 * Started a manual in LyX. For now it's just a quick merge of the
6885 * Started a manual in LyX. For now it's just a quick merge of the
6873 various internal docstrings and READMEs. Later it may grow into a
6886 various internal docstrings and READMEs. Later it may grow into a
6874 nice, full-blown manual.
6887 nice, full-blown manual.
6875
6888
6876 * Set up a distutils based installer. Installation should now be
6889 * Set up a distutils based installer. Installation should now be
6877 trivially simple for end-users.
6890 trivially simple for end-users.
6878
6891
6879 2001-12-11 Fernando Perez <fperez@colorado.edu>
6892 2001-12-11 Fernando Perez <fperez@colorado.edu>
6880
6893
6881 * Released 0.2.0. First public release, announced it at
6894 * Released 0.2.0. First public release, announced it at
6882 comp.lang.python. From now on, just bugfixes...
6895 comp.lang.python. From now on, just bugfixes...
6883
6896
6884 * Went through all the files, set copyright/license notices and
6897 * Went through all the files, set copyright/license notices and
6885 cleaned up things. Ready for release.
6898 cleaned up things. Ready for release.
6886
6899
6887 2001-12-10 Fernando Perez <fperez@colorado.edu>
6900 2001-12-10 Fernando Perez <fperez@colorado.edu>
6888
6901
6889 * Changed the first-time installer not to use tarfiles. It's more
6902 * Changed the first-time installer not to use tarfiles. It's more
6890 robust now and less unix-dependent. Also makes it easier for
6903 robust now and less unix-dependent. Also makes it easier for
6891 people to later upgrade versions.
6904 people to later upgrade versions.
6892
6905
6893 * Changed @exit to @abort to reflect the fact that it's pretty
6906 * Changed @exit to @abort to reflect the fact that it's pretty
6894 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6907 brutal (a sys.exit()). The difference between @abort and Ctrl-D
6895 becomes significant only when IPyhton is embedded: in that case,
6908 becomes significant only when IPyhton is embedded: in that case,
6896 C-D closes IPython only, but @abort kills the enclosing program
6909 C-D closes IPython only, but @abort kills the enclosing program
6897 too (unless it had called IPython inside a try catching
6910 too (unless it had called IPython inside a try catching
6898 SystemExit).
6911 SystemExit).
6899
6912
6900 * Created Shell module which exposes the actuall IPython Shell
6913 * Created Shell module which exposes the actuall IPython Shell
6901 classes, currently the normal and the embeddable one. This at
6914 classes, currently the normal and the embeddable one. This at
6902 least offers a stable interface we won't need to change when
6915 least offers a stable interface we won't need to change when
6903 (later) the internals are rewritten. That rewrite will be confined
6916 (later) the internals are rewritten. That rewrite will be confined
6904 to iplib and ipmaker, but the Shell interface should remain as is.
6917 to iplib and ipmaker, but the Shell interface should remain as is.
6905
6918
6906 * Added embed module which offers an embeddable IPShell object,
6919 * Added embed module which offers an embeddable IPShell object,
6907 useful to fire up IPython *inside* a running program. Great for
6920 useful to fire up IPython *inside* a running program. Great for
6908 debugging or dynamical data analysis.
6921 debugging or dynamical data analysis.
6909
6922
6910 2001-12-08 Fernando Perez <fperez@colorado.edu>
6923 2001-12-08 Fernando Perez <fperez@colorado.edu>
6911
6924
6912 * Fixed small bug preventing seeing info from methods of defined
6925 * Fixed small bug preventing seeing info from methods of defined
6913 objects (incorrect namespace in _ofind()).
6926 objects (incorrect namespace in _ofind()).
6914
6927
6915 * Documentation cleanup. Moved the main usage docstrings to a
6928 * Documentation cleanup. Moved the main usage docstrings to a
6916 separate file, usage.py (cleaner to maintain, and hopefully in the
6929 separate file, usage.py (cleaner to maintain, and hopefully in the
6917 future some perlpod-like way of producing interactive, man and
6930 future some perlpod-like way of producing interactive, man and
6918 html docs out of it will be found).
6931 html docs out of it will be found).
6919
6932
6920 * Added @profile to see your profile at any time.
6933 * Added @profile to see your profile at any time.
6921
6934
6922 * Added @p as an alias for 'print'. It's especially convenient if
6935 * Added @p as an alias for 'print'. It's especially convenient if
6923 using automagic ('p x' prints x).
6936 using automagic ('p x' prints x).
6924
6937
6925 * Small cleanups and fixes after a pychecker run.
6938 * Small cleanups and fixes after a pychecker run.
6926
6939
6927 * Changed the @cd command to handle @cd - and @cd -<n> for
6940 * Changed the @cd command to handle @cd - and @cd -<n> for
6928 visiting any directory in _dh.
6941 visiting any directory in _dh.
6929
6942
6930 * Introduced _dh, a history of visited directories. @dhist prints
6943 * Introduced _dh, a history of visited directories. @dhist prints
6931 it out with numbers.
6944 it out with numbers.
6932
6945
6933 2001-12-07 Fernando Perez <fperez@colorado.edu>
6946 2001-12-07 Fernando Perez <fperez@colorado.edu>
6934
6947
6935 * Released 0.1.22
6948 * Released 0.1.22
6936
6949
6937 * Made initialization a bit more robust against invalid color
6950 * Made initialization a bit more robust against invalid color
6938 options in user input (exit, not traceback-crash).
6951 options in user input (exit, not traceback-crash).
6939
6952
6940 * Changed the bug crash reporter to write the report only in the
6953 * Changed the bug crash reporter to write the report only in the
6941 user's .ipython directory. That way IPython won't litter people's
6954 user's .ipython directory. That way IPython won't litter people's
6942 hard disks with crash files all over the place. Also print on
6955 hard disks with crash files all over the place. Also print on
6943 screen the necessary mail command.
6956 screen the necessary mail command.
6944
6957
6945 * With the new ultraTB, implemented LightBG color scheme for light
6958 * With the new ultraTB, implemented LightBG color scheme for light
6946 background terminals. A lot of people like white backgrounds, so I
6959 background terminals. A lot of people like white backgrounds, so I
6947 guess we should at least give them something readable.
6960 guess we should at least give them something readable.
6948
6961
6949 2001-12-06 Fernando Perez <fperez@colorado.edu>
6962 2001-12-06 Fernando Perez <fperez@colorado.edu>
6950
6963
6951 * Modified the structure of ultraTB. Now there's a proper class
6964 * Modified the structure of ultraTB. Now there's a proper class
6952 for tables of color schemes which allow adding schemes easily and
6965 for tables of color schemes which allow adding schemes easily and
6953 switching the active scheme without creating a new instance every
6966 switching the active scheme without creating a new instance every
6954 time (which was ridiculous). The syntax for creating new schemes
6967 time (which was ridiculous). The syntax for creating new schemes
6955 is also cleaner. I think ultraTB is finally done, with a clean
6968 is also cleaner. I think ultraTB is finally done, with a clean
6956 class structure. Names are also much cleaner (now there's proper
6969 class structure. Names are also much cleaner (now there's proper
6957 color tables, no need for every variable to also have 'color' in
6970 color tables, no need for every variable to also have 'color' in
6958 its name).
6971 its name).
6959
6972
6960 * Broke down genutils into separate files. Now genutils only
6973 * Broke down genutils into separate files. Now genutils only
6961 contains utility functions, and classes have been moved to their
6974 contains utility functions, and classes have been moved to their
6962 own files (they had enough independent functionality to warrant
6975 own files (they had enough independent functionality to warrant
6963 it): ConfigLoader, OutputTrap, Struct.
6976 it): ConfigLoader, OutputTrap, Struct.
6964
6977
6965 2001-12-05 Fernando Perez <fperez@colorado.edu>
6978 2001-12-05 Fernando Perez <fperez@colorado.edu>
6966
6979
6967 * IPython turns 21! Released version 0.1.21, as a candidate for
6980 * IPython turns 21! Released version 0.1.21, as a candidate for
6968 public consumption. If all goes well, release in a few days.
6981 public consumption. If all goes well, release in a few days.
6969
6982
6970 * Fixed path bug (files in Extensions/ directory wouldn't be found
6983 * Fixed path bug (files in Extensions/ directory wouldn't be found
6971 unless IPython/ was explicitly in sys.path).
6984 unless IPython/ was explicitly in sys.path).
6972
6985
6973 * Extended the FlexCompleter class as MagicCompleter to allow
6986 * Extended the FlexCompleter class as MagicCompleter to allow
6974 completion of @-starting lines.
6987 completion of @-starting lines.
6975
6988
6976 * Created __release__.py file as a central repository for release
6989 * Created __release__.py file as a central repository for release
6977 info that other files can read from.
6990 info that other files can read from.
6978
6991
6979 * Fixed small bug in logging: when logging was turned on in
6992 * Fixed small bug in logging: when logging was turned on in
6980 mid-session, old lines with special meanings (!@?) were being
6993 mid-session, old lines with special meanings (!@?) were being
6981 logged without the prepended comment, which is necessary since
6994 logged without the prepended comment, which is necessary since
6982 they are not truly valid python syntax. This should make session
6995 they are not truly valid python syntax. This should make session
6983 restores produce less errors.
6996 restores produce less errors.
6984
6997
6985 * The namespace cleanup forced me to make a FlexCompleter class
6998 * The namespace cleanup forced me to make a FlexCompleter class
6986 which is nothing but a ripoff of rlcompleter, but with selectable
6999 which is nothing but a ripoff of rlcompleter, but with selectable
6987 namespace (rlcompleter only works in __main__.__dict__). I'll try
7000 namespace (rlcompleter only works in __main__.__dict__). I'll try
6988 to submit a note to the authors to see if this change can be
7001 to submit a note to the authors to see if this change can be
6989 incorporated in future rlcompleter releases (Dec.6: done)
7002 incorporated in future rlcompleter releases (Dec.6: done)
6990
7003
6991 * More fixes to namespace handling. It was a mess! Now all
7004 * More fixes to namespace handling. It was a mess! Now all
6992 explicit references to __main__.__dict__ are gone (except when
7005 explicit references to __main__.__dict__ are gone (except when
6993 really needed) and everything is handled through the namespace
7006 really needed) and everything is handled through the namespace
6994 dicts in the IPython instance. We seem to be getting somewhere
7007 dicts in the IPython instance. We seem to be getting somewhere
6995 with this, finally...
7008 with this, finally...
6996
7009
6997 * Small documentation updates.
7010 * Small documentation updates.
6998
7011
6999 * Created the Extensions directory under IPython (with an
7012 * Created the Extensions directory under IPython (with an
7000 __init__.py). Put the PhysicalQ stuff there. This directory should
7013 __init__.py). Put the PhysicalQ stuff there. This directory should
7001 be used for all special-purpose extensions.
7014 be used for all special-purpose extensions.
7002
7015
7003 * File renaming:
7016 * File renaming:
7004 ipythonlib --> ipmaker
7017 ipythonlib --> ipmaker
7005 ipplib --> iplib
7018 ipplib --> iplib
7006 This makes a bit more sense in terms of what these files actually do.
7019 This makes a bit more sense in terms of what these files actually do.
7007
7020
7008 * Moved all the classes and functions in ipythonlib to ipplib, so
7021 * Moved all the classes and functions in ipythonlib to ipplib, so
7009 now ipythonlib only has make_IPython(). This will ease up its
7022 now ipythonlib only has make_IPython(). This will ease up its
7010 splitting in smaller functional chunks later.
7023 splitting in smaller functional chunks later.
7011
7024
7012 * Cleaned up (done, I think) output of @whos. Better column
7025 * Cleaned up (done, I think) output of @whos. Better column
7013 formatting, and now shows str(var) for as much as it can, which is
7026 formatting, and now shows str(var) for as much as it can, which is
7014 typically what one gets with a 'print var'.
7027 typically what one gets with a 'print var'.
7015
7028
7016 2001-12-04 Fernando Perez <fperez@colorado.edu>
7029 2001-12-04 Fernando Perez <fperez@colorado.edu>
7017
7030
7018 * Fixed namespace problems. Now builtin/IPyhton/user names get
7031 * Fixed namespace problems. Now builtin/IPyhton/user names get
7019 properly reported in their namespace. Internal namespace handling
7032 properly reported in their namespace. Internal namespace handling
7020 is finally getting decent (not perfect yet, but much better than
7033 is finally getting decent (not perfect yet, but much better than
7021 the ad-hoc mess we had).
7034 the ad-hoc mess we had).
7022
7035
7023 * Removed -exit option. If people just want to run a python
7036 * Removed -exit option. If people just want to run a python
7024 script, that's what the normal interpreter is for. Less
7037 script, that's what the normal interpreter is for. Less
7025 unnecessary options, less chances for bugs.
7038 unnecessary options, less chances for bugs.
7026
7039
7027 * Added a crash handler which generates a complete post-mortem if
7040 * Added a crash handler which generates a complete post-mortem if
7028 IPython crashes. This will help a lot in tracking bugs down the
7041 IPython crashes. This will help a lot in tracking bugs down the
7029 road.
7042 road.
7030
7043
7031 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
7044 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
7032 which were boud to functions being reassigned would bypass the
7045 which were boud to functions being reassigned would bypass the
7033 logger, breaking the sync of _il with the prompt counter. This
7046 logger, breaking the sync of _il with the prompt counter. This
7034 would then crash IPython later when a new line was logged.
7047 would then crash IPython later when a new line was logged.
7035
7048
7036 2001-12-02 Fernando Perez <fperez@colorado.edu>
7049 2001-12-02 Fernando Perez <fperez@colorado.edu>
7037
7050
7038 * Made IPython a package. This means people don't have to clutter
7051 * Made IPython a package. This means people don't have to clutter
7039 their sys.path with yet another directory. Changed the INSTALL
7052 their sys.path with yet another directory. Changed the INSTALL
7040 file accordingly.
7053 file accordingly.
7041
7054
7042 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
7055 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
7043 sorts its output (so @who shows it sorted) and @whos formats the
7056 sorts its output (so @who shows it sorted) and @whos formats the
7044 table according to the width of the first column. Nicer, easier to
7057 table according to the width of the first column. Nicer, easier to
7045 read. Todo: write a generic table_format() which takes a list of
7058 read. Todo: write a generic table_format() which takes a list of
7046 lists and prints it nicely formatted, with optional row/column
7059 lists and prints it nicely formatted, with optional row/column
7047 separators and proper padding and justification.
7060 separators and proper padding and justification.
7048
7061
7049 * Released 0.1.20
7062 * Released 0.1.20
7050
7063
7051 * Fixed bug in @log which would reverse the inputcache list (a
7064 * Fixed bug in @log which would reverse the inputcache list (a
7052 copy operation was missing).
7065 copy operation was missing).
7053
7066
7054 * Code cleanup. @config was changed to use page(). Better, since
7067 * Code cleanup. @config was changed to use page(). Better, since
7055 its output is always quite long.
7068 its output is always quite long.
7056
7069
7057 * Itpl is back as a dependency. I was having too many problems
7070 * Itpl is back as a dependency. I was having too many problems
7058 getting the parametric aliases to work reliably, and it's just
7071 getting the parametric aliases to work reliably, and it's just
7059 easier to code weird string operations with it than playing %()s
7072 easier to code weird string operations with it than playing %()s
7060 games. It's only ~6k, so I don't think it's too big a deal.
7073 games. It's only ~6k, so I don't think it's too big a deal.
7061
7074
7062 * Found (and fixed) a very nasty bug with history. !lines weren't
7075 * Found (and fixed) a very nasty bug with history. !lines weren't
7063 getting cached, and the out of sync caches would crash
7076 getting cached, and the out of sync caches would crash
7064 IPython. Fixed it by reorganizing the prefilter/handlers/logger
7077 IPython. Fixed it by reorganizing the prefilter/handlers/logger
7065 division of labor a bit better. Bug fixed, cleaner structure.
7078 division of labor a bit better. Bug fixed, cleaner structure.
7066
7079
7067 2001-12-01 Fernando Perez <fperez@colorado.edu>
7080 2001-12-01 Fernando Perez <fperez@colorado.edu>
7068
7081
7069 * Released 0.1.19
7082 * Released 0.1.19
7070
7083
7071 * Added option -n to @hist to prevent line number printing. Much
7084 * Added option -n to @hist to prevent line number printing. Much
7072 easier to copy/paste code this way.
7085 easier to copy/paste code this way.
7073
7086
7074 * Created global _il to hold the input list. Allows easy
7087 * Created global _il to hold the input list. Allows easy
7075 re-execution of blocks of code by slicing it (inspired by Janko's
7088 re-execution of blocks of code by slicing it (inspired by Janko's
7076 comment on 'macros').
7089 comment on 'macros').
7077
7090
7078 * Small fixes and doc updates.
7091 * Small fixes and doc updates.
7079
7092
7080 * Rewrote @history function (was @h). Renamed it to @hist, @h is
7093 * Rewrote @history function (was @h). Renamed it to @hist, @h is
7081 much too fragile with automagic. Handles properly multi-line
7094 much too fragile with automagic. Handles properly multi-line
7082 statements and takes parameters.
7095 statements and takes parameters.
7083
7096
7084 2001-11-30 Fernando Perez <fperez@colorado.edu>
7097 2001-11-30 Fernando Perez <fperez@colorado.edu>
7085
7098
7086 * Version 0.1.18 released.
7099 * Version 0.1.18 released.
7087
7100
7088 * Fixed nasty namespace bug in initial module imports.
7101 * Fixed nasty namespace bug in initial module imports.
7089
7102
7090 * Added copyright/license notes to all code files (except
7103 * Added copyright/license notes to all code files (except
7091 DPyGetOpt). For the time being, LGPL. That could change.
7104 DPyGetOpt). For the time being, LGPL. That could change.
7092
7105
7093 * Rewrote a much nicer README, updated INSTALL, cleaned up
7106 * Rewrote a much nicer README, updated INSTALL, cleaned up
7094 ipythonrc-* samples.
7107 ipythonrc-* samples.
7095
7108
7096 * Overall code/documentation cleanup. Basically ready for
7109 * Overall code/documentation cleanup. Basically ready for
7097 release. Only remaining thing: licence decision (LGPL?).
7110 release. Only remaining thing: licence decision (LGPL?).
7098
7111
7099 * Converted load_config to a class, ConfigLoader. Now recursion
7112 * Converted load_config to a class, ConfigLoader. Now recursion
7100 control is better organized. Doesn't include the same file twice.
7113 control is better organized. Doesn't include the same file twice.
7101
7114
7102 2001-11-29 Fernando Perez <fperez@colorado.edu>
7115 2001-11-29 Fernando Perez <fperez@colorado.edu>
7103
7116
7104 * Got input history working. Changed output history variables from
7117 * Got input history working. Changed output history variables from
7105 _p to _o so that _i is for input and _o for output. Just cleaner
7118 _p to _o so that _i is for input and _o for output. Just cleaner
7106 convention.
7119 convention.
7107
7120
7108 * Implemented parametric aliases. This pretty much allows the
7121 * Implemented parametric aliases. This pretty much allows the
7109 alias system to offer full-blown shell convenience, I think.
7122 alias system to offer full-blown shell convenience, I think.
7110
7123
7111 * Version 0.1.17 released, 0.1.18 opened.
7124 * Version 0.1.17 released, 0.1.18 opened.
7112
7125
7113 * dot_ipython/ipythonrc (alias): added documentation.
7126 * dot_ipython/ipythonrc (alias): added documentation.
7114 (xcolor): Fixed small bug (xcolors -> xcolor)
7127 (xcolor): Fixed small bug (xcolors -> xcolor)
7115
7128
7116 * Changed the alias system. Now alias is a magic command to define
7129 * Changed the alias system. Now alias is a magic command to define
7117 aliases just like the shell. Rationale: the builtin magics should
7130 aliases just like the shell. Rationale: the builtin magics should
7118 be there for things deeply connected to IPython's
7131 be there for things deeply connected to IPython's
7119 architecture. And this is a much lighter system for what I think
7132 architecture. And this is a much lighter system for what I think
7120 is the really important feature: allowing users to define quickly
7133 is the really important feature: allowing users to define quickly
7121 magics that will do shell things for them, so they can customize
7134 magics that will do shell things for them, so they can customize
7122 IPython easily to match their work habits. If someone is really
7135 IPython easily to match their work habits. If someone is really
7123 desperate to have another name for a builtin alias, they can
7136 desperate to have another name for a builtin alias, they can
7124 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
7137 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
7125 works.
7138 works.
7126
7139
7127 2001-11-28 Fernando Perez <fperez@colorado.edu>
7140 2001-11-28 Fernando Perez <fperez@colorado.edu>
7128
7141
7129 * Changed @file so that it opens the source file at the proper
7142 * Changed @file so that it opens the source file at the proper
7130 line. Since it uses less, if your EDITOR environment is
7143 line. Since it uses less, if your EDITOR environment is
7131 configured, typing v will immediately open your editor of choice
7144 configured, typing v will immediately open your editor of choice
7132 right at the line where the object is defined. Not as quick as
7145 right at the line where the object is defined. Not as quick as
7133 having a direct @edit command, but for all intents and purposes it
7146 having a direct @edit command, but for all intents and purposes it
7134 works. And I don't have to worry about writing @edit to deal with
7147 works. And I don't have to worry about writing @edit to deal with
7135 all the editors, less does that.
7148 all the editors, less does that.
7136
7149
7137 * Version 0.1.16 released, 0.1.17 opened.
7150 * Version 0.1.16 released, 0.1.17 opened.
7138
7151
7139 * Fixed some nasty bugs in the page/page_dumb combo that could
7152 * Fixed some nasty bugs in the page/page_dumb combo that could
7140 crash IPython.
7153 crash IPython.
7141
7154
7142 2001-11-27 Fernando Perez <fperez@colorado.edu>
7155 2001-11-27 Fernando Perez <fperez@colorado.edu>
7143
7156
7144 * Version 0.1.15 released, 0.1.16 opened.
7157 * Version 0.1.15 released, 0.1.16 opened.
7145
7158
7146 * Finally got ? and ?? to work for undefined things: now it's
7159 * Finally got ? and ?? to work for undefined things: now it's
7147 possible to type {}.get? and get information about the get method
7160 possible to type {}.get? and get information about the get method
7148 of dicts, or os.path? even if only os is defined (so technically
7161 of dicts, or os.path? even if only os is defined (so technically
7149 os.path isn't). Works at any level. For example, after import os,
7162 os.path isn't). Works at any level. For example, after import os,
7150 os?, os.path?, os.path.abspath? all work. This is great, took some
7163 os?, os.path?, os.path.abspath? all work. This is great, took some
7151 work in _ofind.
7164 work in _ofind.
7152
7165
7153 * Fixed more bugs with logging. The sanest way to do it was to add
7166 * Fixed more bugs with logging. The sanest way to do it was to add
7154 to @log a 'mode' parameter. Killed two in one shot (this mode
7167 to @log a 'mode' parameter. Killed two in one shot (this mode
7155 option was a request of Janko's). I think it's finally clean
7168 option was a request of Janko's). I think it's finally clean
7156 (famous last words).
7169 (famous last words).
7157
7170
7158 * Added a page_dumb() pager which does a decent job of paging on
7171 * Added a page_dumb() pager which does a decent job of paging on
7159 screen, if better things (like less) aren't available. One less
7172 screen, if better things (like less) aren't available. One less
7160 unix dependency (someday maybe somebody will port this to
7173 unix dependency (someday maybe somebody will port this to
7161 windows).
7174 windows).
7162
7175
7163 * Fixed problem in magic_log: would lock of logging out if log
7176 * Fixed problem in magic_log: would lock of logging out if log
7164 creation failed (because it would still think it had succeeded).
7177 creation failed (because it would still think it had succeeded).
7165
7178
7166 * Improved the page() function using curses to auto-detect screen
7179 * Improved the page() function using curses to auto-detect screen
7167 size. Now it can make a much better decision on whether to print
7180 size. Now it can make a much better decision on whether to print
7168 or page a string. Option screen_length was modified: a value 0
7181 or page a string. Option screen_length was modified: a value 0
7169 means auto-detect, and that's the default now.
7182 means auto-detect, and that's the default now.
7170
7183
7171 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
7184 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
7172 go out. I'll test it for a few days, then talk to Janko about
7185 go out. I'll test it for a few days, then talk to Janko about
7173 licences and announce it.
7186 licences and announce it.
7174
7187
7175 * Fixed the length of the auto-generated ---> prompt which appears
7188 * Fixed the length of the auto-generated ---> prompt which appears
7176 for auto-parens and auto-quotes. Getting this right isn't trivial,
7189 for auto-parens and auto-quotes. Getting this right isn't trivial,
7177 with all the color escapes, different prompt types and optional
7190 with all the color escapes, different prompt types and optional
7178 separators. But it seems to be working in all the combinations.
7191 separators. But it seems to be working in all the combinations.
7179
7192
7180 2001-11-26 Fernando Perez <fperez@colorado.edu>
7193 2001-11-26 Fernando Perez <fperez@colorado.edu>
7181
7194
7182 * Wrote a regexp filter to get option types from the option names
7195 * Wrote a regexp filter to get option types from the option names
7183 string. This eliminates the need to manually keep two duplicate
7196 string. This eliminates the need to manually keep two duplicate
7184 lists.
7197 lists.
7185
7198
7186 * Removed the unneeded check_option_names. Now options are handled
7199 * Removed the unneeded check_option_names. Now options are handled
7187 in a much saner manner and it's easy to visually check that things
7200 in a much saner manner and it's easy to visually check that things
7188 are ok.
7201 are ok.
7189
7202
7190 * Updated version numbers on all files I modified to carry a
7203 * Updated version numbers on all files I modified to carry a
7191 notice so Janko and Nathan have clear version markers.
7204 notice so Janko and Nathan have clear version markers.
7192
7205
7193 * Updated docstring for ultraTB with my changes. I should send
7206 * Updated docstring for ultraTB with my changes. I should send
7194 this to Nathan.
7207 this to Nathan.
7195
7208
7196 * Lots of small fixes. Ran everything through pychecker again.
7209 * Lots of small fixes. Ran everything through pychecker again.
7197
7210
7198 * Made loading of deep_reload an cmd line option. If it's not too
7211 * Made loading of deep_reload an cmd line option. If it's not too
7199 kosher, now people can just disable it. With -nodeep_reload it's
7212 kosher, now people can just disable it. With -nodeep_reload it's
7200 still available as dreload(), it just won't overwrite reload().
7213 still available as dreload(), it just won't overwrite reload().
7201
7214
7202 * Moved many options to the no| form (-opt and -noopt
7215 * Moved many options to the no| form (-opt and -noopt
7203 accepted). Cleaner.
7216 accepted). Cleaner.
7204
7217
7205 * Changed magic_log so that if called with no parameters, it uses
7218 * Changed magic_log so that if called with no parameters, it uses
7206 'rotate' mode. That way auto-generated logs aren't automatically
7219 'rotate' mode. That way auto-generated logs aren't automatically
7207 over-written. For normal logs, now a backup is made if it exists
7220 over-written. For normal logs, now a backup is made if it exists
7208 (only 1 level of backups). A new 'backup' mode was added to the
7221 (only 1 level of backups). A new 'backup' mode was added to the
7209 Logger class to support this. This was a request by Janko.
7222 Logger class to support this. This was a request by Janko.
7210
7223
7211 * Added @logoff/@logon to stop/restart an active log.
7224 * Added @logoff/@logon to stop/restart an active log.
7212
7225
7213 * Fixed a lot of bugs in log saving/replay. It was pretty
7226 * Fixed a lot of bugs in log saving/replay. It was pretty
7214 broken. Now special lines (!@,/) appear properly in the command
7227 broken. Now special lines (!@,/) appear properly in the command
7215 history after a log replay.
7228 history after a log replay.
7216
7229
7217 * Tried and failed to implement full session saving via pickle. My
7230 * Tried and failed to implement full session saving via pickle. My
7218 idea was to pickle __main__.__dict__, but modules can't be
7231 idea was to pickle __main__.__dict__, but modules can't be
7219 pickled. This would be a better alternative to replaying logs, but
7232 pickled. This would be a better alternative to replaying logs, but
7220 seems quite tricky to get to work. Changed -session to be called
7233 seems quite tricky to get to work. Changed -session to be called
7221 -logplay, which more accurately reflects what it does. And if we
7234 -logplay, which more accurately reflects what it does. And if we
7222 ever get real session saving working, -session is now available.
7235 ever get real session saving working, -session is now available.
7223
7236
7224 * Implemented color schemes for prompts also. As for tracebacks,
7237 * Implemented color schemes for prompts also. As for tracebacks,
7225 currently only NoColor and Linux are supported. But now the
7238 currently only NoColor and Linux are supported. But now the
7226 infrastructure is in place, based on a generic ColorScheme
7239 infrastructure is in place, based on a generic ColorScheme
7227 class. So writing and activating new schemes both for the prompts
7240 class. So writing and activating new schemes both for the prompts
7228 and the tracebacks should be straightforward.
7241 and the tracebacks should be straightforward.
7229
7242
7230 * Version 0.1.13 released, 0.1.14 opened.
7243 * Version 0.1.13 released, 0.1.14 opened.
7231
7244
7232 * Changed handling of options for output cache. Now counter is
7245 * Changed handling of options for output cache. Now counter is
7233 hardwired starting at 1 and one specifies the maximum number of
7246 hardwired starting at 1 and one specifies the maximum number of
7234 entries *in the outcache* (not the max prompt counter). This is
7247 entries *in the outcache* (not the max prompt counter). This is
7235 much better, since many statements won't increase the cache
7248 much better, since many statements won't increase the cache
7236 count. It also eliminated some confusing options, now there's only
7249 count. It also eliminated some confusing options, now there's only
7237 one: cache_size.
7250 one: cache_size.
7238
7251
7239 * Added 'alias' magic function and magic_alias option in the
7252 * Added 'alias' magic function and magic_alias option in the
7240 ipythonrc file. Now the user can easily define whatever names he
7253 ipythonrc file. Now the user can easily define whatever names he
7241 wants for the magic functions without having to play weird
7254 wants for the magic functions without having to play weird
7242 namespace games. This gives IPython a real shell-like feel.
7255 namespace games. This gives IPython a real shell-like feel.
7243
7256
7244 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
7257 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
7245 @ or not).
7258 @ or not).
7246
7259
7247 This was one of the last remaining 'visible' bugs (that I know
7260 This was one of the last remaining 'visible' bugs (that I know
7248 of). I think if I can clean up the session loading so it works
7261 of). I think if I can clean up the session loading so it works
7249 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
7262 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
7250 about licensing).
7263 about licensing).
7251
7264
7252 2001-11-25 Fernando Perez <fperez@colorado.edu>
7265 2001-11-25 Fernando Perez <fperez@colorado.edu>
7253
7266
7254 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
7267 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
7255 there's a cleaner distinction between what ? and ?? show.
7268 there's a cleaner distinction between what ? and ?? show.
7256
7269
7257 * Added screen_length option. Now the user can define his own
7270 * Added screen_length option. Now the user can define his own
7258 screen size for page() operations.
7271 screen size for page() operations.
7259
7272
7260 * Implemented magic shell-like functions with automatic code
7273 * Implemented magic shell-like functions with automatic code
7261 generation. Now adding another function is just a matter of adding
7274 generation. Now adding another function is just a matter of adding
7262 an entry to a dict, and the function is dynamically generated at
7275 an entry to a dict, and the function is dynamically generated at
7263 run-time. Python has some really cool features!
7276 run-time. Python has some really cool features!
7264
7277
7265 * Renamed many options to cleanup conventions a little. Now all
7278 * Renamed many options to cleanup conventions a little. Now all
7266 are lowercase, and only underscores where needed. Also in the code
7279 are lowercase, and only underscores where needed. Also in the code
7267 option name tables are clearer.
7280 option name tables are clearer.
7268
7281
7269 * Changed prompts a little. Now input is 'In [n]:' instead of
7282 * Changed prompts a little. Now input is 'In [n]:' instead of
7270 'In[n]:='. This allows it the numbers to be aligned with the
7283 'In[n]:='. This allows it the numbers to be aligned with the
7271 Out[n] numbers, and removes usage of ':=' which doesn't exist in
7284 Out[n] numbers, and removes usage of ':=' which doesn't exist in
7272 Python (it was a Mathematica thing). The '...' continuation prompt
7285 Python (it was a Mathematica thing). The '...' continuation prompt
7273 was also changed a little to align better.
7286 was also changed a little to align better.
7274
7287
7275 * Fixed bug when flushing output cache. Not all _p<n> variables
7288 * Fixed bug when flushing output cache. Not all _p<n> variables
7276 exist, so their deletion needs to be wrapped in a try:
7289 exist, so their deletion needs to be wrapped in a try:
7277
7290
7278 * Figured out how to properly use inspect.formatargspec() (it
7291 * Figured out how to properly use inspect.formatargspec() (it
7279 requires the args preceded by *). So I removed all the code from
7292 requires the args preceded by *). So I removed all the code from
7280 _get_pdef in Magic, which was just replicating that.
7293 _get_pdef in Magic, which was just replicating that.
7281
7294
7282 * Added test to prefilter to allow redefining magic function names
7295 * Added test to prefilter to allow redefining magic function names
7283 as variables. This is ok, since the @ form is always available,
7296 as variables. This is ok, since the @ form is always available,
7284 but whe should allow the user to define a variable called 'ls' if
7297 but whe should allow the user to define a variable called 'ls' if
7285 he needs it.
7298 he needs it.
7286
7299
7287 * Moved the ToDo information from README into a separate ToDo.
7300 * Moved the ToDo information from README into a separate ToDo.
7288
7301
7289 * General code cleanup and small bugfixes. I think it's close to a
7302 * General code cleanup and small bugfixes. I think it's close to a
7290 state where it can be released, obviously with a big 'beta'
7303 state where it can be released, obviously with a big 'beta'
7291 warning on it.
7304 warning on it.
7292
7305
7293 * Got the magic function split to work. Now all magics are defined
7306 * Got the magic function split to work. Now all magics are defined
7294 in a separate class. It just organizes things a bit, and now
7307 in a separate class. It just organizes things a bit, and now
7295 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
7308 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
7296 was too long).
7309 was too long).
7297
7310
7298 * Changed @clear to @reset to avoid potential confusions with
7311 * Changed @clear to @reset to avoid potential confusions with
7299 the shell command clear. Also renamed @cl to @clear, which does
7312 the shell command clear. Also renamed @cl to @clear, which does
7300 exactly what people expect it to from their shell experience.
7313 exactly what people expect it to from their shell experience.
7301
7314
7302 Added a check to the @reset command (since it's so
7315 Added a check to the @reset command (since it's so
7303 destructive, it's probably a good idea to ask for confirmation).
7316 destructive, it's probably a good idea to ask for confirmation).
7304 But now reset only works for full namespace resetting. Since the
7317 But now reset only works for full namespace resetting. Since the
7305 del keyword is already there for deleting a few specific
7318 del keyword is already there for deleting a few specific
7306 variables, I don't see the point of having a redundant magic
7319 variables, I don't see the point of having a redundant magic
7307 function for the same task.
7320 function for the same task.
7308
7321
7309 2001-11-24 Fernando Perez <fperez@colorado.edu>
7322 2001-11-24 Fernando Perez <fperez@colorado.edu>
7310
7323
7311 * Updated the builtin docs (esp. the ? ones).
7324 * Updated the builtin docs (esp. the ? ones).
7312
7325
7313 * Ran all the code through pychecker. Not terribly impressed with
7326 * Ran all the code through pychecker. Not terribly impressed with
7314 it: lots of spurious warnings and didn't really find anything of
7327 it: lots of spurious warnings and didn't really find anything of
7315 substance (just a few modules being imported and not used).
7328 substance (just a few modules being imported and not used).
7316
7329
7317 * Implemented the new ultraTB functionality into IPython. New
7330 * Implemented the new ultraTB functionality into IPython. New
7318 option: xcolors. This chooses color scheme. xmode now only selects
7331 option: xcolors. This chooses color scheme. xmode now only selects
7319 between Plain and Verbose. Better orthogonality.
7332 between Plain and Verbose. Better orthogonality.
7320
7333
7321 * Large rewrite of ultraTB. Much cleaner now, with a separation of
7334 * Large rewrite of ultraTB. Much cleaner now, with a separation of
7322 mode and color scheme for the exception handlers. Now it's
7335 mode and color scheme for the exception handlers. Now it's
7323 possible to have the verbose traceback with no coloring.
7336 possible to have the verbose traceback with no coloring.
7324
7337
7325 2001-11-23 Fernando Perez <fperez@colorado.edu>
7338 2001-11-23 Fernando Perez <fperez@colorado.edu>
7326
7339
7327 * Version 0.1.12 released, 0.1.13 opened.
7340 * Version 0.1.12 released, 0.1.13 opened.
7328
7341
7329 * Removed option to set auto-quote and auto-paren escapes by
7342 * Removed option to set auto-quote and auto-paren escapes by
7330 user. The chances of breaking valid syntax are just too high. If
7343 user. The chances of breaking valid syntax are just too high. If
7331 someone *really* wants, they can always dig into the code.
7344 someone *really* wants, they can always dig into the code.
7332
7345
7333 * Made prompt separators configurable.
7346 * Made prompt separators configurable.
7334
7347
7335 2001-11-22 Fernando Perez <fperez@colorado.edu>
7348 2001-11-22 Fernando Perez <fperez@colorado.edu>
7336
7349
7337 * Small bugfixes in many places.
7350 * Small bugfixes in many places.
7338
7351
7339 * Removed the MyCompleter class from ipplib. It seemed redundant
7352 * Removed the MyCompleter class from ipplib. It seemed redundant
7340 with the C-p,C-n history search functionality. Less code to
7353 with the C-p,C-n history search functionality. Less code to
7341 maintain.
7354 maintain.
7342
7355
7343 * Moved all the original ipython.py code into ipythonlib.py. Right
7356 * Moved all the original ipython.py code into ipythonlib.py. Right
7344 now it's just one big dump into a function called make_IPython, so
7357 now it's just one big dump into a function called make_IPython, so
7345 no real modularity has been gained. But at least it makes the
7358 no real modularity has been gained. But at least it makes the
7346 wrapper script tiny, and since ipythonlib is a module, it gets
7359 wrapper script tiny, and since ipythonlib is a module, it gets
7347 compiled and startup is much faster.
7360 compiled and startup is much faster.
7348
7361
7349 This is a reasobably 'deep' change, so we should test it for a
7362 This is a reasobably 'deep' change, so we should test it for a
7350 while without messing too much more with the code.
7363 while without messing too much more with the code.
7351
7364
7352 2001-11-21 Fernando Perez <fperez@colorado.edu>
7365 2001-11-21 Fernando Perez <fperez@colorado.edu>
7353
7366
7354 * Version 0.1.11 released, 0.1.12 opened for further work.
7367 * Version 0.1.11 released, 0.1.12 opened for further work.
7355
7368
7356 * Removed dependency on Itpl. It was only needed in one place. It
7369 * Removed dependency on Itpl. It was only needed in one place. It
7357 would be nice if this became part of python, though. It makes life
7370 would be nice if this became part of python, though. It makes life
7358 *a lot* easier in some cases.
7371 *a lot* easier in some cases.
7359
7372
7360 * Simplified the prefilter code a bit. Now all handlers are
7373 * Simplified the prefilter code a bit. Now all handlers are
7361 expected to explicitly return a value (at least a blank string).
7374 expected to explicitly return a value (at least a blank string).
7362
7375
7363 * Heavy edits in ipplib. Removed the help system altogether. Now
7376 * Heavy edits in ipplib. Removed the help system altogether. Now
7364 obj?/?? is used for inspecting objects, a magic @doc prints
7377 obj?/?? is used for inspecting objects, a magic @doc prints
7365 docstrings, and full-blown Python help is accessed via the 'help'
7378 docstrings, and full-blown Python help is accessed via the 'help'
7366 keyword. This cleans up a lot of code (less to maintain) and does
7379 keyword. This cleans up a lot of code (less to maintain) and does
7367 the job. Since 'help' is now a standard Python component, might as
7380 the job. Since 'help' is now a standard Python component, might as
7368 well use it and remove duplicate functionality.
7381 well use it and remove duplicate functionality.
7369
7382
7370 Also removed the option to use ipplib as a standalone program. By
7383 Also removed the option to use ipplib as a standalone program. By
7371 now it's too dependent on other parts of IPython to function alone.
7384 now it's too dependent on other parts of IPython to function alone.
7372
7385
7373 * Fixed bug in genutils.pager. It would crash if the pager was
7386 * Fixed bug in genutils.pager. It would crash if the pager was
7374 exited immediately after opening (broken pipe).
7387 exited immediately after opening (broken pipe).
7375
7388
7376 * Trimmed down the VerboseTB reporting a little. The header is
7389 * Trimmed down the VerboseTB reporting a little. The header is
7377 much shorter now and the repeated exception arguments at the end
7390 much shorter now and the repeated exception arguments at the end
7378 have been removed. For interactive use the old header seemed a bit
7391 have been removed. For interactive use the old header seemed a bit
7379 excessive.
7392 excessive.
7380
7393
7381 * Fixed small bug in output of @whos for variables with multi-word
7394 * Fixed small bug in output of @whos for variables with multi-word
7382 types (only first word was displayed).
7395 types (only first word was displayed).
7383
7396
7384 2001-11-17 Fernando Perez <fperez@colorado.edu>
7397 2001-11-17 Fernando Perez <fperez@colorado.edu>
7385
7398
7386 * Version 0.1.10 released, 0.1.11 opened for further work.
7399 * Version 0.1.10 released, 0.1.11 opened for further work.
7387
7400
7388 * Modified dirs and friends. dirs now *returns* the stack (not
7401 * Modified dirs and friends. dirs now *returns* the stack (not
7389 prints), so one can manipulate it as a variable. Convenient to
7402 prints), so one can manipulate it as a variable. Convenient to
7390 travel along many directories.
7403 travel along many directories.
7391
7404
7392 * Fixed bug in magic_pdef: would only work with functions with
7405 * Fixed bug in magic_pdef: would only work with functions with
7393 arguments with default values.
7406 arguments with default values.
7394
7407
7395 2001-11-14 Fernando Perez <fperez@colorado.edu>
7408 2001-11-14 Fernando Perez <fperez@colorado.edu>
7396
7409
7397 * Added the PhysicsInput stuff to dot_ipython so it ships as an
7410 * Added the PhysicsInput stuff to dot_ipython so it ships as an
7398 example with IPython. Various other minor fixes and cleanups.
7411 example with IPython. Various other minor fixes and cleanups.
7399
7412
7400 * Version 0.1.9 released, 0.1.10 opened for further work.
7413 * Version 0.1.9 released, 0.1.10 opened for further work.
7401
7414
7402 * Added sys.path to the list of directories searched in the
7415 * Added sys.path to the list of directories searched in the
7403 execfile= option. It used to be the current directory and the
7416 execfile= option. It used to be the current directory and the
7404 user's IPYTHONDIR only.
7417 user's IPYTHONDIR only.
7405
7418
7406 2001-11-13 Fernando Perez <fperez@colorado.edu>
7419 2001-11-13 Fernando Perez <fperez@colorado.edu>
7407
7420
7408 * Reinstated the raw_input/prefilter separation that Janko had
7421 * Reinstated the raw_input/prefilter separation that Janko had
7409 initially. This gives a more convenient setup for extending the
7422 initially. This gives a more convenient setup for extending the
7410 pre-processor from the outside: raw_input always gets a string,
7423 pre-processor from the outside: raw_input always gets a string,
7411 and prefilter has to process it. We can then redefine prefilter
7424 and prefilter has to process it. We can then redefine prefilter
7412 from the outside and implement extensions for special
7425 from the outside and implement extensions for special
7413 purposes.
7426 purposes.
7414
7427
7415 Today I got one for inputting PhysicalQuantity objects
7428 Today I got one for inputting PhysicalQuantity objects
7416 (from Scientific) without needing any function calls at
7429 (from Scientific) without needing any function calls at
7417 all. Extremely convenient, and it's all done as a user-level
7430 all. Extremely convenient, and it's all done as a user-level
7418 extension (no IPython code was touched). Now instead of:
7431 extension (no IPython code was touched). Now instead of:
7419 a = PhysicalQuantity(4.2,'m/s**2')
7432 a = PhysicalQuantity(4.2,'m/s**2')
7420 one can simply say
7433 one can simply say
7421 a = 4.2 m/s**2
7434 a = 4.2 m/s**2
7422 or even
7435 or even
7423 a = 4.2 m/s^2
7436 a = 4.2 m/s^2
7424
7437
7425 I use this, but it's also a proof of concept: IPython really is
7438 I use this, but it's also a proof of concept: IPython really is
7426 fully user-extensible, even at the level of the parsing of the
7439 fully user-extensible, even at the level of the parsing of the
7427 command line. It's not trivial, but it's perfectly doable.
7440 command line. It's not trivial, but it's perfectly doable.
7428
7441
7429 * Added 'add_flip' method to inclusion conflict resolver. Fixes
7442 * Added 'add_flip' method to inclusion conflict resolver. Fixes
7430 the problem of modules being loaded in the inverse order in which
7443 the problem of modules being loaded in the inverse order in which
7431 they were defined in
7444 they were defined in
7432
7445
7433 * Version 0.1.8 released, 0.1.9 opened for further work.
7446 * Version 0.1.8 released, 0.1.9 opened for further work.
7434
7447
7435 * Added magics pdef, source and file. They respectively show the
7448 * Added magics pdef, source and file. They respectively show the
7436 definition line ('prototype' in C), source code and full python
7449 definition line ('prototype' in C), source code and full python
7437 file for any callable object. The object inspector oinfo uses
7450 file for any callable object. The object inspector oinfo uses
7438 these to show the same information.
7451 these to show the same information.
7439
7452
7440 * Version 0.1.7 released, 0.1.8 opened for further work.
7453 * Version 0.1.7 released, 0.1.8 opened for further work.
7441
7454
7442 * Separated all the magic functions into a class called Magic. The
7455 * Separated all the magic functions into a class called Magic. The
7443 InteractiveShell class was becoming too big for Xemacs to handle
7456 InteractiveShell class was becoming too big for Xemacs to handle
7444 (de-indenting a line would lock it up for 10 seconds while it
7457 (de-indenting a line would lock it up for 10 seconds while it
7445 backtracked on the whole class!)
7458 backtracked on the whole class!)
7446
7459
7447 FIXME: didn't work. It can be done, but right now namespaces are
7460 FIXME: didn't work. It can be done, but right now namespaces are
7448 all messed up. Do it later (reverted it for now, so at least
7461 all messed up. Do it later (reverted it for now, so at least
7449 everything works as before).
7462 everything works as before).
7450
7463
7451 * Got the object introspection system (magic_oinfo) working! I
7464 * Got the object introspection system (magic_oinfo) working! I
7452 think this is pretty much ready for release to Janko, so he can
7465 think this is pretty much ready for release to Janko, so he can
7453 test it for a while and then announce it. Pretty much 100% of what
7466 test it for a while and then announce it. Pretty much 100% of what
7454 I wanted for the 'phase 1' release is ready. Happy, tired.
7467 I wanted for the 'phase 1' release is ready. Happy, tired.
7455
7468
7456 2001-11-12 Fernando Perez <fperez@colorado.edu>
7469 2001-11-12 Fernando Perez <fperez@colorado.edu>
7457
7470
7458 * Version 0.1.6 released, 0.1.7 opened for further work.
7471 * Version 0.1.6 released, 0.1.7 opened for further work.
7459
7472
7460 * Fixed bug in printing: it used to test for truth before
7473 * Fixed bug in printing: it used to test for truth before
7461 printing, so 0 wouldn't print. Now checks for None.
7474 printing, so 0 wouldn't print. Now checks for None.
7462
7475
7463 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7476 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
7464 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7477 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
7465 reaches by hand into the outputcache. Think of a better way to do
7478 reaches by hand into the outputcache. Think of a better way to do
7466 this later.
7479 this later.
7467
7480
7468 * Various small fixes thanks to Nathan's comments.
7481 * Various small fixes thanks to Nathan's comments.
7469
7482
7470 * Changed magic_pprint to magic_Pprint. This way it doesn't
7483 * Changed magic_pprint to magic_Pprint. This way it doesn't
7471 collide with pprint() and the name is consistent with the command
7484 collide with pprint() and the name is consistent with the command
7472 line option.
7485 line option.
7473
7486
7474 * Changed prompt counter behavior to be fully like
7487 * Changed prompt counter behavior to be fully like
7475 Mathematica's. That is, even input that doesn't return a result
7488 Mathematica's. That is, even input that doesn't return a result
7476 raises the prompt counter. The old behavior was kind of confusing
7489 raises the prompt counter. The old behavior was kind of confusing
7477 (getting the same prompt number several times if the operation
7490 (getting the same prompt number several times if the operation
7478 didn't return a result).
7491 didn't return a result).
7479
7492
7480 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7493 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
7481
7494
7482 * Fixed -Classic mode (wasn't working anymore).
7495 * Fixed -Classic mode (wasn't working anymore).
7483
7496
7484 * Added colored prompts using Nathan's new code. Colors are
7497 * Added colored prompts using Nathan's new code. Colors are
7485 currently hardwired, they can be user-configurable. For
7498 currently hardwired, they can be user-configurable. For
7486 developers, they can be chosen in file ipythonlib.py, at the
7499 developers, they can be chosen in file ipythonlib.py, at the
7487 beginning of the CachedOutput class def.
7500 beginning of the CachedOutput class def.
7488
7501
7489 2001-11-11 Fernando Perez <fperez@colorado.edu>
7502 2001-11-11 Fernando Perez <fperez@colorado.edu>
7490
7503
7491 * Version 0.1.5 released, 0.1.6 opened for further work.
7504 * Version 0.1.5 released, 0.1.6 opened for further work.
7492
7505
7493 * Changed magic_env to *return* the environment as a dict (not to
7506 * Changed magic_env to *return* the environment as a dict (not to
7494 print it). This way it prints, but it can also be processed.
7507 print it). This way it prints, but it can also be processed.
7495
7508
7496 * Added Verbose exception reporting to interactive
7509 * Added Verbose exception reporting to interactive
7497 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7510 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
7498 traceback. Had to make some changes to the ultraTB file. This is
7511 traceback. Had to make some changes to the ultraTB file. This is
7499 probably the last 'big' thing in my mental todo list. This ties
7512 probably the last 'big' thing in my mental todo list. This ties
7500 in with the next entry:
7513 in with the next entry:
7501
7514
7502 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7515 * Changed -Xi and -Xf to a single -xmode option. Now all the user
7503 has to specify is Plain, Color or Verbose for all exception
7516 has to specify is Plain, Color or Verbose for all exception
7504 handling.
7517 handling.
7505
7518
7506 * Removed ShellServices option. All this can really be done via
7519 * Removed ShellServices option. All this can really be done via
7507 the magic system. It's easier to extend, cleaner and has automatic
7520 the magic system. It's easier to extend, cleaner and has automatic
7508 namespace protection and documentation.
7521 namespace protection and documentation.
7509
7522
7510 2001-11-09 Fernando Perez <fperez@colorado.edu>
7523 2001-11-09 Fernando Perez <fperez@colorado.edu>
7511
7524
7512 * Fixed bug in output cache flushing (missing parameter to
7525 * Fixed bug in output cache flushing (missing parameter to
7513 __init__). Other small bugs fixed (found using pychecker).
7526 __init__). Other small bugs fixed (found using pychecker).
7514
7527
7515 * Version 0.1.4 opened for bugfixing.
7528 * Version 0.1.4 opened for bugfixing.
7516
7529
7517 2001-11-07 Fernando Perez <fperez@colorado.edu>
7530 2001-11-07 Fernando Perez <fperez@colorado.edu>
7518
7531
7519 * Version 0.1.3 released, mainly because of the raw_input bug.
7532 * Version 0.1.3 released, mainly because of the raw_input bug.
7520
7533
7521 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7534 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
7522 and when testing for whether things were callable, a call could
7535 and when testing for whether things were callable, a call could
7523 actually be made to certain functions. They would get called again
7536 actually be made to certain functions. They would get called again
7524 once 'really' executed, with a resulting double call. A disaster
7537 once 'really' executed, with a resulting double call. A disaster
7525 in many cases (list.reverse() would never work!).
7538 in many cases (list.reverse() would never work!).
7526
7539
7527 * Removed prefilter() function, moved its code to raw_input (which
7540 * Removed prefilter() function, moved its code to raw_input (which
7528 after all was just a near-empty caller for prefilter). This saves
7541 after all was just a near-empty caller for prefilter). This saves
7529 a function call on every prompt, and simplifies the class a tiny bit.
7542 a function call on every prompt, and simplifies the class a tiny bit.
7530
7543
7531 * Fix _ip to __ip name in magic example file.
7544 * Fix _ip to __ip name in magic example file.
7532
7545
7533 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7546 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
7534 work with non-gnu versions of tar.
7547 work with non-gnu versions of tar.
7535
7548
7536 2001-11-06 Fernando Perez <fperez@colorado.edu>
7549 2001-11-06 Fernando Perez <fperez@colorado.edu>
7537
7550
7538 * Version 0.1.2. Just to keep track of the recent changes.
7551 * Version 0.1.2. Just to keep track of the recent changes.
7539
7552
7540 * Fixed nasty bug in output prompt routine. It used to check 'if
7553 * Fixed nasty bug in output prompt routine. It used to check 'if
7541 arg != None...'. Problem is, this fails if arg implements a
7554 arg != None...'. Problem is, this fails if arg implements a
7542 special comparison (__cmp__) which disallows comparing to
7555 special comparison (__cmp__) which disallows comparing to
7543 None. Found it when trying to use the PhysicalQuantity module from
7556 None. Found it when trying to use the PhysicalQuantity module from
7544 ScientificPython.
7557 ScientificPython.
7545
7558
7546 2001-11-05 Fernando Perez <fperez@colorado.edu>
7559 2001-11-05 Fernando Perez <fperez@colorado.edu>
7547
7560
7548 * Also added dirs. Now the pushd/popd/dirs family functions
7561 * Also added dirs. Now the pushd/popd/dirs family functions
7549 basically like the shell, with the added convenience of going home
7562 basically like the shell, with the added convenience of going home
7550 when called with no args.
7563 when called with no args.
7551
7564
7552 * pushd/popd slightly modified to mimic shell behavior more
7565 * pushd/popd slightly modified to mimic shell behavior more
7553 closely.
7566 closely.
7554
7567
7555 * Added env,pushd,popd from ShellServices as magic functions. I
7568 * Added env,pushd,popd from ShellServices as magic functions. I
7556 think the cleanest will be to port all desired functions from
7569 think the cleanest will be to port all desired functions from
7557 ShellServices as magics and remove ShellServices altogether. This
7570 ShellServices as magics and remove ShellServices altogether. This
7558 will provide a single, clean way of adding functionality
7571 will provide a single, clean way of adding functionality
7559 (shell-type or otherwise) to IP.
7572 (shell-type or otherwise) to IP.
7560
7573
7561 2001-11-04 Fernando Perez <fperez@colorado.edu>
7574 2001-11-04 Fernando Perez <fperez@colorado.edu>
7562
7575
7563 * Added .ipython/ directory to sys.path. This way users can keep
7576 * Added .ipython/ directory to sys.path. This way users can keep
7564 customizations there and access them via import.
7577 customizations there and access them via import.
7565
7578
7566 2001-11-03 Fernando Perez <fperez@colorado.edu>
7579 2001-11-03 Fernando Perez <fperez@colorado.edu>
7567
7580
7568 * Opened version 0.1.1 for new changes.
7581 * Opened version 0.1.1 for new changes.
7569
7582
7570 * Changed version number to 0.1.0: first 'public' release, sent to
7583 * Changed version number to 0.1.0: first 'public' release, sent to
7571 Nathan and Janko.
7584 Nathan and Janko.
7572
7585
7573 * Lots of small fixes and tweaks.
7586 * Lots of small fixes and tweaks.
7574
7587
7575 * Minor changes to whos format. Now strings are shown, snipped if
7588 * Minor changes to whos format. Now strings are shown, snipped if
7576 too long.
7589 too long.
7577
7590
7578 * Changed ShellServices to work on __main__ so they show up in @who
7591 * Changed ShellServices to work on __main__ so they show up in @who
7579
7592
7580 * Help also works with ? at the end of a line:
7593 * Help also works with ? at the end of a line:
7581 ?sin and sin?
7594 ?sin and sin?
7582 both produce the same effect. This is nice, as often I use the
7595 both produce the same effect. This is nice, as often I use the
7583 tab-complete to find the name of a method, but I used to then have
7596 tab-complete to find the name of a method, but I used to then have
7584 to go to the beginning of the line to put a ? if I wanted more
7597 to go to the beginning of the line to put a ? if I wanted more
7585 info. Now I can just add the ? and hit return. Convenient.
7598 info. Now I can just add the ? and hit return. Convenient.
7586
7599
7587 2001-11-02 Fernando Perez <fperez@colorado.edu>
7600 2001-11-02 Fernando Perez <fperez@colorado.edu>
7588
7601
7589 * Python version check (>=2.1) added.
7602 * Python version check (>=2.1) added.
7590
7603
7591 * Added LazyPython documentation. At this point the docs are quite
7604 * Added LazyPython documentation. At this point the docs are quite
7592 a mess. A cleanup is in order.
7605 a mess. A cleanup is in order.
7593
7606
7594 * Auto-installer created. For some bizarre reason, the zipfiles
7607 * Auto-installer created. For some bizarre reason, the zipfiles
7595 module isn't working on my system. So I made a tar version
7608 module isn't working on my system. So I made a tar version
7596 (hopefully the command line options in various systems won't kill
7609 (hopefully the command line options in various systems won't kill
7597 me).
7610 me).
7598
7611
7599 * Fixes to Struct in genutils. Now all dictionary-like methods are
7612 * Fixes to Struct in genutils. Now all dictionary-like methods are
7600 protected (reasonably).
7613 protected (reasonably).
7601
7614
7602 * Added pager function to genutils and changed ? to print usage
7615 * Added pager function to genutils and changed ? to print usage
7603 note through it (it was too long).
7616 note through it (it was too long).
7604
7617
7605 * Added the LazyPython functionality. Works great! I changed the
7618 * Added the LazyPython functionality. Works great! I changed the
7606 auto-quote escape to ';', it's on home row and next to '. But
7619 auto-quote escape to ';', it's on home row and next to '. But
7607 both auto-quote and auto-paren (still /) escapes are command-line
7620 both auto-quote and auto-paren (still /) escapes are command-line
7608 parameters.
7621 parameters.
7609
7622
7610
7623
7611 2001-11-01 Fernando Perez <fperez@colorado.edu>
7624 2001-11-01 Fernando Perez <fperez@colorado.edu>
7612
7625
7613 * Version changed to 0.0.7. Fairly large change: configuration now
7626 * Version changed to 0.0.7. Fairly large change: configuration now
7614 is all stored in a directory, by default .ipython. There, all
7627 is all stored in a directory, by default .ipython. There, all
7615 config files have normal looking names (not .names)
7628 config files have normal looking names (not .names)
7616
7629
7617 * Version 0.0.6 Released first to Lucas and Archie as a test
7630 * Version 0.0.6 Released first to Lucas and Archie as a test
7618 run. Since it's the first 'semi-public' release, change version to
7631 run. Since it's the first 'semi-public' release, change version to
7619 > 0.0.6 for any changes now.
7632 > 0.0.6 for any changes now.
7620
7633
7621 * Stuff I had put in the ipplib.py changelog:
7634 * Stuff I had put in the ipplib.py changelog:
7622
7635
7623 Changes to InteractiveShell:
7636 Changes to InteractiveShell:
7624
7637
7625 - Made the usage message a parameter.
7638 - Made the usage message a parameter.
7626
7639
7627 - Require the name of the shell variable to be given. It's a bit
7640 - Require the name of the shell variable to be given. It's a bit
7628 of a hack, but allows the name 'shell' not to be hardwired in the
7641 of a hack, but allows the name 'shell' not to be hardwired in the
7629 magic (@) handler, which is problematic b/c it requires
7642 magic (@) handler, which is problematic b/c it requires
7630 polluting the global namespace with 'shell'. This in turn is
7643 polluting the global namespace with 'shell'. This in turn is
7631 fragile: if a user redefines a variable called shell, things
7644 fragile: if a user redefines a variable called shell, things
7632 break.
7645 break.
7633
7646
7634 - magic @: all functions available through @ need to be defined
7647 - magic @: all functions available through @ need to be defined
7635 as magic_<name>, even though they can be called simply as
7648 as magic_<name>, even though they can be called simply as
7636 @<name>. This allows the special command @magic to gather
7649 @<name>. This allows the special command @magic to gather
7637 information automatically about all existing magic functions,
7650 information automatically about all existing magic functions,
7638 even if they are run-time user extensions, by parsing the shell
7651 even if they are run-time user extensions, by parsing the shell
7639 instance __dict__ looking for special magic_ names.
7652 instance __dict__ looking for special magic_ names.
7640
7653
7641 - mainloop: added *two* local namespace parameters. This allows
7654 - mainloop: added *two* local namespace parameters. This allows
7642 the class to differentiate between parameters which were there
7655 the class to differentiate between parameters which were there
7643 before and after command line initialization was processed. This
7656 before and after command line initialization was processed. This
7644 way, later @who can show things loaded at startup by the
7657 way, later @who can show things loaded at startup by the
7645 user. This trick was necessary to make session saving/reloading
7658 user. This trick was necessary to make session saving/reloading
7646 really work: ideally after saving/exiting/reloading a session,
7659 really work: ideally after saving/exiting/reloading a session,
7647 *everything* should look the same, including the output of @who. I
7660 *everything* should look the same, including the output of @who. I
7648 was only able to make this work with this double namespace
7661 was only able to make this work with this double namespace
7649 trick.
7662 trick.
7650
7663
7651 - added a header to the logfile which allows (almost) full
7664 - added a header to the logfile which allows (almost) full
7652 session restoring.
7665 session restoring.
7653
7666
7654 - prepend lines beginning with @ or !, with a and log
7667 - prepend lines beginning with @ or !, with a and log
7655 them. Why? !lines: may be useful to know what you did @lines:
7668 them. Why? !lines: may be useful to know what you did @lines:
7656 they may affect session state. So when restoring a session, at
7669 they may affect session state. So when restoring a session, at
7657 least inform the user of their presence. I couldn't quite get
7670 least inform the user of their presence. I couldn't quite get
7658 them to properly re-execute, but at least the user is warned.
7671 them to properly re-execute, but at least the user is warned.
7659
7672
7660 * Started ChangeLog.
7673 * Started ChangeLog.
@@ -1,395 +1,395 b''
1 .\" Hey, EMACS: -*- nroff -*-
1 .\" Hey, EMACS: -*- nroff -*-
2 .\" First parameter, NAME, should be all caps
2 .\" First parameter, NAME, should be all caps
3 .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
3 .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
4 .\" other parameters are allowed: see man(7), man(1)
4 .\" other parameters are allowed: see man(7), man(1)
5 .TH IPYTHON 1 "November 30, 2004"
5 .TH IPYTHON 1 "November 30, 2004"
6 .\" Please adjust this date whenever revising the manpage.
6 .\" Please adjust this date whenever revising the manpage.
7 .\"
7 .\"
8 .\" Some roff macros, for reference:
8 .\" Some roff macros, for reference:
9 .\" .nh disable hyphenation
9 .\" .nh disable hyphenation
10 .\" .hy enable hyphenation
10 .\" .hy enable hyphenation
11 .\" .ad l left justify
11 .\" .ad l left justify
12 .\" .ad b justify to both left and right margins
12 .\" .ad b justify to both left and right margins
13 .\" .nf disable filling
13 .\" .nf disable filling
14 .\" .fi enable filling
14 .\" .fi enable filling
15 .\" .br insert line break
15 .\" .br insert line break
16 .\" .sp <n> insert n+1 empty lines
16 .\" .sp <n> insert n+1 empty lines
17 .\" for manpage-specific macros, see man(7) and groff_man(7)
17 .\" for manpage-specific macros, see man(7) and groff_man(7)
18 .\" .SH section heading
18 .\" .SH section heading
19 .\" .SS secondary section heading
19 .\" .SS secondary section heading
20 .\"
20 .\"
21 .\"
21 .\"
22 .\" To preview this page as plain text: nroff -man ipython.1
22 .\" To preview this page as plain text: nroff -man ipython.1
23 .\"
23 .\"
24 .SH NAME
24 .SH NAME
25 ipython \- An Enhanced Interactive Python
25 ipython \- An Enhanced Interactive Python
26 .SH SYNOPSIS
26 .SH SYNOPSIS
27 .B ipython
27 .B ipython
28 .RI [ options ] " files" ...
28 .RI [ options ] " files" ...
29 .SH DESCRIPTION
29 .SH DESCRIPTION
30 An interactive Python shell with automatic history (input and output),
30 An interactive Python shell with automatic history (input and output),
31 dynamic object introspection, easier configuration, command
31 dynamic object introspection, easier configuration, command
32 completion, access to the system shell, integration with numerical and
32 completion, access to the system shell, integration with numerical and
33 scientific computing tools, and more.
33 scientific computing tools, and more.
34 .SH SPECIAL THREADING OPTIONS
34 .SH SPECIAL THREADING OPTIONS
35 The following special options are ONLY valid at the beginning of the command
35 The following special options are ONLY valid at the beginning of the command
36 line, and not later. This is because they control the initialization of
36 line, and not later. This is because they control the initialization of
37 ipython itself, before the normal option-handling mechanism is active.
37 ipython itself, before the normal option-handling mechanism is active.
38 .TP
38 .TP
39 .B \-gthread, \-qthread, \-q4thread, \-wthread, \-pylab, \-twisted
39 .B \-gthread, \-qthread, \-q4thread, \-wthread, \-pylab
40 Only ONE of these can be given, and it can only be given as the first option
40 Only ONE of these can be given, and it can only be given as the first option
41 passed to IPython (it will have no effect in any other position). They provide
41 passed to IPython (it will have no effect in any other position). They provide
42 threading support for the GTK, QT3, QT4 and WXWidgets toolkits, for the
42 threading support for the GTK, QT3, QT4 and WXWidgets toolkits, for the
43 matplotlib library and Twisted reactor.
43 matplotlib library and Twisted reactor.
44 .br
44 .br
45 .sp 1
45 .sp 1
46 With any of the first four options, IPython starts running a separate thread
46 With any of the first four options, IPython starts running a separate thread
47 for the graphical toolkit's operation, so that you can open and control
47 for the graphical toolkit's operation, so that you can open and control
48 graphical elements from within an IPython command line, without blocking. All
48 graphical elements from within an IPython command line, without blocking. All
49 four provide essentially the same functionality, respectively for GTK, QT3, QT4
49 four provide essentially the same functionality, respectively for GTK, QT3, QT4
50 and WXWidgets (via their Python interfaces).
50 and 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
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
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
55 'wxversion' Python module installed, which is part of recent wxPython
56 distributions.
56 distributions.
57 .br
57 .br
58 .sp 1
58 .sp 1
59 If \-twisted is given, IPython start a Twisted reactor and runs IPython mainloop
60 in a dedicated thread, passing commands to be run inside the Twisted reactor.
61 .br
62 .sp 1
63 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
64 (http://matplotlib.sourceforge.net), allowing interactive usage of any of its
60 (http://matplotlib.sourceforge.net), allowing interactive usage of any of its
65 backends as defined in the user's .matplotlibrc file. It automatically
61 backends as defined in the user's .matplotlibrc file. It automatically
66 activates GTK, QT or WX threading for IPyhton if the choice of matplotlib
62 activates GTK, QT or WX threading for IPyhton if the choice of matplotlib
67 backend requires it. It also modifies the %run command to correctly execute
63 backend requires it. It also modifies the %run command to correctly execute
68 (without blocking) any matplotlib-based script which calls show() at the end.
64 (without blocking) any matplotlib-based script which calls show() at the end.
69 .TP
65 .TP
70 .B \-tk
66 .B \-tk
71 The \-g/q/q4/wthread options, and \-pylab (if matplotlib is configured to use
67 The \-g/q/q4/wthread options, and \-pylab (if matplotlib is configured to use
72 GTK, QT or WX), will normally block Tk graphical interfaces. This means that
68 GTK, QT or WX), will normally block Tk graphical interfaces. This means that
73 when GTK, QT or WX threading is active, any attempt to open a Tk GUI will
69 when GTK, QT or WX threading is active, any attempt to open a Tk GUI will
74 result in a dead window, and possibly cause the Python interpreter to crash.
70 result in a dead window, and possibly cause the Python interpreter to crash.
75 An extra option, \-tk, is available to address this issue. It can ONLY be
71 An extra option, \-tk, is available to address this issue. It can ONLY be
76 given as a SECOND option after any of the above (\-gthread, \-qthread,
72 given as a SECOND option after any of the above (\-gthread, \-qthread,
77 \-wthread or \-pylab).
73 \-wthread or \-pylab).
78 .br
74 .br
79 .sp 1
75 .sp 1
80 If \-tk is given, IPython will try to coordinate Tk threading with GTK, QT or
76 If \-tk is given, IPython will try to coordinate Tk threading with GTK, QT or
81 WX. This is however potentially unreliable, and you will have to test on your
77 WX. This is however potentially unreliable, and you will have to test on your
82 platform and Python configuration to determine whether it works for you.
78 platform and Python configuration to determine whether it works for you.
83 Debian users have reported success, apparently due to the fact that Debian
79 Debian users have reported success, apparently due to the fact that Debian
84 builds all of Tcl, Tk, Tkinter and Python with pthreads support. Under other
80 builds all of Tcl, Tk, Tkinter and Python with pthreads support. Under other
85 Linux environments (such as Fedora Core 2), this option has caused random
81 Linux environments (such as Fedora Core 2), this option has caused random
86 crashes and lockups of the Python interpreter. Under other operating systems
82 crashes and lockups of the Python interpreter. Under other operating systems
87 (Mac OSX and Windows), you'll need to try it to find out, since currently no
83 (Mac OSX and Windows), you'll need to try it to find out, since currently no
88 user reports are available.
84 user reports are available.
89 .br
85 .br
90 .sp 1
86 .sp 1
91 There is unfortunately no way for IPython to determine at runtime whether \-tk
87 There is unfortunately no way for IPython to determine at runtime whether \-tk
92 will work reliably or not, so you will need to do some experiments before
88 will work reliably or not, so you will need to do some experiments before
93 relying on it for regular work.
89 relying on it for regular work.
94 .
90 .
95 .SH REGULAR OPTIONS
91 .SH REGULAR OPTIONS
96 After the above threading options have been given, regular options can follow
92 After the above threading options have been given, regular options can follow
97 in any order. All options can be abbreviated to their shortest non-ambiguous
93 in any order. All options can be abbreviated to their shortest non-ambiguous
98 form and are case-sensitive. One or two dashes can be used. Some options
94 form and are case-sensitive. One or two dashes can be used. Some options
99 have an alternate short form, indicated after a |.
95 have an alternate short form, indicated after a |.
100 .br
96 .br
101 .sp 1
97 .sp 1
102 Most options can also be set from your ipythonrc configuration file.
98 Most options can also be set from your ipythonrc configuration file.
103 See the provided examples for assistance. Options given on the
99 See the provided examples for assistance. Options given on the
104 commandline override the values set in the ipythonrc file.
100 commandline override the values set in the ipythonrc file.
105 .br
101 .br
106 .sp 1
102 .sp 1
107 All options with a [no] prepended can be specified in negated form
103 All options with a [no] prepended can be specified in negated form
108 (\-nooption instead of \-option) to turn the feature off.
104 (\-nooption instead of \-option) to turn the feature off.
109 .TP
105 .TP
110 .B \-h, \-\-help
106 .B \-h, \-\-help
111 Show summary of options.
107 Show summary of options.
112 .TP
108 .TP
113 .B \-autocall <val>
109 .B \-autocall <val>
114 Make IPython automatically call any callable object even if you didn't type
110 Make IPython automatically call any callable object even if you didn't type
115 explicit parentheses. For example, 'str 43' becomes
111 explicit parentheses. For example, 'str 43' becomes
116 'str(43)' automatically. The value can be '0' to disable the
112 'str(43)' automatically. The value can be '0' to disable the
117 feature, '1' for 'smart' autocall, where it is not applied if
113 feature, '1' for 'smart' autocall, where it is not applied if
118 there are no more arguments on the line, and '2' for 'full'
114 there are no more arguments on the line, and '2' for 'full'
119 autocall, where all callable objects are automatically called
115 autocall, where all callable objects are automatically called
120 (even if no arguments are present). The default is '1'.
116 (even if no arguments are present). The default is '1'.
121 .TP
117 .TP
122 .B \-[no]autoindent
118 .B \-[no]autoindent
123 Turn automatic indentation on/off.
119 Turn automatic indentation on/off.
124 .TP
120 .TP
125 .B \-[no]automagic
121 .B \-[no]automagic
126 Make magic commands automatic (without needing their first character
122 Make magic commands automatic (without needing their first character
127 to be %). Type %magic at the IPython prompt for more information.
123 to be %). Type %magic at the IPython prompt for more information.
128 .TP
124 .TP
129 .B \-[no]autoedit_syntax
125 .B \-[no]autoedit_syntax
130 When a syntax error occurs after editing a file, automatically open the file
126 When a syntax error occurs after editing a file, automatically open the file
131 to the trouble causing line for convenient fixing.
127 to the trouble causing line for convenient fixing.
132 .TP
128 .TP
133 .B \-[no]banner
129 .B \-[no]banner
134 Print the intial information banner (default on).
130 Print the intial information banner (default on).
135 .TP
131 .TP
136 .B \-c <command>
132 .B \-c <command>
137 Execute the given command string, and set sys.argv to ['c']. This is similar
133 Execute the given command string, and set sys.argv to ['c']. This is similar
138 to the \-c option in the normal Python interpreter.
134 to the \-c option in the normal Python interpreter.
139 .TP
135 .TP
140 .B \-cache_size|cs <n>
136 .B \-cache_size|cs <n>
141 Size of the output cache (maximum number of entries to hold in
137 Size of the output cache (maximum number of entries to hold in
142 memory). The default is 1000, you can change it permanently in your
138 memory). The default is 1000, you can change it permanently in your
143 config file. Setting it to 0 completely disables the caching system,
139 config file. Setting it to 0 completely disables the caching system,
144 and the minimum value accepted is 20 (if you provide a value less than
140 and the minimum value accepted is 20 (if you provide a value less than
145 20, it is reset to 0 and a warning is issued). This limit is defined
141 20, it is reset to 0 and a warning is issued). This limit is defined
146 because otherwise you'll spend more time re-flushing a too small cache
142 because otherwise you'll spend more time re-flushing a too small cache
147 than working.
143 than working.
148 .TP
144 .TP
149 .B \-classic|cl
145 .B \-classic|cl
150 Gives IPython a similar feel to the classic Python prompt.
146 Gives IPython a similar feel to the classic Python prompt.
151 .TP
147 .TP
152 .B \-colors <scheme>
148 .B \-colors <scheme>
153 Color scheme for prompts and exception reporting. Currently
149 Color scheme for prompts and exception reporting. Currently
154 implemented: NoColor, Linux, and LightBG.
150 implemented: NoColor, Linux, and LightBG.
155 .TP
151 .TP
156 .B \-[no]color_info
152 .B \-[no]color_info
157 IPython can display information about objects via a set of functions,
153 IPython can display information about objects via a set of functions,
158 and optionally can use colors for this, syntax highlighting source
154 and optionally can use colors for this, syntax highlighting source
159 code and various other elements. However, because this information is
155 code and various other elements. However, because this information is
160 passed through a pager (like 'less') and many pagers get confused with
156 passed through a pager (like 'less') and many pagers get confused with
161 color codes, this option is off by default. You can test it and turn
157 color codes, this option is off by default. You can test it and turn
162 it on permanently in your ipythonrc file if it works for you. As a
158 it on permanently in your ipythonrc file if it works for you. As a
163 reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
159 reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
164 that in RedHat 7.2 doesn't.
160 that in RedHat 7.2 doesn't.
165 .br
161 .br
166 .sp 1
162 .sp 1
167 Test it and turn it on permanently if it works with your system. The
163 Test it and turn it on permanently if it works with your system. The
168 magic function @color_info allows you to toggle this interactively for
164 magic function @color_info allows you to toggle this interactively for
169 testing.
165 testing.
170 .TP
166 .TP
171 .B \-[no]confirm_exit
167 .B \-[no]confirm_exit
172 Set to confirm when you try to exit IPython with an EOF (Control-D in
168 Set to confirm when you try to exit IPython with an EOF (Control-D in
173 Unix, Control-Z/Enter in Windows). Note that using the magic functions
169 Unix, Control-Z/Enter in Windows). Note that using the magic functions
174 @Exit or @Quit you can force a direct exit, bypassing any
170 @Exit or @Quit you can force a direct exit, bypassing any
175 confirmation.
171 confirmation.
176 .TP
172 .TP
177 .B \-[no]debug
173 .B \-[no]debug
178 Show information about the loading process. Very useful to pin down
174 Show information about the loading process. Very useful to pin down
179 problems with your configuration files or to get details about session
175 problems with your configuration files or to get details about session
180 restores.
176 restores.
181 .TP
177 .TP
182 .B \-[no]deep_reload
178 .B \-[no]deep_reload
183 IPython can use the deep_reload module which reloads changes in
179 IPython can use the deep_reload module which reloads changes in
184 modules recursively (it replaces the reload() function, so you don't
180 modules recursively (it replaces the reload() function, so you don't
185 need to change anything to use it). deep_reload() forces a full reload
181 need to change anything to use it). deep_reload() forces a full reload
186 of modules whose code may have changed, which the default reload()
182 of modules whose code may have changed, which the default reload()
187 function does not.
183 function does not.
188 .br
184 .br
189 .sp 1
185 .sp 1
190 When deep_reload is off, IPython will use the normal reload(), but
186 When deep_reload is off, IPython will use the normal reload(), but
191 deep_reload will still be available as dreload(). This feature is off
187 deep_reload will still be available as dreload(). This feature is off
192 by default [which means that you have both normal reload() and
188 by default [which means that you have both normal reload() and
193 dreload()].
189 dreload()].
194 .TP
190 .TP
195 .B \-editor <name>
191 .B \-editor <name>
196 Which editor to use with the @edit command. By default, IPython will
192 Which editor to use with the @edit command. By default, IPython will
197 honor your EDITOR environment variable (if not set, vi is the Unix
193 honor your EDITOR environment variable (if not set, vi is the Unix
198 default and notepad the Windows one). Since this editor is invoked on
194 default and notepad the Windows one). Since this editor is invoked on
199 the fly by IPython and is meant for editing small code snippets, you
195 the fly by IPython and is meant for editing small code snippets, you
200 may want to use a small, lightweight editor here (in case your default
196 may want to use a small, lightweight editor here (in case your default
201 EDITOR is something like Emacs).
197 EDITOR is something like Emacs).
202 .TP
198 .TP
203 .B \-ipythondir <name>
199 .B \-ipythondir <name>
204 The name of your IPython configuration directory IPYTHONDIR. This can
200 The name of your IPython configuration directory IPYTHONDIR. This can
205 also be specified through the environment variable IPYTHONDIR.
201 also be specified through the environment variable IPYTHONDIR.
206 .TP
202 .TP
207 .B \-log|l
203 .B \-log|l
208 Generate a log file of all input. The file is named ipython_log.py in your
204 Generate a log file of all input. The file is named ipython_log.py in your
209 current directory (which prevents logs from multiple IPython sessions from
205 current directory (which prevents logs from multiple IPython sessions from
210 trampling each other). You can use this to later restore a session by loading
206 trampling each other). You can use this to later restore a session by loading
211 your logfile as a file to be executed with option -logplay (see below).
207 your logfile as a file to be executed with option -logplay (see below).
212 .TP
208 .TP
213 .B \-logfile|lf
209 .B \-logfile|lf
214 Specify the name of your logfile.
210 Specify the name of your logfile.
215 .TP
211 .TP
216 .B \-logplay|lp
212 .B \-logplay|lp
217 Replay a previous log. For restoring a session as close as possible to
213 Replay a previous log. For restoring a session as close as possible to
218 the state you left it in, use this option (don't just run the
214 the state you left it in, use this option (don't just run the
219 logfile). With \-logplay, IPython will try to reconstruct the previous
215 logfile). With \-logplay, IPython will try to reconstruct the previous
220 working environment in full, not just execute the commands in the
216 working environment in full, not just execute the commands in the
221 logfile.
217 logfile.
222 .br
218 .br
223 .sh 1
219 .sh 1
224 When a session is restored, logging is automatically turned on again
220 When a session is restored, logging is automatically turned on again
225 with the name of the logfile it was invoked with (it is read from the
221 with the name of the logfile it was invoked with (it is read from the
226 log header). So once you've turned logging on for a session, you can
222 log header). So once you've turned logging on for a session, you can
227 quit IPython and reload it as many times as you want and it will
223 quit IPython and reload it as many times as you want and it will
228 continue to log its history and restore from the beginning every time.
224 continue to log its history and restore from the beginning every time.
229 .br
225 .br
230 .sp 1
226 .sp 1
231 Caveats: there are limitations in this option. The history variables
227 Caveats: there are limitations in this option. The history variables
232 _i*,_* and _dh don't get restored properly. In the future we will try
228 _i*,_* and _dh don't get restored properly. In the future we will try
233 to implement full session saving by writing and retrieving a
229 to implement full session saving by writing and retrieving a
234 'snapshot' of the memory state of IPython. But our first attempts
230 'snapshot' of the memory state of IPython. But our first attempts
235 failed because of inherent limitations of Python's Pickle module, so
231 failed because of inherent limitations of Python's Pickle module, so
236 this may have to wait.
232 this may have to wait.
237 .TP
233 .TP
238 .B \-[no]messages
234 .B \-[no]messages
239 Print messages which IPython collects about its startup process
235 Print messages which IPython collects about its startup process
240 (default on).
236 (default on).
241 .TP
237 .TP
242 .B \-[no]pdb
238 .B \-[no]pdb
243 Automatically call the pdb debugger after every uncaught exception. If
239 Automatically call the pdb debugger after every uncaught exception. If
244 you are used to debugging using pdb, this puts you automatically
240 you are used to debugging using pdb, this puts you automatically
245 inside of it after any call (either in IPython or in code called by
241 inside of it after any call (either in IPython or in code called by
246 it) which triggers an exception which goes uncaught.
242 it) which triggers an exception which goes uncaught.
247 .TP
243 .TP
244 .B \-pydb
245 Makes IPython use the third party "pydb" package as debugger,
246 instead of pdb. Requires that pydb is installed.
247 .TP
248 .B \-[no]pprint
248 .B \-[no]pprint
249 IPython can optionally use the pprint (pretty printer) module for
249 IPython can optionally use the pprint (pretty printer) module for
250 displaying results. pprint tends to give a nicer display of nested
250 displaying results. pprint tends to give a nicer display of nested
251 data structures. If you like it, you can turn it on permanently in
251 data structures. If you like it, you can turn it on permanently in
252 your config file (default off).
252 your config file (default off).
253 .TP
253 .TP
254 .B \-profile|p <name>
254 .B \-profile|p <name>
255 Assume that your config file is ipythonrc-<name> (looks in current dir
255 Assume that your config file is ipythonrc-<name> (looks in current dir
256 first, then in IPYTHONDIR). This is a quick way to keep and load
256 first, then in IPYTHONDIR). This is a quick way to keep and load
257 multiple config files for different tasks, especially if you use the
257 multiple config files for different tasks, especially if you use the
258 include option of config files. You can keep a basic
258 include option of config files. You can keep a basic
259 IPYTHONDIR/ipythonrc file and then have other 'profiles' which include
259 IPYTHONDIR/ipythonrc file and then have other 'profiles' which include
260 this one and load extra things for particular tasks. For example:
260 this one and load extra things for particular tasks. For example:
261 .br
261 .br
262 .sp 1
262 .sp 1
263 1) $HOME/.ipython/ipythonrc : load basic things you always want.
263 1) $HOME/.ipython/ipythonrc : load basic things you always want.
264 .br
264 .br
265 2) $HOME/.ipython/ipythonrc-math : load (1) and basic math-related
265 2) $HOME/.ipython/ipythonrc-math : load (1) and basic math-related
266 modules.
266 modules.
267 .br
267 .br
268 3) $HOME/.ipython/ipythonrc-numeric : load (1) and Numeric and
268 3) $HOME/.ipython/ipythonrc-numeric : load (1) and Numeric and
269 plotting modules.
269 plotting modules.
270 .br
270 .br
271 .sp 1
271 .sp 1
272 Since it is possible to create an endless loop by having circular file
272 Since it is possible to create an endless loop by having circular file
273 inclusions, IPython will stop if it reaches 15 recursive inclusions.
273 inclusions, IPython will stop if it reaches 15 recursive inclusions.
274 .TP
274 .TP
275 .B \-prompt_in1|pi1 <string>
275 .B \-prompt_in1|pi1 <string>
276 Specify the string used for input prompts. Note that if you are using
276 Specify the string used for input prompts. Note that if you are using
277 numbered prompts, the number is represented with a '\\#' in the
277 numbered prompts, the number is represented with a '\\#' in the
278 string. Don't forget to quote strings with spaces embedded in
278 string. Don't forget to quote strings with spaces embedded in
279 them. Default: 'In [\\#]: '.
279 them. Default: 'In [\\#]: '.
280 .br
280 .br
281 .sp 1
281 .sp 1
282 Most bash-like escapes can be used to customize IPython's prompts, as well as
282 Most bash-like escapes can be used to customize IPython's prompts, as well as
283 a few additional ones which are IPython-specific. All valid prompt escapes
283 a few additional ones which are IPython-specific. All valid prompt escapes
284 are described in detail in the Customization section of the IPython HTML/PDF
284 are described in detail in the Customization section of the IPython HTML/PDF
285 manual.
285 manual.
286 .TP
286 .TP
287 .B \-prompt_in2|pi2 <string>
287 .B \-prompt_in2|pi2 <string>
288 Similar to the previous option, but used for the continuation prompts. The
288 Similar to the previous option, but used for the continuation prompts. The
289 special sequence '\\D' is similar to '\\#', but with all digits replaced dots
289 special sequence '\\D' is similar to '\\#', but with all digits replaced dots
290 (so you can have your continuation prompt aligned with your input
290 (so you can have your continuation prompt aligned with your input
291 prompt). Default: ' .\\D.: ' (note three spaces at the start for alignment
291 prompt). Default: ' .\\D.: ' (note three spaces at the start for alignment
292 with 'In [\\#]').
292 with 'In [\\#]').
293 .TP
293 .TP
294 .B \-prompt_out|po <string>
294 .B \-prompt_out|po <string>
295 String used for output prompts, also uses numbers like prompt_in1.
295 String used for output prompts, also uses numbers like prompt_in1.
296 Default: 'Out[\\#]:'.
296 Default: 'Out[\\#]:'.
297 .TP
297 .TP
298 .B \-quick
298 .B \-quick
299 Start in bare bones mode (no config file loaded).
299 Start in bare bones mode (no config file loaded).
300 .TP
300 .TP
301 .B \-rcfile <name>
301 .B \-rcfile <name>
302 Name of your IPython resource configuration file. normally IPython
302 Name of your IPython resource configuration file. normally IPython
303 loads ipythonrc (from current directory) or IPYTHONDIR/ipythonrc. If
303 loads ipythonrc (from current directory) or IPYTHONDIR/ipythonrc. If
304 the loading of your config file fails, IPython starts with a bare
304 the loading of your config file fails, IPython starts with a bare
305 bones configuration (no modules loaded at all).
305 bones configuration (no modules loaded at all).
306 .TP
306 .TP
307 .B \-[no]readline
307 .B \-[no]readline
308 Use the readline library, which is needed to support name completion
308 Use the readline library, which is needed to support name completion
309 and command history, among other things. It is enabled by default, but
309 and command history, among other things. It is enabled by default, but
310 may cause problems for users of X/Emacs in Python comint or shell
310 may cause problems for users of X/Emacs in Python comint or shell
311 buffers.
311 buffers.
312 .br
312 .br
313 .sp 1
313 .sp 1
314 Note that emacs 'eterm' buffers (opened with M-x term) support
314 Note that emacs 'eterm' buffers (opened with M-x term) support
315 IPython's readline and syntax coloring fine, only 'emacs' (M-x shell
315 IPython's readline and syntax coloring fine, only 'emacs' (M-x shell
316 and C-c !) buffers do not.
316 and C-c !) buffers do not.
317 .TP
317 .TP
318 .B \-screen_length|sl <n>
318 .B \-screen_length|sl <n>
319 Number of lines of your screen. This is used to control printing of
319 Number of lines of your screen. This is used to control printing of
320 very long strings. Strings longer than this number of lines will be
320 very long strings. Strings longer than this number of lines will be
321 sent through a pager instead of directly printed.
321 sent through a pager instead of directly printed.
322 .br
322 .br
323 .sp 1
323 .sp 1
324 The default value for this is 0, which means IPython will auto-detect
324 The default value for this is 0, which means IPython will auto-detect
325 your screen size every time it needs to print certain potentially long
325 your screen size every time it needs to print certain potentially long
326 strings (this doesn't change the behavior of the 'print' keyword, it's
326 strings (this doesn't change the behavior of the 'print' keyword, it's
327 only triggered internally). If for some reason this isn't working well
327 only triggered internally). If for some reason this isn't working well
328 (it needs curses support), specify it yourself. Otherwise don't change
328 (it needs curses support), specify it yourself. Otherwise don't change
329 the default.
329 the default.
330 .TP
330 .TP
331 .B \-separate_in|si <string>
331 .B \-separate_in|si <string>
332 Separator before input prompts. Default '\n'.
332 Separator before input prompts. Default '\n'.
333 .TP
333 .TP
334 .B \-separate_out|so <string>
334 .B \-separate_out|so <string>
335 Separator before output prompts. Default: 0 (nothing).
335 Separator before output prompts. Default: 0 (nothing).
336 .TP
336 .TP
337 .B \-separate_out2|so2 <string>
337 .B \-separate_out2|so2 <string>
338 Separator after output prompts. Default: 0 (nothing).
338 Separator after output prompts. Default: 0 (nothing).
339 .TP
339 .TP
340 .B \-nosep
340 .B \-nosep
341 Shorthand for '\-separate_in 0 \-separate_out 0 \-separate_out2 0'.
341 Shorthand for '\-separate_in 0 \-separate_out 0 \-separate_out2 0'.
342 Simply removes all input/output separators.
342 Simply removes all input/output separators.
343 .TP
343 .TP
344 .B \-upgrade
344 .B \-upgrade
345 Allows you to upgrade your IPYTHONDIR configuration when you install a
345 Allows you to upgrade your IPYTHONDIR configuration when you install a
346 new version of IPython. Since new versions may include new command
346 new version of IPython. Since new versions may include new command
347 lines options or example files, this copies updated ipythonrc-type
347 lines options or example files, this copies updated ipythonrc-type
348 files. However, it backs up (with a .old extension) all files which
348 files. However, it backs up (with a .old extension) all files which
349 it overwrites so that you can merge back any custimizations you might
349 it overwrites so that you can merge back any custimizations you might
350 have in your personal files.
350 have in your personal files.
351 .TP
351 .TP
352 .B \-Version
352 .B \-Version
353 Print version information and exit.
353 Print version information and exit.
354 .TP
354 .TP
355 .B -wxversion <string>
355 .B -wxversion <string>
356 Select a specific version of wxPython (used in conjunction with
356 Select a specific version of wxPython (used in conjunction with
357 \-wthread). Requires the wxversion module, part of recent wxPython
357 \-wthread). Requires the wxversion module, part of recent wxPython
358 distributions.
358 distributions.
359 .TP
359 .TP
360 .B \-xmode <modename>
360 .B \-xmode <modename>
361 Mode for exception reporting. The valid modes are Plain, Context, and
361 Mode for exception reporting. The valid modes are Plain, Context, and
362 Verbose.
362 Verbose.
363 .br
363 .br
364 .sp 1
364 .sp 1
365 \- Plain: similar to python's normal traceback printing.
365 \- Plain: similar to python's normal traceback printing.
366 .br
366 .br
367 .sp 1
367 .sp 1
368 \- Context: prints 5 lines of context source code around each line in the
368 \- Context: prints 5 lines of context source code around each line in the
369 traceback.
369 traceback.
370 .br
370 .br
371 .sp 1
371 .sp 1
372 \- Verbose: similar to Context, but additionally prints the variables
372 \- Verbose: similar to Context, but additionally prints the variables
373 currently visible where the exception happened (shortening their strings if
373 currently visible where the exception happened (shortening their strings if
374 too long). This can potentially be very slow, if you happen to have a huge
374 too long). This can potentially be very slow, if you happen to have a huge
375 data structure whose string representation is complex to compute. Your
375 data structure whose string representation is complex to compute. Your
376 computer may appear to freeze for a while with cpu usage at 100%. If this
376 computer may appear to freeze for a while with cpu usage at 100%. If this
377 occurs, you can cancel the traceback with Ctrl-C (maybe hitting it more than
377 occurs, you can cancel the traceback with Ctrl-C (maybe hitting it more than
378 once).
378 once).
379 .
379 .
380 .SH EMBEDDING
380 .SH EMBEDDING
381 It is possible to start an IPython instance inside your own Python
381 It is possible to start an IPython instance inside your own Python
382 programs. In the documentation example files there are some
382 programs. In the documentation example files there are some
383 illustrations on how to do this.
383 illustrations on how to do this.
384 .br
384 .br
385 .sp 1
385 .sp 1
386 This feature allows you to evalutate dynamically the state of your
386 This feature allows you to evalutate dynamically the state of your
387 code, operate with your variables, analyze them, etc. Note however
387 code, operate with your variables, analyze them, etc. Note however
388 that any changes you make to values while in the shell do NOT
388 that any changes you make to values while in the shell do NOT
389 propagate back to the running code, so it is safe to modify your
389 propagate back to the running code, so it is safe to modify your
390 values because you won't break your code in bizarre ways by doing so.
390 values because you won't break your code in bizarre ways by doing so.
391 .SH AUTHOR
391 .SH AUTHOR
392 IPython was written by Fernando Perez <fperez@colorado.edu>, based on earlier
392 IPython was written by Fernando Perez <fperez@colorado.edu>, based on earlier
393 code by Janko Hauser <jh@comunit.de> and Nathaniel Gray
393 code by Janko Hauser <jh@comunit.de> and Nathaniel Gray
394 <n8gray@caltech.edu>. This manual page was written by Jack Moffitt
394 <n8gray@caltech.edu>. This manual page was written by Jack Moffitt
395 <jack@xiph.org>, for the Debian project (but may be used by others).
395 <jack@xiph.org>, for the Debian project (but may be used by others).
@@ -1,5875 +1,5879 b''
1 .. IPython documentation master file, created by sphinx-quickstart.py on Mon Mar 24 17:01:34 2008.
1 .. IPython documentation master file, created by sphinx-quickstart.py on Mon Mar 24 17:01:34 2008.
2 You can adapt this file completely to your liking, but it should at least
2 You can adapt this file completely to your liking, but it should at least
3 contain the root 'toctree' directive.
3 contain the root 'toctree' directive.
4
4
5 IPython documentation
5 IPython documentation
6 =====================
6 =====================
7
7
8 Contents:
8 Contents:
9
9
10 .. toctree::
10 .. toctree::
11 :maxdepth: 2
11 :maxdepth: 2
12
12
13 Indices and tables
13 Indices and tables
14 ==================
14 ==================
15
15
16 * :ref:`genindex`
16 * :ref:`genindex`
17 * :ref:`modindex`
17 * :ref:`modindex`
18 * :ref:`search`
18 * :ref:`search`
19
19
20 Introduction
20 Introduction
21 ============
21 ============
22
22
23 This is the official documentation for IPython 0.x series (i.e. what
23 This is the official documentation for IPython 0.x series (i.e. what
24 we are used to refer to just as "IPython"). The original text of the
24 we are used to refer to just as "IPython"). The original text of the
25 manual (most of which is still in place) has been authored by Fernando
25 manual (most of which is still in place) has been authored by Fernando
26 Perez, but as recommended usage patterns and new features have
26 Perez, but as recommended usage patterns and new features have
27 emerged, this manual has been updated to reflect that fact. Most of
27 emerged, this manual has been updated to reflect that fact. Most of
28 the additions have been authored by Ville M. Vainio.
28 the additions have been authored by Ville M. Vainio.
29
29
30 The manual has been generated from reStructuredText source markup with
30 The manual has been generated from reStructuredText source markup with
31 Sphinx, which should make it much easier to keep it up-to-date in the
31 Sphinx, which should make it much easier to keep it up-to-date in the
32 future. Some reST artifacts and bugs may still be apparent in the
32 future. Some reST artifacts and bugs may still be apparent in the
33 documentation, but this should improve as the toolchain matures.
33 documentation, but this should improve as the toolchain matures.
34
34
35 Overview
35 Overview
36 ========
36 ========
37
37
38 One of Python's most useful features is its interactive interpreter.
38 One of Python's most useful features is its interactive interpreter.
39 This system allows very fast testing of ideas without the overhead of
39 This system allows very fast testing of ideas without the overhead of
40 creating test files as is typical in most programming languages.
40 creating test files as is typical in most programming languages.
41 However, the interpreter supplied with the standard Python distribution
41 However, the interpreter supplied with the standard Python distribution
42 is somewhat limited for extended interactive use.
42 is somewhat limited for extended interactive use.
43
43
44 IPython is a free software project (released under the BSD license)
44 IPython is a free software project (released under the BSD license)
45 which tries to:
45 which tries to:
46
46
47 1. Provide an interactive shell superior to Python's default. IPython
47 1. Provide an interactive shell superior to Python's default. IPython
48 has many features for object introspection, system shell access,
48 has many features for object introspection, system shell access,
49 and its own special command system for adding functionality when
49 and its own special command system for adding functionality when
50 working interactively. It tries to be a very efficient environment
50 working interactively. It tries to be a very efficient environment
51 both for Python code development and for exploration of problems
51 both for Python code development and for exploration of problems
52 using Python objects (in situations like data analysis).
52 using Python objects (in situations like data analysis).
53 2. Serve as an embeddable, ready to use interpreter for your own
53 2. Serve as an embeddable, ready to use interpreter for your own
54 programs. IPython can be started with a single call from inside
54 programs. IPython can be started with a single call from inside
55 another program, providing access to the current namespace. This
55 another program, providing access to the current namespace. This
56 can be very useful both for debugging purposes and for situations
56 can be very useful both for debugging purposes and for situations
57 where a blend of batch-processing and interactive exploration are
57 where a blend of batch-processing and interactive exploration are
58 needed.
58 needed.
59 3. Offer a flexible framework which can be used as the base
59 3. Offer a flexible framework which can be used as the base
60 environment for other systems with Python as the underlying
60 environment for other systems with Python as the underlying
61 language. Specifically scientific environments like Mathematica,
61 language. Specifically scientific environments like Mathematica,
62 IDL and Matlab inspired its design, but similar ideas can be
62 IDL and Matlab inspired its design, but similar ideas can be
63 useful in many fields.
63 useful in many fields.
64 4. Allow interactive testing of threaded graphical toolkits. IPython
64 4. Allow interactive testing of threaded graphical toolkits. IPython
65 has support for interactive, non-blocking control of GTK, Qt and
65 has support for interactive, non-blocking control of GTK, Qt and
66 WX applications via special threading flags. The normal Python
66 WX applications via special threading flags. The normal Python
67 shell can only do this for Tkinter applications.
67 shell can only do this for Tkinter applications.
68
68
69
69
70 Main features
70 Main features
71 -------------
71 -------------
72
72
73 * Dynamic object introspection. One can access docstrings, function
73 * Dynamic object introspection. One can access docstrings, function
74 definition prototypes, source code, source files and other details
74 definition prototypes, source code, source files and other details
75 of any object accessible to the interpreter with a single
75 of any object accessible to the interpreter with a single
76 keystroke ('?', and using '??' provides additional detail).
76 keystroke ('?', and using '??' provides additional detail).
77 * Searching through modules and namespaces with '*' wildcards, both
77 * Searching through modules and namespaces with '*' wildcards, both
78 when using the '?' system and via the %psearch command.
78 when using the '?' system and via the %psearch command.
79 * Completion in the local namespace, by typing TAB at the prompt.
79 * Completion in the local namespace, by typing TAB at the prompt.
80 This works for keywords, modules, methods, variables and files in the
80 This works for keywords, modules, methods, variables and files in the
81 current directory. This is supported via the readline library, and
81 current directory. This is supported via the readline library, and
82 full access to configuring readline's behavior is provided.
82 full access to configuring readline's behavior is provided.
83 Custom completers can be implemented easily for different purposes
83 Custom completers can be implemented easily for different purposes
84 (system commands, magic arguments etc.)
84 (system commands, magic arguments etc.)
85 * Numbered input/output prompts with command history (persistent
85 * Numbered input/output prompts with command history (persistent
86 across sessions and tied to each profile), full searching in this
86 across sessions and tied to each profile), full searching in this
87 history and caching of all input and output.
87 history and caching of all input and output.
88 * User-extensible 'magic' commands. A set of commands prefixed with
88 * User-extensible 'magic' commands. A set of commands prefixed with
89 % is available for controlling IPython itself and provides
89 % is available for controlling IPython itself and provides
90 directory control, namespace information and many aliases to
90 directory control, namespace information and many aliases to
91 common system shell commands.
91 common system shell commands.
92 * Alias facility for defining your own system aliases.
92 * Alias facility for defining your own system aliases.
93 * Complete system shell access. Lines starting with ! are passed
93 * Complete system shell access. Lines starting with ! are passed
94 directly to the system shell, and using !! or var = !cmd
94 directly to the system shell, and using !! or var = !cmd
95 captures shell output into python variables for further use.
95 captures shell output into python variables for further use.
96 * Background execution of Python commands in a separate thread.
96 * Background execution of Python commands in a separate thread.
97 IPython has an internal job manager called jobs, and a
97 IPython has an internal job manager called jobs, and a
98 conveninence backgrounding magic function called %bg.
98 conveninence backgrounding magic function called %bg.
99 * The ability to expand python variables when calling the system
99 * The ability to expand python variables when calling the system
100 shell. In a shell command, any python variable prefixed with $ is
100 shell. In a shell command, any python variable prefixed with $ is
101 expanded. A double $$ allows passing a literal $ to the shell (for
101 expanded. A double $$ allows passing a literal $ to the shell (for
102 access to shell and environment variables like $PATH).
102 access to shell and environment variables like $PATH).
103 * Filesystem navigation, via a magic %cd command, along with a
103 * Filesystem navigation, via a magic %cd command, along with a
104 persistent bookmark system (using %bookmark) for fast access to
104 persistent bookmark system (using %bookmark) for fast access to
105 frequently visited directories.
105 frequently visited directories.
106 * A lightweight persistence framework via the %store command, which
106 * A lightweight persistence framework via the %store command, which
107 allows you to save arbitrary Python variables. These get restored
107 allows you to save arbitrary Python variables. These get restored
108 automatically when your session restarts.
108 automatically when your session restarts.
109 * Automatic indentation (optional) of code as you type (through the
109 * Automatic indentation (optional) of code as you type (through the
110 readline library).
110 readline library).
111 * Macro system for quickly re-executing multiple lines of previous
111 * Macro system for quickly re-executing multiple lines of previous
112 input with a single name. Macros can be stored persistently via
112 input with a single name. Macros can be stored persistently via
113 %store and edited via %edit.
113 %store and edited via %edit.
114 * Session logging (you can then later use these logs as code in your
114 * Session logging (you can then later use these logs as code in your
115 programs). Logs can optionally timestamp all input, and also store
115 programs). Logs can optionally timestamp all input, and also store
116 session output (marked as comments, so the log remains valid
116 session output (marked as comments, so the log remains valid
117 Python source code).
117 Python source code).
118 * Session restoring: logs can be replayed to restore a previous
118 * Session restoring: logs can be replayed to restore a previous
119 session to the state where you left it.
119 session to the state where you left it.
120 * Verbose and colored exception traceback printouts. Easier to parse
120 * Verbose and colored exception traceback printouts. Easier to parse
121 visually, and in verbose mode they produce a lot of useful
121 visually, and in verbose mode they produce a lot of useful
122 debugging information (basically a terminal version of the cgitb
122 debugging information (basically a terminal version of the cgitb
123 module).
123 module).
124 * Auto-parentheses: callable objects can be executed without
124 * Auto-parentheses: callable objects can be executed without
125 parentheses: 'sin 3' is automatically converted to 'sin(3)'.
125 parentheses: 'sin 3' is automatically converted to 'sin(3)'.
126 * Auto-quoting: using ',' or ';' as the first character forces
126 * Auto-quoting: using ',' or ';' as the first character forces
127 auto-quoting of the rest of the line: ',my_function a b' becomes
127 auto-quoting of the rest of the line: ',my_function a b' becomes
128 automatically 'my_function("a","b")', while ';my_function a b'
128 automatically 'my_function("a","b")', while ';my_function a b'
129 becomes 'my_function("a b")'.
129 becomes 'my_function("a b")'.
130 * Extensible input syntax. You can define filters that pre-process
130 * Extensible input syntax. You can define filters that pre-process
131 user input to simplify input in special situations. This allows
131 user input to simplify input in special situations. This allows
132 for example pasting multi-line code fragments which start with
132 for example pasting multi-line code fragments which start with
133 '>>>' or '...' such as those from other python sessions or the
133 '>>>' or '...' such as those from other python sessions or the
134 standard Python documentation.
134 standard Python documentation.
135 * Flexible configuration system. It uses a configuration file which
135 * Flexible configuration system. It uses a configuration file which
136 allows permanent setting of all command-line options, module
136 allows permanent setting of all command-line options, module
137 loading, code and file execution. The system allows recursive file
137 loading, code and file execution. The system allows recursive file
138 inclusion, so you can have a base file with defaults and layers
138 inclusion, so you can have a base file with defaults and layers
139 which load other customizations for particular projects.
139 which load other customizations for particular projects.
140 * Embeddable. You can call IPython as a python shell inside your own
140 * Embeddable. You can call IPython as a python shell inside your own
141 python programs. This can be used both for debugging code or for
141 python programs. This can be used both for debugging code or for
142 providing interactive abilities to your programs with knowledge
142 providing interactive abilities to your programs with knowledge
143 about the local namespaces (very useful in debugging and data
143 about the local namespaces (very useful in debugging and data
144 analysis situations).
144 analysis situations).
145 * Easy debugger access. You can set IPython to call up an enhanced
145 * Easy debugger access. You can set IPython to call up an enhanced
146 version of the Python debugger (pdb) every time there is an
146 version of the Python debugger (pdb) every time there is an
147 uncaught exception. This drops you inside the code which triggered
147 uncaught exception. This drops you inside the code which triggered
148 the exception with all the data live and it is possible to
148 the exception with all the data live and it is possible to
149 navigate the stack to rapidly isolate the source of a bug. The
149 navigate the stack to rapidly isolate the source of a bug. The
150 %run magic command -with the -d option- can run any script under
150 %run magic command -with the -d option- can run any script under
151 pdb's control, automatically setting initial breakpoints for you.
151 pdb's control, automatically setting initial breakpoints for you.
152 This version of pdb has IPython-specific improvements, including
152 This version of pdb has IPython-specific improvements, including
153 tab-completion and traceback coloring support. For even easier
153 tab-completion and traceback coloring support. For even easier
154 debugger access, try %debug after seeing an exception. winpdb is
154 debugger access, try %debug after seeing an exception. winpdb is
155 also supported, see ipy_winpdb extension.
155 also supported, see ipy_winpdb extension.
156 * Profiler support. You can run single statements (similar to
156 * Profiler support. You can run single statements (similar to
157 profile.run()) or complete programs under the profiler's control.
157 profile.run()) or complete programs under the profiler's control.
158 While this is possible with standard cProfile or profile modules,
158 While this is possible with standard cProfile or profile modules,
159 IPython wraps this functionality with magic commands (see '%prun'
159 IPython wraps this functionality with magic commands (see '%prun'
160 and '%run -p') convenient for rapid interactive work.
160 and '%run -p') convenient for rapid interactive work.
161 * Doctest support. The special %doctest_mode command toggles a mode
161 * Doctest support. The special %doctest_mode command toggles a mode
162 that allows you to paste existing doctests (with leading '>>>'
162 that allows you to paste existing doctests (with leading '>>>'
163 prompts and whitespace) and uses doctest-compatible prompts and
163 prompts and whitespace) and uses doctest-compatible prompts and
164 output, so you can use IPython sessions as doctest code.
164 output, so you can use IPython sessions as doctest code.
165
165
166
166
167 Portability and Python requirements
167 Portability and Python requirements
168 -----------------------------------
168 -----------------------------------
169
169
170 Python requirements: IPython requires with Python version 2.3 or newer.
170 Python requirements: IPython requires with Python version 2.3 or newer.
171 If you are still using Python 2.2 and can not upgrade, the last version
171 If you are still using Python 2.2 and can not upgrade, the last version
172 of IPython which worked with Python 2.2 was 0.6.15, so you will have to
172 of IPython which worked with Python 2.2 was 0.6.15, so you will have to
173 use that.
173 use that.
174
174
175 IPython is developed under Linux, but it should work in any reasonable
175 IPython is developed under Linux, but it should work in any reasonable
176 Unix-type system (tested OK under Solaris and the BSD family, for which
176 Unix-type system (tested OK under Solaris and the BSD family, for which
177 a port exists thanks to Dryice Liu).
177 a port exists thanks to Dryice Liu).
178
178
179 Mac OS X: it works, apparently without any problems (thanks to Jim Boyle
179 Mac OS X: it works, apparently without any problems (thanks to Jim Boyle
180 at Lawrence Livermore for the information). Thanks to Andrea Riciputi,
180 at Lawrence Livermore for the information). Thanks to Andrea Riciputi,
181 Fink support is available.
181 Fink support is available.
182
182
183 CygWin: it works mostly OK, though some users have reported problems
183 CygWin: it works mostly OK, though some users have reported problems
184 with prompt coloring. No satisfactory solution to this has been found so
184 with prompt coloring. No satisfactory solution to this has been found so
185 far, you may want to disable colors permanently in the ipythonrc
185 far, you may want to disable colors permanently in the ipythonrc
186 configuration file if you experience problems. If you have proper color
186 configuration file if you experience problems. If you have proper color
187 support under cygwin, please post to the IPython mailing list so this
187 support under cygwin, please post to the IPython mailing list so this
188 issue can be resolved for all users.
188 issue can be resolved for all users.
189
189
190 Windows: it works well under Windows Vista/XP/2k, and I suspect NT should
190 Windows: it works well under Windows Vista/XP/2k, and I suspect NT should
191 behave similarly. Section "Installation under windows" describes
191 behave similarly. Section "Installation under windows" describes
192 installation details for Windows, including some additional tools needed
192 installation details for Windows, including some additional tools needed
193 on this platform.
193 on this platform.
194
194
195 Windows 9x support is present, and has been reported to work fine (at
195 Windows 9x support is present, and has been reported to work fine (at
196 least on WinME).
196 least on WinME).
197
197
198 Location
198 Location
199 --------
199 --------
200
200
201 IPython is generously hosted at http://ipython.scipy.org by the
201 IPython is generously hosted at http://ipython.scipy.org by the
202 Enthought, Inc and the SciPy project. This site offers downloads,
202 Enthought, Inc and the SciPy project. This site offers downloads,
203 subversion access, mailing lists and a bug tracking system. I am very
203 subversion access, mailing lists and a bug tracking system. I am very
204 grateful to Enthought (http://www.enthought.com) and all of the SciPy
204 grateful to Enthought (http://www.enthought.com) and all of the SciPy
205 team for their contribution.
205 team for their contribution.
206
206
207 Installation
207 Installation
208 ============
208 ============
209
209
210 Instant instructions
210 Instant instructions
211 --------------------
211 --------------------
212
212
213 If you are of the impatient kind, under Linux/Unix simply untar/unzip
213 If you are of the impatient kind, under Linux/Unix simply untar/unzip
214 the download, then install with 'python setup.py install'. Under
214 the download, then install with 'python setup.py install'. Under
215 Windows, double-click on the provided .exe binary installer.
215 Windows, double-click on the provided .exe binary installer.
216
216
217 Then, take a look at Customization_ section for configuring things
217 Then, take a look at Customization_ section for configuring things
218 optimally and `Quick tips`_ for quick tips on efficient use of
218 optimally and `Quick tips`_ for quick tips on efficient use of
219 IPython. You can later refer to the rest of the manual for all the
219 IPython. You can later refer to the rest of the manual for all the
220 gory details.
220 gory details.
221
221
222 See the notes in upgrading_ section for upgrading IPython versions.
222 See the notes in upgrading_ section for upgrading IPython versions.
223
223
224
224
225 Detailed Unix instructions (Linux, Mac OS X, etc.)
225 Detailed Unix instructions (Linux, Mac OS X, etc.)
226
226
227 For RPM based systems, simply install the supplied package in the usual
227 For RPM based systems, simply install the supplied package in the usual
228 manner. If you download the tar archive, the process is:
228 manner. If you download the tar archive, the process is:
229
229
230 1. Unzip/untar the ipython-XXX.tar.gz file wherever you want (XXX is
230 1. Unzip/untar the ipython-XXX.tar.gz file wherever you want (XXX is
231 the version number). It will make a directory called ipython-XXX.
231 the version number). It will make a directory called ipython-XXX.
232 Change into that directory where you will find the files README
232 Change into that directory where you will find the files README
233 and setup.py. Once you've completed the installation, you can
233 and setup.py. Once you've completed the installation, you can
234 safely remove this directory.
234 safely remove this directory.
235 2. If you are installing over a previous installation of version
235 2. If you are installing over a previous installation of version
236 0.2.0 or earlier, first remove your $HOME/.ipython directory,
236 0.2.0 or earlier, first remove your $HOME/.ipython directory,
237 since the configuration file format has changed somewhat (the '='
237 since the configuration file format has changed somewhat (the '='
238 were removed from all option specifications). Or you can call
238 were removed from all option specifications). Or you can call
239 ipython with the -upgrade option and it will do this automatically
239 ipython with the -upgrade option and it will do this automatically
240 for you.
240 for you.
241 3. IPython uses distutils, so you can install it by simply typing at
241 3. IPython uses distutils, so you can install it by simply typing at
242 the system prompt (don't type the $)::
242 the system prompt (don't type the $)::
243
243
244 $ python setup.py install
244 $ python setup.py install
245
245
246 Note that this assumes you have root access to your machine. If
246 Note that this assumes you have root access to your machine. If
247 you don't have root access or don't want IPython to go in the
247 you don't have root access or don't want IPython to go in the
248 default python directories, you'll need to use the ``--home`` option
248 default python directories, you'll need to use the ``--home`` option
249 (or ``--prefix``). For example::
249 (or ``--prefix``). For example::
250
250
251 $ python setup.py install --home $HOME/local
251 $ python setup.py install --home $HOME/local
252
252
253 will install IPython into $HOME/local and its subdirectories
253 will install IPython into $HOME/local and its subdirectories
254 (creating them if necessary).
254 (creating them if necessary).
255 You can type::
255 You can type::
256
256
257 $ python setup.py --help
257 $ python setup.py --help
258
258
259 for more details.
259 for more details.
260
260
261 Note that if you change the default location for ``--home`` at
261 Note that if you change the default location for ``--home`` at
262 installation, IPython may end up installed at a location which is
262 installation, IPython may end up installed at a location which is
263 not part of your $PYTHONPATH environment variable. In this case,
263 not part of your $PYTHONPATH environment variable. In this case,
264 you'll need to configure this variable to include the actual
264 you'll need to configure this variable to include the actual
265 directory where the IPython/ directory ended (typically the value
265 directory where the IPython/ directory ended (typically the value
266 you give to ``--home`` plus /lib/python).
266 you give to ``--home`` plus /lib/python).
267
267
268
268
269 Mac OSX information
269 Mac OSX information
270 -------------------
270 -------------------
271
271
272 Under OSX, there is a choice you need to make. Apple ships its own build
272 Under OSX, there is a choice you need to make. Apple ships its own build
273 of Python, which lives in the core OSX filesystem hierarchy. You can
273 of Python, which lives in the core OSX filesystem hierarchy. You can
274 also manually install a separate Python, either purely by hand
274 also manually install a separate Python, either purely by hand
275 (typically in /usr/local) or by using Fink, which puts everything under
275 (typically in /usr/local) or by using Fink, which puts everything under
276 /sw. Which route to follow is a matter of personal preference, as I've
276 /sw. Which route to follow is a matter of personal preference, as I've
277 seen users who favor each of the approaches. Here I will simply list the
277 seen users who favor each of the approaches. Here I will simply list the
278 known installation issues under OSX, along with their solutions.
278 known installation issues under OSX, along with their solutions.
279
279
280 This page: http://geosci.uchicago.edu/~tobis/pylab.html contains
280 This page: http://geosci.uchicago.edu/~tobis/pylab.html contains
281 information on this topic, with additional details on how to make
281 information on this topic, with additional details on how to make
282 IPython and matplotlib play nicely under OSX.
282 IPython and matplotlib play nicely under OSX.
283
283
284 To run IPython and readline on OSX "Leopard" system python, see the
284 To run IPython and readline on OSX "Leopard" system python, see the
285 wiki page at http://ipython.scipy.org/moin/InstallationOSXLeopard
285 wiki page at http://ipython.scipy.org/moin/InstallationOSXLeopard
286
286
287
287
288 GUI problems
288 GUI problems
289 ------------
289 ------------
290
290
291 The following instructions apply to an install of IPython under OSX from
291 The following instructions apply to an install of IPython under OSX from
292 unpacking the .tar.gz distribution and installing it for the default
292 unpacking the .tar.gz distribution and installing it for the default
293 Python interpreter shipped by Apple. If you are using a fink install,
293 Python interpreter shipped by Apple. If you are using a fink install,
294 fink will take care of these details for you, by installing IPython
294 fink will take care of these details for you, by installing IPython
295 against fink's Python.
295 against fink's Python.
296
296
297 IPython offers various forms of support for interacting with graphical
297 IPython offers various forms of support for interacting with graphical
298 applications from the command line, from simple Tk apps (which are in
298 applications from the command line, from simple Tk apps (which are in
299 principle always supported by Python) to interactive control of WX, Qt
299 principle always supported by Python) to interactive control of WX, Qt
300 and GTK apps. Under OSX, however, this requires that ipython is
300 and GTK apps. Under OSX, however, this requires that ipython is
301 installed by calling the special pythonw script at installation time,
301 installed by calling the special pythonw script at installation time,
302 which takes care of coordinating things with Apple's graphical environment.
302 which takes care of coordinating things with Apple's graphical environment.
303
303
304 So when installing under OSX, it is best to use the following command::
304 So when installing under OSX, it is best to use the following command::
305
305
306 $ sudo pythonw setup.py install --install-scripts=/usr/local/bin
306 $ sudo pythonw setup.py install --install-scripts=/usr/local/bin
307
307
308 or
308 or
309
309
310 $ sudo pythonw setup.py install --install-scripts=/usr/bin
310 $ sudo pythonw setup.py install --install-scripts=/usr/bin
311
311
312 depending on where you like to keep hand-installed executables.
312 depending on where you like to keep hand-installed executables.
313
313
314 The resulting script will have an appropriate shebang line (the first
314 The resulting script will have an appropriate shebang line (the first
315 line in the script whic begins with #!...) such that the ipython
315 line in the script whic begins with #!...) such that the ipython
316 interpreter can interact with the OS X GUI. If the installed version
316 interpreter can interact with the OS X GUI. If the installed version
317 does not work and has a shebang line that points to, for example, just
317 does not work and has a shebang line that points to, for example, just
318 /usr/bin/python, then you might have a stale, cached version in your
318 /usr/bin/python, then you might have a stale, cached version in your
319 build/scripts-<python-version> directory. Delete that directory and
319 build/scripts-<python-version> directory. Delete that directory and
320 rerun the setup.py.
320 rerun the setup.py.
321
321
322 It is also a good idea to use the special flag ``--install-scripts`` as
322 It is also a good idea to use the special flag ``--install-scripts`` as
323 indicated above, to ensure that the ipython scripts end up in a location
323 indicated above, to ensure that the ipython scripts end up in a location
324 which is part of your $PATH. Otherwise Apple's Python will put the
324 which is part of your $PATH. Otherwise Apple's Python will put the
325 scripts in an internal directory not available by default at the command
325 scripts in an internal directory not available by default at the command
326 line (if you use /usr/local/bin, you need to make sure this is in your
326 line (if you use /usr/local/bin, you need to make sure this is in your
327 $PATH, which may not be true by default).
327 $PATH, which may not be true by default).
328
328
329
329
330 Readline problems
330 Readline problems
331 -----------------
331 -----------------
332
332
333 By default, the Python version shipped by Apple does not include the
333 By default, the Python version shipped by Apple does not include the
334 readline library, so central to IPython's behavior. If you install
334 readline library, so central to IPython's behavior. If you install
335 IPython against Apple's Python, you will not have arrow keys, tab
335 IPython against Apple's Python, you will not have arrow keys, tab
336 completion, etc. For Mac OSX 10.3 (Panther), you can find a prebuilt
336 completion, etc. For Mac OSX 10.3 (Panther), you can find a prebuilt
337 readline library here:
337 readline library here:
338 http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip
338 http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip
339
339
340 If you are using OSX 10.4 (Tiger), after installing this package you
340 If you are using OSX 10.4 (Tiger), after installing this package you
341 need to either:
341 need to either:
342
342
343 1. move readline.so from /Library/Python/2.3 to
343 1. move readline.so from /Library/Python/2.3 to
344 /Library/Python/2.3/site-packages, or
344 /Library/Python/2.3/site-packages, or
345 2. install http://pythonmac.org/packages/TigerPython23Compat.pkg.zip
345 2. install http://pythonmac.org/packages/TigerPython23Compat.pkg.zip
346
346
347 Users installing against Fink's Python or a properly hand-built one
347 Users installing against Fink's Python or a properly hand-built one
348 should not have this problem.
348 should not have this problem.
349
349
350
350
351 DarwinPorts
351 DarwinPorts
352 -----------
352 -----------
353
353
354 I report here a message from an OSX user, who suggests an alternative
354 I report here a message from an OSX user, who suggests an alternative
355 means of using IPython under this operating system with good results.
355 means of using IPython under this operating system with good results.
356 Please let me know of any updates that may be useful for this section.
356 Please let me know of any updates that may be useful for this section.
357 His message is reproduced verbatim below:
357 His message is reproduced verbatim below:
358
358
359 From: Markus Banfi <markus.banfi-AT-mospheira.net>
359 From: Markus Banfi <markus.banfi-AT-mospheira.net>
360
360
361 As a MacOS X (10.4.2) user I prefer to install software using
361 As a MacOS X (10.4.2) user I prefer to install software using
362 DawinPorts instead of Fink. I had no problems installing ipython
362 DawinPorts instead of Fink. I had no problems installing ipython
363 with DarwinPorts. It's just:
363 with DarwinPorts. It's just:
364
364
365 sudo port install py-ipython
365 sudo port install py-ipython
366
366
367 It automatically resolved all dependencies (python24, readline,
367 It automatically resolved all dependencies (python24, readline,
368 py-readline). So far I did not encounter any problems with the
368 py-readline). So far I did not encounter any problems with the
369 DarwinPorts port of ipython.
369 DarwinPorts port of ipython.
370
370
371
371
372
372
373 Windows instructions
373 Windows instructions
374 --------------------
374 --------------------
375
375
376 Some of IPython's very useful features are:
376 Some of IPython's very useful features are:
377
377
378 * Integrated readline support (Tab-based file, object and attribute
378 * Integrated readline support (Tab-based file, object and attribute
379 completion, input history across sessions, editable command line,
379 completion, input history across sessions, editable command line,
380 etc.)
380 etc.)
381 * Coloring of prompts, code and tracebacks.
381 * Coloring of prompts, code and tracebacks.
382
382
383 .. _pyreadline:
383 .. _pyreadline:
384
384
385 These, by default, are only available under Unix-like operating systems.
385 These, by default, are only available under Unix-like operating systems.
386 However, thanks to Gary Bishop's work, Windows XP/2k users can also
386 However, thanks to Gary Bishop's work, Windows XP/2k users can also
387 benefit from them. His readline library originally implemented both GNU
387 benefit from them. His readline library originally implemented both GNU
388 readline functionality and color support, so that IPython under Windows
388 readline functionality and color support, so that IPython under Windows
389 XP/2k can be as friendly and powerful as under Unix-like environments.
389 XP/2k can be as friendly and powerful as under Unix-like environments.
390
390
391 This library, now named PyReadline, has been absorbed by the IPython
391 This library, now named PyReadline, has been absorbed by the IPython
392 team (Jörgen Stenarson, in particular), and it continues to be developed
392 team (Jörgen Stenarson, in particular), and it continues to be developed
393 with new features, as well as being distributed directly from the
393 with new features, as well as being distributed directly from the
394 IPython site.
394 IPython site.
395
395
396 The PyReadline extension requires CTypes and the windows IPython
396 The PyReadline extension requires CTypes and the windows IPython
397 installer needs PyWin32, so in all you need:
397 installer needs PyWin32, so in all you need:
398
398
399 1. PyWin32 from http://sourceforge.net/projects/pywin32.
399 1. PyWin32 from http://sourceforge.net/projects/pywin32.
400 2. PyReadline for Windows from
400 2. PyReadline for Windows from
401 http://ipython.scipy.org/moin/PyReadline/Intro. That page contains
401 http://ipython.scipy.org/moin/PyReadline/Intro. That page contains
402 further details on using and configuring the system to your liking.
402 further details on using and configuring the system to your liking.
403 3. Finally, only if you are using Python 2.3 or 2.4, you need CTypes
403 3. Finally, only if you are using Python 2.3 or 2.4, you need CTypes
404 from http://starship.python.net/crew/theller/ctypes(you must use
404 from http://starship.python.net/crew/theller/ctypes(you must use
405 version 0.9.1 or newer). This package is included in Python 2.5,
405 version 0.9.1 or newer). This package is included in Python 2.5,
406 so you don't need to manually get it if your Python version is 2.5
406 so you don't need to manually get it if your Python version is 2.5
407 or newer.
407 or newer.
408
408
409 Warning about a broken readline-like library: several users have
409 Warning about a broken readline-like library: several users have
410 reported problems stemming from using the pseudo-readline library at
410 reported problems stemming from using the pseudo-readline library at
411 http://newcenturycomputers.net/projects/readline.html. This is a broken
411 http://newcenturycomputers.net/projects/readline.html. This is a broken
412 library which, while called readline, only implements an incomplete
412 library which, while called readline, only implements an incomplete
413 subset of the readline API. Since it is still called readline, it fools
413 subset of the readline API. Since it is still called readline, it fools
414 IPython's detection mechanisms and causes unpredictable crashes later.
414 IPython's detection mechanisms and causes unpredictable crashes later.
415 If you wish to use IPython under Windows, you must NOT use this library,
415 If you wish to use IPython under Windows, you must NOT use this library,
416 which for all purposes is (at least as of version 1.6) terminally broken.
416 which for all purposes is (at least as of version 1.6) terminally broken.
417
417
418
418
419 Installation procedure
419 Installation procedure
420 ----------------------
420 ----------------------
421
421
422 Once you have the above installed, from the IPython download directory
422 Once you have the above installed, from the IPython download directory
423 grab the ipython-XXX.win32.exe file, where XXX represents the version
423 grab the ipython-XXX.win32.exe file, where XXX represents the version
424 number. This is a regular windows executable installer, which you can
424 number. This is a regular windows executable installer, which you can
425 simply double-click to install. It will add an entry for IPython to your
425 simply double-click to install. It will add an entry for IPython to your
426 Start Menu, as well as registering IPython in the Windows list of
426 Start Menu, as well as registering IPython in the Windows list of
427 applications, so you can later uninstall it from the Control Panel.
427 applications, so you can later uninstall it from the Control Panel.
428
428
429 IPython tries to install the configuration information in a directory
429 IPython tries to install the configuration information in a directory
430 named .ipython (_ipython under Windows) located in your 'home'
430 named .ipython (_ipython under Windows) located in your 'home'
431 directory. IPython sets this directory by looking for a HOME environment
431 directory. IPython sets this directory by looking for a HOME environment
432 variable; if such a variable does not exist, it uses HOMEDRIVE\HOMEPATH
432 variable; if such a variable does not exist, it uses HOMEDRIVE\HOMEPATH
433 (these are always defined by Windows). This typically gives something
433 (these are always defined by Windows). This typically gives something
434 like C:\Documents and Settings\YourUserName, but your local details may
434 like C:\Documents and Settings\YourUserName, but your local details may
435 vary. In this directory you will find all the files that configure
435 vary. In this directory you will find all the files that configure
436 IPython's defaults, and you can put there your profiles and extensions.
436 IPython's defaults, and you can put there your profiles and extensions.
437 This directory is automatically added by IPython to sys.path, so
437 This directory is automatically added by IPython to sys.path, so
438 anything you place there can be found by import statements.
438 anything you place there can be found by import statements.
439
439
440
440
441 Upgrading
441 Upgrading
442 ---------
442 ---------
443
443
444 For an IPython upgrade, you should first uninstall the previous version.
444 For an IPython upgrade, you should first uninstall the previous version.
445 This will ensure that all files and directories (such as the
445 This will ensure that all files and directories (such as the
446 documentation) which carry embedded version strings in their names are
446 documentation) which carry embedded version strings in their names are
447 properly removed.
447 properly removed.
448
448
449
449
450 Manual installation under Win32
450 Manual installation under Win32
451 -------------------------------
451 -------------------------------
452
452
453 In case the automatic installer does not work for some reason, you can
453 In case the automatic installer does not work for some reason, you can
454 download the ipython-XXX.tar.gz file, which contains the full IPython
454 download the ipython-XXX.tar.gz file, which contains the full IPython
455 source distribution (the popular WinZip can read .tar.gz files). After
455 source distribution (the popular WinZip can read .tar.gz files). After
456 uncompressing the archive, you can install it at a command terminal just
456 uncompressing the archive, you can install it at a command terminal just
457 like any other Python module, by using 'python setup.py install'.
457 like any other Python module, by using 'python setup.py install'.
458
458
459 After the installation, run the supplied win32_manual_post_install.py
459 After the installation, run the supplied win32_manual_post_install.py
460 script, which creates the necessary Start Menu shortcuts for you.
460 script, which creates the necessary Start Menu shortcuts for you.
461
461
462
462
463 .. upgrading:
463 .. upgrading:
464
464
465 Upgrading from a previous version
465 Upgrading from a previous version
466 ---------------------------------
466 ---------------------------------
467
467
468 If you are upgrading from a previous version of IPython, you may want
468 If you are upgrading from a previous version of IPython, you may want
469 to upgrade the contents of your ~/.ipython directory. Just run
469 to upgrade the contents of your ~/.ipython directory. Just run
470 %upgrade, look at the diffs and delete the suggested files manually,
470 %upgrade, look at the diffs and delete the suggested files manually,
471 if you think you can lose the old versions. %upgrade will never
471 if you think you can lose the old versions. %upgrade will never
472 overwrite or delete anything.
472 overwrite or delete anything.
473
473
474 Initial configuration of your environment
474 Initial configuration of your environment
475 =========================================
475 =========================================
476
476
477 This section will help you set various things in your environment for
477 This section will help you set various things in your environment for
478 your IPython sessions to be as efficient as possible. All of IPython's
478 your IPython sessions to be as efficient as possible. All of IPython's
479 configuration information, along with several example files, is stored
479 configuration information, along with several example files, is stored
480 in a directory named by default $HOME/.ipython. You can change this by
480 in a directory named by default $HOME/.ipython. You can change this by
481 defining the environment variable IPYTHONDIR, or at runtime with the
481 defining the environment variable IPYTHONDIR, or at runtime with the
482 command line option -ipythondir.
482 command line option -ipythondir.
483
483
484 If all goes well, the first time you run IPython it should
484 If all goes well, the first time you run IPython it should
485 automatically create a user copy of the config directory for you,
485 automatically create a user copy of the config directory for you,
486 based on its builtin defaults. You can look at the files it creates to
486 based on its builtin defaults. You can look at the files it creates to
487 learn more about configuring the system. The main file you will modify
487 learn more about configuring the system. The main file you will modify
488 to configure IPython's behavior is called ipythonrc (with a .ini
488 to configure IPython's behavior is called ipythonrc (with a .ini
489 extension under Windows), included for reference in `ipythonrc`_
489 extension under Windows), included for reference in `ipythonrc`_
490 section. This file is very commented and has many variables you can
490 section. This file is very commented and has many variables you can
491 change to suit your taste, you can find more details in
491 change to suit your taste, you can find more details in
492 Sec. customization_. Here we discuss the basic things you will want to
492 Sec. customization_. Here we discuss the basic things you will want to
493 make sure things are working properly from the beginning.
493 make sure things are working properly from the beginning.
494
494
495
495
496 .. _Accessing help:
496 .. _Accessing help:
497
497
498 Access to the Python help system
498 Access to the Python help system
499 --------------------------------
499 --------------------------------
500
500
501 This is true for Python in general (not just for IPython): you should
501 This is true for Python in general (not just for IPython): you should
502 have an environment variable called PYTHONDOCS pointing to the directory
502 have an environment variable called PYTHONDOCS pointing to the directory
503 where your HTML Python documentation lives. In my system it's
503 where your HTML Python documentation lives. In my system it's
504 /usr/share/doc/python-docs-2.3.4/html, check your local details or ask
504 /usr/share/doc/python-docs-2.3.4/html, check your local details or ask
505 your systems administrator.
505 your systems administrator.
506
506
507 This is the directory which holds the HTML version of the Python
507 This is the directory which holds the HTML version of the Python
508 manuals. Unfortunately it seems that different Linux distributions
508 manuals. Unfortunately it seems that different Linux distributions
509 package these files differently, so you may have to look around a bit.
509 package these files differently, so you may have to look around a bit.
510 Below I show the contents of this directory on my system for reference::
510 Below I show the contents of this directory on my system for reference::
511
511
512 [html]> ls
512 [html]> ls
513 about.dat acks.html dist/ ext/ index.html lib/ modindex.html
513 about.dat acks.html dist/ ext/ index.html lib/ modindex.html
514 stdabout.dat tut/ about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
514 stdabout.dat tut/ about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
515
515
516 You should really make sure this variable is correctly set so that
516 You should really make sure this variable is correctly set so that
517 Python's pydoc-based help system works. It is a powerful and convenient
517 Python's pydoc-based help system works. It is a powerful and convenient
518 system with full access to the Python manuals and all modules accessible
518 system with full access to the Python manuals and all modules accessible
519 to you.
519 to you.
520
520
521 Under Windows it seems that pydoc finds the documentation automatically,
521 Under Windows it seems that pydoc finds the documentation automatically,
522 so no extra setup appears necessary.
522 so no extra setup appears necessary.
523
523
524
524
525 Editor
525 Editor
526 ------
526 ------
527
527
528 The %edit command (and its alias %ed) will invoke the editor set in your
528 The %edit command (and its alias %ed) will invoke the editor set in your
529 environment as EDITOR. If this variable is not set, it will default to
529 environment as EDITOR. If this variable is not set, it will default to
530 vi under Linux/Unix and to notepad under Windows. You may want to set
530 vi under Linux/Unix and to notepad under Windows. You may want to set
531 this variable properly and to a lightweight editor which doesn't take
531 this variable properly and to a lightweight editor which doesn't take
532 too long to start (that is, something other than a new instance of
532 too long to start (that is, something other than a new instance of
533 Emacs). This way you can edit multi-line code quickly and with the power
533 Emacs). This way you can edit multi-line code quickly and with the power
534 of a real editor right inside IPython.
534 of a real editor right inside IPython.
535
535
536 If you are a dedicated Emacs user, you should set up the Emacs server so
536 If you are a dedicated Emacs user, you should set up the Emacs server so
537 that new requests are handled by the original process. This means that
537 that new requests are handled by the original process. This means that
538 almost no time is spent in handling the request (assuming an Emacs
538 almost no time is spent in handling the request (assuming an Emacs
539 process is already running). For this to work, you need to set your
539 process is already running). For this to work, you need to set your
540 EDITOR environment variable to 'emacsclient'. The code below, supplied
540 EDITOR environment variable to 'emacsclient'. The code below, supplied
541 by Francois Pinard, can then be used in your .emacs file to enable the
541 by Francois Pinard, can then be used in your .emacs file to enable the
542 server::
542 server::
543
543
544 (defvar server-buffer-clients)
544 (defvar server-buffer-clients)
545 (when (and (fboundp 'server-start) (string-equal (getenv "TERM") 'xterm))
545 (when (and (fboundp 'server-start) (string-equal (getenv "TERM") 'xterm))
546 (server-start)
546 (server-start)
547 (defun fp-kill-server-with-buffer-routine ()
547 (defun fp-kill-server-with-buffer-routine ()
548 (and server-buffer-clients (server-done)))
548 (and server-buffer-clients (server-done)))
549 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
549 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
550
550
551 You can also set the value of this editor via the commmand-line option
551 You can also set the value of this editor via the commmand-line option
552 '-editor' or in your ipythonrc file. This is useful if you wish to use
552 '-editor' or in your ipythonrc file. This is useful if you wish to use
553 specifically for IPython an editor different from your typical default
553 specifically for IPython an editor different from your typical default
554 (and for Windows users who tend to use fewer environment variables).
554 (and for Windows users who tend to use fewer environment variables).
555
555
556
556
557 Color
557 Color
558 -----
558 -----
559
559
560 The default IPython configuration has most bells and whistles turned on
560 The default IPython configuration has most bells and whistles turned on
561 (they're pretty safe). But there's one that may cause problems on some
561 (they're pretty safe). But there's one that may cause problems on some
562 systems: the use of color on screen for displaying information. This is
562 systems: the use of color on screen for displaying information. This is
563 very useful, since IPython can show prompts and exception tracebacks
563 very useful, since IPython can show prompts and exception tracebacks
564 with various colors, display syntax-highlighted source code, and in
564 with various colors, display syntax-highlighted source code, and in
565 general make it easier to visually parse information.
565 general make it easier to visually parse information.
566
566
567 The following terminals seem to handle the color sequences fine:
567 The following terminals seem to handle the color sequences fine:
568
568
569 * Linux main text console, KDE Konsole, Gnome Terminal, E-term,
569 * Linux main text console, KDE Konsole, Gnome Terminal, E-term,
570 rxvt, xterm.
570 rxvt, xterm.
571 * CDE terminal (tested under Solaris). This one boldfaces light colors.
571 * CDE terminal (tested under Solaris). This one boldfaces light colors.
572 * (X)Emacs buffers. See the emacs_ section for more details on
572 * (X)Emacs buffers. See the emacs_ section for more details on
573 using IPython with (X)Emacs.
573 using IPython with (X)Emacs.
574 * A Windows (XP/2k) command prompt with pyreadline_.
574 * A Windows (XP/2k) command prompt with pyreadline_.
575 * A Windows (XP/2k) CygWin shell. Although some users have reported
575 * A Windows (XP/2k) CygWin shell. Although some users have reported
576 problems; it is not clear whether there is an issue for everyone
576 problems; it is not clear whether there is an issue for everyone
577 or only under specific configurations. If you have full color
577 or only under specific configurations. If you have full color
578 support under cygwin, please post to the IPython mailing list so
578 support under cygwin, please post to the IPython mailing list so
579 this issue can be resolved for all users.
579 this issue can be resolved for all users.
580
580
581 These have shown problems:
581 These have shown problems:
582
582
583 * Windows command prompt in WinXP/2k logged into a Linux machine via
583 * Windows command prompt in WinXP/2k logged into a Linux machine via
584 telnet or ssh.
584 telnet or ssh.
585 * Windows native command prompt in WinXP/2k, without Gary Bishop's
585 * Windows native command prompt in WinXP/2k, without Gary Bishop's
586 extensions. Once Gary's readline library is installed, the normal
586 extensions. Once Gary's readline library is installed, the normal
587 WinXP/2k command prompt works perfectly.
587 WinXP/2k command prompt works perfectly.
588
588
589 Currently the following color schemes are available:
589 Currently the following color schemes are available:
590
590
591 * NoColor: uses no color escapes at all (all escapes are empty '' ''
591 * NoColor: uses no color escapes at all (all escapes are empty '' ''
592 strings). This 'scheme' is thus fully safe to use in any terminal.
592 strings). This 'scheme' is thus fully safe to use in any terminal.
593 * Linux: works well in Linux console type environments: dark
593 * Linux: works well in Linux console type environments: dark
594 background with light fonts. It uses bright colors for
594 background with light fonts. It uses bright colors for
595 information, so it is difficult to read if you have a light
595 information, so it is difficult to read if you have a light
596 colored background.
596 colored background.
597 * LightBG: the basic colors are similar to those in the Linux scheme
597 * LightBG: the basic colors are similar to those in the Linux scheme
598 but darker. It is easy to read in terminals with light backgrounds.
598 but darker. It is easy to read in terminals with light backgrounds.
599
599
600 IPython uses colors for two main groups of things: prompts and
600 IPython uses colors for two main groups of things: prompts and
601 tracebacks which are directly printed to the terminal, and the object
601 tracebacks which are directly printed to the terminal, and the object
602 introspection system which passes large sets of data through a pager.
602 introspection system which passes large sets of data through a pager.
603
603
604
604
605 Input/Output prompts and exception tracebacks
605 Input/Output prompts and exception tracebacks
606 ---------------------------------------------
606 ---------------------------------------------
607
607
608 You can test whether the colored prompts and tracebacks work on your
608 You can test whether the colored prompts and tracebacks work on your
609 system interactively by typing '%colors Linux' at the prompt (use
609 system interactively by typing '%colors Linux' at the prompt (use
610 '%colors LightBG' if your terminal has a light background). If the input
610 '%colors LightBG' if your terminal has a light background). If the input
611 prompt shows garbage like::
611 prompt shows garbage like::
612
612
613 [0;32mIn [[1;32m1[0;32m]: [0;00m
613 [0;32mIn [[1;32m1[0;32m]: [0;00m
614
614
615 instead of (in color) something like::
615 instead of (in color) something like::
616
616
617 In [1]:
617 In [1]:
618
618
619 this means that your terminal doesn't properly handle color escape
619 this means that your terminal doesn't properly handle color escape
620 sequences. You can go to a 'no color' mode by typing '%colors NoColor'.
620 sequences. You can go to a 'no color' mode by typing '%colors NoColor'.
621
621
622 You can try using a different terminal emulator program (Emacs users,
622 You can try using a different terminal emulator program (Emacs users,
623 see below). To permanently set your color preferences, edit the file
623 see below). To permanently set your color preferences, edit the file
624 $HOME/.ipython/ipythonrc and set the colors option to the desired value.
624 $HOME/.ipython/ipythonrc and set the colors option to the desired value.
625
625
626
626
627 Object details (types, docstrings, source code, etc.)
627 Object details (types, docstrings, source code, etc.)
628 -----------------------------------------------------
628 -----------------------------------------------------
629
629
630 IPython has a set of special functions for studying the objects you
630 IPython has a set of special functions for studying the objects you
631 are working with, discussed in detail in Sec. `dynamic object
631 are working with, discussed in detail in Sec. `dynamic object
632 information`_. But this system relies on passing information which is
632 information`_. But this system relies on passing information which is
633 longer than your screen through a data pager, such as the common Unix
633 longer than your screen through a data pager, such as the common Unix
634 less and more programs. In order to be able to see this information in
634 less and more programs. In order to be able to see this information in
635 color, your pager needs to be properly configured. I strongly
635 color, your pager needs to be properly configured. I strongly
636 recommend using less instead of more, as it seems that more simply can
636 recommend using less instead of more, as it seems that more simply can
637 not understand colored text correctly.
637 not understand colored text correctly.
638
638
639 In order to configure less as your default pager, do the following:
639 In order to configure less as your default pager, do the following:
640
640
641 1. Set the environment PAGER variable to less.
641 1. Set the environment PAGER variable to less.
642 2. Set the environment LESS variable to -r (plus any other options
642 2. Set the environment LESS variable to -r (plus any other options
643 you always want to pass to less by default). This tells less to
643 you always want to pass to less by default). This tells less to
644 properly interpret control sequences, which is how color
644 properly interpret control sequences, which is how color
645 information is given to your terminal.
645 information is given to your terminal.
646
646
647 For the csh or tcsh shells, add to your ~/.cshrc file the lines::
647 For the csh or tcsh shells, add to your ~/.cshrc file the lines::
648
648
649 setenv PAGER less
649 setenv PAGER less
650 setenv LESS -r
650 setenv LESS -r
651
651
652 There is similar syntax for other Unix shells, look at your system
652 There is similar syntax for other Unix shells, look at your system
653 documentation for details.
653 documentation for details.
654
654
655 If you are on a system which lacks proper data pagers (such as Windows),
655 If you are on a system which lacks proper data pagers (such as Windows),
656 IPython will use a very limited builtin pager.
656 IPython will use a very limited builtin pager.
657
657
658 .. _emacs:
658 .. _emacs:
659
659
660 (X)Emacs configuration
660 (X)Emacs configuration
661 ----------------------
661 ----------------------
662
662
663 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran,
663 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran,
664 currently (X)Emacs and IPython get along very well.
664 currently (X)Emacs and IPython get along very well.
665
665
666 Important note: You will need to use a recent enough version of
666 Important note: You will need to use a recent enough version of
667 python-mode.el, along with the file ipython.el. You can check that the
667 python-mode.el, along with the file ipython.el. You can check that the
668 version you have of python-mode.el is new enough by either looking at
668 version you have of python-mode.el is new enough by either looking at
669 the revision number in the file itself, or asking for it in (X)Emacs via
669 the revision number in the file itself, or asking for it in (X)Emacs via
670 M-x py-version. Versions 4.68 and newer contain the necessary fixes for
670 M-x py-version. Versions 4.68 and newer contain the necessary fixes for
671 proper IPython support.
671 proper IPython support.
672
672
673 The file ipython.el is included with the IPython distribution, in the
673 The file ipython.el is included with the IPython distribution, in the
674 documentation directory (where this manual resides in PDF and HTML
674 documentation directory (where this manual resides in PDF and HTML
675 formats).
675 formats).
676
676
677 Once you put these files in your Emacs path, all you need in your .emacs
677 Once you put these files in your Emacs path, all you need in your .emacs
678 file is::
678 file is::
679
679
680 (require 'ipython)
680 (require 'ipython)
681
681
682 This should give you full support for executing code snippets via
682 This should give you full support for executing code snippets via
683 IPython, opening IPython as your Python shell via C-c !, etc.
683 IPython, opening IPython as your Python shell via C-c !, etc.
684
684
685 If you happen to get garbage instead of colored prompts as described in
685 If you happen to get garbage instead of colored prompts as described in
686 the previous section, you may need to set also in your .emacs file::
686 the previous section, you may need to set also in your .emacs file::
687
687
688 (setq ansi-color-for-comint-mode t)
688 (setq ansi-color-for-comint-mode t)
689
689
690
690
691 Notes:
691 Notes:
692
692
693 * There is one caveat you should be aware of: you must start the
693 * There is one caveat you should be aware of: you must start the
694 IPython shell before attempting to execute any code regions via
694 IPython shell before attempting to execute any code regions via
695 ``C-c |``. Simply type C-c ! to start IPython before passing any code
695 ``C-c |``. Simply type C-c ! to start IPython before passing any code
696 regions to the interpreter, and you shouldn't experience any
696 regions to the interpreter, and you shouldn't experience any
697 problems.
697 problems.
698 This is due to a bug in Python itself, which has been fixed for
698 This is due to a bug in Python itself, which has been fixed for
699 Python 2.3, but exists as of Python 2.2.2 (reported as SF bug [
699 Python 2.3, but exists as of Python 2.2.2 (reported as SF bug [
700 737947 ]).
700 737947 ]).
701 * The (X)Emacs support is maintained by Alexander Schmolck, so all
701 * The (X)Emacs support is maintained by Alexander Schmolck, so all
702 comments/requests should be directed to him through the IPython
702 comments/requests should be directed to him through the IPython
703 mailing lists.
703 mailing lists.
704 * This code is still somewhat experimental so it's a bit rough
704 * This code is still somewhat experimental so it's a bit rough
705 around the edges (although in practice, it works quite well).
705 around the edges (although in practice, it works quite well).
706 * Be aware that if you customize py-python-command previously, this
706 * Be aware that if you customize py-python-command previously, this
707 value will override what ipython.el does (because loading the
707 value will override what ipython.el does (because loading the
708 customization variables comes later).
708 customization variables comes later).
709
709
710 .. Quick tips:
710 .. Quick tips:
711
711
712 Quick tips
712 Quick tips
713 ==========
713 ==========
714
714
715 IPython can be used as an improved replacement for the Python prompt,
715 IPython can be used as an improved replacement for the Python prompt,
716 and for that you don't really need to read any more of this manual. But
716 and for that you don't really need to read any more of this manual. But
717 in this section we'll try to summarize a few tips on how to make the
717 in this section we'll try to summarize a few tips on how to make the
718 most effective use of it for everyday Python development, highlighting
718 most effective use of it for everyday Python development, highlighting
719 things you might miss in the rest of the manual (which is getting long).
719 things you might miss in the rest of the manual (which is getting long).
720 We'll give references to parts in the manual which provide more detail
720 We'll give references to parts in the manual which provide more detail
721 when appropriate.
721 when appropriate.
722
722
723 The following article by Jeremy Jones provides an introductory tutorial
723 The following article by Jeremy Jones provides an introductory tutorial
724 about IPython:
724 about IPython:
725 http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html
725 http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html
726
726
727 * The TAB key. TAB-completion, especially for attributes, is a
727 * The TAB key. TAB-completion, especially for attributes, is a
728 convenient way to explore the structure of any object you're
728 convenient way to explore the structure of any object you're
729 dealing with. Simply type object_name.<TAB> and a list of the
729 dealing with. Simply type object_name.<TAB> and a list of the
730 object's attributes will be printed (see readline_ for
730 object's attributes will be printed (see readline_ for
731 more). Tab completion also works on
731 more). Tab completion also works on
732 file and directory names, which combined with IPython's alias
732 file and directory names, which combined with IPython's alias
733 system allows you to do from within IPython many of the things you
733 system allows you to do from within IPython many of the things you
734 normally would need the system shell for.
734 normally would need the system shell for.
735 * Explore your objects. Typing object_name? will print all sorts of
735 * Explore your objects. Typing object_name? will print all sorts of
736 details about any object, including docstrings, function
736 details about any object, including docstrings, function
737 definition lines (for call arguments) and constructor details for
737 definition lines (for call arguments) and constructor details for
738 classes. The magic commands %pdoc, %pdef, %psource and %pfile will
738 classes. The magic commands %pdoc, %pdef, %psource and %pfile will
739 respectively print the docstring, function definition line, full
739 respectively print the docstring, function definition line, full
740 source code and the complete file for any object (when they can be
740 source code and the complete file for any object (when they can be
741 found). If automagic is on (it is by default), you don't need to
741 found). If automagic is on (it is by default), you don't need to
742 type the '%' explicitly. See sec. `dynamic object information`_
742 type the '%' explicitly. See sec. `dynamic object information`_
743 for more.
743 for more.
744 * The %run magic command allows you to run any python script and
744 * The %run magic command allows you to run any python script and
745 load all of its data directly into the interactive namespace.
745 load all of its data directly into the interactive namespace.
746 Since the file is re-read from disk each time, changes you make to
746 Since the file is re-read from disk each time, changes you make to
747 it are reflected immediately (in contrast to the behavior of
747 it are reflected immediately (in contrast to the behavior of
748 import). I rarely use import for code I am testing, relying on
748 import). I rarely use import for code I am testing, relying on
749 %run instead. See magic_ section for more on this
749 %run instead. See magic_ section for more on this
750 and other magic commands, or type the name of any magic command
750 and other magic commands, or type the name of any magic command
751 and ? to get details on it. See also sec. dreload_ for a
751 and ? to get details on it. See also sec. dreload_ for a
752 recursive reload command.
752 recursive reload command.
753 %run also has special flags for timing the execution of your
753 %run also has special flags for timing the execution of your
754 scripts (-t) and for executing them under the control of either
754 scripts (-t) and for executing them under the control of either
755 Python's pdb debugger (-d) or profiler (-p). With all of these,
755 Python's pdb debugger (-d) or profiler (-p). With all of these,
756 %run can be used as the main tool for efficient interactive
756 %run can be used as the main tool for efficient interactive
757 development of code which you write in your editor of choice.
757 development of code which you write in your editor of choice.
758 * Use the Python debugger, pdb. The %pdb
758 * Use the Python debugger, pdb. The %pdb
759 command allows you to toggle on and off the automatic invocation
759 command allows you to toggle on and off the automatic invocation
760 of an IPython-enhanced pdb debugger (with coloring, tab completion
760 of an IPython-enhanced pdb debugger (with coloring, tab completion
761 and more) at any uncaught exception. The advantage of this is that
761 and more) at any uncaught exception. The advantage of this is that
762 pdb starts inside the function where the exception occurred, with
762 pdb starts inside the function where the exception occurred, with
763 all data still available. You can print variables, see code,
763 all data still available. You can print variables, see code,
764 execute statements and even walk up and down the call stack to
764 execute statements and even walk up and down the call stack to
765 track down the true source of the problem (which often is many
765 track down the true source of the problem (which often is many
766 layers in the stack above where the exception gets triggered).
766 layers in the stack above where the exception gets triggered).
767 Running programs with %run and pdb active can be an efficient to
767 Running programs with %run and pdb active can be an efficient to
768 develop and debug code, in many cases eliminating the need for
768 develop and debug code, in many cases eliminating the need for
769 print statements or external debugging tools. I often simply put a
769 print statements or external debugging tools. I often simply put a
770 1/0 in a place where I want to take a look so that pdb gets
770 1/0 in a place where I want to take a look so that pdb gets
771 called, quickly view whatever variables I need to or test various
771 called, quickly view whatever variables I need to or test various
772 pieces of code and then remove the 1/0.
772 pieces of code and then remove the 1/0.
773 Note also that '%run -d' activates pdb and automatically sets
773 Note also that '%run -d' activates pdb and automatically sets
774 initial breakpoints for you to step through your code, watch
774 initial breakpoints for you to step through your code, watch
775 variables, etc. See Sec. `Output caching`_ for
775 variables, etc. See Sec. `Output caching`_ for
776 details.
776 details.
777 * Use the output cache. All output results are automatically stored
777 * Use the output cache. All output results are automatically stored
778 in a global dictionary named Out and variables named _1, _2, etc.
778 in a global dictionary named Out and variables named _1, _2, etc.
779 alias them. For example, the result of input line 4 is available
779 alias them. For example, the result of input line 4 is available
780 either as Out[4] or as _4. Additionally, three variables named _,
780 either as Out[4] or as _4. Additionally, three variables named _,
781 __ and ___ are always kept updated with the for the last three
781 __ and ___ are always kept updated with the for the last three
782 results. This allows you to recall any previous result and further
782 results. This allows you to recall any previous result and further
783 use it for new calculations. See Sec. `Output caching`_ for more.
783 use it for new calculations. See Sec. `Output caching`_ for more.
784 * Put a ';' at the end of a line to supress the printing of output.
784 * Put a ';' at the end of a line to supress the printing of output.
785 This is useful when doing calculations which generate long output
785 This is useful when doing calculations which generate long output
786 you are not interested in seeing. The _* variables and the Out[]
786 you are not interested in seeing. The _* variables and the Out[]
787 list do get updated with the contents of the output, even if it is
787 list do get updated with the contents of the output, even if it is
788 not printed. You can thus still access the generated results this
788 not printed. You can thus still access the generated results this
789 way for further processing.
789 way for further processing.
790 * A similar system exists for caching input. All input is stored in
790 * A similar system exists for caching input. All input is stored in
791 a global list called In , so you can re-execute lines 22 through
791 a global list called In , so you can re-execute lines 22 through
792 28 plus line 34 by typing 'exec In[22:29]+In[34]' (using Python
792 28 plus line 34 by typing 'exec In[22:29]+In[34]' (using Python
793 slicing notation). If you need to execute the same set of lines
793 slicing notation). If you need to execute the same set of lines
794 often, you can assign them to a macro with the %macro function.
794 often, you can assign them to a macro with the %macro function.
795 See sec. `Input caching`_ for more.
795 See sec. `Input caching`_ for more.
796 * Use your input history. The %hist command can show you all
796 * Use your input history. The %hist command can show you all
797 previous input, without line numbers if desired (option -n) so you
797 previous input, without line numbers if desired (option -n) so you
798 can directly copy and paste code either back in IPython or in a
798 can directly copy and paste code either back in IPython or in a
799 text editor. You can also save all your history by turning on
799 text editor. You can also save all your history by turning on
800 logging via %logstart; these logs can later be either reloaded as
800 logging via %logstart; these logs can later be either reloaded as
801 IPython sessions or used as code for your programs.
801 IPython sessions or used as code for your programs.
802 * Define your own system aliases. Even though IPython gives you
802 * Define your own system aliases. Even though IPython gives you
803 access to your system shell via the ! prefix, it is convenient to
803 access to your system shell via the ! prefix, it is convenient to
804 have aliases to the system commands you use most often. This
804 have aliases to the system commands you use most often. This
805 allows you to work seamlessly from inside IPython with the same
805 allows you to work seamlessly from inside IPython with the same
806 commands you are used to in your system shell.
806 commands you are used to in your system shell.
807 IPython comes with some pre-defined aliases and a complete system
807 IPython comes with some pre-defined aliases and a complete system
808 for changing directories, both via a stack (see %pushd, %popd and
808 for changing directories, both via a stack (see %pushd, %popd and
809 %dhist) and via direct %cd. The latter keeps a history of visited
809 %dhist) and via direct %cd. The latter keeps a history of visited
810 directories and allows you to go to any previously visited one.
810 directories and allows you to go to any previously visited one.
811 * Use Python to manipulate the results of system commands. The '!!'
811 * Use Python to manipulate the results of system commands. The '!!'
812 special syntax, and the %sc and %sx magic commands allow you to
812 special syntax, and the %sc and %sx magic commands allow you to
813 capture system output into Python variables.
813 capture system output into Python variables.
814 * Expand python variables when calling the shell (either via '!' and
814 * Expand python variables when calling the shell (either via '!' and
815 '!!' or via aliases) by prepending a $ in front of them. You can
815 '!!' or via aliases) by prepending a $ in front of them. You can
816 also expand complete python expressions. See
816 also expand complete python expressions. See
817 `System shell access`_ for more.
817 `System shell access`_ for more.
818 * Use profiles to maintain different configurations (modules to
818 * Use profiles to maintain different configurations (modules to
819 load, function definitions, option settings) for particular tasks.
819 load, function definitions, option settings) for particular tasks.
820 You can then have customized versions of IPython for specific
820 You can then have customized versions of IPython for specific
821 purposes. See sec. profiles_ for more.
821 purposes. See sec. profiles_ for more.
822 * Embed IPython in your programs. A few lines of code are enough to
822 * Embed IPython in your programs. A few lines of code are enough to
823 load a complete IPython inside your own programs, giving you the
823 load a complete IPython inside your own programs, giving you the
824 ability to work with your data interactively after automatic
824 ability to work with your data interactively after automatic
825 processing has been completed. See sec. embedding_
825 processing has been completed. See sec. embedding_
826 for more.
826 for more.
827 * Use the Python profiler. When dealing with performance issues, the
827 * Use the Python profiler. When dealing with performance issues, the
828 %run command with a -p option allows you to run complete programs
828 %run command with a -p option allows you to run complete programs
829 under the control of the Python profiler. The %prun command does a
829 under the control of the Python profiler. The %prun command does a
830 similar job for single Python expressions (like function calls).
830 similar job for single Python expressions (like function calls).
831 * Use the IPython.demo.Demo class to load any Python script as an
831 * Use the IPython.demo.Demo class to load any Python script as an
832 interactive demo. With a minimal amount of simple markup, you can
832 interactive demo. With a minimal amount of simple markup, you can
833 control the execution of the script, stopping as needed. See
833 control the execution of the script, stopping as needed. See
834 sec. `interactive demos`_ for more.
834 sec. `interactive demos`_ for more.
835 * Run your doctests from within IPython for development and
835 * Run your doctests from within IPython for development and
836 debugging. The special %doctest_mode command toggles a mode where
836 debugging. The special %doctest_mode command toggles a mode where
837 the prompt, output and exceptions display matches as closely as
837 the prompt, output and exceptions display matches as closely as
838 possible that of the default Python interpreter. In addition, this
838 possible that of the default Python interpreter. In addition, this
839 mode allows you to directly paste in code that contains leading
839 mode allows you to directly paste in code that contains leading
840 '>>>' prompts, even if they have extra leading whitespace (as is
840 '>>>' prompts, even if they have extra leading whitespace (as is
841 common in doctest files). This combined with the '%history -tn'
841 common in doctest files). This combined with the '%history -tn'
842 call to see your translated history (with these extra prompts
842 call to see your translated history (with these extra prompts
843 removed and no line numbers) allows for an easy doctest workflow,
843 removed and no line numbers) allows for an easy doctest workflow,
844 where you can go from doctest to interactive execution to pasting
844 where you can go from doctest to interactive execution to pasting
845 into valid Python code as needed.
845 into valid Python code as needed.
846
846
847
847
848 Source code handling tips
848 Source code handling tips
849 -------------------------
849 -------------------------
850
850
851 IPython is a line-oriented program, without full control of the
851 IPython is a line-oriented program, without full control of the
852 terminal. Therefore, it doesn't support true multiline editing. However,
852 terminal. Therefore, it doesn't support true multiline editing. However,
853 it has a number of useful tools to help you in dealing effectively with
853 it has a number of useful tools to help you in dealing effectively with
854 more complex editing.
854 more complex editing.
855
855
856 The %edit command gives a reasonable approximation of multiline editing,
856 The %edit command gives a reasonable approximation of multiline editing,
857 by invoking your favorite editor on the spot. IPython will execute the
857 by invoking your favorite editor on the spot. IPython will execute the
858 code you type in there as if it were typed interactively. Type %edit?
858 code you type in there as if it were typed interactively. Type %edit?
859 for the full details on the edit command.
859 for the full details on the edit command.
860
860
861 If you have typed various commands during a session, which you'd like to
861 If you have typed various commands during a session, which you'd like to
862 reuse, IPython provides you with a number of tools. Start by using %hist
862 reuse, IPython provides you with a number of tools. Start by using %hist
863 to see your input history, so you can see the line numbers of all input.
863 to see your input history, so you can see the line numbers of all input.
864 Let us say that you'd like to reuse lines 10 through 20, plus lines 24
864 Let us say that you'd like to reuse lines 10 through 20, plus lines 24
865 and 28. All the commands below can operate on these with the syntax::
865 and 28. All the commands below can operate on these with the syntax::
866
866
867 %command 10-20 24 28
867 %command 10-20 24 28
868
868
869 where the command given can be:
869 where the command given can be:
870
870
871 * %macro <macroname>: this stores the lines into a variable which,
871 * %macro <macroname>: this stores the lines into a variable which,
872 when called at the prompt, re-executes the input. Macros can be
872 when called at the prompt, re-executes the input. Macros can be
873 edited later using '%edit macroname', and they can be stored
873 edited later using '%edit macroname', and they can be stored
874 persistently across sessions with '%store macroname' (the storage
874 persistently across sessions with '%store macroname' (the storage
875 system is per-profile). The combination of quick macros,
875 system is per-profile). The combination of quick macros,
876 persistent storage and editing, allows you to easily refine
876 persistent storage and editing, allows you to easily refine
877 quick-and-dirty interactive input into permanent utilities, always
877 quick-and-dirty interactive input into permanent utilities, always
878 available both in IPython and as files for general reuse.
878 available both in IPython and as files for general reuse.
879 * %edit: this will open a text editor with those lines pre-loaded
879 * %edit: this will open a text editor with those lines pre-loaded
880 for further modification. It will then execute the resulting
880 for further modification. It will then execute the resulting
881 file's contents as if you had typed it at the prompt.
881 file's contents as if you had typed it at the prompt.
882 * %save <filename>: this saves the lines directly to a named file on
882 * %save <filename>: this saves the lines directly to a named file on
883 disk.
883 disk.
884
884
885 While %macro saves input lines into memory for interactive re-execution,
885 While %macro saves input lines into memory for interactive re-execution,
886 sometimes you'd like to save your input directly to a file. The %save
886 sometimes you'd like to save your input directly to a file. The %save
887 magic does this: its input sytnax is the same as %macro, but it saves
887 magic does this: its input sytnax is the same as %macro, but it saves
888 your input directly to a Python file. Note that the %logstart command
888 your input directly to a Python file. Note that the %logstart command
889 also saves input, but it logs all input to disk (though you can
889 also saves input, but it logs all input to disk (though you can
890 temporarily suspend it and reactivate it with %logoff/%logon); %save
890 temporarily suspend it and reactivate it with %logoff/%logon); %save
891 allows you to select which lines of input you need to save.
891 allows you to select which lines of input you need to save.
892
892
893
893
894 Lightweight 'version control'
894 Lightweight 'version control'
895 -----------------------------
895 -----------------------------
896
896
897 When you call %edit with no arguments, IPython opens an empty editor
897 When you call %edit with no arguments, IPython opens an empty editor
898 with a temporary file, and it returns the contents of your editing
898 with a temporary file, and it returns the contents of your editing
899 session as a string variable. Thanks to IPython's output caching
899 session as a string variable. Thanks to IPython's output caching
900 mechanism, this is automatically stored::
900 mechanism, this is automatically stored::
901
901
902 In [1]: %edit
902 In [1]: %edit
903
903
904 IPython will make a temporary file named: /tmp/ipython_edit_yR-HCN.py
904 IPython will make a temporary file named: /tmp/ipython_edit_yR-HCN.py
905
905
906 Editing... done. Executing edited code...
906 Editing... done. Executing edited code...
907
907
908 hello - this is a temporary file
908 hello - this is a temporary file
909
909
910 Out[1]: "print 'hello - this is a temporary file'\n"
910 Out[1]: "print 'hello - this is a temporary file'\n"
911
911
912 Now, if you call '%edit -p', IPython tries to open an editor with the
912 Now, if you call '%edit -p', IPython tries to open an editor with the
913 same data as the last time you used %edit. So if you haven't used %edit
913 same data as the last time you used %edit. So if you haven't used %edit
914 in the meantime, this same contents will reopen; however, it will be
914 in the meantime, this same contents will reopen; however, it will be
915 done in a new file. This means that if you make changes and you later
915 done in a new file. This means that if you make changes and you later
916 want to find an old version, you can always retrieve it by using its
916 want to find an old version, you can always retrieve it by using its
917 output number, via '%edit _NN', where NN is the number of the output
917 output number, via '%edit _NN', where NN is the number of the output
918 prompt.
918 prompt.
919
919
920 Continuing with the example above, this should illustrate this idea::
920 Continuing with the example above, this should illustrate this idea::
921
921
922 In [2]: edit -p
922 In [2]: edit -p
923
923
924 IPython will make a temporary file named: /tmp/ipython_edit_nA09Qk.py
924 IPython will make a temporary file named: /tmp/ipython_edit_nA09Qk.py
925
925
926 Editing... done. Executing edited code...
926 Editing... done. Executing edited code...
927
927
928 hello - now I made some changes
928 hello - now I made some changes
929
929
930 Out[2]: "print 'hello - now I made some changes'\n"
930 Out[2]: "print 'hello - now I made some changes'\n"
931
931
932 In [3]: edit _1
932 In [3]: edit _1
933
933
934 IPython will make a temporary file named: /tmp/ipython_edit_gy6-zD.py
934 IPython will make a temporary file named: /tmp/ipython_edit_gy6-zD.py
935
935
936 Editing... done. Executing edited code...
936 Editing... done. Executing edited code...
937
937
938 hello - this is a temporary file
938 hello - this is a temporary file
939
939
940 IPython version control at work :)
940 IPython version control at work :)
941
941
942 Out[3]: "print 'hello - this is a temporary file'\nprint 'IPython version control at work :)'\n"
942 Out[3]: "print 'hello - this is a temporary file'\nprint 'IPython version control at work :)'\n"
943
943
944
944
945 This section was written after a contribution by Alexander Belchenko on
945 This section was written after a contribution by Alexander Belchenko on
946 the IPython user list.
946 the IPython user list.
947
947
948
948
949 Effective logging
949 Effective logging
950 -----------------
950 -----------------
951
951
952 A very useful suggestion sent in by Robert Kern follows:
952 A very useful suggestion sent in by Robert Kern follows:
953
953
954 I recently happened on a nifty way to keep tidy per-project log files. I
954 I recently happened on a nifty way to keep tidy per-project log files. I
955 made a profile for my project (which is called "parkfield").
955 made a profile for my project (which is called "parkfield").
956
956
957 include ipythonrc
957 include ipythonrc
958
958
959 # cancel earlier logfile invocation:
959 # cancel earlier logfile invocation:
960
960
961 logfile ''
961 logfile ''
962
962
963 execute import time
963 execute import time
964
964
965 execute __cmd = '/Users/kern/research/logfiles/parkfield-%s.log rotate'
965 execute __cmd = '/Users/kern/research/logfiles/parkfield-%s.log rotate'
966
966
967 execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d'))
967 execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d'))
968
968
969 I also added a shell alias for convenience:
969 I also added a shell alias for convenience:
970
970
971 alias parkfield="ipython -pylab -profile parkfield"
971 alias parkfield="ipython -pylab -profile parkfield"
972
972
973 Now I have a nice little directory with everything I ever type in,
973 Now I have a nice little directory with everything I ever type in,
974 organized by project and date.
974 organized by project and date.
975
975
976 Contribute your own: If you have your own favorite tip on using IPython
976 Contribute your own: If you have your own favorite tip on using IPython
977 efficiently for a certain task (especially things which can't be done in
977 efficiently for a certain task (especially things which can't be done in
978 the normal Python interpreter), don't hesitate to send it!
978 the normal Python interpreter), don't hesitate to send it!
979
979
980 .. _Command line options:
980 .. _Command line options:
981
981
982 Command-line use
982 Command-line use
983 ================
983 ================
984
984
985 You start IPython with the command::
985 You start IPython with the command::
986
986
987 $ ipython [options] files
987 $ ipython [options] files
988
988
989 If invoked with no options, it executes all the files listed in sequence
989 If invoked with no options, it executes all the files listed in sequence
990 and drops you into the interpreter while still acknowledging any options
990 and drops you into the interpreter while still acknowledging any options
991 you may have set in your ipythonrc file. This behavior is different from
991 you may have set in your ipythonrc file. This behavior is different from
992 standard Python, which when called as python -i will only execute one
992 standard Python, which when called as python -i will only execute one
993 file and ignore your configuration setup.
993 file and ignore your configuration setup.
994
994
995 Please note that some of the configuration options are not available at
995 Please note that some of the configuration options are not available at
996 the command line, simply because they are not practical here. Look into
996 the command line, simply because they are not practical here. Look into
997 your ipythonrc configuration file for details on those. This file
997 your ipythonrc configuration file for details on those. This file
998 typically installed in the $HOME/.ipython directory. For Windows users,
998 typically installed in the $HOME/.ipython directory. For Windows users,
999 $HOME resolves to C:\\Documents and Settings\\YourUserName in most
999 $HOME resolves to C:\\Documents and Settings\\YourUserName in most
1000 instances. In the rest of this text, we will refer to this directory as
1000 instances. In the rest of this text, we will refer to this directory as
1001 IPYTHONDIR.
1001 IPYTHONDIR.
1002
1002
1003 .. _Threading options:
1003 .. _Threading options:
1004
1004
1005
1005
1006 Special Threading Options
1006 Special Threading Options
1007 -------------------------
1007 -------------------------
1008
1008
1009 The following special options are ONLY valid at the beginning of the
1009 The following special options are ONLY valid at the beginning of the
1010 command line, and not later. This is because they control the initial-
1010 command line, and not later. This is because they control the initial-
1011 ization of ipython itself, before the normal option-handling mechanism
1011 ization of ipython itself, before the normal option-handling mechanism
1012 is active.
1012 is active.
1013
1013
1014 -gthread, -qthread, -q4thread, -wthread, -pylab:
1014 -gthread, -qthread, -q4thread, -wthread, -pylab:
1015 Only one of these can be given, and it can only be given as
1015 Only one of these can be given, and it can only be given as
1016 the first option passed to IPython (it will have no effect in
1016 the first option passed to IPython (it will have no effect in
1017 any other position). They provide threading support for the
1017 any other position). They provide threading support for the
1018 GTK, Qt (versions 3 and 4) and WXPython toolkits, and for the
1018 GTK, Qt (versions 3 and 4) and WXPython toolkits, and for the
1019 matplotlib library.
1019 matplotlib library.
1020
1020
1021 With any of the first four options, IPython starts running a
1021 With any of the first four options, IPython starts running a
1022 separate thread for the graphical toolkit's operation, so that
1022 separate thread for the graphical toolkit's operation, so that
1023 you can open and control graphical elements from within an
1023 you can open and control graphical elements from within an
1024 IPython command line, without blocking. All four provide
1024 IPython command line, without blocking. All four provide
1025 essentially the same functionality, respectively for GTK, Qt3,
1025 essentially the same functionality, respectively for GTK, Qt3,
1026 Qt4 and WXWidgets (via their Python interfaces).
1026 Qt4 and WXWidgets (via their Python interfaces).
1027
1027
1028 Note that with -wthread, you can additionally use the
1028 Note that with -wthread, you can additionally use the
1029 -wxversion option to request a specific version of wx to be
1029 -wxversion option to request a specific version of wx to be
1030 used. This requires that you have the wxversion Python module
1030 used. This requires that you have the wxversion Python module
1031 installed, which is part of recent wxPython distributions.
1031 installed, which is part of recent wxPython distributions.
1032
1032
1033 If -pylab is given, IPython loads special support for the mat
1033 If -pylab is given, IPython loads special support for the mat
1034 plotlib library (http://matplotlib.sourceforge.net), allowing
1034 plotlib library (http://matplotlib.sourceforge.net), allowing
1035 interactive usage of any of its backends as defined in the
1035 interactive usage of any of its backends as defined in the
1036 user's ~/.matplotlib/matplotlibrc file. It automatically
1036 user's ~/.matplotlib/matplotlibrc file. It automatically
1037 activates GTK, Qt or WX threading for IPyhton if the choice of
1037 activates GTK, Qt or WX threading for IPyhton if the choice of
1038 matplotlib backend requires it. It also modifies the %run
1038 matplotlib backend requires it. It also modifies the %run
1039 command to correctly execute (without blocking) any
1039 command to correctly execute (without blocking) any
1040 matplotlib-based script which calls show() at the end.
1040 matplotlib-based script which calls show() at the end.
1041
1041
1042 -tk
1042 -tk
1043 The -g/q/q4/wthread options, and -pylab (if matplotlib is
1043 The -g/q/q4/wthread options, and -pylab (if matplotlib is
1044 configured to use GTK, Qt3, Qt4 or WX), will normally block Tk
1044 configured to use GTK, Qt3, Qt4 or WX), will normally block Tk
1045 graphical interfaces. This means that when either GTK, Qt or WX
1045 graphical interfaces. This means that when either GTK, Qt or WX
1046 threading is active, any attempt to open a Tk GUI will result in a
1046 threading is active, any attempt to open a Tk GUI will result in a
1047 dead window, and possibly cause the Python interpreter to crash.
1047 dead window, and possibly cause the Python interpreter to crash.
1048 An extra option, -tk, is available to address this issue. It can
1048 An extra option, -tk, is available to address this issue. It can
1049 only be given as a second option after any of the above (-gthread,
1049 only be given as a second option after any of the above (-gthread,
1050 -wthread or -pylab).
1050 -wthread or -pylab).
1051
1051
1052 If -tk is given, IPython will try to coordinate Tk threading
1052 If -tk is given, IPython will try to coordinate Tk threading
1053 with GTK, Qt or WX. This is however potentially unreliable, and
1053 with GTK, Qt or WX. This is however potentially unreliable, and
1054 you will have to test on your platform and Python configuration to
1054 you will have to test on your platform and Python configuration to
1055 determine whether it works for you. Debian users have reported
1055 determine whether it works for you. Debian users have reported
1056 success, apparently due to the fact that Debian builds all of Tcl,
1056 success, apparently due to the fact that Debian builds all of Tcl,
1057 Tk, Tkinter and Python with pthreads support. Under other Linux
1057 Tk, Tkinter and Python with pthreads support. Under other Linux
1058 environments (such as Fedora Core 2/3), this option has caused
1058 environments (such as Fedora Core 2/3), this option has caused
1059 random crashes and lockups of the Python interpreter. Under other
1059 random crashes and lockups of the Python interpreter. Under other
1060 operating systems (Mac OSX and Windows), you'll need to try it to
1060 operating systems (Mac OSX and Windows), you'll need to try it to
1061 find out, since currently no user reports are available.
1061 find out, since currently no user reports are available.
1062
1062
1063 There is unfortunately no way for IPython to determine at run time
1063 There is unfortunately no way for IPython to determine at run time
1064 whether -tk will work reliably or not, so you will need to do some
1064 whether -tk will work reliably or not, so you will need to do some
1065 experiments before relying on it for regular work.
1065 experiments before relying on it for regular work.
1066
1066
1067
1067
1068
1068
1069 Regular Options
1069 Regular Options
1070 ---------------
1070 ---------------
1071
1071
1072 After the above threading options have been given, regular options can
1072 After the above threading options have been given, regular options can
1073 follow in any order. All options can be abbreviated to their shortest
1073 follow in any order. All options can be abbreviated to their shortest
1074 non-ambiguous form and are case-sensitive. One or two dashes can be
1074 non-ambiguous form and are case-sensitive. One or two dashes can be
1075 used. Some options have an alternate short form, indicated after a ``|``.
1075 used. Some options have an alternate short form, indicated after a ``|``.
1076
1076
1077 Most options can also be set from your ipythonrc configuration file. See
1077 Most options can also be set from your ipythonrc configuration file. See
1078 the provided example for more details on what the options do. Options
1078 the provided example for more details on what the options do. Options
1079 given at the command line override the values set in the ipythonrc file.
1079 given at the command line override the values set in the ipythonrc file.
1080
1080
1081 All options with a [no] prepended can be specified in negated form
1081 All options with a [no] prepended can be specified in negated form
1082 (-nooption instead of -option) to turn the feature off.
1082 (-nooption instead of -option) to turn the feature off.
1083
1083
1084 -help print a help message and exit.
1084 -help print a help message and exit.
1085
1085
1086 -pylab
1086 -pylab
1087 this can only be given as the first option passed to IPython
1087 this can only be given as the first option passed to IPython
1088 (it will have no effect in any other position). It adds
1088 (it will have no effect in any other position). It adds
1089 special support for the matplotlib library
1089 special support for the matplotlib library
1090 (http://matplotlib.sourceforge.ne), allowing interactive usage
1090 (http://matplotlib.sourceforge.ne), allowing interactive usage
1091 of any of its backends as defined in the user's .matplotlibrc
1091 of any of its backends as defined in the user's .matplotlibrc
1092 file. It automatically activates GTK or WX threading for
1092 file. It automatically activates GTK or WX threading for
1093 IPyhton if the choice of matplotlib backend requires it. It
1093 IPyhton if the choice of matplotlib backend requires it. It
1094 also modifies the %run command to correctly execute (without
1094 also modifies the %run command to correctly execute (without
1095 blocking) any matplotlib-based script which calls show() at
1095 blocking) any matplotlib-based script which calls show() at
1096 the end. See `Matplotlib support`_ for more details.
1096 the end. See `Matplotlib support`_ for more details.
1097
1097
1098 -autocall <val>
1098 -autocall <val>
1099 Make IPython automatically call any callable object even if you
1099 Make IPython automatically call any callable object even if you
1100 didn't type explicit parentheses. For example, 'str 43' becomes
1100 didn't type explicit parentheses. For example, 'str 43' becomes
1101 'str(43)' automatically. The value can be '0' to disable the feature,
1101 'str(43)' automatically. The value can be '0' to disable the feature,
1102 '1' for smart autocall, where it is not applied if there are no more
1102 '1' for smart autocall, where it is not applied if there are no more
1103 arguments on the line, and '2' for full autocall, where all callable
1103 arguments on the line, and '2' for full autocall, where all callable
1104 objects are automatically called (even if no arguments are
1104 objects are automatically called (even if no arguments are
1105 present). The default is '1'.
1105 present). The default is '1'.
1106
1106
1107 -[no]autoindent
1107 -[no]autoindent
1108 Turn automatic indentation on/off.
1108 Turn automatic indentation on/off.
1109
1109
1110 -[no]automagic
1110 -[no]automagic
1111 make magic commands automatic (without needing their first character
1111 make magic commands automatic (without needing their first character
1112 to be %). Type %magic at the IPython prompt for more information.
1112 to be %). Type %magic at the IPython prompt for more information.
1113
1113
1114 -[no]autoedit_syntax
1114 -[no]autoedit_syntax
1115 When a syntax error occurs after editing a file, automatically
1115 When a syntax error occurs after editing a file, automatically
1116 open the file to the trouble causing line for convenient
1116 open the file to the trouble causing line for convenient
1117 fixing.
1117 fixing.
1118
1118
1119 -[no]banner Print the initial information banner (default on).
1119 -[no]banner Print the initial information banner (default on).
1120
1120
1121 -c <command>
1121 -c <command>
1122 execute the given command string. This is similar to the -c
1122 execute the given command string. This is similar to the -c
1123 option in the normal Python interpreter.
1123 option in the normal Python interpreter.
1124
1124
1125 -cache_size, cs <n>
1125 -cache_size, cs <n>
1126 size of the output cache (maximum number of entries to hold in
1126 size of the output cache (maximum number of entries to hold in
1127 memory). The default is 1000, you can change it permanently in your
1127 memory). The default is 1000, you can change it permanently in your
1128 config file. Setting it to 0 completely disables the caching system,
1128 config file. Setting it to 0 completely disables the caching system,
1129 and the minimum value accepted is 20 (if you provide a value less than
1129 and the minimum value accepted is 20 (if you provide a value less than
1130 20, it is reset to 0 and a warning is issued) This limit is defined
1130 20, it is reset to 0 and a warning is issued) This limit is defined
1131 because otherwise you'll spend more time re-flushing a too small cache
1131 because otherwise you'll spend more time re-flushing a too small cache
1132 than working.
1132 than working.
1133
1133
1134 -classic, cl
1134 -classic, cl
1135 Gives IPython a similar feel to the classic Python
1135 Gives IPython a similar feel to the classic Python
1136 prompt.
1136 prompt.
1137
1137
1138 -colors <scheme>
1138 -colors <scheme>
1139 Color scheme for prompts and exception reporting. Currently
1139 Color scheme for prompts and exception reporting. Currently
1140 implemented: NoColor, Linux and LightBG.
1140 implemented: NoColor, Linux and LightBG.
1141
1141
1142 -[no]color_info
1142 -[no]color_info
1143 IPython can display information about objects via a set of functions,
1143 IPython can display information about objects via a set of functions,
1144 and optionally can use colors for this, syntax highlighting source
1144 and optionally can use colors for this, syntax highlighting source
1145 code and various other elements. However, because this information is
1145 code and various other elements. However, because this information is
1146 passed through a pager (like 'less') and many pagers get confused with
1146 passed through a pager (like 'less') and many pagers get confused with
1147 color codes, this option is off by default. You can test it and turn
1147 color codes, this option is off by default. You can test it and turn
1148 it on permanently in your ipythonrc file if it works for you. As a
1148 it on permanently in your ipythonrc file if it works for you. As a
1149 reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
1149 reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
1150 that in RedHat 7.2 doesn't.
1150 that in RedHat 7.2 doesn't.
1151
1151
1152 Test it and turn it on permanently if it works with your
1152 Test it and turn it on permanently if it works with your
1153 system. The magic function %color_info allows you to toggle this
1153 system. The magic function %color_info allows you to toggle this
1154 interactively for testing.
1154 interactively for testing.
1155
1155
1156 -[no]debug
1156 -[no]debug
1157 Show information about the loading process. Very useful to pin down
1157 Show information about the loading process. Very useful to pin down
1158 problems with your configuration files or to get details about
1158 problems with your configuration files or to get details about
1159 session restores.
1159 session restores.
1160
1160
1161 -[no]deep_reload:
1161 -[no]deep_reload:
1162 IPython can use the deep_reload module which reloads changes in
1162 IPython can use the deep_reload module which reloads changes in
1163 modules recursively (it replaces the reload() function, so you don't
1163 modules recursively (it replaces the reload() function, so you don't
1164 need to change anything to use it). deep_reload() forces a full
1164 need to change anything to use it). deep_reload() forces a full
1165 reload of modules whose code may have changed, which the default
1165 reload of modules whose code may have changed, which the default
1166 reload() function does not.
1166 reload() function does not.
1167
1167
1168 When deep_reload is off, IPython will use the normal reload(),
1168 When deep_reload is off, IPython will use the normal reload(),
1169 but deep_reload will still be available as dreload(). This
1169 but deep_reload will still be available as dreload(). This
1170 feature is off by default [which means that you have both
1170 feature is off by default [which means that you have both
1171 normal reload() and dreload()].
1171 normal reload() and dreload()].
1172
1172
1173 -editor <name>
1173 -editor <name>
1174 Which editor to use with the %edit command. By default,
1174 Which editor to use with the %edit command. By default,
1175 IPython will honor your EDITOR environment variable (if not
1175 IPython will honor your EDITOR environment variable (if not
1176 set, vi is the Unix default and notepad the Windows one).
1176 set, vi is the Unix default and notepad the Windows one).
1177 Since this editor is invoked on the fly by IPython and is
1177 Since this editor is invoked on the fly by IPython and is
1178 meant for editing small code snippets, you may want to use a
1178 meant for editing small code snippets, you may want to use a
1179 small, lightweight editor here (in case your default EDITOR is
1179 small, lightweight editor here (in case your default EDITOR is
1180 something like Emacs).
1180 something like Emacs).
1181
1181
1182 -ipythondir <name>
1182 -ipythondir <name>
1183 name of your IPython configuration directory IPYTHONDIR. This
1183 name of your IPython configuration directory IPYTHONDIR. This
1184 can also be specified through the environment variable
1184 can also be specified through the environment variable
1185 IPYTHONDIR.
1185 IPYTHONDIR.
1186
1186
1187 -log, l
1187 -log, l
1188 generate a log file of all input. The file is named
1188 generate a log file of all input. The file is named
1189 ipython_log.py in your current directory (which prevents logs
1189 ipython_log.py in your current directory (which prevents logs
1190 from multiple IPython sessions from trampling each other). You
1190 from multiple IPython sessions from trampling each other). You
1191 can use this to later restore a session by loading your
1191 can use this to later restore a session by loading your
1192 logfile as a file to be executed with option -logplay (see
1192 logfile as a file to be executed with option -logplay (see
1193 below).
1193 below).
1194
1194
1195 -logfile, lf <name> specify the name of your logfile.
1195 -logfile, lf <name> specify the name of your logfile.
1196
1196
1197 -logplay, lp <name>
1197 -logplay, lp <name>
1198
1198
1199 you can replay a previous log. For restoring a session as close as
1199 you can replay a previous log. For restoring a session as close as
1200 possible to the state you left it in, use this option (don't just run
1200 possible to the state you left it in, use this option (don't just run
1201 the logfile). With -logplay, IPython will try to reconstruct the
1201 the logfile). With -logplay, IPython will try to reconstruct the
1202 previous working environment in full, not just execute the commands in
1202 previous working environment in full, not just execute the commands in
1203 the logfile.
1203 the logfile.
1204
1204
1205 When a session is restored, logging is automatically turned on
1205 When a session is restored, logging is automatically turned on
1206 again with the name of the logfile it was invoked with (it is
1206 again with the name of the logfile it was invoked with (it is
1207 read from the log header). So once you've turned logging on for
1207 read from the log header). So once you've turned logging on for
1208 a session, you can quit IPython and reload it as many times as
1208 a session, you can quit IPython and reload it as many times as
1209 you want and it will continue to log its history and restore
1209 you want and it will continue to log its history and restore
1210 from the beginning every time.
1210 from the beginning every time.
1211
1211
1212 Caveats: there are limitations in this option. The history
1212 Caveats: there are limitations in this option. The history
1213 variables _i*,_* and _dh don't get restored properly. In the
1213 variables _i*,_* and _dh don't get restored properly. In the
1214 future we will try to implement full session saving by writing
1214 future we will try to implement full session saving by writing
1215 and retrieving a 'snapshot' of the memory state of IPython. But
1215 and retrieving a 'snapshot' of the memory state of IPython. But
1216 our first attempts failed because of inherent limitations of
1216 our first attempts failed because of inherent limitations of
1217 Python's Pickle module, so this may have to wait.
1217 Python's Pickle module, so this may have to wait.
1218
1218
1219 -[no]messages
1219 -[no]messages
1220 Print messages which IPython collects about its startup
1220 Print messages which IPython collects about its startup
1221 process (default on).
1221 process (default on).
1222
1222
1223 -[no]pdb
1223 -[no]pdb
1224 Automatically call the pdb debugger after every uncaught
1224 Automatically call the pdb debugger after every uncaught
1225 exception. If you are used to debugging using pdb, this puts
1225 exception. If you are used to debugging using pdb, this puts
1226 you automatically inside of it after any call (either in
1226 you automatically inside of it after any call (either in
1227 IPython or in code called by it) which triggers an exception
1227 IPython or in code called by it) which triggers an exception
1228 which goes uncaught.
1228 which goes uncaught.
1229
1229
1230 -pydb
1231 Makes IPython use the third party "pydb" package as debugger,
1232 instead of pdb. Requires that pydb is installed.
1233
1230 -[no]pprint
1234 -[no]pprint
1231 ipython can optionally use the pprint (pretty printer) module
1235 ipython can optionally use the pprint (pretty printer) module
1232 for displaying results. pprint tends to give a nicer display
1236 for displaying results. pprint tends to give a nicer display
1233 of nested data structures. If you like it, you can turn it on
1237 of nested data structures. If you like it, you can turn it on
1234 permanently in your config file (default off).
1238 permanently in your config file (default off).
1235
1239
1236 -profile, p <name>
1240 -profile, p <name>
1237
1241
1238 assume that your config file is ipythonrc-<name> or
1242 assume that your config file is ipythonrc-<name> or
1239 ipy_profile_<name>.py (looks in current dir first, then in
1243 ipy_profile_<name>.py (looks in current dir first, then in
1240 IPYTHONDIR). This is a quick way to keep and load multiple
1244 IPYTHONDIR). This is a quick way to keep and load multiple
1241 config files for different tasks, especially if you use the
1245 config files for different tasks, especially if you use the
1242 include option of config files. You can keep a basic
1246 include option of config files. You can keep a basic
1243 IPYTHONDIR/ipythonrc file and then have other 'profiles' which
1247 IPYTHONDIR/ipythonrc file and then have other 'profiles' which
1244 include this one and load extra things for particular
1248 include this one and load extra things for particular
1245 tasks. For example:
1249 tasks. For example:
1246
1250
1247 1. $HOME/.ipython/ipythonrc : load basic things you always want.
1251 1. $HOME/.ipython/ipythonrc : load basic things you always want.
1248 2. $HOME/.ipython/ipythonrc-math : load (1) and basic math-related modules.
1252 2. $HOME/.ipython/ipythonrc-math : load (1) and basic math-related modules.
1249 3. $HOME/.ipython/ipythonrc-numeric : load (1) and Numeric and plotting modules.
1253 3. $HOME/.ipython/ipythonrc-numeric : load (1) and Numeric and plotting modules.
1250
1254
1251 Since it is possible to create an endless loop by having
1255 Since it is possible to create an endless loop by having
1252 circular file inclusions, IPython will stop if it reaches 15
1256 circular file inclusions, IPython will stop if it reaches 15
1253 recursive inclusions.
1257 recursive inclusions.
1254
1258
1255 -prompt_in1, pi1 <string>
1259 -prompt_in1, pi1 <string>
1256 Specify the string used for input prompts. Note that if you
1260 Specify the string used for input prompts. Note that if you
1257 are using numbered prompts, the number is represented with a
1261 are using numbered prompts, the number is represented with a
1258 '\#' in the string. Don't forget to quote strings with spaces
1262 '\#' in the string. Don't forget to quote strings with spaces
1259 embedded in them. Default: 'In [\#]:'. Sec. Prompts_
1263 embedded in them. Default: 'In [\#]:'. Sec. Prompts_
1260 discusses in detail all the available escapes to customize
1264 discusses in detail all the available escapes to customize
1261 your prompts.
1265 your prompts.
1262
1266
1263 -prompt_in2, pi2 <string>
1267 -prompt_in2, pi2 <string>
1264 Similar to the previous option, but used for the continuation
1268 Similar to the previous option, but used for the continuation
1265 prompts. The special sequence '\D' is similar to '\#', but
1269 prompts. The special sequence '\D' is similar to '\#', but
1266 with all digits replaced dots (so you can have your
1270 with all digits replaced dots (so you can have your
1267 continuation prompt aligned with your input prompt). Default:
1271 continuation prompt aligned with your input prompt). Default:
1268 ' .\D.:' (note three spaces at the start for alignment with
1272 ' .\D.:' (note three spaces at the start for alignment with
1269 'In [\#]').
1273 'In [\#]').
1270
1274
1271 -prompt_out,po <string>
1275 -prompt_out,po <string>
1272 String used for output prompts, also uses numbers like
1276 String used for output prompts, also uses numbers like
1273 prompt_in1. Default: 'Out[\#]:'
1277 prompt_in1. Default: 'Out[\#]:'
1274
1278
1275 -quick start in bare bones mode (no config file loaded).
1279 -quick start in bare bones mode (no config file loaded).
1276
1280
1277 -rcfile <name>
1281 -rcfile <name>
1278 name of your IPython resource configuration file. Normally
1282 name of your IPython resource configuration file. Normally
1279 IPython loads ipythonrc (from current directory) or
1283 IPython loads ipythonrc (from current directory) or
1280 IPYTHONDIR/ipythonrc.
1284 IPYTHONDIR/ipythonrc.
1281
1285
1282 If the loading of your config file fails, IPython starts with
1286 If the loading of your config file fails, IPython starts with
1283 a bare bones configuration (no modules loaded at all).
1287 a bare bones configuration (no modules loaded at all).
1284
1288
1285 -[no]readline
1289 -[no]readline
1286 use the readline library, which is needed to support name
1290 use the readline library, which is needed to support name
1287 completion and command history, among other things. It is
1291 completion and command history, among other things. It is
1288 enabled by default, but may cause problems for users of
1292 enabled by default, but may cause problems for users of
1289 X/Emacs in Python comint or shell buffers.
1293 X/Emacs in Python comint or shell buffers.
1290
1294
1291 Note that X/Emacs 'eterm' buffers (opened with M-x term) support
1295 Note that X/Emacs 'eterm' buffers (opened with M-x term) support
1292 IPython's readline and syntax coloring fine, only 'emacs' (M-x
1296 IPython's readline and syntax coloring fine, only 'emacs' (M-x
1293 shell and C-c !) buffers do not.
1297 shell and C-c !) buffers do not.
1294
1298
1295 -screen_length, sl <n>
1299 -screen_length, sl <n>
1296 number of lines of your screen. This is used to control
1300 number of lines of your screen. This is used to control
1297 printing of very long strings. Strings longer than this number
1301 printing of very long strings. Strings longer than this number
1298 of lines will be sent through a pager instead of directly
1302 of lines will be sent through a pager instead of directly
1299 printed.
1303 printed.
1300
1304
1301 The default value for this is 0, which means IPython will
1305 The default value for this is 0, which means IPython will
1302 auto-detect your screen size every time it needs to print certain
1306 auto-detect your screen size every time it needs to print certain
1303 potentially long strings (this doesn't change the behavior of the
1307 potentially long strings (this doesn't change the behavior of the
1304 'print' keyword, it's only triggered internally). If for some
1308 'print' keyword, it's only triggered internally). If for some
1305 reason this isn't working well (it needs curses support), specify
1309 reason this isn't working well (it needs curses support), specify
1306 it yourself. Otherwise don't change the default.
1310 it yourself. Otherwise don't change the default.
1307
1311
1308 -separate_in, si <string>
1312 -separate_in, si <string>
1309
1313
1310 separator before input prompts.
1314 separator before input prompts.
1311 Default: '\n'
1315 Default: '\n'
1312
1316
1313 -separate_out, so <string>
1317 -separate_out, so <string>
1314 separator before output prompts.
1318 separator before output prompts.
1315 Default: nothing.
1319 Default: nothing.
1316
1320
1317 -separate_out2, so2
1321 -separate_out2, so2
1318 separator after output prompts.
1322 separator after output prompts.
1319 Default: nothing.
1323 Default: nothing.
1320 For these three options, use the value 0 to specify no separator.
1324 For these three options, use the value 0 to specify no separator.
1321
1325
1322 -nosep
1326 -nosep
1323 shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2
1327 shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2
1324 0'. Simply removes all input/output separators.
1328 0'. Simply removes all input/output separators.
1325
1329
1326 -upgrade
1330 -upgrade
1327 allows you to upgrade your IPYTHONDIR configuration when you
1331 allows you to upgrade your IPYTHONDIR configuration when you
1328 install a new version of IPython. Since new versions may
1332 install a new version of IPython. Since new versions may
1329 include new command line options or example files, this copies
1333 include new command line options or example files, this copies
1330 updated ipythonrc-type files. However, it backs up (with a
1334 updated ipythonrc-type files. However, it backs up (with a
1331 .old extension) all files which it overwrites so that you can
1335 .old extension) all files which it overwrites so that you can
1332 merge back any customizations you might have in your personal
1336 merge back any customizations you might have in your personal
1333 files. Note that you should probably use %upgrade instead,
1337 files. Note that you should probably use %upgrade instead,
1334 it's a safer alternative.
1338 it's a safer alternative.
1335
1339
1336
1340
1337 -Version print version information and exit.
1341 -Version print version information and exit.
1338
1342
1339 -wxversion <string>
1343 -wxversion <string>
1340 Select a specific version of wxPython (used in conjunction
1344 Select a specific version of wxPython (used in conjunction
1341 with -wthread). Requires the wxversion module, part of recent
1345 with -wthread). Requires the wxversion module, part of recent
1342 wxPython distributions
1346 wxPython distributions
1343
1347
1344 -xmode <modename>
1348 -xmode <modename>
1345
1349
1346 Mode for exception reporting.
1350 Mode for exception reporting.
1347
1351
1348 Valid modes: Plain, Context and Verbose.
1352 Valid modes: Plain, Context and Verbose.
1349
1353
1350 * Plain: similar to python's normal traceback printing.
1354 * Plain: similar to python's normal traceback printing.
1351 * Context: prints 5 lines of context source code around each
1355 * Context: prints 5 lines of context source code around each
1352 line in the traceback.
1356 line in the traceback.
1353 * Verbose: similar to Context, but additionally prints the
1357 * Verbose: similar to Context, but additionally prints the
1354 variables currently visible where the exception happened
1358 variables currently visible where the exception happened
1355 (shortening their strings if too long). This can potentially be
1359 (shortening their strings if too long). This can potentially be
1356 very slow, if you happen to have a huge data structure whose
1360 very slow, if you happen to have a huge data structure whose
1357 string representation is complex to compute. Your computer may
1361 string representation is complex to compute. Your computer may
1358 appear to freeze for a while with cpu usage at 100%. If this
1362 appear to freeze for a while with cpu usage at 100%. If this
1359 occurs, you can cancel the traceback with Ctrl-C (maybe hitting it
1363 occurs, you can cancel the traceback with Ctrl-C (maybe hitting it
1360 more than once).
1364 more than once).
1361
1365
1362 Interactive use
1366 Interactive use
1363 ===============
1367 ===============
1364
1368
1365 Warning: IPython relies on the existence of a global variable called
1369 Warning: IPython relies on the existence of a global variable called
1366 _ip which controls the shell itself. If you redefine _ip to anything,
1370 _ip which controls the shell itself. If you redefine _ip to anything,
1367 bizarre behavior will quickly occur.
1371 bizarre behavior will quickly occur.
1368
1372
1369 Other than the above warning, IPython is meant to work as a drop-in
1373 Other than the above warning, IPython is meant to work as a drop-in
1370 replacement for the standard interactive interpreter. As such, any code
1374 replacement for the standard interactive interpreter. As such, any code
1371 which is valid python should execute normally under IPython (cases where
1375 which is valid python should execute normally under IPython (cases where
1372 this is not true should be reported as bugs). It does, however, offer
1376 this is not true should be reported as bugs). It does, however, offer
1373 many features which are not available at a standard python prompt. What
1377 many features which are not available at a standard python prompt. What
1374 follows is a list of these.
1378 follows is a list of these.
1375
1379
1376
1380
1377 Caution for Windows users
1381 Caution for Windows users
1378 -------------------------
1382 -------------------------
1379
1383
1380 Windows, unfortunately, uses the '\' character as a path
1384 Windows, unfortunately, uses the '\' character as a path
1381 separator. This is a terrible choice, because '\' also represents the
1385 separator. This is a terrible choice, because '\' also represents the
1382 escape character in most modern programming languages, including
1386 escape character in most modern programming languages, including
1383 Python. For this reason, using '/' character is recommended if you
1387 Python. For this reason, using '/' character is recommended if you
1384 have problems with ``\``. However, in Windows commands '/' flags
1388 have problems with ``\``. However, in Windows commands '/' flags
1385 options, so you can not use it for the root directory. This means that
1389 options, so you can not use it for the root directory. This means that
1386 paths beginning at the root must be typed in a contrived manner like:
1390 paths beginning at the root must be typed in a contrived manner like:
1387 ``%copy \opt/foo/bar.txt \tmp``
1391 ``%copy \opt/foo/bar.txt \tmp``
1388
1392
1389 .. _magic:
1393 .. _magic:
1390
1394
1391 Magic command system
1395 Magic command system
1392 --------------------
1396 --------------------
1393
1397
1394 IPython will treat any line whose first character is a % as a special
1398 IPython will treat any line whose first character is a % as a special
1395 call to a 'magic' function. These allow you to control the behavior of
1399 call to a 'magic' function. These allow you to control the behavior of
1396 IPython itself, plus a lot of system-type features. They are all
1400 IPython itself, plus a lot of system-type features. They are all
1397 prefixed with a % character, but parameters are given without
1401 prefixed with a % character, but parameters are given without
1398 parentheses or quotes.
1402 parentheses or quotes.
1399
1403
1400 Example: typing '%cd mydir' (without the quotes) changes you working
1404 Example: typing '%cd mydir' (without the quotes) changes you working
1401 directory to 'mydir', if it exists.
1405 directory to 'mydir', if it exists.
1402
1406
1403 If you have 'automagic' enabled (in your ipythonrc file, via the command
1407 If you have 'automagic' enabled (in your ipythonrc file, via the command
1404 line option -automagic or with the %automagic function), you don't need
1408 line option -automagic or with the %automagic function), you don't need
1405 to type in the % explicitly. IPython will scan its internal list of
1409 to type in the % explicitly. IPython will scan its internal list of
1406 magic functions and call one if it exists. With automagic on you can
1410 magic functions and call one if it exists. With automagic on you can
1407 then just type 'cd mydir' to go to directory 'mydir'. The automagic
1411 then just type 'cd mydir' to go to directory 'mydir'. The automagic
1408 system has the lowest possible precedence in name searches, so defining
1412 system has the lowest possible precedence in name searches, so defining
1409 an identifier with the same name as an existing magic function will
1413 an identifier with the same name as an existing magic function will
1410 shadow it for automagic use. You can still access the shadowed magic
1414 shadow it for automagic use. You can still access the shadowed magic
1411 function by explicitly using the % character at the beginning of the line.
1415 function by explicitly using the % character at the beginning of the line.
1412
1416
1413 An example (with automagic on) should clarify all this::
1417 An example (with automagic on) should clarify all this::
1414
1418
1415 In [1]: cd ipython # %cd is called by automagic
1419 In [1]: cd ipython # %cd is called by automagic
1416
1420
1417 /home/fperez/ipython
1421 /home/fperez/ipython
1418
1422
1419 In [2]: cd=1 # now cd is just a variable
1423 In [2]: cd=1 # now cd is just a variable
1420
1424
1421 In [3]: cd .. # and doesn't work as a function anymore
1425 In [3]: cd .. # and doesn't work as a function anymore
1422
1426
1423 ------------------------------
1427 ------------------------------
1424
1428
1425 File "<console>", line 1
1429 File "<console>", line 1
1426
1430
1427 cd ..
1431 cd ..
1428
1432
1429 ^
1433 ^
1430
1434
1431 SyntaxError: invalid syntax
1435 SyntaxError: invalid syntax
1432
1436
1433 In [4]: %cd .. # but %cd always works
1437 In [4]: %cd .. # but %cd always works
1434
1438
1435 /home/fperez
1439 /home/fperez
1436
1440
1437 In [5]: del cd # if you remove the cd variable
1441 In [5]: del cd # if you remove the cd variable
1438
1442
1439 In [6]: cd ipython # automagic can work again
1443 In [6]: cd ipython # automagic can work again
1440
1444
1441 /home/fperez/ipython
1445 /home/fperez/ipython
1442
1446
1443 You can define your own magic functions to extend the system. The
1447 You can define your own magic functions to extend the system. The
1444 following example defines a new magic command, %impall::
1448 following example defines a new magic command, %impall::
1445
1449
1446 import IPython.ipapi
1450 import IPython.ipapi
1447
1451
1448 ip = IPython.ipapi.get()
1452 ip = IPython.ipapi.get()
1449
1453
1450 def doimp(self, arg):
1454 def doimp(self, arg):
1451
1455
1452 ip = self.api
1456 ip = self.api
1453
1457
1454 ip.ex("import %s; reload(%s); from %s import *" % (
1458 ip.ex("import %s; reload(%s); from %s import *" % (
1455
1459
1456 arg,arg,arg)
1460 arg,arg,arg)
1457
1461
1458 )
1462 )
1459
1463
1460 ip.expose_magic('impall', doimp)
1464 ip.expose_magic('impall', doimp)
1461
1465
1462 You can also define your own aliased names for magic functions. In your
1466 You can also define your own aliased names for magic functions. In your
1463 ipythonrc file, placing a line like:
1467 ipythonrc file, placing a line like:
1464
1468
1465 execute __IP.magic_cl = __IP.magic_clear
1469 execute __IP.magic_cl = __IP.magic_clear
1466
1470
1467 will define %cl as a new name for %clear.
1471 will define %cl as a new name for %clear.
1468
1472
1469 Type %magic for more information, including a list of all available
1473 Type %magic for more information, including a list of all available
1470 magic functions at any time and their docstrings. You can also type
1474 magic functions at any time and their docstrings. You can also type
1471 %magic_function_name? (see sec. 6.4 <#sec:dyn-object-info> for
1475 %magic_function_name? (see sec. 6.4 <#sec:dyn-object-info> for
1472 information on the '?' system) to get information about any particular
1476 information on the '?' system) to get information about any particular
1473 magic function you are interested in.
1477 magic function you are interested in.
1474
1478
1475
1479
1476 Magic commands
1480 Magic commands
1477 --------------
1481 --------------
1478
1482
1479 The rest of this section is automatically generated for each release
1483 The rest of this section is automatically generated for each release
1480 from the docstrings in the IPython code. Therefore the formatting is
1484 from the docstrings in the IPython code. Therefore the formatting is
1481 somewhat minimal, but this method has the advantage of having
1485 somewhat minimal, but this method has the advantage of having
1482 information always in sync with the code.
1486 information always in sync with the code.
1483
1487
1484 A list of all the magic commands available in IPython's default
1488 A list of all the magic commands available in IPython's default
1485 installation follows. This is similar to what you'll see by simply
1489 installation follows. This is similar to what you'll see by simply
1486 typing %magic at the prompt, but that will also give you information
1490 typing %magic at the prompt, but that will also give you information
1487 about magic commands you may have added as part of your personal
1491 about magic commands you may have added as part of your personal
1488 customizations.
1492 customizations.
1489
1493
1490 .. magic_start
1494 .. magic_start
1491
1495
1492 **%Exit**::
1496 **%Exit**::
1493
1497
1494 Exit IPython without confirmation.
1498 Exit IPython without confirmation.
1495
1499
1496 **%Pprint**::
1500 **%Pprint**::
1497
1501
1498 Toggle pretty printing on/off.
1502 Toggle pretty printing on/off.
1499
1503
1500 **%alias**::
1504 **%alias**::
1501
1505
1502 Define an alias for a system command.
1506 Define an alias for a system command.
1503
1507
1504 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
1508 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
1505
1509
1506 Then, typing 'alias_name params' will execute the system command 'cmd
1510 Then, typing 'alias_name params' will execute the system command 'cmd
1507 params' (from your underlying operating system).
1511 params' (from your underlying operating system).
1508
1512
1509 Aliases have lower precedence than magic functions and Python normal
1513 Aliases have lower precedence than magic functions and Python normal
1510 variables, so if 'foo' is both a Python variable and an alias, the
1514 variables, so if 'foo' is both a Python variable and an alias, the
1511 alias can not be executed until 'del foo' removes the Python variable.
1515 alias can not be executed until 'del foo' removes the Python variable.
1512
1516
1513 You can use the %l specifier in an alias definition to represent the
1517 You can use the %l specifier in an alias definition to represent the
1514 whole line when the alias is called. For example:
1518 whole line when the alias is called. For example:
1515
1519
1516 In [2]: alias all echo "Input in brackets: <%l>"\
1520 In [2]: alias all echo "Input in brackets: <%l>"\
1517 In [3]: all hello world\
1521 In [3]: all hello world\
1518 Input in brackets: <hello world>
1522 Input in brackets: <hello world>
1519
1523
1520 You can also define aliases with parameters using %s specifiers (one
1524 You can also define aliases with parameters using %s specifiers (one
1521 per parameter):
1525 per parameter):
1522
1526
1523 In [1]: alias parts echo first %s second %s\
1527 In [1]: alias parts echo first %s second %s\
1524 In [2]: %parts A B\
1528 In [2]: %parts A B\
1525 first A second B\
1529 first A second B\
1526 In [3]: %parts A\
1530 In [3]: %parts A\
1527 Incorrect number of arguments: 2 expected.\
1531 Incorrect number of arguments: 2 expected.\
1528 parts is an alias to: 'echo first %s second %s'
1532 parts is an alias to: 'echo first %s second %s'
1529
1533
1530 Note that %l and %s are mutually exclusive. You can only use one or
1534 Note that %l and %s are mutually exclusive. You can only use one or
1531 the other in your aliases.
1535 the other in your aliases.
1532
1536
1533 Aliases expand Python variables just like system calls using ! or !!
1537 Aliases expand Python variables just like system calls using ! or !!
1534 do: all expressions prefixed with '$' get expanded. For details of
1538 do: all expressions prefixed with '$' get expanded. For details of
1535 the semantic rules, see PEP-215:
1539 the semantic rules, see PEP-215:
1536 http://www.python.org/peps/pep-0215.html. This is the library used by
1540 http://www.python.org/peps/pep-0215.html. This is the library used by
1537 IPython for variable expansion. If you want to access a true shell
1541 IPython for variable expansion. If you want to access a true shell
1538 variable, an extra $ is necessary to prevent its expansion by IPython:
1542 variable, an extra $ is necessary to prevent its expansion by IPython:
1539
1543
1540 In [6]: alias show echo\
1544 In [6]: alias show echo\
1541 In [7]: PATH='A Python string'\
1545 In [7]: PATH='A Python string'\
1542 In [8]: show $PATH\
1546 In [8]: show $PATH\
1543 A Python string\
1547 A Python string\
1544 In [9]: show $$PATH\
1548 In [9]: show $$PATH\
1545 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
1549 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
1546
1550
1547 You can use the alias facility to acess all of $PATH. See the %rehash
1551 You can use the alias facility to acess all of $PATH. See the %rehash
1548 and %rehashx functions, which automatically create aliases for the
1552 and %rehashx functions, which automatically create aliases for the
1549 contents of your $PATH.
1553 contents of your $PATH.
1550
1554
1551 If called with no parameters, %alias prints the current alias table.
1555 If called with no parameters, %alias prints the current alias table.
1552
1556
1553 **%autocall**::
1557 **%autocall**::
1554
1558
1555 Make functions callable without having to type parentheses.
1559 Make functions callable without having to type parentheses.
1556
1560
1557 Usage:
1561 Usage:
1558
1562
1559 %autocall [mode]
1563 %autocall [mode]
1560
1564
1561 The mode can be one of: 0->Off, 1->Smart, 2->Full. If not given, the
1565 The mode can be one of: 0->Off, 1->Smart, 2->Full. If not given, the
1562 value is toggled on and off (remembering the previous state).
1566 value is toggled on and off (remembering the previous state).
1563
1567
1564 In more detail, these values mean:
1568 In more detail, these values mean:
1565
1569
1566 0 -> fully disabled
1570 0 -> fully disabled
1567
1571
1568 1 -> active, but do not apply if there are no arguments on the line.
1572 1 -> active, but do not apply if there are no arguments on the line.
1569
1573
1570 In this mode, you get:
1574 In this mode, you get:
1571
1575
1572 In [1]: callable
1576 In [1]: callable
1573 Out[1]: <built-in function callable>
1577 Out[1]: <built-in function callable>
1574
1578
1575 In [2]: callable 'hello'
1579 In [2]: callable 'hello'
1576 ------> callable('hello')
1580 ------> callable('hello')
1577 Out[2]: False
1581 Out[2]: False
1578
1582
1579 2 -> Active always. Even if no arguments are present, the callable
1583 2 -> Active always. Even if no arguments are present, the callable
1580 object is called:
1584 object is called:
1581
1585
1582 In [4]: callable
1586 In [4]: callable
1583 ------> callable()
1587 ------> callable()
1584
1588
1585 Note that even with autocall off, you can still use '/' at the start of
1589 Note that even with autocall off, you can still use '/' at the start of
1586 a line to treat the first argument on the command line as a function
1590 a line to treat the first argument on the command line as a function
1587 and add parentheses to it:
1591 and add parentheses to it:
1588
1592
1589 In [8]: /str 43
1593 In [8]: /str 43
1590 ------> str(43)
1594 ------> str(43)
1591 Out[8]: '43'
1595 Out[8]: '43'
1592
1596
1593 **%autoindent**::
1597 **%autoindent**::
1594
1598
1595 Toggle autoindent on/off (if available).
1599 Toggle autoindent on/off (if available).
1596
1600
1597 **%automagic**::
1601 **%automagic**::
1598
1602
1599 Make magic functions callable without having to type the initial %.
1603 Make magic functions callable without having to type the initial %.
1600
1604
1601 Without argumentsl toggles on/off (when off, you must call it as
1605 Without argumentsl toggles on/off (when off, you must call it as
1602 %automagic, of course). With arguments it sets the value, and you can
1606 %automagic, of course). With arguments it sets the value, and you can
1603 use any of (case insensitive):
1607 use any of (case insensitive):
1604
1608
1605 - on,1,True: to activate
1609 - on,1,True: to activate
1606
1610
1607 - off,0,False: to deactivate.
1611 - off,0,False: to deactivate.
1608
1612
1609 Note that magic functions have lowest priority, so if there's a
1613 Note that magic functions have lowest priority, so if there's a
1610 variable whose name collides with that of a magic fn, automagic won't
1614 variable whose name collides with that of a magic fn, automagic won't
1611 work for that function (you get the variable instead). However, if you
1615 work for that function (you get the variable instead). However, if you
1612 delete the variable (del var), the previously shadowed magic function
1616 delete the variable (del var), the previously shadowed magic function
1613 becomes visible to automagic again.
1617 becomes visible to automagic again.
1614
1618
1615 **%bg**::
1619 **%bg**::
1616
1620
1617 Run a job in the background, in a separate thread.
1621 Run a job in the background, in a separate thread.
1618
1622
1619 For example,
1623 For example,
1620
1624
1621 %bg myfunc(x,y,z=1)
1625 %bg myfunc(x,y,z=1)
1622
1626
1623 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
1627 will execute 'myfunc(x,y,z=1)' in a background thread. As soon as the
1624 execution starts, a message will be printed indicating the job
1628 execution starts, a message will be printed indicating the job
1625 number. If your job number is 5, you can use
1629 number. If your job number is 5, you can use
1626
1630
1627 myvar = jobs.result(5) or myvar = jobs[5].result
1631 myvar = jobs.result(5) or myvar = jobs[5].result
1628
1632
1629 to assign this result to variable 'myvar'.
1633 to assign this result to variable 'myvar'.
1630
1634
1631 IPython has a job manager, accessible via the 'jobs' object. You can
1635 IPython has a job manager, accessible via the 'jobs' object. You can
1632 type jobs? to get more information about it, and use jobs.<TAB> to see
1636 type jobs? to get more information about it, and use jobs.<TAB> to see
1633 its attributes. All attributes not starting with an underscore are
1637 its attributes. All attributes not starting with an underscore are
1634 meant for public use.
1638 meant for public use.
1635
1639
1636 In particular, look at the jobs.new() method, which is used to create
1640 In particular, look at the jobs.new() method, which is used to create
1637 new jobs. This magic %bg function is just a convenience wrapper
1641 new jobs. This magic %bg function is just a convenience wrapper
1638 around jobs.new(), for expression-based jobs. If you want to create a
1642 around jobs.new(), for expression-based jobs. If you want to create a
1639 new job with an explicit function object and arguments, you must call
1643 new job with an explicit function object and arguments, you must call
1640 jobs.new() directly.
1644 jobs.new() directly.
1641
1645
1642 The jobs.new docstring also describes in detail several important
1646 The jobs.new docstring also describes in detail several important
1643 caveats associated with a thread-based model for background job
1647 caveats associated with a thread-based model for background job
1644 execution. Type jobs.new? for details.
1648 execution. Type jobs.new? for details.
1645
1649
1646 You can check the status of all jobs with jobs.status().
1650 You can check the status of all jobs with jobs.status().
1647
1651
1648 The jobs variable is set by IPython into the Python builtin namespace.
1652 The jobs variable is set by IPython into the Python builtin namespace.
1649 If you ever declare a variable named 'jobs', you will shadow this
1653 If you ever declare a variable named 'jobs', you will shadow this
1650 name. You can either delete your global jobs variable to regain
1654 name. You can either delete your global jobs variable to regain
1651 access to the job manager, or make a new name and assign it manually
1655 access to the job manager, or make a new name and assign it manually
1652 to the manager (stored in IPython's namespace). For example, to
1656 to the manager (stored in IPython's namespace). For example, to
1653 assign the job manager to the Jobs name, use:
1657 assign the job manager to the Jobs name, use:
1654
1658
1655 Jobs = __builtins__.jobs
1659 Jobs = __builtins__.jobs
1656
1660
1657 **%bookmark**::
1661 **%bookmark**::
1658
1662
1659 Manage IPython's bookmark system.
1663 Manage IPython's bookmark system.
1660
1664
1661 %bookmark <name> - set bookmark to current dir
1665 %bookmark <name> - set bookmark to current dir
1662 %bookmark <name> <dir> - set bookmark to <dir>
1666 %bookmark <name> <dir> - set bookmark to <dir>
1663 %bookmark -l - list all bookmarks
1667 %bookmark -l - list all bookmarks
1664 %bookmark -d <name> - remove bookmark
1668 %bookmark -d <name> - remove bookmark
1665 %bookmark -r - remove all bookmarks
1669 %bookmark -r - remove all bookmarks
1666
1670
1667 You can later on access a bookmarked folder with:
1671 You can later on access a bookmarked folder with:
1668 %cd -b <name>
1672 %cd -b <name>
1669 or simply '%cd <name>' if there is no directory called <name> AND
1673 or simply '%cd <name>' if there is no directory called <name> AND
1670 there is such a bookmark defined.
1674 there is such a bookmark defined.
1671
1675
1672 Your bookmarks persist through IPython sessions, but they are
1676 Your bookmarks persist through IPython sessions, but they are
1673 associated with each profile.
1677 associated with each profile.
1674
1678
1675 **%cd**::
1679 **%cd**::
1676
1680
1677 Change the current working directory.
1681 Change the current working directory.
1678
1682
1679 This command automatically maintains an internal list of directories
1683 This command automatically maintains an internal list of directories
1680 you visit during your IPython session, in the variable _dh. The
1684 you visit during your IPython session, in the variable _dh. The
1681 command %dhist shows this history nicely formatted. You can also
1685 command %dhist shows this history nicely formatted. You can also
1682 do 'cd -<tab>' to see directory history conveniently.
1686 do 'cd -<tab>' to see directory history conveniently.
1683
1687
1684 Usage:
1688 Usage:
1685
1689
1686 cd 'dir': changes to directory 'dir'.
1690 cd 'dir': changes to directory 'dir'.
1687
1691
1688 cd -: changes to the last visited directory.
1692 cd -: changes to the last visited directory.
1689
1693
1690 cd -<n>: changes to the n-th directory in the directory history.
1694 cd -<n>: changes to the n-th directory in the directory history.
1691
1695
1692 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
1696 cd -b <bookmark_name>: jump to a bookmark set by %bookmark
1693 (note: cd <bookmark_name> is enough if there is no
1697 (note: cd <bookmark_name> is enough if there is no
1694 directory <bookmark_name>, but a bookmark with the name exists.)
1698 directory <bookmark_name>, but a bookmark with the name exists.)
1695 'cd -b <tab>' allows you to tab-complete bookmark names.
1699 'cd -b <tab>' allows you to tab-complete bookmark names.
1696
1700
1697 Options:
1701 Options:
1698
1702
1699 -q: quiet. Do not print the working directory after the cd command is
1703 -q: quiet. Do not print the working directory after the cd command is
1700 executed. By default IPython's cd command does print this directory,
1704 executed. By default IPython's cd command does print this directory,
1701 since the default prompts do not display path information.
1705 since the default prompts do not display path information.
1702
1706
1703 Note that !cd doesn't work for this purpose because the shell where
1707 Note that !cd doesn't work for this purpose because the shell where
1704 !command runs is immediately discarded after executing 'command'.
1708 !command runs is immediately discarded after executing 'command'.
1705
1709
1706 **%clear**::
1710 **%clear**::
1707
1711
1708 Clear various data (e.g. stored history data)
1712 Clear various data (e.g. stored history data)
1709
1713
1710 %clear out - clear output history
1714 %clear out - clear output history
1711 %clear in - clear input history
1715 %clear in - clear input history
1712 %clear shadow_compress - Compresses shadow history (to speed up ipython)
1716 %clear shadow_compress - Compresses shadow history (to speed up ipython)
1713 %clear shadow_nuke - permanently erase all entries in shadow history
1717 %clear shadow_nuke - permanently erase all entries in shadow history
1714 %clear dhist - clear dir history
1718 %clear dhist - clear dir history
1715
1719
1716 **%color_info**::
1720 **%color_info**::
1717
1721
1718 Toggle color_info.
1722 Toggle color_info.
1719
1723
1720 The color_info configuration parameter controls whether colors are
1724 The color_info configuration parameter controls whether colors are
1721 used for displaying object details (by things like %psource, %pfile or
1725 used for displaying object details (by things like %psource, %pfile or
1722 the '?' system). This function toggles this value with each call.
1726 the '?' system). This function toggles this value with each call.
1723
1727
1724 Note that unless you have a fairly recent pager (less works better
1728 Note that unless you have a fairly recent pager (less works better
1725 than more) in your system, using colored object information displays
1729 than more) in your system, using colored object information displays
1726 will not work properly. Test it and see.
1730 will not work properly. Test it and see.
1727
1731
1728 **%colors**::
1732 **%colors**::
1729
1733
1730 Switch color scheme for prompts, info system and exception handlers.
1734 Switch color scheme for prompts, info system and exception handlers.
1731
1735
1732 Currently implemented schemes: NoColor, Linux, LightBG.
1736 Currently implemented schemes: NoColor, Linux, LightBG.
1733
1737
1734 Color scheme names are not case-sensitive.
1738 Color scheme names are not case-sensitive.
1735
1739
1736 **%cpaste**::
1740 **%cpaste**::
1737
1741
1738 Allows you to paste & execute a pre-formatted code block from clipboard
1742 Allows you to paste & execute a pre-formatted code block from clipboard
1739
1743
1740 You must terminate the block with '--' (two minus-signs) alone on the
1744 You must terminate the block with '--' (two minus-signs) alone on the
1741 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
1745 line. You can also provide your own sentinel with '%paste -s %%' ('%%'
1742 is the new sentinel for this operation)
1746 is the new sentinel for this operation)
1743
1747
1744 The block is dedented prior to execution to enable execution of method
1748 The block is dedented prior to execution to enable execution of method
1745 definitions. '>' and '+' characters at the beginning of a line are
1749 definitions. '>' and '+' characters at the beginning of a line are
1746 ignored, to allow pasting directly from e-mails or diff files. The
1750 ignored, to allow pasting directly from e-mails or diff files. The
1747 executed block is also assigned to variable named 'pasted_block' for
1751 executed block is also assigned to variable named 'pasted_block' for
1748 later editing with '%edit pasted_block'.
1752 later editing with '%edit pasted_block'.
1749
1753
1750 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
1754 You can also pass a variable name as an argument, e.g. '%cpaste foo'.
1751 This assigns the pasted block to variable 'foo' as string, without
1755 This assigns the pasted block to variable 'foo' as string, without
1752 dedenting or executing it.
1756 dedenting or executing it.
1753
1757
1754 Do not be alarmed by garbled output on Windows (it's a readline bug).
1758 Do not be alarmed by garbled output on Windows (it's a readline bug).
1755 Just press enter and type -- (and press enter again) and the block
1759 Just press enter and type -- (and press enter again) and the block
1756 will be what was just pasted.
1760 will be what was just pasted.
1757
1761
1758 IPython statements (magics, shell escapes) are not supported (yet).
1762 IPython statements (magics, shell escapes) are not supported (yet).
1759
1763
1760 **%debug**::
1764 **%debug**::
1761
1765
1762 Activate the interactive debugger in post-mortem mode.
1766 Activate the interactive debugger in post-mortem mode.
1763
1767
1764 If an exception has just occurred, this lets you inspect its stack
1768 If an exception has just occurred, this lets you inspect its stack
1765 frames interactively. Note that this will always work only on the last
1769 frames interactively. Note that this will always work only on the last
1766 traceback that occurred, so you must call this quickly after an
1770 traceback that occurred, so you must call this quickly after an
1767 exception that you wish to inspect has fired, because if another one
1771 exception that you wish to inspect has fired, because if another one
1768 occurs, it clobbers the previous one.
1772 occurs, it clobbers the previous one.
1769
1773
1770 If you want IPython to automatically do this on every exception, see
1774 If you want IPython to automatically do this on every exception, see
1771 the %pdb magic for more details.
1775 the %pdb magic for more details.
1772
1776
1773 **%dhist**::
1777 **%dhist**::
1774
1778
1775 Print your history of visited directories.
1779 Print your history of visited directories.
1776
1780
1777 %dhist -> print full history\
1781 %dhist -> print full history\
1778 %dhist n -> print last n entries only\
1782 %dhist n -> print last n entries only\
1779 %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\
1783 %dhist n1 n2 -> print entries between n1 and n2 (n1 not included)\
1780
1784
1781 This history is automatically maintained by the %cd command, and
1785 This history is automatically maintained by the %cd command, and
1782 always available as the global list variable _dh. You can use %cd -<n>
1786 always available as the global list variable _dh. You can use %cd -<n>
1783 to go to directory number <n>.
1787 to go to directory number <n>.
1784
1788
1785 Note that most of time, you should view directory history by entering
1789 Note that most of time, you should view directory history by entering
1786 cd -<TAB>.
1790 cd -<TAB>.
1787
1791
1788 **%dirs**::
1792 **%dirs**::
1789
1793
1790 Return the current directory stack.
1794 Return the current directory stack.
1791
1795
1792 **%doctest_mode**::
1796 **%doctest_mode**::
1793
1797
1794 Toggle doctest mode on and off.
1798 Toggle doctest mode on and off.
1795
1799
1796 This mode allows you to toggle the prompt behavior between normal
1800 This mode allows you to toggle the prompt behavior between normal
1797 IPython prompts and ones that are as similar to the default IPython
1801 IPython prompts and ones that are as similar to the default IPython
1798 interpreter as possible.
1802 interpreter as possible.
1799
1803
1800 It also supports the pasting of code snippets that have leading '>>>'
1804 It also supports the pasting of code snippets that have leading '>>>'
1801 and '...' prompts in them. This means that you can paste doctests from
1805 and '...' prompts in them. This means that you can paste doctests from
1802 files or docstrings (even if they have leading whitespace), and the
1806 files or docstrings (even if they have leading whitespace), and the
1803 code will execute correctly. You can then use '%history -tn' to see
1807 code will execute correctly. You can then use '%history -tn' to see
1804 the translated history without line numbers; this will give you the
1808 the translated history without line numbers; this will give you the
1805 input after removal of all the leading prompts and whitespace, which
1809 input after removal of all the leading prompts and whitespace, which
1806 can be pasted back into an editor.
1810 can be pasted back into an editor.
1807
1811
1808 With these features, you can switch into this mode easily whenever you
1812 With these features, you can switch into this mode easily whenever you
1809 need to do testing and changes to doctests, without having to leave
1813 need to do testing and changes to doctests, without having to leave
1810 your existing IPython session.
1814 your existing IPython session.
1811
1815
1812 **%ed**::
1816 **%ed**::
1813
1817
1814 Alias to %edit.
1818 Alias to %edit.
1815
1819
1816 **%edit**::
1820 **%edit**::
1817
1821
1818 Bring up an editor and execute the resulting code.
1822 Bring up an editor and execute the resulting code.
1819
1823
1820 Usage:
1824 Usage:
1821 %edit [options] [args]
1825 %edit [options] [args]
1822
1826
1823 %edit runs IPython's editor hook. The default version of this hook is
1827 %edit runs IPython's editor hook. The default version of this hook is
1824 set to call the __IPYTHON__.rc.editor command. This is read from your
1828 set to call the __IPYTHON__.rc.editor command. This is read from your
1825 environment variable $EDITOR. If this isn't found, it will default to
1829 environment variable $EDITOR. If this isn't found, it will default to
1826 vi under Linux/Unix and to notepad under Windows. See the end of this
1830 vi under Linux/Unix and to notepad under Windows. See the end of this
1827 docstring for how to change the editor hook.
1831 docstring for how to change the editor hook.
1828
1832
1829 You can also set the value of this editor via the command line option
1833 You can also set the value of this editor via the command line option
1830 '-editor' or in your ipythonrc file. This is useful if you wish to use
1834 '-editor' or in your ipythonrc file. This is useful if you wish to use
1831 specifically for IPython an editor different from your typical default
1835 specifically for IPython an editor different from your typical default
1832 (and for Windows users who typically don't set environment variables).
1836 (and for Windows users who typically don't set environment variables).
1833
1837
1834 This command allows you to conveniently edit multi-line code right in
1838 This command allows you to conveniently edit multi-line code right in
1835 your IPython session.
1839 your IPython session.
1836
1840
1837 If called without arguments, %edit opens up an empty editor with a
1841 If called without arguments, %edit opens up an empty editor with a
1838 temporary file and will execute the contents of this file when you
1842 temporary file and will execute the contents of this file when you
1839 close it (don't forget to save it!).
1843 close it (don't forget to save it!).
1840
1844
1841
1845
1842 Options:
1846 Options:
1843
1847
1844 -n <number>: open the editor at a specified line number. By default,
1848 -n <number>: open the editor at a specified line number. By default,
1845 the IPython editor hook uses the unix syntax 'editor +N filename', but
1849 the IPython editor hook uses the unix syntax 'editor +N filename', but
1846 you can configure this by providing your own modified hook if your
1850 you can configure this by providing your own modified hook if your
1847 favorite editor supports line-number specifications with a different
1851 favorite editor supports line-number specifications with a different
1848 syntax.
1852 syntax.
1849
1853
1850 -p: this will call the editor with the same data as the previous time
1854 -p: this will call the editor with the same data as the previous time
1851 it was used, regardless of how long ago (in your current session) it
1855 it was used, regardless of how long ago (in your current session) it
1852 was.
1856 was.
1853
1857
1854 -r: use 'raw' input. This option only applies to input taken from the
1858 -r: use 'raw' input. This option only applies to input taken from the
1855 user's history. By default, the 'processed' history is used, so that
1859 user's history. By default, the 'processed' history is used, so that
1856 magics are loaded in their transformed version to valid Python. If
1860 magics are loaded in their transformed version to valid Python. If
1857 this option is given, the raw input as typed as the command line is
1861 this option is given, the raw input as typed as the command line is
1858 used instead. When you exit the editor, it will be executed by
1862 used instead. When you exit the editor, it will be executed by
1859 IPython's own processor.
1863 IPython's own processor.
1860
1864
1861 -x: do not execute the edited code immediately upon exit. This is
1865 -x: do not execute the edited code immediately upon exit. This is
1862 mainly useful if you are editing programs which need to be called with
1866 mainly useful if you are editing programs which need to be called with
1863 command line arguments, which you can then do using %run.
1867 command line arguments, which you can then do using %run.
1864
1868
1865
1869
1866 Arguments:
1870 Arguments:
1867
1871
1868 If arguments are given, the following possibilites exist:
1872 If arguments are given, the following possibilites exist:
1869
1873
1870 - The arguments are numbers or pairs of colon-separated numbers (like
1874 - The arguments are numbers or pairs of colon-separated numbers (like
1871 1 4:8 9). These are interpreted as lines of previous input to be
1875 1 4:8 9). These are interpreted as lines of previous input to be
1872 loaded into the editor. The syntax is the same of the %macro command.
1876 loaded into the editor. The syntax is the same of the %macro command.
1873
1877
1874 - If the argument doesn't start with a number, it is evaluated as a
1878 - If the argument doesn't start with a number, it is evaluated as a
1875 variable and its contents loaded into the editor. You can thus edit
1879 variable and its contents loaded into the editor. You can thus edit
1876 any string which contains python code (including the result of
1880 any string which contains python code (including the result of
1877 previous edits).
1881 previous edits).
1878
1882
1879 - If the argument is the name of an object (other than a string),
1883 - If the argument is the name of an object (other than a string),
1880 IPython will try to locate the file where it was defined and open the
1884 IPython will try to locate the file where it was defined and open the
1881 editor at the point where it is defined. You can use `%edit function`
1885 editor at the point where it is defined. You can use `%edit function`
1882 to load an editor exactly at the point where 'function' is defined,
1886 to load an editor exactly at the point where 'function' is defined,
1883 edit it and have the file be executed automatically.
1887 edit it and have the file be executed automatically.
1884
1888
1885 If the object is a macro (see %macro for details), this opens up your
1889 If the object is a macro (see %macro for details), this opens up your
1886 specified editor with a temporary file containing the macro's data.
1890 specified editor with a temporary file containing the macro's data.
1887 Upon exit, the macro is reloaded with the contents of the file.
1891 Upon exit, the macro is reloaded with the contents of the file.
1888
1892
1889 Note: opening at an exact line is only supported under Unix, and some
1893 Note: opening at an exact line is only supported under Unix, and some
1890 editors (like kedit and gedit up to Gnome 2.8) do not understand the
1894 editors (like kedit and gedit up to Gnome 2.8) do not understand the
1891 '+NUMBER' parameter necessary for this feature. Good editors like
1895 '+NUMBER' parameter necessary for this feature. Good editors like
1892 (X)Emacs, vi, jed, pico and joe all do.
1896 (X)Emacs, vi, jed, pico and joe all do.
1893
1897
1894 - If the argument is not found as a variable, IPython will look for a
1898 - If the argument is not found as a variable, IPython will look for a
1895 file with that name (adding .py if necessary) and load it into the
1899 file with that name (adding .py if necessary) and load it into the
1896 editor. It will execute its contents with execfile() when you exit,
1900 editor. It will execute its contents with execfile() when you exit,
1897 loading any code in the file into your interactive namespace.
1901 loading any code in the file into your interactive namespace.
1898
1902
1899 After executing your code, %edit will return as output the code you
1903 After executing your code, %edit will return as output the code you
1900 typed in the editor (except when it was an existing file). This way
1904 typed in the editor (except when it was an existing file). This way
1901 you can reload the code in further invocations of %edit as a variable,
1905 you can reload the code in further invocations of %edit as a variable,
1902 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
1906 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
1903 the output.
1907 the output.
1904
1908
1905 Note that %edit is also available through the alias %ed.
1909 Note that %edit is also available through the alias %ed.
1906
1910
1907 This is an example of creating a simple function inside the editor and
1911 This is an example of creating a simple function inside the editor and
1908 then modifying it. First, start up the editor:
1912 then modifying it. First, start up the editor:
1909
1913
1910 In [1]: ed\
1914 In [1]: ed\
1911 Editing... done. Executing edited code...\
1915 Editing... done. Executing edited code...\
1912 Out[1]: 'def foo():\n print "foo() was defined in an editing session"\n'
1916 Out[1]: 'def foo():\n print "foo() was defined in an editing session"\n'
1913
1917
1914 We can then call the function foo():
1918 We can then call the function foo():
1915
1919
1916 In [2]: foo()\
1920 In [2]: foo()\
1917 foo() was defined in an editing session
1921 foo() was defined in an editing session
1918
1922
1919 Now we edit foo. IPython automatically loads the editor with the
1923 Now we edit foo. IPython automatically loads the editor with the
1920 (temporary) file where foo() was previously defined:
1924 (temporary) file where foo() was previously defined:
1921
1925
1922 In [3]: ed foo\
1926 In [3]: ed foo\
1923 Editing... done. Executing edited code...
1927 Editing... done. Executing edited code...
1924
1928
1925 And if we call foo() again we get the modified version:
1929 And if we call foo() again we get the modified version:
1926
1930
1927 In [4]: foo()\
1931 In [4]: foo()\
1928 foo() has now been changed!
1932 foo() has now been changed!
1929
1933
1930 Here is an example of how to edit a code snippet successive
1934 Here is an example of how to edit a code snippet successive
1931 times. First we call the editor:
1935 times. First we call the editor:
1932
1936
1933 In [8]: ed\
1937 In [8]: ed\
1934 Editing... done. Executing edited code...\
1938 Editing... done. Executing edited code...\
1935 hello\
1939 hello\
1936 Out[8]: "print 'hello'\n"
1940 Out[8]: "print 'hello'\n"
1937
1941
1938 Now we call it again with the previous output (stored in _):
1942 Now we call it again with the previous output (stored in _):
1939
1943
1940 In [9]: ed _\
1944 In [9]: ed _\
1941 Editing... done. Executing edited code...\
1945 Editing... done. Executing edited code...\
1942 hello world\
1946 hello world\
1943 Out[9]: "print 'hello world'\n"
1947 Out[9]: "print 'hello world'\n"
1944
1948
1945 Now we call it with the output #8 (stored in _8, also as Out[8]):
1949 Now we call it with the output #8 (stored in _8, also as Out[8]):
1946
1950
1947 In [10]: ed _8\
1951 In [10]: ed _8\
1948 Editing... done. Executing edited code...\
1952 Editing... done. Executing edited code...\
1949 hello again\
1953 hello again\
1950 Out[10]: "print 'hello again'\n"
1954 Out[10]: "print 'hello again'\n"
1951
1955
1952
1956
1953 Changing the default editor hook:
1957 Changing the default editor hook:
1954
1958
1955 If you wish to write your own editor hook, you can put it in a
1959 If you wish to write your own editor hook, you can put it in a
1956 configuration file which you load at startup time. The default hook
1960 configuration file which you load at startup time. The default hook
1957 is defined in the IPython.hooks module, and you can use that as a
1961 is defined in the IPython.hooks module, and you can use that as a
1958 starting example for further modifications. That file also has
1962 starting example for further modifications. That file also has
1959 general instructions on how to set a new hook for use once you've
1963 general instructions on how to set a new hook for use once you've
1960 defined it.
1964 defined it.
1961
1965
1962 **%env**::
1966 **%env**::
1963
1967
1964 List environment variables.
1968 List environment variables.
1965
1969
1966 **%exit**::
1970 **%exit**::
1967
1971
1968 Exit IPython, confirming if configured to do so.
1972 Exit IPython, confirming if configured to do so.
1969
1973
1970 You can configure whether IPython asks for confirmation upon exit by
1974 You can configure whether IPython asks for confirmation upon exit by
1971 setting the confirm_exit flag in the ipythonrc file.
1975 setting the confirm_exit flag in the ipythonrc file.
1972
1976
1973 **%hist**::
1977 **%hist**::
1974
1978
1975 Alternate name for %history.
1979 Alternate name for %history.
1976
1980
1977 **%history**::
1981 **%history**::
1978
1982
1979 Print input history (_i<n> variables), with most recent last.
1983 Print input history (_i<n> variables), with most recent last.
1980
1984
1981 %history -> print at most 40 inputs (some may be multi-line)\
1985 %history -> print at most 40 inputs (some may be multi-line)\
1982 %history n -> print at most n inputs\
1986 %history n -> print at most n inputs\
1983 %history n1 n2 -> print inputs between n1 and n2 (n2 not included)\
1987 %history n1 n2 -> print inputs between n1 and n2 (n2 not included)\
1984
1988
1985 Each input's number <n> is shown, and is accessible as the
1989 Each input's number <n> is shown, and is accessible as the
1986 automatically generated variable _i<n>. Multi-line statements are
1990 automatically generated variable _i<n>. Multi-line statements are
1987 printed starting at a new line for easy copy/paste.
1991 printed starting at a new line for easy copy/paste.
1988
1992
1989
1993
1990 Options:
1994 Options:
1991
1995
1992 -n: do NOT print line numbers. This is useful if you want to get a
1996 -n: do NOT print line numbers. This is useful if you want to get a
1993 printout of many lines which can be directly pasted into a text
1997 printout of many lines which can be directly pasted into a text
1994 editor.
1998 editor.
1995
1999
1996 This feature is only available if numbered prompts are in use.
2000 This feature is only available if numbered prompts are in use.
1997
2001
1998 -t: (default) print the 'translated' history, as IPython understands it.
2002 -t: (default) print the 'translated' history, as IPython understands it.
1999 IPython filters your input and converts it all into valid Python source
2003 IPython filters your input and converts it all into valid Python source
2000 before executing it (things like magics or aliases are turned into
2004 before executing it (things like magics or aliases are turned into
2001 function calls, for example). With this option, you'll see the native
2005 function calls, for example). With this option, you'll see the native
2002 history instead of the user-entered version: '%cd /' will be seen as
2006 history instead of the user-entered version: '%cd /' will be seen as
2003 '_ip.magic("%cd /")' instead of '%cd /'.
2007 '_ip.magic("%cd /")' instead of '%cd /'.
2004
2008
2005 -r: print the 'raw' history, i.e. the actual commands you typed.
2009 -r: print the 'raw' history, i.e. the actual commands you typed.
2006
2010
2007 -g: treat the arg as a pattern to grep for in (full) history.
2011 -g: treat the arg as a pattern to grep for in (full) history.
2008 This includes the "shadow history" (almost all commands ever written).
2012 This includes the "shadow history" (almost all commands ever written).
2009 Use '%hist -g' to show full shadow history (may be very long).
2013 Use '%hist -g' to show full shadow history (may be very long).
2010 In shadow history, every index nuwber starts with 0.
2014 In shadow history, every index nuwber starts with 0.
2011
2015
2012 -f FILENAME: instead of printing the output to the screen, redirect it to
2016 -f FILENAME: instead of printing the output to the screen, redirect it to
2013 the given file. The file is always overwritten, though IPython asks for
2017 the given file. The file is always overwritten, though IPython asks for
2014 confirmation first if it already exists.
2018 confirmation first if it already exists.
2015
2019
2016 **%logoff**::
2020 **%logoff**::
2017
2021
2018 Temporarily stop logging.
2022 Temporarily stop logging.
2019
2023
2020 You must have previously started logging.
2024 You must have previously started logging.
2021
2025
2022 **%logon**::
2026 **%logon**::
2023
2027
2024 Restart logging.
2028 Restart logging.
2025
2029
2026 This function is for restarting logging which you've temporarily
2030 This function is for restarting logging which you've temporarily
2027 stopped with %logoff. For starting logging for the first time, you
2031 stopped with %logoff. For starting logging for the first time, you
2028 must use the %logstart function, which allows you to specify an
2032 must use the %logstart function, which allows you to specify an
2029 optional log filename.
2033 optional log filename.
2030
2034
2031 **%logstart**::
2035 **%logstart**::
2032
2036
2033 Start logging anywhere in a session.
2037 Start logging anywhere in a session.
2034
2038
2035 %logstart [-o|-r|-t] [log_name [log_mode]]
2039 %logstart [-o|-r|-t] [log_name [log_mode]]
2036
2040
2037 If no name is given, it defaults to a file named 'ipython_log.py' in your
2041 If no name is given, it defaults to a file named 'ipython_log.py' in your
2038 current directory, in 'rotate' mode (see below).
2042 current directory, in 'rotate' mode (see below).
2039
2043
2040 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
2044 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
2041 history up to that point and then continues logging.
2045 history up to that point and then continues logging.
2042
2046
2043 %logstart takes a second optional parameter: logging mode. This can be one
2047 %logstart takes a second optional parameter: logging mode. This can be one
2044 of (note that the modes are given unquoted):\
2048 of (note that the modes are given unquoted):\
2045 append: well, that says it.\
2049 append: well, that says it.\
2046 backup: rename (if exists) to name~ and start name.\
2050 backup: rename (if exists) to name~ and start name.\
2047 global: single logfile in your home dir, appended to.\
2051 global: single logfile in your home dir, appended to.\
2048 over : overwrite existing log.\
2052 over : overwrite existing log.\
2049 rotate: create rotating logs name.1~, name.2~, etc.
2053 rotate: create rotating logs name.1~, name.2~, etc.
2050
2054
2051 Options:
2055 Options:
2052
2056
2053 -o: log also IPython's output. In this mode, all commands which
2057 -o: log also IPython's output. In this mode, all commands which
2054 generate an Out[NN] prompt are recorded to the logfile, right after
2058 generate an Out[NN] prompt are recorded to the logfile, right after
2055 their corresponding input line. The output lines are always
2059 their corresponding input line. The output lines are always
2056 prepended with a '#[Out]# ' marker, so that the log remains valid
2060 prepended with a '#[Out]# ' marker, so that the log remains valid
2057 Python code.
2061 Python code.
2058
2062
2059 Since this marker is always the same, filtering only the output from
2063 Since this marker is always the same, filtering only the output from
2060 a log is very easy, using for example a simple awk call:
2064 a log is very easy, using for example a simple awk call:
2061
2065
2062 awk -F'#\[Out\]# ' '{if($2) {print $2}}' ipython_log.py
2066 awk -F'#\[Out\]# ' '{if($2) {print $2}}' ipython_log.py
2063
2067
2064 -r: log 'raw' input. Normally, IPython's logs contain the processed
2068 -r: log 'raw' input. Normally, IPython's logs contain the processed
2065 input, so that user lines are logged in their final form, converted
2069 input, so that user lines are logged in their final form, converted
2066 into valid Python. For example, %Exit is logged as
2070 into valid Python. For example, %Exit is logged as
2067 '_ip.magic("Exit"). If the -r flag is given, all input is logged
2071 '_ip.magic("Exit"). If the -r flag is given, all input is logged
2068 exactly as typed, with no transformations applied.
2072 exactly as typed, with no transformations applied.
2069
2073
2070 -t: put timestamps before each input line logged (these are put in
2074 -t: put timestamps before each input line logged (these are put in
2071 comments).
2075 comments).
2072
2076
2073 **%logstate**::
2077 **%logstate**::
2074
2078
2075 Print the status of the logging system.
2079 Print the status of the logging system.
2076
2080
2077 **%logstop**::
2081 **%logstop**::
2078
2082
2079 Fully stop logging and close log file.
2083 Fully stop logging and close log file.
2080
2084
2081 In order to start logging again, a new %logstart call needs to be made,
2085 In order to start logging again, a new %logstart call needs to be made,
2082 possibly (though not necessarily) with a new filename, mode and other
2086 possibly (though not necessarily) with a new filename, mode and other
2083 options.
2087 options.
2084
2088
2085 **%lsmagic**::
2089 **%lsmagic**::
2086
2090
2087 List currently available magic functions.
2091 List currently available magic functions.
2088
2092
2089 **%macro**::
2093 **%macro**::
2090
2094
2091 Define a set of input lines as a macro for future re-execution.
2095 Define a set of input lines as a macro for future re-execution.
2092
2096
2093 Usage:\
2097 Usage:\
2094 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
2098 %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ...
2095
2099
2096 Options:
2100 Options:
2097
2101
2098 -r: use 'raw' input. By default, the 'processed' history is used,
2102 -r: use 'raw' input. By default, the 'processed' history is used,
2099 so that magics are loaded in their transformed version to valid
2103 so that magics are loaded in their transformed version to valid
2100 Python. If this option is given, the raw input as typed as the
2104 Python. If this option is given, the raw input as typed as the
2101 command line is used instead.
2105 command line is used instead.
2102
2106
2103 This will define a global variable called `name` which is a string
2107 This will define a global variable called `name` which is a string
2104 made of joining the slices and lines you specify (n1,n2,... numbers
2108 made of joining the slices and lines you specify (n1,n2,... numbers
2105 above) from your input history into a single string. This variable
2109 above) from your input history into a single string. This variable
2106 acts like an automatic function which re-executes those lines as if
2110 acts like an automatic function which re-executes those lines as if
2107 you had typed them. You just type 'name' at the prompt and the code
2111 you had typed them. You just type 'name' at the prompt and the code
2108 executes.
2112 executes.
2109
2113
2110 The notation for indicating number ranges is: n1-n2 means 'use line
2114 The notation for indicating number ranges is: n1-n2 means 'use line
2111 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
2115 numbers n1,...n2' (the endpoint is included). That is, '5-7' means
2112 using the lines numbered 5,6 and 7.
2116 using the lines numbered 5,6 and 7.
2113
2117
2114 Note: as a 'hidden' feature, you can also use traditional python slice
2118 Note: as a 'hidden' feature, you can also use traditional python slice
2115 notation, where N:M means numbers N through M-1.
2119 notation, where N:M means numbers N through M-1.
2116
2120
2117 For example, if your history contains (%hist prints it):
2121 For example, if your history contains (%hist prints it):
2118
2122
2119 44: x=1\
2123 44: x=1\
2120 45: y=3\
2124 45: y=3\
2121 46: z=x+y\
2125 46: z=x+y\
2122 47: print x\
2126 47: print x\
2123 48: a=5\
2127 48: a=5\
2124 49: print 'x',x,'y',y\
2128 49: print 'x',x,'y',y\
2125
2129
2126 you can create a macro with lines 44 through 47 (included) and line 49
2130 you can create a macro with lines 44 through 47 (included) and line 49
2127 called my_macro with:
2131 called my_macro with:
2128
2132
2129 In [51]: %macro my_macro 44-47 49
2133 In [51]: %macro my_macro 44-47 49
2130
2134
2131 Now, typing `my_macro` (without quotes) will re-execute all this code
2135 Now, typing `my_macro` (without quotes) will re-execute all this code
2132 in one pass.
2136 in one pass.
2133
2137
2134 You don't need to give the line-numbers in order, and any given line
2138 You don't need to give the line-numbers in order, and any given line
2135 number can appear multiple times. You can assemble macros with any
2139 number can appear multiple times. You can assemble macros with any
2136 lines from your input history in any order.
2140 lines from your input history in any order.
2137
2141
2138 The macro is a simple object which holds its value in an attribute,
2142 The macro is a simple object which holds its value in an attribute,
2139 but IPython's display system checks for macros and executes them as
2143 but IPython's display system checks for macros and executes them as
2140 code instead of printing them when you type their name.
2144 code instead of printing them when you type their name.
2141
2145
2142 You can view a macro's contents by explicitly printing it with:
2146 You can view a macro's contents by explicitly printing it with:
2143
2147
2144 'print macro_name'.
2148 'print macro_name'.
2145
2149
2146 For one-off cases which DON'T contain magic function calls in them you
2150 For one-off cases which DON'T contain magic function calls in them you
2147 can obtain similar results by explicitly executing slices from your
2151 can obtain similar results by explicitly executing slices from your
2148 input history with:
2152 input history with:
2149
2153
2150 In [60]: exec In[44:48]+In[49]
2154 In [60]: exec In[44:48]+In[49]
2151
2155
2152 **%magic**::
2156 **%magic**::
2153
2157
2154 Print information about the magic function system.
2158 Print information about the magic function system.
2155
2159
2156 **%mglob**::
2160 **%mglob**::
2157
2161
2158 This program allows specifying filenames with "mglob" mechanism.
2162 This program allows specifying filenames with "mglob" mechanism.
2159 Supported syntax in globs (wilcard matching patterns)::
2163 Supported syntax in globs (wilcard matching patterns)::
2160
2164
2161 *.cpp ?ellowo*
2165 *.cpp ?ellowo*
2162 - obvious. Differs from normal glob in that dirs are not included.
2166 - obvious. Differs from normal glob in that dirs are not included.
2163 Unix users might want to write this as: "*.cpp" "?ellowo*"
2167 Unix users might want to write this as: "*.cpp" "?ellowo*"
2164 rec:/usr/share=*.txt,*.doc
2168 rec:/usr/share=*.txt,*.doc
2165 - get all *.txt and *.doc under /usr/share,
2169 - get all *.txt and *.doc under /usr/share,
2166 recursively
2170 recursively
2167 rec:/usr/share
2171 rec:/usr/share
2168 - All files under /usr/share, recursively
2172 - All files under /usr/share, recursively
2169 rec:*.py
2173 rec:*.py
2170 - All .py files under current working dir, recursively
2174 - All .py files under current working dir, recursively
2171 foo
2175 foo
2172 - File or dir foo
2176 - File or dir foo
2173 !*.bak readme*
2177 !*.bak readme*
2174 - readme*, exclude files ending with .bak
2178 - readme*, exclude files ending with .bak
2175 !.svn/ !.hg/ !*_Data/ rec:.
2179 !.svn/ !.hg/ !*_Data/ rec:.
2176 - Skip .svn, .hg, foo_Data dirs (and their subdirs) in recurse.
2180 - Skip .svn, .hg, foo_Data dirs (and their subdirs) in recurse.
2177 Trailing / is the key, \ does not work!
2181 Trailing / is the key, \ does not work!
2178 dir:foo
2182 dir:foo
2179 - the directory foo if it exists (not files in foo)
2183 - the directory foo if it exists (not files in foo)
2180 dir:*
2184 dir:*
2181 - all directories in current folder
2185 - all directories in current folder
2182 foo.py bar.* !h* rec:*.py
2186 foo.py bar.* !h* rec:*.py
2183 - Obvious. !h* exclusion only applies for rec:*.py.
2187 - Obvious. !h* exclusion only applies for rec:*.py.
2184 foo.py is *not* included twice.
2188 foo.py is *not* included twice.
2185 @filelist.txt
2189 @filelist.txt
2186 - All files listed in 'filelist.txt' file, on separate lines.
2190 - All files listed in 'filelist.txt' file, on separate lines.
2187
2191
2188 **%page**::
2192 **%page**::
2189
2193
2190 Pretty print the object and display it through a pager.
2194 Pretty print the object and display it through a pager.
2191
2195
2192 %page [options] OBJECT
2196 %page [options] OBJECT
2193
2197
2194 If no object is given, use _ (last output).
2198 If no object is given, use _ (last output).
2195
2199
2196 Options:
2200 Options:
2197
2201
2198 -r: page str(object), don't pretty-print it.
2202 -r: page str(object), don't pretty-print it.
2199
2203
2200 **%pdb**::
2204 **%pdb**::
2201
2205
2202 Control the automatic calling of the pdb interactive debugger.
2206 Control the automatic calling of the pdb interactive debugger.
2203
2207
2204 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
2208 Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without
2205 argument it works as a toggle.
2209 argument it works as a toggle.
2206
2210
2207 When an exception is triggered, IPython can optionally call the
2211 When an exception is triggered, IPython can optionally call the
2208 interactive pdb debugger after the traceback printout. %pdb toggles
2212 interactive pdb debugger after the traceback printout. %pdb toggles
2209 this feature on and off.
2213 this feature on and off.
2210
2214
2211 The initial state of this feature is set in your ipythonrc
2215 The initial state of this feature is set in your ipythonrc
2212 configuration file (the variable is called 'pdb').
2216 configuration file (the variable is called 'pdb').
2213
2217
2214 If you want to just activate the debugger AFTER an exception has fired,
2218 If you want to just activate the debugger AFTER an exception has fired,
2215 without having to type '%pdb on' and rerunning your code, you can use
2219 without having to type '%pdb on' and rerunning your code, you can use
2216 the %debug magic.
2220 the %debug magic.
2217
2221
2218 **%pdef**::
2222 **%pdef**::
2219
2223
2220 Print the definition header for any callable object.
2224 Print the definition header for any callable object.
2221
2225
2222 If the object is a class, print the constructor information.
2226 If the object is a class, print the constructor information.
2223
2227
2224 **%pdoc**::
2228 **%pdoc**::
2225
2229
2226 Print the docstring for an object.
2230 Print the docstring for an object.
2227
2231
2228 If the given object is a class, it will print both the class and the
2232 If the given object is a class, it will print both the class and the
2229 constructor docstrings.
2233 constructor docstrings.
2230
2234
2231 **%pfile**::
2235 **%pfile**::
2232
2236
2233 Print (or run through pager) the file where an object is defined.
2237 Print (or run through pager) the file where an object is defined.
2234
2238
2235 The file opens at the line where the object definition begins. IPython
2239 The file opens at the line where the object definition begins. IPython
2236 will honor the environment variable PAGER if set, and otherwise will
2240 will honor the environment variable PAGER if set, and otherwise will
2237 do its best to print the file in a convenient form.
2241 do its best to print the file in a convenient form.
2238
2242
2239 If the given argument is not an object currently defined, IPython will
2243 If the given argument is not an object currently defined, IPython will
2240 try to interpret it as a filename (automatically adding a .py extension
2244 try to interpret it as a filename (automatically adding a .py extension
2241 if needed). You can thus use %pfile as a syntax highlighting code
2245 if needed). You can thus use %pfile as a syntax highlighting code
2242 viewer.
2246 viewer.
2243
2247
2244 **%pinfo**::
2248 **%pinfo**::
2245
2249
2246 Provide detailed information about an object.
2250 Provide detailed information about an object.
2247
2251
2248 '%pinfo object' is just a synonym for object? or ?object.
2252 '%pinfo object' is just a synonym for object? or ?object.
2249
2253
2250 **%popd**::
2254 **%popd**::
2251
2255
2252 Change to directory popped off the top of the stack.
2256 Change to directory popped off the top of the stack.
2253
2257
2254 **%profile**::
2258 **%profile**::
2255
2259
2256 Print your currently active IPyhton profile.
2260 Print your currently active IPyhton profile.
2257
2261
2258 **%prun**::
2262 **%prun**::
2259
2263
2260 Run a statement through the python code profiler.
2264 Run a statement through the python code profiler.
2261
2265
2262 Usage:\
2266 Usage:\
2263 %prun [options] statement
2267 %prun [options] statement
2264
2268
2265 The given statement (which doesn't require quote marks) is run via the
2269 The given statement (which doesn't require quote marks) is run via the
2266 python profiler in a manner similar to the profile.run() function.
2270 python profiler in a manner similar to the profile.run() function.
2267 Namespaces are internally managed to work correctly; profile.run
2271 Namespaces are internally managed to work correctly; profile.run
2268 cannot be used in IPython because it makes certain assumptions about
2272 cannot be used in IPython because it makes certain assumptions about
2269 namespaces which do not hold under IPython.
2273 namespaces which do not hold under IPython.
2270
2274
2271 Options:
2275 Options:
2272
2276
2273 -l <limit>: you can place restrictions on what or how much of the
2277 -l <limit>: you can place restrictions on what or how much of the
2274 profile gets printed. The limit value can be:
2278 profile gets printed. The limit value can be:
2275
2279
2276 * A string: only information for function names containing this string
2280 * A string: only information for function names containing this string
2277 is printed.
2281 is printed.
2278
2282
2279 * An integer: only these many lines are printed.
2283 * An integer: only these many lines are printed.
2280
2284
2281 * A float (between 0 and 1): this fraction of the report is printed
2285 * A float (between 0 and 1): this fraction of the report is printed
2282 (for example, use a limit of 0.4 to see the topmost 40% only).
2286 (for example, use a limit of 0.4 to see the topmost 40% only).
2283
2287
2284 You can combine several limits with repeated use of the option. For
2288 You can combine several limits with repeated use of the option. For
2285 example, '-l __init__ -l 5' will print only the topmost 5 lines of
2289 example, '-l __init__ -l 5' will print only the topmost 5 lines of
2286 information about class constructors.
2290 information about class constructors.
2287
2291
2288 -r: return the pstats.Stats object generated by the profiling. This
2292 -r: return the pstats.Stats object generated by the profiling. This
2289 object has all the information about the profile in it, and you can
2293 object has all the information about the profile in it, and you can
2290 later use it for further analysis or in other functions.
2294 later use it for further analysis or in other functions.
2291
2295
2292 -s <key>: sort profile by given key. You can provide more than one key
2296 -s <key>: sort profile by given key. You can provide more than one key
2293 by using the option several times: '-s key1 -s key2 -s key3...'. The
2297 by using the option several times: '-s key1 -s key2 -s key3...'. The
2294 default sorting key is 'time'.
2298 default sorting key is 'time'.
2295
2299
2296 The following is copied verbatim from the profile documentation
2300 The following is copied verbatim from the profile documentation
2297 referenced below:
2301 referenced below:
2298
2302
2299 When more than one key is provided, additional keys are used as
2303 When more than one key is provided, additional keys are used as
2300 secondary criteria when the there is equality in all keys selected
2304 secondary criteria when the there is equality in all keys selected
2301 before them.
2305 before them.
2302
2306
2303 Abbreviations can be used for any key names, as long as the
2307 Abbreviations can be used for any key names, as long as the
2304 abbreviation is unambiguous. The following are the keys currently
2308 abbreviation is unambiguous. The following are the keys currently
2305 defined:
2309 defined:
2306
2310
2307 Valid Arg Meaning\
2311 Valid Arg Meaning\
2308 "calls" call count\
2312 "calls" call count\
2309 "cumulative" cumulative time\
2313 "cumulative" cumulative time\
2310 "file" file name\
2314 "file" file name\
2311 "module" file name\
2315 "module" file name\
2312 "pcalls" primitive call count\
2316 "pcalls" primitive call count\
2313 "line" line number\
2317 "line" line number\
2314 "name" function name\
2318 "name" function name\
2315 "nfl" name/file/line\
2319 "nfl" name/file/line\
2316 "stdname" standard name\
2320 "stdname" standard name\
2317 "time" internal time
2321 "time" internal time
2318
2322
2319 Note that all sorts on statistics are in descending order (placing
2323 Note that all sorts on statistics are in descending order (placing
2320 most time consuming items first), where as name, file, and line number
2324 most time consuming items first), where as name, file, and line number
2321 searches are in ascending order (i.e., alphabetical). The subtle
2325 searches are in ascending order (i.e., alphabetical). The subtle
2322 distinction between "nfl" and "stdname" is that the standard name is a
2326 distinction between "nfl" and "stdname" is that the standard name is a
2323 sort of the name as printed, which means that the embedded line
2327 sort of the name as printed, which means that the embedded line
2324 numbers get compared in an odd way. For example, lines 3, 20, and 40
2328 numbers get compared in an odd way. For example, lines 3, 20, and 40
2325 would (if the file names were the same) appear in the string order
2329 would (if the file names were the same) appear in the string order
2326 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
2330 "20" "3" and "40". In contrast, "nfl" does a numeric compare of the
2327 line numbers. In fact, sort_stats("nfl") is the same as
2331 line numbers. In fact, sort_stats("nfl") is the same as
2328 sort_stats("name", "file", "line").
2332 sort_stats("name", "file", "line").
2329
2333
2330 -T <filename>: save profile results as shown on screen to a text
2334 -T <filename>: save profile results as shown on screen to a text
2331 file. The profile is still shown on screen.
2335 file. The profile is still shown on screen.
2332
2336
2333 -D <filename>: save (via dump_stats) profile statistics to given
2337 -D <filename>: save (via dump_stats) profile statistics to given
2334 filename. This data is in a format understod by the pstats module, and
2338 filename. This data is in a format understod by the pstats module, and
2335 is generated by a call to the dump_stats() method of profile
2339 is generated by a call to the dump_stats() method of profile
2336 objects. The profile is still shown on screen.
2340 objects. The profile is still shown on screen.
2337
2341
2338 If you want to run complete programs under the profiler's control, use
2342 If you want to run complete programs under the profiler's control, use
2339 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
2343 '%run -p [prof_opts] filename.py [args to program]' where prof_opts
2340 contains profiler specific options as described here.
2344 contains profiler specific options as described here.
2341
2345
2342 You can read the complete documentation for the profile module with:\
2346 You can read the complete documentation for the profile module with:\
2343 In [1]: import profile; profile.help()
2347 In [1]: import profile; profile.help()
2344
2348
2345 **%psearch**::
2349 **%psearch**::
2346
2350
2347 Search for object in namespaces by wildcard.
2351 Search for object in namespaces by wildcard.
2348
2352
2349 %psearch [options] PATTERN [OBJECT TYPE]
2353 %psearch [options] PATTERN [OBJECT TYPE]
2350
2354
2351 Note: ? can be used as a synonym for %psearch, at the beginning or at
2355 Note: ? can be used as a synonym for %psearch, at the beginning or at
2352 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
2356 the end: both a*? and ?a* are equivalent to '%psearch a*'. Still, the
2353 rest of the command line must be unchanged (options come first), so
2357 rest of the command line must be unchanged (options come first), so
2354 for example the following forms are equivalent
2358 for example the following forms are equivalent
2355
2359
2356 %psearch -i a* function
2360 %psearch -i a* function
2357 -i a* function?
2361 -i a* function?
2358 ?-i a* function
2362 ?-i a* function
2359
2363
2360 Arguments:
2364 Arguments:
2361
2365
2362 PATTERN
2366 PATTERN
2363
2367
2364 where PATTERN is a string containing * as a wildcard similar to its
2368 where PATTERN is a string containing * as a wildcard similar to its
2365 use in a shell. The pattern is matched in all namespaces on the
2369 use in a shell. The pattern is matched in all namespaces on the
2366 search path. By default objects starting with a single _ are not
2370 search path. By default objects starting with a single _ are not
2367 matched, many IPython generated objects have a single
2371 matched, many IPython generated objects have a single
2368 underscore. The default is case insensitive matching. Matching is
2372 underscore. The default is case insensitive matching. Matching is
2369 also done on the attributes of objects and not only on the objects
2373 also done on the attributes of objects and not only on the objects
2370 in a module.
2374 in a module.
2371
2375
2372 [OBJECT TYPE]
2376 [OBJECT TYPE]
2373
2377
2374 Is the name of a python type from the types module. The name is
2378 Is the name of a python type from the types module. The name is
2375 given in lowercase without the ending type, ex. StringType is
2379 given in lowercase without the ending type, ex. StringType is
2376 written string. By adding a type here only objects matching the
2380 written string. By adding a type here only objects matching the
2377 given type are matched. Using all here makes the pattern match all
2381 given type are matched. Using all here makes the pattern match all
2378 types (this is the default).
2382 types (this is the default).
2379
2383
2380 Options:
2384 Options:
2381
2385
2382 -a: makes the pattern match even objects whose names start with a
2386 -a: makes the pattern match even objects whose names start with a
2383 single underscore. These names are normally ommitted from the
2387 single underscore. These names are normally ommitted from the
2384 search.
2388 search.
2385
2389
2386 -i/-c: make the pattern case insensitive/sensitive. If neither of
2390 -i/-c: make the pattern case insensitive/sensitive. If neither of
2387 these options is given, the default is read from your ipythonrc
2391 these options is given, the default is read from your ipythonrc
2388 file. The option name which sets this value is
2392 file. The option name which sets this value is
2389 'wildcards_case_sensitive'. If this option is not specified in your
2393 'wildcards_case_sensitive'. If this option is not specified in your
2390 ipythonrc file, IPython's internal default is to do a case sensitive
2394 ipythonrc file, IPython's internal default is to do a case sensitive
2391 search.
2395 search.
2392
2396
2393 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
2397 -e/-s NAMESPACE: exclude/search a given namespace. The pattern you
2394 specifiy can be searched in any of the following namespaces:
2398 specifiy can be searched in any of the following namespaces:
2395 'builtin', 'user', 'user_global','internal', 'alias', where
2399 'builtin', 'user', 'user_global','internal', 'alias', where
2396 'builtin' and 'user' are the search defaults. Note that you should
2400 'builtin' and 'user' are the search defaults. Note that you should
2397 not use quotes when specifying namespaces.
2401 not use quotes when specifying namespaces.
2398
2402
2399 'Builtin' contains the python module builtin, 'user' contains all
2403 'Builtin' contains the python module builtin, 'user' contains all
2400 user data, 'alias' only contain the shell aliases and no python
2404 user data, 'alias' only contain the shell aliases and no python
2401 objects, 'internal' contains objects used by IPython. The
2405 objects, 'internal' contains objects used by IPython. The
2402 'user_global' namespace is only used by embedded IPython instances,
2406 'user_global' namespace is only used by embedded IPython instances,
2403 and it contains module-level globals. You can add namespaces to the
2407 and it contains module-level globals. You can add namespaces to the
2404 search with -s or exclude them with -e (these options can be given
2408 search with -s or exclude them with -e (these options can be given
2405 more than once).
2409 more than once).
2406
2410
2407 Examples:
2411 Examples:
2408
2412
2409 %psearch a* -> objects beginning with an a
2413 %psearch a* -> objects beginning with an a
2410 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
2414 %psearch -e builtin a* -> objects NOT in the builtin space starting in a
2411 %psearch a* function -> all functions beginning with an a
2415 %psearch a* function -> all functions beginning with an a
2412 %psearch re.e* -> objects beginning with an e in module re
2416 %psearch re.e* -> objects beginning with an e in module re
2413 %psearch r*.e* -> objects that start with e in modules starting in r
2417 %psearch r*.e* -> objects that start with e in modules starting in r
2414 %psearch r*.* string -> all strings in modules beginning with r
2418 %psearch r*.* string -> all strings in modules beginning with r
2415
2419
2416 Case sensitve search:
2420 Case sensitve search:
2417
2421
2418 %psearch -c a* list all object beginning with lower case a
2422 %psearch -c a* list all object beginning with lower case a
2419
2423
2420 Show objects beginning with a single _:
2424 Show objects beginning with a single _:
2421
2425
2422 %psearch -a _* list objects beginning with a single underscore
2426 %psearch -a _* list objects beginning with a single underscore
2423
2427
2424 **%psource**::
2428 **%psource**::
2425
2429
2426 Print (or run through pager) the source code for an object.
2430 Print (or run through pager) the source code for an object.
2427
2431
2428 **%pushd**::
2432 **%pushd**::
2429
2433
2430 Place the current dir on stack and change directory.
2434 Place the current dir on stack and change directory.
2431
2435
2432 Usage:\
2436 Usage:\
2433 %pushd ['dirname']
2437 %pushd ['dirname']
2434
2438
2435 **%pwd**::
2439 **%pwd**::
2436
2440
2437 Return the current working directory path.
2441 Return the current working directory path.
2438
2442
2439 **%pycat**::
2443 **%pycat**::
2440
2444
2441 Show a syntax-highlighted file through a pager.
2445 Show a syntax-highlighted file through a pager.
2442
2446
2443 This magic is similar to the cat utility, but it will assume the file
2447 This magic is similar to the cat utility, but it will assume the file
2444 to be Python source and will show it with syntax highlighting.
2448 to be Python source and will show it with syntax highlighting.
2445
2449
2446 **%quickref**::
2450 **%quickref**::
2447
2451
2448 Show a quick reference sheet
2452 Show a quick reference sheet
2449
2453
2450 **%quit**::
2454 **%quit**::
2451
2455
2452 Exit IPython, confirming if configured to do so (like %exit)
2456 Exit IPython, confirming if configured to do so (like %exit)
2453
2457
2454 **%r**::
2458 **%r**::
2455
2459
2456 Repeat previous input.
2460 Repeat previous input.
2457
2461
2458 Note: Consider using the more powerfull %rep instead!
2462 Note: Consider using the more powerfull %rep instead!
2459
2463
2460 If given an argument, repeats the previous command which starts with
2464 If given an argument, repeats the previous command which starts with
2461 the same string, otherwise it just repeats the previous input.
2465 the same string, otherwise it just repeats the previous input.
2462
2466
2463 Shell escaped commands (with ! as first character) are not recognized
2467 Shell escaped commands (with ! as first character) are not recognized
2464 by this system, only pure python code and magic commands.
2468 by this system, only pure python code and magic commands.
2465
2469
2466 **%rehashdir**::
2470 **%rehashdir**::
2467
2471
2468 Add executables in all specified dirs to alias table
2472 Add executables in all specified dirs to alias table
2469
2473
2470 Usage:
2474 Usage:
2471
2475
2472 %rehashdir c:/bin;c:/tools
2476 %rehashdir c:/bin;c:/tools
2473 - Add all executables under c:/bin and c:/tools to alias table, in
2477 - Add all executables under c:/bin and c:/tools to alias table, in
2474 order to make them directly executable from any directory.
2478 order to make them directly executable from any directory.
2475
2479
2476 Without arguments, add all executables in current directory.
2480 Without arguments, add all executables in current directory.
2477
2481
2478 **%rehashx**::
2482 **%rehashx**::
2479
2483
2480 Update the alias table with all executable files in $PATH.
2484 Update the alias table with all executable files in $PATH.
2481
2485
2482 This version explicitly checks that every entry in $PATH is a file
2486 This version explicitly checks that every entry in $PATH is a file
2483 with execute access (os.X_OK), so it is much slower than %rehash.
2487 with execute access (os.X_OK), so it is much slower than %rehash.
2484
2488
2485 Under Windows, it checks executability as a match agains a
2489 Under Windows, it checks executability as a match agains a
2486 '|'-separated string of extensions, stored in the IPython config
2490 '|'-separated string of extensions, stored in the IPython config
2487 variable win_exec_ext. This defaults to 'exe|com|bat'.
2491 variable win_exec_ext. This defaults to 'exe|com|bat'.
2488
2492
2489 This function also resets the root module cache of module completer,
2493 This function also resets the root module cache of module completer,
2490 used on slow filesystems.
2494 used on slow filesystems.
2491
2495
2492 **%rep**::
2496 **%rep**::
2493
2497
2494 Repeat a command, or get command to input line for editing
2498 Repeat a command, or get command to input line for editing
2495
2499
2496 - %rep (no arguments):
2500 - %rep (no arguments):
2497
2501
2498 Place a string version of last computation result (stored in the special '_'
2502 Place a string version of last computation result (stored in the special '_'
2499 variable) to the next input prompt. Allows you to create elaborate command
2503 variable) to the next input prompt. Allows you to create elaborate command
2500 lines without using copy-paste::
2504 lines without using copy-paste::
2501
2505
2502 $ l = ["hei", "vaan"]
2506 $ l = ["hei", "vaan"]
2503 $ "".join(l)
2507 $ "".join(l)
2504 ==> heivaan
2508 ==> heivaan
2505 $ %rep
2509 $ %rep
2506 $ heivaan_ <== cursor blinking
2510 $ heivaan_ <== cursor blinking
2507
2511
2508 %rep 45
2512 %rep 45
2509
2513
2510 Place history line 45 to next input prompt. Use %hist to find out the
2514 Place history line 45 to next input prompt. Use %hist to find out the
2511 number.
2515 number.
2512
2516
2513 %rep 1-4 6-7 3
2517 %rep 1-4 6-7 3
2514
2518
2515 Repeat the specified lines immediately. Input slice syntax is the same as
2519 Repeat the specified lines immediately. Input slice syntax is the same as
2516 in %macro and %save.
2520 in %macro and %save.
2517
2521
2518 %rep foo
2522 %rep foo
2519
2523
2520 Place the most recent line that has the substring "foo" to next input.
2524 Place the most recent line that has the substring "foo" to next input.
2521 (e.g. 'svn ci -m foobar').
2525 (e.g. 'svn ci -m foobar').
2522
2526
2523 **%reset**::
2527 **%reset**::
2524
2528
2525 Resets the namespace by removing all names defined by the user.
2529 Resets the namespace by removing all names defined by the user.
2526
2530
2527 Input/Output history are left around in case you need them.
2531 Input/Output history are left around in case you need them.
2528
2532
2529 **%run**::
2533 **%run**::
2530
2534
2531 Run the named file inside IPython as a program.
2535 Run the named file inside IPython as a program.
2532
2536
2533 Usage:\
2537 Usage:\
2534 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
2538 %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options]] file [args]
2535
2539
2536 Parameters after the filename are passed as command-line arguments to
2540 Parameters after the filename are passed as command-line arguments to
2537 the program (put in sys.argv). Then, control returns to IPython's
2541 the program (put in sys.argv). Then, control returns to IPython's
2538 prompt.
2542 prompt.
2539
2543
2540 This is similar to running at a system prompt:\
2544 This is similar to running at a system prompt:\
2541 $ python file args\
2545 $ python file args\
2542 but with the advantage of giving you IPython's tracebacks, and of
2546 but with the advantage of giving you IPython's tracebacks, and of
2543 loading all variables into your interactive namespace for further use
2547 loading all variables into your interactive namespace for further use
2544 (unless -p is used, see below).
2548 (unless -p is used, see below).
2545
2549
2546 The file is executed in a namespace initially consisting only of
2550 The file is executed in a namespace initially consisting only of
2547 __name__=='__main__' and sys.argv constructed as indicated. It thus
2551 __name__=='__main__' and sys.argv constructed as indicated. It thus
2548 sees its environment as if it were being run as a stand-alone program
2552 sees its environment as if it were being run as a stand-alone program
2549 (except for sharing global objects such as previously imported
2553 (except for sharing global objects such as previously imported
2550 modules). But after execution, the IPython interactive namespace gets
2554 modules). But after execution, the IPython interactive namespace gets
2551 updated with all variables defined in the program (except for __name__
2555 updated with all variables defined in the program (except for __name__
2552 and sys.argv). This allows for very convenient loading of code for
2556 and sys.argv). This allows for very convenient loading of code for
2553 interactive work, while giving each program a 'clean sheet' to run in.
2557 interactive work, while giving each program a 'clean sheet' to run in.
2554
2558
2555 Options:
2559 Options:
2556
2560
2557 -n: __name__ is NOT set to '__main__', but to the running file's name
2561 -n: __name__ is NOT set to '__main__', but to the running file's name
2558 without extension (as python does under import). This allows running
2562 without extension (as python does under import). This allows running
2559 scripts and reloading the definitions in them without calling code
2563 scripts and reloading the definitions in them without calling code
2560 protected by an ' if __name__ == "__main__" ' clause.
2564 protected by an ' if __name__ == "__main__" ' clause.
2561
2565
2562 -i: run the file in IPython's namespace instead of an empty one. This
2566 -i: run the file in IPython's namespace instead of an empty one. This
2563 is useful if you are experimenting with code written in a text editor
2567 is useful if you are experimenting with code written in a text editor
2564 which depends on variables defined interactively.
2568 which depends on variables defined interactively.
2565
2569
2566 -e: ignore sys.exit() calls or SystemExit exceptions in the script
2570 -e: ignore sys.exit() calls or SystemExit exceptions in the script
2567 being run. This is particularly useful if IPython is being used to
2571 being run. This is particularly useful if IPython is being used to
2568 run unittests, which always exit with a sys.exit() call. In such
2572 run unittests, which always exit with a sys.exit() call. In such
2569 cases you are interested in the output of the test results, not in
2573 cases you are interested in the output of the test results, not in
2570 seeing a traceback of the unittest module.
2574 seeing a traceback of the unittest module.
2571
2575
2572 -t: print timing information at the end of the run. IPython will give
2576 -t: print timing information at the end of the run. IPython will give
2573 you an estimated CPU time consumption for your script, which under
2577 you an estimated CPU time consumption for your script, which under
2574 Unix uses the resource module to avoid the wraparound problems of
2578 Unix uses the resource module to avoid the wraparound problems of
2575 time.clock(). Under Unix, an estimate of time spent on system tasks
2579 time.clock(). Under Unix, an estimate of time spent on system tasks
2576 is also given (for Windows platforms this is reported as 0.0).
2580 is also given (for Windows platforms this is reported as 0.0).
2577
2581
2578 If -t is given, an additional -N<N> option can be given, where <N>
2582 If -t is given, an additional -N<N> option can be given, where <N>
2579 must be an integer indicating how many times you want the script to
2583 must be an integer indicating how many times you want the script to
2580 run. The final timing report will include total and per run results.
2584 run. The final timing report will include total and per run results.
2581
2585
2582 For example (testing the script uniq_stable.py):
2586 For example (testing the script uniq_stable.py):
2583
2587
2584 In [1]: run -t uniq_stable
2588 In [1]: run -t uniq_stable
2585
2589
2586 IPython CPU timings (estimated):\
2590 IPython CPU timings (estimated):\
2587 User : 0.19597 s.\
2591 User : 0.19597 s.\
2588 System: 0.0 s.\
2592 System: 0.0 s.\
2589
2593
2590 In [2]: run -t -N5 uniq_stable
2594 In [2]: run -t -N5 uniq_stable
2591
2595
2592 IPython CPU timings (estimated):\
2596 IPython CPU timings (estimated):\
2593 Total runs performed: 5\
2597 Total runs performed: 5\
2594 Times : Total Per run\
2598 Times : Total Per run\
2595 User : 0.910862 s, 0.1821724 s.\
2599 User : 0.910862 s, 0.1821724 s.\
2596 System: 0.0 s, 0.0 s.
2600 System: 0.0 s, 0.0 s.
2597
2601
2598 -d: run your program under the control of pdb, the Python debugger.
2602 -d: run your program under the control of pdb, the Python debugger.
2599 This allows you to execute your program step by step, watch variables,
2603 This allows you to execute your program step by step, watch variables,
2600 etc. Internally, what IPython does is similar to calling:
2604 etc. Internally, what IPython does is similar to calling:
2601
2605
2602 pdb.run('execfile("YOURFILENAME")')
2606 pdb.run('execfile("YOURFILENAME")')
2603
2607
2604 with a breakpoint set on line 1 of your file. You can change the line
2608 with a breakpoint set on line 1 of your file. You can change the line
2605 number for this automatic breakpoint to be <N> by using the -bN option
2609 number for this automatic breakpoint to be <N> by using the -bN option
2606 (where N must be an integer). For example:
2610 (where N must be an integer). For example:
2607
2611
2608 %run -d -b40 myscript
2612 %run -d -b40 myscript
2609
2613
2610 will set the first breakpoint at line 40 in myscript.py. Note that
2614 will set the first breakpoint at line 40 in myscript.py. Note that
2611 the first breakpoint must be set on a line which actually does
2615 the first breakpoint must be set on a line which actually does
2612 something (not a comment or docstring) for it to stop execution.
2616 something (not a comment or docstring) for it to stop execution.
2613
2617
2614 When the pdb debugger starts, you will see a (Pdb) prompt. You must
2618 When the pdb debugger starts, you will see a (Pdb) prompt. You must
2615 first enter 'c' (without qoutes) to start execution up to the first
2619 first enter 'c' (without qoutes) to start execution up to the first
2616 breakpoint.
2620 breakpoint.
2617
2621
2618 Entering 'help' gives information about the use of the debugger. You
2622 Entering 'help' gives information about the use of the debugger. You
2619 can easily see pdb's full documentation with "import pdb;pdb.help()"
2623 can easily see pdb's full documentation with "import pdb;pdb.help()"
2620 at a prompt.
2624 at a prompt.
2621
2625
2622 -p: run program under the control of the Python profiler module (which
2626 -p: run program under the control of the Python profiler module (which
2623 prints a detailed report of execution times, function calls, etc).
2627 prints a detailed report of execution times, function calls, etc).
2624
2628
2625 You can pass other options after -p which affect the behavior of the
2629 You can pass other options after -p which affect the behavior of the
2626 profiler itself. See the docs for %prun for details.
2630 profiler itself. See the docs for %prun for details.
2627
2631
2628 In this mode, the program's variables do NOT propagate back to the
2632 In this mode, the program's variables do NOT propagate back to the
2629 IPython interactive namespace (because they remain in the namespace
2633 IPython interactive namespace (because they remain in the namespace
2630 where the profiler executes them).
2634 where the profiler executes them).
2631
2635
2632 Internally this triggers a call to %prun, see its documentation for
2636 Internally this triggers a call to %prun, see its documentation for
2633 details on the options available specifically for profiling.
2637 details on the options available specifically for profiling.
2634
2638
2635 There is one special usage for which the text above doesn't apply:
2639 There is one special usage for which the text above doesn't apply:
2636 if the filename ends with .ipy, the file is run as ipython script,
2640 if the filename ends with .ipy, the file is run as ipython script,
2637 just as if the commands were written on IPython prompt.
2641 just as if the commands were written on IPython prompt.
2638
2642
2639 **%runlog**::
2643 **%runlog**::
2640
2644
2641 Run files as logs.
2645 Run files as logs.
2642
2646
2643 Usage:\
2647 Usage:\
2644 %runlog file1 file2 ...
2648 %runlog file1 file2 ...
2645
2649
2646 Run the named files (treating them as log files) in sequence inside
2650 Run the named files (treating them as log files) in sequence inside
2647 the interpreter, and return to the prompt. This is much slower than
2651 the interpreter, and return to the prompt. This is much slower than
2648 %run because each line is executed in a try/except block, but it
2652 %run because each line is executed in a try/except block, but it
2649 allows running files with syntax errors in them.
2653 allows running files with syntax errors in them.
2650
2654
2651 Normally IPython will guess when a file is one of its own logfiles, so
2655 Normally IPython will guess when a file is one of its own logfiles, so
2652 you can typically use %run even for logs. This shorthand allows you to
2656 you can typically use %run even for logs. This shorthand allows you to
2653 force any file to be treated as a log file.
2657 force any file to be treated as a log file.
2654
2658
2655 **%save**::
2659 **%save**::
2656
2660
2657 Save a set of lines to a given filename.
2661 Save a set of lines to a given filename.
2658
2662
2659 Usage:\
2663 Usage:\
2660 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
2664 %save [options] filename n1-n2 n3-n4 ... n5 .. n6 ...
2661
2665
2662 Options:
2666 Options:
2663
2667
2664 -r: use 'raw' input. By default, the 'processed' history is used,
2668 -r: use 'raw' input. By default, the 'processed' history is used,
2665 so that magics are loaded in their transformed version to valid
2669 so that magics are loaded in their transformed version to valid
2666 Python. If this option is given, the raw input as typed as the
2670 Python. If this option is given, the raw input as typed as the
2667 command line is used instead.
2671 command line is used instead.
2668
2672
2669 This function uses the same syntax as %macro for line extraction, but
2673 This function uses the same syntax as %macro for line extraction, but
2670 instead of creating a macro it saves the resulting string to the
2674 instead of creating a macro it saves the resulting string to the
2671 filename you specify.
2675 filename you specify.
2672
2676
2673 It adds a '.py' extension to the file if you don't do so yourself, and
2677 It adds a '.py' extension to the file if you don't do so yourself, and
2674 it asks for confirmation before overwriting existing files.
2678 it asks for confirmation before overwriting existing files.
2675
2679
2676 **%sc**::
2680 **%sc**::
2677
2681
2678 Shell capture - execute a shell command and capture its output.
2682 Shell capture - execute a shell command and capture its output.
2679
2683
2680 DEPRECATED. Suboptimal, retained for backwards compatibility.
2684 DEPRECATED. Suboptimal, retained for backwards compatibility.
2681
2685
2682 You should use the form 'var = !command' instead. Example:
2686 You should use the form 'var = !command' instead. Example:
2683
2687
2684 "%sc -l myfiles = ls ~" should now be written as
2688 "%sc -l myfiles = ls ~" should now be written as
2685
2689
2686 "myfiles = !ls ~"
2690 "myfiles = !ls ~"
2687
2691
2688 myfiles.s, myfiles.l and myfiles.n still apply as documented
2692 myfiles.s, myfiles.l and myfiles.n still apply as documented
2689 below.
2693 below.
2690
2694
2691 --
2695 --
2692 %sc [options] varname=command
2696 %sc [options] varname=command
2693
2697
2694 IPython will run the given command using commands.getoutput(), and
2698 IPython will run the given command using commands.getoutput(), and
2695 will then update the user's interactive namespace with a variable
2699 will then update the user's interactive namespace with a variable
2696 called varname, containing the value of the call. Your command can
2700 called varname, containing the value of the call. Your command can
2697 contain shell wildcards, pipes, etc.
2701 contain shell wildcards, pipes, etc.
2698
2702
2699 The '=' sign in the syntax is mandatory, and the variable name you
2703 The '=' sign in the syntax is mandatory, and the variable name you
2700 supply must follow Python's standard conventions for valid names.
2704 supply must follow Python's standard conventions for valid names.
2701
2705
2702 (A special format without variable name exists for internal use)
2706 (A special format without variable name exists for internal use)
2703
2707
2704 Options:
2708 Options:
2705
2709
2706 -l: list output. Split the output on newlines into a list before
2710 -l: list output. Split the output on newlines into a list before
2707 assigning it to the given variable. By default the output is stored
2711 assigning it to the given variable. By default the output is stored
2708 as a single string.
2712 as a single string.
2709
2713
2710 -v: verbose. Print the contents of the variable.
2714 -v: verbose. Print the contents of the variable.
2711
2715
2712 In most cases you should not need to split as a list, because the
2716 In most cases you should not need to split as a list, because the
2713 returned value is a special type of string which can automatically
2717 returned value is a special type of string which can automatically
2714 provide its contents either as a list (split on newlines) or as a
2718 provide its contents either as a list (split on newlines) or as a
2715 space-separated string. These are convenient, respectively, either
2719 space-separated string. These are convenient, respectively, either
2716 for sequential processing or to be passed to a shell command.
2720 for sequential processing or to be passed to a shell command.
2717
2721
2718 For example:
2722 For example:
2719
2723
2720 # Capture into variable a
2724 # Capture into variable a
2721 In [9]: sc a=ls *py
2725 In [9]: sc a=ls *py
2722
2726
2723 # a is a string with embedded newlines
2727 # a is a string with embedded newlines
2724 In [10]: a
2728 In [10]: a
2725 Out[10]: 'setup.py win32_manual_post_install.py'
2729 Out[10]: 'setup.py win32_manual_post_install.py'
2726
2730
2727 # which can be seen as a list:
2731 # which can be seen as a list:
2728 In [11]: a.l
2732 In [11]: a.l
2729 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2733 Out[11]: ['setup.py', 'win32_manual_post_install.py']
2730
2734
2731 # or as a whitespace-separated string:
2735 # or as a whitespace-separated string:
2732 In [12]: a.s
2736 In [12]: a.s
2733 Out[12]: 'setup.py win32_manual_post_install.py'
2737 Out[12]: 'setup.py win32_manual_post_install.py'
2734
2738
2735 # a.s is useful to pass as a single command line:
2739 # a.s is useful to pass as a single command line:
2736 In [13]: !wc -l $a.s
2740 In [13]: !wc -l $a.s
2737 146 setup.py
2741 146 setup.py
2738 130 win32_manual_post_install.py
2742 130 win32_manual_post_install.py
2739 276 total
2743 276 total
2740
2744
2741 # while the list form is useful to loop over:
2745 # while the list form is useful to loop over:
2742 In [14]: for f in a.l:
2746 In [14]: for f in a.l:
2743 ....: !wc -l $f
2747 ....: !wc -l $f
2744 ....:
2748 ....:
2745 146 setup.py
2749 146 setup.py
2746 130 win32_manual_post_install.py
2750 130 win32_manual_post_install.py
2747
2751
2748 Similiarly, the lists returned by the -l option are also special, in
2752 Similiarly, the lists returned by the -l option are also special, in
2749 the sense that you can equally invoke the .s attribute on them to
2753 the sense that you can equally invoke the .s attribute on them to
2750 automatically get a whitespace-separated string from their contents:
2754 automatically get a whitespace-separated string from their contents:
2751
2755
2752 In [1]: sc -l b=ls *py
2756 In [1]: sc -l b=ls *py
2753
2757
2754 In [2]: b
2758 In [2]: b
2755 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2759 Out[2]: ['setup.py', 'win32_manual_post_install.py']
2756
2760
2757 In [3]: b.s
2761 In [3]: b.s
2758 Out[3]: 'setup.py win32_manual_post_install.py'
2762 Out[3]: 'setup.py win32_manual_post_install.py'
2759
2763
2760 In summary, both the lists and strings used for ouptut capture have
2764 In summary, both the lists and strings used for ouptut capture have
2761 the following special attributes:
2765 the following special attributes:
2762
2766
2763 .l (or .list) : value as list.
2767 .l (or .list) : value as list.
2764 .n (or .nlstr): value as newline-separated string.
2768 .n (or .nlstr): value as newline-separated string.
2765 .s (or .spstr): value as space-separated string.
2769 .s (or .spstr): value as space-separated string.
2766
2770
2767 **%store**::
2771 **%store**::
2768
2772
2769 Lightweight persistence for python variables.
2773 Lightweight persistence for python variables.
2770
2774
2771 Example:
2775 Example:
2772
2776
2773 ville@badger[~]|1> A = ['hello',10,'world']\
2777 ville@badger[~]|1> A = ['hello',10,'world']\
2774 ville@badger[~]|2> %store A\
2778 ville@badger[~]|2> %store A\
2775 ville@badger[~]|3> Exit
2779 ville@badger[~]|3> Exit
2776
2780
2777 (IPython session is closed and started again...)
2781 (IPython session is closed and started again...)
2778
2782
2779 ville@badger:~$ ipython -p pysh\
2783 ville@badger:~$ ipython -p pysh\
2780 ville@badger[~]|1> print A
2784 ville@badger[~]|1> print A
2781
2785
2782 ['hello', 10, 'world']
2786 ['hello', 10, 'world']
2783
2787
2784 Usage:
2788 Usage:
2785
2789
2786 %store - Show list of all variables and their current values\
2790 %store - Show list of all variables and their current values\
2787 %store <var> - Store the *current* value of the variable to disk\
2791 %store <var> - Store the *current* value of the variable to disk\
2788 %store -d <var> - Remove the variable and its value from storage\
2792 %store -d <var> - Remove the variable and its value from storage\
2789 %store -z - Remove all variables from storage\
2793 %store -z - Remove all variables from storage\
2790 %store -r - Refresh all variables from store (delete current vals)\
2794 %store -r - Refresh all variables from store (delete current vals)\
2791 %store foo >a.txt - Store value of foo to new file a.txt\
2795 %store foo >a.txt - Store value of foo to new file a.txt\
2792 %store foo >>a.txt - Append value of foo to file a.txt\
2796 %store foo >>a.txt - Append value of foo to file a.txt\
2793
2797
2794 It should be noted that if you change the value of a variable, you
2798 It should be noted that if you change the value of a variable, you
2795 need to %store it again if you want to persist the new value.
2799 need to %store it again if you want to persist the new value.
2796
2800
2797 Note also that the variables will need to be pickleable; most basic
2801 Note also that the variables will need to be pickleable; most basic
2798 python types can be safely %stored.
2802 python types can be safely %stored.
2799
2803
2800 Also aliases can be %store'd across sessions.
2804 Also aliases can be %store'd across sessions.
2801
2805
2802 **%sx**::
2806 **%sx**::
2803
2807
2804 Shell execute - run a shell command and capture its output.
2808 Shell execute - run a shell command and capture its output.
2805
2809
2806 %sx command
2810 %sx command
2807
2811
2808 IPython will run the given command using commands.getoutput(), and
2812 IPython will run the given command using commands.getoutput(), and
2809 return the result formatted as a list (split on '\n'). Since the
2813 return the result formatted as a list (split on '\n'). Since the
2810 output is _returned_, it will be stored in ipython's regular output
2814 output is _returned_, it will be stored in ipython's regular output
2811 cache Out[N] and in the '_N' automatic variables.
2815 cache Out[N] and in the '_N' automatic variables.
2812
2816
2813 Notes:
2817 Notes:
2814
2818
2815 1) If an input line begins with '!!', then %sx is automatically
2819 1) If an input line begins with '!!', then %sx is automatically
2816 invoked. That is, while:
2820 invoked. That is, while:
2817 !ls
2821 !ls
2818 causes ipython to simply issue system('ls'), typing
2822 causes ipython to simply issue system('ls'), typing
2819 !!ls
2823 !!ls
2820 is a shorthand equivalent to:
2824 is a shorthand equivalent to:
2821 %sx ls
2825 %sx ls
2822
2826
2823 2) %sx differs from %sc in that %sx automatically splits into a list,
2827 2) %sx differs from %sc in that %sx automatically splits into a list,
2824 like '%sc -l'. The reason for this is to make it as easy as possible
2828 like '%sc -l'. The reason for this is to make it as easy as possible
2825 to process line-oriented shell output via further python commands.
2829 to process line-oriented shell output via further python commands.
2826 %sc is meant to provide much finer control, but requires more
2830 %sc is meant to provide much finer control, but requires more
2827 typing.
2831 typing.
2828
2832
2829 3) Just like %sc -l, this is a list with special attributes:
2833 3) Just like %sc -l, this is a list with special attributes:
2830
2834
2831 .l (or .list) : value as list.
2835 .l (or .list) : value as list.
2832 .n (or .nlstr): value as newline-separated string.
2836 .n (or .nlstr): value as newline-separated string.
2833 .s (or .spstr): value as whitespace-separated string.
2837 .s (or .spstr): value as whitespace-separated string.
2834
2838
2835 This is very useful when trying to use such lists as arguments to
2839 This is very useful when trying to use such lists as arguments to
2836 system commands.
2840 system commands.
2837
2841
2838 **%system_verbose**::
2842 **%system_verbose**::
2839
2843
2840 Set verbose printing of system calls.
2844 Set verbose printing of system calls.
2841
2845
2842 If called without an argument, act as a toggle
2846 If called without an argument, act as a toggle
2843
2847
2844 **%time**::
2848 **%time**::
2845
2849
2846 Time execution of a Python statement or expression.
2850 Time execution of a Python statement or expression.
2847
2851
2848 The CPU and wall clock times are printed, and the value of the
2852 The CPU and wall clock times are printed, and the value of the
2849 expression (if any) is returned. Note that under Win32, system time
2853 expression (if any) is returned. Note that under Win32, system time
2850 is always reported as 0, since it can not be measured.
2854 is always reported as 0, since it can not be measured.
2851
2855
2852 This function provides very basic timing functionality. In Python
2856 This function provides very basic timing functionality. In Python
2853 2.3, the timeit module offers more control and sophistication, so this
2857 2.3, the timeit module offers more control and sophistication, so this
2854 could be rewritten to use it (patches welcome).
2858 could be rewritten to use it (patches welcome).
2855
2859
2856 Some examples:
2860 Some examples:
2857
2861
2858 In [1]: time 2**128
2862 In [1]: time 2**128
2859 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
2863 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
2860 Wall time: 0.00
2864 Wall time: 0.00
2861 Out[1]: 340282366920938463463374607431768211456L
2865 Out[1]: 340282366920938463463374607431768211456L
2862
2866
2863 In [2]: n = 1000000
2867 In [2]: n = 1000000
2864
2868
2865 In [3]: time sum(range(n))
2869 In [3]: time sum(range(n))
2866 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
2870 CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s
2867 Wall time: 1.37
2871 Wall time: 1.37
2868 Out[3]: 499999500000L
2872 Out[3]: 499999500000L
2869
2873
2870 In [4]: time print 'hello world'
2874 In [4]: time print 'hello world'
2871 hello world
2875 hello world
2872 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
2876 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
2873 Wall time: 0.00
2877 Wall time: 0.00
2874
2878
2875 Note that the time needed by Python to compile the given expression
2879 Note that the time needed by Python to compile the given expression
2876 will be reported if it is more than 0.1s. In this example, the
2880 will be reported if it is more than 0.1s. In this example, the
2877 actual exponentiation is done by Python at compilation time, so while
2881 actual exponentiation is done by Python at compilation time, so while
2878 the expression can take a noticeable amount of time to compute, that
2882 the expression can take a noticeable amount of time to compute, that
2879 time is purely due to the compilation:
2883 time is purely due to the compilation:
2880
2884
2881 In [5]: time 3**9999;
2885 In [5]: time 3**9999;
2882 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
2886 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
2883 Wall time: 0.00 s
2887 Wall time: 0.00 s
2884
2888
2885 In [6]: time 3**999999;
2889 In [6]: time 3**999999;
2886 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
2890 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
2887 Wall time: 0.00 s
2891 Wall time: 0.00 s
2888 Compiler : 0.78 s
2892 Compiler : 0.78 s
2889
2893
2890 **%timeit**::
2894 **%timeit**::
2891
2895
2892 Time execution of a Python statement or expression
2896 Time execution of a Python statement or expression
2893
2897
2894 Usage:\
2898 Usage:\
2895 %timeit [-n<N> -r<R> [-t|-c]] statement
2899 %timeit [-n<N> -r<R> [-t|-c]] statement
2896
2900
2897 Time execution of a Python statement or expression using the timeit
2901 Time execution of a Python statement or expression using the timeit
2898 module.
2902 module.
2899
2903
2900 Options:
2904 Options:
2901 -n<N>: execute the given statement <N> times in a loop. If this value
2905 -n<N>: execute the given statement <N> times in a loop. If this value
2902 is not given, a fitting value is chosen.
2906 is not given, a fitting value is chosen.
2903
2907
2904 -r<R>: repeat the loop iteration <R> times and take the best result.
2908 -r<R>: repeat the loop iteration <R> times and take the best result.
2905 Default: 3
2909 Default: 3
2906
2910
2907 -t: use time.time to measure the time, which is the default on Unix.
2911 -t: use time.time to measure the time, which is the default on Unix.
2908 This function measures wall time.
2912 This function measures wall time.
2909
2913
2910 -c: use time.clock to measure the time, which is the default on
2914 -c: use time.clock to measure the time, which is the default on
2911 Windows and measures wall time. On Unix, resource.getrusage is used
2915 Windows and measures wall time. On Unix, resource.getrusage is used
2912 instead and returns the CPU user time.
2916 instead and returns the CPU user time.
2913
2917
2914 -p<P>: use a precision of <P> digits to display the timing result.
2918 -p<P>: use a precision of <P> digits to display the timing result.
2915 Default: 3
2919 Default: 3
2916
2920
2917
2921
2918 Examples:\
2922 Examples:\
2919 In [1]: %timeit pass
2923 In [1]: %timeit pass
2920 10000000 loops, best of 3: 53.3 ns per loop
2924 10000000 loops, best of 3: 53.3 ns per loop
2921
2925
2922 In [2]: u = None
2926 In [2]: u = None
2923
2927
2924 In [3]: %timeit u is None
2928 In [3]: %timeit u is None
2925 10000000 loops, best of 3: 184 ns per loop
2929 10000000 loops, best of 3: 184 ns per loop
2926
2930
2927 In [4]: %timeit -r 4 u == None
2931 In [4]: %timeit -r 4 u == None
2928 1000000 loops, best of 4: 242 ns per loop
2932 1000000 loops, best of 4: 242 ns per loop
2929
2933
2930 In [5]: import time
2934 In [5]: import time
2931
2935
2932 In [6]: %timeit -n1 time.sleep(2)
2936 In [6]: %timeit -n1 time.sleep(2)
2933 1 loops, best of 3: 2 s per loop
2937 1 loops, best of 3: 2 s per loop
2934
2938
2935
2939
2936 The times reported by %timeit will be slightly higher than those
2940 The times reported by %timeit will be slightly higher than those
2937 reported by the timeit.py script when variables are accessed. This is
2941 reported by the timeit.py script when variables are accessed. This is
2938 due to the fact that %timeit executes the statement in the namespace
2942 due to the fact that %timeit executes the statement in the namespace
2939 of the shell, compared with timeit.py, which uses a single setup
2943 of the shell, compared with timeit.py, which uses a single setup
2940 statement to import function or create variables. Generally, the bias
2944 statement to import function or create variables. Generally, the bias
2941 does not matter as long as results from timeit.py are not mixed with
2945 does not matter as long as results from timeit.py are not mixed with
2942 those from %timeit.
2946 those from %timeit.
2943
2947
2944 **%unalias**::
2948 **%unalias**::
2945
2949
2946 Remove an alias
2950 Remove an alias
2947
2951
2948 **%upgrade**::
2952 **%upgrade**::
2949
2953
2950 Upgrade your IPython installation
2954 Upgrade your IPython installation
2951
2955
2952 This will copy the config files that don't yet exist in your
2956 This will copy the config files that don't yet exist in your
2953 ipython dir from the system config dir. Use this after upgrading
2957 ipython dir from the system config dir. Use this after upgrading
2954 IPython if you don't wish to delete your .ipython dir.
2958 IPython if you don't wish to delete your .ipython dir.
2955
2959
2956 Call with -nolegacy to get rid of ipythonrc* files (recommended for
2960 Call with -nolegacy to get rid of ipythonrc* files (recommended for
2957 new users)
2961 new users)
2958
2962
2959 **%which**::
2963 **%which**::
2960
2964
2961 %which <cmd> => search PATH for files matching cmd. Also scans aliases.
2965 %which <cmd> => search PATH for files matching cmd. Also scans aliases.
2962
2966
2963 Traverses PATH and prints all files (not just executables!) that match the
2967 Traverses PATH and prints all files (not just executables!) that match the
2964 pattern on command line. Probably more useful in finding stuff
2968 pattern on command line. Probably more useful in finding stuff
2965 interactively than 'which', which only prints the first matching item.
2969 interactively than 'which', which only prints the first matching item.
2966
2970
2967 Also discovers and expands aliases, so you'll see what will be executed
2971 Also discovers and expands aliases, so you'll see what will be executed
2968 when you call an alias.
2972 when you call an alias.
2969
2973
2970 Example:
2974 Example:
2971
2975
2972 [~]|62> %which d
2976 [~]|62> %which d
2973 d -> ls -F --color=auto
2977 d -> ls -F --color=auto
2974 == c:\cygwin\bin\ls.exe
2978 == c:\cygwin\bin\ls.exe
2975 c:\cygwin\bin\d.exe
2979 c:\cygwin\bin\d.exe
2976
2980
2977 [~]|64> %which diff*
2981 [~]|64> %which diff*
2978 diff3 -> diff3
2982 diff3 -> diff3
2979 == c:\cygwin\bin\diff3.exe
2983 == c:\cygwin\bin\diff3.exe
2980 diff -> diff
2984 diff -> diff
2981 == c:\cygwin\bin\diff.exe
2985 == c:\cygwin\bin\diff.exe
2982 c:\cygwin\bin\diff.exe
2986 c:\cygwin\bin\diff.exe
2983 c:\cygwin\bin\diff3.exe
2987 c:\cygwin\bin\diff3.exe
2984
2988
2985 **%who**::
2989 **%who**::
2986
2990
2987 Print all interactive variables, with some minimal formatting.
2991 Print all interactive variables, with some minimal formatting.
2988
2992
2989 If any arguments are given, only variables whose type matches one of
2993 If any arguments are given, only variables whose type matches one of
2990 these are printed. For example:
2994 these are printed. For example:
2991
2995
2992 %who function str
2996 %who function str
2993
2997
2994 will only list functions and strings, excluding all other types of
2998 will only list functions and strings, excluding all other types of
2995 variables. To find the proper type names, simply use type(var) at a
2999 variables. To find the proper type names, simply use type(var) at a
2996 command line to see how python prints type names. For example:
3000 command line to see how python prints type names. For example:
2997
3001
2998 In [1]: type('hello')\
3002 In [1]: type('hello')\
2999 Out[1]: <type 'str'>
3003 Out[1]: <type 'str'>
3000
3004
3001 indicates that the type name for strings is 'str'.
3005 indicates that the type name for strings is 'str'.
3002
3006
3003 %who always excludes executed names loaded through your configuration
3007 %who always excludes executed names loaded through your configuration
3004 file and things which are internal to IPython.
3008 file and things which are internal to IPython.
3005
3009
3006 This is deliberate, as typically you may load many modules and the
3010 This is deliberate, as typically you may load many modules and the
3007 purpose of %who is to show you only what you've manually defined.
3011 purpose of %who is to show you only what you've manually defined.
3008
3012
3009 **%who_ls**::
3013 **%who_ls**::
3010
3014
3011 Return a sorted list of all interactive variables.
3015 Return a sorted list of all interactive variables.
3012
3016
3013 If arguments are given, only variables of types matching these
3017 If arguments are given, only variables of types matching these
3014 arguments are returned.
3018 arguments are returned.
3015
3019
3016 **%whos**::
3020 **%whos**::
3017
3021
3018 Like %who, but gives some extra information about each variable.
3022 Like %who, but gives some extra information about each variable.
3019
3023
3020 The same type filtering of %who can be applied here.
3024 The same type filtering of %who can be applied here.
3021
3025
3022 For all variables, the type is printed. Additionally it prints:
3026 For all variables, the type is printed. Additionally it prints:
3023
3027
3024 - For {},[],(): their length.
3028 - For {},[],(): their length.
3025
3029
3026 - For numpy and Numeric arrays, a summary with shape, number of
3030 - For numpy and Numeric arrays, a summary with shape, number of
3027 elements, typecode and size in memory.
3031 elements, typecode and size in memory.
3028
3032
3029 - Everything else: a string representation, snipping their middle if
3033 - Everything else: a string representation, snipping their middle if
3030 too long.
3034 too long.
3031
3035
3032 **%xmode**::
3036 **%xmode**::
3033
3037
3034 Switch modes for the exception handlers.
3038 Switch modes for the exception handlers.
3035
3039
3036 Valid modes: Plain, Context and Verbose.
3040 Valid modes: Plain, Context and Verbose.
3037
3041
3038 If called without arguments, acts as a toggle.
3042 If called without arguments, acts as a toggle.
3039
3043
3040 .. magic_end
3044 .. magic_end
3041
3045
3042 Access to the standard Python help
3046 Access to the standard Python help
3043 ----------------------------------
3047 ----------------------------------
3044
3048
3045 As of Python 2.1, a help system is available with access to object
3049 As of Python 2.1, a help system is available with access to object
3046 docstrings and the Python manuals. Simply type 'help' (no quotes) to
3050 docstrings and the Python manuals. Simply type 'help' (no quotes) to
3047 access it. You can also type help(object) to obtain information about a
3051 access it. You can also type help(object) to obtain information about a
3048 given object, and help('keyword') for information on a keyword. As noted
3052 given object, and help('keyword') for information on a keyword. As noted
3049 in sec. `accessing help`_, you need to properly configure
3053 in sec. `accessing help`_, you need to properly configure
3050 your environment variable PYTHONDOCS for this feature to work correctly.
3054 your environment variable PYTHONDOCS for this feature to work correctly.
3051
3055
3052
3056
3053 Dynamic object information
3057 Dynamic object information
3054 --------------------------
3058 --------------------------
3055
3059
3056 Typing ?word or word? prints detailed information about an object. If
3060 Typing ?word or word? prints detailed information about an object. If
3057 certain strings in the object are too long (docstrings, code, etc.) they
3061 certain strings in the object are too long (docstrings, code, etc.) they
3058 get snipped in the center for brevity. This system gives access variable
3062 get snipped in the center for brevity. This system gives access variable
3059 types and values, full source code for any object (if available),
3063 types and values, full source code for any object (if available),
3060 function prototypes and other useful information.
3064 function prototypes and other useful information.
3061
3065
3062 Typing ??word or word?? gives access to the full information without
3066 Typing ??word or word?? gives access to the full information without
3063 snipping long strings. Long strings are sent to the screen through the
3067 snipping long strings. Long strings are sent to the screen through the
3064 less pager if longer than the screen and printed otherwise. On systems
3068 less pager if longer than the screen and printed otherwise. On systems
3065 lacking the less command, IPython uses a very basic internal pager.
3069 lacking the less command, IPython uses a very basic internal pager.
3066
3070
3067 The following magic functions are particularly useful for gathering
3071 The following magic functions are particularly useful for gathering
3068 information about your working environment. You can get more details by
3072 information about your working environment. You can get more details by
3069 typing %magic or querying them individually (use %function_name? with or
3073 typing %magic or querying them individually (use %function_name? with or
3070 without the %), this is just a summary:
3074 without the %), this is just a summary:
3071
3075
3072 * **%pdoc <object>**: Print (or run through a pager if too long) the
3076 * **%pdoc <object>**: Print (or run through a pager if too long) the
3073 docstring for an object. If the given object is a class, it will
3077 docstring for an object. If the given object is a class, it will
3074 print both the class and the constructor docstrings.
3078 print both the class and the constructor docstrings.
3075 * **%pdef <object>**: Print the definition header for any callable
3079 * **%pdef <object>**: Print the definition header for any callable
3076 object. If the object is a class, print the constructor information.
3080 object. If the object is a class, print the constructor information.
3077 * **%psource <object>**: Print (or run through a pager if too long)
3081 * **%psource <object>**: Print (or run through a pager if too long)
3078 the source code for an object.
3082 the source code for an object.
3079 * **%pfile <object>**: Show the entire source file where an object was
3083 * **%pfile <object>**: Show the entire source file where an object was
3080 defined via a pager, opening it at the line where the object
3084 defined via a pager, opening it at the line where the object
3081 definition begins.
3085 definition begins.
3082 * **%who/%whos**: These functions give information about identifiers
3086 * **%who/%whos**: These functions give information about identifiers
3083 you have defined interactively (not things you loaded or defined
3087 you have defined interactively (not things you loaded or defined
3084 in your configuration files). %who just prints a list of
3088 in your configuration files). %who just prints a list of
3085 identifiers and %whos prints a table with some basic details about
3089 identifiers and %whos prints a table with some basic details about
3086 each identifier.
3090 each identifier.
3087
3091
3088 Note that the dynamic object information functions (?/??, %pdoc, %pfile,
3092 Note that the dynamic object information functions (?/??, %pdoc, %pfile,
3089 %pdef, %psource) give you access to documentation even on things which
3093 %pdef, %psource) give you access to documentation even on things which
3090 are not really defined as separate identifiers. Try for example typing
3094 are not really defined as separate identifiers. Try for example typing
3091 {}.get? or after doing import os, type os.path.abspath??.
3095 {}.get? or after doing import os, type os.path.abspath??.
3092
3096
3093
3097
3094 .. _Readline:
3098 .. _Readline:
3095
3099
3096 Readline-based features
3100 Readline-based features
3097 -----------------------
3101 -----------------------
3098
3102
3099 These features require the GNU readline library, so they won't work if
3103 These features require the GNU readline library, so they won't work if
3100 your Python installation lacks readline support. We will first describe
3104 your Python installation lacks readline support. We will first describe
3101 the default behavior IPython uses, and then how to change it to suit
3105 the default behavior IPython uses, and then how to change it to suit
3102 your preferences.
3106 your preferences.
3103
3107
3104
3108
3105 Command line completion
3109 Command line completion
3106 +++++++++++++++++++++++
3110 +++++++++++++++++++++++
3107
3111
3108 At any time, hitting TAB will complete any available python commands or
3112 At any time, hitting TAB will complete any available python commands or
3109 variable names, and show you a list of the possible completions if
3113 variable names, and show you a list of the possible completions if
3110 there's no unambiguous one. It will also complete filenames in the
3114 there's no unambiguous one. It will also complete filenames in the
3111 current directory if no python names match what you've typed so far.
3115 current directory if no python names match what you've typed so far.
3112
3116
3113
3117
3114 Search command history
3118 Search command history
3115 ++++++++++++++++++++++
3119 ++++++++++++++++++++++
3116
3120
3117 IPython provides two ways for searching through previous input and thus
3121 IPython provides two ways for searching through previous input and thus
3118 reduce the need for repetitive typing:
3122 reduce the need for repetitive typing:
3119
3123
3120 1. Start typing, and then use Ctrl-p (previous,up) and Ctrl-n
3124 1. Start typing, and then use Ctrl-p (previous,up) and Ctrl-n
3121 (next,down) to search through only the history items that match
3125 (next,down) to search through only the history items that match
3122 what you've typed so far. If you use Ctrl-p/Ctrl-n at a blank
3126 what you've typed so far. If you use Ctrl-p/Ctrl-n at a blank
3123 prompt, they just behave like normal arrow keys.
3127 prompt, they just behave like normal arrow keys.
3124 2. Hit Ctrl-r: opens a search prompt. Begin typing and the system
3128 2. Hit Ctrl-r: opens a search prompt. Begin typing and the system
3125 searches your history for lines that contain what you've typed so
3129 searches your history for lines that contain what you've typed so
3126 far, completing as much as it can.
3130 far, completing as much as it can.
3127
3131
3128
3132
3129 Persistent command history across sessions
3133 Persistent command history across sessions
3130 ++++++++++++++++++++++++++++++++++++++++++
3134 ++++++++++++++++++++++++++++++++++++++++++
3131
3135
3132 IPython will save your input history when it leaves and reload it next
3136 IPython will save your input history when it leaves and reload it next
3133 time you restart it. By default, the history file is named
3137 time you restart it. By default, the history file is named
3134 $IPYTHONDIR/history, but if you've loaded a named profile,
3138 $IPYTHONDIR/history, but if you've loaded a named profile,
3135 '-PROFILE_NAME' is appended to the name. This allows you to keep
3139 '-PROFILE_NAME' is appended to the name. This allows you to keep
3136 separate histories related to various tasks: commands related to
3140 separate histories related to various tasks: commands related to
3137 numerical work will not be clobbered by a system shell history, for
3141 numerical work will not be clobbered by a system shell history, for
3138 example.
3142 example.
3139
3143
3140
3144
3141 Autoindent
3145 Autoindent
3142 ++++++++++
3146 ++++++++++
3143
3147
3144 IPython can recognize lines ending in ':' and indent the next line,
3148 IPython can recognize lines ending in ':' and indent the next line,
3145 while also un-indenting automatically after 'raise' or 'return'.
3149 while also un-indenting automatically after 'raise' or 'return'.
3146
3150
3147 This feature uses the readline library, so it will honor your ~/.inputrc
3151 This feature uses the readline library, so it will honor your ~/.inputrc
3148 configuration (or whatever file your INPUTRC variable points to). Adding
3152 configuration (or whatever file your INPUTRC variable points to). Adding
3149 the following lines to your .inputrc file can make indenting/unindenting
3153 the following lines to your .inputrc file can make indenting/unindenting
3150 more convenient (M-i indents, M-u unindents)::
3154 more convenient (M-i indents, M-u unindents)::
3151
3155
3152 $if Python
3156 $if Python
3153 "\M-i": " "
3157 "\M-i": " "
3154 "\M-u": "\d\d\d\d"
3158 "\M-u": "\d\d\d\d"
3155 $endif
3159 $endif
3156
3160
3157 Note that there are 4 spaces between the quote marks after "M-i" above.
3161 Note that there are 4 spaces between the quote marks after "M-i" above.
3158
3162
3159 Warning: this feature is ON by default, but it can cause problems with
3163 Warning: this feature is ON by default, but it can cause problems with
3160 the pasting of multi-line indented code (the pasted code gets
3164 the pasting of multi-line indented code (the pasted code gets
3161 re-indented on each line). A magic function %autoindent allows you to
3165 re-indented on each line). A magic function %autoindent allows you to
3162 toggle it on/off at runtime. You can also disable it permanently on in
3166 toggle it on/off at runtime. You can also disable it permanently on in
3163 your ipythonrc file (set autoindent 0).
3167 your ipythonrc file (set autoindent 0).
3164
3168
3165
3169
3166 Customizing readline behavior
3170 Customizing readline behavior
3167 +++++++++++++++++++++++++++++
3171 +++++++++++++++++++++++++++++
3168
3172
3169 All these features are based on the GNU readline library, which has an
3173 All these features are based on the GNU readline library, which has an
3170 extremely customizable interface. Normally, readline is configured via a
3174 extremely customizable interface. Normally, readline is configured via a
3171 file which defines the behavior of the library; the details of the
3175 file which defines the behavior of the library; the details of the
3172 syntax for this can be found in the readline documentation available
3176 syntax for this can be found in the readline documentation available
3173 with your system or on the Internet. IPython doesn't read this file (if
3177 with your system or on the Internet. IPython doesn't read this file (if
3174 it exists) directly, but it does support passing to readline valid
3178 it exists) directly, but it does support passing to readline valid
3175 options via a simple interface. In brief, you can customize readline by
3179 options via a simple interface. In brief, you can customize readline by
3176 setting the following options in your ipythonrc configuration file (note
3180 setting the following options in your ipythonrc configuration file (note
3177 that these options can not be specified at the command line):
3181 that these options can not be specified at the command line):
3178
3182
3179 * **readline_parse_and_bind**: this option can appear as many times as
3183 * **readline_parse_and_bind**: this option can appear as many times as
3180 you want, each time defining a string to be executed via a
3184 you want, each time defining a string to be executed via a
3181 readline.parse_and_bind() command. The syntax for valid commands
3185 readline.parse_and_bind() command. The syntax for valid commands
3182 of this kind can be found by reading the documentation for the GNU
3186 of this kind can be found by reading the documentation for the GNU
3183 readline library, as these commands are of the kind which readline
3187 readline library, as these commands are of the kind which readline
3184 accepts in its configuration file.
3188 accepts in its configuration file.
3185 * **readline_remove_delims**: a string of characters to be removed
3189 * **readline_remove_delims**: a string of characters to be removed
3186 from the default word-delimiters list used by readline, so that
3190 from the default word-delimiters list used by readline, so that
3187 completions may be performed on strings which contain them. Do not
3191 completions may be performed on strings which contain them. Do not
3188 change the default value unless you know what you're doing.
3192 change the default value unless you know what you're doing.
3189 * **readline_omit__names**: when tab-completion is enabled, hitting
3193 * **readline_omit__names**: when tab-completion is enabled, hitting
3190 <tab> after a '.' in a name will complete all attributes of an
3194 <tab> after a '.' in a name will complete all attributes of an
3191 object, including all the special methods whose names include
3195 object, including all the special methods whose names include
3192 double underscores (like __getitem__ or __class__). If you'd
3196 double underscores (like __getitem__ or __class__). If you'd
3193 rather not see these names by default, you can set this option to
3197 rather not see these names by default, you can set this option to
3194 1. Note that even when this option is set, you can still see those
3198 1. Note that even when this option is set, you can still see those
3195 names by explicitly typing a _ after the period and hitting <tab>:
3199 names by explicitly typing a _ after the period and hitting <tab>:
3196 'name._<tab>' will always complete attribute names starting with '_'.
3200 'name._<tab>' will always complete attribute names starting with '_'.
3197
3201
3198 This option is off by default so that new users see all
3202 This option is off by default so that new users see all
3199 attributes of any objects they are dealing with.
3203 attributes of any objects they are dealing with.
3200
3204
3201 You will find the default values along with a corresponding detailed
3205 You will find the default values along with a corresponding detailed
3202 explanation in your ipythonrc file.
3206 explanation in your ipythonrc file.
3203
3207
3204
3208
3205 Session logging and restoring
3209 Session logging and restoring
3206 -----------------------------
3210 -----------------------------
3207
3211
3208 You can log all input from a session either by starting IPython with
3212 You can log all input from a session either by starting IPython with
3209 the command line switches -log or -logfile (see sec. `command line
3213 the command line switches -log or -logfile (see sec. `command line
3210 options`_) or by activating the logging at any moment with the magic
3214 options`_) or by activating the logging at any moment with the magic
3211 function %logstart.
3215 function %logstart.
3212
3216
3213 Log files can later be reloaded with the -logplay option and IPython
3217 Log files can later be reloaded with the -logplay option and IPython
3214 will attempt to 'replay' the log by executing all the lines in it, thus
3218 will attempt to 'replay' the log by executing all the lines in it, thus
3215 restoring the state of a previous session. This feature is not quite
3219 restoring the state of a previous session. This feature is not quite
3216 perfect, but can still be useful in many cases.
3220 perfect, but can still be useful in many cases.
3217
3221
3218 The log files can also be used as a way to have a permanent record of
3222 The log files can also be used as a way to have a permanent record of
3219 any code you wrote while experimenting. Log files are regular text files
3223 any code you wrote while experimenting. Log files are regular text files
3220 which you can later open in your favorite text editor to extract code or
3224 which you can later open in your favorite text editor to extract code or
3221 to 'clean them up' before using them to replay a session.
3225 to 'clean them up' before using them to replay a session.
3222
3226
3223 The %logstart function for activating logging in mid-session is used as
3227 The %logstart function for activating logging in mid-session is used as
3224 follows:
3228 follows:
3225
3229
3226 %logstart [log_name [log_mode]]
3230 %logstart [log_name [log_mode]]
3227
3231
3228 If no name is given, it defaults to a file named 'log' in your
3232 If no name is given, it defaults to a file named 'log' in your
3229 IPYTHONDIR directory, in 'rotate' mode (see below).
3233 IPYTHONDIR directory, in 'rotate' mode (see below).
3230
3234
3231 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
3235 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
3232 history up to that point and then continues logging.
3236 history up to that point and then continues logging.
3233
3237
3234 %logstart takes a second optional parameter: logging mode. This can be
3238 %logstart takes a second optional parameter: logging mode. This can be
3235 one of (note that the modes are given unquoted):
3239 one of (note that the modes are given unquoted):
3236
3240
3237 * [over:] overwrite existing log_name.
3241 * [over:] overwrite existing log_name.
3238 * [backup:] rename (if exists) to log_name~ and start log_name.
3242 * [backup:] rename (if exists) to log_name~ and start log_name.
3239 * [append:] well, that says it.
3243 * [append:] well, that says it.
3240 * [rotate:] create rotating logs log_name.1~, log_name.2~, etc.
3244 * [rotate:] create rotating logs log_name.1~, log_name.2~, etc.
3241
3245
3242 The %logoff and %logon functions allow you to temporarily stop and
3246 The %logoff and %logon functions allow you to temporarily stop and
3243 resume logging to a file which had previously been started with
3247 resume logging to a file which had previously been started with
3244 %logstart. They will fail (with an explanation) if you try to use them
3248 %logstart. They will fail (with an explanation) if you try to use them
3245 before logging has been started.
3249 before logging has been started.
3246
3250
3247 System shell access
3251 System shell access
3248 -------------------
3252 -------------------
3249
3253
3250 Any input line beginning with a ! character is passed verbatim (minus
3254 Any input line beginning with a ! character is passed verbatim (minus
3251 the !, of course) to the underlying operating system. For example,
3255 the !, of course) to the underlying operating system. For example,
3252 typing !ls will run 'ls' in the current directory.
3256 typing !ls will run 'ls' in the current directory.
3253
3257
3254 Manual capture of command output
3258 Manual capture of command output
3255 --------------------------------
3259 --------------------------------
3256
3260
3257 If the input line begins with two exclamation marks, !!, the command is
3261 If the input line begins with two exclamation marks, !!, the command is
3258 executed but its output is captured and returned as a python list, split
3262 executed but its output is captured and returned as a python list, split
3259 on newlines. Any output sent by the subprocess to standard error is
3263 on newlines. Any output sent by the subprocess to standard error is
3260 printed separately, so that the resulting list only captures standard
3264 printed separately, so that the resulting list only captures standard
3261 output. The !! syntax is a shorthand for the %sx magic command.
3265 output. The !! syntax is a shorthand for the %sx magic command.
3262
3266
3263 Finally, the %sc magic (short for 'shell capture') is similar to %sx,
3267 Finally, the %sc magic (short for 'shell capture') is similar to %sx,
3264 but allowing more fine-grained control of the capture details, and
3268 but allowing more fine-grained control of the capture details, and
3265 storing the result directly into a named variable. The direct use of
3269 storing the result directly into a named variable. The direct use of
3266 %sc is now deprecated, and you should ise the ``var = !cmd`` syntax
3270 %sc is now deprecated, and you should ise the ``var = !cmd`` syntax
3267 instead.
3271 instead.
3268
3272
3269 IPython also allows you to expand the value of python variables when
3273 IPython also allows you to expand the value of python variables when
3270 making system calls. Any python variable or expression which you prepend
3274 making system calls. Any python variable or expression which you prepend
3271 with $ will get expanded before the system call is made::
3275 with $ will get expanded before the system call is made::
3272
3276
3273 In [1]: pyvar='Hello world'
3277 In [1]: pyvar='Hello world'
3274 In [2]: !echo "A python variable: $pyvar"
3278 In [2]: !echo "A python variable: $pyvar"
3275 A python variable: Hello world
3279 A python variable: Hello world
3276
3280
3277 If you want the shell to actually see a literal $, you need to type it
3281 If you want the shell to actually see a literal $, you need to type it
3278 twice::
3282 twice::
3279
3283
3280 In [3]: !echo "A system variable: $$HOME"
3284 In [3]: !echo "A system variable: $$HOME"
3281 A system variable: /home/fperez
3285 A system variable: /home/fperez
3282
3286
3283 You can pass arbitrary expressions, though you'll need to delimit them
3287 You can pass arbitrary expressions, though you'll need to delimit them
3284 with {} if there is ambiguity as to the extent of the expression::
3288 with {} if there is ambiguity as to the extent of the expression::
3285
3289
3286 In [5]: x=10
3290 In [5]: x=10
3287 In [6]: y=20
3291 In [6]: y=20
3288 In [13]: !echo $x+y
3292 In [13]: !echo $x+y
3289 10+y
3293 10+y
3290 In [7]: !echo ${x+y}
3294 In [7]: !echo ${x+y}
3291 30
3295 30
3292
3296
3293 Even object attributes can be expanded::
3297 Even object attributes can be expanded::
3294
3298
3295 In [12]: !echo $sys.argv
3299 In [12]: !echo $sys.argv
3296 [/home/fperez/usr/bin/ipython]
3300 [/home/fperez/usr/bin/ipython]
3297
3301
3298
3302
3299 System command aliases
3303 System command aliases
3300 ----------------------
3304 ----------------------
3301
3305
3302 The %alias magic function and the alias option in the ipythonrc
3306 The %alias magic function and the alias option in the ipythonrc
3303 configuration file allow you to define magic functions which are in fact
3307 configuration file allow you to define magic functions which are in fact
3304 system shell commands. These aliases can have parameters.
3308 system shell commands. These aliases can have parameters.
3305
3309
3306 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
3310 '%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
3307
3311
3308 Then, typing '%alias_name params' will execute the system command 'cmd
3312 Then, typing '%alias_name params' will execute the system command 'cmd
3309 params' (from your underlying operating system).
3313 params' (from your underlying operating system).
3310
3314
3311 You can also define aliases with parameters using %s specifiers (one per
3315 You can also define aliases with parameters using %s specifiers (one per
3312 parameter). The following example defines the %parts function as an
3316 parameter). The following example defines the %parts function as an
3313 alias to the command 'echo first %s second %s' where each %s will be
3317 alias to the command 'echo first %s second %s' where each %s will be
3314 replaced by a positional parameter to the call to %parts::
3318 replaced by a positional parameter to the call to %parts::
3315
3319
3316 In [1]: alias parts echo first %s second %s
3320 In [1]: alias parts echo first %s second %s
3317 In [2]: %parts A B
3321 In [2]: %parts A B
3318 first A second B
3322 first A second B
3319 In [3]: %parts A
3323 In [3]: %parts A
3320 Incorrect number of arguments: 2 expected.
3324 Incorrect number of arguments: 2 expected.
3321 parts is an alias to: 'echo first %s second %s'
3325 parts is an alias to: 'echo first %s second %s'
3322
3326
3323 If called with no parameters, %alias prints the table of currently
3327 If called with no parameters, %alias prints the table of currently
3324 defined aliases.
3328 defined aliases.
3325
3329
3326 The %rehash/rehashx magics allow you to load your entire $PATH as
3330 The %rehash/rehashx magics allow you to load your entire $PATH as
3327 ipython aliases. See their respective docstrings (or sec. 6.2
3331 ipython aliases. See their respective docstrings (or sec. 6.2
3328 <#sec:magic> for further details).
3332 <#sec:magic> for further details).
3329
3333
3330
3334
3331 .. _dreload:
3335 .. _dreload:
3332
3336
3333 Recursive reload
3337 Recursive reload
3334 ----------------
3338 ----------------
3335
3339
3336 The dreload function does a recursive reload of a module: changes made
3340 The dreload function does a recursive reload of a module: changes made
3337 to the module since you imported will actually be available without
3341 to the module since you imported will actually be available without
3338 having to exit.
3342 having to exit.
3339
3343
3340
3344
3341 Verbose and colored exception traceback printouts
3345 Verbose and colored exception traceback printouts
3342 -------------------------------------------------
3346 -------------------------------------------------
3343
3347
3344 IPython provides the option to see very detailed exception tracebacks,
3348 IPython provides the option to see very detailed exception tracebacks,
3345 which can be especially useful when debugging large programs. You can
3349 which can be especially useful when debugging large programs. You can
3346 run any Python file with the %run function to benefit from these
3350 run any Python file with the %run function to benefit from these
3347 detailed tracebacks. Furthermore, both normal and verbose tracebacks can
3351 detailed tracebacks. Furthermore, both normal and verbose tracebacks can
3348 be colored (if your terminal supports it) which makes them much easier
3352 be colored (if your terminal supports it) which makes them much easier
3349 to parse visually.
3353 to parse visually.
3350
3354
3351 See the magic xmode and colors functions for details (just type %magic).
3355 See the magic xmode and colors functions for details (just type %magic).
3352
3356
3353 These features are basically a terminal version of Ka-Ping Yee's cgitb
3357 These features are basically a terminal version of Ka-Ping Yee's cgitb
3354 module, now part of the standard Python library.
3358 module, now part of the standard Python library.
3355
3359
3356
3360
3357 .. _Input caching:
3361 .. _Input caching:
3358
3362
3359 Input caching system
3363 Input caching system
3360 --------------------
3364 --------------------
3361
3365
3362 IPython offers numbered prompts (In/Out) with input and output caching.
3366 IPython offers numbered prompts (In/Out) with input and output caching.
3363 All input is saved and can be retrieved as variables (besides the usual
3367 All input is saved and can be retrieved as variables (besides the usual
3364 arrow key recall).
3368 arrow key recall).
3365
3369
3366 The following GLOBAL variables always exist (so don't overwrite them!):
3370 The following GLOBAL variables always exist (so don't overwrite them!):
3367 _i: stores previous input. _ii: next previous. _iii: next-next previous.
3371 _i: stores previous input. _ii: next previous. _iii: next-next previous.
3368 _ih : a list of all input _ih[n] is the input from line n and this list
3372 _ih : a list of all input _ih[n] is the input from line n and this list
3369 is aliased to the global variable In. If you overwrite In with a
3373 is aliased to the global variable In. If you overwrite In with a
3370 variable of your own, you can remake the assignment to the internal list
3374 variable of your own, you can remake the assignment to the internal list
3371 with a simple 'In=_ih'.
3375 with a simple 'In=_ih'.
3372
3376
3373 Additionally, global variables named _i<n> are dynamically created (<n>
3377 Additionally, global variables named _i<n> are dynamically created (<n>
3374 being the prompt counter), such that
3378 being the prompt counter), such that
3375 _i<n> == _ih[<n>] == In[<n>].
3379 _i<n> == _ih[<n>] == In[<n>].
3376
3380
3377 For example, what you typed at prompt 14 is available as _i14, _ih[14]
3381 For example, what you typed at prompt 14 is available as _i14, _ih[14]
3378 and In[14].
3382 and In[14].
3379
3383
3380 This allows you to easily cut and paste multi line interactive prompts
3384 This allows you to easily cut and paste multi line interactive prompts
3381 by printing them out: they print like a clean string, without prompt
3385 by printing them out: they print like a clean string, without prompt
3382 characters. You can also manipulate them like regular variables (they
3386 characters. You can also manipulate them like regular variables (they
3383 are strings), modify or exec them (typing 'exec _i9' will re-execute the
3387 are strings), modify or exec them (typing 'exec _i9' will re-execute the
3384 contents of input prompt 9, 'exec In[9:14]+In[18]' will re-execute lines
3388 contents of input prompt 9, 'exec In[9:14]+In[18]' will re-execute lines
3385 9 through 13 and line 18).
3389 9 through 13 and line 18).
3386
3390
3387 You can also re-execute multiple lines of input easily by using the
3391 You can also re-execute multiple lines of input easily by using the
3388 magic %macro function (which automates the process and allows
3392 magic %macro function (which automates the process and allows
3389 re-execution without having to type 'exec' every time). The macro system
3393 re-execution without having to type 'exec' every time). The macro system
3390 also allows you to re-execute previous lines which include magic
3394 also allows you to re-execute previous lines which include magic
3391 function calls (which require special processing). Type %macro? or see
3395 function calls (which require special processing). Type %macro? or see
3392 sec. 6.2 <#sec:magic> for more details on the macro system.
3396 sec. 6.2 <#sec:magic> for more details on the macro system.
3393
3397
3394 A history function %hist allows you to see any part of your input
3398 A history function %hist allows you to see any part of your input
3395 history by printing a range of the _i variables.
3399 history by printing a range of the _i variables.
3396
3400
3397 .. _Output caching:
3401 .. _Output caching:
3398
3402
3399 Output caching system
3403 Output caching system
3400 ---------------------
3404 ---------------------
3401
3405
3402 For output that is returned from actions, a system similar to the input
3406 For output that is returned from actions, a system similar to the input
3403 cache exists but using _ instead of _i. Only actions that produce a
3407 cache exists but using _ instead of _i. Only actions that produce a
3404 result (NOT assignments, for example) are cached. If you are familiar
3408 result (NOT assignments, for example) are cached. If you are familiar
3405 with Mathematica, IPython's _ variables behave exactly like
3409 with Mathematica, IPython's _ variables behave exactly like
3406 Mathematica's % variables.
3410 Mathematica's % variables.
3407
3411
3408 The following GLOBAL variables always exist (so don't overwrite them!):
3412 The following GLOBAL variables always exist (so don't overwrite them!):
3409
3413
3410 * [_] (a single underscore) : stores previous output, like Python's
3414 * [_] (a single underscore) : stores previous output, like Python's
3411 default interpreter.
3415 default interpreter.
3412 * [__] (two underscores): next previous.
3416 * [__] (two underscores): next previous.
3413 * [___] (three underscores): next-next previous.
3417 * [___] (three underscores): next-next previous.
3414
3418
3415 Additionally, global variables named _<n> are dynamically created (<n>
3419 Additionally, global variables named _<n> are dynamically created (<n>
3416 being the prompt counter), such that the result of output <n> is always
3420 being the prompt counter), such that the result of output <n> is always
3417 available as _<n> (don't use the angle brackets, just the number, e.g.
3421 available as _<n> (don't use the angle brackets, just the number, e.g.
3418 _21).
3422 _21).
3419
3423
3420 These global variables are all stored in a global dictionary (not a
3424 These global variables are all stored in a global dictionary (not a
3421 list, since it only has entries for lines which returned a result)
3425 list, since it only has entries for lines which returned a result)
3422 available under the names _oh and Out (similar to _ih and In). So the
3426 available under the names _oh and Out (similar to _ih and In). So the
3423 output from line 12 can be obtained as _12, Out[12] or _oh[12]. If you
3427 output from line 12 can be obtained as _12, Out[12] or _oh[12]. If you
3424 accidentally overwrite the Out variable you can recover it by typing
3428 accidentally overwrite the Out variable you can recover it by typing
3425 'Out=_oh' at the prompt.
3429 'Out=_oh' at the prompt.
3426
3430
3427 This system obviously can potentially put heavy memory demands on your
3431 This system obviously can potentially put heavy memory demands on your
3428 system, since it prevents Python's garbage collector from removing any
3432 system, since it prevents Python's garbage collector from removing any
3429 previously computed results. You can control how many results are kept
3433 previously computed results. You can control how many results are kept
3430 in memory with the option (at the command line or in your ipythonrc
3434 in memory with the option (at the command line or in your ipythonrc
3431 file) cache_size. If you set it to 0, the whole system is completely
3435 file) cache_size. If you set it to 0, the whole system is completely
3432 disabled and the prompts revert to the classic '>>>' of normal Python.
3436 disabled and the prompts revert to the classic '>>>' of normal Python.
3433
3437
3434
3438
3435 Directory history
3439 Directory history
3436 -----------------
3440 -----------------
3437
3441
3438 Your history of visited directories is kept in the global list _dh, and
3442 Your history of visited directories is kept in the global list _dh, and
3439 the magic %cd command can be used to go to any entry in that list. The
3443 the magic %cd command can be used to go to any entry in that list. The
3440 %dhist command allows you to view this history. do ``cd -<TAB`` to
3444 %dhist command allows you to view this history. do ``cd -<TAB`` to
3441 conventiently view the directory history.
3445 conventiently view the directory history.
3442
3446
3443
3447
3444 Automatic parentheses and quotes
3448 Automatic parentheses and quotes
3445 --------------------------------
3449 --------------------------------
3446
3450
3447 These features were adapted from Nathan Gray's LazyPython. They are
3451 These features were adapted from Nathan Gray's LazyPython. They are
3448 meant to allow less typing for common situations.
3452 meant to allow less typing for common situations.
3449
3453
3450
3454
3451 Automatic parentheses
3455 Automatic parentheses
3452 ---------------------
3456 ---------------------
3453
3457
3454 Callable objects (i.e. functions, methods, etc) can be invoked like this
3458 Callable objects (i.e. functions, methods, etc) can be invoked like this
3455 (notice the commas between the arguments)::
3459 (notice the commas between the arguments)::
3456
3460
3457 >>> callable_ob arg1, arg2, arg3
3461 >>> callable_ob arg1, arg2, arg3
3458
3462
3459 and the input will be translated to this::
3463 and the input will be translated to this::
3460
3464
3461 -> callable_ob(arg1, arg2, arg3)
3465 -> callable_ob(arg1, arg2, arg3)
3462
3466
3463 You can force automatic parentheses by using '/' as the first character
3467 You can force automatic parentheses by using '/' as the first character
3464 of a line. For example::
3468 of a line. For example::
3465
3469
3466 >>> /globals # becomes 'globals()'
3470 >>> /globals # becomes 'globals()'
3467
3471
3468 Note that the '/' MUST be the first character on the line! This won't work::
3472 Note that the '/' MUST be the first character on the line! This won't work::
3469
3473
3470 >>> print /globals # syntax error
3474 >>> print /globals # syntax error
3471
3475
3472 In most cases the automatic algorithm should work, so you should rarely
3476 In most cases the automatic algorithm should work, so you should rarely
3473 need to explicitly invoke /. One notable exception is if you are trying
3477 need to explicitly invoke /. One notable exception is if you are trying
3474 to call a function with a list of tuples as arguments (the parenthesis
3478 to call a function with a list of tuples as arguments (the parenthesis
3475 will confuse IPython)::
3479 will confuse IPython)::
3476
3480
3477 In [1]: zip (1,2,3),(4,5,6) # won't work
3481 In [1]: zip (1,2,3),(4,5,6) # won't work
3478
3482
3479 but this will work::
3483 but this will work::
3480
3484
3481 In [2]: /zip (1,2,3),(4,5,6)
3485 In [2]: /zip (1,2,3),(4,5,6)
3482 ---> zip ((1,2,3),(4,5,6))
3486 ---> zip ((1,2,3),(4,5,6))
3483 Out[2]= [(1, 4), (2, 5), (3, 6)]
3487 Out[2]= [(1, 4), (2, 5), (3, 6)]
3484
3488
3485 IPython tells you that it has altered your command line by displaying
3489 IPython tells you that it has altered your command line by displaying
3486 the new command line preceded by ->. e.g.::
3490 the new command line preceded by ->. e.g.::
3487
3491
3488 In [18]: callable list
3492 In [18]: callable list
3489 ----> callable (list)
3493 ----> callable (list)
3490
3494
3491
3495
3492 Automatic quoting
3496 Automatic quoting
3493 -----------------
3497 -----------------
3494
3498
3495 You can force automatic quoting of a function's arguments by using ','
3499 You can force automatic quoting of a function's arguments by using ','
3496 or ';' as the first character of a line. For example::
3500 or ';' as the first character of a line. For example::
3497
3501
3498 >>> ,my_function /home/me # becomes my_function("/home/me")
3502 >>> ,my_function /home/me # becomes my_function("/home/me")
3499
3503
3500 If you use ';' instead, the whole argument is quoted as a single string
3504 If you use ';' instead, the whole argument is quoted as a single string
3501 (while ',' splits on whitespace)::
3505 (while ',' splits on whitespace)::
3502
3506
3503 >>> ,my_function a b c # becomes my_function("a","b","c")
3507 >>> ,my_function a b c # becomes my_function("a","b","c")
3504
3508
3505 >>> ;my_function a b c # becomes my_function("a b c")
3509 >>> ;my_function a b c # becomes my_function("a b c")
3506
3510
3507 Note that the ',' or ';' MUST be the first character on the line! This
3511 Note that the ',' or ';' MUST be the first character on the line! This
3508 won't work::
3512 won't work::
3509
3513
3510 >>> x = ,my_function /home/me # syntax error
3514 >>> x = ,my_function /home/me # syntax error
3511
3515
3512 .. customization:
3516 .. customization:
3513
3517
3514 Customization
3518 Customization
3515 =============
3519 =============
3516
3520
3517 There are 2 ways to configure IPython - the old way of using ipythonrc
3521 There are 2 ways to configure IPython - the old way of using ipythonrc
3518 files (an INI-file like format), and the new way that involves editing
3522 files (an INI-file like format), and the new way that involves editing
3519 your ipy_user_conf.py. Both configuration systems work at the same
3523 your ipy_user_conf.py. Both configuration systems work at the same
3520 time, so you can set your options in both, but if you are hesitating
3524 time, so you can set your options in both, but if you are hesitating
3521 about which alternative to choose, we recommend the ipy_user_conf.py
3525 about which alternative to choose, we recommend the ipy_user_conf.py
3522 approach, as it will give you more power and control in the long
3526 approach, as it will give you more power and control in the long
3523 run. However, there are few options such as pylab_import_all that can
3527 run. However, there are few options such as pylab_import_all that can
3524 only be specified in ipythonrc file or command line - the reason for
3528 only be specified in ipythonrc file or command line - the reason for
3525 this is that they are needed before IPython has been started up, and
3529 this is that they are needed before IPython has been started up, and
3526 the IPApi object used in ipy_user_conf.py is not yet available at that
3530 the IPApi object used in ipy_user_conf.py is not yet available at that
3527 time. A hybrid approach of specifying a few options in ipythonrc and
3531 time. A hybrid approach of specifying a few options in ipythonrc and
3528 doing the more advanced configuration in ipy_user_conf.py is also
3532 doing the more advanced configuration in ipy_user_conf.py is also
3529 possible.
3533 possible.
3530
3534
3531 The ipythonrc approach
3535 The ipythonrc approach
3532 ----------------------
3536 ----------------------
3533
3537
3534 As we've already mentioned, IPython reads a configuration file which can
3538 As we've already mentioned, IPython reads a configuration file which can
3535 be specified at the command line (-rcfile) or which by default is
3539 be specified at the command line (-rcfile) or which by default is
3536 assumed to be called ipythonrc. Such a file is looked for in the current
3540 assumed to be called ipythonrc. Such a file is looked for in the current
3537 directory where IPython is started and then in your IPYTHONDIR, which
3541 directory where IPython is started and then in your IPYTHONDIR, which
3538 allows you to have local configuration files for specific projects. In
3542 allows you to have local configuration files for specific projects. In
3539 this section we will call these types of configuration files simply
3543 this section we will call these types of configuration files simply
3540 rcfiles (short for resource configuration file).
3544 rcfiles (short for resource configuration file).
3541
3545
3542 The syntax of an rcfile is one of key-value pairs separated by
3546 The syntax of an rcfile is one of key-value pairs separated by
3543 whitespace, one per line. Lines beginning with a # are ignored as
3547 whitespace, one per line. Lines beginning with a # are ignored as
3544 comments, but comments can not be put on lines with data (the parser is
3548 comments, but comments can not be put on lines with data (the parser is
3545 fairly primitive). Note that these are not python files, and this is
3549 fairly primitive). Note that these are not python files, and this is
3546 deliberate, because it allows us to do some things which would be quite
3550 deliberate, because it allows us to do some things which would be quite
3547 tricky to implement if they were normal python files.
3551 tricky to implement if they were normal python files.
3548
3552
3549 First, an rcfile can contain permanent default values for almost all
3553 First, an rcfile can contain permanent default values for almost all
3550 command line options (except things like -help or -Version). Sec
3554 command line options (except things like -help or -Version). Sec
3551 `command line options`_ contains a description of all command-line
3555 `command line options`_ contains a description of all command-line
3552 options. However, values you explicitly specify at the command line
3556 options. However, values you explicitly specify at the command line
3553 override the values defined in the rcfile.
3557 override the values defined in the rcfile.
3554
3558
3555 Besides command line option values, the rcfile can specify values for
3559 Besides command line option values, the rcfile can specify values for
3556 certain extra special options which are not available at the command
3560 certain extra special options which are not available at the command
3557 line. These options are briefly described below.
3561 line. These options are briefly described below.
3558
3562
3559 Each of these options may appear as many times as you need it in the file.
3563 Each of these options may appear as many times as you need it in the file.
3560
3564
3561 * include <file1> <file2> ...: you can name other rcfiles you want
3565 * include <file1> <file2> ...: you can name other rcfiles you want
3562 to recursively load up to 15 levels (don't use the <> brackets in
3566 to recursively load up to 15 levels (don't use the <> brackets in
3563 your names!). This feature allows you to define a 'base' rcfile
3567 your names!). This feature allows you to define a 'base' rcfile
3564 with general options and special-purpose files which can be loaded
3568 with general options and special-purpose files which can be loaded
3565 only when needed with particular configuration options. To make
3569 only when needed with particular configuration options. To make
3566 this more convenient, IPython accepts the -profile <name> option
3570 this more convenient, IPython accepts the -profile <name> option
3567 (abbreviates to -p <name>) which tells it to look for an rcfile
3571 (abbreviates to -p <name>) which tells it to look for an rcfile
3568 named ipythonrc-<name>.
3572 named ipythonrc-<name>.
3569 * import_mod <mod1> <mod2> ...: import modules with 'import
3573 * import_mod <mod1> <mod2> ...: import modules with 'import
3570 <mod1>,<mod2>,...'
3574 <mod1>,<mod2>,...'
3571 * import_some <mod> <f1> <f2> ...: import functions with 'from
3575 * import_some <mod> <f1> <f2> ...: import functions with 'from
3572 <mod> import <f1>,<f2>,...'
3576 <mod> import <f1>,<f2>,...'
3573 * import_all <mod1> <mod2> ...: for each module listed import
3577 * import_all <mod1> <mod2> ...: for each module listed import
3574 functions with ``from <mod> import *``.
3578 functions with ``from <mod> import *``.
3575 * execute <python code>: give any single-line python code to be
3579 * execute <python code>: give any single-line python code to be
3576 executed.
3580 executed.
3577 * execfile <filename>: execute the python file given with an
3581 * execfile <filename>: execute the python file given with an
3578 'execfile(filename)' command. Username expansion is performed on
3582 'execfile(filename)' command. Username expansion is performed on
3579 the given names. So if you need any amount of extra fancy
3583 the given names. So if you need any amount of extra fancy
3580 customization that won't fit in any of the above 'canned' options,
3584 customization that won't fit in any of the above 'canned' options,
3581 you can just put it in a separate python file and execute it.
3585 you can just put it in a separate python file and execute it.
3582 * alias <alias_def>: this is equivalent to calling
3586 * alias <alias_def>: this is equivalent to calling
3583 '%alias <alias_def>' at the IPython command line. This way, from
3587 '%alias <alias_def>' at the IPython command line. This way, from
3584 within IPython you can do common system tasks without having to
3588 within IPython you can do common system tasks without having to
3585 exit it or use the ! escape. IPython isn't meant to be a shell
3589 exit it or use the ! escape. IPython isn't meant to be a shell
3586 replacement, but it is often very useful to be able to do things
3590 replacement, but it is often very useful to be able to do things
3587 with files while testing code. This gives you the flexibility to
3591 with files while testing code. This gives you the flexibility to
3588 have within IPython any aliases you may be used to under your
3592 have within IPython any aliases you may be used to under your
3589 normal system shell.
3593 normal system shell.
3590
3594
3591
3595
3592 .. _ipythonrc:
3596 .. _ipythonrc:
3593
3597
3594 Sample ipythonrc file
3598 Sample ipythonrc file
3595 ---------------------
3599 ---------------------
3596
3600
3597 The default rcfile, called ipythonrc and supplied in your IPYTHONDIR
3601 The default rcfile, called ipythonrc and supplied in your IPYTHONDIR
3598 directory contains lots of comments on all of these options. We
3602 directory contains lots of comments on all of these options. We
3599 reproduce it here for reference::
3603 reproduce it here for reference::
3600
3604
3601
3605
3602 # -*- Mode: Shell-Script -*- Not really, but shows comments correctly
3606 # -*- Mode: Shell-Script -*- Not really, but shows comments correctly
3603 # $Id: ipythonrc 2156 2007-03-19 02:32:19Z fperez $
3607 # $Id: ipythonrc 2156 2007-03-19 02:32:19Z fperez $
3604
3608
3605 #***************************************************************************
3609 #***************************************************************************
3606 #
3610 #
3607 # Configuration file for IPython -- ipythonrc format
3611 # Configuration file for IPython -- ipythonrc format
3608 #
3612 #
3609 # ===========================================================
3613 # ===========================================================
3610 # Deprecation note: you should look into modifying ipy_user_conf.py (located
3614 # Deprecation note: you should look into modifying ipy_user_conf.py (located
3611 # in ~/.ipython or ~/_ipython, depending on your platform) instead, it's a
3615 # in ~/.ipython or ~/_ipython, depending on your platform) instead, it's a
3612 # more flexible and robust (and better supported!) configuration
3616 # more flexible and robust (and better supported!) configuration
3613 # method.
3617 # method.
3614 # ===========================================================
3618 # ===========================================================
3615 #
3619 #
3616 # The format of this file is simply one of 'key value' lines.
3620 # The format of this file is simply one of 'key value' lines.
3617 # Lines containing only whitespace at the beginning and then a # are ignored
3621 # Lines containing only whitespace at the beginning and then a # are ignored
3618 # as comments. But comments can NOT be put on lines with data.
3622 # as comments. But comments can NOT be put on lines with data.
3619
3623
3620 # The meaning and use of each key are explained below.
3624 # The meaning and use of each key are explained below.
3621
3625
3622 #---------------------------------------------------------------------------
3626 #---------------------------------------------------------------------------
3623 # Section: included files
3627 # Section: included files
3624
3628
3625 # Put one or more *config* files (with the syntax of this file) you want to
3629 # Put one or more *config* files (with the syntax of this file) you want to
3626 # include. For keys with a unique value the outermost file has precedence. For
3630 # include. For keys with a unique value the outermost file has precedence. For
3627 # keys with multiple values, they all get assembled into a list which then
3631 # keys with multiple values, they all get assembled into a list which then
3628 # gets loaded by IPython.
3632 # gets loaded by IPython.
3629
3633
3630 # In this file, all lists of things should simply be space-separated.
3634 # In this file, all lists of things should simply be space-separated.
3631
3635
3632 # This allows you to build hierarchies of files which recursively load
3636 # This allows you to build hierarchies of files which recursively load
3633 # lower-level services. If this is your main ~/.ipython/ipythonrc file, you
3637 # lower-level services. If this is your main ~/.ipython/ipythonrc file, you
3634 # should only keep here basic things you always want available. Then you can
3638 # should only keep here basic things you always want available. Then you can
3635 # include it in every other special-purpose config file you create.
3639 # include it in every other special-purpose config file you create.
3636 include
3640 include
3637
3641
3638 #---------------------------------------------------------------------------
3642 #---------------------------------------------------------------------------
3639 # Section: startup setup
3643 # Section: startup setup
3640
3644
3641 # These are mostly things which parallel a command line option of the same
3645 # These are mostly things which parallel a command line option of the same
3642 # name.
3646 # name.
3643
3647
3644 # Keys in this section should only appear once. If any key from this section
3648 # Keys in this section should only appear once. If any key from this section
3645 # is encountered more than once, the last value remains, all earlier ones get
3649 # is encountered more than once, the last value remains, all earlier ones get
3646 # discarded.
3650 # discarded.
3647
3651
3648
3652
3649 # Automatic calling of callable objects. If set to 1 or 2, callable objects
3653 # Automatic calling of callable objects. If set to 1 or 2, callable objects
3650 # are automatically called when invoked at the command line, even if you don't
3654 # are automatically called when invoked at the command line, even if you don't
3651 # type parentheses. IPython adds the parentheses for you. For example:
3655 # type parentheses. IPython adds the parentheses for you. For example:
3652
3656
3653 #In [1]: str 45
3657 #In [1]: str 45
3654 #------> str(45)
3658 #------> str(45)
3655 #Out[1]: '45'
3659 #Out[1]: '45'
3656
3660
3657 # IPython reprints your line with '---->' indicating that it added
3661 # IPython reprints your line with '---->' indicating that it added
3658 # parentheses. While this option is very convenient for interactive use, it
3662 # parentheses. While this option is very convenient for interactive use, it
3659 # may occasionally cause problems with objects which have side-effects if
3663 # may occasionally cause problems with objects which have side-effects if
3660 # called unexpectedly.
3664 # called unexpectedly.
3661
3665
3662 # The valid values for autocall are:
3666 # The valid values for autocall are:
3663
3667
3664 # autocall 0 -> disabled (you can toggle it at runtime with the %autocall magic)
3668 # autocall 0 -> disabled (you can toggle it at runtime with the %autocall magic)
3665
3669
3666 # autocall 1 -> active, but do not apply if there are no arguments on the line.
3670 # autocall 1 -> active, but do not apply if there are no arguments on the line.
3667
3671
3668 # In this mode, you get:
3672 # In this mode, you get:
3669
3673
3670 #In [1]: callable
3674 #In [1]: callable
3671 #Out[1]: <built-in function callable>
3675 #Out[1]: <built-in function callable>
3672
3676
3673 #In [2]: callable 'hello'
3677 #In [2]: callable 'hello'
3674 #------> callable('hello')
3678 #------> callable('hello')
3675 #Out[2]: False
3679 #Out[2]: False
3676
3680
3677 # 2 -> Active always. Even if no arguments are present, the callable object
3681 # 2 -> Active always. Even if no arguments are present, the callable object
3678 # is called:
3682 # is called:
3679
3683
3680 #In [4]: callable
3684 #In [4]: callable
3681 #------> callable()
3685 #------> callable()
3682
3686
3683 # Note that even with autocall off, you can still use '/' at the start of a
3687 # Note that even with autocall off, you can still use '/' at the start of a
3684 # line to treat the first argument on the command line as a function and add
3688 # line to treat the first argument on the command line as a function and add
3685 # parentheses to it:
3689 # parentheses to it:
3686
3690
3687 #In [8]: /str 43
3691 #In [8]: /str 43
3688 #------> str(43)
3692 #------> str(43)
3689 #Out[8]: '43'
3693 #Out[8]: '43'
3690
3694
3691 autocall 1
3695 autocall 1
3692
3696
3693 # Auto-edit syntax errors. When you use the %edit magic in ipython to edit
3697 # Auto-edit syntax errors. When you use the %edit magic in ipython to edit
3694 # source code (see the 'editor' variable below), it is possible that you save
3698 # source code (see the 'editor' variable below), it is possible that you save
3695 # a file with syntax errors in it. If this variable is true, IPython will ask
3699 # a file with syntax errors in it. If this variable is true, IPython will ask
3696 # you whether to re-open the editor immediately to correct such an error.
3700 # you whether to re-open the editor immediately to correct such an error.
3697
3701
3698 autoedit_syntax 0
3702 autoedit_syntax 0
3699
3703
3700 # Auto-indent. IPython can recognize lines ending in ':' and indent the next
3704 # Auto-indent. IPython can recognize lines ending in ':' and indent the next
3701 # line, while also un-indenting automatically after 'raise' or 'return'.
3705 # line, while also un-indenting automatically after 'raise' or 'return'.
3702
3706
3703 # This feature uses the readline library, so it will honor your ~/.inputrc
3707 # This feature uses the readline library, so it will honor your ~/.inputrc
3704 # configuration (or whatever file your INPUTRC variable points to). Adding
3708 # configuration (or whatever file your INPUTRC variable points to). Adding
3705 # the following lines to your .inputrc file can make indent/unindenting more
3709 # the following lines to your .inputrc file can make indent/unindenting more
3706 # convenient (M-i indents, M-u unindents):
3710 # convenient (M-i indents, M-u unindents):
3707
3711
3708 # $if Python
3712 # $if Python
3709 # "\M-i": " "
3713 # "\M-i": " "
3710 # "\M-u": "\d\d\d\d"
3714 # "\M-u": "\d\d\d\d"
3711 # $endif
3715 # $endif
3712
3716
3713 # The feature is potentially a bit dangerous, because it can cause problems
3717 # The feature is potentially a bit dangerous, because it can cause problems
3714 # with pasting of indented code (the pasted code gets re-indented on each
3718 # with pasting of indented code (the pasted code gets re-indented on each
3715 # line). But it's a huge time-saver when working interactively. The magic
3719 # line). But it's a huge time-saver when working interactively. The magic
3716 # function %autoindent allows you to toggle it on/off at runtime.
3720 # function %autoindent allows you to toggle it on/off at runtime.
3717
3721
3718 autoindent 1
3722 autoindent 1
3719
3723
3720 # Auto-magic. This gives you access to all the magic functions without having
3724 # Auto-magic. This gives you access to all the magic functions without having
3721 # to prepend them with an % sign. If you define a variable with the same name
3725 # to prepend them with an % sign. If you define a variable with the same name
3722 # as a magic function (say who=1), you will need to access the magic function
3726 # as a magic function (say who=1), you will need to access the magic function
3723 # with % (%who in this example). However, if later you delete your variable
3727 # with % (%who in this example). However, if later you delete your variable
3724 # (del who), you'll recover the automagic calling form.
3728 # (del who), you'll recover the automagic calling form.
3725
3729
3726 # Considering that many magic functions provide a lot of shell-like
3730 # Considering that many magic functions provide a lot of shell-like
3727 # functionality, automagic gives you something close to a full Python+system
3731 # functionality, automagic gives you something close to a full Python+system
3728 # shell environment (and you can extend it further if you want).
3732 # shell environment (and you can extend it further if you want).
3729
3733
3730 automagic 1
3734 automagic 1
3731
3735
3732 # Size of the output cache. After this many entries are stored, the cache will
3736 # Size of the output cache. After this many entries are stored, the cache will
3733 # get flushed. Depending on the size of your intermediate calculations, you
3737 # get flushed. Depending on the size of your intermediate calculations, you
3734 # may have memory problems if you make it too big, since keeping things in the
3738 # may have memory problems if you make it too big, since keeping things in the
3735 # cache prevents Python from reclaiming the memory for old results. Experiment
3739 # cache prevents Python from reclaiming the memory for old results. Experiment
3736 # with a value that works well for you.
3740 # with a value that works well for you.
3737
3741
3738 # If you choose cache_size 0 IPython will revert to python's regular >>>
3742 # If you choose cache_size 0 IPython will revert to python's regular >>>
3739 # unnumbered prompt. You will still have _, __ and ___ for your last three
3743 # unnumbered prompt. You will still have _, __ and ___ for your last three
3740 # results, but that will be it. No dynamic _1, _2, etc. will be created. If
3744 # results, but that will be it. No dynamic _1, _2, etc. will be created. If
3741 # you are running on a slow machine or with very limited memory, this may
3745 # you are running on a slow machine or with very limited memory, this may
3742 # help.
3746 # help.
3743
3747
3744 cache_size 1000
3748 cache_size 1000
3745
3749
3746 # Classic mode: Setting 'classic 1' you lose many of IPython niceties,
3750 # Classic mode: Setting 'classic 1' you lose many of IPython niceties,
3747 # but that's your choice! Classic 1 -> same as IPython -classic.
3751 # but that's your choice! Classic 1 -> same as IPython -classic.
3748 # Note that this is _not_ the normal python interpreter, it's simply
3752 # Note that this is _not_ the normal python interpreter, it's simply
3749 # IPython emulating most of the classic interpreter's behavior.
3753 # IPython emulating most of the classic interpreter's behavior.
3750 classic 0
3754 classic 0
3751
3755
3752 # colors - Coloring option for prompts and traceback printouts.
3756 # colors - Coloring option for prompts and traceback printouts.
3753
3757
3754 # Currently available schemes: NoColor, Linux, LightBG.
3758 # Currently available schemes: NoColor, Linux, LightBG.
3755
3759
3756 # This option allows coloring the prompts and traceback printouts. This
3760 # This option allows coloring the prompts and traceback printouts. This
3757 # requires a terminal which can properly handle color escape sequences. If you
3761 # requires a terminal which can properly handle color escape sequences. If you
3758 # are having problems with this, use the NoColor scheme (uses no color escapes
3762 # are having problems with this, use the NoColor scheme (uses no color escapes
3759 # at all).
3763 # at all).
3760
3764
3761 # The Linux option works well in linux console type environments: dark
3765 # The Linux option works well in linux console type environments: dark
3762 # background with light fonts.
3766 # background with light fonts.
3763
3767
3764 # LightBG is similar to Linux but swaps dark/light colors to be more readable
3768 # LightBG is similar to Linux but swaps dark/light colors to be more readable
3765 # in light background terminals.
3769 # in light background terminals.
3766
3770
3767 # keep uncommented only the one you want:
3771 # keep uncommented only the one you want:
3768 colors Linux
3772 colors Linux
3769 #colors LightBG
3773 #colors LightBG
3770 #colors NoColor
3774 #colors NoColor
3771
3775
3772 ########################
3776 ########################
3773 # Note to Windows users
3777 # Note to Windows users
3774 #
3778 #
3775 # Color and readline support is avaialble to Windows users via Gary Bishop's
3779 # Color and readline support is avaialble to Windows users via Gary Bishop's
3776 # readline library. You can find Gary's tools at
3780 # readline library. You can find Gary's tools at
3777 # http://sourceforge.net/projects/uncpythontools.
3781 # http://sourceforge.net/projects/uncpythontools.
3778 # Note that his readline module requires in turn the ctypes library, available
3782 # Note that his readline module requires in turn the ctypes library, available
3779 # at http://starship.python.net/crew/theller/ctypes.
3783 # at http://starship.python.net/crew/theller/ctypes.
3780 ########################
3784 ########################
3781
3785
3782 # color_info: IPython can display information about objects via a set of
3786 # color_info: IPython can display information about objects via a set of
3783 # functions, and optionally can use colors for this, syntax highlighting
3787 # functions, and optionally can use colors for this, syntax highlighting
3784 # source code and various other elements. This information is passed through a
3788 # source code and various other elements. This information is passed through a
3785 # pager (it defaults to 'less' if $PAGER is not set).
3789 # pager (it defaults to 'less' if $PAGER is not set).
3786
3790
3787 # If your pager has problems, try to setting it to properly handle escapes
3791 # If your pager has problems, try to setting it to properly handle escapes
3788 # (see the less manpage for detail), or disable this option. The magic
3792 # (see the less manpage for detail), or disable this option. The magic
3789 # function %color_info allows you to toggle this interactively for testing.
3793 # function %color_info allows you to toggle this interactively for testing.
3790
3794
3791 color_info 1
3795 color_info 1
3792
3796
3793 # confirm_exit: set to 1 if you want IPython to confirm when you try to exit
3797 # confirm_exit: set to 1 if you want IPython to confirm when you try to exit
3794 # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using
3798 # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using
3795 # the magic functions %Exit or %Quit you can force a direct exit, bypassing
3799 # the magic functions %Exit or %Quit you can force a direct exit, bypassing
3796 # any confirmation.
3800 # any confirmation.
3797
3801
3798 confirm_exit 1
3802 confirm_exit 1
3799
3803
3800 # Use deep_reload() as a substitute for reload() by default. deep_reload() is
3804 # Use deep_reload() as a substitute for reload() by default. deep_reload() is
3801 # still available as dreload() and appears as a builtin.
3805 # still available as dreload() and appears as a builtin.
3802
3806
3803 deep_reload 0
3807 deep_reload 0
3804
3808
3805 # Which editor to use with the %edit command. If you leave this at 0, IPython
3809 # Which editor to use with the %edit command. If you leave this at 0, IPython
3806 # will honor your EDITOR environment variable. Since this editor is invoked on
3810 # will honor your EDITOR environment variable. Since this editor is invoked on
3807 # the fly by ipython and is meant for editing small code snippets, you may
3811 # the fly by ipython and is meant for editing small code snippets, you may
3808 # want to use a small, lightweight editor here.
3812 # want to use a small, lightweight editor here.
3809
3813
3810 # For Emacs users, setting up your Emacs server properly as described in the
3814 # For Emacs users, setting up your Emacs server properly as described in the
3811 # manual is a good idea. An alternative is to use jed, a very light editor
3815 # manual is a good idea. An alternative is to use jed, a very light editor
3812 # with much of the feel of Emacs (though not as powerful for heavy-duty work).
3816 # with much of the feel of Emacs (though not as powerful for heavy-duty work).
3813
3817
3814 editor 0
3818 editor 0
3815
3819
3816 # log 1 -> same as ipython -log. This automatically logs to ./ipython.log
3820 # log 1 -> same as ipython -log. This automatically logs to ./ipython.log
3817 log 0
3821 log 0
3818
3822
3819 # Same as ipython -Logfile YourLogfileName.
3823 # Same as ipython -Logfile YourLogfileName.
3820 # Don't use with log 1 (use one or the other)
3824 # Don't use with log 1 (use one or the other)
3821 logfile ''
3825 logfile ''
3822
3826
3823 # banner 0 -> same as ipython -nobanner
3827 # banner 0 -> same as ipython -nobanner
3824 banner 1
3828 banner 1
3825
3829
3826 # messages 0 -> same as ipython -nomessages
3830 # messages 0 -> same as ipython -nomessages
3827 messages 1
3831 messages 1
3828
3832
3829 # Automatically call the pdb debugger after every uncaught exception. If you
3833 # Automatically call the pdb debugger after every uncaught exception. If you
3830 # are used to debugging using pdb, this puts you automatically inside of it
3834 # are used to debugging using pdb, this puts you automatically inside of it
3831 # after any call (either in IPython or in code called by it) which triggers an
3835 # after any call (either in IPython or in code called by it) which triggers an
3832 # exception which goes uncaught.
3836 # exception which goes uncaught.
3833 pdb 0
3837 pdb 0
3834
3838
3835 # Enable the pprint module for printing. pprint tends to give a more readable
3839 # Enable the pprint module for printing. pprint tends to give a more readable
3836 # display (than print) for complex nested data structures.
3840 # display (than print) for complex nested data structures.
3837 pprint 1
3841 pprint 1
3838
3842
3839 # Prompt strings
3843 # Prompt strings
3840
3844
3841 # Most bash-like escapes can be used to customize IPython's prompts, as well as
3845 # Most bash-like escapes can be used to customize IPython's prompts, as well as
3842 # a few additional ones which are IPython-specific. All valid prompt escapes
3846 # a few additional ones which are IPython-specific. All valid prompt escapes
3843 # are described in detail in the Customization section of the IPython HTML/PDF
3847 # are described in detail in the Customization section of the IPython HTML/PDF
3844 # manual.
3848 # manual.
3845
3849
3846 # Use \# to represent the current prompt number, and quote them to protect
3850 # Use \# to represent the current prompt number, and quote them to protect
3847 # spaces.
3851 # spaces.
3848 prompt_in1 'In [\#]: '
3852 prompt_in1 'In [\#]: '
3849
3853
3850 # \D is replaced by as many dots as there are digits in the
3854 # \D is replaced by as many dots as there are digits in the
3851 # current value of \#.
3855 # current value of \#.
3852 prompt_in2 ' .\D.: '
3856 prompt_in2 ' .\D.: '
3853
3857
3854 prompt_out 'Out[\#]: '
3858 prompt_out 'Out[\#]: '
3855
3859
3856 # Select whether to left-pad the output prompts to match the length of the
3860 # Select whether to left-pad the output prompts to match the length of the
3857 # input ones. This allows you for example to use a simple '>' as an output
3861 # input ones. This allows you for example to use a simple '>' as an output
3858 # prompt, and yet have the output line up with the input. If set to false,
3862 # prompt, and yet have the output line up with the input. If set to false,
3859 # the output prompts will be unpadded (flush left).
3863 # the output prompts will be unpadded (flush left).
3860 prompts_pad_left 1
3864 prompts_pad_left 1
3861
3865
3862 # Pylab support: when ipython is started with the -pylab switch, by default it
3866 # Pylab support: when ipython is started with the -pylab switch, by default it
3863 # executes 'from matplotlib.pylab import *'. Set this variable to false if you
3867 # executes 'from matplotlib.pylab import *'. Set this variable to false if you
3864 # want to disable this behavior.
3868 # want to disable this behavior.
3865
3869
3866 # For details on pylab, see the matplotlib website:
3870 # For details on pylab, see the matplotlib website:
3867 # http://matplotlib.sf.net
3871 # http://matplotlib.sf.net
3868 pylab_import_all 1
3872 pylab_import_all 1
3869
3873
3870
3874
3871 # quick 1 -> same as ipython -quick
3875 # quick 1 -> same as ipython -quick
3872 quick 0
3876 quick 0
3873
3877
3874 # Use the readline library (1) or not (0). Most users will want this on, but
3878 # Use the readline library (1) or not (0). Most users will want this on, but
3875 # if you experience strange problems with line management (mainly when using
3879 # if you experience strange problems with line management (mainly when using
3876 # IPython inside Emacs buffers) you may try disabling it. Not having it on
3880 # IPython inside Emacs buffers) you may try disabling it. Not having it on
3877 # prevents you from getting command history with the arrow keys, searching and
3881 # prevents you from getting command history with the arrow keys, searching and
3878 # name completion using TAB.
3882 # name completion using TAB.
3879
3883
3880 readline 1
3884 readline 1
3881
3885
3882 # Screen Length: number of lines of your screen. This is used to control
3886 # Screen Length: number of lines of your screen. This is used to control
3883 # printing of very long strings. Strings longer than this number of lines will
3887 # printing of very long strings. Strings longer than this number of lines will
3884 # be paged with the less command instead of directly printed.
3888 # be paged with the less command instead of directly printed.
3885
3889
3886 # The default value for this is 0, which means IPython will auto-detect your
3890 # The default value for this is 0, which means IPython will auto-detect your
3887 # screen size every time it needs to print. If for some reason this isn't
3891 # screen size every time it needs to print. If for some reason this isn't
3888 # working well (it needs curses support), specify it yourself. Otherwise don't
3892 # working well (it needs curses support), specify it yourself. Otherwise don't
3889 # change the default.
3893 # change the default.
3890
3894
3891 screen_length 0
3895 screen_length 0
3892
3896
3893 # Prompt separators for input and output.
3897 # Prompt separators for input and output.
3894 # Use \n for newline explicitly, without quotes.
3898 # Use \n for newline explicitly, without quotes.
3895 # Use 0 (like at the cmd line) to turn off a given separator.
3899 # Use 0 (like at the cmd line) to turn off a given separator.
3896
3900
3897 # The structure of prompt printing is:
3901 # The structure of prompt printing is:
3898 # (SeparateIn)Input....
3902 # (SeparateIn)Input....
3899 # (SeparateOut)Output...
3903 # (SeparateOut)Output...
3900 # (SeparateOut2), # that is, no newline is printed after Out2
3904 # (SeparateOut2), # that is, no newline is printed after Out2
3901 # By choosing these you can organize your output any way you want.
3905 # By choosing these you can organize your output any way you want.
3902
3906
3903 separate_in \n
3907 separate_in \n
3904 separate_out 0
3908 separate_out 0
3905 separate_out2 0
3909 separate_out2 0
3906
3910
3907 # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'.
3911 # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'.
3908 # Simply removes all input/output separators, overriding the choices above.
3912 # Simply removes all input/output separators, overriding the choices above.
3909 nosep 0
3913 nosep 0
3910
3914
3911 # Wildcard searches - IPython has a system for searching names using
3915 # Wildcard searches - IPython has a system for searching names using
3912 # shell-like wildcards; type %psearch? for details. This variables sets
3916 # shell-like wildcards; type %psearch? for details. This variables sets
3913 # whether by default such searches should be case sensitive or not. You can
3917 # whether by default such searches should be case sensitive or not. You can
3914 # always override the default at the system command line or the IPython
3918 # always override the default at the system command line or the IPython
3915 # prompt.
3919 # prompt.
3916
3920
3917 wildcards_case_sensitive 1
3921 wildcards_case_sensitive 1
3918
3922
3919 # Object information: at what level of detail to display the string form of an
3923 # Object information: at what level of detail to display the string form of an
3920 # object. If set to 0, ipython will compute the string form of any object X,
3924 # object. If set to 0, ipython will compute the string form of any object X,
3921 # by calling str(X), when X? is typed. If set to 1, str(X) will only be
3925 # by calling str(X), when X? is typed. If set to 1, str(X) will only be
3922 # computed when X?? is given, and if set to 2 or higher, it will never be
3926 # computed when X?? is given, and if set to 2 or higher, it will never be
3923 # computed (there is no X??? level of detail). This is mostly of use to
3927 # computed (there is no X??? level of detail). This is mostly of use to
3924 # people who frequently manipulate objects whose string representation is
3928 # people who frequently manipulate objects whose string representation is
3925 # extremely expensive to compute.
3929 # extremely expensive to compute.
3926
3930
3927 object_info_string_level 0
3931 object_info_string_level 0
3928
3932
3929 # xmode - Exception reporting mode.
3933 # xmode - Exception reporting mode.
3930
3934
3931 # Valid modes: Plain, Context and Verbose.
3935 # Valid modes: Plain, Context and Verbose.
3932
3936
3933 # Plain: similar to python's normal traceback printing.
3937 # Plain: similar to python's normal traceback printing.
3934
3938
3935 # Context: prints 5 lines of context source code around each line in the
3939 # Context: prints 5 lines of context source code around each line in the
3936 # traceback.
3940 # traceback.
3937
3941
3938 # Verbose: similar to Context, but additionally prints the variables currently
3942 # Verbose: similar to Context, but additionally prints the variables currently
3939 # visible where the exception happened (shortening their strings if too
3943 # visible where the exception happened (shortening their strings if too
3940 # long). This can potentially be very slow, if you happen to have a huge data
3944 # long). This can potentially be very slow, if you happen to have a huge data
3941 # structure whose string representation is complex to compute. Your computer
3945 # structure whose string representation is complex to compute. Your computer
3942 # may appear to freeze for a while with cpu usage at 100%. If this occurs, you
3946 # may appear to freeze for a while with cpu usage at 100%. If this occurs, you
3943 # can cancel the traceback with Ctrl-C (maybe hitting it more than once).
3947 # can cancel the traceback with Ctrl-C (maybe hitting it more than once).
3944
3948
3945 #xmode Plain
3949 #xmode Plain
3946 xmode Context
3950 xmode Context
3947 #xmode Verbose
3951 #xmode Verbose
3948
3952
3949 # multi_line_specials: if true, allow magics, aliases and shell escapes (via
3953 # multi_line_specials: if true, allow magics, aliases and shell escapes (via
3950 # !cmd) to be used in multi-line input (like for loops). For example, if you
3954 # !cmd) to be used in multi-line input (like for loops). For example, if you
3951 # have this active, the following is valid in IPython:
3955 # have this active, the following is valid in IPython:
3952 #
3956 #
3953 #In [17]: for i in range(3):
3957 #In [17]: for i in range(3):
3954 # ....: mkdir $i
3958 # ....: mkdir $i
3955 # ....: !touch $i/hello
3959 # ....: !touch $i/hello
3956 # ....: ls -l $i
3960 # ....: ls -l $i
3957
3961
3958 multi_line_specials 1
3962 multi_line_specials 1
3959
3963
3960
3964
3961 # System calls: When IPython makes system calls (e.g. via special syntax like
3965 # System calls: When IPython makes system calls (e.g. via special syntax like
3962 # !cmd or !!cmd, or magics like %sc or %sx), it can print the command it is
3966 # !cmd or !!cmd, or magics like %sc or %sx), it can print the command it is
3963 # executing to standard output, prefixed by a header string.
3967 # executing to standard output, prefixed by a header string.
3964
3968
3965 system_header "IPython system call: "
3969 system_header "IPython system call: "
3966
3970
3967 system_verbose 1
3971 system_verbose 1
3968
3972
3969 # wxversion: request a specific wxPython version (used for -wthread)
3973 # wxversion: request a specific wxPython version (used for -wthread)
3970
3974
3971 # Set this to the value of wxPython you want to use, but note that this
3975 # Set this to the value of wxPython you want to use, but note that this
3972 # feature requires you to have the wxversion Python module to work. If you
3976 # feature requires you to have the wxversion Python module to work. If you
3973 # don't have the wxversion module (try 'import wxversion' at the prompt to
3977 # don't have the wxversion module (try 'import wxversion' at the prompt to
3974 # check) or simply want to leave the system to pick up the default, leave this
3978 # check) or simply want to leave the system to pick up the default, leave this
3975 # variable at 0.
3979 # variable at 0.
3976
3980
3977 wxversion 0
3981 wxversion 0
3978
3982
3979 #---------------------------------------------------------------------------
3983 #---------------------------------------------------------------------------
3980 # Section: Readline configuration (readline is not available for MS-Windows)
3984 # Section: Readline configuration (readline is not available for MS-Windows)
3981
3985
3982 # This is done via the following options:
3986 # This is done via the following options:
3983
3987
3984 # (i) readline_parse_and_bind: this option can appear as many times as you
3988 # (i) readline_parse_and_bind: this option can appear as many times as you
3985 # want, each time defining a string to be executed via a
3989 # want, each time defining a string to be executed via a
3986 # readline.parse_and_bind() command. The syntax for valid commands of this
3990 # readline.parse_and_bind() command. The syntax for valid commands of this
3987 # kind can be found by reading the documentation for the GNU readline library,
3991 # kind can be found by reading the documentation for the GNU readline library,
3988 # as these commands are of the kind which readline accepts in its
3992 # as these commands are of the kind which readline accepts in its
3989 # configuration file.
3993 # configuration file.
3990
3994
3991 # The TAB key can be used to complete names at the command line in one of two
3995 # The TAB key can be used to complete names at the command line in one of two
3992 # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only
3996 # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only
3993 # completes as much as possible while 'menu-complete' cycles through all
3997 # completes as much as possible while 'menu-complete' cycles through all
3994 # possible completions. Leave the one you prefer uncommented.
3998 # possible completions. Leave the one you prefer uncommented.
3995
3999
3996 readline_parse_and_bind tab: complete
4000 readline_parse_and_bind tab: complete
3997 #readline_parse_and_bind tab: menu-complete
4001 #readline_parse_and_bind tab: menu-complete
3998
4002
3999 # This binds Control-l to printing the list of all possible completions when
4003 # This binds Control-l to printing the list of all possible completions when
4000 # there is more than one (what 'complete' does when hitting TAB twice, or at
4004 # there is more than one (what 'complete' does when hitting TAB twice, or at
4001 # the first TAB if show-all-if-ambiguous is on)
4005 # the first TAB if show-all-if-ambiguous is on)
4002 readline_parse_and_bind "\C-l": possible-completions
4006 readline_parse_and_bind "\C-l": possible-completions
4003
4007
4004 # This forces readline to automatically print the above list when tab
4008 # This forces readline to automatically print the above list when tab
4005 # completion is set to 'complete'. You can still get this list manually by
4009 # completion is set to 'complete'. You can still get this list manually by
4006 # using the key bound to 'possible-completions' (Control-l by default) or by
4010 # using the key bound to 'possible-completions' (Control-l by default) or by
4007 # hitting TAB twice. Turning this on makes the printing happen at the first
4011 # hitting TAB twice. Turning this on makes the printing happen at the first
4008 # TAB.
4012 # TAB.
4009 readline_parse_and_bind set show-all-if-ambiguous on
4013 readline_parse_and_bind set show-all-if-ambiguous on
4010
4014
4011 # If you have TAB set to complete names, you can rebind any key (Control-o by
4015 # If you have TAB set to complete names, you can rebind any key (Control-o by
4012 # default) to insert a true TAB character.
4016 # default) to insert a true TAB character.
4013 readline_parse_and_bind "\C-o": tab-insert
4017 readline_parse_and_bind "\C-o": tab-insert
4014
4018
4015 # These commands allow you to indent/unindent easily, with the 4-space
4019 # These commands allow you to indent/unindent easily, with the 4-space
4016 # convention of the Python coding standards. Since IPython's internal
4020 # convention of the Python coding standards. Since IPython's internal
4017 # auto-indent system also uses 4 spaces, you should not change the number of
4021 # auto-indent system also uses 4 spaces, you should not change the number of
4018 # spaces in the code below.
4022 # spaces in the code below.
4019 readline_parse_and_bind "\M-i": " "
4023 readline_parse_and_bind "\M-i": " "
4020 readline_parse_and_bind "\M-o": "\d\d\d\d"
4024 readline_parse_and_bind "\M-o": "\d\d\d\d"
4021 readline_parse_and_bind "\M-I": "\d\d\d\d"
4025 readline_parse_and_bind "\M-I": "\d\d\d\d"
4022
4026
4023 # Bindings for incremental searches in the history. These searches use the
4027 # Bindings for incremental searches in the history. These searches use the
4024 # string typed so far on the command line and search anything in the previous
4028 # string typed so far on the command line and search anything in the previous
4025 # input history containing them.
4029 # input history containing them.
4026 readline_parse_and_bind "\C-r": reverse-search-history
4030 readline_parse_and_bind "\C-r": reverse-search-history
4027 readline_parse_and_bind "\C-s": forward-search-history
4031 readline_parse_and_bind "\C-s": forward-search-history
4028
4032
4029 # Bindings for completing the current line in the history of previous
4033 # Bindings for completing the current line in the history of previous
4030 # commands. This allows you to recall any previous command by typing its first
4034 # commands. This allows you to recall any previous command by typing its first
4031 # few letters and hitting Control-p, bypassing all intermediate commands which
4035 # few letters and hitting Control-p, bypassing all intermediate commands which
4032 # may be in the history (much faster than hitting up-arrow 50 times!)
4036 # may be in the history (much faster than hitting up-arrow 50 times!)
4033 readline_parse_and_bind "\C-p": history-search-backward
4037 readline_parse_and_bind "\C-p": history-search-backward
4034 readline_parse_and_bind "\C-n": history-search-forward
4038 readline_parse_and_bind "\C-n": history-search-forward
4035
4039
4036 # I also like to have the same functionality on the plain arrow keys. If you'd
4040 # I also like to have the same functionality on the plain arrow keys. If you'd
4037 # rather have the arrows use all the history (and not just match what you've
4041 # rather have the arrows use all the history (and not just match what you've
4038 # typed so far), comment out or delete the next two lines.
4042 # typed so far), comment out or delete the next two lines.
4039 readline_parse_and_bind "\e[A": history-search-backward
4043 readline_parse_and_bind "\e[A": history-search-backward
4040 readline_parse_and_bind "\e[B": history-search-forward
4044 readline_parse_and_bind "\e[B": history-search-forward
4041
4045
4042 # These are typically on by default under *nix, but not win32.
4046 # These are typically on by default under *nix, but not win32.
4043 readline_parse_and_bind "\C-k": kill-line
4047 readline_parse_and_bind "\C-k": kill-line
4044 readline_parse_and_bind "\C-u": unix-line-discard
4048 readline_parse_and_bind "\C-u": unix-line-discard
4045
4049
4046 # (ii) readline_remove_delims: a string of characters to be removed from the
4050 # (ii) readline_remove_delims: a string of characters to be removed from the
4047 # default word-delimiters list used by readline, so that completions may be
4051 # default word-delimiters list used by readline, so that completions may be
4048 # performed on strings which contain them.
4052 # performed on strings which contain them.
4049
4053
4050 readline_remove_delims -/~
4054 readline_remove_delims -/~
4051
4055
4052 # (iii) readline_merge_completions: whether to merge the result of all
4056 # (iii) readline_merge_completions: whether to merge the result of all
4053 # possible completions or not. If true, IPython will complete filenames,
4057 # possible completions or not. If true, IPython will complete filenames,
4054 # python names and aliases and return all possible completions. If you set it
4058 # python names and aliases and return all possible completions. If you set it
4055 # to false, each completer is used at a time, and only if it doesn't return
4059 # to false, each completer is used at a time, and only if it doesn't return
4056 # any completions is the next one used.
4060 # any completions is the next one used.
4057
4061
4058 # The default order is: [python_matches, file_matches, alias_matches]
4062 # The default order is: [python_matches, file_matches, alias_matches]
4059
4063
4060 readline_merge_completions 1
4064 readline_merge_completions 1
4061
4065
4062 # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name
4066 # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name
4063 # will complete all attributes of an object, including all the special methods
4067 # will complete all attributes of an object, including all the special methods
4064 # whose names start with single or double underscores (like __getitem__ or
4068 # whose names start with single or double underscores (like __getitem__ or
4065 # __class__).
4069 # __class__).
4066
4070
4067 # This variable allows you to control this completion behavior:
4071 # This variable allows you to control this completion behavior:
4068
4072
4069 # readline_omit__names 1 -> completion will omit showing any names starting
4073 # readline_omit__names 1 -> completion will omit showing any names starting
4070 # with two __, but it will still show names starting with one _.
4074 # with two __, but it will still show names starting with one _.
4071
4075
4072 # readline_omit__names 2 -> completion will omit all names beginning with one
4076 # readline_omit__names 2 -> completion will omit all names beginning with one
4073 # _ (which obviously means filtering out the double __ ones).
4077 # _ (which obviously means filtering out the double __ ones).
4074
4078
4075 # Even when this option is set, you can still see those names by explicitly
4079 # Even when this option is set, you can still see those names by explicitly
4076 # typing a _ after the period and hitting <tab>: 'name._<tab>' will always
4080 # typing a _ after the period and hitting <tab>: 'name._<tab>' will always
4077 # complete attribute names starting with '_'.
4081 # complete attribute names starting with '_'.
4078
4082
4079 # This option is off by default so that new users see all attributes of any
4083 # This option is off by default so that new users see all attributes of any
4080 # objects they are dealing with.
4084 # objects they are dealing with.
4081
4085
4082 readline_omit__names 0
4086 readline_omit__names 0
4083
4087
4084 #---------------------------------------------------------------------------
4088 #---------------------------------------------------------------------------
4085 # Section: modules to be loaded with 'import ...'
4089 # Section: modules to be loaded with 'import ...'
4086
4090
4087 # List, separated by spaces, the names of the modules you want to import
4091 # List, separated by spaces, the names of the modules you want to import
4088
4092
4089 # Example:
4093 # Example:
4090 # import_mod sys os
4094 # import_mod sys os
4091 # will produce internally the statements
4095 # will produce internally the statements
4092 # import sys
4096 # import sys
4093 # import os
4097 # import os
4094
4098
4095 # Each import is executed in its own try/except block, so if one module
4099 # Each import is executed in its own try/except block, so if one module
4096 # fails to load the others will still be ok.
4100 # fails to load the others will still be ok.
4097
4101
4098 import_mod
4102 import_mod
4099
4103
4100 #---------------------------------------------------------------------------
4104 #---------------------------------------------------------------------------
4101 # Section: modules to import some functions from: 'from ... import ...'
4105 # Section: modules to import some functions from: 'from ... import ...'
4102
4106
4103 # List, one per line, the modules for which you want only to import some
4107 # List, one per line, the modules for which you want only to import some
4104 # functions. Give the module name first and then the name of functions to be
4108 # functions. Give the module name first and then the name of functions to be
4105 # imported from that module.
4109 # imported from that module.
4106
4110
4107 # Example:
4111 # Example:
4108
4112
4109 # import_some IPython.genutils timing timings
4113 # import_some IPython.genutils timing timings
4110 # will produce internally the statement
4114 # will produce internally the statement
4111 # from IPython.genutils import timing, timings
4115 # from IPython.genutils import timing, timings
4112
4116
4113 # timing() and timings() are two IPython utilities for timing the execution of
4117 # timing() and timings() are two IPython utilities for timing the execution of
4114 # your own functions, which you may find useful. Just commment out the above
4118 # your own functions, which you may find useful. Just commment out the above
4115 # line if you want to test them.
4119 # line if you want to test them.
4116
4120
4117 # If you have more than one modules_some line, each gets its own try/except
4121 # If you have more than one modules_some line, each gets its own try/except
4118 # block (like modules, see above).
4122 # block (like modules, see above).
4119
4123
4120 import_some
4124 import_some
4121
4125
4122 #---------------------------------------------------------------------------
4126 #---------------------------------------------------------------------------
4123 # Section: modules to import all from : 'from ... import *'
4127 # Section: modules to import all from : 'from ... import *'
4124
4128
4125 # List (same syntax as import_mod above) those modules for which you want to
4129 # List (same syntax as import_mod above) those modules for which you want to
4126 # import all functions. Remember, this is a potentially dangerous thing to do,
4130 # import all functions. Remember, this is a potentially dangerous thing to do,
4127 # since it is very easy to overwrite names of things you need. Use with
4131 # since it is very easy to overwrite names of things you need. Use with
4128 # caution.
4132 # caution.
4129
4133
4130 # Example:
4134 # Example:
4131 # import_all sys os
4135 # import_all sys os
4132 # will produce internally the statements
4136 # will produce internally the statements
4133 # from sys import *
4137 # from sys import *
4134 # from os import *
4138 # from os import *
4135
4139
4136 # As before, each will be called in a separate try/except block.
4140 # As before, each will be called in a separate try/except block.
4137
4141
4138 import_all
4142 import_all
4139
4143
4140 #---------------------------------------------------------------------------
4144 #---------------------------------------------------------------------------
4141 # Section: Python code to execute.
4145 # Section: Python code to execute.
4142
4146
4143 # Put here code to be explicitly executed (keep it simple!)
4147 # Put here code to be explicitly executed (keep it simple!)
4144 # Put one line of python code per line. All whitespace is removed (this is a
4148 # Put one line of python code per line. All whitespace is removed (this is a
4145 # feature, not a bug), so don't get fancy building loops here.
4149 # feature, not a bug), so don't get fancy building loops here.
4146 # This is just for quick convenient creation of things you want available.
4150 # This is just for quick convenient creation of things you want available.
4147
4151
4148 # Example:
4152 # Example:
4149 # execute x = 1
4153 # execute x = 1
4150 # execute print 'hello world'; y = z = 'a'
4154 # execute print 'hello world'; y = z = 'a'
4151 # will produce internally
4155 # will produce internally
4152 # x = 1
4156 # x = 1
4153 # print 'hello world'; y = z = 'a'
4157 # print 'hello world'; y = z = 'a'
4154 # and each *line* (not each statement, we don't do python syntax parsing) is
4158 # and each *line* (not each statement, we don't do python syntax parsing) is
4155 # executed in its own try/except block.
4159 # executed in its own try/except block.
4156
4160
4157 execute
4161 execute
4158
4162
4159 # Note for the adventurous: you can use this to define your own names for the
4163 # Note for the adventurous: you can use this to define your own names for the
4160 # magic functions, by playing some namespace tricks:
4164 # magic functions, by playing some namespace tricks:
4161
4165
4162 # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
4166 # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
4163
4167
4164 # defines %pf as a new name for %profile.
4168 # defines %pf as a new name for %profile.
4165
4169
4166 #---------------------------------------------------------------------------
4170 #---------------------------------------------------------------------------
4167 # Section: Pyhton files to load and execute.
4171 # Section: Pyhton files to load and execute.
4168
4172
4169 # Put here the full names of files you want executed with execfile(file). If
4173 # Put here the full names of files you want executed with execfile(file). If
4170 # you want complicated initialization, just write whatever you want in a
4174 # you want complicated initialization, just write whatever you want in a
4171 # regular python file and load it from here.
4175 # regular python file and load it from here.
4172
4176
4173 # Filenames defined here (which *must* include the extension) are searched for
4177 # Filenames defined here (which *must* include the extension) are searched for
4174 # through all of sys.path. Since IPython adds your .ipython directory to
4178 # through all of sys.path. Since IPython adds your .ipython directory to
4175 # sys.path, they can also be placed in your .ipython dir and will be
4179 # sys.path, they can also be placed in your .ipython dir and will be
4176 # found. Otherwise (if you want to execute things not in .ipyton nor in
4180 # found. Otherwise (if you want to execute things not in .ipyton nor in
4177 # sys.path) give a full path (you can use ~, it gets expanded)
4181 # sys.path) give a full path (you can use ~, it gets expanded)
4178
4182
4179 # Example:
4183 # Example:
4180 # execfile file1.py ~/file2.py
4184 # execfile file1.py ~/file2.py
4181 # will generate
4185 # will generate
4182 # execfile('file1.py')
4186 # execfile('file1.py')
4183 # execfile('_path_to_your_home/file2.py')
4187 # execfile('_path_to_your_home/file2.py')
4184
4188
4185 # As before, each file gets its own try/except block.
4189 # As before, each file gets its own try/except block.
4186
4190
4187 execfile
4191 execfile
4188
4192
4189 # If you are feeling adventurous, you can even add functionality to IPython
4193 # If you are feeling adventurous, you can even add functionality to IPython
4190 # through here. IPython works through a global variable called __ip which
4194 # through here. IPython works through a global variable called __ip which
4191 # exists at the time when these files are read. If you know what you are doing
4195 # exists at the time when these files are read. If you know what you are doing
4192 # (read the source) you can add functions to __ip in files loaded here.
4196 # (read the source) you can add functions to __ip in files loaded here.
4193
4197
4194 # The file example-magic.py contains a simple but correct example. Try it:
4198 # The file example-magic.py contains a simple but correct example. Try it:
4195
4199
4196 # execfile example-magic.py
4200 # execfile example-magic.py
4197
4201
4198 # Look at the examples in IPython/iplib.py for more details on how these magic
4202 # Look at the examples in IPython/iplib.py for more details on how these magic
4199 # functions need to process their arguments.
4203 # functions need to process their arguments.
4200
4204
4201 #---------------------------------------------------------------------------
4205 #---------------------------------------------------------------------------
4202 # Section: aliases for system shell commands
4206 # Section: aliases for system shell commands
4203
4207
4204 # Here you can define your own names for system commands. The syntax is
4208 # Here you can define your own names for system commands. The syntax is
4205 # similar to that of the builtin %alias function:
4209 # similar to that of the builtin %alias function:
4206
4210
4207 # alias alias_name command_string
4211 # alias alias_name command_string
4208
4212
4209 # The resulting aliases are auto-generated magic functions (hence usable as
4213 # The resulting aliases are auto-generated magic functions (hence usable as
4210 # %alias_name)
4214 # %alias_name)
4211
4215
4212 # For example:
4216 # For example:
4213
4217
4214 # alias myls ls -la
4218 # alias myls ls -la
4215
4219
4216 # will define 'myls' as an alias for executing the system command 'ls -la'.
4220 # will define 'myls' as an alias for executing the system command 'ls -la'.
4217 # This allows you to customize IPython's environment to have the same aliases
4221 # This allows you to customize IPython's environment to have the same aliases
4218 # you are accustomed to from your own shell.
4222 # you are accustomed to from your own shell.
4219
4223
4220 # You can also define aliases with parameters using %s specifiers (one per
4224 # You can also define aliases with parameters using %s specifiers (one per
4221 # parameter):
4225 # parameter):
4222
4226
4223 # alias parts echo first %s second %s
4227 # alias parts echo first %s second %s
4224
4228
4225 # will give you in IPython:
4229 # will give you in IPython:
4226 # >>> %parts A B
4230 # >>> %parts A B
4227 # first A second B
4231 # first A second B
4228
4232
4229 # Use one 'alias' statement per alias you wish to define.
4233 # Use one 'alias' statement per alias you wish to define.
4230
4234
4231 # alias
4235 # alias
4232
4236
4233 #************************* end of file <ipythonrc> ************************
4237 #************************* end of file <ipythonrc> ************************
4234
4238
4235
4239
4236 ipy_user_conf.py
4240 ipy_user_conf.py
4237 ----------------
4241 ----------------
4238
4242
4239 There should be a simple template ipy_user_conf.py file in your
4243 There should be a simple template ipy_user_conf.py file in your
4240 ~/.ipython directory. It is a plain python module that is imported
4244 ~/.ipython directory. It is a plain python module that is imported
4241 during IPython startup, so you can do pretty much what you want there
4245 during IPython startup, so you can do pretty much what you want there
4242 - import modules, configure extensions, change options, define magic
4246 - import modules, configure extensions, change options, define magic
4243 commands, put variables and functions in the IPython namespace,
4247 commands, put variables and functions in the IPython namespace,
4244 etc. You use the IPython extension api object, acquired by
4248 etc. You use the IPython extension api object, acquired by
4245 IPython.ipapi.get() and documented in the "IPython extension API"
4249 IPython.ipapi.get() and documented in the "IPython extension API"
4246 chapter, to interact with IPython. A sample ipy_user_conf.py is listed
4250 chapter, to interact with IPython. A sample ipy_user_conf.py is listed
4247 below for reference::
4251 below for reference::
4248
4252
4249 # Most of your config files and extensions will probably start
4253 # Most of your config files and extensions will probably start
4250 # with this import
4254 # with this import
4251
4255
4252 import IPython.ipapi
4256 import IPython.ipapi
4253 ip = IPython.ipapi.get()
4257 ip = IPython.ipapi.get()
4254
4258
4255 # You probably want to uncomment this if you did %upgrade -nolegacy
4259 # You probably want to uncomment this if you did %upgrade -nolegacy
4256 # import ipy_defaults
4260 # import ipy_defaults
4257
4261
4258 import os
4262 import os
4259
4263
4260 def main():
4264 def main():
4261
4265
4262 #ip.dbg.debugmode = True
4266 #ip.dbg.debugmode = True
4263 ip.dbg.debug_stack()
4267 ip.dbg.debug_stack()
4264
4268
4265 # uncomment if you want to get ipython -p sh behaviour
4269 # uncomment if you want to get ipython -p sh behaviour
4266 # without having to use command line switches
4270 # without having to use command line switches
4267 import ipy_profile_sh
4271 import ipy_profile_sh
4268 import jobctrl
4272 import jobctrl
4269
4273
4270 # Configure your favourite editor?
4274 # Configure your favourite editor?
4271 # Good idea e.g. for %edit os.path.isfile
4275 # Good idea e.g. for %edit os.path.isfile
4272
4276
4273 #import ipy_editors
4277 #import ipy_editors
4274
4278
4275 # Choose one of these:
4279 # Choose one of these:
4276
4280
4277 #ipy_editors.scite()
4281 #ipy_editors.scite()
4278 #ipy_editors.scite('c:/opt/scite/scite.exe')
4282 #ipy_editors.scite('c:/opt/scite/scite.exe')
4279 #ipy_editors.komodo()
4283 #ipy_editors.komodo()
4280 #ipy_editors.idle()
4284 #ipy_editors.idle()
4281 # ... or many others, try 'ipy_editors??' after import to see them
4285 # ... or many others, try 'ipy_editors??' after import to see them
4282
4286
4283 # Or roll your own:
4287 # Or roll your own:
4284 #ipy_editors.install_editor("c:/opt/jed +$line $file")
4288 #ipy_editors.install_editor("c:/opt/jed +$line $file")
4285
4289
4286
4290
4287 o = ip.options
4291 o = ip.options
4288 # An example on how to set options
4292 # An example on how to set options
4289 #o.autocall = 1
4293 #o.autocall = 1
4290 o.system_verbose = 0
4294 o.system_verbose = 0
4291
4295
4292 #import_all("os sys")
4296 #import_all("os sys")
4293 #execf('~/_ipython/ns.py')
4297 #execf('~/_ipython/ns.py')
4294
4298
4295
4299
4296 # -- prompt
4300 # -- prompt
4297 # A different, more compact set of prompts from the default ones, that
4301 # A different, more compact set of prompts from the default ones, that
4298 # always show your current location in the filesystem:
4302 # always show your current location in the filesystem:
4299
4303
4300 #o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#>'
4304 #o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#>'
4301 #o.prompt_in2 = r'.\D: '
4305 #o.prompt_in2 = r'.\D: '
4302 #o.prompt_out = r'[\#] '
4306 #o.prompt_out = r'[\#] '
4303
4307
4304 # Try one of these color settings if you can't read the text easily
4308 # Try one of these color settings if you can't read the text easily
4305 # autoexec is a list of IPython commands to execute on startup
4309 # autoexec is a list of IPython commands to execute on startup
4306 #o.autoexec.append('%colors LightBG')
4310 #o.autoexec.append('%colors LightBG')
4307 #o.autoexec.append('%colors NoColor')
4311 #o.autoexec.append('%colors NoColor')
4308 o.autoexec.append('%colors Linux')
4312 o.autoexec.append('%colors Linux')
4309
4313
4310
4314
4311 # some config helper functions you can use
4315 # some config helper functions you can use
4312 def import_all(modules):
4316 def import_all(modules):
4313 """ Usage: import_all("os sys") """
4317 """ Usage: import_all("os sys") """
4314 for m in modules.split():
4318 for m in modules.split():
4315 ip.ex("from %s import *" % m)
4319 ip.ex("from %s import *" % m)
4316
4320
4317 def execf(fname):
4321 def execf(fname):
4318 """ Execute a file in user namespace """
4322 """ Execute a file in user namespace """
4319 ip.ex('execfile("%s")' % os.path.expanduser(fname))
4323 ip.ex('execfile("%s")' % os.path.expanduser(fname))
4320
4324
4321 main()
4325 main()
4322
4326
4323 .. _Prompts:
4327 .. _Prompts:
4324
4328
4325 Fine-tuning your prompt
4329 Fine-tuning your prompt
4326 -----------------------
4330 -----------------------
4327
4331
4328 IPython's prompts can be customized using a syntax similar to that of
4332 IPython's prompts can be customized using a syntax similar to that of
4329 the bash shell. Many of bash's escapes are supported, as well as a few
4333 the bash shell. Many of bash's escapes are supported, as well as a few
4330 additional ones. We list them below::
4334 additional ones. We list them below::
4331
4335
4332 \#
4336 \#
4333 the prompt/history count number. This escape is automatically
4337 the prompt/history count number. This escape is automatically
4334 wrapped in the coloring codes for the currently active color scheme.
4338 wrapped in the coloring codes for the currently active color scheme.
4335 \N
4339 \N
4336 the 'naked' prompt/history count number: this is just the number
4340 the 'naked' prompt/history count number: this is just the number
4337 itself, without any coloring applied to it. This lets you produce
4341 itself, without any coloring applied to it. This lets you produce
4338 numbered prompts with your own colors.
4342 numbered prompts with your own colors.
4339 \D
4343 \D
4340 the prompt/history count, with the actual digits replaced by dots.
4344 the prompt/history count, with the actual digits replaced by dots.
4341 Used mainly in continuation prompts (prompt_in2)
4345 Used mainly in continuation prompts (prompt_in2)
4342 \w
4346 \w
4343 the current working directory
4347 the current working directory
4344 \W
4348 \W
4345 the basename of current working directory
4349 the basename of current working directory
4346 \Xn
4350 \Xn
4347 where $n=0\ldots5.$ The current working directory, with $HOME
4351 where $n=0\ldots5.$ The current working directory, with $HOME
4348 replaced by ~, and filtered out to contain only $n$ path elements
4352 replaced by ~, and filtered out to contain only $n$ path elements
4349 \Yn
4353 \Yn
4350 Similar to \Xn, but with the $n+1$ element included if it is ~ (this
4354 Similar to \Xn, but with the $n+1$ element included if it is ~ (this
4351 is similar to the behavior of the %cn escapes in tcsh)
4355 is similar to the behavior of the %cn escapes in tcsh)
4352 \u
4356 \u
4353 the username of the current user
4357 the username of the current user
4354 \$
4358 \$
4355 if the effective UID is 0, a #, otherwise a $
4359 if the effective UID is 0, a #, otherwise a $
4356 \h
4360 \h
4357 the hostname up to the first '.'
4361 the hostname up to the first '.'
4358 \H
4362 \H
4359 the hostname
4363 the hostname
4360 \n
4364 \n
4361 a newline
4365 a newline
4362 \r
4366 \r
4363 a carriage return
4367 a carriage return
4364 \v
4368 \v
4365 IPython version string
4369 IPython version string
4366
4370
4367 In addition to these, ANSI color escapes can be insterted into the
4371 In addition to these, ANSI color escapes can be insterted into the
4368 prompts, as \C_ColorName. The list of valid color names is: Black, Blue,
4372 prompts, as \C_ColorName. The list of valid color names is: Black, Blue,
4369 Brown, Cyan, DarkGray, Green, LightBlue, LightCyan, LightGray,
4373 Brown, Cyan, DarkGray, Green, LightBlue, LightCyan, LightGray,
4370 LightGreen, LightPurple, LightRed, NoColor, Normal, Purple, Red, White,
4374 LightGreen, LightPurple, LightRed, NoColor, Normal, Purple, Red, White,
4371 Yellow.
4375 Yellow.
4372
4376
4373 Finally, IPython supports the evaluation of arbitrary expressions in
4377 Finally, IPython supports the evaluation of arbitrary expressions in
4374 your prompt string. The prompt strings are evaluated through the syntax
4378 your prompt string. The prompt strings are evaluated through the syntax
4375 of PEP 215, but basically you can use $x.y to expand the value of x.y,
4379 of PEP 215, but basically you can use $x.y to expand the value of x.y,
4376 and for more complicated expressions you can use braces: ${foo()+x} will
4380 and for more complicated expressions you can use braces: ${foo()+x} will
4377 call function foo and add to it the value of x, before putting the
4381 call function foo and add to it the value of x, before putting the
4378 result into your prompt. For example, using
4382 result into your prompt. For example, using
4379 prompt_in1 '${commands.getoutput("uptime")}\nIn [\#]: '
4383 prompt_in1 '${commands.getoutput("uptime")}\nIn [\#]: '
4380 will print the result of the uptime command on each prompt (assuming the
4384 will print the result of the uptime command on each prompt (assuming the
4381 commands module has been imported in your ipythonrc file).
4385 commands module has been imported in your ipythonrc file).
4382
4386
4383
4387
4384 Prompt examples
4388 Prompt examples
4385
4389
4386 The following options in an ipythonrc file will give you IPython's
4390 The following options in an ipythonrc file will give you IPython's
4387 default prompts::
4391 default prompts::
4388
4392
4389 prompt_in1 'In [\#]:'
4393 prompt_in1 'In [\#]:'
4390 prompt_in2 ' .\D.:'
4394 prompt_in2 ' .\D.:'
4391 prompt_out 'Out[\#]:'
4395 prompt_out 'Out[\#]:'
4392
4396
4393 which look like this::
4397 which look like this::
4394
4398
4395 In [1]: 1+2
4399 In [1]: 1+2
4396 Out[1]: 3
4400 Out[1]: 3
4397
4401
4398 In [2]: for i in (1,2,3):
4402 In [2]: for i in (1,2,3):
4399 ...: print i,
4403 ...: print i,
4400 ...:
4404 ...:
4401 1 2 3
4405 1 2 3
4402
4406
4403 These will give you a very colorful prompt with path information::
4407 These will give you a very colorful prompt with path information::
4404
4408
4405 #prompt_in1 '\C_Red\u\C_Blue[\C_Cyan\Y1\C_Blue]\C_LightGreen\#>'
4409 #prompt_in1 '\C_Red\u\C_Blue[\C_Cyan\Y1\C_Blue]\C_LightGreen\#>'
4406 prompt_in2 ' ..\D>'
4410 prompt_in2 ' ..\D>'
4407 prompt_out '<\#>'
4411 prompt_out '<\#>'
4408
4412
4409 which look like this::
4413 which look like this::
4410
4414
4411 fperez[~/ipython]1> 1+2
4415 fperez[~/ipython]1> 1+2
4412 <1> 3
4416 <1> 3
4413 fperez[~/ipython]2> for i in (1,2,3):
4417 fperez[~/ipython]2> for i in (1,2,3):
4414 ...> print i,
4418 ...> print i,
4415 ...>
4419 ...>
4416 1 2 3
4420 1 2 3
4417
4421
4418
4422
4419 .. _Profiles:
4423 .. _Profiles:
4420
4424
4421 IPython profiles
4425 IPython profiles
4422 ----------------
4426 ----------------
4423
4427
4424 As we already mentioned, IPython supports the -profile command-line
4428 As we already mentioned, IPython supports the -profile command-line
4425 option (see sec. `command line options`_). A profile is nothing more
4429 option (see sec. `command line options`_). A profile is nothing more
4426 than a particular configuration file like your basic ipythonrc one,
4430 than a particular configuration file like your basic ipythonrc one,
4427 but with particular customizations for a specific purpose. When you
4431 but with particular customizations for a specific purpose. When you
4428 start IPython with 'ipython -profile <name>', it assumes that in your
4432 start IPython with 'ipython -profile <name>', it assumes that in your
4429 IPYTHONDIR there is a file called ipythonrc-<name> or
4433 IPYTHONDIR there is a file called ipythonrc-<name> or
4430 ipy_profile_<name>.py, and loads it instead of the normal ipythonrc.
4434 ipy_profile_<name>.py, and loads it instead of the normal ipythonrc.
4431
4435
4432 This system allows you to maintain multiple configurations which load
4436 This system allows you to maintain multiple configurations which load
4433 modules, set options, define functions, etc. suitable for different
4437 modules, set options, define functions, etc. suitable for different
4434 tasks and activate them in a very simple manner. In order to avoid
4438 tasks and activate them in a very simple manner. In order to avoid
4435 having to repeat all of your basic options (common things that don't
4439 having to repeat all of your basic options (common things that don't
4436 change such as your color preferences, for example), any profile can
4440 change such as your color preferences, for example), any profile can
4437 include another configuration file. The most common way to use profiles
4441 include another configuration file. The most common way to use profiles
4438 is then to have each one include your basic ipythonrc file as a starting
4442 is then to have each one include your basic ipythonrc file as a starting
4439 point, and then add further customizations.
4443 point, and then add further customizations.
4440
4444
4441 IPython as your default Python environment
4445 IPython as your default Python environment
4442 ==========================================
4446 ==========================================
4443
4447
4444 Python honors the environment variable PYTHONSTARTUP and will execute at
4448 Python honors the environment variable PYTHONSTARTUP and will execute at
4445 startup the file referenced by this variable. If you put at the end of
4449 startup the file referenced by this variable. If you put at the end of
4446 this file the following two lines of code::
4450 this file the following two lines of code::
4447
4451
4448 import IPython
4452 import IPython
4449 IPython.Shell.IPShell().mainloop(sys_exit=1)
4453 IPython.Shell.IPShell().mainloop(sys_exit=1)
4450
4454
4451 then IPython will be your working environment anytime you start Python.
4455 then IPython will be your working environment anytime you start Python.
4452 The sys_exit=1 is needed to have IPython issue a call to sys.exit() when
4456 The sys_exit=1 is needed to have IPython issue a call to sys.exit() when
4453 it finishes, otherwise you'll be back at the normal Python '>>>'
4457 it finishes, otherwise you'll be back at the normal Python '>>>'
4454 prompt.
4458 prompt.
4455
4459
4456 This is probably useful to developers who manage multiple Python
4460 This is probably useful to developers who manage multiple Python
4457 versions and don't want to have correspondingly multiple IPython
4461 versions and don't want to have correspondingly multiple IPython
4458 versions. Note that in this mode, there is no way to pass IPython any
4462 versions. Note that in this mode, there is no way to pass IPython any
4459 command-line options, as those are trapped first by Python itself.
4463 command-line options, as those are trapped first by Python itself.
4460
4464
4461 .. _Embedding:
4465 .. _Embedding:
4462
4466
4463 Embedding IPython
4467 Embedding IPython
4464 =================
4468 =================
4465
4469
4466 It is possible to start an IPython instance inside your own Python
4470 It is possible to start an IPython instance inside your own Python
4467 programs. This allows you to evaluate dynamically the state of your
4471 programs. This allows you to evaluate dynamically the state of your
4468 code, operate with your variables, analyze them, etc. Note however that
4472 code, operate with your variables, analyze them, etc. Note however that
4469 any changes you make to values while in the shell do not propagate back
4473 any changes you make to values while in the shell do not propagate back
4470 to the running code, so it is safe to modify your values because you
4474 to the running code, so it is safe to modify your values because you
4471 won't break your code in bizarre ways by doing so.
4475 won't break your code in bizarre ways by doing so.
4472
4476
4473 This feature allows you to easily have a fully functional python
4477 This feature allows you to easily have a fully functional python
4474 environment for doing object introspection anywhere in your code with a
4478 environment for doing object introspection anywhere in your code with a
4475 simple function call. In some cases a simple print statement is enough,
4479 simple function call. In some cases a simple print statement is enough,
4476 but if you need to do more detailed analysis of a code fragment this
4480 but if you need to do more detailed analysis of a code fragment this
4477 feature can be very valuable.
4481 feature can be very valuable.
4478
4482
4479 It can also be useful in scientific computing situations where it is
4483 It can also be useful in scientific computing situations where it is
4480 common to need to do some automatic, computationally intensive part and
4484 common to need to do some automatic, computationally intensive part and
4481 then stop to look at data, plots, etc.
4485 then stop to look at data, plots, etc.
4482 Opening an IPython instance will give you full access to your data and
4486 Opening an IPython instance will give you full access to your data and
4483 functions, and you can resume program execution once you are done with
4487 functions, and you can resume program execution once you are done with
4484 the interactive part (perhaps to stop again later, as many times as
4488 the interactive part (perhaps to stop again later, as many times as
4485 needed).
4489 needed).
4486
4490
4487 The following code snippet is the bare minimum you need to include in
4491 The following code snippet is the bare minimum you need to include in
4488 your Python programs for this to work (detailed examples follow later)::
4492 your Python programs for this to work (detailed examples follow later)::
4489
4493
4490 from IPython.Shell import IPShellEmbed
4494 from IPython.Shell import IPShellEmbed
4491
4495
4492 ipshell = IPShellEmbed()
4496 ipshell = IPShellEmbed()
4493
4497
4494 ipshell() # this call anywhere in your program will start IPython
4498 ipshell() # this call anywhere in your program will start IPython
4495
4499
4496 You can run embedded instances even in code which is itself being run at
4500 You can run embedded instances even in code which is itself being run at
4497 the IPython interactive prompt with '%run <filename>'. Since it's easy
4501 the IPython interactive prompt with '%run <filename>'. Since it's easy
4498 to get lost as to where you are (in your top-level IPython or in your
4502 to get lost as to where you are (in your top-level IPython or in your
4499 embedded one), it's a good idea in such cases to set the in/out prompts
4503 embedded one), it's a good idea in such cases to set the in/out prompts
4500 to something different for the embedded instances. The code examples
4504 to something different for the embedded instances. The code examples
4501 below illustrate this.
4505 below illustrate this.
4502
4506
4503 You can also have multiple IPython instances in your program and open
4507 You can also have multiple IPython instances in your program and open
4504 them separately, for example with different options for data
4508 them separately, for example with different options for data
4505 presentation. If you close and open the same instance multiple times,
4509 presentation. If you close and open the same instance multiple times,
4506 its prompt counters simply continue from each execution to the next.
4510 its prompt counters simply continue from each execution to the next.
4507
4511
4508 Please look at the docstrings in the Shell.py module for more details on
4512 Please look at the docstrings in the Shell.py module for more details on
4509 the use of this system.
4513 the use of this system.
4510
4514
4511 The following sample file illustrating how to use the embedding
4515 The following sample file illustrating how to use the embedding
4512 functionality is provided in the examples directory as example-embed.py.
4516 functionality is provided in the examples directory as example-embed.py.
4513 It should be fairly self-explanatory::
4517 It should be fairly self-explanatory::
4514
4518
4515
4519
4516 #!/usr/bin/env python
4520 #!/usr/bin/env python
4517
4521
4518 """An example of how to embed an IPython shell into a running program.
4522 """An example of how to embed an IPython shell into a running program.
4519
4523
4520 Please see the documentation in the IPython.Shell module for more details.
4524 Please see the documentation in the IPython.Shell module for more details.
4521
4525
4522 The accompanying file example-embed-short.py has quick code fragments for
4526 The accompanying file example-embed-short.py has quick code fragments for
4523 embedding which you can cut and paste in your code once you understand how
4527 embedding which you can cut and paste in your code once you understand how
4524 things work.
4528 things work.
4525
4529
4526 The code in this file is deliberately extra-verbose, meant for learning."""
4530 The code in this file is deliberately extra-verbose, meant for learning."""
4527
4531
4528 # The basics to get you going:
4532 # The basics to get you going:
4529
4533
4530 # IPython sets the __IPYTHON__ variable so you can know if you have nested
4534 # IPython sets the __IPYTHON__ variable so you can know if you have nested
4531 # copies running.
4535 # copies running.
4532
4536
4533 # Try running this code both at the command line and from inside IPython (with
4537 # Try running this code both at the command line and from inside IPython (with
4534 # %run example-embed.py)
4538 # %run example-embed.py)
4535 try:
4539 try:
4536 __IPYTHON__
4540 __IPYTHON__
4537 except NameError:
4541 except NameError:
4538 nested = 0
4542 nested = 0
4539 args = ['']
4543 args = ['']
4540 else:
4544 else:
4541 print "Running nested copies of IPython."
4545 print "Running nested copies of IPython."
4542 print "The prompts for the nested copy have been modified"
4546 print "The prompts for the nested copy have been modified"
4543 nested = 1
4547 nested = 1
4544 # what the embedded instance will see as sys.argv:
4548 # what the embedded instance will see as sys.argv:
4545 args = ['-pi1','In <\\#>: ','-pi2',' .\\D.: ',
4549 args = ['-pi1','In <\\#>: ','-pi2',' .\\D.: ',
4546 '-po','Out<\\#>: ','-nosep']
4550 '-po','Out<\\#>: ','-nosep']
4547
4551
4548 # First import the embeddable shell class
4552 # First import the embeddable shell class
4549 from IPython.Shell import IPShellEmbed
4553 from IPython.Shell import IPShellEmbed
4550
4554
4551 # Now create an instance of the embeddable shell. The first argument is a
4555 # Now create an instance of the embeddable shell. The first argument is a
4552 # string with options exactly as you would type them if you were starting
4556 # string with options exactly as you would type them if you were starting
4553 # IPython at the system command line. Any parameters you want to define for
4557 # IPython at the system command line. Any parameters you want to define for
4554 # configuration can thus be specified here.
4558 # configuration can thus be specified here.
4555 ipshell = IPShellEmbed(args,
4559 ipshell = IPShellEmbed(args,
4556 banner = 'Dropping into IPython',
4560 banner = 'Dropping into IPython',
4557 exit_msg = 'Leaving Interpreter, back to program.')
4561 exit_msg = 'Leaving Interpreter, back to program.')
4558
4562
4559 # Make a second instance, you can have as many as you want.
4563 # Make a second instance, you can have as many as you want.
4560 if nested:
4564 if nested:
4561 args[1] = 'In2<\\#>'
4565 args[1] = 'In2<\\#>'
4562 else:
4566 else:
4563 args = ['-pi1','In2<\\#>: ','-pi2',' .\\D.: ',
4567 args = ['-pi1','In2<\\#>: ','-pi2',' .\\D.: ',
4564 '-po','Out<\\#>: ','-nosep']
4568 '-po','Out<\\#>: ','-nosep']
4565 ipshell2 = IPShellEmbed(args,banner = 'Second IPython instance.')
4569 ipshell2 = IPShellEmbed(args,banner = 'Second IPython instance.')
4566
4570
4567 print '\nHello. This is printed from the main controller program.\n'
4571 print '\nHello. This is printed from the main controller program.\n'
4568
4572
4569 # You can then call ipshell() anywhere you need it (with an optional
4573 # You can then call ipshell() anywhere you need it (with an optional
4570 # message):
4574 # message):
4571 ipshell('***Called from top level. '
4575 ipshell('***Called from top level. '
4572 'Hit Ctrl-D to exit interpreter and continue program.\n'
4576 'Hit Ctrl-D to exit interpreter and continue program.\n'
4573 'Note that if you use %kill_embedded, you can fully deactivate\n'
4577 'Note that if you use %kill_embedded, you can fully deactivate\n'
4574 'This embedded instance so it will never turn on again')
4578 'This embedded instance so it will never turn on again')
4575
4579
4576 print '\nBack in caller program, moving along...\n'
4580 print '\nBack in caller program, moving along...\n'
4577
4581
4578 #---------------------------------------------------------------------------
4582 #---------------------------------------------------------------------------
4579 # More details:
4583 # More details:
4580
4584
4581 # IPShellEmbed instances don't print the standard system banner and
4585 # IPShellEmbed instances don't print the standard system banner and
4582 # messages. The IPython banner (which actually may contain initialization
4586 # messages. The IPython banner (which actually may contain initialization
4583 # messages) is available as <instance>.IP.BANNER in case you want it.
4587 # messages) is available as <instance>.IP.BANNER in case you want it.
4584
4588
4585 # IPShellEmbed instances print the following information everytime they
4589 # IPShellEmbed instances print the following information everytime they
4586 # start:
4590 # start:
4587
4591
4588 # - A global startup banner.
4592 # - A global startup banner.
4589
4593
4590 # - A call-specific header string, which you can use to indicate where in the
4594 # - A call-specific header string, which you can use to indicate where in the
4591 # execution flow the shell is starting.
4595 # execution flow the shell is starting.
4592
4596
4593 # They also print an exit message every time they exit.
4597 # They also print an exit message every time they exit.
4594
4598
4595 # Both the startup banner and the exit message default to None, and can be set
4599 # Both the startup banner and the exit message default to None, and can be set
4596 # either at the instance constructor or at any other time with the
4600 # either at the instance constructor or at any other time with the
4597 # set_banner() and set_exit_msg() methods.
4601 # set_banner() and set_exit_msg() methods.
4598
4602
4599 # The shell instance can be also put in 'dummy' mode globally or on a per-call
4603 # The shell instance can be also put in 'dummy' mode globally or on a per-call
4600 # basis. This gives you fine control for debugging without having to change
4604 # basis. This gives you fine control for debugging without having to change
4601 # code all over the place.
4605 # code all over the place.
4602
4606
4603 # The code below illustrates all this.
4607 # The code below illustrates all this.
4604
4608
4605
4609
4606 # This is how the global banner and exit_msg can be reset at any point
4610 # This is how the global banner and exit_msg can be reset at any point
4607 ipshell.set_banner('Entering interpreter - New Banner')
4611 ipshell.set_banner('Entering interpreter - New Banner')
4608 ipshell.set_exit_msg('Leaving interpreter - New exit_msg')
4612 ipshell.set_exit_msg('Leaving interpreter - New exit_msg')
4609
4613
4610 def foo(m):
4614 def foo(m):
4611 s = 'spam'
4615 s = 'spam'
4612 ipshell('***In foo(). Try @whos, or print s or m:')
4616 ipshell('***In foo(). Try @whos, or print s or m:')
4613 print 'foo says m = ',m
4617 print 'foo says m = ',m
4614
4618
4615 def bar(n):
4619 def bar(n):
4616 s = 'eggs'
4620 s = 'eggs'
4617 ipshell('***In bar(). Try @whos, or print s or n:')
4621 ipshell('***In bar(). Try @whos, or print s or n:')
4618 print 'bar says n = ',n
4622 print 'bar says n = ',n
4619
4623
4620 # Some calls to the above functions which will trigger IPython:
4624 # Some calls to the above functions which will trigger IPython:
4621 print 'Main program calling foo("eggs")\n'
4625 print 'Main program calling foo("eggs")\n'
4622 foo('eggs')
4626 foo('eggs')
4623
4627
4624 # The shell can be put in 'dummy' mode where calls to it silently return. This
4628 # The shell can be put in 'dummy' mode where calls to it silently return. This
4625 # allows you, for example, to globally turn off debugging for a program with a
4629 # allows you, for example, to globally turn off debugging for a program with a
4626 # single call.
4630 # single call.
4627 ipshell.set_dummy_mode(1)
4631 ipshell.set_dummy_mode(1)
4628 print '\nTrying to call IPython which is now "dummy":'
4632 print '\nTrying to call IPython which is now "dummy":'
4629 ipshell()
4633 ipshell()
4630 print 'Nothing happened...'
4634 print 'Nothing happened...'
4631 # The global 'dummy' mode can still be overridden for a single call
4635 # The global 'dummy' mode can still be overridden for a single call
4632 print '\nOverriding dummy mode manually:'
4636 print '\nOverriding dummy mode manually:'
4633 ipshell(dummy=0)
4637 ipshell(dummy=0)
4634
4638
4635 # Reactivate the IPython shell
4639 # Reactivate the IPython shell
4636 ipshell.set_dummy_mode(0)
4640 ipshell.set_dummy_mode(0)
4637
4641
4638 print 'You can even have multiple embedded instances:'
4642 print 'You can even have multiple embedded instances:'
4639 ipshell2()
4643 ipshell2()
4640
4644
4641 print '\nMain program calling bar("spam")\n'
4645 print '\nMain program calling bar("spam")\n'
4642 bar('spam')
4646 bar('spam')
4643
4647
4644 print 'Main program finished. Bye!'
4648 print 'Main program finished. Bye!'
4645
4649
4646 #********************** End of file <example-embed.py> ***********************
4650 #********************** End of file <example-embed.py> ***********************
4647
4651
4648 Once you understand how the system functions, you can use the following
4652 Once you understand how the system functions, you can use the following
4649 code fragments in your programs which are ready for cut and paste::
4653 code fragments in your programs which are ready for cut and paste::
4650
4654
4651
4655
4652 """Quick code snippets for embedding IPython into other programs.
4656 """Quick code snippets for embedding IPython into other programs.
4653
4657
4654 See example-embed.py for full details, this file has the bare minimum code for
4658 See example-embed.py for full details, this file has the bare minimum code for
4655 cut and paste use once you understand how to use the system."""
4659 cut and paste use once you understand how to use the system."""
4656
4660
4657 #---------------------------------------------------------------------------
4661 #---------------------------------------------------------------------------
4658 # This code loads IPython but modifies a few things if it detects it's running
4662 # This code loads IPython but modifies a few things if it detects it's running
4659 # embedded in another IPython session (helps avoid confusion)
4663 # embedded in another IPython session (helps avoid confusion)
4660
4664
4661 try:
4665 try:
4662 __IPYTHON__
4666 __IPYTHON__
4663 except NameError:
4667 except NameError:
4664 argv = ['']
4668 argv = ['']
4665 banner = exit_msg = ''
4669 banner = exit_msg = ''
4666 else:
4670 else:
4667 # Command-line options for IPython (a list like sys.argv)
4671 # Command-line options for IPython (a list like sys.argv)
4668 argv = ['-pi1','In <\\#>:','-pi2',' .\\D.:','-po','Out<\\#>:']
4672 argv = ['-pi1','In <\\#>:','-pi2',' .\\D.:','-po','Out<\\#>:']
4669 banner = '*** Nested interpreter ***'
4673 banner = '*** Nested interpreter ***'
4670 exit_msg = '*** Back in main IPython ***'
4674 exit_msg = '*** Back in main IPython ***'
4671
4675
4672 # First import the embeddable shell class
4676 # First import the embeddable shell class
4673 from IPython.Shell import IPShellEmbed
4677 from IPython.Shell import IPShellEmbed
4674 # Now create the IPython shell instance. Put ipshell() anywhere in your code
4678 # Now create the IPython shell instance. Put ipshell() anywhere in your code
4675 # where you want it to open.
4679 # where you want it to open.
4676 ipshell = IPShellEmbed(argv,banner=banner,exit_msg=exit_msg)
4680 ipshell = IPShellEmbed(argv,banner=banner,exit_msg=exit_msg)
4677
4681
4678 #---------------------------------------------------------------------------
4682 #---------------------------------------------------------------------------
4679 # This code will load an embeddable IPython shell always with no changes for
4683 # This code will load an embeddable IPython shell always with no changes for
4680 # nested embededings.
4684 # nested embededings.
4681
4685
4682 from IPython.Shell import IPShellEmbed
4686 from IPython.Shell import IPShellEmbed
4683 ipshell = IPShellEmbed()
4687 ipshell = IPShellEmbed()
4684 # Now ipshell() will open IPython anywhere in the code.
4688 # Now ipshell() will open IPython anywhere in the code.
4685
4689
4686 #---------------------------------------------------------------------------
4690 #---------------------------------------------------------------------------
4687 # This code loads an embeddable shell only if NOT running inside
4691 # This code loads an embeddable shell only if NOT running inside
4688 # IPython. Inside IPython, the embeddable shell variable ipshell is just a
4692 # IPython. Inside IPython, the embeddable shell variable ipshell is just a
4689 # dummy function.
4693 # dummy function.
4690
4694
4691 try:
4695 try:
4692 __IPYTHON__
4696 __IPYTHON__
4693 except NameError:
4697 except NameError:
4694 from IPython.Shell import IPShellEmbed
4698 from IPython.Shell import IPShellEmbed
4695 ipshell = IPShellEmbed()
4699 ipshell = IPShellEmbed()
4696 # Now ipshell() will open IPython anywhere in the code
4700 # Now ipshell() will open IPython anywhere in the code
4697 else:
4701 else:
4698 # Define a dummy ipshell() so the same code doesn't crash inside an
4702 # Define a dummy ipshell() so the same code doesn't crash inside an
4699 # interactive IPython
4703 # interactive IPython
4700 def ipshell(): pass
4704 def ipshell(): pass
4701
4705
4702 #******************* End of file <example-embed-short.py> ********************
4706 #******************* End of file <example-embed-short.py> ********************
4703
4707
4704 Using the Python debugger (pdb)
4708 Using the Python debugger (pdb)
4705 ===============================
4709 ===============================
4706
4710
4707 Running entire programs via pdb
4711 Running entire programs via pdb
4708 -------------------------------
4712 -------------------------------
4709
4713
4710 pdb, the Python debugger, is a powerful interactive debugger which
4714 pdb, the Python debugger, is a powerful interactive debugger which
4711 allows you to step through code, set breakpoints, watch variables,
4715 allows you to step through code, set breakpoints, watch variables,
4712 etc. IPython makes it very easy to start any script under the control
4716 etc. IPython makes it very easy to start any script under the control
4713 of pdb, regardless of whether you have wrapped it into a 'main()'
4717 of pdb, regardless of whether you have wrapped it into a 'main()'
4714 function or not. For this, simply type '%run -d myscript' at an
4718 function or not. For this, simply type '%run -d myscript' at an
4715 IPython prompt. See the %run command's documentation (via '%run?' or
4719 IPython prompt. See the %run command's documentation (via '%run?' or
4716 in Sec. magic_ for more details, including how to control where pdb
4720 in Sec. magic_ for more details, including how to control where pdb
4717 will stop execution first.
4721 will stop execution first.
4718
4722
4719 For more information on the use of the pdb debugger, read the included
4723 For more information on the use of the pdb debugger, read the included
4720 pdb.doc file (part of the standard Python distribution). On a stock
4724 pdb.doc file (part of the standard Python distribution). On a stock
4721 Linux system it is located at /usr/lib/python2.3/pdb.doc, but the
4725 Linux system it is located at /usr/lib/python2.3/pdb.doc, but the
4722 easiest way to read it is by using the help() function of the pdb module
4726 easiest way to read it is by using the help() function of the pdb module
4723 as follows (in an IPython prompt):
4727 as follows (in an IPython prompt):
4724
4728
4725 In [1]: import pdb
4729 In [1]: import pdb
4726 In [2]: pdb.help()
4730 In [2]: pdb.help()
4727
4731
4728 This will load the pdb.doc document in a file viewer for you automatically.
4732 This will load the pdb.doc document in a file viewer for you automatically.
4729
4733
4730
4734
4731 Automatic invocation of pdb on exceptions
4735 Automatic invocation of pdb on exceptions
4732 -----------------------------------------
4736 -----------------------------------------
4733
4737
4734 IPython, if started with the -pdb option (or if the option is set in
4738 IPython, if started with the -pdb option (or if the option is set in
4735 your rc file) can call the Python pdb debugger every time your code
4739 your rc file) can call the Python pdb debugger every time your code
4736 triggers an uncaught exception. This feature
4740 triggers an uncaught exception. This feature
4737 can also be toggled at any time with the %pdb magic command. This can be
4741 can also be toggled at any time with the %pdb magic command. This can be
4738 extremely useful in order to find the origin of subtle bugs, because pdb
4742 extremely useful in order to find the origin of subtle bugs, because pdb
4739 opens up at the point in your code which triggered the exception, and
4743 opens up at the point in your code which triggered the exception, and
4740 while your program is at this point 'dead', all the data is still
4744 while your program is at this point 'dead', all the data is still
4741 available and you can walk up and down the stack frame and understand
4745 available and you can walk up and down the stack frame and understand
4742 the origin of the problem.
4746 the origin of the problem.
4743
4747
4744 Furthermore, you can use these debugging facilities both with the
4748 Furthermore, you can use these debugging facilities both with the
4745 embedded IPython mode and without IPython at all. For an embedded shell
4749 embedded IPython mode and without IPython at all. For an embedded shell
4746 (see sec. Embedding_), simply call the constructor with
4750 (see sec. Embedding_), simply call the constructor with
4747 '-pdb' in the argument string and automatically pdb will be called if an
4751 '-pdb' in the argument string and automatically pdb will be called if an
4748 uncaught exception is triggered by your code.
4752 uncaught exception is triggered by your code.
4749
4753
4750 For stand-alone use of the feature in your programs which do not use
4754 For stand-alone use of the feature in your programs which do not use
4751 IPython at all, put the following lines toward the top of your 'main'
4755 IPython at all, put the following lines toward the top of your 'main'
4752 routine::
4756 routine::
4753
4757
4754 import sys,IPython.ultraTB
4758 import sys,IPython.ultraTB
4755 sys.excepthook = IPython.ultraTB.FormattedTB(mode='Verbose',
4759 sys.excepthook = IPython.ultraTB.FormattedTB(mode='Verbose',
4756 color_scheme='Linux', call_pdb=1)
4760 color_scheme='Linux', call_pdb=1)
4757
4761
4758 The mode keyword can be either 'Verbose' or 'Plain', giving either very
4762 The mode keyword can be either 'Verbose' or 'Plain', giving either very
4759 detailed or normal tracebacks respectively. The color_scheme keyword can
4763 detailed or normal tracebacks respectively. The color_scheme keyword can
4760 be one of 'NoColor', 'Linux' (default) or 'LightBG'. These are the same
4764 be one of 'NoColor', 'Linux' (default) or 'LightBG'. These are the same
4761 options which can be set in IPython with -colors and -xmode.
4765 options which can be set in IPython with -colors and -xmode.
4762
4766
4763 This will give any of your programs detailed, colored tracebacks with
4767 This will give any of your programs detailed, colored tracebacks with
4764 automatic invocation of pdb.
4768 automatic invocation of pdb.
4765
4769
4766
4770
4767 Extensions for syntax processing
4771 Extensions for syntax processing
4768 ================================
4772 ================================
4769
4773
4770 This isn't for the faint of heart, because the potential for breaking
4774 This isn't for the faint of heart, because the potential for breaking
4771 things is quite high. But it can be a very powerful and useful feature.
4775 things is quite high. But it can be a very powerful and useful feature.
4772 In a nutshell, you can redefine the way IPython processes the user input
4776 In a nutshell, you can redefine the way IPython processes the user input
4773 line to accept new, special extensions to the syntax without needing to
4777 line to accept new, special extensions to the syntax without needing to
4774 change any of IPython's own code.
4778 change any of IPython's own code.
4775
4779
4776 In the IPython/Extensions directory you will find some examples
4780 In the IPython/Extensions directory you will find some examples
4777 supplied, which we will briefly describe now. These can be used 'as is'
4781 supplied, which we will briefly describe now. These can be used 'as is'
4778 (and both provide very useful functionality), or you can use them as a
4782 (and both provide very useful functionality), or you can use them as a
4779 starting point for writing your own extensions.
4783 starting point for writing your own extensions.
4780
4784
4781
4785
4782 Pasting of code starting with '>>> ' or '... '
4786 Pasting of code starting with '>>> ' or '... '
4783 ----------------------------------------------
4787 ----------------------------------------------
4784
4788
4785 In the python tutorial it is common to find code examples which have
4789 In the python tutorial it is common to find code examples which have
4786 been taken from real python sessions. The problem with those is that all
4790 been taken from real python sessions. The problem with those is that all
4787 the lines begin with either '>>> ' or '... ', which makes it impossible
4791 the lines begin with either '>>> ' or '... ', which makes it impossible
4788 to paste them all at once. One must instead do a line by line manual
4792 to paste them all at once. One must instead do a line by line manual
4789 copying, carefully removing the leading extraneous characters.
4793 copying, carefully removing the leading extraneous characters.
4790
4794
4791 This extension identifies those starting characters and removes them
4795 This extension identifies those starting characters and removes them
4792 from the input automatically, so that one can paste multi-line examples
4796 from the input automatically, so that one can paste multi-line examples
4793 directly into IPython, saving a lot of time. Please look at the file
4797 directly into IPython, saving a lot of time. Please look at the file
4794 InterpreterPasteInput.py in the IPython/Extensions directory for details
4798 InterpreterPasteInput.py in the IPython/Extensions directory for details
4795 on how this is done.
4799 on how this is done.
4796
4800
4797 IPython comes with a special profile enabling this feature, called
4801 IPython comes with a special profile enabling this feature, called
4798 tutorial. Simply start IPython via 'ipython -p tutorial' and the feature
4802 tutorial. Simply start IPython via 'ipython -p tutorial' and the feature
4799 will be available. In a normal IPython session you can activate the
4803 will be available. In a normal IPython session you can activate the
4800 feature by importing the corresponding module with:
4804 feature by importing the corresponding module with:
4801 In [1]: import IPython.Extensions.InterpreterPasteInput
4805 In [1]: import IPython.Extensions.InterpreterPasteInput
4802
4806
4803 The following is a 'screenshot' of how things work when this extension
4807 The following is a 'screenshot' of how things work when this extension
4804 is on, copying an example from the standard tutorial::
4808 is on, copying an example from the standard tutorial::
4805
4809
4806 IPython profile: tutorial
4810 IPython profile: tutorial
4807
4811
4808 *** Pasting of code with ">>>" or "..." has been enabled.
4812 *** Pasting of code with ">>>" or "..." has been enabled.
4809
4813
4810 In [1]: >>> def fib2(n): # return Fibonacci series up to n
4814 In [1]: >>> def fib2(n): # return Fibonacci series up to n
4811 ...: ... """Return a list containing the Fibonacci series up to
4815 ...: ... """Return a list containing the Fibonacci series up to
4812 n."""
4816 n."""
4813 ...: ... result = []
4817 ...: ... result = []
4814 ...: ... a, b = 0, 1
4818 ...: ... a, b = 0, 1
4815 ...: ... while b < n:
4819 ...: ... while b < n:
4816 ...: ... result.append(b) # see below
4820 ...: ... result.append(b) # see below
4817 ...: ... a, b = b, a+b
4821 ...: ... a, b = b, a+b
4818 ...: ... return result
4822 ...: ... return result
4819 ...:
4823 ...:
4820
4824
4821 In [2]: fib2(10)
4825 In [2]: fib2(10)
4822 Out[2]: [1, 1, 2, 3, 5, 8]
4826 Out[2]: [1, 1, 2, 3, 5, 8]
4823
4827
4824 Note that as currently written, this extension does not recognize
4828 Note that as currently written, this extension does not recognize
4825 IPython's prompts for pasting. Those are more complicated, since the
4829 IPython's prompts for pasting. Those are more complicated, since the
4826 user can change them very easily, they involve numbers and can vary in
4830 user can change them very easily, they involve numbers and can vary in
4827 length. One could however extract all the relevant information from the
4831 length. One could however extract all the relevant information from the
4828 IPython instance and build an appropriate regular expression. This is
4832 IPython instance and build an appropriate regular expression. This is
4829 left as an exercise for the reader.
4833 left as an exercise for the reader.
4830
4834
4831
4835
4832 Input of physical quantities with units
4836 Input of physical quantities with units
4833 ---------------------------------------
4837 ---------------------------------------
4834
4838
4835 The module PhysicalQInput allows a simplified form of input for physical
4839 The module PhysicalQInput allows a simplified form of input for physical
4836 quantities with units. This file is meant to be used in conjunction with
4840 quantities with units. This file is meant to be used in conjunction with
4837 the PhysicalQInteractive module (in the same directory) and
4841 the PhysicalQInteractive module (in the same directory) and
4838 Physics.PhysicalQuantities from Konrad Hinsen's ScientificPython
4842 Physics.PhysicalQuantities from Konrad Hinsen's ScientificPython
4839 (http://dirac.cnrs-orleans.fr/ScientificPython/).
4843 (http://dirac.cnrs-orleans.fr/ScientificPython/).
4840
4844
4841 The Physics.PhysicalQuantities module defines PhysicalQuantity objects,
4845 The Physics.PhysicalQuantities module defines PhysicalQuantity objects,
4842 but these must be declared as instances of a class. For example, to
4846 but these must be declared as instances of a class. For example, to
4843 define v as a velocity of 3 m/s, normally you would write::
4847 define v as a velocity of 3 m/s, normally you would write::
4844
4848
4845 In [1]: v = PhysicalQuantity(3,'m/s')
4849 In [1]: v = PhysicalQuantity(3,'m/s')
4846
4850
4847 Using the PhysicalQ_Input extension this can be input instead as:
4851 Using the PhysicalQ_Input extension this can be input instead as:
4848 In [1]: v = 3 m/s
4852 In [1]: v = 3 m/s
4849 which is much more convenient for interactive use (even though it is
4853 which is much more convenient for interactive use (even though it is
4850 blatantly invalid Python syntax).
4854 blatantly invalid Python syntax).
4851
4855
4852 The physics profile supplied with IPython (enabled via 'ipython -p
4856 The physics profile supplied with IPython (enabled via 'ipython -p
4853 physics') uses these extensions, which you can also activate with:
4857 physics') uses these extensions, which you can also activate with:
4854
4858
4855 from math import * # math MUST be imported BEFORE PhysicalQInteractive
4859 from math import * # math MUST be imported BEFORE PhysicalQInteractive
4856 from IPython.Extensions.PhysicalQInteractive import *
4860 from IPython.Extensions.PhysicalQInteractive import *
4857 import IPython.Extensions.PhysicalQInput
4861 import IPython.Extensions.PhysicalQInput
4858
4862
4859
4863
4860 IPython as a system shell - the 'Sh' profile
4864 IPython as a system shell - the 'Sh' profile
4861 ============================================
4865 ============================================
4862
4866
4863 The 'sh' profile optimizes IPython for system shell usage. Apart from
4867 The 'sh' profile optimizes IPython for system shell usage. Apart from
4864 certain job control functionality that is present in unix (ctrl+z does
4868 certain job control functionality that is present in unix (ctrl+z does
4865 "suspend"), the sh profile should provide you with most of the
4869 "suspend"), the sh profile should provide you with most of the
4866 functionality you use daily in system shell, and more. Invoke IPython
4870 functionality you use daily in system shell, and more. Invoke IPython
4867 in 'sh' profile by doing 'ipython -p sh', or (in win32) by launching
4871 in 'sh' profile by doing 'ipython -p sh', or (in win32) by launching
4868 the "pysh" shortcut in start menu.
4872 the "pysh" shortcut in start menu.
4869
4873
4870 If you want to use the features of sh profile as your defaults (which
4874 If you want to use the features of sh profile as your defaults (which
4871 might be a good idea if you use other profiles a lot of the time but
4875 might be a good idea if you use other profiles a lot of the time but
4872 still want the convenience of sh profile), add ``import ipy_profile_sh``
4876 still want the convenience of sh profile), add ``import ipy_profile_sh``
4873 to your ~/.ipython/ipy_user_conf.py.
4877 to your ~/.ipython/ipy_user_conf.py.
4874
4878
4875 The 'sh' profile is different from the default profile in that:
4879 The 'sh' profile is different from the default profile in that:
4876
4880
4877 * Prompt shows the current directory
4881 * Prompt shows the current directory
4878 * Spacing between prompts and input is more compact (no padding with
4882 * Spacing between prompts and input is more compact (no padding with
4879 empty lines). The startup banner is more compact as well.
4883 empty lines). The startup banner is more compact as well.
4880 * System commands are directly available (in alias table) without
4884 * System commands are directly available (in alias table) without
4881 requesting %rehashx - however, if you install new programs along
4885 requesting %rehashx - however, if you install new programs along
4882 your PATH, you might want to run %rehashx to update the persistent
4886 your PATH, you might want to run %rehashx to update the persistent
4883 alias table
4887 alias table
4884 * Macros are stored in raw format by default. That is, instead of
4888 * Macros are stored in raw format by default. That is, instead of
4885 '_ip.system("cat foo"), the macro will contain text 'cat foo')
4889 '_ip.system("cat foo"), the macro will contain text 'cat foo')
4886 * Autocall is in full mode
4890 * Autocall is in full mode
4887 * Calling "up" does "cd .."
4891 * Calling "up" does "cd .."
4888
4892
4889 The 'sh' profile is different from the now-obsolete (and unavailable)
4893 The 'sh' profile is different from the now-obsolete (and unavailable)
4890 'pysh' profile in that:
4894 'pysh' profile in that:
4891
4895
4892 * '$$var = command' and '$var = command' syntax is not supported
4896 * '$$var = command' and '$var = command' syntax is not supported
4893 * anymore. Use 'var = !command' instead (incidentally, this is
4897 * anymore. Use 'var = !command' instead (incidentally, this is
4894 * available in all IPython profiles). Note that !!command *will*
4898 * available in all IPython profiles). Note that !!command *will*
4895 * work.
4899 * work.
4896
4900
4897 Aliases
4901 Aliases
4898 -------
4902 -------
4899
4903
4900 All of your $PATH has been loaded as IPython aliases, so you should be
4904 All of your $PATH has been loaded as IPython aliases, so you should be
4901 able to type any normal system command and have it executed. See
4905 able to type any normal system command and have it executed. See
4902 %alias? and %unalias? for details on the alias facilities. See also
4906 %alias? and %unalias? for details on the alias facilities. See also
4903 %rehashx? for details on the mechanism used to load $PATH.
4907 %rehashx? for details on the mechanism used to load $PATH.
4904
4908
4905
4909
4906 Directory management
4910 Directory management
4907 --------------------
4911 --------------------
4908
4912
4909 Since each command passed by ipython to the underlying system is executed
4913 Since each command passed by ipython to the underlying system is executed
4910 in a subshell which exits immediately, you can NOT use !cd to navigate
4914 in a subshell which exits immediately, you can NOT use !cd to navigate
4911 the filesystem.
4915 the filesystem.
4912
4916
4913 IPython provides its own builtin '%cd' magic command to move in the
4917 IPython provides its own builtin '%cd' magic command to move in the
4914 filesystem (the % is not required with automagic on). It also maintains
4918 filesystem (the % is not required with automagic on). It also maintains
4915 a list of visited directories (use %dhist to see it) and allows direct
4919 a list of visited directories (use %dhist to see it) and allows direct
4916 switching to any of them. Type 'cd?' for more details.
4920 switching to any of them. Type 'cd?' for more details.
4917
4921
4918 %pushd, %popd and %dirs are provided for directory stack handling.
4922 %pushd, %popd and %dirs are provided for directory stack handling.
4919
4923
4920
4924
4921 Enabled extensions
4925 Enabled extensions
4922 ------------------
4926 ------------------
4923
4927
4924 Some extensions, listed below, are enabled as default in this profile.
4928 Some extensions, listed below, are enabled as default in this profile.
4925
4929
4926 envpersist
4930 envpersist
4927 ++++++++++
4931 ++++++++++
4928
4932
4929 %env can be used to "remember" environment variable manipulations. Examples::
4933 %env can be used to "remember" environment variable manipulations. Examples::
4930
4934
4931 %env - Show all environment variables
4935 %env - Show all environment variables
4932 %env VISUAL=jed - set VISUAL to jed
4936 %env VISUAL=jed - set VISUAL to jed
4933 %env PATH+=;/foo - append ;foo to PATH
4937 %env PATH+=;/foo - append ;foo to PATH
4934 %env PATH+=;/bar - also append ;bar to PATH
4938 %env PATH+=;/bar - also append ;bar to PATH
4935 %env PATH-=/wbin; - prepend /wbin; to PATH
4939 %env PATH-=/wbin; - prepend /wbin; to PATH
4936 %env -d VISUAL - forget VISUAL persistent val
4940 %env -d VISUAL - forget VISUAL persistent val
4937 %env -p - print all persistent env modifications
4941 %env -p - print all persistent env modifications
4938
4942
4939 ipy_which
4943 ipy_which
4940 +++++++++
4944 +++++++++
4941
4945
4942 %which magic command. Like 'which' in unix, but knows about ipython aliases.
4946 %which magic command. Like 'which' in unix, but knows about ipython aliases.
4943
4947
4944 Example::
4948 Example::
4945
4949
4946 [C:/ipython]|14> %which st
4950 [C:/ipython]|14> %which st
4947 st -> start .
4951 st -> start .
4948 [C:/ipython]|15> %which d
4952 [C:/ipython]|15> %which d
4949 d -> dir /w /og /on
4953 d -> dir /w /og /on
4950 [C:/ipython]|16> %which cp
4954 [C:/ipython]|16> %which cp
4951 cp -> cp
4955 cp -> cp
4952 == c:\bin\cp.exe
4956 == c:\bin\cp.exe
4953 c:\bin\cp.exe
4957 c:\bin\cp.exe
4954
4958
4955 ipy_app_completers
4959 ipy_app_completers
4956 ++++++++++++++++++
4960 ++++++++++++++++++
4957
4961
4958 Custom tab completers for some apps like svn, hg, bzr, apt-get. Try 'apt-get install <TAB>' in debian/ubuntu.
4962 Custom tab completers for some apps like svn, hg, bzr, apt-get. Try 'apt-get install <TAB>' in debian/ubuntu.
4959
4963
4960 ipy_rehashdir
4964 ipy_rehashdir
4961 +++++++++++++
4965 +++++++++++++
4962
4966
4963 Allows you to add system command aliases for commands that are not along your path. Let's say that you just installed Putty and want to be able to invoke it without adding it to path, you can create the alias for it with rehashdir::
4967 Allows you to add system command aliases for commands that are not along your path. Let's say that you just installed Putty and want to be able to invoke it without adding it to path, you can create the alias for it with rehashdir::
4964
4968
4965 [~]|22> cd c:/opt/PuTTY/
4969 [~]|22> cd c:/opt/PuTTY/
4966 [c:opt/PuTTY]|23> rehashdir .
4970 [c:opt/PuTTY]|23> rehashdir .
4967 <23> ['pageant', 'plink', 'pscp', 'psftp', 'putty', 'puttygen', 'unins000']
4971 <23> ['pageant', 'plink', 'pscp', 'psftp', 'putty', 'puttygen', 'unins000']
4968
4972
4969 Now, you can execute any of those commams directly::
4973 Now, you can execute any of those commams directly::
4970
4974
4971 [c:opt/PuTTY]|24> cd
4975 [c:opt/PuTTY]|24> cd
4972 [~]|25> putty
4976 [~]|25> putty
4973
4977
4974 (the putty window opens).
4978 (the putty window opens).
4975
4979
4976 If you want to store the alias so that it will always be available, do '%store putty'. If you want to %store all these aliases persistently, just do it in a for loop::
4980 If you want to store the alias so that it will always be available, do '%store putty'. If you want to %store all these aliases persistently, just do it in a for loop::
4977
4981
4978 [~]|27> for a in _23:
4982 [~]|27> for a in _23:
4979 |..> %store $a
4983 |..> %store $a
4980 |..>
4984 |..>
4981 |..>
4985 |..>
4982 Alias stored: pageant (0, 'c:\\opt\\PuTTY\\pageant.exe')
4986 Alias stored: pageant (0, 'c:\\opt\\PuTTY\\pageant.exe')
4983 Alias stored: plink (0, 'c:\\opt\\PuTTY\\plink.exe')
4987 Alias stored: plink (0, 'c:\\opt\\PuTTY\\plink.exe')
4984 Alias stored: pscp (0, 'c:\\opt\\PuTTY\\pscp.exe')
4988 Alias stored: pscp (0, 'c:\\opt\\PuTTY\\pscp.exe')
4985 Alias stored: psftp (0, 'c:\\opt\\PuTTY\\psftp.exe')
4989 Alias stored: psftp (0, 'c:\\opt\\PuTTY\\psftp.exe')
4986 ...
4990 ...
4987
4991
4988 mglob
4992 mglob
4989 +++++
4993 +++++
4990
4994
4991 Provide the magic function %mglob, which makes it easier (than the 'find' command) to collect (possibly recursive) file lists. Examples::
4995 Provide the magic function %mglob, which makes it easier (than the 'find' command) to collect (possibly recursive) file lists. Examples::
4992
4996
4993 [c:/ipython]|9> mglob *.py
4997 [c:/ipython]|9> mglob *.py
4994 [c:/ipython]|10> mglob *.py rec:*.txt
4998 [c:/ipython]|10> mglob *.py rec:*.txt
4995 [c:/ipython]|19> workfiles = %mglob !.svn/ !.hg/ !*_Data/ !*.bak rec:.
4999 [c:/ipython]|19> workfiles = %mglob !.svn/ !.hg/ !*_Data/ !*.bak rec:.
4996
5000
4997 Note that the first 2 calls will put the file list in result history (_, _9, _10), and the last one will assign it to 'workfiles'.
5001 Note that the first 2 calls will put the file list in result history (_, _9, _10), and the last one will assign it to 'workfiles'.
4998
5002
4999
5003
5000 Prompt customization
5004 Prompt customization
5001 --------------------
5005 --------------------
5002
5006
5003 The sh profile uses the following prompt configurations::
5007 The sh profile uses the following prompt configurations::
5004
5008
5005 o.prompt_in1= r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Green|\#>'
5009 o.prompt_in1= r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Green|\#>'
5006 o.prompt_in2= r'\C_Green|\C_LightGreen\D\C_Green>'
5010 o.prompt_in2= r'\C_Green|\C_LightGreen\D\C_Green>'
5007
5011
5008 You can change the prompt configuration to your liking by editing
5012 You can change the prompt configuration to your liking by editing
5009 ipy_user_conf.py.
5013 ipy_user_conf.py.
5010
5014
5011 String lists
5015 String lists
5012 ============
5016 ============
5013
5017
5014 String lists (IPython.genutils.SList) are handy way to process output
5018 String lists (IPython.genutils.SList) are handy way to process output
5015 from system commands. They are produced by ``var = !cmd`` syntax.
5019 from system commands. They are produced by ``var = !cmd`` syntax.
5016
5020
5017 First, we acquire the output of 'ls -l'::
5021 First, we acquire the output of 'ls -l'::
5018
5022
5019 [Q:doc/examples]|2> lines = !ls -l
5023 [Q:doc/examples]|2> lines = !ls -l
5020 ==
5024 ==
5021 ['total 23',
5025 ['total 23',
5022 '-rw-rw-rw- 1 ville None 1163 Sep 30 2006 example-demo.py',
5026 '-rw-rw-rw- 1 ville None 1163 Sep 30 2006 example-demo.py',
5023 '-rw-rw-rw- 1 ville None 1927 Sep 30 2006 example-embed-short.py',
5027 '-rw-rw-rw- 1 ville None 1927 Sep 30 2006 example-embed-short.py',
5024 '-rwxrwxrwx 1 ville None 4606 Sep 1 17:15 example-embed.py',
5028 '-rwxrwxrwx 1 ville None 4606 Sep 1 17:15 example-embed.py',
5025 '-rwxrwxrwx 1 ville None 1017 Sep 30 2006 example-gnuplot.py',
5029 '-rwxrwxrwx 1 ville None 1017 Sep 30 2006 example-gnuplot.py',
5026 '-rwxrwxrwx 1 ville None 339 Jun 11 18:01 extension.py',
5030 '-rwxrwxrwx 1 ville None 339 Jun 11 18:01 extension.py',
5027 '-rwxrwxrwx 1 ville None 113 Dec 20 2006 seteditor.py',
5031 '-rwxrwxrwx 1 ville None 113 Dec 20 2006 seteditor.py',
5028 '-rwxrwxrwx 1 ville None 245 Dec 12 2006 seteditor.pyc']
5032 '-rwxrwxrwx 1 ville None 245 Dec 12 2006 seteditor.pyc']
5029
5033
5030 Now, let's take a look at the contents of 'lines' (the first number is
5034 Now, let's take a look at the contents of 'lines' (the first number is
5031 the list element number)::
5035 the list element number)::
5032
5036
5033 [Q:doc/examples]|3> lines
5037 [Q:doc/examples]|3> lines
5034 <3> SList (.p, .n, .l, .s, .grep(), .fields() available). Value:
5038 <3> SList (.p, .n, .l, .s, .grep(), .fields() available). Value:
5035
5039
5036 0: total 23
5040 0: total 23
5037 1: -rw-rw-rw- 1 ville None 1163 Sep 30 2006 example-demo.py
5041 1: -rw-rw-rw- 1 ville None 1163 Sep 30 2006 example-demo.py
5038 2: -rw-rw-rw- 1 ville None 1927 Sep 30 2006 example-embed-short.py
5042 2: -rw-rw-rw- 1 ville None 1927 Sep 30 2006 example-embed-short.py
5039 3: -rwxrwxrwx 1 ville None 4606 Sep 1 17:15 example-embed.py
5043 3: -rwxrwxrwx 1 ville None 4606 Sep 1 17:15 example-embed.py
5040 4: -rwxrwxrwx 1 ville None 1017 Sep 30 2006 example-gnuplot.py
5044 4: -rwxrwxrwx 1 ville None 1017 Sep 30 2006 example-gnuplot.py
5041 5: -rwxrwxrwx 1 ville None 339 Jun 11 18:01 extension.py
5045 5: -rwxrwxrwx 1 ville None 339 Jun 11 18:01 extension.py
5042 6: -rwxrwxrwx 1 ville None 113 Dec 20 2006 seteditor.py
5046 6: -rwxrwxrwx 1 ville None 113 Dec 20 2006 seteditor.py
5043 7: -rwxrwxrwx 1 ville None 245 Dec 12 2006 seteditor.pyc
5047 7: -rwxrwxrwx 1 ville None 245 Dec 12 2006 seteditor.pyc
5044
5048
5045 Now, let's filter out the 'embed' lines::
5049 Now, let's filter out the 'embed' lines::
5046
5050
5047 [Q:doc/examples]|4> l2 = lines.grep('embed',prune=1)
5051 [Q:doc/examples]|4> l2 = lines.grep('embed',prune=1)
5048 [Q:doc/examples]|5> l2
5052 [Q:doc/examples]|5> l2
5049 <5> SList (.p, .n, .l, .s, .grep(), .fields() available). Value:
5053 <5> SList (.p, .n, .l, .s, .grep(), .fields() available). Value:
5050
5054
5051 0: total 23
5055 0: total 23
5052 1: -rw-rw-rw- 1 ville None 1163 Sep 30 2006 example-demo.py
5056 1: -rw-rw-rw- 1 ville None 1163 Sep 30 2006 example-demo.py
5053 2: -rwxrwxrwx 1 ville None 1017 Sep 30 2006 example-gnuplot.py
5057 2: -rwxrwxrwx 1 ville None 1017 Sep 30 2006 example-gnuplot.py
5054 3: -rwxrwxrwx 1 ville None 339 Jun 11 18:01 extension.py
5058 3: -rwxrwxrwx 1 ville None 339 Jun 11 18:01 extension.py
5055 4: -rwxrwxrwx 1 ville None 113 Dec 20 2006 seteditor.py
5059 4: -rwxrwxrwx 1 ville None 113 Dec 20 2006 seteditor.py
5056 5: -rwxrwxrwx 1 ville None 245 Dec 12 2006 seteditor.pyc
5060 5: -rwxrwxrwx 1 ville None 245 Dec 12 2006 seteditor.pyc
5057
5061
5058 Now, we want strings having just file names and permissions::
5062 Now, we want strings having just file names and permissions::
5059
5063
5060 [Q:doc/examples]|6> l2.fields(8,0)
5064 [Q:doc/examples]|6> l2.fields(8,0)
5061 <6> SList (.p, .n, .l, .s, .grep(), .fields() available). Value:
5065 <6> SList (.p, .n, .l, .s, .grep(), .fields() available). Value:
5062
5066
5063 0: total
5067 0: total
5064 1: example-demo.py -rw-rw-rw-
5068 1: example-demo.py -rw-rw-rw-
5065 2: example-gnuplot.py -rwxrwxrwx
5069 2: example-gnuplot.py -rwxrwxrwx
5066 3: extension.py -rwxrwxrwx
5070 3: extension.py -rwxrwxrwx
5067 4: seteditor.py -rwxrwxrwx
5071 4: seteditor.py -rwxrwxrwx
5068 5: seteditor.pyc -rwxrwxrwx
5072 5: seteditor.pyc -rwxrwxrwx
5069
5073
5070 Note how the line with 'total' does not raise IndexError.
5074 Note how the line with 'total' does not raise IndexError.
5071
5075
5072 If you want to split these (yielding lists), call fields() without
5076 If you want to split these (yielding lists), call fields() without
5073 arguments::
5077 arguments::
5074
5078
5075 [Q:doc/examples]|7> _.fields()
5079 [Q:doc/examples]|7> _.fields()
5076 <7>
5080 <7>
5077 [['total'],
5081 [['total'],
5078 ['example-demo.py', '-rw-rw-rw-'],
5082 ['example-demo.py', '-rw-rw-rw-'],
5079 ['example-gnuplot.py', '-rwxrwxrwx'],
5083 ['example-gnuplot.py', '-rwxrwxrwx'],
5080 ['extension.py', '-rwxrwxrwx'],
5084 ['extension.py', '-rwxrwxrwx'],
5081 ['seteditor.py', '-rwxrwxrwx'],
5085 ['seteditor.py', '-rwxrwxrwx'],
5082 ['seteditor.pyc', '-rwxrwxrwx']]
5086 ['seteditor.pyc', '-rwxrwxrwx']]
5083
5087
5084 If you want to pass these separated with spaces to a command (typical
5088 If you want to pass these separated with spaces to a command (typical
5085 for lists if files), use the .s property::
5089 for lists if files), use the .s property::
5086
5090
5087
5091
5088 [Q:doc/examples]|13> files = l2.fields(8).s
5092 [Q:doc/examples]|13> files = l2.fields(8).s
5089 [Q:doc/examples]|14> files
5093 [Q:doc/examples]|14> files
5090 <14> 'example-demo.py example-gnuplot.py extension.py seteditor.py seteditor.pyc'
5094 <14> 'example-demo.py example-gnuplot.py extension.py seteditor.py seteditor.pyc'
5091 [Q:doc/examples]|15> ls $files
5095 [Q:doc/examples]|15> ls $files
5092 example-demo.py example-gnuplot.py extension.py seteditor.py seteditor.pyc
5096 example-demo.py example-gnuplot.py extension.py seteditor.py seteditor.pyc
5093
5097
5094 SLists are inherited from normal python lists, so every list method is
5098 SLists are inherited from normal python lists, so every list method is
5095 available::
5099 available::
5096
5100
5097 [Q:doc/examples]|21> lines.append('hey')
5101 [Q:doc/examples]|21> lines.append('hey')
5098
5102
5099
5103
5100 Real world example: remove all files outside version control
5104 Real world example: remove all files outside version control
5101 ------------------------------------------------------------
5105 ------------------------------------------------------------
5102
5106
5103 First, capture output of "hg status"::
5107 First, capture output of "hg status"::
5104
5108
5105 [Q:/ipython]|28> out = !hg status
5109 [Q:/ipython]|28> out = !hg status
5106 ==
5110 ==
5107 ['M IPython\\Extensions\\ipy_kitcfg.py',
5111 ['M IPython\\Extensions\\ipy_kitcfg.py',
5108 'M IPython\\Extensions\\ipy_rehashdir.py',
5112 'M IPython\\Extensions\\ipy_rehashdir.py',
5109 ...
5113 ...
5110 '? build\\lib\\IPython\\Debugger.py',
5114 '? build\\lib\\IPython\\Debugger.py',
5111 '? build\\lib\\IPython\\Extensions\\InterpreterExec.py',
5115 '? build\\lib\\IPython\\Extensions\\InterpreterExec.py',
5112 '? build\\lib\\IPython\\Extensions\\InterpreterPasteInput.py',
5116 '? build\\lib\\IPython\\Extensions\\InterpreterPasteInput.py',
5113 ...
5117 ...
5114
5118
5115 (lines starting with ? are not under version control).
5119 (lines starting with ? are not under version control).
5116
5120
5117 ::
5121 ::
5118
5122
5119 [Q:/ipython]|35> junk = out.grep(r'^\?').fields(1)
5123 [Q:/ipython]|35> junk = out.grep(r'^\?').fields(1)
5120 [Q:/ipython]|36> junk
5124 [Q:/ipython]|36> junk
5121 <36> SList (.p, .n, .l, .s, .grep(), .fields() availab
5125 <36> SList (.p, .n, .l, .s, .grep(), .fields() availab
5122 ...
5126 ...
5123 10: build\bdist.win32\winexe\temp\_ctypes.py
5127 10: build\bdist.win32\winexe\temp\_ctypes.py
5124 11: build\bdist.win32\winexe\temp\_hashlib.py
5128 11: build\bdist.win32\winexe\temp\_hashlib.py
5125 12: build\bdist.win32\winexe\temp\_socket.py
5129 12: build\bdist.win32\winexe\temp\_socket.py
5126
5130
5127 Now we can just remove these files by doing 'rm $junk.s'.
5131 Now we can just remove these files by doing 'rm $junk.s'.
5128
5132
5129 The .s, .n, .p properties
5133 The .s, .n, .p properties
5130 -------------------------
5134 -------------------------
5131
5135
5132 The '.s' property returns one string where lines are separated by
5136 The '.s' property returns one string where lines are separated by
5133 single space (for convenient passing to system commands). The '.n'
5137 single space (for convenient passing to system commands). The '.n'
5134 property return one string where the lines are separated by '\n'
5138 property return one string where the lines are separated by '\n'
5135 (i.e. the original output of the function). If the items in string
5139 (i.e. the original output of the function). If the items in string
5136 list are file names, '.p' can be used to get a list of "path" objects
5140 list are file names, '.p' can be used to get a list of "path" objects
5137 for convenient file manipulation.
5141 for convenient file manipulation.
5138
5142
5139
5143
5140 Threading support
5144 Threading support
5141 =================
5145 =================
5142
5146
5143 WARNING: The threading support is still somewhat experimental, and it
5147 WARNING: The threading support is still somewhat experimental, and it
5144 has only seen reasonable testing under Linux. Threaded code is
5148 has only seen reasonable testing under Linux. Threaded code is
5145 particularly tricky to debug, and it tends to show extremely
5149 particularly tricky to debug, and it tends to show extremely
5146 platform-dependent behavior. Since I only have access to Linux machines,
5150 platform-dependent behavior. Since I only have access to Linux machines,
5147 I will have to rely on user's experiences and assistance for this area
5151 I will have to rely on user's experiences and assistance for this area
5148 of IPython to improve under other platforms.
5152 of IPython to improve under other platforms.
5149
5153
5150 IPython, via the -gthread , -qthread, -q4thread and -wthread options
5154 IPython, via the -gthread , -qthread, -q4thread and -wthread options
5151 (described in Sec. `Threading options`_), can run in
5155 (described in Sec. `Threading options`_), can run in
5152 multithreaded mode to support pyGTK, Qt3, Qt4 and WXPython applications
5156 multithreaded mode to support pyGTK, Qt3, Qt4 and WXPython applications
5153 respectively. These GUI toolkits need to control the python main loop of
5157 respectively. These GUI toolkits need to control the python main loop of
5154 execution, so under a normal Python interpreter, starting a pyGTK, Qt3,
5158 execution, so under a normal Python interpreter, starting a pyGTK, Qt3,
5155 Qt4 or WXPython application will immediately freeze the shell.
5159 Qt4 or WXPython application will immediately freeze the shell.
5156
5160
5157 IPython, with one of these options (you can only use one at a time),
5161 IPython, with one of these options (you can only use one at a time),
5158 separates the graphical loop and IPython's code execution run into
5162 separates the graphical loop and IPython's code execution run into
5159 different threads. This allows you to test interactively (with %run, for
5163 different threads. This allows you to test interactively (with %run, for
5160 example) your GUI code without blocking.
5164 example) your GUI code without blocking.
5161
5165
5162 A nice mini-tutorial on using IPython along with the Qt Designer
5166 A nice mini-tutorial on using IPython along with the Qt Designer
5163 application is available at the SciPy wiki:
5167 application is available at the SciPy wiki:
5164 http://www.scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer.
5168 http://www.scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer.
5165
5169
5166
5170
5167 Tk issues
5171 Tk issues
5168 ---------
5172 ---------
5169
5173
5170 As indicated in Sec. `Threading options`_, a special -tk option is
5174 As indicated in Sec. `Threading options`_, a special -tk option is
5171 provided to try and allow Tk graphical applications to coexist
5175 provided to try and allow Tk graphical applications to coexist
5172 interactively with WX, Qt or GTK ones. Whether this works at all,
5176 interactively with WX, Qt or GTK ones. Whether this works at all,
5173 however, is very platform and configuration dependent. Please
5177 however, is very platform and configuration dependent. Please
5174 experiment with simple test cases before committing to using this
5178 experiment with simple test cases before committing to using this
5175 combination of Tk and GTK/Qt/WX threading in a production environment.
5179 combination of Tk and GTK/Qt/WX threading in a production environment.
5176
5180
5177
5181
5178 I/O pitfalls
5182 I/O pitfalls
5179 ------------
5183 ------------
5180
5184
5181 Be mindful that the Python interpreter switches between threads every
5185 Be mindful that the Python interpreter switches between threads every
5182 $N$ bytecodes, where the default value as of Python 2.3 is $N=100.$ This
5186 $N$ bytecodes, where the default value as of Python 2.3 is $N=100.$ This
5183 value can be read by using the sys.getcheckinterval() function, and it
5187 value can be read by using the sys.getcheckinterval() function, and it
5184 can be reset via sys.setcheckinterval(N). This switching of threads can
5188 can be reset via sys.setcheckinterval(N). This switching of threads can
5185 cause subtly confusing effects if one of your threads is doing file I/O.
5189 cause subtly confusing effects if one of your threads is doing file I/O.
5186 In text mode, most systems only flush file buffers when they encounter a
5190 In text mode, most systems only flush file buffers when they encounter a
5187 '\n'. An instruction as simple as::
5191 '\n'. An instruction as simple as::
5188
5192
5189 print >> filehandle, ''hello world''
5193 print >> filehandle, ''hello world''
5190
5194
5191 actually consists of several bytecodes, so it is possible that the
5195 actually consists of several bytecodes, so it is possible that the
5192 newline does not reach your file before the next thread switch.
5196 newline does not reach your file before the next thread switch.
5193 Similarly, if you are writing to a file in binary mode, the file won't
5197 Similarly, if you are writing to a file in binary mode, the file won't
5194 be flushed until the buffer fills, and your other thread may see
5198 be flushed until the buffer fills, and your other thread may see
5195 apparently truncated files.
5199 apparently truncated files.
5196
5200
5197 For this reason, if you are using IPython's thread support and have (for
5201 For this reason, if you are using IPython's thread support and have (for
5198 example) a GUI application which will read data generated by files
5202 example) a GUI application which will read data generated by files
5199 written to from the IPython thread, the safest approach is to open all
5203 written to from the IPython thread, the safest approach is to open all
5200 of your files in unbuffered mode (the third argument to the file/open
5204 of your files in unbuffered mode (the third argument to the file/open
5201 function is the buffering value)::
5205 function is the buffering value)::
5202
5206
5203 filehandle = open(filename,mode,0)
5207 filehandle = open(filename,mode,0)
5204
5208
5205 This is obviously a brute force way of avoiding race conditions with the
5209 This is obviously a brute force way of avoiding race conditions with the
5206 file buffering. If you want to do it cleanly, and you have a resource
5210 file buffering. If you want to do it cleanly, and you have a resource
5207 which is being shared by the interactive IPython loop and your GUI
5211 which is being shared by the interactive IPython loop and your GUI
5208 thread, you should really handle it with thread locking and
5212 thread, you should really handle it with thread locking and
5209 syncrhonization properties. The Python documentation discusses these.
5213 syncrhonization properties. The Python documentation discusses these.
5210
5214
5211 .. _Interactive demos:
5215 .. _Interactive demos:
5212
5216
5213 Interactive demos with IPython
5217 Interactive demos with IPython
5214 ==============================
5218 ==============================
5215
5219
5216 IPython ships with a basic system for running scripts interactively in
5220 IPython ships with a basic system for running scripts interactively in
5217 sections, useful when presenting code to audiences. A few tags embedded
5221 sections, useful when presenting code to audiences. A few tags embedded
5218 in comments (so that the script remains valid Python code) divide a file
5222 in comments (so that the script remains valid Python code) divide a file
5219 into separate blocks, and the demo can be run one block at a time, with
5223 into separate blocks, and the demo can be run one block at a time, with
5220 IPython printing (with syntax highlighting) the block before executing
5224 IPython printing (with syntax highlighting) the block before executing
5221 it, and returning to the interactive prompt after each block. The
5225 it, and returning to the interactive prompt after each block. The
5222 interactive namespace is updated after each block is run with the
5226 interactive namespace is updated after each block is run with the
5223 contents of the demo's namespace.
5227 contents of the demo's namespace.
5224
5228
5225 This allows you to show a piece of code, run it and then execute
5229 This allows you to show a piece of code, run it and then execute
5226 interactively commands based on the variables just created. Once you
5230 interactively commands based on the variables just created. Once you
5227 want to continue, you simply execute the next block of the demo. The
5231 want to continue, you simply execute the next block of the demo. The
5228 following listing shows the markup necessary for dividing a script into
5232 following listing shows the markup necessary for dividing a script into
5229 sections for execution as a demo::
5233 sections for execution as a demo::
5230
5234
5231
5235
5232 """A simple interactive demo to illustrate the use of IPython's Demo class.
5236 """A simple interactive demo to illustrate the use of IPython's Demo class.
5233
5237
5234 Any python script can be run as a demo, but that does little more than showing
5238 Any python script can be run as a demo, but that does little more than showing
5235 it on-screen, syntax-highlighted in one shot. If you add a little simple
5239 it on-screen, syntax-highlighted in one shot. If you add a little simple
5236 markup, you can stop at specified intervals and return to the ipython prompt,
5240 markup, you can stop at specified intervals and return to the ipython prompt,
5237 resuming execution later.
5241 resuming execution later.
5238 """
5242 """
5239
5243
5240 print 'Hello, welcome to an interactive IPython demo.'
5244 print 'Hello, welcome to an interactive IPython demo.'
5241 print 'Executing this block should require confirmation before proceeding,'
5245 print 'Executing this block should require confirmation before proceeding,'
5242 print 'unless auto_all has been set to true in the demo object'
5246 print 'unless auto_all has been set to true in the demo object'
5243
5247
5244 # The mark below defines a block boundary, which is a point where IPython will
5248 # The mark below defines a block boundary, which is a point where IPython will
5245 # stop execution and return to the interactive prompt.
5249 # stop execution and return to the interactive prompt.
5246 # Note that in actual interactive execution,
5250 # Note that in actual interactive execution,
5247 # <demo> --- stop ---
5251 # <demo> --- stop ---
5248
5252
5249 x = 1
5253 x = 1
5250 y = 2
5254 y = 2
5251
5255
5252 # <demo> --- stop ---
5256 # <demo> --- stop ---
5253
5257
5254 # the mark below makes this block as silent
5258 # the mark below makes this block as silent
5255 # <demo> silent
5259 # <demo> silent
5256
5260
5257 print 'This is a silent block, which gets executed but not printed.'
5261 print 'This is a silent block, which gets executed but not printed.'
5258
5262
5259 # <demo> --- stop ---
5263 # <demo> --- stop ---
5260 # <demo> auto
5264 # <demo> auto
5261 print 'This is an automatic block.'
5265 print 'This is an automatic block.'
5262 print 'It is executed without asking for confirmation, but printed.'
5266 print 'It is executed without asking for confirmation, but printed.'
5263 z = x+y
5267 z = x+y
5264
5268
5265 print 'z=',x
5269 print 'z=',x
5266
5270
5267 # <demo> --- stop ---
5271 # <demo> --- stop ---
5268 # This is just another normal block.
5272 # This is just another normal block.
5269 print 'z is now:', z
5273 print 'z is now:', z
5270
5274
5271 print 'bye!'
5275 print 'bye!'
5272
5276
5273 In order to run a file as a demo, you must first make a Demo object out
5277 In order to run a file as a demo, you must first make a Demo object out
5274 of it. If the file is named myscript.py, the following code will make a
5278 of it. If the file is named myscript.py, the following code will make a
5275 demo::
5279 demo::
5276
5280
5277 from IPython.demo import Demo
5281 from IPython.demo import Demo
5278
5282
5279 mydemo = Demo('myscript.py')
5283 mydemo = Demo('myscript.py')
5280
5284
5281 This creates the mydemo object, whose blocks you run one at a time by
5285 This creates the mydemo object, whose blocks you run one at a time by
5282 simply calling the object with no arguments. If you have autocall active
5286 simply calling the object with no arguments. If you have autocall active
5283 in IPython (the default), all you need to do is type::
5287 in IPython (the default), all you need to do is type::
5284
5288
5285 mydemo
5289 mydemo
5286
5290
5287 and IPython will call it, executing each block. Demo objects can be
5291 and IPython will call it, executing each block. Demo objects can be
5288 restarted, you can move forward or back skipping blocks, re-execute the
5292 restarted, you can move forward or back skipping blocks, re-execute the
5289 last block, etc. Simply use the Tab key on a demo object to see its
5293 last block, etc. Simply use the Tab key on a demo object to see its
5290 methods, and call '?' on them to see their docstrings for more usage
5294 methods, and call '?' on them to see their docstrings for more usage
5291 details. In addition, the demo module itself contains a comprehensive
5295 details. In addition, the demo module itself contains a comprehensive
5292 docstring, which you can access via::
5296 docstring, which you can access via::
5293
5297
5294 from IPython import demo
5298 from IPython import demo
5295
5299
5296 demo?
5300 demo?
5297
5301
5298 Limitations: It is important to note that these demos are limited to
5302 Limitations: It is important to note that these demos are limited to
5299 fairly simple uses. In particular, you can not put division marks in
5303 fairly simple uses. In particular, you can not put division marks in
5300 indented code (loops, if statements, function definitions, etc.)
5304 indented code (loops, if statements, function definitions, etc.)
5301 Supporting something like this would basically require tracking the
5305 Supporting something like this would basically require tracking the
5302 internal execution state of the Python interpreter, so only top-level
5306 internal execution state of the Python interpreter, so only top-level
5303 divisions are allowed. If you want to be able to open an IPython
5307 divisions are allowed. If you want to be able to open an IPython
5304 instance at an arbitrary point in a program, you can use IPython's
5308 instance at an arbitrary point in a program, you can use IPython's
5305 embedding facilities, described in detail in Sec. 9
5309 embedding facilities, described in detail in Sec. 9
5306
5310
5307
5311
5308 .. _Matplotlib support:
5312 .. _Matplotlib support:
5309
5313
5310 Plotting with matplotlib
5314 Plotting with matplotlib
5311 ========================
5315 ========================
5312
5316
5313 The matplotlib library (http://matplotlib.sourceforge.net
5317 The matplotlib library (http://matplotlib.sourceforge.net
5314 http://matplotlib.sourceforge.net) provides high quality 2D plotting for
5318 http://matplotlib.sourceforge.net) provides high quality 2D plotting for
5315 Python. Matplotlib can produce plots on screen using a variety of GUI
5319 Python. Matplotlib can produce plots on screen using a variety of GUI
5316 toolkits, including Tk, GTK and WXPython. It also provides a number of
5320 toolkits, including Tk, GTK and WXPython. It also provides a number of
5317 commands useful for scientific computing, all with a syntax compatible
5321 commands useful for scientific computing, all with a syntax compatible
5318 with that of the popular Matlab program.
5322 with that of the popular Matlab program.
5319
5323
5320 IPython accepts the special option -pylab (Sec. `Command line
5324 IPython accepts the special option -pylab (Sec. `Command line
5321 options`_). This configures it to support matplotlib, honoring the
5325 options`_). This configures it to support matplotlib, honoring the
5322 settings in the .matplotlibrc file. IPython will detect the user's
5326 settings in the .matplotlibrc file. IPython will detect the user's
5323 choice of matplotlib GUI backend, and automatically select the proper
5327 choice of matplotlib GUI backend, and automatically select the proper
5324 threading model to prevent blocking. It also sets matplotlib in
5328 threading model to prevent blocking. It also sets matplotlib in
5325 interactive mode and modifies %run slightly, so that any
5329 interactive mode and modifies %run slightly, so that any
5326 matplotlib-based script can be executed using %run and the final
5330 matplotlib-based script can be executed using %run and the final
5327 show() command does not block the interactive shell.
5331 show() command does not block the interactive shell.
5328
5332
5329 The -pylab option must be given first in order for IPython to
5333 The -pylab option must be given first in order for IPython to
5330 configure its threading mode. However, you can still issue other
5334 configure its threading mode. However, you can still issue other
5331 options afterwards. This allows you to have a matplotlib-based
5335 options afterwards. This allows you to have a matplotlib-based
5332 environment customized with additional modules using the standard
5336 environment customized with additional modules using the standard
5333 IPython profile mechanism (Sec. Profiles_): ''ipython -pylab -p
5337 IPython profile mechanism (Sec. Profiles_): ''ipython -pylab -p
5334 myprofile'' will load the profile defined in ipythonrc-myprofile after
5338 myprofile'' will load the profile defined in ipythonrc-myprofile after
5335 configuring matplotlib.
5339 configuring matplotlib.
5336
5340
5337 IPython Extension Api
5341 IPython Extension Api
5338 =====================
5342 =====================
5339
5343
5340 IPython api (defined in IPython/ipapi.py) is the public api that
5344 IPython api (defined in IPython/ipapi.py) is the public api that
5341 should be used for
5345 should be used for
5342
5346
5343 * Configuration of user preferences (.ipython/ipy_user_conf.py)
5347 * Configuration of user preferences (.ipython/ipy_user_conf.py)
5344 * Creating new profiles (.ipython/ipy_profile_PROFILENAME.py)
5348 * Creating new profiles (.ipython/ipy_profile_PROFILENAME.py)
5345 * Writing extensions
5349 * Writing extensions
5346
5350
5347 Note that by using the extension api for configuration (editing
5351 Note that by using the extension api for configuration (editing
5348 ipy_user_conf.py instead of ipythonrc), you get better validity checks
5352 ipy_user_conf.py instead of ipythonrc), you get better validity checks
5349 and get richer functionality - for example, you can import an
5353 and get richer functionality - for example, you can import an
5350 extension and call functions in it to configure it for your purposes.
5354 extension and call functions in it to configure it for your purposes.
5351
5355
5352 For an example extension (the 'sh' profile), see
5356 For an example extension (the 'sh' profile), see
5353 IPython/Extensions/ipy_profile_sh.py.
5357 IPython/Extensions/ipy_profile_sh.py.
5354
5358
5355 For the last word on what's available, see the source code of
5359 For the last word on what's available, see the source code of
5356 IPython/ipapi.py.
5360 IPython/ipapi.py.
5357
5361
5358
5362
5359 Getting started
5363 Getting started
5360 ---------------
5364 ---------------
5361
5365
5362 If you want to define an extension, create a normal python module that
5366 If you want to define an extension, create a normal python module that
5363 can be imported. The module will access IPython functionality through
5367 can be imported. The module will access IPython functionality through
5364 the 'ip' object defined below.
5368 the 'ip' object defined below.
5365
5369
5366 If you are creating a new profile (e.g. foobar), name the module as
5370 If you are creating a new profile (e.g. foobar), name the module as
5367 'ipy_profile_foobar.py' and put it in your ~/.ipython directory. Then,
5371 'ipy_profile_foobar.py' and put it in your ~/.ipython directory. Then,
5368 when you start ipython with the '-p foobar' argument, the module is
5372 when you start ipython with the '-p foobar' argument, the module is
5369 automatically imported on ipython startup.
5373 automatically imported on ipython startup.
5370
5374
5371 If you are just doing some per-user configuration, you can either
5375 If you are just doing some per-user configuration, you can either
5372
5376
5373 * Put the commands directly into ipy_user_conf.py.
5377 * Put the commands directly into ipy_user_conf.py.
5374
5378
5375 * Create a new module with your customization code and import *that*
5379 * Create a new module with your customization code and import *that*
5376 module in ipy_user_conf.py. This is preferable to the first approach,
5380 module in ipy_user_conf.py. This is preferable to the first approach,
5377 because now you can reuse and distribute your customization code.
5381 because now you can reuse and distribute your customization code.
5378
5382
5379 Getting a handle to the api
5383 Getting a handle to the api
5380 ---------------------------
5384 ---------------------------
5381
5385
5382 Put this in the start of your module::
5386 Put this in the start of your module::
5383
5387
5384 #!python
5388 #!python
5385 import IPython.ipapi
5389 import IPython.ipapi
5386 ip = IPython.ipapi.get()
5390 ip = IPython.ipapi.get()
5387
5391
5388 The 'ip' object will then be used for accessing IPython
5392 The 'ip' object will then be used for accessing IPython
5389 functionality. 'ip' will mean this api object in all the following
5393 functionality. 'ip' will mean this api object in all the following
5390 code snippets. The same 'ip' that we just acquired is always
5394 code snippets. The same 'ip' that we just acquired is always
5391 accessible in interactive IPython sessions by the name _ip - play with
5395 accessible in interactive IPython sessions by the name _ip - play with
5392 it like this::
5396 it like this::
5393
5397
5394 [~\_ipython]|81> a = 10
5398 [~\_ipython]|81> a = 10
5395 [~\_ipython]|82> _ip.e
5399 [~\_ipython]|82> _ip.e
5396 _ip.ev _ip.ex _ip.expose_magic
5400 _ip.ev _ip.ex _ip.expose_magic
5397 [~\_ipython]|82> _ip.ev('a+13')
5401 [~\_ipython]|82> _ip.ev('a+13')
5398 <82> 23
5402 <82> 23
5399
5403
5400 The _ip object is also used in some examples in this document - it can
5404 The _ip object is also used in some examples in this document - it can
5401 be substituted by 'ip' in non-interactive use.
5405 be substituted by 'ip' in non-interactive use.
5402
5406
5403 Changing options
5407 Changing options
5404 ----------------
5408 ----------------
5405
5409
5406 The ip object has 'options' attribute that can be used te get/set
5410 The ip object has 'options' attribute that can be used te get/set
5407 configuration options (just as in the ipythonrc file)::
5411 configuration options (just as in the ipythonrc file)::
5408
5412
5409 o = ip.options
5413 o = ip.options
5410 o.autocall = 2
5414 o.autocall = 2
5411 o.automagic = 1
5415 o.automagic = 1
5412
5416
5413 Executing statements in IPython namespace with 'ex' and 'ev'
5417 Executing statements in IPython namespace with 'ex' and 'ev'
5414 ------------------------------------------------------------
5418 ------------------------------------------------------------
5415
5419
5416 Often, you want to e.g. import some module or define something that
5420 Often, you want to e.g. import some module or define something that
5417 should be visible in IPython namespace. Use ``ip.ev`` to
5421 should be visible in IPython namespace. Use ``ip.ev`` to
5418 *evaluate* (calculate the value of) expression and ``ip.ex`` to
5422 *evaluate* (calculate the value of) expression and ``ip.ex`` to
5419 '''execute''' a statement::
5423 '''execute''' a statement::
5420
5424
5421 # path module will be visible to the interactive session
5425 # path module will be visible to the interactive session
5422 ip.ex("from path import path" )
5426 ip.ex("from path import path" )
5423
5427
5424 # define a handy function 'up' that changes the working directory
5428 # define a handy function 'up' that changes the working directory
5425
5429
5426 ip.ex('import os')
5430 ip.ex('import os')
5427 ip.ex("def up(): os.chdir('..')")
5431 ip.ex("def up(): os.chdir('..')")
5428
5432
5429
5433
5430 # _i2 has the input history entry #2, print its value in uppercase.
5434 # _i2 has the input history entry #2, print its value in uppercase.
5431 print ip.ev('_i2.upper()')
5435 print ip.ev('_i2.upper()')
5432
5436
5433 Accessing the IPython namespace
5437 Accessing the IPython namespace
5434 -------------------------------
5438 -------------------------------
5435
5439
5436 ip.user_ns attribute has a dictionary containing the IPython global
5440 ip.user_ns attribute has a dictionary containing the IPython global
5437 namespace (the namespace visible in the interactive session).
5441 namespace (the namespace visible in the interactive session).
5438
5442
5439 ::
5443 ::
5440
5444
5441 [~\_ipython]|84> tauno = 555
5445 [~\_ipython]|84> tauno = 555
5442 [~\_ipython]|85> _ip.user_ns['tauno']
5446 [~\_ipython]|85> _ip.user_ns['tauno']
5443 <85> 555
5447 <85> 555
5444
5448
5445 Defining new magic commands
5449 Defining new magic commands
5446 ---------------------------
5450 ---------------------------
5447
5451
5448 The following example defines a new magic command, %impall. What the
5452 The following example defines a new magic command, %impall. What the
5449 command does should be obvious::
5453 command does should be obvious::
5450
5454
5451 def doimp(self, arg):
5455 def doimp(self, arg):
5452 ip = self.api
5456 ip = self.api
5453 ip.ex("import %s; reload(%s); from %s import *" % (
5457 ip.ex("import %s; reload(%s); from %s import *" % (
5454 arg,arg,arg)
5458 arg,arg,arg)
5455 )
5459 )
5456
5460
5457 ip.expose_magic('impall', doimp)
5461 ip.expose_magic('impall', doimp)
5458
5462
5459 Things to observe in this example:
5463 Things to observe in this example:
5460
5464
5461 * Define a function that implements the magic command using the
5465 * Define a function that implements the magic command using the
5462 ipapi methods defined in this document
5466 ipapi methods defined in this document
5463 * The first argument of the function is 'self', i.e. the
5467 * The first argument of the function is 'self', i.e. the
5464 interpreter object. It shouldn't be used directly. however.
5468 interpreter object. It shouldn't be used directly. however.
5465 The interpreter object is probably *not* going to remain stable
5469 The interpreter object is probably *not* going to remain stable
5466 through IPython versions.
5470 through IPython versions.
5467 * Access the ipapi through 'self.api' instead of the global 'ip' object.
5471 * Access the ipapi through 'self.api' instead of the global 'ip' object.
5468 * All the text following the magic command on the command line is
5472 * All the text following the magic command on the command line is
5469 contained in the second argument
5473 contained in the second argument
5470 * Expose the magic by ip.expose_magic()
5474 * Expose the magic by ip.expose_magic()
5471
5475
5472
5476
5473 Calling magic functions and system commands
5477 Calling magic functions and system commands
5474 -------------------------------------------
5478 -------------------------------------------
5475
5479
5476 Use ip.magic() to execute a magic function, and ip.system() to execute
5480 Use ip.magic() to execute a magic function, and ip.system() to execute
5477 a system command::
5481 a system command::
5478
5482
5479 # go to a bookmark
5483 # go to a bookmark
5480 ip.magic('%cd -b relfiles')
5484 ip.magic('%cd -b relfiles')
5481
5485
5482 # execute 'ls -F' system command. Interchangeable with os.system('ls'), really.
5486 # execute 'ls -F' system command. Interchangeable with os.system('ls'), really.
5483 ip.system('ls -F')
5487 ip.system('ls -F')
5484
5488
5485 Launching IPython instance from normal python code
5489 Launching IPython instance from normal python code
5486 --------------------------------------------------
5490 --------------------------------------------------
5487
5491
5488 Use ipapi.launch_new_instance() with an argument that specifies the
5492 Use ipapi.launch_new_instance() with an argument that specifies the
5489 namespace to use. This can be useful for trivially embedding IPython
5493 namespace to use. This can be useful for trivially embedding IPython
5490 into your program. Here's an example of normal python program test.py
5494 into your program. Here's an example of normal python program test.py
5491 ('''without''' an existing IPython session) that launches an IPython
5495 ('''without''' an existing IPython session) that launches an IPython
5492 interpreter and regains control when the interpreter is exited::
5496 interpreter and regains control when the interpreter is exited::
5493
5497
5494 [ipython]|1> cat test.py
5498 [ipython]|1> cat test.py
5495 my_ns = dict(
5499 my_ns = dict(
5496 kissa = 15,
5500 kissa = 15,
5497 koira = 16)
5501 koira = 16)
5498 import IPython.ipapi
5502 import IPython.ipapi
5499 print "launching IPython instance"
5503 print "launching IPython instance"
5500 IPython.ipapi.launch_new_instance(my_ns)
5504 IPython.ipapi.launch_new_instance(my_ns)
5501 print "Exited IPython instance!"
5505 print "Exited IPython instance!"
5502 print "New vals:",my_ns['kissa'], my_ns['koira']
5506 print "New vals:",my_ns['kissa'], my_ns['koira']
5503
5507
5504 And here's what it looks like when run (note how we don't start it
5508 And here's what it looks like when run (note how we don't start it
5505 from an ipython session)::
5509 from an ipython session)::
5506
5510
5507 Q:\ipython>python test.py
5511 Q:\ipython>python test.py
5508 launching IPython instance
5512 launching IPython instance
5509 Py 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] IPy 0.7.3b3.r1975
5513 Py 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] IPy 0.7.3b3.r1975
5510 [ipython]|1> kissa = 444
5514 [ipython]|1> kissa = 444
5511 [ipython]|2> koira = 555
5515 [ipython]|2> koira = 555
5512 [ipython]|3> Exit
5516 [ipython]|3> Exit
5513 Exited IPython instance!
5517 Exited IPython instance!
5514 New vals: 444 555
5518 New vals: 444 555
5515
5519
5516 Accessing unexposed functionality
5520 Accessing unexposed functionality
5517 ---------------------------------
5521 ---------------------------------
5518
5522
5519 There are still many features that are not exposed via the ipapi. If
5523 There are still many features that are not exposed via the ipapi. If
5520 you can't avoid using them, you can use the functionality in
5524 you can't avoid using them, you can use the functionality in
5521 InteractiveShell object (central IPython session class, defined in
5525 InteractiveShell object (central IPython session class, defined in
5522 iplib.py) through ip.IP.
5526 iplib.py) through ip.IP.
5523
5527
5524 For example::
5528 For example::
5525
5529
5526 [~]|7> _ip.IP.expand_aliases('np','myfile.py')
5530 [~]|7> _ip.IP.expand_aliases('np','myfile.py')
5527 <7> 'c:/opt/Notepad++/notepad++.exe myfile.py'
5531 <7> 'c:/opt/Notepad++/notepad++.exe myfile.py'
5528 [~]|8>
5532 [~]|8>
5529
5533
5530 Still, it's preferable that if you encounter such a feature, contact
5534 Still, it's preferable that if you encounter such a feature, contact
5531 the IPython team and request that the functionality be exposed in a
5535 the IPython team and request that the functionality be exposed in a
5532 future version of IPython. Things not in ipapi are more likely to
5536 future version of IPython. Things not in ipapi are more likely to
5533 change over time.
5537 change over time.
5534
5538
5535 Provided extensions
5539 Provided extensions
5536 ===================
5540 ===================
5537
5541
5538 You can see the list of available extensions (and profiles) by doing
5542 You can see the list of available extensions (and profiles) by doing
5539 ``import ipy_<TAB>``. Some extensions don't have the ``ipy_`` prefix in
5543 ``import ipy_<TAB>``. Some extensions don't have the ``ipy_`` prefix in
5540 module name, so you may need to see the contents of IPython/Extensions
5544 module name, so you may need to see the contents of IPython/Extensions
5541 folder to see what's available.
5545 folder to see what's available.
5542
5546
5543 You can see a brief documentation of an extension by looking at the
5547 You can see a brief documentation of an extension by looking at the
5544 module docstring::
5548 module docstring::
5545
5549
5546 [c:p/ipython_main]|190> import ipy_fsops
5550 [c:p/ipython_main]|190> import ipy_fsops
5547 [c:p/ipython_main]|191> ipy_fsops?
5551 [c:p/ipython_main]|191> ipy_fsops?
5548
5552
5549 ...
5553 ...
5550
5554
5551 Docstring:
5555 Docstring:
5552 File system operations
5556 File system operations
5553
5557
5554 Contains: Simple variants of normal unix shell commands (icp, imv, irm,
5558 Contains: Simple variants of normal unix shell commands (icp, imv, irm,
5555 imkdir, igrep).
5559 imkdir, igrep).
5556
5560
5557 You can also install your own extensions - the recommended way is to
5561 You can also install your own extensions - the recommended way is to
5558 just copy the module to ~/.ipython. Extensions are typically enabled
5562 just copy the module to ~/.ipython. Extensions are typically enabled
5559 by just importing them (e.g. in ipy_user_conf.py), but some extensions
5563 by just importing them (e.g. in ipy_user_conf.py), but some extensions
5560 require additional steps, for example::
5564 require additional steps, for example::
5561
5565
5562 [c:p]|192> import ipy_traits_completer
5566 [c:p]|192> import ipy_traits_completer
5563 [c:p]|193> ipy_traits_completer.activate()
5567 [c:p]|193> ipy_traits_completer.activate()
5564
5568
5565 Note that extensions, even if provided in the stock IPython
5569 Note that extensions, even if provided in the stock IPython
5566 installation, are not guaranteed to have the same requirements as the
5570 installation, are not guaranteed to have the same requirements as the
5567 rest of IPython - an extension may require external libraries or a
5571 rest of IPython - an extension may require external libraries or a
5568 newer version of Python than what IPython officially requires. An
5572 newer version of Python than what IPython officially requires. An
5569 extension may also be under a more restrictive license than IPython
5573 extension may also be under a more restrictive license than IPython
5570 (e.g. ipy_bzr is under GPL).
5574 (e.g. ipy_bzr is under GPL).
5571
5575
5572 Just for reference, the list of bundled extensions at the time of
5576 Just for reference, the list of bundled extensions at the time of
5573 writing is below:
5577 writing is below:
5574
5578
5575 astyle.py clearcmd.py envpersist.py ext_rescapture.py ibrowse.py
5579 astyle.py clearcmd.py envpersist.py ext_rescapture.py ibrowse.py
5576 igrid.py InterpreterExec.py InterpreterPasteInput.py ipipe.py
5580 igrid.py InterpreterExec.py InterpreterPasteInput.py ipipe.py
5577 ipy_app_completers.py ipy_autoreload.py ipy_bzr.py ipy_completers.py
5581 ipy_app_completers.py ipy_autoreload.py ipy_bzr.py ipy_completers.py
5578 ipy_constants.py ipy_defaults.py ipy_editors.py ipy_exportdb.py
5582 ipy_constants.py ipy_defaults.py ipy_editors.py ipy_exportdb.py
5579 ipy_extutil.py ipy_fsops.py ipy_gnuglobal.py ipy_kitcfg.py
5583 ipy_extutil.py ipy_fsops.py ipy_gnuglobal.py ipy_kitcfg.py
5580 ipy_legacy.py ipy_leo.py ipy_p4.py ipy_profile_doctest.py
5584 ipy_legacy.py ipy_leo.py ipy_p4.py ipy_profile_doctest.py
5581 ipy_profile_none.py ipy_profile_scipy.py ipy_profile_sh.py
5585 ipy_profile_none.py ipy_profile_scipy.py ipy_profile_sh.py
5582 ipy_profile_zope.py ipy_pydb.py ipy_rehashdir.py ipy_render.py
5586 ipy_profile_zope.py ipy_pydb.py ipy_rehashdir.py ipy_render.py
5583 ipy_server.py ipy_signals.py ipy_stock_completers.py
5587 ipy_server.py ipy_signals.py ipy_stock_completers.py
5584 ipy_system_conf.py ipy_traits_completer.py ipy_vimserver.py
5588 ipy_system_conf.py ipy_traits_completer.py ipy_vimserver.py
5585 ipy_which.py ipy_workdir.py jobctrl.py ledit.py numeric_formats.py
5589 ipy_which.py ipy_workdir.py jobctrl.py ledit.py numeric_formats.py
5586 PhysicalQInput.py PhysicalQInteractive.py pickleshare.py
5590 PhysicalQInput.py PhysicalQInteractive.py pickleshare.py
5587 pspersistence.py win32clip.py __init__.py
5591 pspersistence.py win32clip.py __init__.py
5588
5592
5589 Reporting bugs
5593 Reporting bugs
5590 ==============
5594 ==============
5591
5595
5592 Automatic crash reports
5596 Automatic crash reports
5593 -----------------------
5597 -----------------------
5594
5598
5595 Ideally, IPython itself shouldn't crash. It will catch exceptions
5599 Ideally, IPython itself shouldn't crash. It will catch exceptions
5596 produced by you, but bugs in its internals will still crash it.
5600 produced by you, but bugs in its internals will still crash it.
5597
5601
5598 In such a situation, IPython will leave a file named
5602 In such a situation, IPython will leave a file named
5599 IPython_crash_report.txt in your IPYTHONDIR directory (that way if
5603 IPython_crash_report.txt in your IPYTHONDIR directory (that way if
5600 crashes happen several times it won't litter many directories, the
5604 crashes happen several times it won't litter many directories, the
5601 post-mortem file is always located in the same place and new
5605 post-mortem file is always located in the same place and new
5602 occurrences just overwrite the previous one). If you can mail this
5606 occurrences just overwrite the previous one). If you can mail this
5603 file to the developers (see sec. credits_ for names and addresses), it
5607 file to the developers (see sec. credits_ for names and addresses), it
5604 will help us a lot in understanding the cause of the problem and
5608 will help us a lot in understanding the cause of the problem and
5605 fixing it sooner.
5609 fixing it sooner.
5606
5610
5607
5611
5608 The bug tracker
5612 The bug tracker
5609 ---------------
5613 ---------------
5610
5614
5611 IPython also has an online bug-tracker, located at
5615 IPython also has an online bug-tracker, located at
5612 http://projects.scipy.org/ipython/ipython/report/1. In addition to
5616 http://projects.scipy.org/ipython/ipython/report/1. In addition to
5613 mailing the developers, it would be a good idea to file a bug report
5617 mailing the developers, it would be a good idea to file a bug report
5614 here. This will ensure that the issue is properly followed to
5618 here. This will ensure that the issue is properly followed to
5615 conclusion. To report new bugs you will have to register first.
5619 conclusion. To report new bugs you will have to register first.
5616
5620
5617 You can also use this bug tracker to file feature requests.
5621 You can also use this bug tracker to file feature requests.
5618
5622
5619 Brief history
5623 Brief history
5620 =============
5624 =============
5621
5625
5622
5626
5623 Origins
5627 Origins
5624 -------
5628 -------
5625
5629
5626 The current IPython system grew out of the following three projects:
5630 The current IPython system grew out of the following three projects:
5627
5631
5628 * [ipython] by Fernando Pérez. I was working on adding
5632 * [ipython] by Fernando Pérez. I was working on adding
5629 Mathematica-type prompts and a flexible configuration system
5633 Mathematica-type prompts and a flexible configuration system
5630 (something better than $PYTHONSTARTUP) to the standard Python
5634 (something better than $PYTHONSTARTUP) to the standard Python
5631 interactive interpreter.
5635 interactive interpreter.
5632 * [IPP] by Janko Hauser. Very well organized, great usability. Had
5636 * [IPP] by Janko Hauser. Very well organized, great usability. Had
5633 an old help system. IPP was used as the 'container' code into
5637 an old help system. IPP was used as the 'container' code into
5634 which I added the functionality from ipython and LazyPython.
5638 which I added the functionality from ipython and LazyPython.
5635 * [LazyPython] by Nathan Gray. Simple but very powerful. The quick
5639 * [LazyPython] by Nathan Gray. Simple but very powerful. The quick
5636 syntax (auto parens, auto quotes) and verbose/colored tracebacks
5640 syntax (auto parens, auto quotes) and verbose/colored tracebacks
5637 were all taken from here.
5641 were all taken from here.
5638
5642
5639 When I found out about IPP and LazyPython I tried to join all three
5643 When I found out about IPP and LazyPython I tried to join all three
5640 into a unified system. I thought this could provide a very nice
5644 into a unified system. I thought this could provide a very nice
5641 working environment, both for regular programming and scientific
5645 working environment, both for regular programming and scientific
5642 computing: shell-like features, IDL/Matlab numerics, Mathematica-type
5646 computing: shell-like features, IDL/Matlab numerics, Mathematica-type
5643 prompt history and great object introspection and help facilities. I
5647 prompt history and great object introspection and help facilities. I
5644 think it worked reasonably well, though it was a lot more work than I
5648 think it worked reasonably well, though it was a lot more work than I
5645 had initially planned.
5649 had initially planned.
5646
5650
5647
5651
5648 Current status
5652 Current status
5649 --------------
5653 --------------
5650
5654
5651 The above listed features work, and quite well for the most part. But
5655 The above listed features work, and quite well for the most part. But
5652 until a major internal restructuring is done (see below), only bug
5656 until a major internal restructuring is done (see below), only bug
5653 fixing will be done, no other features will be added (unless very minor
5657 fixing will be done, no other features will be added (unless very minor
5654 and well localized in the cleaner parts of the code).
5658 and well localized in the cleaner parts of the code).
5655
5659
5656 IPython consists of some 18000 lines of pure python code, of which
5660 IPython consists of some 18000 lines of pure python code, of which
5657 roughly two thirds is reasonably clean. The rest is, messy code which
5661 roughly two thirds is reasonably clean. The rest is, messy code which
5658 needs a massive restructuring before any further major work is done.
5662 needs a massive restructuring before any further major work is done.
5659 Even the messy code is fairly well documented though, and most of the
5663 Even the messy code is fairly well documented though, and most of the
5660 problems in the (non-existent) class design are well pointed to by a
5664 problems in the (non-existent) class design are well pointed to by a
5661 PyChecker run. So the rewriting work isn't that bad, it will just be
5665 PyChecker run. So the rewriting work isn't that bad, it will just be
5662 time-consuming.
5666 time-consuming.
5663
5667
5664
5668
5665 Future
5669 Future
5666 ------
5670 ------
5667
5671
5668 See the separate new_design document for details. Ultimately, I would
5672 See the separate new_design document for details. Ultimately, I would
5669 like to see IPython become part of the standard Python distribution as a
5673 like to see IPython become part of the standard Python distribution as a
5670 'big brother with batteries' to the standard Python interactive
5674 'big brother with batteries' to the standard Python interactive
5671 interpreter. But that will never happen with the current state of the
5675 interpreter. But that will never happen with the current state of the
5672 code, so all contributions are welcome.
5676 code, so all contributions are welcome.
5673
5677
5674 License
5678 License
5675 =======
5679 =======
5676
5680
5677 IPython is released under the terms of the BSD license, whose general
5681 IPython is released under the terms of the BSD license, whose general
5678 form can be found at:
5682 form can be found at:
5679 http://www.opensource.org/licenses/bsd-license.php. The full text of the
5683 http://www.opensource.org/licenses/bsd-license.php. The full text of the
5680 IPython license is reproduced below::
5684 IPython license is reproduced below::
5681
5685
5682 IPython is released under a BSD-type license.
5686 IPython is released under a BSD-type license.
5683
5687
5684 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez
5688 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez
5685 <fperez@colorado.edu>.
5689 <fperez@colorado.edu>.
5686
5690
5687 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
5691 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
5688 Nathaniel Gray <n8gray@caltech.edu>.
5692 Nathaniel Gray <n8gray@caltech.edu>.
5689
5693
5690 All rights reserved.
5694 All rights reserved.
5691
5695
5692 Redistribution and use in source and binary forms, with or without
5696 Redistribution and use in source and binary forms, with or without
5693 modification, are permitted provided that the following conditions
5697 modification, are permitted provided that the following conditions
5694 are met:
5698 are met:
5695
5699
5696 a. Redistributions of source code must retain the above copyright
5700 a. Redistributions of source code must retain the above copyright
5697 notice, this list of conditions and the following disclaimer.
5701 notice, this list of conditions and the following disclaimer.
5698
5702
5699 b. Redistributions in binary form must reproduce the above copyright
5703 b. Redistributions in binary form must reproduce the above copyright
5700 notice, this list of conditions and the following disclaimer in the
5704 notice, this list of conditions and the following disclaimer in the
5701 documentation and/or other materials provided with the distribution.
5705 documentation and/or other materials provided with the distribution.
5702
5706
5703 c. Neither the name of the copyright holders nor the names of any
5707 c. Neither the name of the copyright holders nor the names of any
5704 contributors to this software may be used to endorse or promote
5708 contributors to this software may be used to endorse or promote
5705 products derived from this software without specific prior written
5709 products derived from this software without specific prior written
5706 permission.
5710 permission.
5707
5711
5708 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5712 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5709 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5713 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5710 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
5714 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
5711 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
5715 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
5712 REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
5716 REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
5713 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
5717 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
5714 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
5718 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
5715 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5719 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5716 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5720 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5717 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
5721 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
5718 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
5722 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
5719 POSSIBILITY OF SUCH DAMAGE.
5723 POSSIBILITY OF SUCH DAMAGE.
5720
5724
5721 Individual authors are the holders of the copyright for their code and
5725 Individual authors are the holders of the copyright for their code and
5722 are listed in each file.
5726 are listed in each file.
5723
5727
5724 Some files (DPyGetOpt.py, for example) may be licensed under different
5728 Some files (DPyGetOpt.py, for example) may be licensed under different
5725 conditions. Ultimately each file indicates clearly the conditions under
5729 conditions. Ultimately each file indicates clearly the conditions under
5726 which its author/authors have decided to publish the code.
5730 which its author/authors have decided to publish the code.
5727
5731
5728 Versions of IPython up to and including 0.6.3 were released under the
5732 Versions of IPython up to and including 0.6.3 were released under the
5729 GNU Lesser General Public License (LGPL), available at
5733 GNU Lesser General Public License (LGPL), available at
5730 http://www.gnu.org/copyleft/lesser.html.
5734 http://www.gnu.org/copyleft/lesser.html.
5731
5735
5732 Credits
5736 Credits
5733 =======
5737 =======
5734
5738
5735 IPython is mainly developed by Fernando Pérez
5739 IPython is mainly developed by Fernando Pérez
5736 <Fernando.Perez@colorado.edu>, but the project was born from mixing in
5740 <Fernando.Perez@colorado.edu>, but the project was born from mixing in
5737 Fernando's code with the IPP project by Janko Hauser
5741 Fernando's code with the IPP project by Janko Hauser
5738 <jhauser-AT-zscout.de> and LazyPython by Nathan Gray
5742 <jhauser-AT-zscout.de> and LazyPython by Nathan Gray
5739 <n8gray-AT-caltech.edu>. For all IPython-related requests, please
5743 <n8gray-AT-caltech.edu>. For all IPython-related requests, please
5740 contact Fernando.
5744 contact Fernando.
5741
5745
5742 As of early 2006, the following developers have joined the core team:
5746 As of early 2006, the following developers have joined the core team:
5743
5747
5744 * [Robert Kern] <rkern-AT-enthought.com>: co-mentored the 2005
5748 * [Robert Kern] <rkern-AT-enthought.com>: co-mentored the 2005
5745 Google Summer of Code project to develop python interactive
5749 Google Summer of Code project to develop python interactive
5746 notebooks (XML documents) and graphical interface. This project
5750 notebooks (XML documents) and graphical interface. This project
5747 was awarded to the students Tzanko Matev <tsanko-AT-gmail.com> and
5751 was awarded to the students Tzanko Matev <tsanko-AT-gmail.com> and
5748 Toni Alatalo <antont-AT-an.org>
5752 Toni Alatalo <antont-AT-an.org>
5749 * [Brian Granger] <bgranger-AT-scu.edu>: extending IPython to allow
5753 * [Brian Granger] <bgranger-AT-scu.edu>: extending IPython to allow
5750 support for interactive parallel computing.
5754 support for interactive parallel computing.
5751 * [Ville Vainio] <vivainio-AT-gmail.com>: Ville is the new
5755 * [Ville Vainio] <vivainio-AT-gmail.com>: Ville is the new
5752 maintainer for the main trunk of IPython after version 0.7.1.
5756 maintainer for the main trunk of IPython after version 0.7.1.
5753
5757
5754 User or development help should be requested via the IPython mailing lists:
5758 User or development help should be requested via the IPython mailing lists:
5755
5759
5756 *User list:*
5760 *User list:*
5757 http://scipy.net/mailman/listinfo/ipython-user
5761 http://scipy.net/mailman/listinfo/ipython-user
5758 *Developer's list:*
5762 *Developer's list:*
5759 http://scipy.net/mailman/listinfo/ipython-dev
5763 http://scipy.net/mailman/listinfo/ipython-dev
5760
5764
5761 The IPython project is also very grateful to:
5765 The IPython project is also very grateful to:
5762
5766
5763 Bill Bumgarner <bbum-AT-friday.com>: for providing the DPyGetOpt module
5767 Bill Bumgarner <bbum-AT-friday.com>: for providing the DPyGetOpt module
5764 which gives very powerful and convenient handling of command-line
5768 which gives very powerful and convenient handling of command-line
5765 options (light years ahead of what Python 2.1.1's getopt module does).
5769 options (light years ahead of what Python 2.1.1's getopt module does).
5766
5770
5767 Ka-Ping Yee <ping-AT-lfw.org>: for providing the Itpl module for
5771 Ka-Ping Yee <ping-AT-lfw.org>: for providing the Itpl module for
5768 convenient and powerful string interpolation with a much nicer syntax
5772 convenient and powerful string interpolation with a much nicer syntax
5769 than formatting through the '%' operator.
5773 than formatting through the '%' operator.
5770
5774
5771 Arnd Baecker <baecker-AT-physik.tu-dresden.de>: for his many very useful
5775 Arnd Baecker <baecker-AT-physik.tu-dresden.de>: for his many very useful
5772 suggestions and comments, and lots of help with testing and
5776 suggestions and comments, and lots of help with testing and
5773 documentation checking. Many of IPython's newer features are a result of
5777 documentation checking. Many of IPython's newer features are a result of
5774 discussions with him (bugs are still my fault, not his).
5778 discussions with him (bugs are still my fault, not his).
5775
5779
5776 Obviously Guido van Rossum and the whole Python development team, that
5780 Obviously Guido van Rossum and the whole Python development team, that
5777 goes without saying.
5781 goes without saying.
5778
5782
5779 IPython's website is generously hosted at http://ipython.scipy.orgby
5783 IPython's website is generously hosted at http://ipython.scipy.orgby
5780 Enthought (http://www.enthought.com). I am very grateful to them and all
5784 Enthought (http://www.enthought.com). I am very grateful to them and all
5781 of the SciPy team for their contribution.
5785 of the SciPy team for their contribution.
5782
5786
5783 Fernando would also like to thank Stephen Figgins <fig-AT-monitor.net>,
5787 Fernando would also like to thank Stephen Figgins <fig-AT-monitor.net>,
5784 an O'Reilly Python editor. His Oct/11/2001 article about IPP and
5788 an O'Reilly Python editor. His Oct/11/2001 article about IPP and
5785 LazyPython, was what got this project started. You can read it at:
5789 LazyPython, was what got this project started. You can read it at:
5786 http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html.
5790 http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html.
5787
5791
5788 And last but not least, all the kind IPython users who have emailed new
5792 And last but not least, all the kind IPython users who have emailed new
5789 code, bug reports, fixes, comments and ideas. A brief list follows,
5793 code, bug reports, fixes, comments and ideas. A brief list follows,
5790 please let me know if I have ommitted your name by accident:
5794 please let me know if I have ommitted your name by accident:
5791
5795
5792 * [Jack Moffit] <jack-AT-xiph.org> Bug fixes, including the infamous
5796 * [Jack Moffit] <jack-AT-xiph.org> Bug fixes, including the infamous
5793 color problem. This bug alone caused many lost hours and
5797 color problem. This bug alone caused many lost hours and
5794 frustration, many thanks to him for the fix. I've always been a
5798 frustration, many thanks to him for the fix. I've always been a
5795 fan of Ogg & friends, now I have one more reason to like these folks.
5799 fan of Ogg & friends, now I have one more reason to like these folks.
5796 Jack is also contributing with Debian packaging and many other
5800 Jack is also contributing with Debian packaging and many other
5797 things.
5801 things.
5798 * [Alexander Schmolck] <a.schmolck-AT-gmx.net> Emacs work, bug
5802 * [Alexander Schmolck] <a.schmolck-AT-gmx.net> Emacs work, bug
5799 reports, bug fixes, ideas, lots more. The ipython.el mode for
5803 reports, bug fixes, ideas, lots more. The ipython.el mode for
5800 (X)Emacs is Alex's code, providing full support for IPython under
5804 (X)Emacs is Alex's code, providing full support for IPython under
5801 (X)Emacs.
5805 (X)Emacs.
5802 * [Andrea Riciputi] <andrea.riciputi-AT-libero.it> Mac OSX
5806 * [Andrea Riciputi] <andrea.riciputi-AT-libero.it> Mac OSX
5803 information, Fink package management.
5807 information, Fink package management.
5804 * [Gary Bishop] <gb-AT-cs.unc.edu> Bug reports, and patches to work
5808 * [Gary Bishop] <gb-AT-cs.unc.edu> Bug reports, and patches to work
5805 around the exception handling idiosyncracies of WxPython. Readline
5809 around the exception handling idiosyncracies of WxPython. Readline
5806 and color support for Windows.
5810 and color support for Windows.
5807 * [Jeffrey Collins] <Jeff.Collins-AT-vexcel.com> Bug reports. Much
5811 * [Jeffrey Collins] <Jeff.Collins-AT-vexcel.com> Bug reports. Much
5808 improved readline support, including fixes for Python 2.3.
5812 improved readline support, including fixes for Python 2.3.
5809 * [Dryice Liu] <dryice-AT-liu.com.cn> FreeBSD port.
5813 * [Dryice Liu] <dryice-AT-liu.com.cn> FreeBSD port.
5810 * [Mike Heeter] <korora-AT-SDF.LONESTAR.ORG>
5814 * [Mike Heeter] <korora-AT-SDF.LONESTAR.ORG>
5811 * [Christopher Hart] <hart-AT-caltech.edu> PDB integration.
5815 * [Christopher Hart] <hart-AT-caltech.edu> PDB integration.
5812 * [Milan Zamazal] <pdm-AT-zamazal.org> Emacs info.
5816 * [Milan Zamazal] <pdm-AT-zamazal.org> Emacs info.
5813 * [Philip Hisley] <compsys-AT-starpower.net>
5817 * [Philip Hisley] <compsys-AT-starpower.net>
5814 * [Holger Krekel] <pyth-AT-devel.trillke.net> Tab completion, lots
5818 * [Holger Krekel] <pyth-AT-devel.trillke.net> Tab completion, lots
5815 more.
5819 more.
5816 * [Robin Siebler] <robinsiebler-AT-starband.net>
5820 * [Robin Siebler] <robinsiebler-AT-starband.net>
5817 * [Ralf Ahlbrink] <ralf_ahlbrink-AT-web.de>
5821 * [Ralf Ahlbrink] <ralf_ahlbrink-AT-web.de>
5818 * [Thorsten Kampe] <thorsten-AT-thorstenkampe.de>
5822 * [Thorsten Kampe] <thorsten-AT-thorstenkampe.de>
5819 * [Fredrik Kant] <fredrik.kant-AT-front.com> Windows setup.
5823 * [Fredrik Kant] <fredrik.kant-AT-front.com> Windows setup.
5820 * [Syver Enstad] <syver-en-AT-online.no> Windows setup.
5824 * [Syver Enstad] <syver-en-AT-online.no> Windows setup.
5821 * [Richard] <rxe-AT-renre-europe.com> Global embedding.
5825 * [Richard] <rxe-AT-renre-europe.com> Global embedding.
5822 * [Hayden Callow] <h.callow-AT-elec.canterbury.ac.nz> Gnuplot.py 1.6
5826 * [Hayden Callow] <h.callow-AT-elec.canterbury.ac.nz> Gnuplot.py 1.6
5823 compatibility.
5827 compatibility.
5824 * [Leonardo Santagada] <retype-AT-terra.com.br> Fixes for Windows
5828 * [Leonardo Santagada] <retype-AT-terra.com.br> Fixes for Windows
5825 installation.
5829 installation.
5826 * [Christopher Armstrong] <radix-AT-twistedmatrix.com> Bugfixes.
5830 * [Christopher Armstrong] <radix-AT-twistedmatrix.com> Bugfixes.
5827 * [Francois Pinard] <pinard-AT-iro.umontreal.ca> Code and
5831 * [Francois Pinard] <pinard-AT-iro.umontreal.ca> Code and
5828 documentation fixes.
5832 documentation fixes.
5829 * [Cory Dodt] <cdodt-AT-fcoe.k12.ca.us> Bug reports and Windows
5833 * [Cory Dodt] <cdodt-AT-fcoe.k12.ca.us> Bug reports and Windows
5830 ideas. Patches for Windows installer.
5834 ideas. Patches for Windows installer.
5831 * [Olivier Aubert] <oaubert-AT-bat710.univ-lyon1.fr> New magics.
5835 * [Olivier Aubert] <oaubert-AT-bat710.univ-lyon1.fr> New magics.
5832 * [King C. Shu] <kingshu-AT-myrealbox.com> Autoindent patch.
5836 * [King C. Shu] <kingshu-AT-myrealbox.com> Autoindent patch.
5833 * [Chris Drexler] <chris-AT-ac-drexler.de> Readline packages for
5837 * [Chris Drexler] <chris-AT-ac-drexler.de> Readline packages for
5834 Win32/CygWin.
5838 Win32/CygWin.
5835 * [Gustavo Cordova Avila] <gcordova-AT-sismex.com> EvalDict code for
5839 * [Gustavo Cordova Avila] <gcordova-AT-sismex.com> EvalDict code for
5836 nice, lightweight string interpolation.
5840 nice, lightweight string interpolation.
5837 * [Kasper Souren] <Kasper.Souren-AT-ircam.fr> Bug reports, ideas.
5841 * [Kasper Souren] <Kasper.Souren-AT-ircam.fr> Bug reports, ideas.
5838 * [Gever Tulley] <gever-AT-helium.com> Code contributions.
5842 * [Gever Tulley] <gever-AT-helium.com> Code contributions.
5839 * [Ralf Schmitt] <ralf-AT-brainbot.com> Bug reports & fixes.
5843 * [Ralf Schmitt] <ralf-AT-brainbot.com> Bug reports & fixes.
5840 * [Oliver Sander] <osander-AT-gmx.de> Bug reports.
5844 * [Oliver Sander] <osander-AT-gmx.de> Bug reports.
5841 * [Rod Holland] <rhh-AT-structurelabs.com> Bug reports and fixes to
5845 * [Rod Holland] <rhh-AT-structurelabs.com> Bug reports and fixes to
5842 logging module.
5846 logging module.
5843 * [Daniel 'Dang' Griffith] <pythondev-dang-AT-lazytwinacres.net>
5847 * [Daniel 'Dang' Griffith] <pythondev-dang-AT-lazytwinacres.net>
5844 Fixes, enhancement suggestions for system shell use.
5848 Fixes, enhancement suggestions for system shell use.
5845 * [Viktor Ransmayr] <viktor.ransmayr-AT-t-online.de> Tests and
5849 * [Viktor Ransmayr] <viktor.ransmayr-AT-t-online.de> Tests and
5846 reports on Windows installation issues. Contributed a true Windows
5850 reports on Windows installation issues. Contributed a true Windows
5847 binary installer.
5851 binary installer.
5848 * [Mike Salib] <msalib-AT-mit.edu> Help fixing a subtle bug related
5852 * [Mike Salib] <msalib-AT-mit.edu> Help fixing a subtle bug related
5849 to traceback printing.
5853 to traceback printing.
5850 * [W.J. van der Laan] <gnufnork-AT-hetdigitalegat.nl> Bash-like
5854 * [W.J. van der Laan] <gnufnork-AT-hetdigitalegat.nl> Bash-like
5851 prompt specials.
5855 prompt specials.
5852 * [Antoon Pardon] <Antoon.Pardon-AT-rece.vub.ac.be> Critical fix for
5856 * [Antoon Pardon] <Antoon.Pardon-AT-rece.vub.ac.be> Critical fix for
5853 the multithreaded IPython.
5857 the multithreaded IPython.
5854 * [John Hunter] <jdhunter-AT-nitace.bsd.uchicago.edu> Matplotlib
5858 * [John Hunter] <jdhunter-AT-nitace.bsd.uchicago.edu> Matplotlib
5855 author, helped with all the development of support for matplotlib
5859 author, helped with all the development of support for matplotlib
5856 in IPyhton, including making necessary changes to matplotlib itself.
5860 in IPyhton, including making necessary changes to matplotlib itself.
5857 * [Matthew Arnison] <maffew-AT-cat.org.au> Bug reports, '%run -d' idea.
5861 * [Matthew Arnison] <maffew-AT-cat.org.au> Bug reports, '%run -d' idea.
5858 * [Prabhu Ramachandran] <prabhu_r-AT-users.sourceforge.net> Help
5862 * [Prabhu Ramachandran] <prabhu_r-AT-users.sourceforge.net> Help
5859 with (X)Emacs support, threading patches, ideas...
5863 with (X)Emacs support, threading patches, ideas...
5860 * [Norbert Tretkowski] <tretkowski-AT-inittab.de> help with Debian
5864 * [Norbert Tretkowski] <tretkowski-AT-inittab.de> help with Debian
5861 packaging and distribution.
5865 packaging and distribution.
5862 * [George Sakkis] <gsakkis-AT-eden.rutgers.edu> New matcher for
5866 * [George Sakkis] <gsakkis-AT-eden.rutgers.edu> New matcher for
5863 tab-completing named arguments of user-defined functions.
5867 tab-completing named arguments of user-defined functions.
5864 * [Jörgen Stenarson] <jorgen.stenarson-AT-bostream.nu> Wildcard
5868 * [Jörgen Stenarson] <jorgen.stenarson-AT-bostream.nu> Wildcard
5865 support implementation for searching namespaces.
5869 support implementation for searching namespaces.
5866 * [Vivian De Smedt] <vivian-AT-vdesmedt.com> Debugger enhancements,
5870 * [Vivian De Smedt] <vivian-AT-vdesmedt.com> Debugger enhancements,
5867 so that when pdb is activated from within IPython, coloring, tab
5871 so that when pdb is activated from within IPython, coloring, tab
5868 completion and other features continue to work seamlessly.
5872 completion and other features continue to work seamlessly.
5869 * [Scott Tsai] <scottt958-AT-yahoo.com.tw> Support for automatic
5873 * [Scott Tsai] <scottt958-AT-yahoo.com.tw> Support for automatic
5870 editor invocation on syntax errors (see
5874 editor invocation on syntax errors (see
5871 http://www.scipy.net/roundup/ipython/issue36).
5875 http://www.scipy.net/roundup/ipython/issue36).
5872 * [Alexander Belchenko] <bialix-AT-ukr.net> Improvements for win32
5876 * [Alexander Belchenko] <bialix-AT-ukr.net> Improvements for win32
5873 paging system.
5877 paging system.
5874 * [Will Maier] <willmaier-AT-ml1.net> Official OpenBSD port.
5878 * [Will Maier] <willmaier-AT-ml1.net> Official OpenBSD port.
5875
5879
General Comments 0
You need to be logged in to leave comments. Login now