##// END OF EJS Templates
- Modified clock() to return total (user+system) time. Introduced...
fperez -
Show More
@@ -1,1731 +1,1751 b''
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 General purpose utilities.
4 4
5 5 This is a grab-bag of stuff I find useful in most programs I write. Some of
6 6 these things are also convenient when working at the command line.
7 7
8 $Id: genutils.py 1930 2006-11-26 17:22:13Z vivainio $"""
8 $Id: genutils.py 2108 2007-02-23 00:31:17Z fperez $"""
9 9
10 10 #*****************************************************************************
11 11 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
12 12 #
13 13 # Distributed under the terms of the BSD License. The full license is in
14 14 # the file COPYING, distributed as part of this software.
15 15 #*****************************************************************************
16 16
17 17 from IPython import Release
18 18 __author__ = '%s <%s>' % Release.authors['Fernando']
19 19 __license__ = Release.license
20 20
21 21 #****************************************************************************
22 22 # required modules from the Python standard library
23 23 import __main__
24 24 import commands
25 25 import os
26 26 import re
27 27 import shlex
28 28 import shutil
29 29 import sys
30 30 import tempfile
31 31 import time
32 32 import types
33 33 import warnings
34 34
35 35 # Other IPython utilities
36 36 from IPython.Itpl import Itpl,itpl,printpl
37 37 from IPython import DPyGetOpt
38 38 from path import path
39 39 if os.name == "nt":
40 40 from IPython.winconsole import get_console_size
41 41
42 42 #****************************************************************************
43 43 # Exceptions
44 44 class Error(Exception):
45 45 """Base class for exceptions in this module."""
46 46 pass
47 47
48 48 #----------------------------------------------------------------------------
49 49 class IOStream:
50 50 def __init__(self,stream,fallback):
51 51 if not hasattr(stream,'write') or not hasattr(stream,'flush'):
52 52 stream = fallback
53 53 self.stream = stream
54 54 self._swrite = stream.write
55 55 self.flush = stream.flush
56 56
57 57 def write(self,data):
58 58 try:
59 59 self._swrite(data)
60 60 except:
61 61 try:
62 62 # print handles some unicode issues which may trip a plain
63 63 # write() call. Attempt to emulate write() by using a
64 64 # trailing comma
65 65 print >> self.stream, data,
66 66 except:
67 67 # if we get here, something is seriously broken.
68 68 print >> sys.stderr, \
69 69 'ERROR - failed to write data to stream:', self.stream
70 70
71 71 class IOTerm:
72 72 """ Term holds the file or file-like objects for handling I/O operations.
73 73
74 74 These are normally just sys.stdin, sys.stdout and sys.stderr but for
75 75 Windows they can can replaced to allow editing the strings before they are
76 76 displayed."""
77 77
78 78 # In the future, having IPython channel all its I/O operations through
79 79 # this class will make it easier to embed it into other environments which
80 80 # are not a normal terminal (such as a GUI-based shell)
81 81 def __init__(self,cin=None,cout=None,cerr=None):
82 82 self.cin = IOStream(cin,sys.stdin)
83 83 self.cout = IOStream(cout,sys.stdout)
84 84 self.cerr = IOStream(cerr,sys.stderr)
85 85
86 86 # Global variable to be used for all I/O
87 87 Term = IOTerm()
88 88
89 89 import IPython.rlineimpl as readline
90 90 # Remake Term to use the readline i/o facilities
91 91 if sys.platform == 'win32' and readline.have_readline:
92 92
93 93 Term = IOTerm(cout=readline._outputfile,cerr=readline._outputfile)
94 94
95 95
96 96 #****************************************************************************
97 97 # Generic warning/error printer, used by everything else
98 98 def warn(msg,level=2,exit_val=1):
99 99 """Standard warning printer. Gives formatting consistency.
100 100
101 101 Output is sent to Term.cerr (sys.stderr by default).
102 102
103 103 Options:
104 104
105 105 -level(2): allows finer control:
106 106 0 -> Do nothing, dummy function.
107 107 1 -> Print message.
108 108 2 -> Print 'WARNING:' + message. (Default level).
109 109 3 -> Print 'ERROR:' + message.
110 110 4 -> Print 'FATAL ERROR:' + message and trigger a sys.exit(exit_val).
111 111
112 112 -exit_val (1): exit value returned by sys.exit() for a level 4
113 113 warning. Ignored for all other levels."""
114 114
115 115 if level>0:
116 116 header = ['','','WARNING: ','ERROR: ','FATAL ERROR: ']
117 117 print >> Term.cerr, '%s%s' % (header[level],msg)
118 118 if level == 4:
119 119 print >> Term.cerr,'Exiting.\n'
120 120 sys.exit(exit_val)
121 121
122 122 def info(msg):
123 123 """Equivalent to warn(msg,level=1)."""
124 124
125 125 warn(msg,level=1)
126 126
127 127 def error(msg):
128 128 """Equivalent to warn(msg,level=3)."""
129 129
130 130 warn(msg,level=3)
131 131
132 132 def fatal(msg,exit_val=1):
133 133 """Equivalent to warn(msg,exit_val=exit_val,level=4)."""
134 134
135 135 warn(msg,exit_val=exit_val,level=4)
136 136
137 137 #---------------------------------------------------------------------------
138 138 # Debugging routines
139 139 #
140 140 def debugx(expr,pre_msg=''):
141 141 """Print the value of an expression from the caller's frame.
142 142
143 143 Takes an expression, evaluates it in the caller's frame and prints both
144 144 the given expression and the resulting value (as well as a debug mark
145 145 indicating the name of the calling function. The input must be of a form
146 146 suitable for eval().
147 147
148 148 An optional message can be passed, which will be prepended to the printed
149 149 expr->value pair."""
150 150
151 151 cf = sys._getframe(1)
152 152 print '[DBG:%s] %s%s -> %r' % (cf.f_code.co_name,pre_msg,expr,
153 153 eval(expr,cf.f_globals,cf.f_locals))
154 154
155 155 # deactivate it by uncommenting the following line, which makes it a no-op
156 156 #def debugx(expr,pre_msg=''): pass
157 157
158 158 #----------------------------------------------------------------------------
159 159 StringTypes = types.StringTypes
160 160
161 161 # Basic timing functionality
162 162
163 163 # If possible (Unix), use the resource module instead of time.clock()
164 164 try:
165 165 import resource
166 def clock():
167 """clock() -> floating point number
166 def clocku():
167 """clocku() -> floating point number
168 168
169 Return the CPU time in seconds (user time only, system time is
170 ignored) since the start of the process. This is done via a call to
171 resource.getrusage, so it avoids the wraparound problems in
172 time.clock()."""
169 Return the *USER* CPU time in seconds since the start of the process.
170 This is done via a call to resource.getrusage, so it avoids the
171 wraparound problems in time.clock()."""
173 172
174 173 return resource.getrusage(resource.RUSAGE_SELF)[0]
175 174
175 def clocks():
176 """clocks() -> floating point number
177
178 Return the *SYSTEM* CPU time in seconds since the start of the process.
179 This is done via a call to resource.getrusage, so it avoids the
180 wraparound problems in time.clock()."""
181
182 return resource.getrusage(resource.RUSAGE_SELF)[1]
183
184 def clock():
185 """clock() -> floating point number
186
187 Return the *TOTAL USER+SYSTEM* CPU time in seconds since the start of
188 the process. This is done via a call to resource.getrusage, so it
189 avoids the wraparound problems in time.clock()."""
190
191 u,s = resource.getrusage(resource.RUSAGE_SELF)[:2]
192 return u+s
193
176 194 def clock2():
177 195 """clock2() -> (t_user,t_system)
178 196
179 197 Similar to clock(), but return a tuple of user/system times."""
180 198 return resource.getrusage(resource.RUSAGE_SELF)[:2]
181 199
182 200 except ImportError:
183 clock = time.clock
201 # There is no distinction of user/system time under windows, so we just use
202 # time.clock() for everything...
203 clocku = clocks = clock = time.clock
184 204 def clock2():
185 205 """Under windows, system CPU time can't be measured.
186 206
187 207 This just returns clock() and zero."""
188 208 return time.clock(),0.0
189 209
190 210 def timings_out(reps,func,*args,**kw):
191 211 """timings_out(reps,func,*args,**kw) -> (t_total,t_per_call,output)
192 212
193 213 Execute a function reps times, return a tuple with the elapsed total
194 214 CPU time in seconds, the time per call and the function's output.
195 215
196 216 Under Unix, the return value is the sum of user+system time consumed by
197 217 the process, computed via the resource module. This prevents problems
198 218 related to the wraparound effect which the time.clock() function has.
199 219
200 220 Under Windows the return value is in wall clock seconds. See the
201 221 documentation for the time module for more details."""
202 222
203 223 reps = int(reps)
204 224 assert reps >=1, 'reps must be >= 1'
205 225 if reps==1:
206 226 start = clock()
207 227 out = func(*args,**kw)
208 228 tot_time = clock()-start
209 229 else:
210 230 rng = xrange(reps-1) # the last time is executed separately to store output
211 231 start = clock()
212 232 for dummy in rng: func(*args,**kw)
213 233 out = func(*args,**kw) # one last time
214 234 tot_time = clock()-start
215 235 av_time = tot_time / reps
216 236 return tot_time,av_time,out
217 237
218 238 def timings(reps,func,*args,**kw):
219 239 """timings(reps,func,*args,**kw) -> (t_total,t_per_call)
220 240
221 241 Execute a function reps times, return a tuple with the elapsed total CPU
222 242 time in seconds and the time per call. These are just the first two values
223 243 in timings_out()."""
224 244
225 245 return timings_out(reps,func,*args,**kw)[0:2]
226 246
227 247 def timing(func,*args,**kw):
228 248 """timing(func,*args,**kw) -> t_total
229 249
230 250 Execute a function once, return the elapsed total CPU time in
231 251 seconds. This is just the first value in timings_out()."""
232 252
233 253 return timings_out(1,func,*args,**kw)[0]
234 254
235 255 #****************************************************************************
236 256 # file and system
237 257
238 258 def arg_split(s,posix=False):
239 259 """Split a command line's arguments in a shell-like manner.
240 260
241 261 This is a modified version of the standard library's shlex.split()
242 262 function, but with a default of posix=False for splitting, so that quotes
243 263 in inputs are respected."""
244 264
245 265 lex = shlex.shlex(s, posix=posix)
246 266 lex.whitespace_split = True
247 267 return list(lex)
248 268
249 269 def system(cmd,verbose=0,debug=0,header=''):
250 270 """Execute a system command, return its exit status.
251 271
252 272 Options:
253 273
254 274 - verbose (0): print the command to be executed.
255 275
256 276 - debug (0): only print, do not actually execute.
257 277
258 278 - header (''): Header to print on screen prior to the executed command (it
259 279 is only prepended to the command, no newlines are added).
260 280
261 281 Note: a stateful version of this function is available through the
262 282 SystemExec class."""
263 283
264 284 stat = 0
265 285 if verbose or debug: print header+cmd
266 286 sys.stdout.flush()
267 287 if not debug: stat = os.system(cmd)
268 288 return stat
269 289
270 290 # This function is used by ipython in a lot of places to make system calls.
271 291 # We need it to be slightly different under win32, due to the vagaries of
272 292 # 'network shares'. A win32 override is below.
273 293
274 294 def shell(cmd,verbose=0,debug=0,header=''):
275 295 """Execute a command in the system shell, always return None.
276 296
277 297 Options:
278 298
279 299 - verbose (0): print the command to be executed.
280 300
281 301 - debug (0): only print, do not actually execute.
282 302
283 303 - header (''): Header to print on screen prior to the executed command (it
284 304 is only prepended to the command, no newlines are added).
285 305
286 306 Note: this is similar to genutils.system(), but it returns None so it can
287 307 be conveniently used in interactive loops without getting the return value
288 308 (typically 0) printed many times."""
289 309
290 310 stat = 0
291 311 if verbose or debug: print header+cmd
292 312 # flush stdout so we don't mangle python's buffering
293 313 sys.stdout.flush()
294 314 if not debug:
295 315 os.system(cmd)
296 316
297 317 # override shell() for win32 to deal with network shares
298 318 if os.name in ('nt','dos'):
299 319
300 320 shell_ori = shell
301 321
302 322 def shell(cmd,verbose=0,debug=0,header=''):
303 323 if os.getcwd().startswith(r"\\"):
304 324 path = os.getcwd()
305 325 # change to c drive (cannot be on UNC-share when issuing os.system,
306 326 # as cmd.exe cannot handle UNC addresses)
307 327 os.chdir("c:")
308 328 # issue pushd to the UNC-share and then run the command
309 329 try:
310 330 shell_ori('"pushd %s&&"'%path+cmd,verbose,debug,header)
311 331 finally:
312 332 os.chdir(path)
313 333 else:
314 334 shell_ori(cmd,verbose,debug,header)
315 335
316 336 shell.__doc__ = shell_ori.__doc__
317 337
318 338 def getoutput(cmd,verbose=0,debug=0,header='',split=0):
319 339 """Dummy substitute for perl's backquotes.
320 340
321 341 Executes a command and returns the output.
322 342
323 343 Accepts the same arguments as system(), plus:
324 344
325 345 - split(0): if true, the output is returned as a list split on newlines.
326 346
327 347 Note: a stateful version of this function is available through the
328 348 SystemExec class.
329 349
330 350 This is pretty much deprecated and rarely used,
331 351 genutils.getoutputerror may be what you need.
332 352
333 353 """
334 354
335 355 if verbose or debug: print header+cmd
336 356 if not debug:
337 357 output = os.popen(cmd).read()
338 358 # stipping last \n is here for backwards compat.
339 359 if output.endswith('\n'):
340 360 output = output[:-1]
341 361 if split:
342 362 return output.split('\n')
343 363 else:
344 364 return output
345 365
346 366 def getoutputerror(cmd,verbose=0,debug=0,header='',split=0):
347 367 """Return (standard output,standard error) of executing cmd in a shell.
348 368
349 369 Accepts the same arguments as system(), plus:
350 370
351 371 - split(0): if true, each of stdout/err is returned as a list split on
352 372 newlines.
353 373
354 374 Note: a stateful version of this function is available through the
355 375 SystemExec class."""
356 376
357 377 if verbose or debug: print header+cmd
358 378 if not cmd:
359 379 if split:
360 380 return [],[]
361 381 else:
362 382 return '',''
363 383 if not debug:
364 384 pin,pout,perr = os.popen3(cmd)
365 385 tout = pout.read().rstrip()
366 386 terr = perr.read().rstrip()
367 387 pin.close()
368 388 pout.close()
369 389 perr.close()
370 390 if split:
371 391 return tout.split('\n'),terr.split('\n')
372 392 else:
373 393 return tout,terr
374 394
375 395 # for compatibility with older naming conventions
376 396 xsys = system
377 397 bq = getoutput
378 398
379 399 class SystemExec:
380 400 """Access the system and getoutput functions through a stateful interface.
381 401
382 402 Note: here we refer to the system and getoutput functions from this
383 403 library, not the ones from the standard python library.
384 404
385 405 This class offers the system and getoutput functions as methods, but the
386 406 verbose, debug and header parameters can be set for the instance (at
387 407 creation time or later) so that they don't need to be specified on each
388 408 call.
389 409
390 410 For efficiency reasons, there's no way to override the parameters on a
391 411 per-call basis other than by setting instance attributes. If you need
392 412 local overrides, it's best to directly call system() or getoutput().
393 413
394 414 The following names are provided as alternate options:
395 415 - xsys: alias to system
396 416 - bq: alias to getoutput
397 417
398 418 An instance can then be created as:
399 419 >>> sysexec = SystemExec(verbose=1,debug=0,header='Calling: ')
400 420
401 421 And used as:
402 422 >>> sysexec.xsys('pwd')
403 423 >>> dirlist = sysexec.bq('ls -l')
404 424 """
405 425
406 426 def __init__(self,verbose=0,debug=0,header='',split=0):
407 427 """Specify the instance's values for verbose, debug and header."""
408 428 setattr_list(self,'verbose debug header split')
409 429
410 430 def system(self,cmd):
411 431 """Stateful interface to system(), with the same keyword parameters."""
412 432
413 433 system(cmd,self.verbose,self.debug,self.header)
414 434
415 435 def shell(self,cmd):
416 436 """Stateful interface to shell(), with the same keyword parameters."""
417 437
418 438 shell(cmd,self.verbose,self.debug,self.header)
419 439
420 440 xsys = system # alias
421 441
422 442 def getoutput(self,cmd):
423 443 """Stateful interface to getoutput()."""
424 444
425 445 return getoutput(cmd,self.verbose,self.debug,self.header,self.split)
426 446
427 447 def getoutputerror(self,cmd):
428 448 """Stateful interface to getoutputerror()."""
429 449
430 450 return getoutputerror(cmd,self.verbose,self.debug,self.header,self.split)
431 451
432 452 bq = getoutput # alias
433 453
434 454 #-----------------------------------------------------------------------------
435 455 def mutex_opts(dict,ex_op):
436 456 """Check for presence of mutually exclusive keys in a dict.
437 457
438 458 Call: mutex_opts(dict,[[op1a,op1b],[op2a,op2b]...]"""
439 459 for op1,op2 in ex_op:
440 460 if op1 in dict and op2 in dict:
441 461 raise ValueError,'\n*** ERROR in Arguments *** '\
442 462 'Options '+op1+' and '+op2+' are mutually exclusive.'
443 463
444 464 #-----------------------------------------------------------------------------
445 465 def get_py_filename(name):
446 466 """Return a valid python filename in the current directory.
447 467
448 468 If the given name is not a file, it adds '.py' and searches again.
449 469 Raises IOError with an informative message if the file isn't found."""
450 470
451 471 name = os.path.expanduser(name)
452 472 if not os.path.isfile(name) and not name.endswith('.py'):
453 473 name += '.py'
454 474 if os.path.isfile(name):
455 475 return name
456 476 else:
457 477 raise IOError,'File `%s` not found.' % name
458 478
459 479 #-----------------------------------------------------------------------------
460 480 def filefind(fname,alt_dirs = None):
461 481 """Return the given filename either in the current directory, if it
462 482 exists, or in a specified list of directories.
463 483
464 484 ~ expansion is done on all file and directory names.
465 485
466 486 Upon an unsuccessful search, raise an IOError exception."""
467 487
468 488 if alt_dirs is None:
469 489 try:
470 490 alt_dirs = get_home_dir()
471 491 except HomeDirError:
472 492 alt_dirs = os.getcwd()
473 493 search = [fname] + list_strings(alt_dirs)
474 494 search = map(os.path.expanduser,search)
475 495 #print 'search list for',fname,'list:',search # dbg
476 496 fname = search[0]
477 497 if os.path.isfile(fname):
478 498 return fname
479 499 for direc in search[1:]:
480 500 testname = os.path.join(direc,fname)
481 501 #print 'testname',testname # dbg
482 502 if os.path.isfile(testname):
483 503 return testname
484 504 raise IOError,'File' + `fname` + \
485 505 ' not found in current or supplied directories:' + `alt_dirs`
486 506
487 507 #----------------------------------------------------------------------------
488 508 def file_read(filename):
489 509 """Read a file and close it. Returns the file source."""
490 510 fobj = open(filename,'r');
491 511 source = fobj.read();
492 512 fobj.close()
493 513 return source
494 514
495 515 def file_readlines(filename):
496 516 """Read a file and close it. Returns the file source using readlines()."""
497 517 fobj = open(filename,'r');
498 518 lines = fobj.readlines();
499 519 fobj.close()
500 520 return lines
501 521
502 522 #----------------------------------------------------------------------------
503 523 def target_outdated(target,deps):
504 524 """Determine whether a target is out of date.
505 525
506 526 target_outdated(target,deps) -> 1/0
507 527
508 528 deps: list of filenames which MUST exist.
509 529 target: single filename which may or may not exist.
510 530
511 531 If target doesn't exist or is older than any file listed in deps, return
512 532 true, otherwise return false.
513 533 """
514 534 try:
515 535 target_time = os.path.getmtime(target)
516 536 except os.error:
517 537 return 1
518 538 for dep in deps:
519 539 dep_time = os.path.getmtime(dep)
520 540 if dep_time > target_time:
521 541 #print "For target",target,"Dep failed:",dep # dbg
522 542 #print "times (dep,tar):",dep_time,target_time # dbg
523 543 return 1
524 544 return 0
525 545
526 546 #-----------------------------------------------------------------------------
527 547 def target_update(target,deps,cmd):
528 548 """Update a target with a given command given a list of dependencies.
529 549
530 550 target_update(target,deps,cmd) -> runs cmd if target is outdated.
531 551
532 552 This is just a wrapper around target_outdated() which calls the given
533 553 command if target is outdated."""
534 554
535 555 if target_outdated(target,deps):
536 556 xsys(cmd)
537 557
538 558 #----------------------------------------------------------------------------
539 559 def unquote_ends(istr):
540 560 """Remove a single pair of quotes from the endpoints of a string."""
541 561
542 562 if not istr:
543 563 return istr
544 564 if (istr[0]=="'" and istr[-1]=="'") or \
545 565 (istr[0]=='"' and istr[-1]=='"'):
546 566 return istr[1:-1]
547 567 else:
548 568 return istr
549 569
550 570 #----------------------------------------------------------------------------
551 571 def process_cmdline(argv,names=[],defaults={},usage=''):
552 572 """ Process command-line options and arguments.
553 573
554 574 Arguments:
555 575
556 576 - argv: list of arguments, typically sys.argv.
557 577
558 578 - names: list of option names. See DPyGetOpt docs for details on options
559 579 syntax.
560 580
561 581 - defaults: dict of default values.
562 582
563 583 - usage: optional usage notice to print if a wrong argument is passed.
564 584
565 585 Return a dict of options and a list of free arguments."""
566 586
567 587 getopt = DPyGetOpt.DPyGetOpt()
568 588 getopt.setIgnoreCase(0)
569 589 getopt.parseConfiguration(names)
570 590
571 591 try:
572 592 getopt.processArguments(argv)
573 593 except:
574 594 print usage
575 595 warn(`sys.exc_value`,level=4)
576 596
577 597 defaults.update(getopt.optionValues)
578 598 args = getopt.freeValues
579 599
580 600 return defaults,args
581 601
582 602 #----------------------------------------------------------------------------
583 603 def optstr2types(ostr):
584 604 """Convert a string of option names to a dict of type mappings.
585 605
586 606 optstr2types(str) -> {None:'string_opts',int:'int_opts',float:'float_opts'}
587 607
588 608 This is used to get the types of all the options in a string formatted
589 609 with the conventions of DPyGetOpt. The 'type' None is used for options
590 610 which are strings (they need no further conversion). This function's main
591 611 use is to get a typemap for use with read_dict().
592 612 """
593 613
594 614 typeconv = {None:'',int:'',float:''}
595 615 typemap = {'s':None,'i':int,'f':float}
596 616 opt_re = re.compile(r'([\w]*)([^:=]*:?=?)([sif]?)')
597 617
598 618 for w in ostr.split():
599 619 oname,alias,otype = opt_re.match(w).groups()
600 620 if otype == '' or alias == '!': # simple switches are integers too
601 621 otype = 'i'
602 622 typeconv[typemap[otype]] += oname + ' '
603 623 return typeconv
604 624
605 625 #----------------------------------------------------------------------------
606 626 def read_dict(filename,type_conv=None,**opt):
607 627
608 628 """Read a dictionary of key=value pairs from an input file, optionally
609 629 performing conversions on the resulting values.
610 630
611 631 read_dict(filename,type_conv,**opt) -> dict
612 632
613 633 Only one value per line is accepted, the format should be
614 634 # optional comments are ignored
615 635 key value\n
616 636
617 637 Args:
618 638
619 639 - type_conv: A dictionary specifying which keys need to be converted to
620 640 which types. By default all keys are read as strings. This dictionary
621 641 should have as its keys valid conversion functions for strings
622 642 (int,long,float,complex, or your own). The value for each key
623 643 (converter) should be a whitespace separated string containing the names
624 644 of all the entries in the file to be converted using that function. For
625 645 keys to be left alone, use None as the conversion function (only needed
626 646 with purge=1, see below).
627 647
628 648 - opt: dictionary with extra options as below (default in parens)
629 649
630 650 purge(0): if set to 1, all keys *not* listed in type_conv are purged out
631 651 of the dictionary to be returned. If purge is going to be used, the
632 652 set of keys to be left as strings also has to be explicitly specified
633 653 using the (non-existent) conversion function None.
634 654
635 655 fs(None): field separator. This is the key/value separator to be used
636 656 when parsing the file. The None default means any whitespace [behavior
637 657 of string.split()].
638 658
639 659 strip(0): if 1, strip string values of leading/trailinig whitespace.
640 660
641 661 warn(1): warning level if requested keys are not found in file.
642 662 - 0: silently ignore.
643 663 - 1: inform but proceed.
644 664 - 2: raise KeyError exception.
645 665
646 666 no_empty(0): if 1, remove keys with whitespace strings as a value.
647 667
648 668 unique([]): list of keys (or space separated string) which can't be
649 669 repeated. If one such key is found in the file, each new instance
650 670 overwrites the previous one. For keys not listed here, the behavior is
651 671 to make a list of all appearances.
652 672
653 673 Example:
654 674 If the input file test.ini has:
655 675 i 3
656 676 x 4.5
657 677 y 5.5
658 678 s hi ho
659 679 Then:
660 680
661 681 >>> type_conv={int:'i',float:'x',None:'s'}
662 682 >>> read_dict('test.ini')
663 683 {'i': '3', 's': 'hi ho', 'x': '4.5', 'y': '5.5'}
664 684 >>> read_dict('test.ini',type_conv)
665 685 {'i': 3, 's': 'hi ho', 'x': 4.5, 'y': '5.5'}
666 686 >>> read_dict('test.ini',type_conv,purge=1)
667 687 {'i': 3, 's': 'hi ho', 'x': 4.5}
668 688 """
669 689
670 690 # starting config
671 691 opt.setdefault('purge',0)
672 692 opt.setdefault('fs',None) # field sep defaults to any whitespace
673 693 opt.setdefault('strip',0)
674 694 opt.setdefault('warn',1)
675 695 opt.setdefault('no_empty',0)
676 696 opt.setdefault('unique','')
677 697 if type(opt['unique']) in StringTypes:
678 698 unique_keys = qw(opt['unique'])
679 699 elif type(opt['unique']) in (types.TupleType,types.ListType):
680 700 unique_keys = opt['unique']
681 701 else:
682 702 raise ValueError, 'Unique keys must be given as a string, List or Tuple'
683 703
684 704 dict = {}
685 705 # first read in table of values as strings
686 706 file = open(filename,'r')
687 707 for line in file.readlines():
688 708 line = line.strip()
689 709 if len(line) and line[0]=='#': continue
690 710 if len(line)>0:
691 711 lsplit = line.split(opt['fs'],1)
692 712 try:
693 713 key,val = lsplit
694 714 except ValueError:
695 715 key,val = lsplit[0],''
696 716 key = key.strip()
697 717 if opt['strip']: val = val.strip()
698 718 if val == "''" or val == '""': val = ''
699 719 if opt['no_empty'] and (val=='' or val.isspace()):
700 720 continue
701 721 # if a key is found more than once in the file, build a list
702 722 # unless it's in the 'unique' list. In that case, last found in file
703 723 # takes precedence. User beware.
704 724 try:
705 725 if dict[key] and key in unique_keys:
706 726 dict[key] = val
707 727 elif type(dict[key]) is types.ListType:
708 728 dict[key].append(val)
709 729 else:
710 730 dict[key] = [dict[key],val]
711 731 except KeyError:
712 732 dict[key] = val
713 733 # purge if requested
714 734 if opt['purge']:
715 735 accepted_keys = qwflat(type_conv.values())
716 736 for key in dict.keys():
717 737 if key in accepted_keys: continue
718 738 del(dict[key])
719 739 # now convert if requested
720 740 if type_conv==None: return dict
721 741 conversions = type_conv.keys()
722 742 try: conversions.remove(None)
723 743 except: pass
724 744 for convert in conversions:
725 745 for val in qw(type_conv[convert]):
726 746 try:
727 747 dict[val] = convert(dict[val])
728 748 except KeyError,e:
729 749 if opt['warn'] == 0:
730 750 pass
731 751 elif opt['warn'] == 1:
732 752 print >>sys.stderr, 'Warning: key',val,\
733 753 'not found in file',filename
734 754 elif opt['warn'] == 2:
735 755 raise KeyError,e
736 756 else:
737 757 raise ValueError,'Warning level must be 0,1 or 2'
738 758
739 759 return dict
740 760
741 761 #----------------------------------------------------------------------------
742 762 def flag_calls(func):
743 763 """Wrap a function to detect and flag when it gets called.
744 764
745 765 This is a decorator which takes a function and wraps it in a function with
746 766 a 'called' attribute. wrapper.called is initialized to False.
747 767
748 768 The wrapper.called attribute is set to False right before each call to the
749 769 wrapped function, so if the call fails it remains False. After the call
750 770 completes, wrapper.called is set to True and the output is returned.
751 771
752 772 Testing for truth in wrapper.called allows you to determine if a call to
753 773 func() was attempted and succeeded."""
754 774
755 775 def wrapper(*args,**kw):
756 776 wrapper.called = False
757 777 out = func(*args,**kw)
758 778 wrapper.called = True
759 779 return out
760 780
761 781 wrapper.called = False
762 782 wrapper.__doc__ = func.__doc__
763 783 return wrapper
764 784
765 785 #----------------------------------------------------------------------------
766 786 class HomeDirError(Error):
767 787 pass
768 788
769 789 def get_home_dir():
770 790 """Return the closest possible equivalent to a 'home' directory.
771 791
772 792 We first try $HOME. Absent that, on NT it's $HOMEDRIVE\$HOMEPATH.
773 793
774 794 Currently only Posix and NT are implemented, a HomeDirError exception is
775 795 raised for all other OSes. """
776 796
777 797 isdir = os.path.isdir
778 798 env = os.environ
779 799 try:
780 800 homedir = env['HOME']
781 801 if not isdir(homedir):
782 802 # in case a user stuck some string which does NOT resolve to a
783 803 # valid path, it's as good as if we hadn't foud it
784 804 raise KeyError
785 805 return homedir
786 806 except KeyError:
787 807 if os.name == 'posix':
788 808 raise HomeDirError,'undefined $HOME, IPython can not proceed.'
789 809 elif os.name == 'nt':
790 810 # For some strange reason, win9x returns 'nt' for os.name.
791 811 try:
792 812 homedir = os.path.join(env['HOMEDRIVE'],env['HOMEPATH'])
793 813 if not isdir(homedir):
794 814 homedir = os.path.join(env['USERPROFILE'])
795 815 if not isdir(homedir):
796 816 raise HomeDirError
797 817 return homedir
798 818 except:
799 819 try:
800 820 # Use the registry to get the 'My Documents' folder.
801 821 import _winreg as wreg
802 822 key = wreg.OpenKey(wreg.HKEY_CURRENT_USER,
803 823 "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders")
804 824 homedir = wreg.QueryValueEx(key,'Personal')[0]
805 825 key.Close()
806 826 if not isdir(homedir):
807 827 e = ('Invalid "Personal" folder registry key '
808 828 'typically "My Documents".\n'
809 829 'Value: %s\n'
810 830 'This is not a valid directory on your system.' %
811 831 homedir)
812 832 raise HomeDirError(e)
813 833 return homedir
814 834 except HomeDirError:
815 835 raise
816 836 except:
817 837 return 'C:\\'
818 838 elif os.name == 'dos':
819 839 # Desperate, may do absurd things in classic MacOS. May work under DOS.
820 840 return 'C:\\'
821 841 else:
822 842 raise HomeDirError,'support for your operating system not implemented.'
823 843
824 844 #****************************************************************************
825 845 # strings and text
826 846
827 847 class LSString(str):
828 848 """String derivative with a special access attributes.
829 849
830 850 These are normal strings, but with the special attributes:
831 851
832 852 .l (or .list) : value as list (split on newlines).
833 853 .n (or .nlstr): original value (the string itself).
834 854 .s (or .spstr): value as whitespace-separated string.
835 855
836 856 Any values which require transformations are computed only once and
837 857 cached.
838 858
839 859 Such strings are very useful to efficiently interact with the shell, which
840 860 typically only understands whitespace-separated options for commands."""
841 861
842 862 def get_list(self):
843 863 try:
844 864 return self.__list
845 865 except AttributeError:
846 866 self.__list = self.split('\n')
847 867 return self.__list
848 868
849 869 l = list = property(get_list)
850 870
851 871 def get_spstr(self):
852 872 try:
853 873 return self.__spstr
854 874 except AttributeError:
855 875 self.__spstr = self.replace('\n',' ')
856 876 return self.__spstr
857 877
858 878 s = spstr = property(get_spstr)
859 879
860 880 def get_nlstr(self):
861 881 return self
862 882
863 883 n = nlstr = property(get_nlstr)
864 884
865 885 def get_paths(self):
866 886 try:
867 887 return self.__paths
868 888 except AttributeError:
869 889 self.__paths = [path(p) for p in self.split('\n') if os.path.exists(p)]
870 890 return self.__paths
871 891
872 892 p = paths = property(get_paths)
873 893
874 894
875 895 #----------------------------------------------------------------------------
876 896 class SList(list):
877 897 """List derivative with a special access attributes.
878 898
879 899 These are normal lists, but with the special attributes:
880 900
881 901 .l (or .list) : value as list (the list itself).
882 902 .n (or .nlstr): value as a string, joined on newlines.
883 903 .s (or .spstr): value as a string, joined on spaces.
884 904
885 905 Any values which require transformations are computed only once and
886 906 cached."""
887 907
888 908 def get_list(self):
889 909 return self
890 910
891 911 l = list = property(get_list)
892 912
893 913 def get_spstr(self):
894 914 try:
895 915 return self.__spstr
896 916 except AttributeError:
897 917 self.__spstr = ' '.join(self)
898 918 return self.__spstr
899 919
900 920 s = spstr = property(get_spstr)
901 921
902 922 def get_nlstr(self):
903 923 try:
904 924 return self.__nlstr
905 925 except AttributeError:
906 926 self.__nlstr = '\n'.join(self)
907 927 return self.__nlstr
908 928
909 929 n = nlstr = property(get_nlstr)
910 930
911 931 def get_paths(self):
912 932 try:
913 933 return self.__paths
914 934 except AttributeError:
915 935 self.__paths = [path(p) for p in self if os.path.exists(p)]
916 936 return self.__paths
917 937
918 938 p = paths = property(get_paths)
919 939
920 940 #----------------------------------------------------------------------------
921 941 def esc_quotes(strng):
922 942 """Return the input string with single and double quotes escaped out"""
923 943
924 944 return strng.replace('"','\\"').replace("'","\\'")
925 945
926 946 #----------------------------------------------------------------------------
927 947 def make_quoted_expr(s):
928 948 """Return string s in appropriate quotes, using raw string if possible.
929 949
930 950 Effectively this turns string: cd \ao\ao\
931 951 to: r"cd \ao\ao\_"[:-1]
932 952
933 953 Note the use of raw string and padding at the end to allow trailing backslash.
934 954
935 955 """
936 956
937 957 tail = ''
938 958 tailpadding = ''
939 959 raw = ''
940 960 if "\\" in s:
941 961 raw = 'r'
942 962 if s.endswith('\\'):
943 963 tail = '[:-1]'
944 964 tailpadding = '_'
945 965 if '"' not in s:
946 966 quote = '"'
947 967 elif "'" not in s:
948 968 quote = "'"
949 969 elif '"""' not in s and not s.endswith('"'):
950 970 quote = '"""'
951 971 elif "'''" not in s and not s.endswith("'"):
952 972 quote = "'''"
953 973 else:
954 974 # give up, backslash-escaped string will do
955 975 return '"%s"' % esc_quotes(s)
956 976 res = itpl("$raw$quote$s$tailpadding$quote$tail")
957 977 return res
958 978
959 979
960 980 #----------------------------------------------------------------------------
961 981 def raw_input_multi(header='', ps1='==> ', ps2='..> ',terminate_str = '.'):
962 982 """Take multiple lines of input.
963 983
964 984 A list with each line of input as a separate element is returned when a
965 985 termination string is entered (defaults to a single '.'). Input can also
966 986 terminate via EOF (^D in Unix, ^Z-RET in Windows).
967 987
968 988 Lines of input which end in \\ are joined into single entries (and a
969 989 secondary continuation prompt is issued as long as the user terminates
970 990 lines with \\). This allows entering very long strings which are still
971 991 meant to be treated as single entities.
972 992 """
973 993
974 994 try:
975 995 if header:
976 996 header += '\n'
977 997 lines = [raw_input(header + ps1)]
978 998 except EOFError:
979 999 return []
980 1000 terminate = [terminate_str]
981 1001 try:
982 1002 while lines[-1:] != terminate:
983 1003 new_line = raw_input(ps1)
984 1004 while new_line.endswith('\\'):
985 1005 new_line = new_line[:-1] + raw_input(ps2)
986 1006 lines.append(new_line)
987 1007
988 1008 return lines[:-1] # don't return the termination command
989 1009 except EOFError:
990 1010 print
991 1011 return lines
992 1012
993 1013 #----------------------------------------------------------------------------
994 1014 def raw_input_ext(prompt='', ps2='... '):
995 1015 """Similar to raw_input(), but accepts extended lines if input ends with \\."""
996 1016
997 1017 line = raw_input(prompt)
998 1018 while line.endswith('\\'):
999 1019 line = line[:-1] + raw_input(ps2)
1000 1020 return line
1001 1021
1002 1022 #----------------------------------------------------------------------------
1003 1023 def ask_yes_no(prompt,default=None):
1004 1024 """Asks a question and returns an integer 1/0 (y/n) answer.
1005 1025
1006 1026 If default is given (one of 'y','n'), it is used if the user input is
1007 1027 empty. Otherwise the question is repeated until an answer is given.
1008 1028
1009 1029 An EOF is treated as the default answer. If there is no default, an
1010 1030 exception is raised to prevent infinite loops.
1011 1031
1012 1032 Valid answers are: y/yes/n/no (match is not case sensitive)."""
1013 1033
1014 1034 answers = {'y':True,'n':False,'yes':True,'no':False}
1015 1035 ans = None
1016 1036 while ans not in answers.keys():
1017 1037 try:
1018 1038 ans = raw_input(prompt+' ').lower()
1019 1039 if not ans: # response was an empty string
1020 1040 ans = default
1021 1041 except KeyboardInterrupt:
1022 1042 pass
1023 1043 except EOFError:
1024 1044 if default in answers.keys():
1025 1045 ans = default
1026 1046 print
1027 1047 else:
1028 1048 raise
1029 1049
1030 1050 return answers[ans]
1031 1051
1032 1052 #----------------------------------------------------------------------------
1033 1053 def marquee(txt='',width=78,mark='*'):
1034 1054 """Return the input string centered in a 'marquee'."""
1035 1055 if not txt:
1036 1056 return (mark*width)[:width]
1037 1057 nmark = (width-len(txt)-2)/len(mark)/2
1038 1058 if nmark < 0: nmark =0
1039 1059 marks = mark*nmark
1040 1060 return '%s %s %s' % (marks,txt,marks)
1041 1061
1042 1062 #----------------------------------------------------------------------------
1043 1063 class EvalDict:
1044 1064 """
1045 1065 Emulate a dict which evaluates its contents in the caller's frame.
1046 1066
1047 1067 Usage:
1048 1068 >>>number = 19
1049 1069 >>>text = "python"
1050 1070 >>>print "%(text.capitalize())s %(number/9.0).1f rules!" % EvalDict()
1051 1071 """
1052 1072
1053 1073 # This version is due to sismex01@hebmex.com on c.l.py, and is basically a
1054 1074 # modified (shorter) version of:
1055 1075 # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66018 by
1056 1076 # Skip Montanaro (skip@pobox.com).
1057 1077
1058 1078 def __getitem__(self, name):
1059 1079 frame = sys._getframe(1)
1060 1080 return eval(name, frame.f_globals, frame.f_locals)
1061 1081
1062 1082 EvalString = EvalDict # for backwards compatibility
1063 1083 #----------------------------------------------------------------------------
1064 1084 def qw(words,flat=0,sep=None,maxsplit=-1):
1065 1085 """Similar to Perl's qw() operator, but with some more options.
1066 1086
1067 1087 qw(words,flat=0,sep=' ',maxsplit=-1) -> words.split(sep,maxsplit)
1068 1088
1069 1089 words can also be a list itself, and with flat=1, the output will be
1070 1090 recursively flattened. Examples:
1071 1091
1072 1092 >>> qw('1 2')
1073 1093 ['1', '2']
1074 1094 >>> qw(['a b','1 2',['m n','p q']])
1075 1095 [['a', 'b'], ['1', '2'], [['m', 'n'], ['p', 'q']]]
1076 1096 >>> qw(['a b','1 2',['m n','p q']],flat=1)
1077 1097 ['a', 'b', '1', '2', 'm', 'n', 'p', 'q'] """
1078 1098
1079 1099 if type(words) in StringTypes:
1080 1100 return [word.strip() for word in words.split(sep,maxsplit)
1081 1101 if word and not word.isspace() ]
1082 1102 if flat:
1083 1103 return flatten(map(qw,words,[1]*len(words)))
1084 1104 return map(qw,words)
1085 1105
1086 1106 #----------------------------------------------------------------------------
1087 1107 def qwflat(words,sep=None,maxsplit=-1):
1088 1108 """Calls qw(words) in flat mode. It's just a convenient shorthand."""
1089 1109 return qw(words,1,sep,maxsplit)
1090 1110
1091 1111 #----------------------------------------------------------------------------
1092 1112 def qw_lol(indata):
1093 1113 """qw_lol('a b') -> [['a','b']],
1094 1114 otherwise it's just a call to qw().
1095 1115
1096 1116 We need this to make sure the modules_some keys *always* end up as a
1097 1117 list of lists."""
1098 1118
1099 1119 if type(indata) in StringTypes:
1100 1120 return [qw(indata)]
1101 1121 else:
1102 1122 return qw(indata)
1103 1123
1104 1124 #-----------------------------------------------------------------------------
1105 1125 def list_strings(arg):
1106 1126 """Always return a list of strings, given a string or list of strings
1107 1127 as input."""
1108 1128
1109 1129 if type(arg) in StringTypes: return [arg]
1110 1130 else: return arg
1111 1131
1112 1132 #----------------------------------------------------------------------------
1113 1133 def grep(pat,list,case=1):
1114 1134 """Simple minded grep-like function.
1115 1135 grep(pat,list) returns occurrences of pat in list, None on failure.
1116 1136
1117 1137 It only does simple string matching, with no support for regexps. Use the
1118 1138 option case=0 for case-insensitive matching."""
1119 1139
1120 1140 # This is pretty crude. At least it should implement copying only references
1121 1141 # to the original data in case it's big. Now it copies the data for output.
1122 1142 out=[]
1123 1143 if case:
1124 1144 for term in list:
1125 1145 if term.find(pat)>-1: out.append(term)
1126 1146 else:
1127 1147 lpat=pat.lower()
1128 1148 for term in list:
1129 1149 if term.lower().find(lpat)>-1: out.append(term)
1130 1150
1131 1151 if len(out): return out
1132 1152 else: return None
1133 1153
1134 1154 #----------------------------------------------------------------------------
1135 1155 def dgrep(pat,*opts):
1136 1156 """Return grep() on dir()+dir(__builtins__).
1137 1157
1138 1158 A very common use of grep() when working interactively."""
1139 1159
1140 1160 return grep(pat,dir(__main__)+dir(__main__.__builtins__),*opts)
1141 1161
1142 1162 #----------------------------------------------------------------------------
1143 1163 def idgrep(pat):
1144 1164 """Case-insensitive dgrep()"""
1145 1165
1146 1166 return dgrep(pat,0)
1147 1167
1148 1168 #----------------------------------------------------------------------------
1149 1169 def igrep(pat,list):
1150 1170 """Synonym for case-insensitive grep."""
1151 1171
1152 1172 return grep(pat,list,case=0)
1153 1173
1154 1174 #----------------------------------------------------------------------------
1155 1175 def indent(str,nspaces=4,ntabs=0):
1156 1176 """Indent a string a given number of spaces or tabstops.
1157 1177
1158 1178 indent(str,nspaces=4,ntabs=0) -> indent str by ntabs+nspaces.
1159 1179 """
1160 1180 if str is None:
1161 1181 return
1162 1182 ind = '\t'*ntabs+' '*nspaces
1163 1183 outstr = '%s%s' % (ind,str.replace(os.linesep,os.linesep+ind))
1164 1184 if outstr.endswith(os.linesep+ind):
1165 1185 return outstr[:-len(ind)]
1166 1186 else:
1167 1187 return outstr
1168 1188
1169 1189 #-----------------------------------------------------------------------------
1170 1190 def native_line_ends(filename,backup=1):
1171 1191 """Convert (in-place) a file to line-ends native to the current OS.
1172 1192
1173 1193 If the optional backup argument is given as false, no backup of the
1174 1194 original file is left. """
1175 1195
1176 1196 backup_suffixes = {'posix':'~','dos':'.bak','nt':'.bak','mac':'.bak'}
1177 1197
1178 1198 bak_filename = filename + backup_suffixes[os.name]
1179 1199
1180 1200 original = open(filename).read()
1181 1201 shutil.copy2(filename,bak_filename)
1182 1202 try:
1183 1203 new = open(filename,'wb')
1184 1204 new.write(os.linesep.join(original.splitlines()))
1185 1205 new.write(os.linesep) # ALWAYS put an eol at the end of the file
1186 1206 new.close()
1187 1207 except:
1188 1208 os.rename(bak_filename,filename)
1189 1209 if not backup:
1190 1210 try:
1191 1211 os.remove(bak_filename)
1192 1212 except:
1193 1213 pass
1194 1214
1195 1215 #----------------------------------------------------------------------------
1196 1216 def get_pager_cmd(pager_cmd = None):
1197 1217 """Return a pager command.
1198 1218
1199 1219 Makes some attempts at finding an OS-correct one."""
1200 1220
1201 1221 if os.name == 'posix':
1202 1222 default_pager_cmd = 'less -r' # -r for color control sequences
1203 1223 elif os.name in ['nt','dos']:
1204 1224 default_pager_cmd = 'type'
1205 1225
1206 1226 if pager_cmd is None:
1207 1227 try:
1208 1228 pager_cmd = os.environ['PAGER']
1209 1229 except:
1210 1230 pager_cmd = default_pager_cmd
1211 1231 return pager_cmd
1212 1232
1213 1233 #-----------------------------------------------------------------------------
1214 1234 def get_pager_start(pager,start):
1215 1235 """Return the string for paging files with an offset.
1216 1236
1217 1237 This is the '+N' argument which less and more (under Unix) accept.
1218 1238 """
1219 1239
1220 1240 if pager in ['less','more']:
1221 1241 if start:
1222 1242 start_string = '+' + str(start)
1223 1243 else:
1224 1244 start_string = ''
1225 1245 else:
1226 1246 start_string = ''
1227 1247 return start_string
1228 1248
1229 1249 #----------------------------------------------------------------------------
1230 1250 if os.name == "nt":
1231 1251 import msvcrt
1232 1252 def page_more():
1233 1253 """ Smart pausing between pages
1234 1254
1235 1255 @return: True if need print more lines, False if quit
1236 1256 """
1237 1257 Term.cout.write('---Return to continue, q to quit--- ')
1238 1258 ans = msvcrt.getch()
1239 1259 if ans in ("q", "Q"):
1240 1260 result = False
1241 1261 else:
1242 1262 result = True
1243 1263 Term.cout.write("\b"*37 + " "*37 + "\b"*37)
1244 1264 return result
1245 1265 else:
1246 1266 def page_more():
1247 1267 ans = raw_input('---Return to continue, q to quit--- ')
1248 1268 if ans.lower().startswith('q'):
1249 1269 return False
1250 1270 else:
1251 1271 return True
1252 1272
1253 1273 esc_re = re.compile(r"(\x1b[^m]+m)")
1254 1274
1255 1275 def page_dumb(strng,start=0,screen_lines=25):
1256 1276 """Very dumb 'pager' in Python, for when nothing else works.
1257 1277
1258 1278 Only moves forward, same interface as page(), except for pager_cmd and
1259 1279 mode."""
1260 1280
1261 1281 out_ln = strng.splitlines()[start:]
1262 1282 screens = chop(out_ln,screen_lines-1)
1263 1283 if len(screens) == 1:
1264 1284 print >>Term.cout, os.linesep.join(screens[0])
1265 1285 else:
1266 1286 last_escape = ""
1267 1287 for scr in screens[0:-1]:
1268 1288 hunk = os.linesep.join(scr)
1269 1289 print >>Term.cout, last_escape + hunk
1270 1290 if not page_more():
1271 1291 return
1272 1292 esc_list = esc_re.findall(hunk)
1273 1293 if len(esc_list) > 0:
1274 1294 last_escape = esc_list[-1]
1275 1295 print >>Term.cout, last_escape + os.linesep.join(screens[-1])
1276 1296
1277 1297 #----------------------------------------------------------------------------
1278 1298 def page(strng,start=0,screen_lines=0,pager_cmd = None):
1279 1299 """Print a string, piping through a pager after a certain length.
1280 1300
1281 1301 The screen_lines parameter specifies the number of *usable* lines of your
1282 1302 terminal screen (total lines minus lines you need to reserve to show other
1283 1303 information).
1284 1304
1285 1305 If you set screen_lines to a number <=0, page() will try to auto-determine
1286 1306 your screen size and will only use up to (screen_size+screen_lines) for
1287 1307 printing, paging after that. That is, if you want auto-detection but need
1288 1308 to reserve the bottom 3 lines of the screen, use screen_lines = -3, and for
1289 1309 auto-detection without any lines reserved simply use screen_lines = 0.
1290 1310
1291 1311 If a string won't fit in the allowed lines, it is sent through the
1292 1312 specified pager command. If none given, look for PAGER in the environment,
1293 1313 and ultimately default to less.
1294 1314
1295 1315 If no system pager works, the string is sent through a 'dumb pager'
1296 1316 written in python, very simplistic.
1297 1317 """
1298 1318
1299 1319 # Ugly kludge, but calling curses.initscr() flat out crashes in emacs
1300 1320 TERM = os.environ.get('TERM','dumb')
1301 1321 if TERM in ['dumb','emacs'] and os.name != 'nt':
1302 1322 print strng
1303 1323 return
1304 1324 # chop off the topmost part of the string we don't want to see
1305 1325 str_lines = strng.split(os.linesep)[start:]
1306 1326 str_toprint = os.linesep.join(str_lines)
1307 1327 num_newlines = len(str_lines)
1308 1328 len_str = len(str_toprint)
1309 1329
1310 1330 # Dumb heuristics to guesstimate number of on-screen lines the string
1311 1331 # takes. Very basic, but good enough for docstrings in reasonable
1312 1332 # terminals. If someone later feels like refining it, it's not hard.
1313 1333 numlines = max(num_newlines,int(len_str/80)+1)
1314 1334
1315 1335 if os.name == "nt":
1316 1336 screen_lines_def = get_console_size(defaulty=25)[1]
1317 1337 else:
1318 1338 screen_lines_def = 25 # default value if we can't auto-determine
1319 1339
1320 1340 # auto-determine screen size
1321 1341 if screen_lines <= 0:
1322 1342 if TERM=='xterm':
1323 1343 try:
1324 1344 import curses
1325 1345 if hasattr(curses,'initscr'):
1326 1346 use_curses = 1
1327 1347 else:
1328 1348 use_curses = 0
1329 1349 except ImportError:
1330 1350 use_curses = 0
1331 1351 else:
1332 1352 # curses causes problems on many terminals other than xterm.
1333 1353 use_curses = 0
1334 1354 if use_curses:
1335 1355 scr = curses.initscr()
1336 1356 screen_lines_real,screen_cols = scr.getmaxyx()
1337 1357 curses.endwin()
1338 1358 screen_lines += screen_lines_real
1339 1359 #print '***Screen size:',screen_lines_real,'lines x',\
1340 1360 #screen_cols,'columns.' # dbg
1341 1361 else:
1342 1362 screen_lines += screen_lines_def
1343 1363
1344 1364 #print 'numlines',numlines,'screenlines',screen_lines # dbg
1345 1365 if numlines <= screen_lines :
1346 1366 #print '*** normal print' # dbg
1347 1367 print >>Term.cout, str_toprint
1348 1368 else:
1349 1369 # Try to open pager and default to internal one if that fails.
1350 1370 # All failure modes are tagged as 'retval=1', to match the return
1351 1371 # value of a failed system command. If any intermediate attempt
1352 1372 # sets retval to 1, at the end we resort to our own page_dumb() pager.
1353 1373 pager_cmd = get_pager_cmd(pager_cmd)
1354 1374 pager_cmd += ' ' + get_pager_start(pager_cmd,start)
1355 1375 if os.name == 'nt':
1356 1376 if pager_cmd.startswith('type'):
1357 1377 # The default WinXP 'type' command is failing on complex strings.
1358 1378 retval = 1
1359 1379 else:
1360 1380 tmpname = tempfile.mktemp('.txt')
1361 1381 tmpfile = file(tmpname,'wt')
1362 1382 tmpfile.write(strng)
1363 1383 tmpfile.close()
1364 1384 cmd = "%s < %s" % (pager_cmd,tmpname)
1365 1385 if os.system(cmd):
1366 1386 retval = 1
1367 1387 else:
1368 1388 retval = None
1369 1389 os.remove(tmpname)
1370 1390 else:
1371 1391 try:
1372 1392 retval = None
1373 1393 # if I use popen4, things hang. No idea why.
1374 1394 #pager,shell_out = os.popen4(pager_cmd)
1375 1395 pager = os.popen(pager_cmd,'w')
1376 1396 pager.write(strng)
1377 1397 pager.close()
1378 1398 retval = pager.close() # success returns None
1379 1399 except IOError,msg: # broken pipe when user quits
1380 1400 if msg.args == (32,'Broken pipe'):
1381 1401 retval = None
1382 1402 else:
1383 1403 retval = 1
1384 1404 except OSError:
1385 1405 # Other strange problems, sometimes seen in Win2k/cygwin
1386 1406 retval = 1
1387 1407 if retval is not None:
1388 1408 page_dumb(strng,screen_lines=screen_lines)
1389 1409
1390 1410 #----------------------------------------------------------------------------
1391 1411 def page_file(fname,start = 0, pager_cmd = None):
1392 1412 """Page a file, using an optional pager command and starting line.
1393 1413 """
1394 1414
1395 1415 pager_cmd = get_pager_cmd(pager_cmd)
1396 1416 pager_cmd += ' ' + get_pager_start(pager_cmd,start)
1397 1417
1398 1418 try:
1399 1419 if os.environ['TERM'] in ['emacs','dumb']:
1400 1420 raise EnvironmentError
1401 1421 xsys(pager_cmd + ' ' + fname)
1402 1422 except:
1403 1423 try:
1404 1424 if start > 0:
1405 1425 start -= 1
1406 1426 page(open(fname).read(),start)
1407 1427 except:
1408 1428 print 'Unable to show file',`fname`
1409 1429
1410 1430 #----------------------------------------------------------------------------
1411 1431 def snip_print(str,width = 75,print_full = 0,header = ''):
1412 1432 """Print a string snipping the midsection to fit in width.
1413 1433
1414 1434 print_full: mode control:
1415 1435 - 0: only snip long strings
1416 1436 - 1: send to page() directly.
1417 1437 - 2: snip long strings and ask for full length viewing with page()
1418 1438 Return 1 if snipping was necessary, 0 otherwise."""
1419 1439
1420 1440 if print_full == 1:
1421 1441 page(header+str)
1422 1442 return 0
1423 1443
1424 1444 print header,
1425 1445 if len(str) < width:
1426 1446 print str
1427 1447 snip = 0
1428 1448 else:
1429 1449 whalf = int((width -5)/2)
1430 1450 print str[:whalf] + ' <...> ' + str[-whalf:]
1431 1451 snip = 1
1432 1452 if snip and print_full == 2:
1433 1453 if raw_input(header+' Snipped. View (y/n)? [N]').lower() == 'y':
1434 1454 page(str)
1435 1455 return snip
1436 1456
1437 1457 #****************************************************************************
1438 1458 # lists, dicts and structures
1439 1459
1440 1460 def belong(candidates,checklist):
1441 1461 """Check whether a list of items appear in a given list of options.
1442 1462
1443 1463 Returns a list of 1 and 0, one for each candidate given."""
1444 1464
1445 1465 return [x in checklist for x in candidates]
1446 1466
1447 1467 #----------------------------------------------------------------------------
1448 1468 def uniq_stable(elems):
1449 1469 """uniq_stable(elems) -> list
1450 1470
1451 1471 Return from an iterable, a list of all the unique elements in the input,
1452 1472 but maintaining the order in which they first appear.
1453 1473
1454 1474 A naive solution to this problem which just makes a dictionary with the
1455 1475 elements as keys fails to respect the stability condition, since
1456 1476 dictionaries are unsorted by nature.
1457 1477
1458 1478 Note: All elements in the input must be valid dictionary keys for this
1459 1479 routine to work, as it internally uses a dictionary for efficiency
1460 1480 reasons."""
1461 1481
1462 1482 unique = []
1463 1483 unique_dict = {}
1464 1484 for nn in elems:
1465 1485 if nn not in unique_dict:
1466 1486 unique.append(nn)
1467 1487 unique_dict[nn] = None
1468 1488 return unique
1469 1489
1470 1490 #----------------------------------------------------------------------------
1471 1491 class NLprinter:
1472 1492 """Print an arbitrarily nested list, indicating index numbers.
1473 1493
1474 1494 An instance of this class called nlprint is available and callable as a
1475 1495 function.
1476 1496
1477 1497 nlprint(list,indent=' ',sep=': ') -> prints indenting each level by 'indent'
1478 1498 and using 'sep' to separate the index from the value. """
1479 1499
1480 1500 def __init__(self):
1481 1501 self.depth = 0
1482 1502
1483 1503 def __call__(self,lst,pos='',**kw):
1484 1504 """Prints the nested list numbering levels."""
1485 1505 kw.setdefault('indent',' ')
1486 1506 kw.setdefault('sep',': ')
1487 1507 kw.setdefault('start',0)
1488 1508 kw.setdefault('stop',len(lst))
1489 1509 # we need to remove start and stop from kw so they don't propagate
1490 1510 # into a recursive call for a nested list.
1491 1511 start = kw['start']; del kw['start']
1492 1512 stop = kw['stop']; del kw['stop']
1493 1513 if self.depth == 0 and 'header' in kw.keys():
1494 1514 print kw['header']
1495 1515
1496 1516 for idx in range(start,stop):
1497 1517 elem = lst[idx]
1498 1518 if type(elem)==type([]):
1499 1519 self.depth += 1
1500 1520 self.__call__(elem,itpl('$pos$idx,'),**kw)
1501 1521 self.depth -= 1
1502 1522 else:
1503 1523 printpl(kw['indent']*self.depth+'$pos$idx$kw["sep"]$elem')
1504 1524
1505 1525 nlprint = NLprinter()
1506 1526 #----------------------------------------------------------------------------
1507 1527 def all_belong(candidates,checklist):
1508 1528 """Check whether a list of items ALL appear in a given list of options.
1509 1529
1510 1530 Returns a single 1 or 0 value."""
1511 1531
1512 1532 return 1-(0 in [x in checklist for x in candidates])
1513 1533
1514 1534 #----------------------------------------------------------------------------
1515 1535 def sort_compare(lst1,lst2,inplace = 1):
1516 1536 """Sort and compare two lists.
1517 1537
1518 1538 By default it does it in place, thus modifying the lists. Use inplace = 0
1519 1539 to avoid that (at the cost of temporary copy creation)."""
1520 1540 if not inplace:
1521 1541 lst1 = lst1[:]
1522 1542 lst2 = lst2[:]
1523 1543 lst1.sort(); lst2.sort()
1524 1544 return lst1 == lst2
1525 1545
1526 1546 #----------------------------------------------------------------------------
1527 1547 def mkdict(**kwargs):
1528 1548 """Return a dict from a keyword list.
1529 1549
1530 1550 It's just syntactic sugar for making ditcionary creation more convenient:
1531 1551 # the standard way
1532 1552 >>>data = { 'red' : 1, 'green' : 2, 'blue' : 3 }
1533 1553 # a cleaner way
1534 1554 >>>data = dict(red=1, green=2, blue=3)
1535 1555
1536 1556 If you need more than this, look at the Struct() class."""
1537 1557
1538 1558 return kwargs
1539 1559
1540 1560 #----------------------------------------------------------------------------
1541 1561 def list2dict(lst):
1542 1562 """Takes a list of (key,value) pairs and turns it into a dict."""
1543 1563
1544 1564 dic = {}
1545 1565 for k,v in lst: dic[k] = v
1546 1566 return dic
1547 1567
1548 1568 #----------------------------------------------------------------------------
1549 1569 def list2dict2(lst,default=''):
1550 1570 """Takes a list and turns it into a dict.
1551 1571 Much slower than list2dict, but more versatile. This version can take
1552 1572 lists with sublists of arbitrary length (including sclars)."""
1553 1573
1554 1574 dic = {}
1555 1575 for elem in lst:
1556 1576 if type(elem) in (types.ListType,types.TupleType):
1557 1577 size = len(elem)
1558 1578 if size == 0:
1559 1579 pass
1560 1580 elif size == 1:
1561 1581 dic[elem] = default
1562 1582 else:
1563 1583 k,v = elem[0], elem[1:]
1564 1584 if len(v) == 1: v = v[0]
1565 1585 dic[k] = v
1566 1586 else:
1567 1587 dic[elem] = default
1568 1588 return dic
1569 1589
1570 1590 #----------------------------------------------------------------------------
1571 1591 def flatten(seq):
1572 1592 """Flatten a list of lists (NOT recursive, only works for 2d lists)."""
1573 1593
1574 1594 return [x for subseq in seq for x in subseq]
1575 1595
1576 1596 #----------------------------------------------------------------------------
1577 1597 def get_slice(seq,start=0,stop=None,step=1):
1578 1598 """Get a slice of a sequence with variable step. Specify start,stop,step."""
1579 1599 if stop == None:
1580 1600 stop = len(seq)
1581 1601 item = lambda i: seq[i]
1582 1602 return map(item,xrange(start,stop,step))
1583 1603
1584 1604 #----------------------------------------------------------------------------
1585 1605 def chop(seq,size):
1586 1606 """Chop a sequence into chunks of the given size."""
1587 1607 chunk = lambda i: seq[i:i+size]
1588 1608 return map(chunk,xrange(0,len(seq),size))
1589 1609
1590 1610 #----------------------------------------------------------------------------
1591 1611 # with is a keyword as of python 2.5, so this function is renamed to withobj
1592 1612 # from its old 'with' name.
1593 1613 def with_obj(object, **args):
1594 1614 """Set multiple attributes for an object, similar to Pascal's with.
1595 1615
1596 1616 Example:
1597 1617 with_obj(jim,
1598 1618 born = 1960,
1599 1619 haircolour = 'Brown',
1600 1620 eyecolour = 'Green')
1601 1621
1602 1622 Credit: Greg Ewing, in
1603 1623 http://mail.python.org/pipermail/python-list/2001-May/040703.html.
1604 1624
1605 1625 NOTE: up until IPython 0.7.2, this was called simply 'with', but 'with'
1606 1626 has become a keyword for Python 2.5, so we had to rename it."""
1607 1627
1608 1628 object.__dict__.update(args)
1609 1629
1610 1630 #----------------------------------------------------------------------------
1611 1631 def setattr_list(obj,alist,nspace = None):
1612 1632 """Set a list of attributes for an object taken from a namespace.
1613 1633
1614 1634 setattr_list(obj,alist,nspace) -> sets in obj all the attributes listed in
1615 1635 alist with their values taken from nspace, which must be a dict (something
1616 1636 like locals() will often do) If nspace isn't given, locals() of the
1617 1637 *caller* is used, so in most cases you can omit it.
1618 1638
1619 1639 Note that alist can be given as a string, which will be automatically
1620 1640 split into a list on whitespace. If given as a list, it must be a list of
1621 1641 *strings* (the variable names themselves), not of variables."""
1622 1642
1623 1643 # this grabs the local variables from the *previous* call frame -- that is
1624 1644 # the locals from the function that called setattr_list().
1625 1645 # - snipped from weave.inline()
1626 1646 if nspace is None:
1627 1647 call_frame = sys._getframe().f_back
1628 1648 nspace = call_frame.f_locals
1629 1649
1630 1650 if type(alist) in StringTypes:
1631 1651 alist = alist.split()
1632 1652 for attr in alist:
1633 1653 val = eval(attr,nspace)
1634 1654 setattr(obj,attr,val)
1635 1655
1636 1656 #----------------------------------------------------------------------------
1637 1657 def getattr_list(obj,alist,*args):
1638 1658 """getattr_list(obj,alist[, default]) -> attribute list.
1639 1659
1640 1660 Get a list of named attributes for an object. When a default argument is
1641 1661 given, it is returned when the attribute doesn't exist; without it, an
1642 1662 exception is raised in that case.
1643 1663
1644 1664 Note that alist can be given as a string, which will be automatically
1645 1665 split into a list on whitespace. If given as a list, it must be a list of
1646 1666 *strings* (the variable names themselves), not of variables."""
1647 1667
1648 1668 if type(alist) in StringTypes:
1649 1669 alist = alist.split()
1650 1670 if args:
1651 1671 if len(args)==1:
1652 1672 default = args[0]
1653 1673 return map(lambda attr: getattr(obj,attr,default),alist)
1654 1674 else:
1655 1675 raise ValueError,'getattr_list() takes only one optional argument'
1656 1676 else:
1657 1677 return map(lambda attr: getattr(obj,attr),alist)
1658 1678
1659 1679 #----------------------------------------------------------------------------
1660 1680 def map_method(method,object_list,*argseq,**kw):
1661 1681 """map_method(method,object_list,*args,**kw) -> list
1662 1682
1663 1683 Return a list of the results of applying the methods to the items of the
1664 1684 argument sequence(s). If more than one sequence is given, the method is
1665 1685 called with an argument list consisting of the corresponding item of each
1666 1686 sequence. All sequences must be of the same length.
1667 1687
1668 1688 Keyword arguments are passed verbatim to all objects called.
1669 1689
1670 1690 This is Python code, so it's not nearly as fast as the builtin map()."""
1671 1691
1672 1692 out_list = []
1673 1693 idx = 0
1674 1694 for object in object_list:
1675 1695 try:
1676 1696 handler = getattr(object, method)
1677 1697 except AttributeError:
1678 1698 out_list.append(None)
1679 1699 else:
1680 1700 if argseq:
1681 1701 args = map(lambda lst:lst[idx],argseq)
1682 1702 #print 'ob',object,'hand',handler,'ar',args # dbg
1683 1703 out_list.append(handler(args,**kw))
1684 1704 else:
1685 1705 out_list.append(handler(**kw))
1686 1706 idx += 1
1687 1707 return out_list
1688 1708
1689 1709 #----------------------------------------------------------------------------
1690 1710 def import_fail_info(mod_name,fns=None):
1691 1711 """Inform load failure for a module."""
1692 1712
1693 1713 if fns == None:
1694 1714 warn("Loading of %s failed.\n" % (mod_name,))
1695 1715 else:
1696 1716 warn("Loading of %s from %s failed.\n" % (fns,mod_name))
1697 1717
1698 1718 #----------------------------------------------------------------------------
1699 1719 # Proposed popitem() extension, written as a method
1700 1720
1701 1721
1702 1722 class NotGiven: pass
1703 1723
1704 1724 def popkey(dct,key,default=NotGiven):
1705 1725 """Return dct[key] and delete dct[key].
1706 1726
1707 1727 If default is given, return it if dct[key] doesn't exist, otherwise raise
1708 1728 KeyError. """
1709 1729
1710 1730 try:
1711 1731 val = dct[key]
1712 1732 except KeyError:
1713 1733 if default is NotGiven:
1714 1734 raise
1715 1735 else:
1716 1736 return default
1717 1737 else:
1718 1738 del dct[key]
1719 1739 return val
1720 1740
1721 1741 def wrap_deprecated(func, suggest = '<nothing>'):
1722 1742 def newFunc(*args, **kwargs):
1723 1743 warnings.warn("Call to deprecated function %s, use %s instead" %
1724 1744 ( func.__name__, suggest),
1725 1745 category=DeprecationWarning,
1726 1746 stacklevel = 2)
1727 1747 return func(*args, **kwargs)
1728 1748 return newFunc
1729 1749
1730 1750 #*************************** end of file <genutils.py> **********************
1731 1751
@@ -1,6235 +1,6246 b''
1 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/genutils.py (clock): I modified clock() to return total
4 time, user+system. This is a more commonly needed metric. I also
5 introduced the new clocku/clocks to get only user/system time if
6 one wants those instead.
7
8 ***WARNING: API CHANGE*** clock() used to return only user time,
9 so if you want exactly the same results as before, use clocku
10 instead.
11
1 12 2007-02-22 Ville Vainio <vivainio@gmail.com>
2 13
3 14 * IPython/Extensions/ipy_p4.py: Extension for improved
4 15 p4 (perforce version control system) experience.
5 16 Adds %p4 magic with p4 command completion and
6 17 automatic -G argument (marshall output as python dict)
7 18
8 19 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
9 20
10 21 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
11 22 stop marks.
12 23 (ClearingMixin): a simple mixin to easily make a Demo class clear
13 24 the screen in between blocks and have empty marquees. The
14 25 ClearDemo and ClearIPDemo classes that use it are included.
15 26
16 27 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
17 28
18 29 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
19 30 protect against exceptions at Python shutdown time. Patch
20 31 sumbmitted to upstream.
21 32
22 33 2007-02-14 Walter Doerwald <walter@livinglogic.de>
23 34
24 35 * IPython/Extensions/ibrowse.py: If entering the first object level
25 36 (i.e. the object for which the browser has been started) fails,
26 37 now the error is raised directly (aborting the browser) instead of
27 38 running into an empty levels list later.
28 39
29 40 2007-02-03 Walter Doerwald <walter@livinglogic.de>
30 41
31 42 * IPython/Extensions/ipipe.py: Add an xrepr implementation
32 43 for the noitem object.
33 44
34 45 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
35 46
36 47 * IPython/completer.py (Completer.attr_matches): Fix small
37 48 tab-completion bug with Enthought Traits objects with units.
38 49 Thanks to a bug report by Tom Denniston
39 50 <tom.denniston-AT-alum.dartmouth.org>.
40 51
41 52 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
42 53
43 54 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
44 55 bug where only .ipy or .py would be completed. Once the first
45 56 argument to %run has been given, all completions are valid because
46 57 they are the arguments to the script, which may well be non-python
47 58 filenames.
48 59
49 60 * IPython/irunner.py (InteractiveRunner.run_source): major updates
50 61 to irunner to allow it to correctly support real doctesting of
51 62 out-of-process ipython code.
52 63
53 64 * IPython/Magic.py (magic_cd): Make the setting of the terminal
54 65 title an option (-noterm_title) because it completely breaks
55 66 doctesting.
56 67
57 68 * IPython/demo.py: fix IPythonDemo class that was not actually working.
58 69
59 70 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
60 71
61 72 * IPython/irunner.py (main): fix small bug where extensions were
62 73 not being correctly recognized.
63 74
64 75 2007-01-23 Walter Doerwald <walter@livinglogic.de>
65 76
66 77 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
67 78 a string containing a single line yields the string itself as the
68 79 only item.
69 80
70 81 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
71 82 object if it's the same as the one on the last level (This avoids
72 83 infinite recursion for one line strings).
73 84
74 85 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
75 86
76 87 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
77 88 all output streams before printing tracebacks. This ensures that
78 89 user output doesn't end up interleaved with traceback output.
79 90
80 91 2007-01-10 Ville Vainio <vivainio@gmail.com>
81 92
82 93 * Extensions/envpersist.py: Turbocharged %env that remembers
83 94 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
84 95 "%env VISUAL=jed".
85 96
86 97 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
87 98
88 99 * IPython/iplib.py (showtraceback): ensure that we correctly call
89 100 custom handlers in all cases (some with pdb were slipping through,
90 101 but I'm not exactly sure why).
91 102
92 103 * IPython/Debugger.py (Tracer.__init__): added new class to
93 104 support set_trace-like usage of IPython's enhanced debugger.
94 105
95 106 2006-12-24 Ville Vainio <vivainio@gmail.com>
96 107
97 108 * ipmaker.py: more informative message when ipy_user_conf
98 109 import fails (suggest running %upgrade).
99 110
100 111 * tools/run_ipy_in_profiler.py: Utility to see where
101 112 the time during IPython startup is spent.
102 113
103 114 2006-12-20 Ville Vainio <vivainio@gmail.com>
104 115
105 116 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
106 117
107 118 * ipapi.py: Add new ipapi method, expand_alias.
108 119
109 120 * Release.py: Bump up version to 0.7.4.svn
110 121
111 122 2006-12-17 Ville Vainio <vivainio@gmail.com>
112 123
113 124 * Extensions/jobctrl.py: Fixed &cmd arg arg...
114 125 to work properly on posix too
115 126
116 127 * Release.py: Update revnum (version is still just 0.7.3).
117 128
118 129 2006-12-15 Ville Vainio <vivainio@gmail.com>
119 130
120 131 * scripts/ipython_win_post_install: create ipython.py in
121 132 prefix + "/scripts".
122 133
123 134 * Release.py: Update version to 0.7.3.
124 135
125 136 2006-12-14 Ville Vainio <vivainio@gmail.com>
126 137
127 138 * scripts/ipython_win_post_install: Overwrite old shortcuts
128 139 if they already exist
129 140
130 141 * Release.py: release 0.7.3rc2
131 142
132 143 2006-12-13 Ville Vainio <vivainio@gmail.com>
133 144
134 145 * Branch and update Release.py for 0.7.3rc1
135 146
136 147 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
137 148
138 149 * IPython/Shell.py (IPShellWX): update for current WX naming
139 150 conventions, to avoid a deprecation warning with current WX
140 151 versions. Thanks to a report by Danny Shevitz.
141 152
142 153 2006-12-12 Ville Vainio <vivainio@gmail.com>
143 154
144 155 * ipmaker.py: apply david cournapeau's patch to make
145 156 import_some work properly even when ipythonrc does
146 157 import_some on empty list (it was an old bug!).
147 158
148 159 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
149 160 Add deprecation note to ipythonrc and a url to wiki
150 161 in ipy_user_conf.py
151 162
152 163
153 164 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
154 165 as if it was typed on IPython command prompt, i.e.
155 166 as IPython script.
156 167
157 168 * example-magic.py, magic_grepl.py: remove outdated examples
158 169
159 170 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
160 171
161 172 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
162 173 is called before any exception has occurred.
163 174
164 175 2006-12-08 Ville Vainio <vivainio@gmail.com>
165 176
166 177 * Extensions/ipy_stock_completers.py: fix cd completer
167 178 to translate /'s to \'s again.
168 179
169 180 * completer.py: prevent traceback on file completions w/
170 181 backslash.
171 182
172 183 * Release.py: Update release number to 0.7.3b3 for release
173 184
174 185 2006-12-07 Ville Vainio <vivainio@gmail.com>
175 186
176 187 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
177 188 while executing external code. Provides more shell-like behaviour
178 189 and overall better response to ctrl + C / ctrl + break.
179 190
180 191 * tools/make_tarball.py: new script to create tarball straight from svn
181 192 (setup.py sdist doesn't work on win32).
182 193
183 194 * Extensions/ipy_stock_completers.py: fix cd completer to give up
184 195 on dirnames with spaces and use the default completer instead.
185 196
186 197 * Revision.py: Change version to 0.7.3b2 for release.
187 198
188 199 2006-12-05 Ville Vainio <vivainio@gmail.com>
189 200
190 201 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
191 202 pydb patch 4 (rm debug printing, py 2.5 checking)
192 203
193 204 2006-11-30 Walter Doerwald <walter@livinglogic.de>
194 205 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
195 206 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
196 207 "refreshfind" (mapped to "R") does the same but tries to go back to the same
197 208 object the cursor was on before the refresh. The command "markrange" is
198 209 mapped to "%" now.
199 210 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
200 211
201 212 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
202 213
203 214 * IPython/Magic.py (magic_debug): new %debug magic to activate the
204 215 interactive debugger on the last traceback, without having to call
205 216 %pdb and rerun your code. Made minor changes in various modules,
206 217 should automatically recognize pydb if available.
207 218
208 219 2006-11-28 Ville Vainio <vivainio@gmail.com>
209 220
210 221 * completer.py: If the text start with !, show file completions
211 222 properly. This helps when trying to complete command name
212 223 for shell escapes.
213 224
214 225 2006-11-27 Ville Vainio <vivainio@gmail.com>
215 226
216 227 * ipy_stock_completers.py: bzr completer submitted by Stefan van
217 228 der Walt. Clean up svn and hg completers by using a common
218 229 vcs_completer.
219 230
220 231 2006-11-26 Ville Vainio <vivainio@gmail.com>
221 232
222 233 * Remove ipconfig and %config; you should use _ip.options structure
223 234 directly instead!
224 235
225 236 * genutils.py: add wrap_deprecated function for deprecating callables
226 237
227 238 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
228 239 _ip.system instead. ipalias is redundant.
229 240
230 241 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
231 242 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
232 243 explicit.
233 244
234 245 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
235 246 completer. Try it by entering 'hg ' and pressing tab.
236 247
237 248 * macro.py: Give Macro a useful __repr__ method
238 249
239 250 * Magic.py: %whos abbreviates the typename of Macro for brevity.
240 251
241 252 2006-11-24 Walter Doerwald <walter@livinglogic.de>
242 253 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
243 254 we don't get a duplicate ipipe module, where registration of the xrepr
244 255 implementation for Text is useless.
245 256
246 257 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
247 258
248 259 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
249 260
250 261 2006-11-24 Ville Vainio <vivainio@gmail.com>
251 262
252 263 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
253 264 try to use "cProfile" instead of the slower pure python
254 265 "profile"
255 266
256 267 2006-11-23 Ville Vainio <vivainio@gmail.com>
257 268
258 269 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
259 270 Qt+IPython+Designer link in documentation.
260 271
261 272 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
262 273 correct Pdb object to %pydb.
263 274
264 275
265 276 2006-11-22 Walter Doerwald <walter@livinglogic.de>
266 277 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
267 278 generic xrepr(), otherwise the list implementation would kick in.
268 279
269 280 2006-11-21 Ville Vainio <vivainio@gmail.com>
270 281
271 282 * upgrade_dir.py: Now actually overwrites a nonmodified user file
272 283 with one from UserConfig.
273 284
274 285 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
275 286 it was missing which broke the sh profile.
276 287
277 288 * completer.py: file completer now uses explicit '/' instead
278 289 of os.path.join, expansion of 'foo' was broken on win32
279 290 if there was one directory with name 'foobar'.
280 291
281 292 * A bunch of patches from Kirill Smelkov:
282 293
283 294 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
284 295
285 296 * [patch 7/9] Implement %page -r (page in raw mode) -
286 297
287 298 * [patch 5/9] ScientificPython webpage has moved
288 299
289 300 * [patch 4/9] The manual mentions %ds, should be %dhist
290 301
291 302 * [patch 3/9] Kill old bits from %prun doc.
292 303
293 304 * [patch 1/9] Fix typos here and there.
294 305
295 306 2006-11-08 Ville Vainio <vivainio@gmail.com>
296 307
297 308 * completer.py (attr_matches): catch all exceptions raised
298 309 by eval of expr with dots.
299 310
300 311 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
301 312
302 313 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
303 314 input if it starts with whitespace. This allows you to paste
304 315 indented input from any editor without manually having to type in
305 316 the 'if 1:', which is convenient when working interactively.
306 317 Slightly modifed version of a patch by Bo Peng
307 318 <bpeng-AT-rice.edu>.
308 319
309 320 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
310 321
311 322 * IPython/irunner.py (main): modified irunner so it automatically
312 323 recognizes the right runner to use based on the extension (.py for
313 324 python, .ipy for ipython and .sage for sage).
314 325
315 326 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
316 327 visible in ipapi as ip.config(), to programatically control the
317 328 internal rc object. There's an accompanying %config magic for
318 329 interactive use, which has been enhanced to match the
319 330 funtionality in ipconfig.
320 331
321 332 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
322 333 so it's not just a toggle, it now takes an argument. Add support
323 334 for a customizable header when making system calls, as the new
324 335 system_header variable in the ipythonrc file.
325 336
326 337 2006-11-03 Walter Doerwald <walter@livinglogic.de>
327 338
328 339 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
329 340 generic functions (using Philip J. Eby's simplegeneric package).
330 341 This makes it possible to customize the display of third-party classes
331 342 without having to monkeypatch them. xiter() no longer supports a mode
332 343 argument and the XMode class has been removed. The same functionality can
333 344 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
334 345 One consequence of the switch to generic functions is that xrepr() and
335 346 xattrs() implementation must define the default value for the mode
336 347 argument themselves and xattrs() implementations must return real
337 348 descriptors.
338 349
339 350 * IPython/external: This new subpackage will contain all third-party
340 351 packages that are bundled with IPython. (The first one is simplegeneric).
341 352
342 353 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
343 354 directory which as been dropped in r1703.
344 355
345 356 * IPython/Extensions/ipipe.py (iless): Fixed.
346 357
347 358 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
348 359
349 360 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
350 361
351 362 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
352 363 handling in variable expansion so that shells and magics recognize
353 364 function local scopes correctly. Bug reported by Brian.
354 365
355 366 * scripts/ipython: remove the very first entry in sys.path which
356 367 Python auto-inserts for scripts, so that sys.path under IPython is
357 368 as similar as possible to that under plain Python.
358 369
359 370 * IPython/completer.py (IPCompleter.file_matches): Fix
360 371 tab-completion so that quotes are not closed unless the completion
361 372 is unambiguous. After a request by Stefan. Minor cleanups in
362 373 ipy_stock_completers.
363 374
364 375 2006-11-02 Ville Vainio <vivainio@gmail.com>
365 376
366 377 * ipy_stock_completers.py: Add %run and %cd completers.
367 378
368 379 * completer.py: Try running custom completer for both
369 380 "foo" and "%foo" if the command is just "foo". Ignore case
370 381 when filtering possible completions.
371 382
372 383 * UserConfig/ipy_user_conf.py: install stock completers as default
373 384
374 385 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
375 386 simplified readline history save / restore through a wrapper
376 387 function
377 388
378 389
379 390 2006-10-31 Ville Vainio <vivainio@gmail.com>
380 391
381 392 * strdispatch.py, completer.py, ipy_stock_completers.py:
382 393 Allow str_key ("command") in completer hooks. Implement
383 394 trivial completer for 'import' (stdlib modules only). Rename
384 395 ipy_linux_package_managers.py to ipy_stock_completers.py.
385 396 SVN completer.
386 397
387 398 * Extensions/ledit.py: %magic line editor for easily and
388 399 incrementally manipulating lists of strings. The magic command
389 400 name is %led.
390 401
391 402 2006-10-30 Ville Vainio <vivainio@gmail.com>
392 403
393 404 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
394 405 Bernsteins's patches for pydb integration.
395 406 http://bashdb.sourceforge.net/pydb/
396 407
397 408 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
398 409 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
399 410 custom completer hook to allow the users to implement their own
400 411 completers. See ipy_linux_package_managers.py for example. The
401 412 hook name is 'complete_command'.
402 413
403 414 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
404 415
405 416 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
406 417 Numeric leftovers.
407 418
408 419 * ipython.el (py-execute-region): apply Stefan's patch to fix
409 420 garbled results if the python shell hasn't been previously started.
410 421
411 422 * IPython/genutils.py (arg_split): moved to genutils, since it's a
412 423 pretty generic function and useful for other things.
413 424
414 425 * IPython/OInspect.py (getsource): Add customizable source
415 426 extractor. After a request/patch form W. Stein (SAGE).
416 427
417 428 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
418 429 window size to a more reasonable value from what pexpect does,
419 430 since their choice causes wrapping bugs with long input lines.
420 431
421 432 2006-10-28 Ville Vainio <vivainio@gmail.com>
422 433
423 434 * Magic.py (%run): Save and restore the readline history from
424 435 file around %run commands to prevent side effects from
425 436 %runned programs that might use readline (e.g. pydb).
426 437
427 438 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
428 439 invoking the pydb enhanced debugger.
429 440
430 441 2006-10-23 Walter Doerwald <walter@livinglogic.de>
431 442
432 443 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
433 444 call the base class method and propagate the return value to
434 445 ifile. This is now done by path itself.
435 446
436 447 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
437 448
438 449 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
439 450 api: set_crash_handler(), to expose the ability to change the
440 451 internal crash handler.
441 452
442 453 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
443 454 the various parameters of the crash handler so that apps using
444 455 IPython as their engine can customize crash handling. Ipmlemented
445 456 at the request of SAGE.
446 457
447 458 2006-10-14 Ville Vainio <vivainio@gmail.com>
448 459
449 460 * Magic.py, ipython.el: applied first "safe" part of Rocky
450 461 Bernstein's patch set for pydb integration.
451 462
452 463 * Magic.py (%unalias, %alias): %store'd aliases can now be
453 464 removed with '%unalias'. %alias w/o args now shows most
454 465 interesting (stored / manually defined) aliases last
455 466 where they catch the eye w/o scrolling.
456 467
457 468 * Magic.py (%rehashx), ext_rehashdir.py: files with
458 469 'py' extension are always considered executable, even
459 470 when not in PATHEXT environment variable.
460 471
461 472 2006-10-12 Ville Vainio <vivainio@gmail.com>
462 473
463 474 * jobctrl.py: Add new "jobctrl" extension for spawning background
464 475 processes with "&find /". 'import jobctrl' to try it out. Requires
465 476 'subprocess' module, standard in python 2.4+.
466 477
467 478 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
468 479 so if foo -> bar and bar -> baz, then foo -> baz.
469 480
470 481 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
471 482
472 483 * IPython/Magic.py (Magic.parse_options): add a new posix option
473 484 to allow parsing of input args in magics that doesn't strip quotes
474 485 (if posix=False). This also closes %timeit bug reported by
475 486 Stefan.
476 487
477 488 2006-10-03 Ville Vainio <vivainio@gmail.com>
478 489
479 490 * iplib.py (raw_input, interact): Return ValueError catching for
480 491 raw_input. Fixes infinite loop for sys.stdin.close() or
481 492 sys.stdout.close().
482 493
483 494 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
484 495
485 496 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
486 497 to help in handling doctests. irunner is now pretty useful for
487 498 running standalone scripts and simulate a full interactive session
488 499 in a format that can be then pasted as a doctest.
489 500
490 501 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
491 502 on top of the default (useless) ones. This also fixes the nasty
492 503 way in which 2.5's Quitter() exits (reverted [1785]).
493 504
494 505 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
495 506 2.5.
496 507
497 508 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
498 509 color scheme is updated as well when color scheme is changed
499 510 interactively.
500 511
501 512 2006-09-27 Ville Vainio <vivainio@gmail.com>
502 513
503 514 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
504 515 infinite loop and just exit. It's a hack, but will do for a while.
505 516
506 517 2006-08-25 Walter Doerwald <walter@livinglogic.de>
507 518
508 519 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
509 520 the constructor, this makes it possible to get a list of only directories
510 521 or only files.
511 522
512 523 2006-08-12 Ville Vainio <vivainio@gmail.com>
513 524
514 525 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
515 526 they broke unittest
516 527
517 528 2006-08-11 Ville Vainio <vivainio@gmail.com>
518 529
519 530 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
520 531 by resolving issue properly, i.e. by inheriting FakeModule
521 532 from types.ModuleType. Pickling ipython interactive data
522 533 should still work as usual (testing appreciated).
523 534
524 535 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
525 536
526 537 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
527 538 running under python 2.3 with code from 2.4 to fix a bug with
528 539 help(). Reported by the Debian maintainers, Norbert Tretkowski
529 540 <norbert-AT-tretkowski.de> and Alexandre Fayolle
530 541 <afayolle-AT-debian.org>.
531 542
532 543 2006-08-04 Walter Doerwald <walter@livinglogic.de>
533 544
534 545 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
535 546 (which was displaying "quit" twice).
536 547
537 548 2006-07-28 Walter Doerwald <walter@livinglogic.de>
538 549
539 550 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
540 551 the mode argument).
541 552
542 553 2006-07-27 Walter Doerwald <walter@livinglogic.de>
543 554
544 555 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
545 556 not running under IPython.
546 557
547 558 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
548 559 and make it iterable (iterating over the attribute itself). Add two new
549 560 magic strings for __xattrs__(): If the string starts with "-", the attribute
550 561 will not be displayed in ibrowse's detail view (but it can still be
551 562 iterated over). This makes it possible to add attributes that are large
552 563 lists or generator methods to the detail view. Replace magic attribute names
553 564 and _attrname() and _getattr() with "descriptors": For each type of magic
554 565 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
555 566 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
556 567 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
557 568 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
558 569 are still supported.
559 570
560 571 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
561 572 fails in ibrowse.fetch(), the exception object is added as the last item
562 573 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
563 574 a generator throws an exception midway through execution.
564 575
565 576 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
566 577 encoding into methods.
567 578
568 579 2006-07-26 Ville Vainio <vivainio@gmail.com>
569 580
570 581 * iplib.py: history now stores multiline input as single
571 582 history entries. Patch by Jorgen Cederlof.
572 583
573 584 2006-07-18 Walter Doerwald <walter@livinglogic.de>
574 585
575 586 * IPython/Extensions/ibrowse.py: Make cursor visible over
576 587 non existing attributes.
577 588
578 589 2006-07-14 Walter Doerwald <walter@livinglogic.de>
579 590
580 591 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
581 592 error output of the running command doesn't mess up the screen.
582 593
583 594 2006-07-13 Walter Doerwald <walter@livinglogic.de>
584 595
585 596 * IPython/Extensions/ipipe.py (isort): Make isort usable without
586 597 argument. This sorts the items themselves.
587 598
588 599 2006-07-12 Walter Doerwald <walter@livinglogic.de>
589 600
590 601 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
591 602 Compile expression strings into code objects. This should speed
592 603 up ifilter and friends somewhat.
593 604
594 605 2006-07-08 Ville Vainio <vivainio@gmail.com>
595 606
596 607 * Magic.py: %cpaste now strips > from the beginning of lines
597 608 to ease pasting quoted code from emails. Contributed by
598 609 Stefan van der Walt.
599 610
600 611 2006-06-29 Ville Vainio <vivainio@gmail.com>
601 612
602 613 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
603 614 mode, patch contributed by Darren Dale. NEEDS TESTING!
604 615
605 616 2006-06-28 Walter Doerwald <walter@livinglogic.de>
606 617
607 618 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
608 619 a blue background. Fix fetching new display rows when the browser
609 620 scrolls more than a screenful (e.g. by using the goto command).
610 621
611 622 2006-06-27 Ville Vainio <vivainio@gmail.com>
612 623
613 624 * Magic.py (_inspect, _ofind) Apply David Huard's
614 625 patch for displaying the correct docstring for 'property'
615 626 attributes.
616 627
617 628 2006-06-23 Walter Doerwald <walter@livinglogic.de>
618 629
619 630 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
620 631 commands into the methods implementing them.
621 632
622 633 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
623 634
624 635 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
625 636 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
626 637 autoindent support was authored by Jin Liu.
627 638
628 639 2006-06-22 Walter Doerwald <walter@livinglogic.de>
629 640
630 641 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
631 642 for keymaps with a custom class that simplifies handling.
632 643
633 644 2006-06-19 Walter Doerwald <walter@livinglogic.de>
634 645
635 646 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
636 647 resizing. This requires Python 2.5 to work.
637 648
638 649 2006-06-16 Walter Doerwald <walter@livinglogic.de>
639 650
640 651 * IPython/Extensions/ibrowse.py: Add two new commands to
641 652 ibrowse: "hideattr" (mapped to "h") hides the attribute under
642 653 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
643 654 attributes again. Remapped the help command to "?". Display
644 655 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
645 656 as keys for the "home" and "end" commands. Add three new commands
646 657 to the input mode for "find" and friends: "delend" (CTRL-K)
647 658 deletes to the end of line. "incsearchup" searches upwards in the
648 659 command history for an input that starts with the text before the cursor.
649 660 "incsearchdown" does the same downwards. Removed a bogus mapping of
650 661 the x key to "delete".
651 662
652 663 2006-06-15 Ville Vainio <vivainio@gmail.com>
653 664
654 665 * iplib.py, hooks.py: Added new generate_prompt hook that can be
655 666 used to create prompts dynamically, instead of the "old" way of
656 667 assigning "magic" strings to prompt_in1 and prompt_in2. The old
657 668 way still works (it's invoked by the default hook), of course.
658 669
659 670 * Prompts.py: added generate_output_prompt hook for altering output
660 671 prompt
661 672
662 673 * Release.py: Changed version string to 0.7.3.svn.
663 674
664 675 2006-06-15 Walter Doerwald <walter@livinglogic.de>
665 676
666 677 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
667 678 the call to fetch() always tries to fetch enough data for at least one
668 679 full screen. This makes it possible to simply call moveto(0,0,True) in
669 680 the constructor. Fix typos and removed the obsolete goto attribute.
670 681
671 682 2006-06-12 Ville Vainio <vivainio@gmail.com>
672 683
673 684 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
674 685 allowing $variable interpolation within multiline statements,
675 686 though so far only with "sh" profile for a testing period.
676 687 The patch also enables splitting long commands with \ but it
677 688 doesn't work properly yet.
678 689
679 690 2006-06-12 Walter Doerwald <walter@livinglogic.de>
680 691
681 692 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
682 693 input history and the position of the cursor in the input history for
683 694 the find, findbackwards and goto command.
684 695
685 696 2006-06-10 Walter Doerwald <walter@livinglogic.de>
686 697
687 698 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
688 699 implements the basic functionality of browser commands that require
689 700 input. Reimplement the goto, find and findbackwards commands as
690 701 subclasses of _CommandInput. Add an input history and keymaps to those
691 702 commands. Add "\r" as a keyboard shortcut for the enterdefault and
692 703 execute commands.
693 704
694 705 2006-06-07 Ville Vainio <vivainio@gmail.com>
695 706
696 707 * iplib.py: ipython mybatch.ipy exits ipython immediately after
697 708 running the batch files instead of leaving the session open.
698 709
699 710 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
700 711
701 712 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
702 713 the original fix was incomplete. Patch submitted by W. Maier.
703 714
704 715 2006-06-07 Ville Vainio <vivainio@gmail.com>
705 716
706 717 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
707 718 Confirmation prompts can be supressed by 'quiet' option.
708 719 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
709 720
710 721 2006-06-06 *** Released version 0.7.2
711 722
712 723 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
713 724
714 725 * IPython/Release.py (version): Made 0.7.2 final for release.
715 726 Repo tagged and release cut.
716 727
717 728 2006-06-05 Ville Vainio <vivainio@gmail.com>
718 729
719 730 * Magic.py (magic_rehashx): Honor no_alias list earlier in
720 731 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
721 732
722 733 * upgrade_dir.py: try import 'path' module a bit harder
723 734 (for %upgrade)
724 735
725 736 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
726 737
727 738 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
728 739 instead of looping 20 times.
729 740
730 741 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
731 742 correctly at initialization time. Bug reported by Krishna Mohan
732 743 Gundu <gkmohan-AT-gmail.com> on the user list.
733 744
734 745 * IPython/Release.py (version): Mark 0.7.2 version to start
735 746 testing for release on 06/06.
736 747
737 748 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
738 749
739 750 * scripts/irunner: thin script interface so users don't have to
740 751 find the module and call it as an executable, since modules rarely
741 752 live in people's PATH.
742 753
743 754 * IPython/irunner.py (InteractiveRunner.__init__): added
744 755 delaybeforesend attribute to control delays with newer versions of
745 756 pexpect. Thanks to detailed help from pexpect's author, Noah
746 757 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
747 758 correctly (it works in NoColor mode).
748 759
749 760 * IPython/iplib.py (handle_normal): fix nasty crash reported on
750 761 SAGE list, from improper log() calls.
751 762
752 763 2006-05-31 Ville Vainio <vivainio@gmail.com>
753 764
754 765 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
755 766 with args in parens to work correctly with dirs that have spaces.
756 767
757 768 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
758 769
759 770 * IPython/Logger.py (Logger.logstart): add option to log raw input
760 771 instead of the processed one. A -r flag was added to the
761 772 %logstart magic used for controlling logging.
762 773
763 774 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
764 775
765 776 * IPython/iplib.py (InteractiveShell.__init__): add check for the
766 777 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
767 778 recognize the option. After a bug report by Will Maier. This
768 779 closes #64 (will do it after confirmation from W. Maier).
769 780
770 781 * IPython/irunner.py: New module to run scripts as if manually
771 782 typed into an interactive environment, based on pexpect. After a
772 783 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
773 784 ipython-user list. Simple unittests in the tests/ directory.
774 785
775 786 * tools/release: add Will Maier, OpenBSD port maintainer, to
776 787 recepients list. We are now officially part of the OpenBSD ports:
777 788 http://www.openbsd.org/ports.html ! Many thanks to Will for the
778 789 work.
779 790
780 791 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
781 792
782 793 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
783 794 so that it doesn't break tkinter apps.
784 795
785 796 * IPython/iplib.py (_prefilter): fix bug where aliases would
786 797 shadow variables when autocall was fully off. Reported by SAGE
787 798 author William Stein.
788 799
789 800 * IPython/OInspect.py (Inspector.__init__): add a flag to control
790 801 at what detail level strings are computed when foo? is requested.
791 802 This allows users to ask for example that the string form of an
792 803 object is only computed when foo?? is called, or even never, by
793 804 setting the object_info_string_level >= 2 in the configuration
794 805 file. This new option has been added and documented. After a
795 806 request by SAGE to be able to control the printing of very large
796 807 objects more easily.
797 808
798 809 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
799 810
800 811 * IPython/ipmaker.py (make_IPython): remove the ipython call path
801 812 from sys.argv, to be 100% consistent with how Python itself works
802 813 (as seen for example with python -i file.py). After a bug report
803 814 by Jeffrey Collins.
804 815
805 816 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
806 817 nasty bug which was preventing custom namespaces with -pylab,
807 818 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
808 819 compatibility (long gone from mpl).
809 820
810 821 * IPython/ipapi.py (make_session): name change: create->make. We
811 822 use make in other places (ipmaker,...), it's shorter and easier to
812 823 type and say, etc. I'm trying to clean things before 0.7.2 so
813 824 that I can keep things stable wrt to ipapi in the chainsaw branch.
814 825
815 826 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
816 827 python-mode recognizes our debugger mode. Add support for
817 828 autoindent inside (X)emacs. After a patch sent in by Jin Liu
818 829 <m.liu.jin-AT-gmail.com> originally written by
819 830 doxgen-AT-newsmth.net (with minor modifications for xemacs
820 831 compatibility)
821 832
822 833 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
823 834 tracebacks when walking the stack so that the stack tracking system
824 835 in emacs' python-mode can identify the frames correctly.
825 836
826 837 * IPython/ipmaker.py (make_IPython): make the internal (and
827 838 default config) autoedit_syntax value false by default. Too many
828 839 users have complained to me (both on and off-list) about problems
829 840 with this option being on by default, so I'm making it default to
830 841 off. It can still be enabled by anyone via the usual mechanisms.
831 842
832 843 * IPython/completer.py (Completer.attr_matches): add support for
833 844 PyCrust-style _getAttributeNames magic method. Patch contributed
834 845 by <mscott-AT-goldenspud.com>. Closes #50.
835 846
836 847 * IPython/iplib.py (InteractiveShell.__init__): remove the
837 848 deletion of exit/quit from __builtin__, which can break
838 849 third-party tools like the Zope debugging console. The
839 850 %exit/%quit magics remain. In general, it's probably a good idea
840 851 not to delete anything from __builtin__, since we never know what
841 852 that will break. In any case, python now (for 2.5) will support
842 853 'real' exit/quit, so this issue is moot. Closes #55.
843 854
844 855 * IPython/genutils.py (with_obj): rename the 'with' function to
845 856 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
846 857 becomes a language keyword. Closes #53.
847 858
848 859 * IPython/FakeModule.py (FakeModule.__init__): add a proper
849 860 __file__ attribute to this so it fools more things into thinking
850 861 it is a real module. Closes #59.
851 862
852 863 * IPython/Magic.py (magic_edit): add -n option to open the editor
853 864 at a specific line number. After a patch by Stefan van der Walt.
854 865
855 866 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
856 867
857 868 * IPython/iplib.py (edit_syntax_error): fix crash when for some
858 869 reason the file could not be opened. After automatic crash
859 870 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
860 871 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
861 872 (_should_recompile): Don't fire editor if using %bg, since there
862 873 is no file in the first place. From the same report as above.
863 874 (raw_input): protect against faulty third-party prefilters. After
864 875 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
865 876 while running under SAGE.
866 877
867 878 2006-05-23 Ville Vainio <vivainio@gmail.com>
868 879
869 880 * ipapi.py: Stripped down ip.to_user_ns() to work only as
870 881 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
871 882 now returns None (again), unless dummy is specifically allowed by
872 883 ipapi.get(allow_dummy=True).
873 884
874 885 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
875 886
876 887 * IPython: remove all 2.2-compatibility objects and hacks from
877 888 everywhere, since we only support 2.3 at this point. Docs
878 889 updated.
879 890
880 891 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
881 892 Anything requiring extra validation can be turned into a Python
882 893 property in the future. I used a property for the db one b/c
883 894 there was a nasty circularity problem with the initialization
884 895 order, which right now I don't have time to clean up.
885 896
886 897 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
887 898 another locking bug reported by Jorgen. I'm not 100% sure though,
888 899 so more testing is needed...
889 900
890 901 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
891 902
892 903 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
893 904 local variables from any routine in user code (typically executed
894 905 with %run) directly into the interactive namespace. Very useful
895 906 when doing complex debugging.
896 907 (IPythonNotRunning): Changed the default None object to a dummy
897 908 whose attributes can be queried as well as called without
898 909 exploding, to ease writing code which works transparently both in
899 910 and out of ipython and uses some of this API.
900 911
901 912 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
902 913
903 914 * IPython/hooks.py (result_display): Fix the fact that our display
904 915 hook was using str() instead of repr(), as the default python
905 916 console does. This had gone unnoticed b/c it only happened if
906 917 %Pprint was off, but the inconsistency was there.
907 918
908 919 2006-05-15 Ville Vainio <vivainio@gmail.com>
909 920
910 921 * Oinspect.py: Only show docstring for nonexisting/binary files
911 922 when doing object??, closing ticket #62
912 923
913 924 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
914 925
915 926 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
916 927 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
917 928 was being released in a routine which hadn't checked if it had
918 929 been the one to acquire it.
919 930
920 931 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
921 932
922 933 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
923 934
924 935 2006-04-11 Ville Vainio <vivainio@gmail.com>
925 936
926 937 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
927 938 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
928 939 prefilters, allowing stuff like magics and aliases in the file.
929 940
930 941 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
931 942 added. Supported now are "%clear in" and "%clear out" (clear input and
932 943 output history, respectively). Also fixed CachedOutput.flush to
933 944 properly flush the output cache.
934 945
935 946 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
936 947 half-success (and fail explicitly).
937 948
938 949 2006-03-28 Ville Vainio <vivainio@gmail.com>
939 950
940 951 * iplib.py: Fix quoting of aliases so that only argless ones
941 952 are quoted
942 953
943 954 2006-03-28 Ville Vainio <vivainio@gmail.com>
944 955
945 956 * iplib.py: Quote aliases with spaces in the name.
946 957 "c:\program files\blah\bin" is now legal alias target.
947 958
948 959 * ext_rehashdir.py: Space no longer allowed as arg
949 960 separator, since space is legal in path names.
950 961
951 962 2006-03-16 Ville Vainio <vivainio@gmail.com>
952 963
953 964 * upgrade_dir.py: Take path.py from Extensions, correcting
954 965 %upgrade magic
955 966
956 967 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
957 968
958 969 * hooks.py: Only enclose editor binary in quotes if legal and
959 970 necessary (space in the name, and is an existing file). Fixes a bug
960 971 reported by Zachary Pincus.
961 972
962 973 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
963 974
964 975 * Manual: thanks to a tip on proper color handling for Emacs, by
965 976 Eric J Haywiser <ejh1-AT-MIT.EDU>.
966 977
967 978 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
968 979 by applying the provided patch. Thanks to Liu Jin
969 980 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
970 981 XEmacs/Linux, I'm trusting the submitter that it actually helps
971 982 under win32/GNU Emacs. Will revisit if any problems are reported.
972 983
973 984 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
974 985
975 986 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
976 987 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
977 988
978 989 2006-03-12 Ville Vainio <vivainio@gmail.com>
979 990
980 991 * Magic.py (magic_timeit): Added %timeit magic, contributed by
981 992 Torsten Marek.
982 993
983 994 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
984 995
985 996 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
986 997 line ranges works again.
987 998
988 999 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
989 1000
990 1001 * IPython/iplib.py (showtraceback): add back sys.last_traceback
991 1002 and friends, after a discussion with Zach Pincus on ipython-user.
992 1003 I'm not 100% sure, but after thinking about it quite a bit, it may
993 1004 be OK. Testing with the multithreaded shells didn't reveal any
994 1005 problems, but let's keep an eye out.
995 1006
996 1007 In the process, I fixed a few things which were calling
997 1008 self.InteractiveTB() directly (like safe_execfile), which is a
998 1009 mistake: ALL exception reporting should be done by calling
999 1010 self.showtraceback(), which handles state and tab-completion and
1000 1011 more.
1001 1012
1002 1013 2006-03-01 Ville Vainio <vivainio@gmail.com>
1003 1014
1004 1015 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1005 1016 To use, do "from ipipe import *".
1006 1017
1007 1018 2006-02-24 Ville Vainio <vivainio@gmail.com>
1008 1019
1009 1020 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1010 1021 "cleanly" and safely than the older upgrade mechanism.
1011 1022
1012 1023 2006-02-21 Ville Vainio <vivainio@gmail.com>
1013 1024
1014 1025 * Magic.py: %save works again.
1015 1026
1016 1027 2006-02-15 Ville Vainio <vivainio@gmail.com>
1017 1028
1018 1029 * Magic.py: %Pprint works again
1019 1030
1020 1031 * Extensions/ipy_sane_defaults.py: Provide everything provided
1021 1032 in default ipythonrc, to make it possible to have a completely empty
1022 1033 ipythonrc (and thus completely rc-file free configuration)
1023 1034
1024 1035 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1025 1036
1026 1037 * IPython/hooks.py (editor): quote the call to the editor command,
1027 1038 to allow commands with spaces in them. Problem noted by watching
1028 1039 Ian Oswald's video about textpad under win32 at
1029 1040 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1030 1041
1031 1042 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1032 1043 describing magics (we haven't used @ for a loong time).
1033 1044
1034 1045 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1035 1046 contributed by marienz to close
1036 1047 http://www.scipy.net/roundup/ipython/issue53.
1037 1048
1038 1049 2006-02-10 Ville Vainio <vivainio@gmail.com>
1039 1050
1040 1051 * genutils.py: getoutput now works in win32 too
1041 1052
1042 1053 * completer.py: alias and magic completion only invoked
1043 1054 at the first "item" in the line, to avoid "cd %store"
1044 1055 nonsense.
1045 1056
1046 1057 2006-02-09 Ville Vainio <vivainio@gmail.com>
1047 1058
1048 1059 * test/*: Added a unit testing framework (finally).
1049 1060 '%run runtests.py' to run test_*.
1050 1061
1051 1062 * ipapi.py: Exposed runlines and set_custom_exc
1052 1063
1053 1064 2006-02-07 Ville Vainio <vivainio@gmail.com>
1054 1065
1055 1066 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1056 1067 instead use "f(1 2)" as before.
1057 1068
1058 1069 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1059 1070
1060 1071 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1061 1072 facilities, for demos processed by the IPython input filter
1062 1073 (IPythonDemo), and for running a script one-line-at-a-time as a
1063 1074 demo, both for pure Python (LineDemo) and for IPython-processed
1064 1075 input (IPythonLineDemo). After a request by Dave Kohel, from the
1065 1076 SAGE team.
1066 1077 (Demo.edit): added an edit() method to the demo objects, to edit
1067 1078 the in-memory copy of the last executed block.
1068 1079
1069 1080 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1070 1081 processing to %edit, %macro and %save. These commands can now be
1071 1082 invoked on the unprocessed input as it was typed by the user
1072 1083 (without any prefilters applied). After requests by the SAGE team
1073 1084 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1074 1085
1075 1086 2006-02-01 Ville Vainio <vivainio@gmail.com>
1076 1087
1077 1088 * setup.py, eggsetup.py: easy_install ipython==dev works
1078 1089 correctly now (on Linux)
1079 1090
1080 1091 * ipy_user_conf,ipmaker: user config changes, removed spurious
1081 1092 warnings
1082 1093
1083 1094 * iplib: if rc.banner is string, use it as is.
1084 1095
1085 1096 * Magic: %pycat accepts a string argument and pages it's contents.
1086 1097
1087 1098
1088 1099 2006-01-30 Ville Vainio <vivainio@gmail.com>
1089 1100
1090 1101 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1091 1102 Now %store and bookmarks work through PickleShare, meaning that
1092 1103 concurrent access is possible and all ipython sessions see the
1093 1104 same database situation all the time, instead of snapshot of
1094 1105 the situation when the session was started. Hence, %bookmark
1095 1106 results are immediately accessible from othes sessions. The database
1096 1107 is also available for use by user extensions. See:
1097 1108 http://www.python.org/pypi/pickleshare
1098 1109
1099 1110 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1100 1111
1101 1112 * aliases can now be %store'd
1102 1113
1103 1114 * path.py moved to Extensions so that pickleshare does not need
1104 1115 IPython-specific import. Extensions added to pythonpath right
1105 1116 at __init__.
1106 1117
1107 1118 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1108 1119 called with _ip.system and the pre-transformed command string.
1109 1120
1110 1121 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1111 1122
1112 1123 * IPython/iplib.py (interact): Fix that we were not catching
1113 1124 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1114 1125 logic here had to change, but it's fixed now.
1115 1126
1116 1127 2006-01-29 Ville Vainio <vivainio@gmail.com>
1117 1128
1118 1129 * iplib.py: Try to import pyreadline on Windows.
1119 1130
1120 1131 2006-01-27 Ville Vainio <vivainio@gmail.com>
1121 1132
1122 1133 * iplib.py: Expose ipapi as _ip in builtin namespace.
1123 1134 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1124 1135 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1125 1136 syntax now produce _ip.* variant of the commands.
1126 1137
1127 1138 * "_ip.options().autoedit_syntax = 2" automatically throws
1128 1139 user to editor for syntax error correction without prompting.
1129 1140
1130 1141 2006-01-27 Ville Vainio <vivainio@gmail.com>
1131 1142
1132 1143 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1133 1144 'ipython' at argv[0]) executed through command line.
1134 1145 NOTE: this DEPRECATES calling ipython with multiple scripts
1135 1146 ("ipython a.py b.py c.py")
1136 1147
1137 1148 * iplib.py, hooks.py: Added configurable input prefilter,
1138 1149 named 'input_prefilter'. See ext_rescapture.py for example
1139 1150 usage.
1140 1151
1141 1152 * ext_rescapture.py, Magic.py: Better system command output capture
1142 1153 through 'var = !ls' (deprecates user-visible %sc). Same notation
1143 1154 applies for magics, 'var = %alias' assigns alias list to var.
1144 1155
1145 1156 * ipapi.py: added meta() for accessing extension-usable data store.
1146 1157
1147 1158 * iplib.py: added InteractiveShell.getapi(). New magics should be
1148 1159 written doing self.getapi() instead of using the shell directly.
1149 1160
1150 1161 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1151 1162 %store foo >> ~/myfoo.txt to store variables to files (in clean
1152 1163 textual form, not a restorable pickle).
1153 1164
1154 1165 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1155 1166
1156 1167 * usage.py, Magic.py: added %quickref
1157 1168
1158 1169 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1159 1170
1160 1171 * GetoptErrors when invoking magics etc. with wrong args
1161 1172 are now more helpful:
1162 1173 GetoptError: option -l not recognized (allowed: "qb" )
1163 1174
1164 1175 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1165 1176
1166 1177 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1167 1178 computationally intensive blocks don't appear to stall the demo.
1168 1179
1169 1180 2006-01-24 Ville Vainio <vivainio@gmail.com>
1170 1181
1171 1182 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1172 1183 value to manipulate resulting history entry.
1173 1184
1174 1185 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1175 1186 to instance methods of IPApi class, to make extending an embedded
1176 1187 IPython feasible. See ext_rehashdir.py for example usage.
1177 1188
1178 1189 * Merged 1071-1076 from branches/0.7.1
1179 1190
1180 1191
1181 1192 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1182 1193
1183 1194 * tools/release (daystamp): Fix build tools to use the new
1184 1195 eggsetup.py script to build lightweight eggs.
1185 1196
1186 1197 * Applied changesets 1062 and 1064 before 0.7.1 release.
1187 1198
1188 1199 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1189 1200 see the raw input history (without conversions like %ls ->
1190 1201 ipmagic("ls")). After a request from W. Stein, SAGE
1191 1202 (http://modular.ucsd.edu/sage) developer. This information is
1192 1203 stored in the input_hist_raw attribute of the IPython instance, so
1193 1204 developers can access it if needed (it's an InputList instance).
1194 1205
1195 1206 * Versionstring = 0.7.2.svn
1196 1207
1197 1208 * eggsetup.py: A separate script for constructing eggs, creates
1198 1209 proper launch scripts even on Windows (an .exe file in
1199 1210 \python24\scripts).
1200 1211
1201 1212 * ipapi.py: launch_new_instance, launch entry point needed for the
1202 1213 egg.
1203 1214
1204 1215 2006-01-23 Ville Vainio <vivainio@gmail.com>
1205 1216
1206 1217 * Added %cpaste magic for pasting python code
1207 1218
1208 1219 2006-01-22 Ville Vainio <vivainio@gmail.com>
1209 1220
1210 1221 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1211 1222
1212 1223 * Versionstring = 0.7.2.svn
1213 1224
1214 1225 * eggsetup.py: A separate script for constructing eggs, creates
1215 1226 proper launch scripts even on Windows (an .exe file in
1216 1227 \python24\scripts).
1217 1228
1218 1229 * ipapi.py: launch_new_instance, launch entry point needed for the
1219 1230 egg.
1220 1231
1221 1232 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1222 1233
1223 1234 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1224 1235 %pfile foo would print the file for foo even if it was a binary.
1225 1236 Now, extensions '.so' and '.dll' are skipped.
1226 1237
1227 1238 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1228 1239 bug, where macros would fail in all threaded modes. I'm not 100%
1229 1240 sure, so I'm going to put out an rc instead of making a release
1230 1241 today, and wait for feedback for at least a few days.
1231 1242
1232 1243 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1233 1244 it...) the handling of pasting external code with autoindent on.
1234 1245 To get out of a multiline input, the rule will appear for most
1235 1246 users unchanged: two blank lines or change the indent level
1236 1247 proposed by IPython. But there is a twist now: you can
1237 1248 add/subtract only *one or two spaces*. If you add/subtract three
1238 1249 or more (unless you completely delete the line), IPython will
1239 1250 accept that line, and you'll need to enter a second one of pure
1240 1251 whitespace. I know it sounds complicated, but I can't find a
1241 1252 different solution that covers all the cases, with the right
1242 1253 heuristics. Hopefully in actual use, nobody will really notice
1243 1254 all these strange rules and things will 'just work'.
1244 1255
1245 1256 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1246 1257
1247 1258 * IPython/iplib.py (interact): catch exceptions which can be
1248 1259 triggered asynchronously by signal handlers. Thanks to an
1249 1260 automatic crash report, submitted by Colin Kingsley
1250 1261 <tercel-AT-gentoo.org>.
1251 1262
1252 1263 2006-01-20 Ville Vainio <vivainio@gmail.com>
1253 1264
1254 1265 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1255 1266 (%rehashdir, very useful, try it out) of how to extend ipython
1256 1267 with new magics. Also added Extensions dir to pythonpath to make
1257 1268 importing extensions easy.
1258 1269
1259 1270 * %store now complains when trying to store interactively declared
1260 1271 classes / instances of those classes.
1261 1272
1262 1273 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1263 1274 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1264 1275 if they exist, and ipy_user_conf.py with some defaults is created for
1265 1276 the user.
1266 1277
1267 1278 * Startup rehashing done by the config file, not InterpreterExec.
1268 1279 This means system commands are available even without selecting the
1269 1280 pysh profile. It's the sensible default after all.
1270 1281
1271 1282 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1272 1283
1273 1284 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1274 1285 multiline code with autoindent on working. But I am really not
1275 1286 sure, so this needs more testing. Will commit a debug-enabled
1276 1287 version for now, while I test it some more, so that Ville and
1277 1288 others may also catch any problems. Also made
1278 1289 self.indent_current_str() a method, to ensure that there's no
1279 1290 chance of the indent space count and the corresponding string
1280 1291 falling out of sync. All code needing the string should just call
1281 1292 the method.
1282 1293
1283 1294 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1284 1295
1285 1296 * IPython/Magic.py (magic_edit): fix check for when users don't
1286 1297 save their output files, the try/except was in the wrong section.
1287 1298
1288 1299 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1289 1300
1290 1301 * IPython/Magic.py (magic_run): fix __file__ global missing from
1291 1302 script's namespace when executed via %run. After a report by
1292 1303 Vivian.
1293 1304
1294 1305 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1295 1306 when using python 2.4. The parent constructor changed in 2.4, and
1296 1307 we need to track it directly (we can't call it, as it messes up
1297 1308 readline and tab-completion inside our pdb would stop working).
1298 1309 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1299 1310
1300 1311 2006-01-16 Ville Vainio <vivainio@gmail.com>
1301 1312
1302 1313 * Ipython/magic.py: Reverted back to old %edit functionality
1303 1314 that returns file contents on exit.
1304 1315
1305 1316 * IPython/path.py: Added Jason Orendorff's "path" module to
1306 1317 IPython tree, http://www.jorendorff.com/articles/python/path/.
1307 1318 You can get path objects conveniently through %sc, and !!, e.g.:
1308 1319 sc files=ls
1309 1320 for p in files.paths: # or files.p
1310 1321 print p,p.mtime
1311 1322
1312 1323 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1313 1324 now work again without considering the exclusion regexp -
1314 1325 hence, things like ',foo my/path' turn to 'foo("my/path")'
1315 1326 instead of syntax error.
1316 1327
1317 1328
1318 1329 2006-01-14 Ville Vainio <vivainio@gmail.com>
1319 1330
1320 1331 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1321 1332 ipapi decorators for python 2.4 users, options() provides access to rc
1322 1333 data.
1323 1334
1324 1335 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1325 1336 as path separators (even on Linux ;-). Space character after
1326 1337 backslash (as yielded by tab completer) is still space;
1327 1338 "%cd long\ name" works as expected.
1328 1339
1329 1340 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1330 1341 as "chain of command", with priority. API stays the same,
1331 1342 TryNext exception raised by a hook function signals that
1332 1343 current hook failed and next hook should try handling it, as
1333 1344 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1334 1345 requested configurable display hook, which is now implemented.
1335 1346
1336 1347 2006-01-13 Ville Vainio <vivainio@gmail.com>
1337 1348
1338 1349 * IPython/platutils*.py: platform specific utility functions,
1339 1350 so far only set_term_title is implemented (change terminal
1340 1351 label in windowing systems). %cd now changes the title to
1341 1352 current dir.
1342 1353
1343 1354 * IPython/Release.py: Added myself to "authors" list,
1344 1355 had to create new files.
1345 1356
1346 1357 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1347 1358 shell escape; not a known bug but had potential to be one in the
1348 1359 future.
1349 1360
1350 1361 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1351 1362 extension API for IPython! See the module for usage example. Fix
1352 1363 OInspect for docstring-less magic functions.
1353 1364
1354 1365
1355 1366 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1356 1367
1357 1368 * IPython/iplib.py (raw_input): temporarily deactivate all
1358 1369 attempts at allowing pasting of code with autoindent on. It
1359 1370 introduced bugs (reported by Prabhu) and I can't seem to find a
1360 1371 robust combination which works in all cases. Will have to revisit
1361 1372 later.
1362 1373
1363 1374 * IPython/genutils.py: remove isspace() function. We've dropped
1364 1375 2.2 compatibility, so it's OK to use the string method.
1365 1376
1366 1377 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1367 1378
1368 1379 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1369 1380 matching what NOT to autocall on, to include all python binary
1370 1381 operators (including things like 'and', 'or', 'is' and 'in').
1371 1382 Prompted by a bug report on 'foo & bar', but I realized we had
1372 1383 many more potential bug cases with other operators. The regexp is
1373 1384 self.re_exclude_auto, it's fairly commented.
1374 1385
1375 1386 2006-01-12 Ville Vainio <vivainio@gmail.com>
1376 1387
1377 1388 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1378 1389 Prettified and hardened string/backslash quoting with ipsystem(),
1379 1390 ipalias() and ipmagic(). Now even \ characters are passed to
1380 1391 %magics, !shell escapes and aliases exactly as they are in the
1381 1392 ipython command line. Should improve backslash experience,
1382 1393 particularly in Windows (path delimiter for some commands that
1383 1394 won't understand '/'), but Unix benefits as well (regexps). %cd
1384 1395 magic still doesn't support backslash path delimiters, though. Also
1385 1396 deleted all pretense of supporting multiline command strings in
1386 1397 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1387 1398
1388 1399 * doc/build_doc_instructions.txt added. Documentation on how to
1389 1400 use doc/update_manual.py, added yesterday. Both files contributed
1390 1401 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1391 1402 doc/*.sh for deprecation at a later date.
1392 1403
1393 1404 * /ipython.py Added ipython.py to root directory for
1394 1405 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1395 1406 ipython.py) and development convenience (no need to keep doing
1396 1407 "setup.py install" between changes).
1397 1408
1398 1409 * Made ! and !! shell escapes work (again) in multiline expressions:
1399 1410 if 1:
1400 1411 !ls
1401 1412 !!ls
1402 1413
1403 1414 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1404 1415
1405 1416 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1406 1417 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1407 1418 module in case-insensitive installation. Was causing crashes
1408 1419 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1409 1420
1410 1421 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1411 1422 <marienz-AT-gentoo.org>, closes
1412 1423 http://www.scipy.net/roundup/ipython/issue51.
1413 1424
1414 1425 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1415 1426
1416 1427 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1417 1428 problem of excessive CPU usage under *nix and keyboard lag under
1418 1429 win32.
1419 1430
1420 1431 2006-01-10 *** Released version 0.7.0
1421 1432
1422 1433 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1423 1434
1424 1435 * IPython/Release.py (revision): tag version number to 0.7.0,
1425 1436 ready for release.
1426 1437
1427 1438 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1428 1439 it informs the user of the name of the temp. file used. This can
1429 1440 help if you decide later to reuse that same file, so you know
1430 1441 where to copy the info from.
1431 1442
1432 1443 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1433 1444
1434 1445 * setup_bdist_egg.py: little script to build an egg. Added
1435 1446 support in the release tools as well.
1436 1447
1437 1448 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1438 1449
1439 1450 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1440 1451 version selection (new -wxversion command line and ipythonrc
1441 1452 parameter). Patch contributed by Arnd Baecker
1442 1453 <arnd.baecker-AT-web.de>.
1443 1454
1444 1455 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1445 1456 embedded instances, for variables defined at the interactive
1446 1457 prompt of the embedded ipython. Reported by Arnd.
1447 1458
1448 1459 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1449 1460 it can be used as a (stateful) toggle, or with a direct parameter.
1450 1461
1451 1462 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1452 1463 could be triggered in certain cases and cause the traceback
1453 1464 printer not to work.
1454 1465
1455 1466 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1456 1467
1457 1468 * IPython/iplib.py (_should_recompile): Small fix, closes
1458 1469 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1459 1470
1460 1471 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1461 1472
1462 1473 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1463 1474 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1464 1475 Moad for help with tracking it down.
1465 1476
1466 1477 * IPython/iplib.py (handle_auto): fix autocall handling for
1467 1478 objects which support BOTH __getitem__ and __call__ (so that f [x]
1468 1479 is left alone, instead of becoming f([x]) automatically).
1469 1480
1470 1481 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1471 1482 Ville's patch.
1472 1483
1473 1484 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1474 1485
1475 1486 * IPython/iplib.py (handle_auto): changed autocall semantics to
1476 1487 include 'smart' mode, where the autocall transformation is NOT
1477 1488 applied if there are no arguments on the line. This allows you to
1478 1489 just type 'foo' if foo is a callable to see its internal form,
1479 1490 instead of having it called with no arguments (typically a
1480 1491 mistake). The old 'full' autocall still exists: for that, you
1481 1492 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1482 1493
1483 1494 * IPython/completer.py (Completer.attr_matches): add
1484 1495 tab-completion support for Enthoughts' traits. After a report by
1485 1496 Arnd and a patch by Prabhu.
1486 1497
1487 1498 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1488 1499
1489 1500 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1490 1501 Schmolck's patch to fix inspect.getinnerframes().
1491 1502
1492 1503 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1493 1504 for embedded instances, regarding handling of namespaces and items
1494 1505 added to the __builtin__ one. Multiple embedded instances and
1495 1506 recursive embeddings should work better now (though I'm not sure
1496 1507 I've got all the corner cases fixed, that code is a bit of a brain
1497 1508 twister).
1498 1509
1499 1510 * IPython/Magic.py (magic_edit): added support to edit in-memory
1500 1511 macros (automatically creates the necessary temp files). %edit
1501 1512 also doesn't return the file contents anymore, it's just noise.
1502 1513
1503 1514 * IPython/completer.py (Completer.attr_matches): revert change to
1504 1515 complete only on attributes listed in __all__. I realized it
1505 1516 cripples the tab-completion system as a tool for exploring the
1506 1517 internals of unknown libraries (it renders any non-__all__
1507 1518 attribute off-limits). I got bit by this when trying to see
1508 1519 something inside the dis module.
1509 1520
1510 1521 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1511 1522
1512 1523 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1513 1524 namespace for users and extension writers to hold data in. This
1514 1525 follows the discussion in
1515 1526 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1516 1527
1517 1528 * IPython/completer.py (IPCompleter.complete): small patch to help
1518 1529 tab-completion under Emacs, after a suggestion by John Barnard
1519 1530 <barnarj-AT-ccf.org>.
1520 1531
1521 1532 * IPython/Magic.py (Magic.extract_input_slices): added support for
1522 1533 the slice notation in magics to use N-M to represent numbers N...M
1523 1534 (closed endpoints). This is used by %macro and %save.
1524 1535
1525 1536 * IPython/completer.py (Completer.attr_matches): for modules which
1526 1537 define __all__, complete only on those. After a patch by Jeffrey
1527 1538 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1528 1539 speed up this routine.
1529 1540
1530 1541 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1531 1542 don't know if this is the end of it, but the behavior now is
1532 1543 certainly much more correct. Note that coupled with macros,
1533 1544 slightly surprising (at first) behavior may occur: a macro will in
1534 1545 general expand to multiple lines of input, so upon exiting, the
1535 1546 in/out counters will both be bumped by the corresponding amount
1536 1547 (as if the macro's contents had been typed interactively). Typing
1537 1548 %hist will reveal the intermediate (silently processed) lines.
1538 1549
1539 1550 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1540 1551 pickle to fail (%run was overwriting __main__ and not restoring
1541 1552 it, but pickle relies on __main__ to operate).
1542 1553
1543 1554 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1544 1555 using properties, but forgot to make the main InteractiveShell
1545 1556 class a new-style class. Properties fail silently, and
1546 1557 mysteriously, with old-style class (getters work, but
1547 1558 setters don't do anything).
1548 1559
1549 1560 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1550 1561
1551 1562 * IPython/Magic.py (magic_history): fix history reporting bug (I
1552 1563 know some nasties are still there, I just can't seem to find a
1553 1564 reproducible test case to track them down; the input history is
1554 1565 falling out of sync...)
1555 1566
1556 1567 * IPython/iplib.py (handle_shell_escape): fix bug where both
1557 1568 aliases and system accesses where broken for indented code (such
1558 1569 as loops).
1559 1570
1560 1571 * IPython/genutils.py (shell): fix small but critical bug for
1561 1572 win32 system access.
1562 1573
1563 1574 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1564 1575
1565 1576 * IPython/iplib.py (showtraceback): remove use of the
1566 1577 sys.last_{type/value/traceback} structures, which are non
1567 1578 thread-safe.
1568 1579 (_prefilter): change control flow to ensure that we NEVER
1569 1580 introspect objects when autocall is off. This will guarantee that
1570 1581 having an input line of the form 'x.y', where access to attribute
1571 1582 'y' has side effects, doesn't trigger the side effect TWICE. It
1572 1583 is important to note that, with autocall on, these side effects
1573 1584 can still happen.
1574 1585 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1575 1586 trio. IPython offers these three kinds of special calls which are
1576 1587 not python code, and it's a good thing to have their call method
1577 1588 be accessible as pure python functions (not just special syntax at
1578 1589 the command line). It gives us a better internal implementation
1579 1590 structure, as well as exposing these for user scripting more
1580 1591 cleanly.
1581 1592
1582 1593 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1583 1594 file. Now that they'll be more likely to be used with the
1584 1595 persistance system (%store), I want to make sure their module path
1585 1596 doesn't change in the future, so that we don't break things for
1586 1597 users' persisted data.
1587 1598
1588 1599 * IPython/iplib.py (autoindent_update): move indentation
1589 1600 management into the _text_ processing loop, not the keyboard
1590 1601 interactive one. This is necessary to correctly process non-typed
1591 1602 multiline input (such as macros).
1592 1603
1593 1604 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
1594 1605 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
1595 1606 which was producing problems in the resulting manual.
1596 1607 (magic_whos): improve reporting of instances (show their class,
1597 1608 instead of simply printing 'instance' which isn't terribly
1598 1609 informative).
1599 1610
1600 1611 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
1601 1612 (minor mods) to support network shares under win32.
1602 1613
1603 1614 * IPython/winconsole.py (get_console_size): add new winconsole
1604 1615 module and fixes to page_dumb() to improve its behavior under
1605 1616 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
1606 1617
1607 1618 * IPython/Magic.py (Macro): simplified Macro class to just
1608 1619 subclass list. We've had only 2.2 compatibility for a very long
1609 1620 time, yet I was still avoiding subclassing the builtin types. No
1610 1621 more (I'm also starting to use properties, though I won't shift to
1611 1622 2.3-specific features quite yet).
1612 1623 (magic_store): added Ville's patch for lightweight variable
1613 1624 persistence, after a request on the user list by Matt Wilkie
1614 1625 <maphew-AT-gmail.com>. The new %store magic's docstring has full
1615 1626 details.
1616 1627
1617 1628 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1618 1629 changed the default logfile name from 'ipython.log' to
1619 1630 'ipython_log.py'. These logs are real python files, and now that
1620 1631 we have much better multiline support, people are more likely to
1621 1632 want to use them as such. Might as well name them correctly.
1622 1633
1623 1634 * IPython/Magic.py: substantial cleanup. While we can't stop
1624 1635 using magics as mixins, due to the existing customizations 'out
1625 1636 there' which rely on the mixin naming conventions, at least I
1626 1637 cleaned out all cross-class name usage. So once we are OK with
1627 1638 breaking compatibility, the two systems can be separated.
1628 1639
1629 1640 * IPython/Logger.py: major cleanup. This one is NOT a mixin
1630 1641 anymore, and the class is a fair bit less hideous as well. New
1631 1642 features were also introduced: timestamping of input, and logging
1632 1643 of output results. These are user-visible with the -t and -o
1633 1644 options to %logstart. Closes
1634 1645 http://www.scipy.net/roundup/ipython/issue11 and a request by
1635 1646 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
1636 1647
1637 1648 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
1638 1649
1639 1650 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
1640 1651 better handle backslashes in paths. See the thread 'More Windows
1641 1652 questions part 2 - \/ characters revisited' on the iypthon user
1642 1653 list:
1643 1654 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
1644 1655
1645 1656 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
1646 1657
1647 1658 (InteractiveShell.__init__): change threaded shells to not use the
1648 1659 ipython crash handler. This was causing more problems than not,
1649 1660 as exceptions in the main thread (GUI code, typically) would
1650 1661 always show up as a 'crash', when they really weren't.
1651 1662
1652 1663 The colors and exception mode commands (%colors/%xmode) have been
1653 1664 synchronized to also take this into account, so users can get
1654 1665 verbose exceptions for their threaded code as well. I also added
1655 1666 support for activating pdb inside this exception handler as well,
1656 1667 so now GUI authors can use IPython's enhanced pdb at runtime.
1657 1668
1658 1669 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
1659 1670 true by default, and add it to the shipped ipythonrc file. Since
1660 1671 this asks the user before proceeding, I think it's OK to make it
1661 1672 true by default.
1662 1673
1663 1674 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
1664 1675 of the previous special-casing of input in the eval loop. I think
1665 1676 this is cleaner, as they really are commands and shouldn't have
1666 1677 a special role in the middle of the core code.
1667 1678
1668 1679 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
1669 1680
1670 1681 * IPython/iplib.py (edit_syntax_error): added support for
1671 1682 automatically reopening the editor if the file had a syntax error
1672 1683 in it. Thanks to scottt who provided the patch at:
1673 1684 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
1674 1685 version committed).
1675 1686
1676 1687 * IPython/iplib.py (handle_normal): add suport for multi-line
1677 1688 input with emtpy lines. This fixes
1678 1689 http://www.scipy.net/roundup/ipython/issue43 and a similar
1679 1690 discussion on the user list.
1680 1691
1681 1692 WARNING: a behavior change is necessarily introduced to support
1682 1693 blank lines: now a single blank line with whitespace does NOT
1683 1694 break the input loop, which means that when autoindent is on, by
1684 1695 default hitting return on the next (indented) line does NOT exit.
1685 1696
1686 1697 Instead, to exit a multiline input you can either have:
1687 1698
1688 1699 - TWO whitespace lines (just hit return again), or
1689 1700 - a single whitespace line of a different length than provided
1690 1701 by the autoindent (add or remove a space).
1691 1702
1692 1703 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
1693 1704 module to better organize all readline-related functionality.
1694 1705 I've deleted FlexCompleter and put all completion clases here.
1695 1706
1696 1707 * IPython/iplib.py (raw_input): improve indentation management.
1697 1708 It is now possible to paste indented code with autoindent on, and
1698 1709 the code is interpreted correctly (though it still looks bad on
1699 1710 screen, due to the line-oriented nature of ipython).
1700 1711 (MagicCompleter.complete): change behavior so that a TAB key on an
1701 1712 otherwise empty line actually inserts a tab, instead of completing
1702 1713 on the entire global namespace. This makes it easier to use the
1703 1714 TAB key for indentation. After a request by Hans Meine
1704 1715 <hans_meine-AT-gmx.net>
1705 1716 (_prefilter): add support so that typing plain 'exit' or 'quit'
1706 1717 does a sensible thing. Originally I tried to deviate as little as
1707 1718 possible from the default python behavior, but even that one may
1708 1719 change in this direction (thread on python-dev to that effect).
1709 1720 Regardless, ipython should do the right thing even if CPython's
1710 1721 '>>>' prompt doesn't.
1711 1722 (InteractiveShell): removed subclassing code.InteractiveConsole
1712 1723 class. By now we'd overridden just about all of its methods: I've
1713 1724 copied the remaining two over, and now ipython is a standalone
1714 1725 class. This will provide a clearer picture for the chainsaw
1715 1726 branch refactoring.
1716 1727
1717 1728 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
1718 1729
1719 1730 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
1720 1731 failures for objects which break when dir() is called on them.
1721 1732
1722 1733 * IPython/FlexCompleter.py (Completer.__init__): Added support for
1723 1734 distinct local and global namespaces in the completer API. This
1724 1735 change allows us to properly handle completion with distinct
1725 1736 scopes, including in embedded instances (this had never really
1726 1737 worked correctly).
1727 1738
1728 1739 Note: this introduces a change in the constructor for
1729 1740 MagicCompleter, as a new global_namespace parameter is now the
1730 1741 second argument (the others were bumped one position).
1731 1742
1732 1743 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
1733 1744
1734 1745 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1735 1746 embedded instances (which can be done now thanks to Vivian's
1736 1747 frame-handling fixes for pdb).
1737 1748 (InteractiveShell.__init__): Fix namespace handling problem in
1738 1749 embedded instances. We were overwriting __main__ unconditionally,
1739 1750 and this should only be done for 'full' (non-embedded) IPython;
1740 1751 embedded instances must respect the caller's __main__. Thanks to
1741 1752 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
1742 1753
1743 1754 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
1744 1755
1745 1756 * setup.py: added download_url to setup(). This registers the
1746 1757 download address at PyPI, which is not only useful to humans
1747 1758 browsing the site, but is also picked up by setuptools (the Eggs
1748 1759 machinery). Thanks to Ville and R. Kern for the info/discussion
1749 1760 on this.
1750 1761
1751 1762 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
1752 1763
1753 1764 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
1754 1765 This brings a lot of nice functionality to the pdb mode, which now
1755 1766 has tab-completion, syntax highlighting, and better stack handling
1756 1767 than before. Many thanks to Vivian De Smedt
1757 1768 <vivian-AT-vdesmedt.com> for the original patches.
1758 1769
1759 1770 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
1760 1771
1761 1772 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
1762 1773 sequence to consistently accept the banner argument. The
1763 1774 inconsistency was tripping SAGE, thanks to Gary Zablackis
1764 1775 <gzabl-AT-yahoo.com> for the report.
1765 1776
1766 1777 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1767 1778
1768 1779 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1769 1780 Fix bug where a naked 'alias' call in the ipythonrc file would
1770 1781 cause a crash. Bug reported by Jorgen Stenarson.
1771 1782
1772 1783 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
1773 1784
1774 1785 * IPython/ipmaker.py (make_IPython): cleanups which should improve
1775 1786 startup time.
1776 1787
1777 1788 * IPython/iplib.py (runcode): my globals 'fix' for embedded
1778 1789 instances had introduced a bug with globals in normal code. Now
1779 1790 it's working in all cases.
1780 1791
1781 1792 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
1782 1793 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
1783 1794 has been introduced to set the default case sensitivity of the
1784 1795 searches. Users can still select either mode at runtime on a
1785 1796 per-search basis.
1786 1797
1787 1798 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
1788 1799
1789 1800 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
1790 1801 attributes in wildcard searches for subclasses. Modified version
1791 1802 of a patch by Jorgen.
1792 1803
1793 1804 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
1794 1805
1795 1806 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
1796 1807 embedded instances. I added a user_global_ns attribute to the
1797 1808 InteractiveShell class to handle this.
1798 1809
1799 1810 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
1800 1811
1801 1812 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
1802 1813 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
1803 1814 (reported under win32, but may happen also in other platforms).
1804 1815 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
1805 1816
1806 1817 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
1807 1818
1808 1819 * IPython/Magic.py (magic_psearch): new support for wildcard
1809 1820 patterns. Now, typing ?a*b will list all names which begin with a
1810 1821 and end in b, for example. The %psearch magic has full
1811 1822 docstrings. Many thanks to JΓΆrgen Stenarson
1812 1823 <jorgen.stenarson-AT-bostream.nu>, author of the patches
1813 1824 implementing this functionality.
1814 1825
1815 1826 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1816 1827
1817 1828 * Manual: fixed long-standing annoyance of double-dashes (as in
1818 1829 --prefix=~, for example) being stripped in the HTML version. This
1819 1830 is a latex2html bug, but a workaround was provided. Many thanks
1820 1831 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
1821 1832 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
1822 1833 rolling. This seemingly small issue had tripped a number of users
1823 1834 when first installing, so I'm glad to see it gone.
1824 1835
1825 1836 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
1826 1837
1827 1838 * IPython/Extensions/numeric_formats.py: fix missing import,
1828 1839 reported by Stephen Walton.
1829 1840
1830 1841 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
1831 1842
1832 1843 * IPython/demo.py: finish demo module, fully documented now.
1833 1844
1834 1845 * IPython/genutils.py (file_read): simple little utility to read a
1835 1846 file and ensure it's closed afterwards.
1836 1847
1837 1848 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
1838 1849
1839 1850 * IPython/demo.py (Demo.__init__): added support for individually
1840 1851 tagging blocks for automatic execution.
1841 1852
1842 1853 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
1843 1854 syntax-highlighted python sources, requested by John.
1844 1855
1845 1856 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
1846 1857
1847 1858 * IPython/demo.py (Demo.again): fix bug where again() blocks after
1848 1859 finishing.
1849 1860
1850 1861 * IPython/genutils.py (shlex_split): moved from Magic to here,
1851 1862 where all 2.2 compatibility stuff lives. I needed it for demo.py.
1852 1863
1853 1864 * IPython/demo.py (Demo.__init__): added support for silent
1854 1865 blocks, improved marks as regexps, docstrings written.
1855 1866 (Demo.__init__): better docstring, added support for sys.argv.
1856 1867
1857 1868 * IPython/genutils.py (marquee): little utility used by the demo
1858 1869 code, handy in general.
1859 1870
1860 1871 * IPython/demo.py (Demo.__init__): new class for interactive
1861 1872 demos. Not documented yet, I just wrote it in a hurry for
1862 1873 scipy'05. Will docstring later.
1863 1874
1864 1875 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
1865 1876
1866 1877 * IPython/Shell.py (sigint_handler): Drastic simplification which
1867 1878 also seems to make Ctrl-C work correctly across threads! This is
1868 1879 so simple, that I can't beleive I'd missed it before. Needs more
1869 1880 testing, though.
1870 1881 (KBINT): Never mind, revert changes. I'm sure I'd tried something
1871 1882 like this before...
1872 1883
1873 1884 * IPython/genutils.py (get_home_dir): add protection against
1874 1885 non-dirs in win32 registry.
1875 1886
1876 1887 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
1877 1888 bug where dict was mutated while iterating (pysh crash).
1878 1889
1879 1890 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
1880 1891
1881 1892 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
1882 1893 spurious newlines added by this routine. After a report by
1883 1894 F. Mantegazza.
1884 1895
1885 1896 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
1886 1897
1887 1898 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
1888 1899 calls. These were a leftover from the GTK 1.x days, and can cause
1889 1900 problems in certain cases (after a report by John Hunter).
1890 1901
1891 1902 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
1892 1903 os.getcwd() fails at init time. Thanks to patch from David Remahl
1893 1904 <chmod007-AT-mac.com>.
1894 1905 (InteractiveShell.__init__): prevent certain special magics from
1895 1906 being shadowed by aliases. Closes
1896 1907 http://www.scipy.net/roundup/ipython/issue41.
1897 1908
1898 1909 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
1899 1910
1900 1911 * IPython/iplib.py (InteractiveShell.complete): Added new
1901 1912 top-level completion method to expose the completion mechanism
1902 1913 beyond readline-based environments.
1903 1914
1904 1915 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
1905 1916
1906 1917 * tools/ipsvnc (svnversion): fix svnversion capture.
1907 1918
1908 1919 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
1909 1920 attribute to self, which was missing. Before, it was set by a
1910 1921 routine which in certain cases wasn't being called, so the
1911 1922 instance could end up missing the attribute. This caused a crash.
1912 1923 Closes http://www.scipy.net/roundup/ipython/issue40.
1913 1924
1914 1925 2005-08-16 Fernando Perez <fperez@colorado.edu>
1915 1926
1916 1927 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
1917 1928 contains non-string attribute. Closes
1918 1929 http://www.scipy.net/roundup/ipython/issue38.
1919 1930
1920 1931 2005-08-14 Fernando Perez <fperez@colorado.edu>
1921 1932
1922 1933 * tools/ipsvnc: Minor improvements, to add changeset info.
1923 1934
1924 1935 2005-08-12 Fernando Perez <fperez@colorado.edu>
1925 1936
1926 1937 * IPython/iplib.py (runsource): remove self.code_to_run_src
1927 1938 attribute. I realized this is nothing more than
1928 1939 '\n'.join(self.buffer), and having the same data in two different
1929 1940 places is just asking for synchronization bugs. This may impact
1930 1941 people who have custom exception handlers, so I need to warn
1931 1942 ipython-dev about it (F. Mantegazza may use them).
1932 1943
1933 1944 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
1934 1945
1935 1946 * IPython/genutils.py: fix 2.2 compatibility (generators)
1936 1947
1937 1948 2005-07-18 Fernando Perez <fperez@colorado.edu>
1938 1949
1939 1950 * IPython/genutils.py (get_home_dir): fix to help users with
1940 1951 invalid $HOME under win32.
1941 1952
1942 1953 2005-07-17 Fernando Perez <fperez@colorado.edu>
1943 1954
1944 1955 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
1945 1956 some old hacks and clean up a bit other routines; code should be
1946 1957 simpler and a bit faster.
1947 1958
1948 1959 * IPython/iplib.py (interact): removed some last-resort attempts
1949 1960 to survive broken stdout/stderr. That code was only making it
1950 1961 harder to abstract out the i/o (necessary for gui integration),
1951 1962 and the crashes it could prevent were extremely rare in practice
1952 1963 (besides being fully user-induced in a pretty violent manner).
1953 1964
1954 1965 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
1955 1966 Nothing major yet, but the code is simpler to read; this should
1956 1967 make it easier to do more serious modifications in the future.
1957 1968
1958 1969 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
1959 1970 which broke in .15 (thanks to a report by Ville).
1960 1971
1961 1972 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1962 1973 be quite correct, I know next to nothing about unicode). This
1963 1974 will allow unicode strings to be used in prompts, amongst other
1964 1975 cases. It also will prevent ipython from crashing when unicode
1965 1976 shows up unexpectedly in many places. If ascii encoding fails, we
1966 1977 assume utf_8. Currently the encoding is not a user-visible
1967 1978 setting, though it could be made so if there is demand for it.
1968 1979
1969 1980 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1970 1981
1971 1982 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1972 1983
1973 1984 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1974 1985
1975 1986 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1976 1987 code can work transparently for 2.2/2.3.
1977 1988
1978 1989 2005-07-16 Fernando Perez <fperez@colorado.edu>
1979 1990
1980 1991 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1981 1992 out of the color scheme table used for coloring exception
1982 1993 tracebacks. This allows user code to add new schemes at runtime.
1983 1994 This is a minimally modified version of the patch at
1984 1995 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1985 1996 for the contribution.
1986 1997
1987 1998 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1988 1999 slightly modified version of the patch in
1989 2000 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1990 2001 to remove the previous try/except solution (which was costlier).
1991 2002 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1992 2003
1993 2004 2005-06-08 Fernando Perez <fperez@colorado.edu>
1994 2005
1995 2006 * IPython/iplib.py (write/write_err): Add methods to abstract all
1996 2007 I/O a bit more.
1997 2008
1998 2009 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1999 2010 warning, reported by Aric Hagberg, fix by JD Hunter.
2000 2011
2001 2012 2005-06-02 *** Released version 0.6.15
2002 2013
2003 2014 2005-06-01 Fernando Perez <fperez@colorado.edu>
2004 2015
2005 2016 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2006 2017 tab-completion of filenames within open-quoted strings. Note that
2007 2018 this requires that in ~/.ipython/ipythonrc, users change the
2008 2019 readline delimiters configuration to read:
2009 2020
2010 2021 readline_remove_delims -/~
2011 2022
2012 2023
2013 2024 2005-05-31 *** Released version 0.6.14
2014 2025
2015 2026 2005-05-29 Fernando Perez <fperez@colorado.edu>
2016 2027
2017 2028 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2018 2029 with files not on the filesystem. Reported by Eliyahu Sandler
2019 2030 <eli@gondolin.net>
2020 2031
2021 2032 2005-05-22 Fernando Perez <fperez@colorado.edu>
2022 2033
2023 2034 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2024 2035 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2025 2036
2026 2037 2005-05-19 Fernando Perez <fperez@colorado.edu>
2027 2038
2028 2039 * IPython/iplib.py (safe_execfile): close a file which could be
2029 2040 left open (causing problems in win32, which locks open files).
2030 2041 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2031 2042
2032 2043 2005-05-18 Fernando Perez <fperez@colorado.edu>
2033 2044
2034 2045 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2035 2046 keyword arguments correctly to safe_execfile().
2036 2047
2037 2048 2005-05-13 Fernando Perez <fperez@colorado.edu>
2038 2049
2039 2050 * ipython.1: Added info about Qt to manpage, and threads warning
2040 2051 to usage page (invoked with --help).
2041 2052
2042 2053 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2043 2054 new matcher (it goes at the end of the priority list) to do
2044 2055 tab-completion on named function arguments. Submitted by George
2045 2056 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2046 2057 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2047 2058 for more details.
2048 2059
2049 2060 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2050 2061 SystemExit exceptions in the script being run. Thanks to a report
2051 2062 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2052 2063 producing very annoying behavior when running unit tests.
2053 2064
2054 2065 2005-05-12 Fernando Perez <fperez@colorado.edu>
2055 2066
2056 2067 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2057 2068 which I'd broken (again) due to a changed regexp. In the process,
2058 2069 added ';' as an escape to auto-quote the whole line without
2059 2070 splitting its arguments. Thanks to a report by Jerry McRae
2060 2071 <qrs0xyc02-AT-sneakemail.com>.
2061 2072
2062 2073 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2063 2074 possible crashes caused by a TokenError. Reported by Ed Schofield
2064 2075 <schofield-AT-ftw.at>.
2065 2076
2066 2077 2005-05-06 Fernando Perez <fperez@colorado.edu>
2067 2078
2068 2079 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2069 2080
2070 2081 2005-04-29 Fernando Perez <fperez@colorado.edu>
2071 2082
2072 2083 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2073 2084 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2074 2085 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2075 2086 which provides support for Qt interactive usage (similar to the
2076 2087 existing one for WX and GTK). This had been often requested.
2077 2088
2078 2089 2005-04-14 *** Released version 0.6.13
2079 2090
2080 2091 2005-04-08 Fernando Perez <fperez@colorado.edu>
2081 2092
2082 2093 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2083 2094 from _ofind, which gets called on almost every input line. Now,
2084 2095 we only try to get docstrings if they are actually going to be
2085 2096 used (the overhead of fetching unnecessary docstrings can be
2086 2097 noticeable for certain objects, such as Pyro proxies).
2087 2098
2088 2099 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2089 2100 for completers. For some reason I had been passing them the state
2090 2101 variable, which completers never actually need, and was in
2091 2102 conflict with the rlcompleter API. Custom completers ONLY need to
2092 2103 take the text parameter.
2093 2104
2094 2105 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2095 2106 work correctly in pysh. I've also moved all the logic which used
2096 2107 to be in pysh.py here, which will prevent problems with future
2097 2108 upgrades. However, this time I must warn users to update their
2098 2109 pysh profile to include the line
2099 2110
2100 2111 import_all IPython.Extensions.InterpreterExec
2101 2112
2102 2113 because otherwise things won't work for them. They MUST also
2103 2114 delete pysh.py and the line
2104 2115
2105 2116 execfile pysh.py
2106 2117
2107 2118 from their ipythonrc-pysh.
2108 2119
2109 2120 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2110 2121 robust in the face of objects whose dir() returns non-strings
2111 2122 (which it shouldn't, but some broken libs like ITK do). Thanks to
2112 2123 a patch by John Hunter (implemented differently, though). Also
2113 2124 minor improvements by using .extend instead of + on lists.
2114 2125
2115 2126 * pysh.py:
2116 2127
2117 2128 2005-04-06 Fernando Perez <fperez@colorado.edu>
2118 2129
2119 2130 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2120 2131 by default, so that all users benefit from it. Those who don't
2121 2132 want it can still turn it off.
2122 2133
2123 2134 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2124 2135 config file, I'd forgotten about this, so users were getting it
2125 2136 off by default.
2126 2137
2127 2138 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2128 2139 consistency. Now magics can be called in multiline statements,
2129 2140 and python variables can be expanded in magic calls via $var.
2130 2141 This makes the magic system behave just like aliases or !system
2131 2142 calls.
2132 2143
2133 2144 2005-03-28 Fernando Perez <fperez@colorado.edu>
2134 2145
2135 2146 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2136 2147 expensive string additions for building command. Add support for
2137 2148 trailing ';' when autocall is used.
2138 2149
2139 2150 2005-03-26 Fernando Perez <fperez@colorado.edu>
2140 2151
2141 2152 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2142 2153 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2143 2154 ipython.el robust against prompts with any number of spaces
2144 2155 (including 0) after the ':' character.
2145 2156
2146 2157 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2147 2158 continuation prompt, which misled users to think the line was
2148 2159 already indented. Closes debian Bug#300847, reported to me by
2149 2160 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2150 2161
2151 2162 2005-03-23 Fernando Perez <fperez@colorado.edu>
2152 2163
2153 2164 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2154 2165 properly aligned if they have embedded newlines.
2155 2166
2156 2167 * IPython/iplib.py (runlines): Add a public method to expose
2157 2168 IPython's code execution machinery, so that users can run strings
2158 2169 as if they had been typed at the prompt interactively.
2159 2170 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2160 2171 methods which can call the system shell, but with python variable
2161 2172 expansion. The three such methods are: __IPYTHON__.system,
2162 2173 .getoutput and .getoutputerror. These need to be documented in a
2163 2174 'public API' section (to be written) of the manual.
2164 2175
2165 2176 2005-03-20 Fernando Perez <fperez@colorado.edu>
2166 2177
2167 2178 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2168 2179 for custom exception handling. This is quite powerful, and it
2169 2180 allows for user-installable exception handlers which can trap
2170 2181 custom exceptions at runtime and treat them separately from
2171 2182 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2172 2183 Mantegazza <mantegazza-AT-ill.fr>.
2173 2184 (InteractiveShell.set_custom_completer): public API function to
2174 2185 add new completers at runtime.
2175 2186
2176 2187 2005-03-19 Fernando Perez <fperez@colorado.edu>
2177 2188
2178 2189 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2179 2190 allow objects which provide their docstrings via non-standard
2180 2191 mechanisms (like Pyro proxies) to still be inspected by ipython's
2181 2192 ? system.
2182 2193
2183 2194 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2184 2195 automatic capture system. I tried quite hard to make it work
2185 2196 reliably, and simply failed. I tried many combinations with the
2186 2197 subprocess module, but eventually nothing worked in all needed
2187 2198 cases (not blocking stdin for the child, duplicating stdout
2188 2199 without blocking, etc). The new %sc/%sx still do capture to these
2189 2200 magical list/string objects which make shell use much more
2190 2201 conveninent, so not all is lost.
2191 2202
2192 2203 XXX - FIX MANUAL for the change above!
2193 2204
2194 2205 (runsource): I copied code.py's runsource() into ipython to modify
2195 2206 it a bit. Now the code object and source to be executed are
2196 2207 stored in ipython. This makes this info accessible to third-party
2197 2208 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2198 2209 Mantegazza <mantegazza-AT-ill.fr>.
2199 2210
2200 2211 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2201 2212 history-search via readline (like C-p/C-n). I'd wanted this for a
2202 2213 long time, but only recently found out how to do it. For users
2203 2214 who already have their ipythonrc files made and want this, just
2204 2215 add:
2205 2216
2206 2217 readline_parse_and_bind "\e[A": history-search-backward
2207 2218 readline_parse_and_bind "\e[B": history-search-forward
2208 2219
2209 2220 2005-03-18 Fernando Perez <fperez@colorado.edu>
2210 2221
2211 2222 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2212 2223 LSString and SList classes which allow transparent conversions
2213 2224 between list mode and whitespace-separated string.
2214 2225 (magic_r): Fix recursion problem in %r.
2215 2226
2216 2227 * IPython/genutils.py (LSString): New class to be used for
2217 2228 automatic storage of the results of all alias/system calls in _o
2218 2229 and _e (stdout/err). These provide a .l/.list attribute which
2219 2230 does automatic splitting on newlines. This means that for most
2220 2231 uses, you'll never need to do capturing of output with %sc/%sx
2221 2232 anymore, since ipython keeps this always done for you. Note that
2222 2233 only the LAST results are stored, the _o/e variables are
2223 2234 overwritten on each call. If you need to save their contents
2224 2235 further, simply bind them to any other name.
2225 2236
2226 2237 2005-03-17 Fernando Perez <fperez@colorado.edu>
2227 2238
2228 2239 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2229 2240 prompt namespace handling.
2230 2241
2231 2242 2005-03-16 Fernando Perez <fperez@colorado.edu>
2232 2243
2233 2244 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2234 2245 classic prompts to be '>>> ' (final space was missing, and it
2235 2246 trips the emacs python mode).
2236 2247 (BasePrompt.__str__): Added safe support for dynamic prompt
2237 2248 strings. Now you can set your prompt string to be '$x', and the
2238 2249 value of x will be printed from your interactive namespace. The
2239 2250 interpolation syntax includes the full Itpl support, so
2240 2251 ${foo()+x+bar()} is a valid prompt string now, and the function
2241 2252 calls will be made at runtime.
2242 2253
2243 2254 2005-03-15 Fernando Perez <fperez@colorado.edu>
2244 2255
2245 2256 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2246 2257 avoid name clashes in pylab. %hist still works, it just forwards
2247 2258 the call to %history.
2248 2259
2249 2260 2005-03-02 *** Released version 0.6.12
2250 2261
2251 2262 2005-03-02 Fernando Perez <fperez@colorado.edu>
2252 2263
2253 2264 * IPython/iplib.py (handle_magic): log magic calls properly as
2254 2265 ipmagic() function calls.
2255 2266
2256 2267 * IPython/Magic.py (magic_time): Improved %time to support
2257 2268 statements and provide wall-clock as well as CPU time.
2258 2269
2259 2270 2005-02-27 Fernando Perez <fperez@colorado.edu>
2260 2271
2261 2272 * IPython/hooks.py: New hooks module, to expose user-modifiable
2262 2273 IPython functionality in a clean manner. For now only the editor
2263 2274 hook is actually written, and other thigns which I intend to turn
2264 2275 into proper hooks aren't yet there. The display and prefilter
2265 2276 stuff, for example, should be hooks. But at least now the
2266 2277 framework is in place, and the rest can be moved here with more
2267 2278 time later. IPython had had a .hooks variable for a long time for
2268 2279 this purpose, but I'd never actually used it for anything.
2269 2280
2270 2281 2005-02-26 Fernando Perez <fperez@colorado.edu>
2271 2282
2272 2283 * IPython/ipmaker.py (make_IPython): make the default ipython
2273 2284 directory be called _ipython under win32, to follow more the
2274 2285 naming peculiarities of that platform (where buggy software like
2275 2286 Visual Sourcesafe breaks with .named directories). Reported by
2276 2287 Ville Vainio.
2277 2288
2278 2289 2005-02-23 Fernando Perez <fperez@colorado.edu>
2279 2290
2280 2291 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2281 2292 auto_aliases for win32 which were causing problems. Users can
2282 2293 define the ones they personally like.
2283 2294
2284 2295 2005-02-21 Fernando Perez <fperez@colorado.edu>
2285 2296
2286 2297 * IPython/Magic.py (magic_time): new magic to time execution of
2287 2298 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2288 2299
2289 2300 2005-02-19 Fernando Perez <fperez@colorado.edu>
2290 2301
2291 2302 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2292 2303 into keys (for prompts, for example).
2293 2304
2294 2305 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2295 2306 prompts in case users want them. This introduces a small behavior
2296 2307 change: ipython does not automatically add a space to all prompts
2297 2308 anymore. To get the old prompts with a space, users should add it
2298 2309 manually to their ipythonrc file, so for example prompt_in1 should
2299 2310 now read 'In [\#]: ' instead of 'In [\#]:'.
2300 2311 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2301 2312 file) to control left-padding of secondary prompts.
2302 2313
2303 2314 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2304 2315 the profiler can't be imported. Fix for Debian, which removed
2305 2316 profile.py because of License issues. I applied a slightly
2306 2317 modified version of the original Debian patch at
2307 2318 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2308 2319
2309 2320 2005-02-17 Fernando Perez <fperez@colorado.edu>
2310 2321
2311 2322 * IPython/genutils.py (native_line_ends): Fix bug which would
2312 2323 cause improper line-ends under win32 b/c I was not opening files
2313 2324 in binary mode. Bug report and fix thanks to Ville.
2314 2325
2315 2326 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2316 2327 trying to catch spurious foo[1] autocalls. My fix actually broke
2317 2328 ',/' autoquote/call with explicit escape (bad regexp).
2318 2329
2319 2330 2005-02-15 *** Released version 0.6.11
2320 2331
2321 2332 2005-02-14 Fernando Perez <fperez@colorado.edu>
2322 2333
2323 2334 * IPython/background_jobs.py: New background job management
2324 2335 subsystem. This is implemented via a new set of classes, and
2325 2336 IPython now provides a builtin 'jobs' object for background job
2326 2337 execution. A convenience %bg magic serves as a lightweight
2327 2338 frontend for starting the more common type of calls. This was
2328 2339 inspired by discussions with B. Granger and the BackgroundCommand
2329 2340 class described in the book Python Scripting for Computational
2330 2341 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2331 2342 (although ultimately no code from this text was used, as IPython's
2332 2343 system is a separate implementation).
2333 2344
2334 2345 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2335 2346 to control the completion of single/double underscore names
2336 2347 separately. As documented in the example ipytonrc file, the
2337 2348 readline_omit__names variable can now be set to 2, to omit even
2338 2349 single underscore names. Thanks to a patch by Brian Wong
2339 2350 <BrianWong-AT-AirgoNetworks.Com>.
2340 2351 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2341 2352 be autocalled as foo([1]) if foo were callable. A problem for
2342 2353 things which are both callable and implement __getitem__.
2343 2354 (init_readline): Fix autoindentation for win32. Thanks to a patch
2344 2355 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2345 2356
2346 2357 2005-02-12 Fernando Perez <fperez@colorado.edu>
2347 2358
2348 2359 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2349 2360 which I had written long ago to sort out user error messages which
2350 2361 may occur during startup. This seemed like a good idea initially,
2351 2362 but it has proven a disaster in retrospect. I don't want to
2352 2363 change much code for now, so my fix is to set the internal 'debug'
2353 2364 flag to true everywhere, whose only job was precisely to control
2354 2365 this subsystem. This closes issue 28 (as well as avoiding all
2355 2366 sorts of strange hangups which occur from time to time).
2356 2367
2357 2368 2005-02-07 Fernando Perez <fperez@colorado.edu>
2358 2369
2359 2370 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2360 2371 previous call produced a syntax error.
2361 2372
2362 2373 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2363 2374 classes without constructor.
2364 2375
2365 2376 2005-02-06 Fernando Perez <fperez@colorado.edu>
2366 2377
2367 2378 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2368 2379 completions with the results of each matcher, so we return results
2369 2380 to the user from all namespaces. This breaks with ipython
2370 2381 tradition, but I think it's a nicer behavior. Now you get all
2371 2382 possible completions listed, from all possible namespaces (python,
2372 2383 filesystem, magics...) After a request by John Hunter
2373 2384 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2374 2385
2375 2386 2005-02-05 Fernando Perez <fperez@colorado.edu>
2376 2387
2377 2388 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2378 2389 the call had quote characters in it (the quotes were stripped).
2379 2390
2380 2391 2005-01-31 Fernando Perez <fperez@colorado.edu>
2381 2392
2382 2393 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2383 2394 Itpl.itpl() to make the code more robust against psyco
2384 2395 optimizations.
2385 2396
2386 2397 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2387 2398 of causing an exception. Quicker, cleaner.
2388 2399
2389 2400 2005-01-28 Fernando Perez <fperez@colorado.edu>
2390 2401
2391 2402 * scripts/ipython_win_post_install.py (install): hardcode
2392 2403 sys.prefix+'python.exe' as the executable path. It turns out that
2393 2404 during the post-installation run, sys.executable resolves to the
2394 2405 name of the binary installer! I should report this as a distutils
2395 2406 bug, I think. I updated the .10 release with this tiny fix, to
2396 2407 avoid annoying the lists further.
2397 2408
2398 2409 2005-01-27 *** Released version 0.6.10
2399 2410
2400 2411 2005-01-27 Fernando Perez <fperez@colorado.edu>
2401 2412
2402 2413 * IPython/numutils.py (norm): Added 'inf' as optional name for
2403 2414 L-infinity norm, included references to mathworld.com for vector
2404 2415 norm definitions.
2405 2416 (amin/amax): added amin/amax for array min/max. Similar to what
2406 2417 pylab ships with after the recent reorganization of names.
2407 2418 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2408 2419
2409 2420 * ipython.el: committed Alex's recent fixes and improvements.
2410 2421 Tested with python-mode from CVS, and it looks excellent. Since
2411 2422 python-mode hasn't released anything in a while, I'm temporarily
2412 2423 putting a copy of today's CVS (v 4.70) of python-mode in:
2413 2424 http://ipython.scipy.org/tmp/python-mode.el
2414 2425
2415 2426 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2416 2427 sys.executable for the executable name, instead of assuming it's
2417 2428 called 'python.exe' (the post-installer would have produced broken
2418 2429 setups on systems with a differently named python binary).
2419 2430
2420 2431 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2421 2432 references to os.linesep, to make the code more
2422 2433 platform-independent. This is also part of the win32 coloring
2423 2434 fixes.
2424 2435
2425 2436 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2426 2437 lines, which actually cause coloring bugs because the length of
2427 2438 the line is very difficult to correctly compute with embedded
2428 2439 escapes. This was the source of all the coloring problems under
2429 2440 Win32. I think that _finally_, Win32 users have a properly
2430 2441 working ipython in all respects. This would never have happened
2431 2442 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2432 2443
2433 2444 2005-01-26 *** Released version 0.6.9
2434 2445
2435 2446 2005-01-25 Fernando Perez <fperez@colorado.edu>
2436 2447
2437 2448 * setup.py: finally, we have a true Windows installer, thanks to
2438 2449 the excellent work of Viktor Ransmayr
2439 2450 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2440 2451 Windows users. The setup routine is quite a bit cleaner thanks to
2441 2452 this, and the post-install script uses the proper functions to
2442 2453 allow a clean de-installation using the standard Windows Control
2443 2454 Panel.
2444 2455
2445 2456 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2446 2457 environment variable under all OSes (including win32) if
2447 2458 available. This will give consistency to win32 users who have set
2448 2459 this variable for any reason. If os.environ['HOME'] fails, the
2449 2460 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2450 2461
2451 2462 2005-01-24 Fernando Perez <fperez@colorado.edu>
2452 2463
2453 2464 * IPython/numutils.py (empty_like): add empty_like(), similar to
2454 2465 zeros_like() but taking advantage of the new empty() Numeric routine.
2455 2466
2456 2467 2005-01-23 *** Released version 0.6.8
2457 2468
2458 2469 2005-01-22 Fernando Perez <fperez@colorado.edu>
2459 2470
2460 2471 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2461 2472 automatic show() calls. After discussing things with JDH, it
2462 2473 turns out there are too many corner cases where this can go wrong.
2463 2474 It's best not to try to be 'too smart', and simply have ipython
2464 2475 reproduce as much as possible the default behavior of a normal
2465 2476 python shell.
2466 2477
2467 2478 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2468 2479 line-splitting regexp and _prefilter() to avoid calling getattr()
2469 2480 on assignments. This closes
2470 2481 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2471 2482 readline uses getattr(), so a simple <TAB> keypress is still
2472 2483 enough to trigger getattr() calls on an object.
2473 2484
2474 2485 2005-01-21 Fernando Perez <fperez@colorado.edu>
2475 2486
2476 2487 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2477 2488 docstring under pylab so it doesn't mask the original.
2478 2489
2479 2490 2005-01-21 *** Released version 0.6.7
2480 2491
2481 2492 2005-01-21 Fernando Perez <fperez@colorado.edu>
2482 2493
2483 2494 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2484 2495 signal handling for win32 users in multithreaded mode.
2485 2496
2486 2497 2005-01-17 Fernando Perez <fperez@colorado.edu>
2487 2498
2488 2499 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2489 2500 instances with no __init__. After a crash report by Norbert Nemec
2490 2501 <Norbert-AT-nemec-online.de>.
2491 2502
2492 2503 2005-01-14 Fernando Perez <fperez@colorado.edu>
2493 2504
2494 2505 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2495 2506 names for verbose exceptions, when multiple dotted names and the
2496 2507 'parent' object were present on the same line.
2497 2508
2498 2509 2005-01-11 Fernando Perez <fperez@colorado.edu>
2499 2510
2500 2511 * IPython/genutils.py (flag_calls): new utility to trap and flag
2501 2512 calls in functions. I need it to clean up matplotlib support.
2502 2513 Also removed some deprecated code in genutils.
2503 2514
2504 2515 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2505 2516 that matplotlib scripts called with %run, which don't call show()
2506 2517 themselves, still have their plotting windows open.
2507 2518
2508 2519 2005-01-05 Fernando Perez <fperez@colorado.edu>
2509 2520
2510 2521 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2511 2522 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2512 2523
2513 2524 2004-12-19 Fernando Perez <fperez@colorado.edu>
2514 2525
2515 2526 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2516 2527 parent_runcode, which was an eyesore. The same result can be
2517 2528 obtained with Python's regular superclass mechanisms.
2518 2529
2519 2530 2004-12-17 Fernando Perez <fperez@colorado.edu>
2520 2531
2521 2532 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2522 2533 reported by Prabhu.
2523 2534 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2524 2535 sys.stderr) instead of explicitly calling sys.stderr. This helps
2525 2536 maintain our I/O abstractions clean, for future GUI embeddings.
2526 2537
2527 2538 * IPython/genutils.py (info): added new utility for sys.stderr
2528 2539 unified info message handling (thin wrapper around warn()).
2529 2540
2530 2541 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2531 2542 composite (dotted) names on verbose exceptions.
2532 2543 (VerboseTB.nullrepr): harden against another kind of errors which
2533 2544 Python's inspect module can trigger, and which were crashing
2534 2545 IPython. Thanks to a report by Marco Lombardi
2535 2546 <mlombard-AT-ma010192.hq.eso.org>.
2536 2547
2537 2548 2004-12-13 *** Released version 0.6.6
2538 2549
2539 2550 2004-12-12 Fernando Perez <fperez@colorado.edu>
2540 2551
2541 2552 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2542 2553 generated by pygtk upon initialization if it was built without
2543 2554 threads (for matplotlib users). After a crash reported by
2544 2555 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2545 2556
2546 2557 * IPython/ipmaker.py (make_IPython): fix small bug in the
2547 2558 import_some parameter for multiple imports.
2548 2559
2549 2560 * IPython/iplib.py (ipmagic): simplified the interface of
2550 2561 ipmagic() to take a single string argument, just as it would be
2551 2562 typed at the IPython cmd line.
2552 2563 (ipalias): Added new ipalias() with an interface identical to
2553 2564 ipmagic(). This completes exposing a pure python interface to the
2554 2565 alias and magic system, which can be used in loops or more complex
2555 2566 code where IPython's automatic line mangling is not active.
2556 2567
2557 2568 * IPython/genutils.py (timing): changed interface of timing to
2558 2569 simply run code once, which is the most common case. timings()
2559 2570 remains unchanged, for the cases where you want multiple runs.
2560 2571
2561 2572 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2562 2573 bug where Python2.2 crashes with exec'ing code which does not end
2563 2574 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2564 2575 before.
2565 2576
2566 2577 2004-12-10 Fernando Perez <fperez@colorado.edu>
2567 2578
2568 2579 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2569 2580 -t to -T, to accomodate the new -t flag in %run (the %run and
2570 2581 %prun options are kind of intermixed, and it's not easy to change
2571 2582 this with the limitations of python's getopt).
2572 2583
2573 2584 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2574 2585 the execution of scripts. It's not as fine-tuned as timeit.py,
2575 2586 but it works from inside ipython (and under 2.2, which lacks
2576 2587 timeit.py). Optionally a number of runs > 1 can be given for
2577 2588 timing very short-running code.
2578 2589
2579 2590 * IPython/genutils.py (uniq_stable): new routine which returns a
2580 2591 list of unique elements in any iterable, but in stable order of
2581 2592 appearance. I needed this for the ultraTB fixes, and it's a handy
2582 2593 utility.
2583 2594
2584 2595 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2585 2596 dotted names in Verbose exceptions. This had been broken since
2586 2597 the very start, now x.y will properly be printed in a Verbose
2587 2598 traceback, instead of x being shown and y appearing always as an
2588 2599 'undefined global'. Getting this to work was a bit tricky,
2589 2600 because by default python tokenizers are stateless. Saved by
2590 2601 python's ability to easily add a bit of state to an arbitrary
2591 2602 function (without needing to build a full-blown callable object).
2592 2603
2593 2604 Also big cleanup of this code, which had horrendous runtime
2594 2605 lookups of zillions of attributes for colorization. Moved all
2595 2606 this code into a few templates, which make it cleaner and quicker.
2596 2607
2597 2608 Printout quality was also improved for Verbose exceptions: one
2598 2609 variable per line, and memory addresses are printed (this can be
2599 2610 quite handy in nasty debugging situations, which is what Verbose
2600 2611 is for).
2601 2612
2602 2613 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
2603 2614 the command line as scripts to be loaded by embedded instances.
2604 2615 Doing so has the potential for an infinite recursion if there are
2605 2616 exceptions thrown in the process. This fixes a strange crash
2606 2617 reported by Philippe MULLER <muller-AT-irit.fr>.
2607 2618
2608 2619 2004-12-09 Fernando Perez <fperez@colorado.edu>
2609 2620
2610 2621 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
2611 2622 to reflect new names in matplotlib, which now expose the
2612 2623 matlab-compatible interface via a pylab module instead of the
2613 2624 'matlab' name. The new code is backwards compatible, so users of
2614 2625 all matplotlib versions are OK. Patch by J. Hunter.
2615 2626
2616 2627 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
2617 2628 of __init__ docstrings for instances (class docstrings are already
2618 2629 automatically printed). Instances with customized docstrings
2619 2630 (indep. of the class) are also recognized and all 3 separate
2620 2631 docstrings are printed (instance, class, constructor). After some
2621 2632 comments/suggestions by J. Hunter.
2622 2633
2623 2634 2004-12-05 Fernando Perez <fperez@colorado.edu>
2624 2635
2625 2636 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
2626 2637 warnings when tab-completion fails and triggers an exception.
2627 2638
2628 2639 2004-12-03 Fernando Perez <fperez@colorado.edu>
2629 2640
2630 2641 * IPython/Magic.py (magic_prun): Fix bug where an exception would
2631 2642 be triggered when using 'run -p'. An incorrect option flag was
2632 2643 being set ('d' instead of 'D').
2633 2644 (manpage): fix missing escaped \- sign.
2634 2645
2635 2646 2004-11-30 *** Released version 0.6.5
2636 2647
2637 2648 2004-11-30 Fernando Perez <fperez@colorado.edu>
2638 2649
2639 2650 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
2640 2651 setting with -d option.
2641 2652
2642 2653 * setup.py (docfiles): Fix problem where the doc glob I was using
2643 2654 was COMPLETELY BROKEN. It was giving the right files by pure
2644 2655 accident, but failed once I tried to include ipython.el. Note:
2645 2656 glob() does NOT allow you to do exclusion on multiple endings!
2646 2657
2647 2658 2004-11-29 Fernando Perez <fperez@colorado.edu>
2648 2659
2649 2660 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
2650 2661 the manpage as the source. Better formatting & consistency.
2651 2662
2652 2663 * IPython/Magic.py (magic_run): Added new -d option, to run
2653 2664 scripts under the control of the python pdb debugger. Note that
2654 2665 this required changing the %prun option -d to -D, to avoid a clash
2655 2666 (since %run must pass options to %prun, and getopt is too dumb to
2656 2667 handle options with string values with embedded spaces). Thanks
2657 2668 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
2658 2669 (magic_who_ls): added type matching to %who and %whos, so that one
2659 2670 can filter their output to only include variables of certain
2660 2671 types. Another suggestion by Matthew.
2661 2672 (magic_whos): Added memory summaries in kb and Mb for arrays.
2662 2673 (magic_who): Improve formatting (break lines every 9 vars).
2663 2674
2664 2675 2004-11-28 Fernando Perez <fperez@colorado.edu>
2665 2676
2666 2677 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
2667 2678 cache when empty lines were present.
2668 2679
2669 2680 2004-11-24 Fernando Perez <fperez@colorado.edu>
2670 2681
2671 2682 * IPython/usage.py (__doc__): document the re-activated threading
2672 2683 options for WX and GTK.
2673 2684
2674 2685 2004-11-23 Fernando Perez <fperez@colorado.edu>
2675 2686
2676 2687 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
2677 2688 the -wthread and -gthread options, along with a new -tk one to try
2678 2689 and coordinate Tk threading with wx/gtk. The tk support is very
2679 2690 platform dependent, since it seems to require Tcl and Tk to be
2680 2691 built with threads (Fedora1/2 appears NOT to have it, but in
2681 2692 Prabhu's Debian boxes it works OK). But even with some Tk
2682 2693 limitations, this is a great improvement.
2683 2694
2684 2695 * IPython/Prompts.py (prompt_specials_color): Added \t for time
2685 2696 info in user prompts. Patch by Prabhu.
2686 2697
2687 2698 2004-11-18 Fernando Perez <fperez@colorado.edu>
2688 2699
2689 2700 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
2690 2701 EOFErrors and bail, to avoid infinite loops if a non-terminating
2691 2702 file is fed into ipython. Patch submitted in issue 19 by user,
2692 2703 many thanks.
2693 2704
2694 2705 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
2695 2706 autoquote/parens in continuation prompts, which can cause lots of
2696 2707 problems. Closes roundup issue 20.
2697 2708
2698 2709 2004-11-17 Fernando Perez <fperez@colorado.edu>
2699 2710
2700 2711 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
2701 2712 reported as debian bug #280505. I'm not sure my local changelog
2702 2713 entry has the proper debian format (Jack?).
2703 2714
2704 2715 2004-11-08 *** Released version 0.6.4
2705 2716
2706 2717 2004-11-08 Fernando Perez <fperez@colorado.edu>
2707 2718
2708 2719 * IPython/iplib.py (init_readline): Fix exit message for Windows
2709 2720 when readline is active. Thanks to a report by Eric Jones
2710 2721 <eric-AT-enthought.com>.
2711 2722
2712 2723 2004-11-07 Fernando Perez <fperez@colorado.edu>
2713 2724
2714 2725 * IPython/genutils.py (page): Add a trap for OSError exceptions,
2715 2726 sometimes seen by win2k/cygwin users.
2716 2727
2717 2728 2004-11-06 Fernando Perez <fperez@colorado.edu>
2718 2729
2719 2730 * IPython/iplib.py (interact): Change the handling of %Exit from
2720 2731 trying to propagate a SystemExit to an internal ipython flag.
2721 2732 This is less elegant than using Python's exception mechanism, but
2722 2733 I can't get that to work reliably with threads, so under -pylab
2723 2734 %Exit was hanging IPython. Cross-thread exception handling is
2724 2735 really a bitch. Thaks to a bug report by Stephen Walton
2725 2736 <stephen.walton-AT-csun.edu>.
2726 2737
2727 2738 2004-11-04 Fernando Perez <fperez@colorado.edu>
2728 2739
2729 2740 * IPython/iplib.py (raw_input_original): store a pointer to the
2730 2741 true raw_input to harden against code which can modify it
2731 2742 (wx.py.PyShell does this and would otherwise crash ipython).
2732 2743 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
2733 2744
2734 2745 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
2735 2746 Ctrl-C problem, which does not mess up the input line.
2736 2747
2737 2748 2004-11-03 Fernando Perez <fperez@colorado.edu>
2738 2749
2739 2750 * IPython/Release.py: Changed licensing to BSD, in all files.
2740 2751 (name): lowercase name for tarball/RPM release.
2741 2752
2742 2753 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
2743 2754 use throughout ipython.
2744 2755
2745 2756 * IPython/Magic.py (Magic._ofind): Switch to using the new
2746 2757 OInspect.getdoc() function.
2747 2758
2748 2759 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
2749 2760 of the line currently being canceled via Ctrl-C. It's extremely
2750 2761 ugly, but I don't know how to do it better (the problem is one of
2751 2762 handling cross-thread exceptions).
2752 2763
2753 2764 2004-10-28 Fernando Perez <fperez@colorado.edu>
2754 2765
2755 2766 * IPython/Shell.py (signal_handler): add signal handlers to trap
2756 2767 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
2757 2768 report by Francesc Alted.
2758 2769
2759 2770 2004-10-21 Fernando Perez <fperez@colorado.edu>
2760 2771
2761 2772 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
2762 2773 to % for pysh syntax extensions.
2763 2774
2764 2775 2004-10-09 Fernando Perez <fperez@colorado.edu>
2765 2776
2766 2777 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
2767 2778 arrays to print a more useful summary, without calling str(arr).
2768 2779 This avoids the problem of extremely lengthy computations which
2769 2780 occur if arr is large, and appear to the user as a system lockup
2770 2781 with 100% cpu activity. After a suggestion by Kristian Sandberg
2771 2782 <Kristian.Sandberg@colorado.edu>.
2772 2783 (Magic.__init__): fix bug in global magic escapes not being
2773 2784 correctly set.
2774 2785
2775 2786 2004-10-08 Fernando Perez <fperez@colorado.edu>
2776 2787
2777 2788 * IPython/Magic.py (__license__): change to absolute imports of
2778 2789 ipython's own internal packages, to start adapting to the absolute
2779 2790 import requirement of PEP-328.
2780 2791
2781 2792 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
2782 2793 files, and standardize author/license marks through the Release
2783 2794 module instead of having per/file stuff (except for files with
2784 2795 particular licenses, like the MIT/PSF-licensed codes).
2785 2796
2786 2797 * IPython/Debugger.py: remove dead code for python 2.1
2787 2798
2788 2799 2004-10-04 Fernando Perez <fperez@colorado.edu>
2789 2800
2790 2801 * IPython/iplib.py (ipmagic): New function for accessing magics
2791 2802 via a normal python function call.
2792 2803
2793 2804 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
2794 2805 from '@' to '%', to accomodate the new @decorator syntax of python
2795 2806 2.4.
2796 2807
2797 2808 2004-09-29 Fernando Perez <fperez@colorado.edu>
2798 2809
2799 2810 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
2800 2811 matplotlib.use to prevent running scripts which try to switch
2801 2812 interactive backends from within ipython. This will just crash
2802 2813 the python interpreter, so we can't allow it (but a detailed error
2803 2814 is given to the user).
2804 2815
2805 2816 2004-09-28 Fernando Perez <fperez@colorado.edu>
2806 2817
2807 2818 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
2808 2819 matplotlib-related fixes so that using @run with non-matplotlib
2809 2820 scripts doesn't pop up spurious plot windows. This requires
2810 2821 matplotlib >= 0.63, where I had to make some changes as well.
2811 2822
2812 2823 * IPython/ipmaker.py (make_IPython): update version requirement to
2813 2824 python 2.2.
2814 2825
2815 2826 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
2816 2827 banner arg for embedded customization.
2817 2828
2818 2829 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
2819 2830 explicit uses of __IP as the IPython's instance name. Now things
2820 2831 are properly handled via the shell.name value. The actual code
2821 2832 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
2822 2833 is much better than before. I'll clean things completely when the
2823 2834 magic stuff gets a real overhaul.
2824 2835
2825 2836 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
2826 2837 minor changes to debian dir.
2827 2838
2828 2839 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
2829 2840 pointer to the shell itself in the interactive namespace even when
2830 2841 a user-supplied dict is provided. This is needed for embedding
2831 2842 purposes (found by tests with Michel Sanner).
2832 2843
2833 2844 2004-09-27 Fernando Perez <fperez@colorado.edu>
2834 2845
2835 2846 * IPython/UserConfig/ipythonrc: remove []{} from
2836 2847 readline_remove_delims, so that things like [modname.<TAB> do
2837 2848 proper completion. This disables [].TAB, but that's a less common
2838 2849 case than module names in list comprehensions, for example.
2839 2850 Thanks to a report by Andrea Riciputi.
2840 2851
2841 2852 2004-09-09 Fernando Perez <fperez@colorado.edu>
2842 2853
2843 2854 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
2844 2855 blocking problems in win32 and osx. Fix by John.
2845 2856
2846 2857 2004-09-08 Fernando Perez <fperez@colorado.edu>
2847 2858
2848 2859 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
2849 2860 for Win32 and OSX. Fix by John Hunter.
2850 2861
2851 2862 2004-08-30 *** Released version 0.6.3
2852 2863
2853 2864 2004-08-30 Fernando Perez <fperez@colorado.edu>
2854 2865
2855 2866 * setup.py (isfile): Add manpages to list of dependent files to be
2856 2867 updated.
2857 2868
2858 2869 2004-08-27 Fernando Perez <fperez@colorado.edu>
2859 2870
2860 2871 * IPython/Shell.py (start): I've disabled -wthread and -gthread
2861 2872 for now. They don't really work with standalone WX/GTK code
2862 2873 (though matplotlib IS working fine with both of those backends).
2863 2874 This will neeed much more testing. I disabled most things with
2864 2875 comments, so turning it back on later should be pretty easy.
2865 2876
2866 2877 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
2867 2878 autocalling of expressions like r'foo', by modifying the line
2868 2879 split regexp. Closes
2869 2880 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
2870 2881 Riley <ipythonbugs-AT-sabi.net>.
2871 2882 (InteractiveShell.mainloop): honor --nobanner with banner
2872 2883 extensions.
2873 2884
2874 2885 * IPython/Shell.py: Significant refactoring of all classes, so
2875 2886 that we can really support ALL matplotlib backends and threading
2876 2887 models (John spotted a bug with Tk which required this). Now we
2877 2888 should support single-threaded, WX-threads and GTK-threads, both
2878 2889 for generic code and for matplotlib.
2879 2890
2880 2891 * IPython/ipmaker.py (__call__): Changed -mpthread option to
2881 2892 -pylab, to simplify things for users. Will also remove the pylab
2882 2893 profile, since now all of matplotlib configuration is directly
2883 2894 handled here. This also reduces startup time.
2884 2895
2885 2896 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
2886 2897 shell wasn't being correctly called. Also in IPShellWX.
2887 2898
2888 2899 * IPython/iplib.py (InteractiveShell.__init__): Added option to
2889 2900 fine-tune banner.
2890 2901
2891 2902 * IPython/numutils.py (spike): Deprecate these spike functions,
2892 2903 delete (long deprecated) gnuplot_exec handler.
2893 2904
2894 2905 2004-08-26 Fernando Perez <fperez@colorado.edu>
2895 2906
2896 2907 * ipython.1: Update for threading options, plus some others which
2897 2908 were missing.
2898 2909
2899 2910 * IPython/ipmaker.py (__call__): Added -wthread option for
2900 2911 wxpython thread handling. Make sure threading options are only
2901 2912 valid at the command line.
2902 2913
2903 2914 * scripts/ipython: moved shell selection into a factory function
2904 2915 in Shell.py, to keep the starter script to a minimum.
2905 2916
2906 2917 2004-08-25 Fernando Perez <fperez@colorado.edu>
2907 2918
2908 2919 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
2909 2920 John. Along with some recent changes he made to matplotlib, the
2910 2921 next versions of both systems should work very well together.
2911 2922
2912 2923 2004-08-24 Fernando Perez <fperez@colorado.edu>
2913 2924
2914 2925 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
2915 2926 tried to switch the profiling to using hotshot, but I'm getting
2916 2927 strange errors from prof.runctx() there. I may be misreading the
2917 2928 docs, but it looks weird. For now the profiling code will
2918 2929 continue to use the standard profiler.
2919 2930
2920 2931 2004-08-23 Fernando Perez <fperez@colorado.edu>
2921 2932
2922 2933 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
2923 2934 threaded shell, by John Hunter. It's not quite ready yet, but
2924 2935 close.
2925 2936
2926 2937 2004-08-22 Fernando Perez <fperez@colorado.edu>
2927 2938
2928 2939 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
2929 2940 in Magic and ultraTB.
2930 2941
2931 2942 * ipython.1: document threading options in manpage.
2932 2943
2933 2944 * scripts/ipython: Changed name of -thread option to -gthread,
2934 2945 since this is GTK specific. I want to leave the door open for a
2935 2946 -wthread option for WX, which will most likely be necessary. This
2936 2947 change affects usage and ipmaker as well.
2937 2948
2938 2949 * IPython/Shell.py (matplotlib_shell): Add a factory function to
2939 2950 handle the matplotlib shell issues. Code by John Hunter
2940 2951 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2941 2952 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
2942 2953 broken (and disabled for end users) for now, but it puts the
2943 2954 infrastructure in place.
2944 2955
2945 2956 2004-08-21 Fernando Perez <fperez@colorado.edu>
2946 2957
2947 2958 * ipythonrc-pylab: Add matplotlib support.
2948 2959
2949 2960 * matplotlib_config.py: new files for matplotlib support, part of
2950 2961 the pylab profile.
2951 2962
2952 2963 * IPython/usage.py (__doc__): documented the threading options.
2953 2964
2954 2965 2004-08-20 Fernando Perez <fperez@colorado.edu>
2955 2966
2956 2967 * ipython: Modified the main calling routine to handle the -thread
2957 2968 and -mpthread options. This needs to be done as a top-level hack,
2958 2969 because it determines which class to instantiate for IPython
2959 2970 itself.
2960 2971
2961 2972 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2962 2973 classes to support multithreaded GTK operation without blocking,
2963 2974 and matplotlib with all backends. This is a lot of still very
2964 2975 experimental code, and threads are tricky. So it may still have a
2965 2976 few rough edges... This code owes a lot to
2966 2977 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2967 2978 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2968 2979 to John Hunter for all the matplotlib work.
2969 2980
2970 2981 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2971 2982 options for gtk thread and matplotlib support.
2972 2983
2973 2984 2004-08-16 Fernando Perez <fperez@colorado.edu>
2974 2985
2975 2986 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2976 2987 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2977 2988 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2978 2989
2979 2990 2004-08-11 Fernando Perez <fperez@colorado.edu>
2980 2991
2981 2992 * setup.py (isfile): Fix build so documentation gets updated for
2982 2993 rpms (it was only done for .tgz builds).
2983 2994
2984 2995 2004-08-10 Fernando Perez <fperez@colorado.edu>
2985 2996
2986 2997 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2987 2998
2988 2999 * iplib.py : Silence syntax error exceptions in tab-completion.
2989 3000
2990 3001 2004-08-05 Fernando Perez <fperez@colorado.edu>
2991 3002
2992 3003 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2993 3004 'color off' mark for continuation prompts. This was causing long
2994 3005 continuation lines to mis-wrap.
2995 3006
2996 3007 2004-08-01 Fernando Perez <fperez@colorado.edu>
2997 3008
2998 3009 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2999 3010 for building ipython to be a parameter. All this is necessary
3000 3011 right now to have a multithreaded version, but this insane
3001 3012 non-design will be cleaned up soon. For now, it's a hack that
3002 3013 works.
3003 3014
3004 3015 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3005 3016 args in various places. No bugs so far, but it's a dangerous
3006 3017 practice.
3007 3018
3008 3019 2004-07-31 Fernando Perez <fperez@colorado.edu>
3009 3020
3010 3021 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3011 3022 fix completion of files with dots in their names under most
3012 3023 profiles (pysh was OK because the completion order is different).
3013 3024
3014 3025 2004-07-27 Fernando Perez <fperez@colorado.edu>
3015 3026
3016 3027 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3017 3028 keywords manually, b/c the one in keyword.py was removed in python
3018 3029 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3019 3030 This is NOT a bug under python 2.3 and earlier.
3020 3031
3021 3032 2004-07-26 Fernando Perez <fperez@colorado.edu>
3022 3033
3023 3034 * IPython/ultraTB.py (VerboseTB.text): Add another
3024 3035 linecache.checkcache() call to try to prevent inspect.py from
3025 3036 crashing under python 2.3. I think this fixes
3026 3037 http://www.scipy.net/roundup/ipython/issue17.
3027 3038
3028 3039 2004-07-26 *** Released version 0.6.2
3029 3040
3030 3041 2004-07-26 Fernando Perez <fperez@colorado.edu>
3031 3042
3032 3043 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3033 3044 fail for any number.
3034 3045 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3035 3046 empty bookmarks.
3036 3047
3037 3048 2004-07-26 *** Released version 0.6.1
3038 3049
3039 3050 2004-07-26 Fernando Perez <fperez@colorado.edu>
3040 3051
3041 3052 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3042 3053
3043 3054 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3044 3055 escaping '()[]{}' in filenames.
3045 3056
3046 3057 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3047 3058 Python 2.2 users who lack a proper shlex.split.
3048 3059
3049 3060 2004-07-19 Fernando Perez <fperez@colorado.edu>
3050 3061
3051 3062 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3052 3063 for reading readline's init file. I follow the normal chain:
3053 3064 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3054 3065 report by Mike Heeter. This closes
3055 3066 http://www.scipy.net/roundup/ipython/issue16.
3056 3067
3057 3068 2004-07-18 Fernando Perez <fperez@colorado.edu>
3058 3069
3059 3070 * IPython/iplib.py (__init__): Add better handling of '\' under
3060 3071 Win32 for filenames. After a patch by Ville.
3061 3072
3062 3073 2004-07-17 Fernando Perez <fperez@colorado.edu>
3063 3074
3064 3075 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3065 3076 autocalling would be triggered for 'foo is bar' if foo is
3066 3077 callable. I also cleaned up the autocall detection code to use a
3067 3078 regexp, which is faster. Bug reported by Alexander Schmolck.
3068 3079
3069 3080 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3070 3081 '?' in them would confuse the help system. Reported by Alex
3071 3082 Schmolck.
3072 3083
3073 3084 2004-07-16 Fernando Perez <fperez@colorado.edu>
3074 3085
3075 3086 * IPython/GnuplotInteractive.py (__all__): added plot2.
3076 3087
3077 3088 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3078 3089 plotting dictionaries, lists or tuples of 1d arrays.
3079 3090
3080 3091 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3081 3092 optimizations.
3082 3093
3083 3094 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3084 3095 the information which was there from Janko's original IPP code:
3085 3096
3086 3097 03.05.99 20:53 porto.ifm.uni-kiel.de
3087 3098 --Started changelog.
3088 3099 --make clear do what it say it does
3089 3100 --added pretty output of lines from inputcache
3090 3101 --Made Logger a mixin class, simplifies handling of switches
3091 3102 --Added own completer class. .string<TAB> expands to last history
3092 3103 line which starts with string. The new expansion is also present
3093 3104 with Ctrl-r from the readline library. But this shows, who this
3094 3105 can be done for other cases.
3095 3106 --Added convention that all shell functions should accept a
3096 3107 parameter_string This opens the door for different behaviour for
3097 3108 each function. @cd is a good example of this.
3098 3109
3099 3110 04.05.99 12:12 porto.ifm.uni-kiel.de
3100 3111 --added logfile rotation
3101 3112 --added new mainloop method which freezes first the namespace
3102 3113
3103 3114 07.05.99 21:24 porto.ifm.uni-kiel.de
3104 3115 --added the docreader classes. Now there is a help system.
3105 3116 -This is only a first try. Currently it's not easy to put new
3106 3117 stuff in the indices. But this is the way to go. Info would be
3107 3118 better, but HTML is every where and not everybody has an info
3108 3119 system installed and it's not so easy to change html-docs to info.
3109 3120 --added global logfile option
3110 3121 --there is now a hook for object inspection method pinfo needs to
3111 3122 be provided for this. Can be reached by two '??'.
3112 3123
3113 3124 08.05.99 20:51 porto.ifm.uni-kiel.de
3114 3125 --added a README
3115 3126 --bug in rc file. Something has changed so functions in the rc
3116 3127 file need to reference the shell and not self. Not clear if it's a
3117 3128 bug or feature.
3118 3129 --changed rc file for new behavior
3119 3130
3120 3131 2004-07-15 Fernando Perez <fperez@colorado.edu>
3121 3132
3122 3133 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3123 3134 cache was falling out of sync in bizarre manners when multi-line
3124 3135 input was present. Minor optimizations and cleanup.
3125 3136
3126 3137 (Logger): Remove old Changelog info for cleanup. This is the
3127 3138 information which was there from Janko's original code:
3128 3139
3129 3140 Changes to Logger: - made the default log filename a parameter
3130 3141
3131 3142 - put a check for lines beginning with !@? in log(). Needed
3132 3143 (even if the handlers properly log their lines) for mid-session
3133 3144 logging activation to work properly. Without this, lines logged
3134 3145 in mid session, which get read from the cache, would end up
3135 3146 'bare' (with !@? in the open) in the log. Now they are caught
3136 3147 and prepended with a #.
3137 3148
3138 3149 * IPython/iplib.py (InteractiveShell.init_readline): added check
3139 3150 in case MagicCompleter fails to be defined, so we don't crash.
3140 3151
3141 3152 2004-07-13 Fernando Perez <fperez@colorado.edu>
3142 3153
3143 3154 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3144 3155 of EPS if the requested filename ends in '.eps'.
3145 3156
3146 3157 2004-07-04 Fernando Perez <fperez@colorado.edu>
3147 3158
3148 3159 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3149 3160 escaping of quotes when calling the shell.
3150 3161
3151 3162 2004-07-02 Fernando Perez <fperez@colorado.edu>
3152 3163
3153 3164 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3154 3165 gettext not working because we were clobbering '_'. Fixes
3155 3166 http://www.scipy.net/roundup/ipython/issue6.
3156 3167
3157 3168 2004-07-01 Fernando Perez <fperez@colorado.edu>
3158 3169
3159 3170 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3160 3171 into @cd. Patch by Ville.
3161 3172
3162 3173 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3163 3174 new function to store things after ipmaker runs. Patch by Ville.
3164 3175 Eventually this will go away once ipmaker is removed and the class
3165 3176 gets cleaned up, but for now it's ok. Key functionality here is
3166 3177 the addition of the persistent storage mechanism, a dict for
3167 3178 keeping data across sessions (for now just bookmarks, but more can
3168 3179 be implemented later).
3169 3180
3170 3181 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3171 3182 persistent across sections. Patch by Ville, I modified it
3172 3183 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3173 3184 added a '-l' option to list all bookmarks.
3174 3185
3175 3186 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3176 3187 center for cleanup. Registered with atexit.register(). I moved
3177 3188 here the old exit_cleanup(). After a patch by Ville.
3178 3189
3179 3190 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3180 3191 characters in the hacked shlex_split for python 2.2.
3181 3192
3182 3193 * IPython/iplib.py (file_matches): more fixes to filenames with
3183 3194 whitespace in them. It's not perfect, but limitations in python's
3184 3195 readline make it impossible to go further.
3185 3196
3186 3197 2004-06-29 Fernando Perez <fperez@colorado.edu>
3187 3198
3188 3199 * IPython/iplib.py (file_matches): escape whitespace correctly in
3189 3200 filename completions. Bug reported by Ville.
3190 3201
3191 3202 2004-06-28 Fernando Perez <fperez@colorado.edu>
3192 3203
3193 3204 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3194 3205 the history file will be called 'history-PROFNAME' (or just
3195 3206 'history' if no profile is loaded). I was getting annoyed at
3196 3207 getting my Numerical work history clobbered by pysh sessions.
3197 3208
3198 3209 * IPython/iplib.py (InteractiveShell.__init__): Internal
3199 3210 getoutputerror() function so that we can honor the system_verbose
3200 3211 flag for _all_ system calls. I also added escaping of #
3201 3212 characters here to avoid confusing Itpl.
3202 3213
3203 3214 * IPython/Magic.py (shlex_split): removed call to shell in
3204 3215 parse_options and replaced it with shlex.split(). The annoying
3205 3216 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3206 3217 to backport it from 2.3, with several frail hacks (the shlex
3207 3218 module is rather limited in 2.2). Thanks to a suggestion by Ville
3208 3219 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3209 3220 problem.
3210 3221
3211 3222 (Magic.magic_system_verbose): new toggle to print the actual
3212 3223 system calls made by ipython. Mainly for debugging purposes.
3213 3224
3214 3225 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3215 3226 doesn't support persistence. Reported (and fix suggested) by
3216 3227 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3217 3228
3218 3229 2004-06-26 Fernando Perez <fperez@colorado.edu>
3219 3230
3220 3231 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3221 3232 continue prompts.
3222 3233
3223 3234 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3224 3235 function (basically a big docstring) and a few more things here to
3225 3236 speedup startup. pysh.py is now very lightweight. We want because
3226 3237 it gets execfile'd, while InterpreterExec gets imported, so
3227 3238 byte-compilation saves time.
3228 3239
3229 3240 2004-06-25 Fernando Perez <fperez@colorado.edu>
3230 3241
3231 3242 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3232 3243 -NUM', which was recently broken.
3233 3244
3234 3245 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3235 3246 in multi-line input (but not !!, which doesn't make sense there).
3236 3247
3237 3248 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3238 3249 It's just too useful, and people can turn it off in the less
3239 3250 common cases where it's a problem.
3240 3251
3241 3252 2004-06-24 Fernando Perez <fperez@colorado.edu>
3242 3253
3243 3254 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3244 3255 special syntaxes (like alias calling) is now allied in multi-line
3245 3256 input. This is still _very_ experimental, but it's necessary for
3246 3257 efficient shell usage combining python looping syntax with system
3247 3258 calls. For now it's restricted to aliases, I don't think it
3248 3259 really even makes sense to have this for magics.
3249 3260
3250 3261 2004-06-23 Fernando Perez <fperez@colorado.edu>
3251 3262
3252 3263 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3253 3264 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3254 3265
3255 3266 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3256 3267 extensions under Windows (after code sent by Gary Bishop). The
3257 3268 extensions considered 'executable' are stored in IPython's rc
3258 3269 structure as win_exec_ext.
3259 3270
3260 3271 * IPython/genutils.py (shell): new function, like system() but
3261 3272 without return value. Very useful for interactive shell work.
3262 3273
3263 3274 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3264 3275 delete aliases.
3265 3276
3266 3277 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3267 3278 sure that the alias table doesn't contain python keywords.
3268 3279
3269 3280 2004-06-21 Fernando Perez <fperez@colorado.edu>
3270 3281
3271 3282 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3272 3283 non-existent items are found in $PATH. Reported by Thorsten.
3273 3284
3274 3285 2004-06-20 Fernando Perez <fperez@colorado.edu>
3275 3286
3276 3287 * IPython/iplib.py (complete): modified the completer so that the
3277 3288 order of priorities can be easily changed at runtime.
3278 3289
3279 3290 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3280 3291 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3281 3292
3282 3293 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3283 3294 expand Python variables prepended with $ in all system calls. The
3284 3295 same was done to InteractiveShell.handle_shell_escape. Now all
3285 3296 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3286 3297 expansion of python variables and expressions according to the
3287 3298 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3288 3299
3289 3300 Though PEP-215 has been rejected, a similar (but simpler) one
3290 3301 seems like it will go into Python 2.4, PEP-292 -
3291 3302 http://www.python.org/peps/pep-0292.html.
3292 3303
3293 3304 I'll keep the full syntax of PEP-215, since IPython has since the
3294 3305 start used Ka-Ping Yee's reference implementation discussed there
3295 3306 (Itpl), and I actually like the powerful semantics it offers.
3296 3307
3297 3308 In order to access normal shell variables, the $ has to be escaped
3298 3309 via an extra $. For example:
3299 3310
3300 3311 In [7]: PATH='a python variable'
3301 3312
3302 3313 In [8]: !echo $PATH
3303 3314 a python variable
3304 3315
3305 3316 In [9]: !echo $$PATH
3306 3317 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3307 3318
3308 3319 (Magic.parse_options): escape $ so the shell doesn't evaluate
3309 3320 things prematurely.
3310 3321
3311 3322 * IPython/iplib.py (InteractiveShell.call_alias): added the
3312 3323 ability for aliases to expand python variables via $.
3313 3324
3314 3325 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3315 3326 system, now there's a @rehash/@rehashx pair of magics. These work
3316 3327 like the csh rehash command, and can be invoked at any time. They
3317 3328 build a table of aliases to everything in the user's $PATH
3318 3329 (@rehash uses everything, @rehashx is slower but only adds
3319 3330 executable files). With this, the pysh.py-based shell profile can
3320 3331 now simply call rehash upon startup, and full access to all
3321 3332 programs in the user's path is obtained.
3322 3333
3323 3334 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3324 3335 functionality is now fully in place. I removed the old dynamic
3325 3336 code generation based approach, in favor of a much lighter one
3326 3337 based on a simple dict. The advantage is that this allows me to
3327 3338 now have thousands of aliases with negligible cost (unthinkable
3328 3339 with the old system).
3329 3340
3330 3341 2004-06-19 Fernando Perez <fperez@colorado.edu>
3331 3342
3332 3343 * IPython/iplib.py (__init__): extended MagicCompleter class to
3333 3344 also complete (last in priority) on user aliases.
3334 3345
3335 3346 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3336 3347 call to eval.
3337 3348 (ItplNS.__init__): Added a new class which functions like Itpl,
3338 3349 but allows configuring the namespace for the evaluation to occur
3339 3350 in.
3340 3351
3341 3352 2004-06-18 Fernando Perez <fperez@colorado.edu>
3342 3353
3343 3354 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3344 3355 better message when 'exit' or 'quit' are typed (a common newbie
3345 3356 confusion).
3346 3357
3347 3358 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3348 3359 check for Windows users.
3349 3360
3350 3361 * IPython/iplib.py (InteractiveShell.user_setup): removed
3351 3362 disabling of colors for Windows. I'll test at runtime and issue a
3352 3363 warning if Gary's readline isn't found, as to nudge users to
3353 3364 download it.
3354 3365
3355 3366 2004-06-16 Fernando Perez <fperez@colorado.edu>
3356 3367
3357 3368 * IPython/genutils.py (Stream.__init__): changed to print errors
3358 3369 to sys.stderr. I had a circular dependency here. Now it's
3359 3370 possible to run ipython as IDLE's shell (consider this pre-alpha,
3360 3371 since true stdout things end up in the starting terminal instead
3361 3372 of IDLE's out).
3362 3373
3363 3374 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3364 3375 users who haven't # updated their prompt_in2 definitions. Remove
3365 3376 eventually.
3366 3377 (multiple_replace): added credit to original ASPN recipe.
3367 3378
3368 3379 2004-06-15 Fernando Perez <fperez@colorado.edu>
3369 3380
3370 3381 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3371 3382 list of auto-defined aliases.
3372 3383
3373 3384 2004-06-13 Fernando Perez <fperez@colorado.edu>
3374 3385
3375 3386 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3376 3387 install was really requested (so setup.py can be used for other
3377 3388 things under Windows).
3378 3389
3379 3390 2004-06-10 Fernando Perez <fperez@colorado.edu>
3380 3391
3381 3392 * IPython/Logger.py (Logger.create_log): Manually remove any old
3382 3393 backup, since os.remove may fail under Windows. Fixes bug
3383 3394 reported by Thorsten.
3384 3395
3385 3396 2004-06-09 Fernando Perez <fperez@colorado.edu>
3386 3397
3387 3398 * examples/example-embed.py: fixed all references to %n (replaced
3388 3399 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3389 3400 for all examples and the manual as well.
3390 3401
3391 3402 2004-06-08 Fernando Perez <fperez@colorado.edu>
3392 3403
3393 3404 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3394 3405 alignment and color management. All 3 prompt subsystems now
3395 3406 inherit from BasePrompt.
3396 3407
3397 3408 * tools/release: updates for windows installer build and tag rpms
3398 3409 with python version (since paths are fixed).
3399 3410
3400 3411 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3401 3412 which will become eventually obsolete. Also fixed the default
3402 3413 prompt_in2 to use \D, so at least new users start with the correct
3403 3414 defaults.
3404 3415 WARNING: Users with existing ipythonrc files will need to apply
3405 3416 this fix manually!
3406 3417
3407 3418 * setup.py: make windows installer (.exe). This is finally the
3408 3419 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3409 3420 which I hadn't included because it required Python 2.3 (or recent
3410 3421 distutils).
3411 3422
3412 3423 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3413 3424 usage of new '\D' escape.
3414 3425
3415 3426 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3416 3427 lacks os.getuid())
3417 3428 (CachedOutput.set_colors): Added the ability to turn coloring
3418 3429 on/off with @colors even for manually defined prompt colors. It
3419 3430 uses a nasty global, but it works safely and via the generic color
3420 3431 handling mechanism.
3421 3432 (Prompt2.__init__): Introduced new escape '\D' for continuation
3422 3433 prompts. It represents the counter ('\#') as dots.
3423 3434 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3424 3435 need to update their ipythonrc files and replace '%n' with '\D' in
3425 3436 their prompt_in2 settings everywhere. Sorry, but there's
3426 3437 otherwise no clean way to get all prompts to properly align. The
3427 3438 ipythonrc shipped with IPython has been updated.
3428 3439
3429 3440 2004-06-07 Fernando Perez <fperez@colorado.edu>
3430 3441
3431 3442 * setup.py (isfile): Pass local_icons option to latex2html, so the
3432 3443 resulting HTML file is self-contained. Thanks to
3433 3444 dryice-AT-liu.com.cn for the tip.
3434 3445
3435 3446 * pysh.py: I created a new profile 'shell', which implements a
3436 3447 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3437 3448 system shell, nor will it become one anytime soon. It's mainly
3438 3449 meant to illustrate the use of the new flexible bash-like prompts.
3439 3450 I guess it could be used by hardy souls for true shell management,
3440 3451 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3441 3452 profile. This uses the InterpreterExec extension provided by
3442 3453 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3443 3454
3444 3455 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3445 3456 auto-align itself with the length of the previous input prompt
3446 3457 (taking into account the invisible color escapes).
3447 3458 (CachedOutput.__init__): Large restructuring of this class. Now
3448 3459 all three prompts (primary1, primary2, output) are proper objects,
3449 3460 managed by the 'parent' CachedOutput class. The code is still a
3450 3461 bit hackish (all prompts share state via a pointer to the cache),
3451 3462 but it's overall far cleaner than before.
3452 3463
3453 3464 * IPython/genutils.py (getoutputerror): modified to add verbose,
3454 3465 debug and header options. This makes the interface of all getout*
3455 3466 functions uniform.
3456 3467 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3457 3468
3458 3469 * IPython/Magic.py (Magic.default_option): added a function to
3459 3470 allow registering default options for any magic command. This
3460 3471 makes it easy to have profiles which customize the magics globally
3461 3472 for a certain use. The values set through this function are
3462 3473 picked up by the parse_options() method, which all magics should
3463 3474 use to parse their options.
3464 3475
3465 3476 * IPython/genutils.py (warn): modified the warnings framework to
3466 3477 use the Term I/O class. I'm trying to slowly unify all of
3467 3478 IPython's I/O operations to pass through Term.
3468 3479
3469 3480 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3470 3481 the secondary prompt to correctly match the length of the primary
3471 3482 one for any prompt. Now multi-line code will properly line up
3472 3483 even for path dependent prompts, such as the new ones available
3473 3484 via the prompt_specials.
3474 3485
3475 3486 2004-06-06 Fernando Perez <fperez@colorado.edu>
3476 3487
3477 3488 * IPython/Prompts.py (prompt_specials): Added the ability to have
3478 3489 bash-like special sequences in the prompts, which get
3479 3490 automatically expanded. Things like hostname, current working
3480 3491 directory and username are implemented already, but it's easy to
3481 3492 add more in the future. Thanks to a patch by W.J. van der Laan
3482 3493 <gnufnork-AT-hetdigitalegat.nl>
3483 3494 (prompt_specials): Added color support for prompt strings, so
3484 3495 users can define arbitrary color setups for their prompts.
3485 3496
3486 3497 2004-06-05 Fernando Perez <fperez@colorado.edu>
3487 3498
3488 3499 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3489 3500 code to load Gary Bishop's readline and configure it
3490 3501 automatically. Thanks to Gary for help on this.
3491 3502
3492 3503 2004-06-01 Fernando Perez <fperez@colorado.edu>
3493 3504
3494 3505 * IPython/Logger.py (Logger.create_log): fix bug for logging
3495 3506 with no filename (previous fix was incomplete).
3496 3507
3497 3508 2004-05-25 Fernando Perez <fperez@colorado.edu>
3498 3509
3499 3510 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3500 3511 parens would get passed to the shell.
3501 3512
3502 3513 2004-05-20 Fernando Perez <fperez@colorado.edu>
3503 3514
3504 3515 * IPython/Magic.py (Magic.magic_prun): changed default profile
3505 3516 sort order to 'time' (the more common profiling need).
3506 3517
3507 3518 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3508 3519 so that source code shown is guaranteed in sync with the file on
3509 3520 disk (also changed in psource). Similar fix to the one for
3510 3521 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3511 3522 <yann.ledu-AT-noos.fr>.
3512 3523
3513 3524 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3514 3525 with a single option would not be correctly parsed. Closes
3515 3526 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3516 3527 introduced in 0.6.0 (on 2004-05-06).
3517 3528
3518 3529 2004-05-13 *** Released version 0.6.0
3519 3530
3520 3531 2004-05-13 Fernando Perez <fperez@colorado.edu>
3521 3532
3522 3533 * debian/: Added debian/ directory to CVS, so that debian support
3523 3534 is publicly accessible. The debian package is maintained by Jack
3524 3535 Moffit <jack-AT-xiph.org>.
3525 3536
3526 3537 * Documentation: included the notes about an ipython-based system
3527 3538 shell (the hypothetical 'pysh') into the new_design.pdf document,
3528 3539 so that these ideas get distributed to users along with the
3529 3540 official documentation.
3530 3541
3531 3542 2004-05-10 Fernando Perez <fperez@colorado.edu>
3532 3543
3533 3544 * IPython/Logger.py (Logger.create_log): fix recently introduced
3534 3545 bug (misindented line) where logstart would fail when not given an
3535 3546 explicit filename.
3536 3547
3537 3548 2004-05-09 Fernando Perez <fperez@colorado.edu>
3538 3549
3539 3550 * IPython/Magic.py (Magic.parse_options): skip system call when
3540 3551 there are no options to look for. Faster, cleaner for the common
3541 3552 case.
3542 3553
3543 3554 * Documentation: many updates to the manual: describing Windows
3544 3555 support better, Gnuplot updates, credits, misc small stuff. Also
3545 3556 updated the new_design doc a bit.
3546 3557
3547 3558 2004-05-06 *** Released version 0.6.0.rc1
3548 3559
3549 3560 2004-05-06 Fernando Perez <fperez@colorado.edu>
3550 3561
3551 3562 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3552 3563 operations to use the vastly more efficient list/''.join() method.
3553 3564 (FormattedTB.text): Fix
3554 3565 http://www.scipy.net/roundup/ipython/issue12 - exception source
3555 3566 extract not updated after reload. Thanks to Mike Salib
3556 3567 <msalib-AT-mit.edu> for pinning the source of the problem.
3557 3568 Fortunately, the solution works inside ipython and doesn't require
3558 3569 any changes to python proper.
3559 3570
3560 3571 * IPython/Magic.py (Magic.parse_options): Improved to process the
3561 3572 argument list as a true shell would (by actually using the
3562 3573 underlying system shell). This way, all @magics automatically get
3563 3574 shell expansion for variables. Thanks to a comment by Alex
3564 3575 Schmolck.
3565 3576
3566 3577 2004-04-04 Fernando Perez <fperez@colorado.edu>
3567 3578
3568 3579 * IPython/iplib.py (InteractiveShell.interact): Added a special
3569 3580 trap for a debugger quit exception, which is basically impossible
3570 3581 to handle by normal mechanisms, given what pdb does to the stack.
3571 3582 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3572 3583
3573 3584 2004-04-03 Fernando Perez <fperez@colorado.edu>
3574 3585
3575 3586 * IPython/genutils.py (Term): Standardized the names of the Term
3576 3587 class streams to cin/cout/cerr, following C++ naming conventions
3577 3588 (I can't use in/out/err because 'in' is not a valid attribute
3578 3589 name).
3579 3590
3580 3591 * IPython/iplib.py (InteractiveShell.interact): don't increment
3581 3592 the prompt if there's no user input. By Daniel 'Dang' Griffith
3582 3593 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3583 3594 Francois Pinard.
3584 3595
3585 3596 2004-04-02 Fernando Perez <fperez@colorado.edu>
3586 3597
3587 3598 * IPython/genutils.py (Stream.__init__): Modified to survive at
3588 3599 least importing in contexts where stdin/out/err aren't true file
3589 3600 objects, such as PyCrust (they lack fileno() and mode). However,
3590 3601 the recovery facilities which rely on these things existing will
3591 3602 not work.
3592 3603
3593 3604 2004-04-01 Fernando Perez <fperez@colorado.edu>
3594 3605
3595 3606 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
3596 3607 use the new getoutputerror() function, so it properly
3597 3608 distinguishes stdout/err.
3598 3609
3599 3610 * IPython/genutils.py (getoutputerror): added a function to
3600 3611 capture separately the standard output and error of a command.
3601 3612 After a comment from dang on the mailing lists. This code is
3602 3613 basically a modified version of commands.getstatusoutput(), from
3603 3614 the standard library.
3604 3615
3605 3616 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
3606 3617 '!!' as a special syntax (shorthand) to access @sx.
3607 3618
3608 3619 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
3609 3620 command and return its output as a list split on '\n'.
3610 3621
3611 3622 2004-03-31 Fernando Perez <fperez@colorado.edu>
3612 3623
3613 3624 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
3614 3625 method to dictionaries used as FakeModule instances if they lack
3615 3626 it. At least pydoc in python2.3 breaks for runtime-defined
3616 3627 functions without this hack. At some point I need to _really_
3617 3628 understand what FakeModule is doing, because it's a gross hack.
3618 3629 But it solves Arnd's problem for now...
3619 3630
3620 3631 2004-02-27 Fernando Perez <fperez@colorado.edu>
3621 3632
3622 3633 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
3623 3634 mode would behave erratically. Also increased the number of
3624 3635 possible logs in rotate mod to 999. Thanks to Rod Holland
3625 3636 <rhh@StructureLABS.com> for the report and fixes.
3626 3637
3627 3638 2004-02-26 Fernando Perez <fperez@colorado.edu>
3628 3639
3629 3640 * IPython/genutils.py (page): Check that the curses module really
3630 3641 has the initscr attribute before trying to use it. For some
3631 3642 reason, the Solaris curses module is missing this. I think this
3632 3643 should be considered a Solaris python bug, but I'm not sure.
3633 3644
3634 3645 2004-01-17 Fernando Perez <fperez@colorado.edu>
3635 3646
3636 3647 * IPython/genutils.py (Stream.__init__): Changes to try to make
3637 3648 ipython robust against stdin/out/err being closed by the user.
3638 3649 This is 'user error' (and blocks a normal python session, at least
3639 3650 the stdout case). However, Ipython should be able to survive such
3640 3651 instances of abuse as gracefully as possible. To simplify the
3641 3652 coding and maintain compatibility with Gary Bishop's Term
3642 3653 contributions, I've made use of classmethods for this. I think
3643 3654 this introduces a dependency on python 2.2.
3644 3655
3645 3656 2004-01-13 Fernando Perez <fperez@colorado.edu>
3646 3657
3647 3658 * IPython/numutils.py (exp_safe): simplified the code a bit and
3648 3659 removed the need for importing the kinds module altogether.
3649 3660
3650 3661 2004-01-06 Fernando Perez <fperez@colorado.edu>
3651 3662
3652 3663 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
3653 3664 a magic function instead, after some community feedback. No
3654 3665 special syntax will exist for it, but its name is deliberately
3655 3666 very short.
3656 3667
3657 3668 2003-12-20 Fernando Perez <fperez@colorado.edu>
3658 3669
3659 3670 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
3660 3671 new functionality, to automagically assign the result of a shell
3661 3672 command to a variable. I'll solicit some community feedback on
3662 3673 this before making it permanent.
3663 3674
3664 3675 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
3665 3676 requested about callables for which inspect couldn't obtain a
3666 3677 proper argspec. Thanks to a crash report sent by Etienne
3667 3678 Posthumus <etienne-AT-apple01.cs.vu.nl>.
3668 3679
3669 3680 2003-12-09 Fernando Perez <fperez@colorado.edu>
3670 3681
3671 3682 * IPython/genutils.py (page): patch for the pager to work across
3672 3683 various versions of Windows. By Gary Bishop.
3673 3684
3674 3685 2003-12-04 Fernando Perez <fperez@colorado.edu>
3675 3686
3676 3687 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
3677 3688 Gnuplot.py version 1.7, whose internal names changed quite a bit.
3678 3689 While I tested this and it looks ok, there may still be corner
3679 3690 cases I've missed.
3680 3691
3681 3692 2003-12-01 Fernando Perez <fperez@colorado.edu>
3682 3693
3683 3694 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
3684 3695 where a line like 'p,q=1,2' would fail because the automagic
3685 3696 system would be triggered for @p.
3686 3697
3687 3698 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
3688 3699 cleanups, code unmodified.
3689 3700
3690 3701 * IPython/genutils.py (Term): added a class for IPython to handle
3691 3702 output. In most cases it will just be a proxy for stdout/err, but
3692 3703 having this allows modifications to be made for some platforms,
3693 3704 such as handling color escapes under Windows. All of this code
3694 3705 was contributed by Gary Bishop, with minor modifications by me.
3695 3706 The actual changes affect many files.
3696 3707
3697 3708 2003-11-30 Fernando Perez <fperez@colorado.edu>
3698 3709
3699 3710 * IPython/iplib.py (file_matches): new completion code, courtesy
3700 3711 of Jeff Collins. This enables filename completion again under
3701 3712 python 2.3, which disabled it at the C level.
3702 3713
3703 3714 2003-11-11 Fernando Perez <fperez@colorado.edu>
3704 3715
3705 3716 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
3706 3717 for Numeric.array(map(...)), but often convenient.
3707 3718
3708 3719 2003-11-05 Fernando Perez <fperez@colorado.edu>
3709 3720
3710 3721 * IPython/numutils.py (frange): Changed a call from int() to
3711 3722 int(round()) to prevent a problem reported with arange() in the
3712 3723 numpy list.
3713 3724
3714 3725 2003-10-06 Fernando Perez <fperez@colorado.edu>
3715 3726
3716 3727 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
3717 3728 prevent crashes if sys lacks an argv attribute (it happens with
3718 3729 embedded interpreters which build a bare-bones sys module).
3719 3730 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
3720 3731
3721 3732 2003-09-24 Fernando Perez <fperez@colorado.edu>
3722 3733
3723 3734 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
3724 3735 to protect against poorly written user objects where __getattr__
3725 3736 raises exceptions other than AttributeError. Thanks to a bug
3726 3737 report by Oliver Sander <osander-AT-gmx.de>.
3727 3738
3728 3739 * IPython/FakeModule.py (FakeModule.__repr__): this method was
3729 3740 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
3730 3741
3731 3742 2003-09-09 Fernando Perez <fperez@colorado.edu>
3732 3743
3733 3744 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3734 3745 unpacking a list whith a callable as first element would
3735 3746 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
3736 3747 Collins.
3737 3748
3738 3749 2003-08-25 *** Released version 0.5.0
3739 3750
3740 3751 2003-08-22 Fernando Perez <fperez@colorado.edu>
3741 3752
3742 3753 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
3743 3754 improperly defined user exceptions. Thanks to feedback from Mark
3744 3755 Russell <mrussell-AT-verio.net>.
3745 3756
3746 3757 2003-08-20 Fernando Perez <fperez@colorado.edu>
3747 3758
3748 3759 * IPython/OInspect.py (Inspector.pinfo): changed String Form
3749 3760 printing so that it would print multi-line string forms starting
3750 3761 with a new line. This way the formatting is better respected for
3751 3762 objects which work hard to make nice string forms.
3752 3763
3753 3764 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
3754 3765 autocall would overtake data access for objects with both
3755 3766 __getitem__ and __call__.
3756 3767
3757 3768 2003-08-19 *** Released version 0.5.0-rc1
3758 3769
3759 3770 2003-08-19 Fernando Perez <fperez@colorado.edu>
3760 3771
3761 3772 * IPython/deep_reload.py (load_tail): single tiny change here
3762 3773 seems to fix the long-standing bug of dreload() failing to work
3763 3774 for dotted names. But this module is pretty tricky, so I may have
3764 3775 missed some subtlety. Needs more testing!.
3765 3776
3766 3777 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
3767 3778 exceptions which have badly implemented __str__ methods.
3768 3779 (VerboseTB.text): harden against inspect.getinnerframes crashing,
3769 3780 which I've been getting reports about from Python 2.3 users. I
3770 3781 wish I had a simple test case to reproduce the problem, so I could
3771 3782 either write a cleaner workaround or file a bug report if
3772 3783 necessary.
3773 3784
3774 3785 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
3775 3786 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
3776 3787 a bug report by Tjabo Kloppenburg.
3777 3788
3778 3789 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
3779 3790 crashes. Wrapped the pdb call in a blanket try/except, since pdb
3780 3791 seems rather unstable. Thanks to a bug report by Tjabo
3781 3792 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
3782 3793
3783 3794 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
3784 3795 this out soon because of the critical fixes in the inner loop for
3785 3796 generators.
3786 3797
3787 3798 * IPython/Magic.py (Magic.getargspec): removed. This (and
3788 3799 _get_def) have been obsoleted by OInspect for a long time, I
3789 3800 hadn't noticed that they were dead code.
3790 3801 (Magic._ofind): restored _ofind functionality for a few literals
3791 3802 (those in ["''",'""','[]','{}','()']). But it won't work anymore
3792 3803 for things like "hello".capitalize?, since that would require a
3793 3804 potentially dangerous eval() again.
3794 3805
3795 3806 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
3796 3807 logic a bit more to clean up the escapes handling and minimize the
3797 3808 use of _ofind to only necessary cases. The interactive 'feel' of
3798 3809 IPython should have improved quite a bit with the changes in
3799 3810 _prefilter and _ofind (besides being far safer than before).
3800 3811
3801 3812 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
3802 3813 obscure, never reported). Edit would fail to find the object to
3803 3814 edit under some circumstances.
3804 3815 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
3805 3816 which were causing double-calling of generators. Those eval calls
3806 3817 were _very_ dangerous, since code with side effects could be
3807 3818 triggered. As they say, 'eval is evil'... These were the
3808 3819 nastiest evals in IPython. Besides, _ofind is now far simpler,
3809 3820 and it should also be quite a bit faster. Its use of inspect is
3810 3821 also safer, so perhaps some of the inspect-related crashes I've
3811 3822 seen lately with Python 2.3 might be taken care of. That will
3812 3823 need more testing.
3813 3824
3814 3825 2003-08-17 Fernando Perez <fperez@colorado.edu>
3815 3826
3816 3827 * IPython/iplib.py (InteractiveShell._prefilter): significant
3817 3828 simplifications to the logic for handling user escapes. Faster
3818 3829 and simpler code.
3819 3830
3820 3831 2003-08-14 Fernando Perez <fperez@colorado.edu>
3821 3832
3822 3833 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
3823 3834 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
3824 3835 but it should be quite a bit faster. And the recursive version
3825 3836 generated O(log N) intermediate storage for all rank>1 arrays,
3826 3837 even if they were contiguous.
3827 3838 (l1norm): Added this function.
3828 3839 (norm): Added this function for arbitrary norms (including
3829 3840 l-infinity). l1 and l2 are still special cases for convenience
3830 3841 and speed.
3831 3842
3832 3843 2003-08-03 Fernando Perez <fperez@colorado.edu>
3833 3844
3834 3845 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
3835 3846 exceptions, which now raise PendingDeprecationWarnings in Python
3836 3847 2.3. There were some in Magic and some in Gnuplot2.
3837 3848
3838 3849 2003-06-30 Fernando Perez <fperez@colorado.edu>
3839 3850
3840 3851 * IPython/genutils.py (page): modified to call curses only for
3841 3852 terminals where TERM=='xterm'. After problems under many other
3842 3853 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
3843 3854
3844 3855 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
3845 3856 would be triggered when readline was absent. This was just an old
3846 3857 debugging statement I'd forgotten to take out.
3847 3858
3848 3859 2003-06-20 Fernando Perez <fperez@colorado.edu>
3849 3860
3850 3861 * IPython/genutils.py (clock): modified to return only user time
3851 3862 (not counting system time), after a discussion on scipy. While
3852 3863 system time may be a useful quantity occasionally, it may much
3853 3864 more easily be skewed by occasional swapping or other similar
3854 3865 activity.
3855 3866
3856 3867 2003-06-05 Fernando Perez <fperez@colorado.edu>
3857 3868
3858 3869 * IPython/numutils.py (identity): new function, for building
3859 3870 arbitrary rank Kronecker deltas (mostly backwards compatible with
3860 3871 Numeric.identity)
3861 3872
3862 3873 2003-06-03 Fernando Perez <fperez@colorado.edu>
3863 3874
3864 3875 * IPython/iplib.py (InteractiveShell.handle_magic): protect
3865 3876 arguments passed to magics with spaces, to allow trailing '\' to
3866 3877 work normally (mainly for Windows users).
3867 3878
3868 3879 2003-05-29 Fernando Perez <fperez@colorado.edu>
3869 3880
3870 3881 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
3871 3882 instead of pydoc.help. This fixes a bizarre behavior where
3872 3883 printing '%s' % locals() would trigger the help system. Now
3873 3884 ipython behaves like normal python does.
3874 3885
3875 3886 Note that if one does 'from pydoc import help', the bizarre
3876 3887 behavior returns, but this will also happen in normal python, so
3877 3888 it's not an ipython bug anymore (it has to do with how pydoc.help
3878 3889 is implemented).
3879 3890
3880 3891 2003-05-22 Fernando Perez <fperez@colorado.edu>
3881 3892
3882 3893 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
3883 3894 return [] instead of None when nothing matches, also match to end
3884 3895 of line. Patch by Gary Bishop.
3885 3896
3886 3897 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
3887 3898 protection as before, for files passed on the command line. This
3888 3899 prevents the CrashHandler from kicking in if user files call into
3889 3900 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
3890 3901 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
3891 3902
3892 3903 2003-05-20 *** Released version 0.4.0
3893 3904
3894 3905 2003-05-20 Fernando Perez <fperez@colorado.edu>
3895 3906
3896 3907 * setup.py: added support for manpages. It's a bit hackish b/c of
3897 3908 a bug in the way the bdist_rpm distutils target handles gzipped
3898 3909 manpages, but it works. After a patch by Jack.
3899 3910
3900 3911 2003-05-19 Fernando Perez <fperez@colorado.edu>
3901 3912
3902 3913 * IPython/numutils.py: added a mockup of the kinds module, since
3903 3914 it was recently removed from Numeric. This way, numutils will
3904 3915 work for all users even if they are missing kinds.
3905 3916
3906 3917 * IPython/Magic.py (Magic._ofind): Harden against an inspect
3907 3918 failure, which can occur with SWIG-wrapped extensions. After a
3908 3919 crash report from Prabhu.
3909 3920
3910 3921 2003-05-16 Fernando Perez <fperez@colorado.edu>
3911 3922
3912 3923 * IPython/iplib.py (InteractiveShell.excepthook): New method to
3913 3924 protect ipython from user code which may call directly
3914 3925 sys.excepthook (this looks like an ipython crash to the user, even
3915 3926 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3916 3927 This is especially important to help users of WxWindows, but may
3917 3928 also be useful in other cases.
3918 3929
3919 3930 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
3920 3931 an optional tb_offset to be specified, and to preserve exception
3921 3932 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
3922 3933
3923 3934 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
3924 3935
3925 3936 2003-05-15 Fernando Perez <fperez@colorado.edu>
3926 3937
3927 3938 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
3928 3939 installing for a new user under Windows.
3929 3940
3930 3941 2003-05-12 Fernando Perez <fperez@colorado.edu>
3931 3942
3932 3943 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
3933 3944 handler for Emacs comint-based lines. Currently it doesn't do
3934 3945 much (but importantly, it doesn't update the history cache). In
3935 3946 the future it may be expanded if Alex needs more functionality
3936 3947 there.
3937 3948
3938 3949 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
3939 3950 info to crash reports.
3940 3951
3941 3952 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
3942 3953 just like Python's -c. Also fixed crash with invalid -color
3943 3954 option value at startup. Thanks to Will French
3944 3955 <wfrench-AT-bestweb.net> for the bug report.
3945 3956
3946 3957 2003-05-09 Fernando Perez <fperez@colorado.edu>
3947 3958
3948 3959 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
3949 3960 to EvalDict (it's a mapping, after all) and simplified its code
3950 3961 quite a bit, after a nice discussion on c.l.py where Gustavo
3951 3962 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
3952 3963
3953 3964 2003-04-30 Fernando Perez <fperez@colorado.edu>
3954 3965
3955 3966 * IPython/genutils.py (timings_out): modified it to reduce its
3956 3967 overhead in the common reps==1 case.
3957 3968
3958 3969 2003-04-29 Fernando Perez <fperez@colorado.edu>
3959 3970
3960 3971 * IPython/genutils.py (timings_out): Modified to use the resource
3961 3972 module, which avoids the wraparound problems of time.clock().
3962 3973
3963 3974 2003-04-17 *** Released version 0.2.15pre4
3964 3975
3965 3976 2003-04-17 Fernando Perez <fperez@colorado.edu>
3966 3977
3967 3978 * setup.py (scriptfiles): Split windows-specific stuff over to a
3968 3979 separate file, in an attempt to have a Windows GUI installer.
3969 3980 That didn't work, but part of the groundwork is done.
3970 3981
3971 3982 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3972 3983 indent/unindent with 4 spaces. Particularly useful in combination
3973 3984 with the new auto-indent option.
3974 3985
3975 3986 2003-04-16 Fernando Perez <fperez@colorado.edu>
3976 3987
3977 3988 * IPython/Magic.py: various replacements of self.rc for
3978 3989 self.shell.rc. A lot more remains to be done to fully disentangle
3979 3990 this class from the main Shell class.
3980 3991
3981 3992 * IPython/GnuplotRuntime.py: added checks for mouse support so
3982 3993 that we don't try to enable it if the current gnuplot doesn't
3983 3994 really support it. Also added checks so that we don't try to
3984 3995 enable persist under Windows (where Gnuplot doesn't recognize the
3985 3996 option).
3986 3997
3987 3998 * IPython/iplib.py (InteractiveShell.interact): Added optional
3988 3999 auto-indenting code, after a patch by King C. Shu
3989 4000 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3990 4001 get along well with pasting indented code. If I ever figure out
3991 4002 how to make that part go well, it will become on by default.
3992 4003
3993 4004 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3994 4005 crash ipython if there was an unmatched '%' in the user's prompt
3995 4006 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3996 4007
3997 4008 * IPython/iplib.py (InteractiveShell.interact): removed the
3998 4009 ability to ask the user whether he wants to crash or not at the
3999 4010 'last line' exception handler. Calling functions at that point
4000 4011 changes the stack, and the error reports would have incorrect
4001 4012 tracebacks.
4002 4013
4003 4014 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4004 4015 pass through a peger a pretty-printed form of any object. After a
4005 4016 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4006 4017
4007 4018 2003-04-14 Fernando Perez <fperez@colorado.edu>
4008 4019
4009 4020 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4010 4021 all files in ~ would be modified at first install (instead of
4011 4022 ~/.ipython). This could be potentially disastrous, as the
4012 4023 modification (make line-endings native) could damage binary files.
4013 4024
4014 4025 2003-04-10 Fernando Perez <fperez@colorado.edu>
4015 4026
4016 4027 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4017 4028 handle only lines which are invalid python. This now means that
4018 4029 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4019 4030 for the bug report.
4020 4031
4021 4032 2003-04-01 Fernando Perez <fperez@colorado.edu>
4022 4033
4023 4034 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4024 4035 where failing to set sys.last_traceback would crash pdb.pm().
4025 4036 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4026 4037 report.
4027 4038
4028 4039 2003-03-25 Fernando Perez <fperez@colorado.edu>
4029 4040
4030 4041 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4031 4042 before printing it (it had a lot of spurious blank lines at the
4032 4043 end).
4033 4044
4034 4045 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4035 4046 output would be sent 21 times! Obviously people don't use this
4036 4047 too often, or I would have heard about it.
4037 4048
4038 4049 2003-03-24 Fernando Perez <fperez@colorado.edu>
4039 4050
4040 4051 * setup.py (scriptfiles): renamed the data_files parameter from
4041 4052 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4042 4053 for the patch.
4043 4054
4044 4055 2003-03-20 Fernando Perez <fperez@colorado.edu>
4045 4056
4046 4057 * IPython/genutils.py (error): added error() and fatal()
4047 4058 functions.
4048 4059
4049 4060 2003-03-18 *** Released version 0.2.15pre3
4050 4061
4051 4062 2003-03-18 Fernando Perez <fperez@colorado.edu>
4052 4063
4053 4064 * setupext/install_data_ext.py
4054 4065 (install_data_ext.initialize_options): Class contributed by Jack
4055 4066 Moffit for fixing the old distutils hack. He is sending this to
4056 4067 the distutils folks so in the future we may not need it as a
4057 4068 private fix.
4058 4069
4059 4070 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4060 4071 changes for Debian packaging. See his patch for full details.
4061 4072 The old distutils hack of making the ipythonrc* files carry a
4062 4073 bogus .py extension is gone, at last. Examples were moved to a
4063 4074 separate subdir under doc/, and the separate executable scripts
4064 4075 now live in their own directory. Overall a great cleanup. The
4065 4076 manual was updated to use the new files, and setup.py has been
4066 4077 fixed for this setup.
4067 4078
4068 4079 * IPython/PyColorize.py (Parser.usage): made non-executable and
4069 4080 created a pycolor wrapper around it to be included as a script.
4070 4081
4071 4082 2003-03-12 *** Released version 0.2.15pre2
4072 4083
4073 4084 2003-03-12 Fernando Perez <fperez@colorado.edu>
4074 4085
4075 4086 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4076 4087 long-standing problem with garbage characters in some terminals.
4077 4088 The issue was really that the \001 and \002 escapes must _only_ be
4078 4089 passed to input prompts (which call readline), but _never_ to
4079 4090 normal text to be printed on screen. I changed ColorANSI to have
4080 4091 two classes: TermColors and InputTermColors, each with the
4081 4092 appropriate escapes for input prompts or normal text. The code in
4082 4093 Prompts.py got slightly more complicated, but this very old and
4083 4094 annoying bug is finally fixed.
4084 4095
4085 4096 All the credit for nailing down the real origin of this problem
4086 4097 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4087 4098 *Many* thanks to him for spending quite a bit of effort on this.
4088 4099
4089 4100 2003-03-05 *** Released version 0.2.15pre1
4090 4101
4091 4102 2003-03-03 Fernando Perez <fperez@colorado.edu>
4092 4103
4093 4104 * IPython/FakeModule.py: Moved the former _FakeModule to a
4094 4105 separate file, because it's also needed by Magic (to fix a similar
4095 4106 pickle-related issue in @run).
4096 4107
4097 4108 2003-03-02 Fernando Perez <fperez@colorado.edu>
4098 4109
4099 4110 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4100 4111 the autocall option at runtime.
4101 4112 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4102 4113 across Magic.py to start separating Magic from InteractiveShell.
4103 4114 (Magic._ofind): Fixed to return proper namespace for dotted
4104 4115 names. Before, a dotted name would always return 'not currently
4105 4116 defined', because it would find the 'parent'. s.x would be found,
4106 4117 but since 'x' isn't defined by itself, it would get confused.
4107 4118 (Magic.magic_run): Fixed pickling problems reported by Ralf
4108 4119 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4109 4120 that I'd used when Mike Heeter reported similar issues at the
4110 4121 top-level, but now for @run. It boils down to injecting the
4111 4122 namespace where code is being executed with something that looks
4112 4123 enough like a module to fool pickle.dump(). Since a pickle stores
4113 4124 a named reference to the importing module, we need this for
4114 4125 pickles to save something sensible.
4115 4126
4116 4127 * IPython/ipmaker.py (make_IPython): added an autocall option.
4117 4128
4118 4129 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4119 4130 the auto-eval code. Now autocalling is an option, and the code is
4120 4131 also vastly safer. There is no more eval() involved at all.
4121 4132
4122 4133 2003-03-01 Fernando Perez <fperez@colorado.edu>
4123 4134
4124 4135 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4125 4136 dict with named keys instead of a tuple.
4126 4137
4127 4138 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4128 4139
4129 4140 * setup.py (make_shortcut): Fixed message about directories
4130 4141 created during Windows installation (the directories were ok, just
4131 4142 the printed message was misleading). Thanks to Chris Liechti
4132 4143 <cliechti-AT-gmx.net> for the heads up.
4133 4144
4134 4145 2003-02-21 Fernando Perez <fperez@colorado.edu>
4135 4146
4136 4147 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4137 4148 of ValueError exception when checking for auto-execution. This
4138 4149 one is raised by things like Numeric arrays arr.flat when the
4139 4150 array is non-contiguous.
4140 4151
4141 4152 2003-01-31 Fernando Perez <fperez@colorado.edu>
4142 4153
4143 4154 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4144 4155 not return any value at all (even though the command would get
4145 4156 executed).
4146 4157 (xsys): Flush stdout right after printing the command to ensure
4147 4158 proper ordering of commands and command output in the total
4148 4159 output.
4149 4160 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4150 4161 system/getoutput as defaults. The old ones are kept for
4151 4162 compatibility reasons, so no code which uses this library needs
4152 4163 changing.
4153 4164
4154 4165 2003-01-27 *** Released version 0.2.14
4155 4166
4156 4167 2003-01-25 Fernando Perez <fperez@colorado.edu>
4157 4168
4158 4169 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4159 4170 functions defined in previous edit sessions could not be re-edited
4160 4171 (because the temp files were immediately removed). Now temp files
4161 4172 are removed only at IPython's exit.
4162 4173 (Magic.magic_run): Improved @run to perform shell-like expansions
4163 4174 on its arguments (~users and $VARS). With this, @run becomes more
4164 4175 like a normal command-line.
4165 4176
4166 4177 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4167 4178 bugs related to embedding and cleaned up that code. A fairly
4168 4179 important one was the impossibility to access the global namespace
4169 4180 through the embedded IPython (only local variables were visible).
4170 4181
4171 4182 2003-01-14 Fernando Perez <fperez@colorado.edu>
4172 4183
4173 4184 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4174 4185 auto-calling to be a bit more conservative. Now it doesn't get
4175 4186 triggered if any of '!=()<>' are in the rest of the input line, to
4176 4187 allow comparing callables. Thanks to Alex for the heads up.
4177 4188
4178 4189 2003-01-07 Fernando Perez <fperez@colorado.edu>
4179 4190
4180 4191 * IPython/genutils.py (page): fixed estimation of the number of
4181 4192 lines in a string to be paged to simply count newlines. This
4182 4193 prevents over-guessing due to embedded escape sequences. A better
4183 4194 long-term solution would involve stripping out the control chars
4184 4195 for the count, but it's potentially so expensive I just don't
4185 4196 think it's worth doing.
4186 4197
4187 4198 2002-12-19 *** Released version 0.2.14pre50
4188 4199
4189 4200 2002-12-19 Fernando Perez <fperez@colorado.edu>
4190 4201
4191 4202 * tools/release (version): Changed release scripts to inform
4192 4203 Andrea and build a NEWS file with a list of recent changes.
4193 4204
4194 4205 * IPython/ColorANSI.py (__all__): changed terminal detection
4195 4206 code. Seems to work better for xterms without breaking
4196 4207 konsole. Will need more testing to determine if WinXP and Mac OSX
4197 4208 also work ok.
4198 4209
4199 4210 2002-12-18 *** Released version 0.2.14pre49
4200 4211
4201 4212 2002-12-18 Fernando Perez <fperez@colorado.edu>
4202 4213
4203 4214 * Docs: added new info about Mac OSX, from Andrea.
4204 4215
4205 4216 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4206 4217 allow direct plotting of python strings whose format is the same
4207 4218 of gnuplot data files.
4208 4219
4209 4220 2002-12-16 Fernando Perez <fperez@colorado.edu>
4210 4221
4211 4222 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4212 4223 value of exit question to be acknowledged.
4213 4224
4214 4225 2002-12-03 Fernando Perez <fperez@colorado.edu>
4215 4226
4216 4227 * IPython/ipmaker.py: removed generators, which had been added
4217 4228 by mistake in an earlier debugging run. This was causing trouble
4218 4229 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4219 4230 for pointing this out.
4220 4231
4221 4232 2002-11-17 Fernando Perez <fperez@colorado.edu>
4222 4233
4223 4234 * Manual: updated the Gnuplot section.
4224 4235
4225 4236 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4226 4237 a much better split of what goes in Runtime and what goes in
4227 4238 Interactive.
4228 4239
4229 4240 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4230 4241 being imported from iplib.
4231 4242
4232 4243 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4233 4244 for command-passing. Now the global Gnuplot instance is called
4234 4245 'gp' instead of 'g', which was really a far too fragile and
4235 4246 common name.
4236 4247
4237 4248 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4238 4249 bounding boxes generated by Gnuplot for square plots.
4239 4250
4240 4251 * IPython/genutils.py (popkey): new function added. I should
4241 4252 suggest this on c.l.py as a dict method, it seems useful.
4242 4253
4243 4254 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4244 4255 to transparently handle PostScript generation. MUCH better than
4245 4256 the previous plot_eps/replot_eps (which I removed now). The code
4246 4257 is also fairly clean and well documented now (including
4247 4258 docstrings).
4248 4259
4249 4260 2002-11-13 Fernando Perez <fperez@colorado.edu>
4250 4261
4251 4262 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4252 4263 (inconsistent with options).
4253 4264
4254 4265 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4255 4266 manually disabled, I don't know why. Fixed it.
4256 4267 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4257 4268 eps output.
4258 4269
4259 4270 2002-11-12 Fernando Perez <fperez@colorado.edu>
4260 4271
4261 4272 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4262 4273 don't propagate up to caller. Fixes crash reported by François
4263 4274 Pinard.
4264 4275
4265 4276 2002-11-09 Fernando Perez <fperez@colorado.edu>
4266 4277
4267 4278 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4268 4279 history file for new users.
4269 4280 (make_IPython): fixed bug where initial install would leave the
4270 4281 user running in the .ipython dir.
4271 4282 (make_IPython): fixed bug where config dir .ipython would be
4272 4283 created regardless of the given -ipythondir option. Thanks to Cory
4273 4284 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4274 4285
4275 4286 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4276 4287 type confirmations. Will need to use it in all of IPython's code
4277 4288 consistently.
4278 4289
4279 4290 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4280 4291 context to print 31 lines instead of the default 5. This will make
4281 4292 the crash reports extremely detailed in case the problem is in
4282 4293 libraries I don't have access to.
4283 4294
4284 4295 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4285 4296 line of defense' code to still crash, but giving users fair
4286 4297 warning. I don't want internal errors to go unreported: if there's
4287 4298 an internal problem, IPython should crash and generate a full
4288 4299 report.
4289 4300
4290 4301 2002-11-08 Fernando Perez <fperez@colorado.edu>
4291 4302
4292 4303 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4293 4304 otherwise uncaught exceptions which can appear if people set
4294 4305 sys.stdout to something badly broken. Thanks to a crash report
4295 4306 from henni-AT-mail.brainbot.com.
4296 4307
4297 4308 2002-11-04 Fernando Perez <fperez@colorado.edu>
4298 4309
4299 4310 * IPython/iplib.py (InteractiveShell.interact): added
4300 4311 __IPYTHON__active to the builtins. It's a flag which goes on when
4301 4312 the interaction starts and goes off again when it stops. This
4302 4313 allows embedding code to detect being inside IPython. Before this
4303 4314 was done via __IPYTHON__, but that only shows that an IPython
4304 4315 instance has been created.
4305 4316
4306 4317 * IPython/Magic.py (Magic.magic_env): I realized that in a
4307 4318 UserDict, instance.data holds the data as a normal dict. So I
4308 4319 modified @env to return os.environ.data instead of rebuilding a
4309 4320 dict by hand.
4310 4321
4311 4322 2002-11-02 Fernando Perez <fperez@colorado.edu>
4312 4323
4313 4324 * IPython/genutils.py (warn): changed so that level 1 prints no
4314 4325 header. Level 2 is now the default (with 'WARNING' header, as
4315 4326 before). I think I tracked all places where changes were needed in
4316 4327 IPython, but outside code using the old level numbering may have
4317 4328 broken.
4318 4329
4319 4330 * IPython/iplib.py (InteractiveShell.runcode): added this to
4320 4331 handle the tracebacks in SystemExit traps correctly. The previous
4321 4332 code (through interact) was printing more of the stack than
4322 4333 necessary, showing IPython internal code to the user.
4323 4334
4324 4335 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4325 4336 default. Now that the default at the confirmation prompt is yes,
4326 4337 it's not so intrusive. François' argument that ipython sessions
4327 4338 tend to be complex enough not to lose them from an accidental C-d,
4328 4339 is a valid one.
4329 4340
4330 4341 * IPython/iplib.py (InteractiveShell.interact): added a
4331 4342 showtraceback() call to the SystemExit trap, and modified the exit
4332 4343 confirmation to have yes as the default.
4333 4344
4334 4345 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4335 4346 this file. It's been gone from the code for a long time, this was
4336 4347 simply leftover junk.
4337 4348
4338 4349 2002-11-01 Fernando Perez <fperez@colorado.edu>
4339 4350
4340 4351 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4341 4352 added. If set, IPython now traps EOF and asks for
4342 4353 confirmation. After a request by François Pinard.
4343 4354
4344 4355 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4345 4356 of @abort, and with a new (better) mechanism for handling the
4346 4357 exceptions.
4347 4358
4348 4359 2002-10-27 Fernando Perez <fperez@colorado.edu>
4349 4360
4350 4361 * IPython/usage.py (__doc__): updated the --help information and
4351 4362 the ipythonrc file to indicate that -log generates
4352 4363 ./ipython.log. Also fixed the corresponding info in @logstart.
4353 4364 This and several other fixes in the manuals thanks to reports by
4354 4365 François Pinard <pinard-AT-iro.umontreal.ca>.
4355 4366
4356 4367 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4357 4368 refer to @logstart (instead of @log, which doesn't exist).
4358 4369
4359 4370 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4360 4371 AttributeError crash. Thanks to Christopher Armstrong
4361 4372 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4362 4373 introduced recently (in 0.2.14pre37) with the fix to the eval
4363 4374 problem mentioned below.
4364 4375
4365 4376 2002-10-17 Fernando Perez <fperez@colorado.edu>
4366 4377
4367 4378 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4368 4379 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4369 4380
4370 4381 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4371 4382 this function to fix a problem reported by Alex Schmolck. He saw
4372 4383 it with list comprehensions and generators, which were getting
4373 4384 called twice. The real problem was an 'eval' call in testing for
4374 4385 automagic which was evaluating the input line silently.
4375 4386
4376 4387 This is a potentially very nasty bug, if the input has side
4377 4388 effects which must not be repeated. The code is much cleaner now,
4378 4389 without any blanket 'except' left and with a regexp test for
4379 4390 actual function names.
4380 4391
4381 4392 But an eval remains, which I'm not fully comfortable with. I just
4382 4393 don't know how to find out if an expression could be a callable in
4383 4394 the user's namespace without doing an eval on the string. However
4384 4395 that string is now much more strictly checked so that no code
4385 4396 slips by, so the eval should only happen for things that can
4386 4397 really be only function/method names.
4387 4398
4388 4399 2002-10-15 Fernando Perez <fperez@colorado.edu>
4389 4400
4390 4401 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4391 4402 OSX information to main manual, removed README_Mac_OSX file from
4392 4403 distribution. Also updated credits for recent additions.
4393 4404
4394 4405 2002-10-10 Fernando Perez <fperez@colorado.edu>
4395 4406
4396 4407 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4397 4408 terminal-related issues. Many thanks to Andrea Riciputi
4398 4409 <andrea.riciputi-AT-libero.it> for writing it.
4399 4410
4400 4411 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4401 4412 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4402 4413
4403 4414 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4404 4415 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4405 4416 <syver-en-AT-online.no> who both submitted patches for this problem.
4406 4417
4407 4418 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4408 4419 global embedding to make sure that things don't overwrite user
4409 4420 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4410 4421
4411 4422 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4412 4423 compatibility. Thanks to Hayden Callow
4413 4424 <h.callow-AT-elec.canterbury.ac.nz>
4414 4425
4415 4426 2002-10-04 Fernando Perez <fperez@colorado.edu>
4416 4427
4417 4428 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4418 4429 Gnuplot.File objects.
4419 4430
4420 4431 2002-07-23 Fernando Perez <fperez@colorado.edu>
4421 4432
4422 4433 * IPython/genutils.py (timing): Added timings() and timing() for
4423 4434 quick access to the most commonly needed data, the execution
4424 4435 times. Old timing() renamed to timings_out().
4425 4436
4426 4437 2002-07-18 Fernando Perez <fperez@colorado.edu>
4427 4438
4428 4439 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4429 4440 bug with nested instances disrupting the parent's tab completion.
4430 4441
4431 4442 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4432 4443 all_completions code to begin the emacs integration.
4433 4444
4434 4445 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4435 4446 argument to allow titling individual arrays when plotting.
4436 4447
4437 4448 2002-07-15 Fernando Perez <fperez@colorado.edu>
4438 4449
4439 4450 * setup.py (make_shortcut): changed to retrieve the value of
4440 4451 'Program Files' directory from the registry (this value changes in
4441 4452 non-english versions of Windows). Thanks to Thomas Fanslau
4442 4453 <tfanslau-AT-gmx.de> for the report.
4443 4454
4444 4455 2002-07-10 Fernando Perez <fperez@colorado.edu>
4445 4456
4446 4457 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4447 4458 a bug in pdb, which crashes if a line with only whitespace is
4448 4459 entered. Bug report submitted to sourceforge.
4449 4460
4450 4461 2002-07-09 Fernando Perez <fperez@colorado.edu>
4451 4462
4452 4463 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4453 4464 reporting exceptions (it's a bug in inspect.py, I just set a
4454 4465 workaround).
4455 4466
4456 4467 2002-07-08 Fernando Perez <fperez@colorado.edu>
4457 4468
4458 4469 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4459 4470 __IPYTHON__ in __builtins__ to show up in user_ns.
4460 4471
4461 4472 2002-07-03 Fernando Perez <fperez@colorado.edu>
4462 4473
4463 4474 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4464 4475 name from @gp_set_instance to @gp_set_default.
4465 4476
4466 4477 * IPython/ipmaker.py (make_IPython): default editor value set to
4467 4478 '0' (a string), to match the rc file. Otherwise will crash when
4468 4479 .strip() is called on it.
4469 4480
4470 4481
4471 4482 2002-06-28 Fernando Perez <fperez@colorado.edu>
4472 4483
4473 4484 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4474 4485 of files in current directory when a file is executed via
4475 4486 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4476 4487
4477 4488 * setup.py (manfiles): fix for rpm builds, submitted by RA
4478 4489 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4479 4490
4480 4491 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4481 4492 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4482 4493 string!). A. Schmolck caught this one.
4483 4494
4484 4495 2002-06-27 Fernando Perez <fperez@colorado.edu>
4485 4496
4486 4497 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4487 4498 defined files at the cmd line. __name__ wasn't being set to
4488 4499 __main__.
4489 4500
4490 4501 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4491 4502 regular lists and tuples besides Numeric arrays.
4492 4503
4493 4504 * IPython/Prompts.py (CachedOutput.__call__): Added output
4494 4505 supression for input ending with ';'. Similar to Mathematica and
4495 4506 Matlab. The _* vars and Out[] list are still updated, just like
4496 4507 Mathematica behaves.
4497 4508
4498 4509 2002-06-25 Fernando Perez <fperez@colorado.edu>
4499 4510
4500 4511 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4501 4512 .ini extensions for profiels under Windows.
4502 4513
4503 4514 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4504 4515 string form. Fix contributed by Alexander Schmolck
4505 4516 <a.schmolck-AT-gmx.net>
4506 4517
4507 4518 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4508 4519 pre-configured Gnuplot instance.
4509 4520
4510 4521 2002-06-21 Fernando Perez <fperez@colorado.edu>
4511 4522
4512 4523 * IPython/numutils.py (exp_safe): new function, works around the
4513 4524 underflow problems in Numeric.
4514 4525 (log2): New fn. Safe log in base 2: returns exact integer answer
4515 4526 for exact integer powers of 2.
4516 4527
4517 4528 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4518 4529 properly.
4519 4530
4520 4531 2002-06-20 Fernando Perez <fperez@colorado.edu>
4521 4532
4522 4533 * IPython/genutils.py (timing): new function like
4523 4534 Mathematica's. Similar to time_test, but returns more info.
4524 4535
4525 4536 2002-06-18 Fernando Perez <fperez@colorado.edu>
4526 4537
4527 4538 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4528 4539 according to Mike Heeter's suggestions.
4529 4540
4530 4541 2002-06-16 Fernando Perez <fperez@colorado.edu>
4531 4542
4532 4543 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4533 4544 system. GnuplotMagic is gone as a user-directory option. New files
4534 4545 make it easier to use all the gnuplot stuff both from external
4535 4546 programs as well as from IPython. Had to rewrite part of
4536 4547 hardcopy() b/c of a strange bug: often the ps files simply don't
4537 4548 get created, and require a repeat of the command (often several
4538 4549 times).
4539 4550
4540 4551 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4541 4552 resolve output channel at call time, so that if sys.stderr has
4542 4553 been redirected by user this gets honored.
4543 4554
4544 4555 2002-06-13 Fernando Perez <fperez@colorado.edu>
4545 4556
4546 4557 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4547 4558 IPShell. Kept a copy with the old names to avoid breaking people's
4548 4559 embedded code.
4549 4560
4550 4561 * IPython/ipython: simplified it to the bare minimum after
4551 4562 Holger's suggestions. Added info about how to use it in
4552 4563 PYTHONSTARTUP.
4553 4564
4554 4565 * IPython/Shell.py (IPythonShell): changed the options passing
4555 4566 from a string with funky %s replacements to a straight list. Maybe
4556 4567 a bit more typing, but it follows sys.argv conventions, so there's
4557 4568 less special-casing to remember.
4558 4569
4559 4570 2002-06-12 Fernando Perez <fperez@colorado.edu>
4560 4571
4561 4572 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4562 4573 command. Thanks to a suggestion by Mike Heeter.
4563 4574 (Magic.magic_pfile): added behavior to look at filenames if given
4564 4575 arg is not a defined object.
4565 4576 (Magic.magic_save): New @save function to save code snippets. Also
4566 4577 a Mike Heeter idea.
4567 4578
4568 4579 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4569 4580 plot() and replot(). Much more convenient now, especially for
4570 4581 interactive use.
4571 4582
4572 4583 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4573 4584 filenames.
4574 4585
4575 4586 2002-06-02 Fernando Perez <fperez@colorado.edu>
4576 4587
4577 4588 * IPython/Struct.py (Struct.__init__): modified to admit
4578 4589 initialization via another struct.
4579 4590
4580 4591 * IPython/genutils.py (SystemExec.__init__): New stateful
4581 4592 interface to xsys and bq. Useful for writing system scripts.
4582 4593
4583 4594 2002-05-30 Fernando Perez <fperez@colorado.edu>
4584 4595
4585 4596 * MANIFEST.in: Changed docfile selection to exclude all the lyx
4586 4597 documents. This will make the user download smaller (it's getting
4587 4598 too big).
4588 4599
4589 4600 2002-05-29 Fernando Perez <fperez@colorado.edu>
4590 4601
4591 4602 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
4592 4603 fix problems with shelve and pickle. Seems to work, but I don't
4593 4604 know if corner cases break it. Thanks to Mike Heeter
4594 4605 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
4595 4606
4596 4607 2002-05-24 Fernando Perez <fperez@colorado.edu>
4597 4608
4598 4609 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
4599 4610 macros having broken.
4600 4611
4601 4612 2002-05-21 Fernando Perez <fperez@colorado.edu>
4602 4613
4603 4614 * IPython/Magic.py (Magic.magic_logstart): fixed recently
4604 4615 introduced logging bug: all history before logging started was
4605 4616 being written one character per line! This came from the redesign
4606 4617 of the input history as a special list which slices to strings,
4607 4618 not to lists.
4608 4619
4609 4620 2002-05-20 Fernando Perez <fperez@colorado.edu>
4610 4621
4611 4622 * IPython/Prompts.py (CachedOutput.__init__): made the color table
4612 4623 be an attribute of all classes in this module. The design of these
4613 4624 classes needs some serious overhauling.
4614 4625
4615 4626 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
4616 4627 which was ignoring '_' in option names.
4617 4628
4618 4629 * IPython/ultraTB.py (FormattedTB.__init__): Changed
4619 4630 'Verbose_novars' to 'Context' and made it the new default. It's a
4620 4631 bit more readable and also safer than verbose.
4621 4632
4622 4633 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
4623 4634 triple-quoted strings.
4624 4635
4625 4636 * IPython/OInspect.py (__all__): new module exposing the object
4626 4637 introspection facilities. Now the corresponding magics are dummy
4627 4638 wrappers around this. Having this module will make it much easier
4628 4639 to put these functions into our modified pdb.
4629 4640 This new object inspector system uses the new colorizing module,
4630 4641 so source code and other things are nicely syntax highlighted.
4631 4642
4632 4643 2002-05-18 Fernando Perez <fperez@colorado.edu>
4633 4644
4634 4645 * IPython/ColorANSI.py: Split the coloring tools into a separate
4635 4646 module so I can use them in other code easier (they were part of
4636 4647 ultraTB).
4637 4648
4638 4649 2002-05-17 Fernando Perez <fperez@colorado.edu>
4639 4650
4640 4651 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4641 4652 fixed it to set the global 'g' also to the called instance, as
4642 4653 long as 'g' was still a gnuplot instance (so it doesn't overwrite
4643 4654 user's 'g' variables).
4644 4655
4645 4656 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
4646 4657 global variables (aliases to _ih,_oh) so that users which expect
4647 4658 In[5] or Out[7] to work aren't unpleasantly surprised.
4648 4659 (InputList.__getslice__): new class to allow executing slices of
4649 4660 input history directly. Very simple class, complements the use of
4650 4661 macros.
4651 4662
4652 4663 2002-05-16 Fernando Perez <fperez@colorado.edu>
4653 4664
4654 4665 * setup.py (docdirbase): make doc directory be just doc/IPython
4655 4666 without version numbers, it will reduce clutter for users.
4656 4667
4657 4668 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
4658 4669 execfile call to prevent possible memory leak. See for details:
4659 4670 http://mail.python.org/pipermail/python-list/2002-February/088476.html
4660 4671
4661 4672 2002-05-15 Fernando Perez <fperez@colorado.edu>
4662 4673
4663 4674 * IPython/Magic.py (Magic.magic_psource): made the object
4664 4675 introspection names be more standard: pdoc, pdef, pfile and
4665 4676 psource. They all print/page their output, and it makes
4666 4677 remembering them easier. Kept old names for compatibility as
4667 4678 aliases.
4668 4679
4669 4680 2002-05-14 Fernando Perez <fperez@colorado.edu>
4670 4681
4671 4682 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
4672 4683 what the mouse problem was. The trick is to use gnuplot with temp
4673 4684 files and NOT with pipes (for data communication), because having
4674 4685 both pipes and the mouse on is bad news.
4675 4686
4676 4687 2002-05-13 Fernando Perez <fperez@colorado.edu>
4677 4688
4678 4689 * IPython/Magic.py (Magic._ofind): fixed namespace order search
4679 4690 bug. Information would be reported about builtins even when
4680 4691 user-defined functions overrode them.
4681 4692
4682 4693 2002-05-11 Fernando Perez <fperez@colorado.edu>
4683 4694
4684 4695 * IPython/__init__.py (__all__): removed FlexCompleter from
4685 4696 __all__ so that things don't fail in platforms without readline.
4686 4697
4687 4698 2002-05-10 Fernando Perez <fperez@colorado.edu>
4688 4699
4689 4700 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
4690 4701 it requires Numeric, effectively making Numeric a dependency for
4691 4702 IPython.
4692 4703
4693 4704 * Released 0.2.13
4694 4705
4695 4706 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
4696 4707 profiler interface. Now all the major options from the profiler
4697 4708 module are directly supported in IPython, both for single
4698 4709 expressions (@prun) and for full programs (@run -p).
4699 4710
4700 4711 2002-05-09 Fernando Perez <fperez@colorado.edu>
4701 4712
4702 4713 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
4703 4714 magic properly formatted for screen.
4704 4715
4705 4716 * setup.py (make_shortcut): Changed things to put pdf version in
4706 4717 doc/ instead of doc/manual (had to change lyxport a bit).
4707 4718
4708 4719 * IPython/Magic.py (Profile.string_stats): made profile runs go
4709 4720 through pager (they are long and a pager allows searching, saving,
4710 4721 etc.)
4711 4722
4712 4723 2002-05-08 Fernando Perez <fperez@colorado.edu>
4713 4724
4714 4725 * Released 0.2.12
4715 4726
4716 4727 2002-05-06 Fernando Perez <fperez@colorado.edu>
4717 4728
4718 4729 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
4719 4730 introduced); 'hist n1 n2' was broken.
4720 4731 (Magic.magic_pdb): added optional on/off arguments to @pdb
4721 4732 (Magic.magic_run): added option -i to @run, which executes code in
4722 4733 the IPython namespace instead of a clean one. Also added @irun as
4723 4734 an alias to @run -i.
4724 4735
4725 4736 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
4726 4737 fixed (it didn't really do anything, the namespaces were wrong).
4727 4738
4728 4739 * IPython/Debugger.py (__init__): Added workaround for python 2.1
4729 4740
4730 4741 * IPython/__init__.py (__all__): Fixed package namespace, now
4731 4742 'import IPython' does give access to IPython.<all> as
4732 4743 expected. Also renamed __release__ to Release.
4733 4744
4734 4745 * IPython/Debugger.py (__license__): created new Pdb class which
4735 4746 functions like a drop-in for the normal pdb.Pdb but does NOT
4736 4747 import readline by default. This way it doesn't muck up IPython's
4737 4748 readline handling, and now tab-completion finally works in the
4738 4749 debugger -- sort of. It completes things globally visible, but the
4739 4750 completer doesn't track the stack as pdb walks it. That's a bit
4740 4751 tricky, and I'll have to implement it later.
4741 4752
4742 4753 2002-05-05 Fernando Perez <fperez@colorado.edu>
4743 4754
4744 4755 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
4745 4756 magic docstrings when printed via ? (explicit \'s were being
4746 4757 printed).
4747 4758
4748 4759 * IPython/ipmaker.py (make_IPython): fixed namespace
4749 4760 identification bug. Now variables loaded via logs or command-line
4750 4761 files are recognized in the interactive namespace by @who.
4751 4762
4752 4763 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
4753 4764 log replay system stemming from the string form of Structs.
4754 4765
4755 4766 * IPython/Magic.py (Macro.__init__): improved macros to properly
4756 4767 handle magic commands in them.
4757 4768 (Magic.magic_logstart): usernames are now expanded so 'logstart
4758 4769 ~/mylog' now works.
4759 4770
4760 4771 * IPython/iplib.py (complete): fixed bug where paths starting with
4761 4772 '/' would be completed as magic names.
4762 4773
4763 4774 2002-05-04 Fernando Perez <fperez@colorado.edu>
4764 4775
4765 4776 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
4766 4777 allow running full programs under the profiler's control.
4767 4778
4768 4779 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
4769 4780 mode to report exceptions verbosely but without formatting
4770 4781 variables. This addresses the issue of ipython 'freezing' (it's
4771 4782 not frozen, but caught in an expensive formatting loop) when huge
4772 4783 variables are in the context of an exception.
4773 4784 (VerboseTB.text): Added '--->' markers at line where exception was
4774 4785 triggered. Much clearer to read, especially in NoColor modes.
4775 4786
4776 4787 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
4777 4788 implemented in reverse when changing to the new parse_options().
4778 4789
4779 4790 2002-05-03 Fernando Perez <fperez@colorado.edu>
4780 4791
4781 4792 * IPython/Magic.py (Magic.parse_options): new function so that
4782 4793 magics can parse options easier.
4783 4794 (Magic.magic_prun): new function similar to profile.run(),
4784 4795 suggested by Chris Hart.
4785 4796 (Magic.magic_cd): fixed behavior so that it only changes if
4786 4797 directory actually is in history.
4787 4798
4788 4799 * IPython/usage.py (__doc__): added information about potential
4789 4800 slowness of Verbose exception mode when there are huge data
4790 4801 structures to be formatted (thanks to Archie Paulson).
4791 4802
4792 4803 * IPython/ipmaker.py (make_IPython): Changed default logging
4793 4804 (when simply called with -log) to use curr_dir/ipython.log in
4794 4805 rotate mode. Fixed crash which was occuring with -log before
4795 4806 (thanks to Jim Boyle).
4796 4807
4797 4808 2002-05-01 Fernando Perez <fperez@colorado.edu>
4798 4809
4799 4810 * Released 0.2.11 for these fixes (mainly the ultraTB one which
4800 4811 was nasty -- though somewhat of a corner case).
4801 4812
4802 4813 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
4803 4814 text (was a bug).
4804 4815
4805 4816 2002-04-30 Fernando Perez <fperez@colorado.edu>
4806 4817
4807 4818 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
4808 4819 a print after ^D or ^C from the user so that the In[] prompt
4809 4820 doesn't over-run the gnuplot one.
4810 4821
4811 4822 2002-04-29 Fernando Perez <fperez@colorado.edu>
4812 4823
4813 4824 * Released 0.2.10
4814 4825
4815 4826 * IPython/__release__.py (version): get date dynamically.
4816 4827
4817 4828 * Misc. documentation updates thanks to Arnd's comments. Also ran
4818 4829 a full spellcheck on the manual (hadn't been done in a while).
4819 4830
4820 4831 2002-04-27 Fernando Perez <fperez@colorado.edu>
4821 4832
4822 4833 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
4823 4834 starting a log in mid-session would reset the input history list.
4824 4835
4825 4836 2002-04-26 Fernando Perez <fperez@colorado.edu>
4826 4837
4827 4838 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
4828 4839 all files were being included in an update. Now anything in
4829 4840 UserConfig that matches [A-Za-z]*.py will go (this excludes
4830 4841 __init__.py)
4831 4842
4832 4843 2002-04-25 Fernando Perez <fperez@colorado.edu>
4833 4844
4834 4845 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
4835 4846 to __builtins__ so that any form of embedded or imported code can
4836 4847 test for being inside IPython.
4837 4848
4838 4849 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
4839 4850 changed to GnuplotMagic because it's now an importable module,
4840 4851 this makes the name follow that of the standard Gnuplot module.
4841 4852 GnuplotMagic can now be loaded at any time in mid-session.
4842 4853
4843 4854 2002-04-24 Fernando Perez <fperez@colorado.edu>
4844 4855
4845 4856 * IPython/numutils.py: removed SIUnits. It doesn't properly set
4846 4857 the globals (IPython has its own namespace) and the
4847 4858 PhysicalQuantity stuff is much better anyway.
4848 4859
4849 4860 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
4850 4861 embedding example to standard user directory for
4851 4862 distribution. Also put it in the manual.
4852 4863
4853 4864 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
4854 4865 instance as first argument (so it doesn't rely on some obscure
4855 4866 hidden global).
4856 4867
4857 4868 * IPython/UserConfig/ipythonrc.py: put () back in accepted
4858 4869 delimiters. While it prevents ().TAB from working, it allows
4859 4870 completions in open (... expressions. This is by far a more common
4860 4871 case.
4861 4872
4862 4873 2002-04-23 Fernando Perez <fperez@colorado.edu>
4863 4874
4864 4875 * IPython/Extensions/InterpreterPasteInput.py: new
4865 4876 syntax-processing module for pasting lines with >>> or ... at the
4866 4877 start.
4867 4878
4868 4879 * IPython/Extensions/PhysicalQ_Interactive.py
4869 4880 (PhysicalQuantityInteractive.__int__): fixed to work with either
4870 4881 Numeric or math.
4871 4882
4872 4883 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
4873 4884 provided profiles. Now we have:
4874 4885 -math -> math module as * and cmath with its own namespace.
4875 4886 -numeric -> Numeric as *, plus gnuplot & grace
4876 4887 -physics -> same as before
4877 4888
4878 4889 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
4879 4890 user-defined magics wouldn't be found by @magic if they were
4880 4891 defined as class methods. Also cleaned up the namespace search
4881 4892 logic and the string building (to use %s instead of many repeated
4882 4893 string adds).
4883 4894
4884 4895 * IPython/UserConfig/example-magic.py (magic_foo): updated example
4885 4896 of user-defined magics to operate with class methods (cleaner, in
4886 4897 line with the gnuplot code).
4887 4898
4888 4899 2002-04-22 Fernando Perez <fperez@colorado.edu>
4889 4900
4890 4901 * setup.py: updated dependency list so that manual is updated when
4891 4902 all included files change.
4892 4903
4893 4904 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
4894 4905 the delimiter removal option (the fix is ugly right now).
4895 4906
4896 4907 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
4897 4908 all of the math profile (quicker loading, no conflict between
4898 4909 g-9.8 and g-gnuplot).
4899 4910
4900 4911 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
4901 4912 name of post-mortem files to IPython_crash_report.txt.
4902 4913
4903 4914 * Cleanup/update of the docs. Added all the new readline info and
4904 4915 formatted all lists as 'real lists'.
4905 4916
4906 4917 * IPython/ipmaker.py (make_IPython): removed now-obsolete
4907 4918 tab-completion options, since the full readline parse_and_bind is
4908 4919 now accessible.
4909 4920
4910 4921 * IPython/iplib.py (InteractiveShell.init_readline): Changed
4911 4922 handling of readline options. Now users can specify any string to
4912 4923 be passed to parse_and_bind(), as well as the delimiters to be
4913 4924 removed.
4914 4925 (InteractiveShell.__init__): Added __name__ to the global
4915 4926 namespace so that things like Itpl which rely on its existence
4916 4927 don't crash.
4917 4928 (InteractiveShell._prefilter): Defined the default with a _ so
4918 4929 that prefilter() is easier to override, while the default one
4919 4930 remains available.
4920 4931
4921 4932 2002-04-18 Fernando Perez <fperez@colorado.edu>
4922 4933
4923 4934 * Added information about pdb in the docs.
4924 4935
4925 4936 2002-04-17 Fernando Perez <fperez@colorado.edu>
4926 4937
4927 4938 * IPython/ipmaker.py (make_IPython): added rc_override option to
4928 4939 allow passing config options at creation time which may override
4929 4940 anything set in the config files or command line. This is
4930 4941 particularly useful for configuring embedded instances.
4931 4942
4932 4943 2002-04-15 Fernando Perez <fperez@colorado.edu>
4933 4944
4934 4945 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
4935 4946 crash embedded instances because of the input cache falling out of
4936 4947 sync with the output counter.
4937 4948
4938 4949 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
4939 4950 mode which calls pdb after an uncaught exception in IPython itself.
4940 4951
4941 4952 2002-04-14 Fernando Perez <fperez@colorado.edu>
4942 4953
4943 4954 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
4944 4955 readline, fix it back after each call.
4945 4956
4946 4957 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
4947 4958 method to force all access via __call__(), which guarantees that
4948 4959 traceback references are properly deleted.
4949 4960
4950 4961 * IPython/Prompts.py (CachedOutput._display): minor fixes to
4951 4962 improve printing when pprint is in use.
4952 4963
4953 4964 2002-04-13 Fernando Perez <fperez@colorado.edu>
4954 4965
4955 4966 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
4956 4967 exceptions aren't caught anymore. If the user triggers one, he
4957 4968 should know why he's doing it and it should go all the way up,
4958 4969 just like any other exception. So now @abort will fully kill the
4959 4970 embedded interpreter and the embedding code (unless that happens
4960 4971 to catch SystemExit).
4961 4972
4962 4973 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4963 4974 and a debugger() method to invoke the interactive pdb debugger
4964 4975 after printing exception information. Also added the corresponding
4965 4976 -pdb option and @pdb magic to control this feature, and updated
4966 4977 the docs. After a suggestion from Christopher Hart
4967 4978 (hart-AT-caltech.edu).
4968 4979
4969 4980 2002-04-12 Fernando Perez <fperez@colorado.edu>
4970 4981
4971 4982 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4972 4983 the exception handlers defined by the user (not the CrashHandler)
4973 4984 so that user exceptions don't trigger an ipython bug report.
4974 4985
4975 4986 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4976 4987 configurable (it should have always been so).
4977 4988
4978 4989 2002-03-26 Fernando Perez <fperez@colorado.edu>
4979 4990
4980 4991 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4981 4992 and there to fix embedding namespace issues. This should all be
4982 4993 done in a more elegant way.
4983 4994
4984 4995 2002-03-25 Fernando Perez <fperez@colorado.edu>
4985 4996
4986 4997 * IPython/genutils.py (get_home_dir): Try to make it work under
4987 4998 win9x also.
4988 4999
4989 5000 2002-03-20 Fernando Perez <fperez@colorado.edu>
4990 5001
4991 5002 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4992 5003 sys.displayhook untouched upon __init__.
4993 5004
4994 5005 2002-03-19 Fernando Perez <fperez@colorado.edu>
4995 5006
4996 5007 * Released 0.2.9 (for embedding bug, basically).
4997 5008
4998 5009 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4999 5010 exceptions so that enclosing shell's state can be restored.
5000 5011
5001 5012 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5002 5013 naming conventions in the .ipython/ dir.
5003 5014
5004 5015 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5005 5016 from delimiters list so filenames with - in them get expanded.
5006 5017
5007 5018 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5008 5019 sys.displayhook not being properly restored after an embedded call.
5009 5020
5010 5021 2002-03-18 Fernando Perez <fperez@colorado.edu>
5011 5022
5012 5023 * Released 0.2.8
5013 5024
5014 5025 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5015 5026 some files weren't being included in a -upgrade.
5016 5027 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5017 5028 on' so that the first tab completes.
5018 5029 (InteractiveShell.handle_magic): fixed bug with spaces around
5019 5030 quotes breaking many magic commands.
5020 5031
5021 5032 * setup.py: added note about ignoring the syntax error messages at
5022 5033 installation.
5023 5034
5024 5035 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5025 5036 streamlining the gnuplot interface, now there's only one magic @gp.
5026 5037
5027 5038 2002-03-17 Fernando Perez <fperez@colorado.edu>
5028 5039
5029 5040 * IPython/UserConfig/magic_gnuplot.py: new name for the
5030 5041 example-magic_pm.py file. Much enhanced system, now with a shell
5031 5042 for communicating directly with gnuplot, one command at a time.
5032 5043
5033 5044 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5034 5045 setting __name__=='__main__'.
5035 5046
5036 5047 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5037 5048 mini-shell for accessing gnuplot from inside ipython. Should
5038 5049 extend it later for grace access too. Inspired by Arnd's
5039 5050 suggestion.
5040 5051
5041 5052 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5042 5053 calling magic functions with () in their arguments. Thanks to Arnd
5043 5054 Baecker for pointing this to me.
5044 5055
5045 5056 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5046 5057 infinitely for integer or complex arrays (only worked with floats).
5047 5058
5048 5059 2002-03-16 Fernando Perez <fperez@colorado.edu>
5049 5060
5050 5061 * setup.py: Merged setup and setup_windows into a single script
5051 5062 which properly handles things for windows users.
5052 5063
5053 5064 2002-03-15 Fernando Perez <fperez@colorado.edu>
5054 5065
5055 5066 * Big change to the manual: now the magics are all automatically
5056 5067 documented. This information is generated from their docstrings
5057 5068 and put in a latex file included by the manual lyx file. This way
5058 5069 we get always up to date information for the magics. The manual
5059 5070 now also has proper version information, also auto-synced.
5060 5071
5061 5072 For this to work, an undocumented --magic_docstrings option was added.
5062 5073
5063 5074 2002-03-13 Fernando Perez <fperez@colorado.edu>
5064 5075
5065 5076 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5066 5077 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5067 5078
5068 5079 2002-03-12 Fernando Perez <fperez@colorado.edu>
5069 5080
5070 5081 * IPython/ultraTB.py (TermColors): changed color escapes again to
5071 5082 fix the (old, reintroduced) line-wrapping bug. Basically, if
5072 5083 \001..\002 aren't given in the color escapes, lines get wrapped
5073 5084 weirdly. But giving those screws up old xterms and emacs terms. So
5074 5085 I added some logic for emacs terms to be ok, but I can't identify old
5075 5086 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5076 5087
5077 5088 2002-03-10 Fernando Perez <fperez@colorado.edu>
5078 5089
5079 5090 * IPython/usage.py (__doc__): Various documentation cleanups and
5080 5091 updates, both in usage docstrings and in the manual.
5081 5092
5082 5093 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5083 5094 handling of caching. Set minimum acceptabe value for having a
5084 5095 cache at 20 values.
5085 5096
5086 5097 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5087 5098 install_first_time function to a method, renamed it and added an
5088 5099 'upgrade' mode. Now people can update their config directory with
5089 5100 a simple command line switch (-upgrade, also new).
5090 5101
5091 5102 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5092 5103 @file (convenient for automagic users under Python >= 2.2).
5093 5104 Removed @files (it seemed more like a plural than an abbrev. of
5094 5105 'file show').
5095 5106
5096 5107 * IPython/iplib.py (install_first_time): Fixed crash if there were
5097 5108 backup files ('~') in .ipython/ install directory.
5098 5109
5099 5110 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5100 5111 system. Things look fine, but these changes are fairly
5101 5112 intrusive. Test them for a few days.
5102 5113
5103 5114 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5104 5115 the prompts system. Now all in/out prompt strings are user
5105 5116 controllable. This is particularly useful for embedding, as one
5106 5117 can tag embedded instances with particular prompts.
5107 5118
5108 5119 Also removed global use of sys.ps1/2, which now allows nested
5109 5120 embeddings without any problems. Added command-line options for
5110 5121 the prompt strings.
5111 5122
5112 5123 2002-03-08 Fernando Perez <fperez@colorado.edu>
5113 5124
5114 5125 * IPython/UserConfig/example-embed-short.py (ipshell): added
5115 5126 example file with the bare minimum code for embedding.
5116 5127
5117 5128 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5118 5129 functionality for the embeddable shell to be activated/deactivated
5119 5130 either globally or at each call.
5120 5131
5121 5132 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5122 5133 rewriting the prompt with '--->' for auto-inputs with proper
5123 5134 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5124 5135 this is handled by the prompts class itself, as it should.
5125 5136
5126 5137 2002-03-05 Fernando Perez <fperez@colorado.edu>
5127 5138
5128 5139 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5129 5140 @logstart to avoid name clashes with the math log function.
5130 5141
5131 5142 * Big updates to X/Emacs section of the manual.
5132 5143
5133 5144 * Removed ipython_emacs. Milan explained to me how to pass
5134 5145 arguments to ipython through Emacs. Some day I'm going to end up
5135 5146 learning some lisp...
5136 5147
5137 5148 2002-03-04 Fernando Perez <fperez@colorado.edu>
5138 5149
5139 5150 * IPython/ipython_emacs: Created script to be used as the
5140 5151 py-python-command Emacs variable so we can pass IPython
5141 5152 parameters. I can't figure out how to tell Emacs directly to pass
5142 5153 parameters to IPython, so a dummy shell script will do it.
5143 5154
5144 5155 Other enhancements made for things to work better under Emacs'
5145 5156 various types of terminals. Many thanks to Milan Zamazal
5146 5157 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5147 5158
5148 5159 2002-03-01 Fernando Perez <fperez@colorado.edu>
5149 5160
5150 5161 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5151 5162 that loading of readline is now optional. This gives better
5152 5163 control to emacs users.
5153 5164
5154 5165 * IPython/ultraTB.py (__date__): Modified color escape sequences
5155 5166 and now things work fine under xterm and in Emacs' term buffers
5156 5167 (though not shell ones). Well, in emacs you get colors, but all
5157 5168 seem to be 'light' colors (no difference between dark and light
5158 5169 ones). But the garbage chars are gone, and also in xterms. It
5159 5170 seems that now I'm using 'cleaner' ansi sequences.
5160 5171
5161 5172 2002-02-21 Fernando Perez <fperez@colorado.edu>
5162 5173
5163 5174 * Released 0.2.7 (mainly to publish the scoping fix).
5164 5175
5165 5176 * IPython/Logger.py (Logger.logstate): added. A corresponding
5166 5177 @logstate magic was created.
5167 5178
5168 5179 * IPython/Magic.py: fixed nested scoping problem under Python
5169 5180 2.1.x (automagic wasn't working).
5170 5181
5171 5182 2002-02-20 Fernando Perez <fperez@colorado.edu>
5172 5183
5173 5184 * Released 0.2.6.
5174 5185
5175 5186 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5176 5187 option so that logs can come out without any headers at all.
5177 5188
5178 5189 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5179 5190 SciPy.
5180 5191
5181 5192 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5182 5193 that embedded IPython calls don't require vars() to be explicitly
5183 5194 passed. Now they are extracted from the caller's frame (code
5184 5195 snatched from Eric Jones' weave). Added better documentation to
5185 5196 the section on embedding and the example file.
5186 5197
5187 5198 * IPython/genutils.py (page): Changed so that under emacs, it just
5188 5199 prints the string. You can then page up and down in the emacs
5189 5200 buffer itself. This is how the builtin help() works.
5190 5201
5191 5202 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5192 5203 macro scoping: macros need to be executed in the user's namespace
5193 5204 to work as if they had been typed by the user.
5194 5205
5195 5206 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5196 5207 execute automatically (no need to type 'exec...'). They then
5197 5208 behave like 'true macros'. The printing system was also modified
5198 5209 for this to work.
5199 5210
5200 5211 2002-02-19 Fernando Perez <fperez@colorado.edu>
5201 5212
5202 5213 * IPython/genutils.py (page_file): new function for paging files
5203 5214 in an OS-independent way. Also necessary for file viewing to work
5204 5215 well inside Emacs buffers.
5205 5216 (page): Added checks for being in an emacs buffer.
5206 5217 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5207 5218 same bug in iplib.
5208 5219
5209 5220 2002-02-18 Fernando Perez <fperez@colorado.edu>
5210 5221
5211 5222 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5212 5223 of readline so that IPython can work inside an Emacs buffer.
5213 5224
5214 5225 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5215 5226 method signatures (they weren't really bugs, but it looks cleaner
5216 5227 and keeps PyChecker happy).
5217 5228
5218 5229 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5219 5230 for implementing various user-defined hooks. Currently only
5220 5231 display is done.
5221 5232
5222 5233 * IPython/Prompts.py (CachedOutput._display): changed display
5223 5234 functions so that they can be dynamically changed by users easily.
5224 5235
5225 5236 * IPython/Extensions/numeric_formats.py (num_display): added an
5226 5237 extension for printing NumPy arrays in flexible manners. It
5227 5238 doesn't do anything yet, but all the structure is in
5228 5239 place. Ultimately the plan is to implement output format control
5229 5240 like in Octave.
5230 5241
5231 5242 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5232 5243 methods are found at run-time by all the automatic machinery.
5233 5244
5234 5245 2002-02-17 Fernando Perez <fperez@colorado.edu>
5235 5246
5236 5247 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5237 5248 whole file a little.
5238 5249
5239 5250 * ToDo: closed this document. Now there's a new_design.lyx
5240 5251 document for all new ideas. Added making a pdf of it for the
5241 5252 end-user distro.
5242 5253
5243 5254 * IPython/Logger.py (Logger.switch_log): Created this to replace
5244 5255 logon() and logoff(). It also fixes a nasty crash reported by
5245 5256 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5246 5257
5247 5258 * IPython/iplib.py (complete): got auto-completion to work with
5248 5259 automagic (I had wanted this for a long time).
5249 5260
5250 5261 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5251 5262 to @file, since file() is now a builtin and clashes with automagic
5252 5263 for @file.
5253 5264
5254 5265 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5255 5266 of this was previously in iplib, which had grown to more than 2000
5256 5267 lines, way too long. No new functionality, but it makes managing
5257 5268 the code a bit easier.
5258 5269
5259 5270 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5260 5271 information to crash reports.
5261 5272
5262 5273 2002-02-12 Fernando Perez <fperez@colorado.edu>
5263 5274
5264 5275 * Released 0.2.5.
5265 5276
5266 5277 2002-02-11 Fernando Perez <fperez@colorado.edu>
5267 5278
5268 5279 * Wrote a relatively complete Windows installer. It puts
5269 5280 everything in place, creates Start Menu entries and fixes the
5270 5281 color issues. Nothing fancy, but it works.
5271 5282
5272 5283 2002-02-10 Fernando Perez <fperez@colorado.edu>
5273 5284
5274 5285 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5275 5286 os.path.expanduser() call so that we can type @run ~/myfile.py and
5276 5287 have thigs work as expected.
5277 5288
5278 5289 * IPython/genutils.py (page): fixed exception handling so things
5279 5290 work both in Unix and Windows correctly. Quitting a pager triggers
5280 5291 an IOError/broken pipe in Unix, and in windows not finding a pager
5281 5292 is also an IOError, so I had to actually look at the return value
5282 5293 of the exception, not just the exception itself. Should be ok now.
5283 5294
5284 5295 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5285 5296 modified to allow case-insensitive color scheme changes.
5286 5297
5287 5298 2002-02-09 Fernando Perez <fperez@colorado.edu>
5288 5299
5289 5300 * IPython/genutils.py (native_line_ends): new function to leave
5290 5301 user config files with os-native line-endings.
5291 5302
5292 5303 * README and manual updates.
5293 5304
5294 5305 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5295 5306 instead of StringType to catch Unicode strings.
5296 5307
5297 5308 * IPython/genutils.py (filefind): fixed bug for paths with
5298 5309 embedded spaces (very common in Windows).
5299 5310
5300 5311 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5301 5312 files under Windows, so that they get automatically associated
5302 5313 with a text editor. Windows makes it a pain to handle
5303 5314 extension-less files.
5304 5315
5305 5316 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5306 5317 warning about readline only occur for Posix. In Windows there's no
5307 5318 way to get readline, so why bother with the warning.
5308 5319
5309 5320 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5310 5321 for __str__ instead of dir(self), since dir() changed in 2.2.
5311 5322
5312 5323 * Ported to Windows! Tested on XP, I suspect it should work fine
5313 5324 on NT/2000, but I don't think it will work on 98 et al. That
5314 5325 series of Windows is such a piece of junk anyway that I won't try
5315 5326 porting it there. The XP port was straightforward, showed a few
5316 5327 bugs here and there (fixed all), in particular some string
5317 5328 handling stuff which required considering Unicode strings (which
5318 5329 Windows uses). This is good, but hasn't been too tested :) No
5319 5330 fancy installer yet, I'll put a note in the manual so people at
5320 5331 least make manually a shortcut.
5321 5332
5322 5333 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5323 5334 into a single one, "colors". This now controls both prompt and
5324 5335 exception color schemes, and can be changed both at startup
5325 5336 (either via command-line switches or via ipythonrc files) and at
5326 5337 runtime, with @colors.
5327 5338 (Magic.magic_run): renamed @prun to @run and removed the old
5328 5339 @run. The two were too similar to warrant keeping both.
5329 5340
5330 5341 2002-02-03 Fernando Perez <fperez@colorado.edu>
5331 5342
5332 5343 * IPython/iplib.py (install_first_time): Added comment on how to
5333 5344 configure the color options for first-time users. Put a <return>
5334 5345 request at the end so that small-terminal users get a chance to
5335 5346 read the startup info.
5336 5347
5337 5348 2002-01-23 Fernando Perez <fperez@colorado.edu>
5338 5349
5339 5350 * IPython/iplib.py (CachedOutput.update): Changed output memory
5340 5351 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5341 5352 input history we still use _i. Did this b/c these variable are
5342 5353 very commonly used in interactive work, so the less we need to
5343 5354 type the better off we are.
5344 5355 (Magic.magic_prun): updated @prun to better handle the namespaces
5345 5356 the file will run in, including a fix for __name__ not being set
5346 5357 before.
5347 5358
5348 5359 2002-01-20 Fernando Perez <fperez@colorado.edu>
5349 5360
5350 5361 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5351 5362 extra garbage for Python 2.2. Need to look more carefully into
5352 5363 this later.
5353 5364
5354 5365 2002-01-19 Fernando Perez <fperez@colorado.edu>
5355 5366
5356 5367 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5357 5368 display SyntaxError exceptions properly formatted when they occur
5358 5369 (they can be triggered by imported code).
5359 5370
5360 5371 2002-01-18 Fernando Perez <fperez@colorado.edu>
5361 5372
5362 5373 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5363 5374 SyntaxError exceptions are reported nicely formatted, instead of
5364 5375 spitting out only offset information as before.
5365 5376 (Magic.magic_prun): Added the @prun function for executing
5366 5377 programs with command line args inside IPython.
5367 5378
5368 5379 2002-01-16 Fernando Perez <fperez@colorado.edu>
5369 5380
5370 5381 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5371 5382 to *not* include the last item given in a range. This brings their
5372 5383 behavior in line with Python's slicing:
5373 5384 a[n1:n2] -> a[n1]...a[n2-1]
5374 5385 It may be a bit less convenient, but I prefer to stick to Python's
5375 5386 conventions *everywhere*, so users never have to wonder.
5376 5387 (Magic.magic_macro): Added @macro function to ease the creation of
5377 5388 macros.
5378 5389
5379 5390 2002-01-05 Fernando Perez <fperez@colorado.edu>
5380 5391
5381 5392 * Released 0.2.4.
5382 5393
5383 5394 * IPython/iplib.py (Magic.magic_pdef):
5384 5395 (InteractiveShell.safe_execfile): report magic lines and error
5385 5396 lines without line numbers so one can easily copy/paste them for
5386 5397 re-execution.
5387 5398
5388 5399 * Updated manual with recent changes.
5389 5400
5390 5401 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5391 5402 docstring printing when class? is called. Very handy for knowing
5392 5403 how to create class instances (as long as __init__ is well
5393 5404 documented, of course :)
5394 5405 (Magic.magic_doc): print both class and constructor docstrings.
5395 5406 (Magic.magic_pdef): give constructor info if passed a class and
5396 5407 __call__ info for callable object instances.
5397 5408
5398 5409 2002-01-04 Fernando Perez <fperez@colorado.edu>
5399 5410
5400 5411 * Made deep_reload() off by default. It doesn't always work
5401 5412 exactly as intended, so it's probably safer to have it off. It's
5402 5413 still available as dreload() anyway, so nothing is lost.
5403 5414
5404 5415 2002-01-02 Fernando Perez <fperez@colorado.edu>
5405 5416
5406 5417 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5407 5418 so I wanted an updated release).
5408 5419
5409 5420 2001-12-27 Fernando Perez <fperez@colorado.edu>
5410 5421
5411 5422 * IPython/iplib.py (InteractiveShell.interact): Added the original
5412 5423 code from 'code.py' for this module in order to change the
5413 5424 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5414 5425 the history cache would break when the user hit Ctrl-C, and
5415 5426 interact() offers no way to add any hooks to it.
5416 5427
5417 5428 2001-12-23 Fernando Perez <fperez@colorado.edu>
5418 5429
5419 5430 * setup.py: added check for 'MANIFEST' before trying to remove
5420 5431 it. Thanks to Sean Reifschneider.
5421 5432
5422 5433 2001-12-22 Fernando Perez <fperez@colorado.edu>
5423 5434
5424 5435 * Released 0.2.2.
5425 5436
5426 5437 * Finished (reasonably) writing the manual. Later will add the
5427 5438 python-standard navigation stylesheets, but for the time being
5428 5439 it's fairly complete. Distribution will include html and pdf
5429 5440 versions.
5430 5441
5431 5442 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5432 5443 (MayaVi author).
5433 5444
5434 5445 2001-12-21 Fernando Perez <fperez@colorado.edu>
5435 5446
5436 5447 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5437 5448 good public release, I think (with the manual and the distutils
5438 5449 installer). The manual can use some work, but that can go
5439 5450 slowly. Otherwise I think it's quite nice for end users. Next
5440 5451 summer, rewrite the guts of it...
5441 5452
5442 5453 * Changed format of ipythonrc files to use whitespace as the
5443 5454 separator instead of an explicit '='. Cleaner.
5444 5455
5445 5456 2001-12-20 Fernando Perez <fperez@colorado.edu>
5446 5457
5447 5458 * Started a manual in LyX. For now it's just a quick merge of the
5448 5459 various internal docstrings and READMEs. Later it may grow into a
5449 5460 nice, full-blown manual.
5450 5461
5451 5462 * Set up a distutils based installer. Installation should now be
5452 5463 trivially simple for end-users.
5453 5464
5454 5465 2001-12-11 Fernando Perez <fperez@colorado.edu>
5455 5466
5456 5467 * Released 0.2.0. First public release, announced it at
5457 5468 comp.lang.python. From now on, just bugfixes...
5458 5469
5459 5470 * Went through all the files, set copyright/license notices and
5460 5471 cleaned up things. Ready for release.
5461 5472
5462 5473 2001-12-10 Fernando Perez <fperez@colorado.edu>
5463 5474
5464 5475 * Changed the first-time installer not to use tarfiles. It's more
5465 5476 robust now and less unix-dependent. Also makes it easier for
5466 5477 people to later upgrade versions.
5467 5478
5468 5479 * Changed @exit to @abort to reflect the fact that it's pretty
5469 5480 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5470 5481 becomes significant only when IPyhton is embedded: in that case,
5471 5482 C-D closes IPython only, but @abort kills the enclosing program
5472 5483 too (unless it had called IPython inside a try catching
5473 5484 SystemExit).
5474 5485
5475 5486 * Created Shell module which exposes the actuall IPython Shell
5476 5487 classes, currently the normal and the embeddable one. This at
5477 5488 least offers a stable interface we won't need to change when
5478 5489 (later) the internals are rewritten. That rewrite will be confined
5479 5490 to iplib and ipmaker, but the Shell interface should remain as is.
5480 5491
5481 5492 * Added embed module which offers an embeddable IPShell object,
5482 5493 useful to fire up IPython *inside* a running program. Great for
5483 5494 debugging or dynamical data analysis.
5484 5495
5485 5496 2001-12-08 Fernando Perez <fperez@colorado.edu>
5486 5497
5487 5498 * Fixed small bug preventing seeing info from methods of defined
5488 5499 objects (incorrect namespace in _ofind()).
5489 5500
5490 5501 * Documentation cleanup. Moved the main usage docstrings to a
5491 5502 separate file, usage.py (cleaner to maintain, and hopefully in the
5492 5503 future some perlpod-like way of producing interactive, man and
5493 5504 html docs out of it will be found).
5494 5505
5495 5506 * Added @profile to see your profile at any time.
5496 5507
5497 5508 * Added @p as an alias for 'print'. It's especially convenient if
5498 5509 using automagic ('p x' prints x).
5499 5510
5500 5511 * Small cleanups and fixes after a pychecker run.
5501 5512
5502 5513 * Changed the @cd command to handle @cd - and @cd -<n> for
5503 5514 visiting any directory in _dh.
5504 5515
5505 5516 * Introduced _dh, a history of visited directories. @dhist prints
5506 5517 it out with numbers.
5507 5518
5508 5519 2001-12-07 Fernando Perez <fperez@colorado.edu>
5509 5520
5510 5521 * Released 0.1.22
5511 5522
5512 5523 * Made initialization a bit more robust against invalid color
5513 5524 options in user input (exit, not traceback-crash).
5514 5525
5515 5526 * Changed the bug crash reporter to write the report only in the
5516 5527 user's .ipython directory. That way IPython won't litter people's
5517 5528 hard disks with crash files all over the place. Also print on
5518 5529 screen the necessary mail command.
5519 5530
5520 5531 * With the new ultraTB, implemented LightBG color scheme for light
5521 5532 background terminals. A lot of people like white backgrounds, so I
5522 5533 guess we should at least give them something readable.
5523 5534
5524 5535 2001-12-06 Fernando Perez <fperez@colorado.edu>
5525 5536
5526 5537 * Modified the structure of ultraTB. Now there's a proper class
5527 5538 for tables of color schemes which allow adding schemes easily and
5528 5539 switching the active scheme without creating a new instance every
5529 5540 time (which was ridiculous). The syntax for creating new schemes
5530 5541 is also cleaner. I think ultraTB is finally done, with a clean
5531 5542 class structure. Names are also much cleaner (now there's proper
5532 5543 color tables, no need for every variable to also have 'color' in
5533 5544 its name).
5534 5545
5535 5546 * Broke down genutils into separate files. Now genutils only
5536 5547 contains utility functions, and classes have been moved to their
5537 5548 own files (they had enough independent functionality to warrant
5538 5549 it): ConfigLoader, OutputTrap, Struct.
5539 5550
5540 5551 2001-12-05 Fernando Perez <fperez@colorado.edu>
5541 5552
5542 5553 * IPython turns 21! Released version 0.1.21, as a candidate for
5543 5554 public consumption. If all goes well, release in a few days.
5544 5555
5545 5556 * Fixed path bug (files in Extensions/ directory wouldn't be found
5546 5557 unless IPython/ was explicitly in sys.path).
5547 5558
5548 5559 * Extended the FlexCompleter class as MagicCompleter to allow
5549 5560 completion of @-starting lines.
5550 5561
5551 5562 * Created __release__.py file as a central repository for release
5552 5563 info that other files can read from.
5553 5564
5554 5565 * Fixed small bug in logging: when logging was turned on in
5555 5566 mid-session, old lines with special meanings (!@?) were being
5556 5567 logged without the prepended comment, which is necessary since
5557 5568 they are not truly valid python syntax. This should make session
5558 5569 restores produce less errors.
5559 5570
5560 5571 * The namespace cleanup forced me to make a FlexCompleter class
5561 5572 which is nothing but a ripoff of rlcompleter, but with selectable
5562 5573 namespace (rlcompleter only works in __main__.__dict__). I'll try
5563 5574 to submit a note to the authors to see if this change can be
5564 5575 incorporated in future rlcompleter releases (Dec.6: done)
5565 5576
5566 5577 * More fixes to namespace handling. It was a mess! Now all
5567 5578 explicit references to __main__.__dict__ are gone (except when
5568 5579 really needed) and everything is handled through the namespace
5569 5580 dicts in the IPython instance. We seem to be getting somewhere
5570 5581 with this, finally...
5571 5582
5572 5583 * Small documentation updates.
5573 5584
5574 5585 * Created the Extensions directory under IPython (with an
5575 5586 __init__.py). Put the PhysicalQ stuff there. This directory should
5576 5587 be used for all special-purpose extensions.
5577 5588
5578 5589 * File renaming:
5579 5590 ipythonlib --> ipmaker
5580 5591 ipplib --> iplib
5581 5592 This makes a bit more sense in terms of what these files actually do.
5582 5593
5583 5594 * Moved all the classes and functions in ipythonlib to ipplib, so
5584 5595 now ipythonlib only has make_IPython(). This will ease up its
5585 5596 splitting in smaller functional chunks later.
5586 5597
5587 5598 * Cleaned up (done, I think) output of @whos. Better column
5588 5599 formatting, and now shows str(var) for as much as it can, which is
5589 5600 typically what one gets with a 'print var'.
5590 5601
5591 5602 2001-12-04 Fernando Perez <fperez@colorado.edu>
5592 5603
5593 5604 * Fixed namespace problems. Now builtin/IPyhton/user names get
5594 5605 properly reported in their namespace. Internal namespace handling
5595 5606 is finally getting decent (not perfect yet, but much better than
5596 5607 the ad-hoc mess we had).
5597 5608
5598 5609 * Removed -exit option. If people just want to run a python
5599 5610 script, that's what the normal interpreter is for. Less
5600 5611 unnecessary options, less chances for bugs.
5601 5612
5602 5613 * Added a crash handler which generates a complete post-mortem if
5603 5614 IPython crashes. This will help a lot in tracking bugs down the
5604 5615 road.
5605 5616
5606 5617 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
5607 5618 which were boud to functions being reassigned would bypass the
5608 5619 logger, breaking the sync of _il with the prompt counter. This
5609 5620 would then crash IPython later when a new line was logged.
5610 5621
5611 5622 2001-12-02 Fernando Perez <fperez@colorado.edu>
5612 5623
5613 5624 * Made IPython a package. This means people don't have to clutter
5614 5625 their sys.path with yet another directory. Changed the INSTALL
5615 5626 file accordingly.
5616 5627
5617 5628 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
5618 5629 sorts its output (so @who shows it sorted) and @whos formats the
5619 5630 table according to the width of the first column. Nicer, easier to
5620 5631 read. Todo: write a generic table_format() which takes a list of
5621 5632 lists and prints it nicely formatted, with optional row/column
5622 5633 separators and proper padding and justification.
5623 5634
5624 5635 * Released 0.1.20
5625 5636
5626 5637 * Fixed bug in @log which would reverse the inputcache list (a
5627 5638 copy operation was missing).
5628 5639
5629 5640 * Code cleanup. @config was changed to use page(). Better, since
5630 5641 its output is always quite long.
5631 5642
5632 5643 * Itpl is back as a dependency. I was having too many problems
5633 5644 getting the parametric aliases to work reliably, and it's just
5634 5645 easier to code weird string operations with it than playing %()s
5635 5646 games. It's only ~6k, so I don't think it's too big a deal.
5636 5647
5637 5648 * Found (and fixed) a very nasty bug with history. !lines weren't
5638 5649 getting cached, and the out of sync caches would crash
5639 5650 IPython. Fixed it by reorganizing the prefilter/handlers/logger
5640 5651 division of labor a bit better. Bug fixed, cleaner structure.
5641 5652
5642 5653 2001-12-01 Fernando Perez <fperez@colorado.edu>
5643 5654
5644 5655 * Released 0.1.19
5645 5656
5646 5657 * Added option -n to @hist to prevent line number printing. Much
5647 5658 easier to copy/paste code this way.
5648 5659
5649 5660 * Created global _il to hold the input list. Allows easy
5650 5661 re-execution of blocks of code by slicing it (inspired by Janko's
5651 5662 comment on 'macros').
5652 5663
5653 5664 * Small fixes and doc updates.
5654 5665
5655 5666 * Rewrote @history function (was @h). Renamed it to @hist, @h is
5656 5667 much too fragile with automagic. Handles properly multi-line
5657 5668 statements and takes parameters.
5658 5669
5659 5670 2001-11-30 Fernando Perez <fperez@colorado.edu>
5660 5671
5661 5672 * Version 0.1.18 released.
5662 5673
5663 5674 * Fixed nasty namespace bug in initial module imports.
5664 5675
5665 5676 * Added copyright/license notes to all code files (except
5666 5677 DPyGetOpt). For the time being, LGPL. That could change.
5667 5678
5668 5679 * Rewrote a much nicer README, updated INSTALL, cleaned up
5669 5680 ipythonrc-* samples.
5670 5681
5671 5682 * Overall code/documentation cleanup. Basically ready for
5672 5683 release. Only remaining thing: licence decision (LGPL?).
5673 5684
5674 5685 * Converted load_config to a class, ConfigLoader. Now recursion
5675 5686 control is better organized. Doesn't include the same file twice.
5676 5687
5677 5688 2001-11-29 Fernando Perez <fperez@colorado.edu>
5678 5689
5679 5690 * Got input history working. Changed output history variables from
5680 5691 _p to _o so that _i is for input and _o for output. Just cleaner
5681 5692 convention.
5682 5693
5683 5694 * Implemented parametric aliases. This pretty much allows the
5684 5695 alias system to offer full-blown shell convenience, I think.
5685 5696
5686 5697 * Version 0.1.17 released, 0.1.18 opened.
5687 5698
5688 5699 * dot_ipython/ipythonrc (alias): added documentation.
5689 5700 (xcolor): Fixed small bug (xcolors -> xcolor)
5690 5701
5691 5702 * Changed the alias system. Now alias is a magic command to define
5692 5703 aliases just like the shell. Rationale: the builtin magics should
5693 5704 be there for things deeply connected to IPython's
5694 5705 architecture. And this is a much lighter system for what I think
5695 5706 is the really important feature: allowing users to define quickly
5696 5707 magics that will do shell things for them, so they can customize
5697 5708 IPython easily to match their work habits. If someone is really
5698 5709 desperate to have another name for a builtin alias, they can
5699 5710 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
5700 5711 works.
5701 5712
5702 5713 2001-11-28 Fernando Perez <fperez@colorado.edu>
5703 5714
5704 5715 * Changed @file so that it opens the source file at the proper
5705 5716 line. Since it uses less, if your EDITOR environment is
5706 5717 configured, typing v will immediately open your editor of choice
5707 5718 right at the line where the object is defined. Not as quick as
5708 5719 having a direct @edit command, but for all intents and purposes it
5709 5720 works. And I don't have to worry about writing @edit to deal with
5710 5721 all the editors, less does that.
5711 5722
5712 5723 * Version 0.1.16 released, 0.1.17 opened.
5713 5724
5714 5725 * Fixed some nasty bugs in the page/page_dumb combo that could
5715 5726 crash IPython.
5716 5727
5717 5728 2001-11-27 Fernando Perez <fperez@colorado.edu>
5718 5729
5719 5730 * Version 0.1.15 released, 0.1.16 opened.
5720 5731
5721 5732 * Finally got ? and ?? to work for undefined things: now it's
5722 5733 possible to type {}.get? and get information about the get method
5723 5734 of dicts, or os.path? even if only os is defined (so technically
5724 5735 os.path isn't). Works at any level. For example, after import os,
5725 5736 os?, os.path?, os.path.abspath? all work. This is great, took some
5726 5737 work in _ofind.
5727 5738
5728 5739 * Fixed more bugs with logging. The sanest way to do it was to add
5729 5740 to @log a 'mode' parameter. Killed two in one shot (this mode
5730 5741 option was a request of Janko's). I think it's finally clean
5731 5742 (famous last words).
5732 5743
5733 5744 * Added a page_dumb() pager which does a decent job of paging on
5734 5745 screen, if better things (like less) aren't available. One less
5735 5746 unix dependency (someday maybe somebody will port this to
5736 5747 windows).
5737 5748
5738 5749 * Fixed problem in magic_log: would lock of logging out if log
5739 5750 creation failed (because it would still think it had succeeded).
5740 5751
5741 5752 * Improved the page() function using curses to auto-detect screen
5742 5753 size. Now it can make a much better decision on whether to print
5743 5754 or page a string. Option screen_length was modified: a value 0
5744 5755 means auto-detect, and that's the default now.
5745 5756
5746 5757 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
5747 5758 go out. I'll test it for a few days, then talk to Janko about
5748 5759 licences and announce it.
5749 5760
5750 5761 * Fixed the length of the auto-generated ---> prompt which appears
5751 5762 for auto-parens and auto-quotes. Getting this right isn't trivial,
5752 5763 with all the color escapes, different prompt types and optional
5753 5764 separators. But it seems to be working in all the combinations.
5754 5765
5755 5766 2001-11-26 Fernando Perez <fperez@colorado.edu>
5756 5767
5757 5768 * Wrote a regexp filter to get option types from the option names
5758 5769 string. This eliminates the need to manually keep two duplicate
5759 5770 lists.
5760 5771
5761 5772 * Removed the unneeded check_option_names. Now options are handled
5762 5773 in a much saner manner and it's easy to visually check that things
5763 5774 are ok.
5764 5775
5765 5776 * Updated version numbers on all files I modified to carry a
5766 5777 notice so Janko and Nathan have clear version markers.
5767 5778
5768 5779 * Updated docstring for ultraTB with my changes. I should send
5769 5780 this to Nathan.
5770 5781
5771 5782 * Lots of small fixes. Ran everything through pychecker again.
5772 5783
5773 5784 * Made loading of deep_reload an cmd line option. If it's not too
5774 5785 kosher, now people can just disable it. With -nodeep_reload it's
5775 5786 still available as dreload(), it just won't overwrite reload().
5776 5787
5777 5788 * Moved many options to the no| form (-opt and -noopt
5778 5789 accepted). Cleaner.
5779 5790
5780 5791 * Changed magic_log so that if called with no parameters, it uses
5781 5792 'rotate' mode. That way auto-generated logs aren't automatically
5782 5793 over-written. For normal logs, now a backup is made if it exists
5783 5794 (only 1 level of backups). A new 'backup' mode was added to the
5784 5795 Logger class to support this. This was a request by Janko.
5785 5796
5786 5797 * Added @logoff/@logon to stop/restart an active log.
5787 5798
5788 5799 * Fixed a lot of bugs in log saving/replay. It was pretty
5789 5800 broken. Now special lines (!@,/) appear properly in the command
5790 5801 history after a log replay.
5791 5802
5792 5803 * Tried and failed to implement full session saving via pickle. My
5793 5804 idea was to pickle __main__.__dict__, but modules can't be
5794 5805 pickled. This would be a better alternative to replaying logs, but
5795 5806 seems quite tricky to get to work. Changed -session to be called
5796 5807 -logplay, which more accurately reflects what it does. And if we
5797 5808 ever get real session saving working, -session is now available.
5798 5809
5799 5810 * Implemented color schemes for prompts also. As for tracebacks,
5800 5811 currently only NoColor and Linux are supported. But now the
5801 5812 infrastructure is in place, based on a generic ColorScheme
5802 5813 class. So writing and activating new schemes both for the prompts
5803 5814 and the tracebacks should be straightforward.
5804 5815
5805 5816 * Version 0.1.13 released, 0.1.14 opened.
5806 5817
5807 5818 * Changed handling of options for output cache. Now counter is
5808 5819 hardwired starting at 1 and one specifies the maximum number of
5809 5820 entries *in the outcache* (not the max prompt counter). This is
5810 5821 much better, since many statements won't increase the cache
5811 5822 count. It also eliminated some confusing options, now there's only
5812 5823 one: cache_size.
5813 5824
5814 5825 * Added 'alias' magic function and magic_alias option in the
5815 5826 ipythonrc file. Now the user can easily define whatever names he
5816 5827 wants for the magic functions without having to play weird
5817 5828 namespace games. This gives IPython a real shell-like feel.
5818 5829
5819 5830 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
5820 5831 @ or not).
5821 5832
5822 5833 This was one of the last remaining 'visible' bugs (that I know
5823 5834 of). I think if I can clean up the session loading so it works
5824 5835 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
5825 5836 about licensing).
5826 5837
5827 5838 2001-11-25 Fernando Perez <fperez@colorado.edu>
5828 5839
5829 5840 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
5830 5841 there's a cleaner distinction between what ? and ?? show.
5831 5842
5832 5843 * Added screen_length option. Now the user can define his own
5833 5844 screen size for page() operations.
5834 5845
5835 5846 * Implemented magic shell-like functions with automatic code
5836 5847 generation. Now adding another function is just a matter of adding
5837 5848 an entry to a dict, and the function is dynamically generated at
5838 5849 run-time. Python has some really cool features!
5839 5850
5840 5851 * Renamed many options to cleanup conventions a little. Now all
5841 5852 are lowercase, and only underscores where needed. Also in the code
5842 5853 option name tables are clearer.
5843 5854
5844 5855 * Changed prompts a little. Now input is 'In [n]:' instead of
5845 5856 'In[n]:='. This allows it the numbers to be aligned with the
5846 5857 Out[n] numbers, and removes usage of ':=' which doesn't exist in
5847 5858 Python (it was a Mathematica thing). The '...' continuation prompt
5848 5859 was also changed a little to align better.
5849 5860
5850 5861 * Fixed bug when flushing output cache. Not all _p<n> variables
5851 5862 exist, so their deletion needs to be wrapped in a try:
5852 5863
5853 5864 * Figured out how to properly use inspect.formatargspec() (it
5854 5865 requires the args preceded by *). So I removed all the code from
5855 5866 _get_pdef in Magic, which was just replicating that.
5856 5867
5857 5868 * Added test to prefilter to allow redefining magic function names
5858 5869 as variables. This is ok, since the @ form is always available,
5859 5870 but whe should allow the user to define a variable called 'ls' if
5860 5871 he needs it.
5861 5872
5862 5873 * Moved the ToDo information from README into a separate ToDo.
5863 5874
5864 5875 * General code cleanup and small bugfixes. I think it's close to a
5865 5876 state where it can be released, obviously with a big 'beta'
5866 5877 warning on it.
5867 5878
5868 5879 * Got the magic function split to work. Now all magics are defined
5869 5880 in a separate class. It just organizes things a bit, and now
5870 5881 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
5871 5882 was too long).
5872 5883
5873 5884 * Changed @clear to @reset to avoid potential confusions with
5874 5885 the shell command clear. Also renamed @cl to @clear, which does
5875 5886 exactly what people expect it to from their shell experience.
5876 5887
5877 5888 Added a check to the @reset command (since it's so
5878 5889 destructive, it's probably a good idea to ask for confirmation).
5879 5890 But now reset only works for full namespace resetting. Since the
5880 5891 del keyword is already there for deleting a few specific
5881 5892 variables, I don't see the point of having a redundant magic
5882 5893 function for the same task.
5883 5894
5884 5895 2001-11-24 Fernando Perez <fperez@colorado.edu>
5885 5896
5886 5897 * Updated the builtin docs (esp. the ? ones).
5887 5898
5888 5899 * Ran all the code through pychecker. Not terribly impressed with
5889 5900 it: lots of spurious warnings and didn't really find anything of
5890 5901 substance (just a few modules being imported and not used).
5891 5902
5892 5903 * Implemented the new ultraTB functionality into IPython. New
5893 5904 option: xcolors. This chooses color scheme. xmode now only selects
5894 5905 between Plain and Verbose. Better orthogonality.
5895 5906
5896 5907 * Large rewrite of ultraTB. Much cleaner now, with a separation of
5897 5908 mode and color scheme for the exception handlers. Now it's
5898 5909 possible to have the verbose traceback with no coloring.
5899 5910
5900 5911 2001-11-23 Fernando Perez <fperez@colorado.edu>
5901 5912
5902 5913 * Version 0.1.12 released, 0.1.13 opened.
5903 5914
5904 5915 * Removed option to set auto-quote and auto-paren escapes by
5905 5916 user. The chances of breaking valid syntax are just too high. If
5906 5917 someone *really* wants, they can always dig into the code.
5907 5918
5908 5919 * Made prompt separators configurable.
5909 5920
5910 5921 2001-11-22 Fernando Perez <fperez@colorado.edu>
5911 5922
5912 5923 * Small bugfixes in many places.
5913 5924
5914 5925 * Removed the MyCompleter class from ipplib. It seemed redundant
5915 5926 with the C-p,C-n history search functionality. Less code to
5916 5927 maintain.
5917 5928
5918 5929 * Moved all the original ipython.py code into ipythonlib.py. Right
5919 5930 now it's just one big dump into a function called make_IPython, so
5920 5931 no real modularity has been gained. But at least it makes the
5921 5932 wrapper script tiny, and since ipythonlib is a module, it gets
5922 5933 compiled and startup is much faster.
5923 5934
5924 5935 This is a reasobably 'deep' change, so we should test it for a
5925 5936 while without messing too much more with the code.
5926 5937
5927 5938 2001-11-21 Fernando Perez <fperez@colorado.edu>
5928 5939
5929 5940 * Version 0.1.11 released, 0.1.12 opened for further work.
5930 5941
5931 5942 * Removed dependency on Itpl. It was only needed in one place. It
5932 5943 would be nice if this became part of python, though. It makes life
5933 5944 *a lot* easier in some cases.
5934 5945
5935 5946 * Simplified the prefilter code a bit. Now all handlers are
5936 5947 expected to explicitly return a value (at least a blank string).
5937 5948
5938 5949 * Heavy edits in ipplib. Removed the help system altogether. Now
5939 5950 obj?/?? is used for inspecting objects, a magic @doc prints
5940 5951 docstrings, and full-blown Python help is accessed via the 'help'
5941 5952 keyword. This cleans up a lot of code (less to maintain) and does
5942 5953 the job. Since 'help' is now a standard Python component, might as
5943 5954 well use it and remove duplicate functionality.
5944 5955
5945 5956 Also removed the option to use ipplib as a standalone program. By
5946 5957 now it's too dependent on other parts of IPython to function alone.
5947 5958
5948 5959 * Fixed bug in genutils.pager. It would crash if the pager was
5949 5960 exited immediately after opening (broken pipe).
5950 5961
5951 5962 * Trimmed down the VerboseTB reporting a little. The header is
5952 5963 much shorter now and the repeated exception arguments at the end
5953 5964 have been removed. For interactive use the old header seemed a bit
5954 5965 excessive.
5955 5966
5956 5967 * Fixed small bug in output of @whos for variables with multi-word
5957 5968 types (only first word was displayed).
5958 5969
5959 5970 2001-11-17 Fernando Perez <fperez@colorado.edu>
5960 5971
5961 5972 * Version 0.1.10 released, 0.1.11 opened for further work.
5962 5973
5963 5974 * Modified dirs and friends. dirs now *returns* the stack (not
5964 5975 prints), so one can manipulate it as a variable. Convenient to
5965 5976 travel along many directories.
5966 5977
5967 5978 * Fixed bug in magic_pdef: would only work with functions with
5968 5979 arguments with default values.
5969 5980
5970 5981 2001-11-14 Fernando Perez <fperez@colorado.edu>
5971 5982
5972 5983 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5973 5984 example with IPython. Various other minor fixes and cleanups.
5974 5985
5975 5986 * Version 0.1.9 released, 0.1.10 opened for further work.
5976 5987
5977 5988 * Added sys.path to the list of directories searched in the
5978 5989 execfile= option. It used to be the current directory and the
5979 5990 user's IPYTHONDIR only.
5980 5991
5981 5992 2001-11-13 Fernando Perez <fperez@colorado.edu>
5982 5993
5983 5994 * Reinstated the raw_input/prefilter separation that Janko had
5984 5995 initially. This gives a more convenient setup for extending the
5985 5996 pre-processor from the outside: raw_input always gets a string,
5986 5997 and prefilter has to process it. We can then redefine prefilter
5987 5998 from the outside and implement extensions for special
5988 5999 purposes.
5989 6000
5990 6001 Today I got one for inputting PhysicalQuantity objects
5991 6002 (from Scientific) without needing any function calls at
5992 6003 all. Extremely convenient, and it's all done as a user-level
5993 6004 extension (no IPython code was touched). Now instead of:
5994 6005 a = PhysicalQuantity(4.2,'m/s**2')
5995 6006 one can simply say
5996 6007 a = 4.2 m/s**2
5997 6008 or even
5998 6009 a = 4.2 m/s^2
5999 6010
6000 6011 I use this, but it's also a proof of concept: IPython really is
6001 6012 fully user-extensible, even at the level of the parsing of the
6002 6013 command line. It's not trivial, but it's perfectly doable.
6003 6014
6004 6015 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6005 6016 the problem of modules being loaded in the inverse order in which
6006 6017 they were defined in
6007 6018
6008 6019 * Version 0.1.8 released, 0.1.9 opened for further work.
6009 6020
6010 6021 * Added magics pdef, source and file. They respectively show the
6011 6022 definition line ('prototype' in C), source code and full python
6012 6023 file for any callable object. The object inspector oinfo uses
6013 6024 these to show the same information.
6014 6025
6015 6026 * Version 0.1.7 released, 0.1.8 opened for further work.
6016 6027
6017 6028 * Separated all the magic functions into a class called Magic. The
6018 6029 InteractiveShell class was becoming too big for Xemacs to handle
6019 6030 (de-indenting a line would lock it up for 10 seconds while it
6020 6031 backtracked on the whole class!)
6021 6032
6022 6033 FIXME: didn't work. It can be done, but right now namespaces are
6023 6034 all messed up. Do it later (reverted it for now, so at least
6024 6035 everything works as before).
6025 6036
6026 6037 * Got the object introspection system (magic_oinfo) working! I
6027 6038 think this is pretty much ready for release to Janko, so he can
6028 6039 test it for a while and then announce it. Pretty much 100% of what
6029 6040 I wanted for the 'phase 1' release is ready. Happy, tired.
6030 6041
6031 6042 2001-11-12 Fernando Perez <fperez@colorado.edu>
6032 6043
6033 6044 * Version 0.1.6 released, 0.1.7 opened for further work.
6034 6045
6035 6046 * Fixed bug in printing: it used to test for truth before
6036 6047 printing, so 0 wouldn't print. Now checks for None.
6037 6048
6038 6049 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6039 6050 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6040 6051 reaches by hand into the outputcache. Think of a better way to do
6041 6052 this later.
6042 6053
6043 6054 * Various small fixes thanks to Nathan's comments.
6044 6055
6045 6056 * Changed magic_pprint to magic_Pprint. This way it doesn't
6046 6057 collide with pprint() and the name is consistent with the command
6047 6058 line option.
6048 6059
6049 6060 * Changed prompt counter behavior to be fully like
6050 6061 Mathematica's. That is, even input that doesn't return a result
6051 6062 raises the prompt counter. The old behavior was kind of confusing
6052 6063 (getting the same prompt number several times if the operation
6053 6064 didn't return a result).
6054 6065
6055 6066 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6056 6067
6057 6068 * Fixed -Classic mode (wasn't working anymore).
6058 6069
6059 6070 * Added colored prompts using Nathan's new code. Colors are
6060 6071 currently hardwired, they can be user-configurable. For
6061 6072 developers, they can be chosen in file ipythonlib.py, at the
6062 6073 beginning of the CachedOutput class def.
6063 6074
6064 6075 2001-11-11 Fernando Perez <fperez@colorado.edu>
6065 6076
6066 6077 * Version 0.1.5 released, 0.1.6 opened for further work.
6067 6078
6068 6079 * Changed magic_env to *return* the environment as a dict (not to
6069 6080 print it). This way it prints, but it can also be processed.
6070 6081
6071 6082 * Added Verbose exception reporting to interactive
6072 6083 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6073 6084 traceback. Had to make some changes to the ultraTB file. This is
6074 6085 probably the last 'big' thing in my mental todo list. This ties
6075 6086 in with the next entry:
6076 6087
6077 6088 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6078 6089 has to specify is Plain, Color or Verbose for all exception
6079 6090 handling.
6080 6091
6081 6092 * Removed ShellServices option. All this can really be done via
6082 6093 the magic system. It's easier to extend, cleaner and has automatic
6083 6094 namespace protection and documentation.
6084 6095
6085 6096 2001-11-09 Fernando Perez <fperez@colorado.edu>
6086 6097
6087 6098 * Fixed bug in output cache flushing (missing parameter to
6088 6099 __init__). Other small bugs fixed (found using pychecker).
6089 6100
6090 6101 * Version 0.1.4 opened for bugfixing.
6091 6102
6092 6103 2001-11-07 Fernando Perez <fperez@colorado.edu>
6093 6104
6094 6105 * Version 0.1.3 released, mainly because of the raw_input bug.
6095 6106
6096 6107 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6097 6108 and when testing for whether things were callable, a call could
6098 6109 actually be made to certain functions. They would get called again
6099 6110 once 'really' executed, with a resulting double call. A disaster
6100 6111 in many cases (list.reverse() would never work!).
6101 6112
6102 6113 * Removed prefilter() function, moved its code to raw_input (which
6103 6114 after all was just a near-empty caller for prefilter). This saves
6104 6115 a function call on every prompt, and simplifies the class a tiny bit.
6105 6116
6106 6117 * Fix _ip to __ip name in magic example file.
6107 6118
6108 6119 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6109 6120 work with non-gnu versions of tar.
6110 6121
6111 6122 2001-11-06 Fernando Perez <fperez@colorado.edu>
6112 6123
6113 6124 * Version 0.1.2. Just to keep track of the recent changes.
6114 6125
6115 6126 * Fixed nasty bug in output prompt routine. It used to check 'if
6116 6127 arg != None...'. Problem is, this fails if arg implements a
6117 6128 special comparison (__cmp__) which disallows comparing to
6118 6129 None. Found it when trying to use the PhysicalQuantity module from
6119 6130 ScientificPython.
6120 6131
6121 6132 2001-11-05 Fernando Perez <fperez@colorado.edu>
6122 6133
6123 6134 * Also added dirs. Now the pushd/popd/dirs family functions
6124 6135 basically like the shell, with the added convenience of going home
6125 6136 when called with no args.
6126 6137
6127 6138 * pushd/popd slightly modified to mimic shell behavior more
6128 6139 closely.
6129 6140
6130 6141 * Added env,pushd,popd from ShellServices as magic functions. I
6131 6142 think the cleanest will be to port all desired functions from
6132 6143 ShellServices as magics and remove ShellServices altogether. This
6133 6144 will provide a single, clean way of adding functionality
6134 6145 (shell-type or otherwise) to IP.
6135 6146
6136 6147 2001-11-04 Fernando Perez <fperez@colorado.edu>
6137 6148
6138 6149 * Added .ipython/ directory to sys.path. This way users can keep
6139 6150 customizations there and access them via import.
6140 6151
6141 6152 2001-11-03 Fernando Perez <fperez@colorado.edu>
6142 6153
6143 6154 * Opened version 0.1.1 for new changes.
6144 6155
6145 6156 * Changed version number to 0.1.0: first 'public' release, sent to
6146 6157 Nathan and Janko.
6147 6158
6148 6159 * Lots of small fixes and tweaks.
6149 6160
6150 6161 * Minor changes to whos format. Now strings are shown, snipped if
6151 6162 too long.
6152 6163
6153 6164 * Changed ShellServices to work on __main__ so they show up in @who
6154 6165
6155 6166 * Help also works with ? at the end of a line:
6156 6167 ?sin and sin?
6157 6168 both produce the same effect. This is nice, as often I use the
6158 6169 tab-complete to find the name of a method, but I used to then have
6159 6170 to go to the beginning of the line to put a ? if I wanted more
6160 6171 info. Now I can just add the ? and hit return. Convenient.
6161 6172
6162 6173 2001-11-02 Fernando Perez <fperez@colorado.edu>
6163 6174
6164 6175 * Python version check (>=2.1) added.
6165 6176
6166 6177 * Added LazyPython documentation. At this point the docs are quite
6167 6178 a mess. A cleanup is in order.
6168 6179
6169 6180 * Auto-installer created. For some bizarre reason, the zipfiles
6170 6181 module isn't working on my system. So I made a tar version
6171 6182 (hopefully the command line options in various systems won't kill
6172 6183 me).
6173 6184
6174 6185 * Fixes to Struct in genutils. Now all dictionary-like methods are
6175 6186 protected (reasonably).
6176 6187
6177 6188 * Added pager function to genutils and changed ? to print usage
6178 6189 note through it (it was too long).
6179 6190
6180 6191 * Added the LazyPython functionality. Works great! I changed the
6181 6192 auto-quote escape to ';', it's on home row and next to '. But
6182 6193 both auto-quote and auto-paren (still /) escapes are command-line
6183 6194 parameters.
6184 6195
6185 6196
6186 6197 2001-11-01 Fernando Perez <fperez@colorado.edu>
6187 6198
6188 6199 * Version changed to 0.0.7. Fairly large change: configuration now
6189 6200 is all stored in a directory, by default .ipython. There, all
6190 6201 config files have normal looking names (not .names)
6191 6202
6192 6203 * Version 0.0.6 Released first to Lucas and Archie as a test
6193 6204 run. Since it's the first 'semi-public' release, change version to
6194 6205 > 0.0.6 for any changes now.
6195 6206
6196 6207 * Stuff I had put in the ipplib.py changelog:
6197 6208
6198 6209 Changes to InteractiveShell:
6199 6210
6200 6211 - Made the usage message a parameter.
6201 6212
6202 6213 - Require the name of the shell variable to be given. It's a bit
6203 6214 of a hack, but allows the name 'shell' not to be hardwired in the
6204 6215 magic (@) handler, which is problematic b/c it requires
6205 6216 polluting the global namespace with 'shell'. This in turn is
6206 6217 fragile: if a user redefines a variable called shell, things
6207 6218 break.
6208 6219
6209 6220 - magic @: all functions available through @ need to be defined
6210 6221 as magic_<name>, even though they can be called simply as
6211 6222 @<name>. This allows the special command @magic to gather
6212 6223 information automatically about all existing magic functions,
6213 6224 even if they are run-time user extensions, by parsing the shell
6214 6225 instance __dict__ looking for special magic_ names.
6215 6226
6216 6227 - mainloop: added *two* local namespace parameters. This allows
6217 6228 the class to differentiate between parameters which were there
6218 6229 before and after command line initialization was processed. This
6219 6230 way, later @who can show things loaded at startup by the
6220 6231 user. This trick was necessary to make session saving/reloading
6221 6232 really work: ideally after saving/exiting/reloading a session,
6222 6233 *everything* should look the same, including the output of @who. I
6223 6234 was only able to make this work with this double namespace
6224 6235 trick.
6225 6236
6226 6237 - added a header to the logfile which allows (almost) full
6227 6238 session restoring.
6228 6239
6229 6240 - prepend lines beginning with @ or !, with a and log
6230 6241 them. Why? !lines: may be useful to know what you did @lines:
6231 6242 they may affect session state. So when restoring a session, at
6232 6243 least inform the user of their presence. I couldn't quite get
6233 6244 them to properly re-execute, but at least the user is warned.
6234 6245
6235 6246 * Started ChangeLog.
General Comments 0
You need to be logged in to leave comments. Login now