Show More
@@ -2,7 +2,7 b'' | |||
|
2 | 2 | """ |
|
3 | 3 | Logger class for IPython's logging facilities. |
|
4 | 4 | |
|
5 |
$Id: Logger.py |
|
|
5 | $Id: Logger.py 1077 2006-01-24 18:15:27Z vivainio $ | |
|
6 | 6 | """ |
|
7 | 7 | |
|
8 | 8 | #***************************************************************************** |
@@ -214,6 +214,7 b' which already exists. But you must first start the logging process with' | |||
|
214 | 214 | def log_write(self,data,kind='input'): |
|
215 | 215 | """Write data to the log file, if active""" |
|
216 | 216 | |
|
217 | #print 'data: %r' % data # dbg | |
|
217 | 218 | if self.log_active and data: |
|
218 | 219 | write = self.logfile.write |
|
219 | 220 | if kind=='input': |
@@ -1,7 +1,7 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """Magic functions for InteractiveShell. |
|
3 | 3 | |
|
4 |
$Id: Magic.py 107 |
|
|
4 | $Id: Magic.py 1077 2006-01-24 18:15:27Z vivainio $""" | |
|
5 | 5 | |
|
6 | 6 | #***************************************************************************** |
|
7 | 7 | # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and |
@@ -480,27 +480,42 b' Currently the magic system has the following functions:\\n"""' | |||
|
480 | 480 | def magic_history(self, parameter_s = ''): |
|
481 | 481 | """Print input history (_i<n> variables), with most recent last. |
|
482 | 482 | |
|
483 |
%history |
|
|
484 |
%history |
|
|
485 |
%history |
|
|
483 | %history -> print at most 40 inputs (some may be multi-line)\\ | |
|
484 | %history n -> print at most n inputs\\ | |
|
485 | %history n1 n2 -> print inputs between n1 and n2 (n2 not included)\\ | |
|
486 | 486 | |
|
487 | 487 | Each input's number <n> is shown, and is accessible as the |
|
488 | 488 | automatically generated variable _i<n>. Multi-line statements are |
|
489 | 489 | printed starting at a new line for easy copy/paste. |
|
490 | 490 | |
|
491 | If option -n is used, input numbers are not printed. This is useful if | |
|
492 | you want to get a printout of many lines which can be directly pasted | |
|
493 | into a text editor. | |
|
494 | 491 | |
|
495 | This feature is only available if numbered prompts are in use.""" | |
|
492 | Options: | |
|
493 | ||
|
494 | -n: do NOT print line numbers. This is useful if you want to get a | |
|
495 | printout of many lines which can be directly pasted into a text | |
|
496 | editor. | |
|
497 | ||
|
498 | This feature is only available if numbered prompts are in use. | |
|
499 | ||
|
500 | -r: print the 'raw' history. IPython filters your input and | |
|
501 | converts it all into valid Python source before executing it (things | |
|
502 | like magics or aliases are turned into function calls, for | |
|
503 | example). With this option, you'll see the unfiltered history | |
|
504 | instead of the filtered version: '%cd /' will be seen as '%cd /' | |
|
505 | instead of 'ipmagic("%cd /")'. | |
|
506 | """ | |
|
496 | 507 | |
|
497 | 508 | shell = self.shell |
|
498 | 509 | if not shell.outputcache.do_full_cache: |
|
499 | 510 | print 'This feature is only available if numbered prompts are in use.' |
|
500 | 511 | return |
|
501 | opts,args = self.parse_options(parameter_s,'n',mode='list') | |
|
512 | opts,args = self.parse_options(parameter_s,'nr',mode='list') | |
|
502 | 513 | |
|
514 | if opts.has_key('r'): | |
|
515 | input_hist = shell.input_hist_raw | |
|
516 | else: | |
|
503 | 517 | input_hist = shell.input_hist |
|
518 | ||
|
504 | 519 | default_length = 40 |
|
505 | 520 | if len(args) == 0: |
|
506 | 521 | final = len(input_hist) |
@@ -1,7 +1,7 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """Release data for the IPython project. |
|
3 | 3 | |
|
4 |
$Id: Release.py 10 |
|
|
4 | $Id: Release.py 1077 2006-01-24 18:15:27Z vivainio $""" | |
|
5 | 5 | |
|
6 | 6 | #***************************************************************************** |
|
7 | 7 | # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu> |
@@ -22,9 +22,10 b" name = 'ipython'" | |||
|
22 | 22 | # because bdist_rpm does not accept dashes (an RPM) convention, and |
|
23 | 23 | # bdist_deb does not accept underscores (a Debian convention). |
|
24 | 24 | |
|
25 | ||
|
25 | 26 | version = '0.7.2.svn' |
|
26 | 27 | |
|
27 |
revision = '$Revision: 10 |
|
|
28 | revision = '$Revision: 1077 $' | |
|
28 | 29 | |
|
29 | 30 | description = "An enhanced interactive Python shell." |
|
30 | 31 |
@@ -80,7 +80,7 b' except NameError:' | |||
|
80 | 80 | from sets import Set as set |
|
81 | 81 | |
|
82 | 82 | |
|
83 |
from IPython.genutils import shlex_split,debug |
|
|
83 | from IPython.genutils import shlex_split,debugx | |
|
84 | 84 | |
|
85 | 85 | __all__ = ['Completer','IPCompleter'] |
|
86 | 86 |
@@ -5,7 +5,7 b' General purpose utilities.' | |||
|
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 10 |
|
|
8 | $Id: genutils.py 1077 2006-01-24 18:15:27Z vivainio $""" | |
|
9 | 9 | |
|
10 | 10 | #***************************************************************************** |
|
11 | 11 | # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu> |
@@ -207,9 +207,10 b' def fatal(msg,exit_val=1):' | |||
|
207 | 207 | |
|
208 | 208 | warn(msg,exit_val=exit_val,level=4) |
|
209 | 209 | |
|
210 | ||
|
211 | # useful for debugging | |
|
212 | def debugp(expr,pre_msg=''): | |
|
210 | #--------------------------------------------------------------------------- | |
|
211 | # Debugging routines | |
|
212 | # | |
|
213 | def debugx(expr,pre_msg=''): | |
|
213 | 214 | """Print the value of an expression from the caller's frame. |
|
214 | 215 | |
|
215 | 216 | Takes an expression, evaluates it in the caller's frame and prints both |
@@ -225,7 +226,7 b" def debugp(expr,pre_msg=''):" | |||
|
225 | 226 | eval(expr,cf.f_globals,cf.f_locals)) |
|
226 | 227 | |
|
227 | 228 | # deactivate it by uncommenting the following line, which makes it a no-op |
|
228 |
def debug |
|
|
229 | #def debugx(expr,pre_msg=''): pass | |
|
229 | 230 | |
|
230 | 231 | #---------------------------------------------------------------------------- |
|
231 | 232 | StringTypes = types.StringTypes |
@@ -154,7 +154,7 b' def ev(expr):' | |||
|
154 | 154 | return eval(expr,user_ns()) |
|
155 | 155 | |
|
156 | 156 | def launch_new_instance(): |
|
157 |
""" Creat |
|
|
157 | """ Create and start a new ipython instance. | |
|
158 | 158 | |
|
159 | 159 | This can be called even without having an already initialized |
|
160 | 160 | ipython session running. |
@@ -6,7 +6,7 b' Requires Python 2.3 or newer.' | |||
|
6 | 6 | |
|
7 | 7 | This file contains all the classes and helper functions specific to IPython. |
|
8 | 8 | |
|
9 |
$Id: iplib.py 10 |
|
|
9 | $Id: iplib.py 1077 2006-01-24 18:15:27Z vivainio $ | |
|
10 | 10 | """ |
|
11 | 11 | |
|
12 | 12 | #***************************************************************************** |
@@ -341,6 +341,10 b' class InteractiveShell(object,Magic):' | |||
|
341 | 341 | # List of input with multi-line handling. |
|
342 | 342 | # Fill its zero entry, user counter starts at 1 |
|
343 | 343 | self.input_hist = InputList(['\n']) |
|
344 | # This one will hold the 'raw' input history, without any | |
|
345 | # pre-processing. This will allow users to retrieve the input just as | |
|
346 | # it was exactly typed in by the user, with %hist -r. | |
|
347 | self.input_hist_raw = InputList(['\n']) | |
|
344 | 348 | |
|
345 | 349 | # list of visited directories |
|
346 | 350 | try: |
@@ -1155,7 +1159,7 b' want to merge them back into the new files.""" % locals()' | |||
|
1155 | 1159 | |
|
1156 | 1160 | Currently it handles auto-indent only.""" |
|
1157 | 1161 | |
|
1158 |
#debug |
|
|
1162 | #debugx('self.indent_current_nsp','pre_readline:') | |
|
1159 | 1163 | self.readline.insert_text(self.indent_current_str()) |
|
1160 | 1164 | |
|
1161 | 1165 | def init_readline(self): |
@@ -1554,9 +1558,8 b' want to merge them back into the new files.""" % locals()' | |||
|
1554 | 1558 | def autoindent_update(self,line): |
|
1555 | 1559 | """Keep track of the indent level.""" |
|
1556 | 1560 | |
|
1557 | #import traceback; traceback.print_stack() # dbg | |
|
1558 |
|
|
|
1559 | debugp('self.indent_current_nsp') | |
|
1561 | #debugx('line') | |
|
1562 | #debugx('self.indent_current_nsp') | |
|
1560 | 1563 | if self.autoindent: |
|
1561 | 1564 | if line: |
|
1562 | 1565 | inisp = num_ini_spaces(line) |
@@ -1755,19 +1758,22 b' want to merge them back into the new files.""" % locals()' | |||
|
1755 | 1758 | # Try to be reasonably smart about not re-indenting pasted input more |
|
1756 | 1759 | # than necessary. We do this by trimming out the auto-indent initial |
|
1757 | 1760 | # spaces, if the user's actual input started itself with whitespace. |
|
1758 |
#debug |
|
|
1761 | #debugx('self.buffer[-1]') | |
|
1759 | 1762 | |
|
1760 | debugp('line') | |
|
1761 | debugp('self.indent_current_nsp') | |
|
1762 | 1763 | if self.autoindent: |
|
1763 | 1764 | if num_ini_spaces(line) > self.indent_current_nsp: |
|
1764 | 1765 | line = line[self.indent_current_nsp:] |
|
1765 | 1766 | self.indent_current_nsp = 0 |
|
1766 | debugp('self.indent_current_nsp') | |
|
1767 | 1767 | |
|
1768 | debugp('line') | |
|
1768 | # store the unfiltered input before the user has any chance to modify | |
|
1769 | # it. | |
|
1770 | if line.strip(): | |
|
1771 | if continue_prompt: | |
|
1772 | self.input_hist_raw[-1] += '%s\n' % line | |
|
1773 | else: | |
|
1774 | self.input_hist_raw.append('%s\n' % line) | |
|
1775 | ||
|
1769 | 1776 | lineout = self.prefilter(line,continue_prompt) |
|
1770 | debugp('lineout') | |
|
1771 | 1777 | return lineout |
|
1772 | 1778 | |
|
1773 | 1779 | def split_user_input(self,line): |
@@ -1947,7 +1953,6 b' want to merge them back into the new files.""" % locals()' | |||
|
1947 | 1953 | if (continue_prompt and self.autoindent and line.isspace() and |
|
1948 | 1954 | (0 < abs(len(line) - self.indent_current_nsp) <= 2 or |
|
1949 | 1955 | (self.buffer[-1]).isspace() )): |
|
1950 | #print 'reset line' # dbg | |
|
1951 | 1956 | line = '' |
|
1952 | 1957 | |
|
1953 | 1958 | self.log(line,continue_prompt) |
@@ -7,6 +7,31 b'' | |||
|
7 | 7 | is_ipython_session() to determine whether we are running |
|
8 | 8 | inside an ipython session. |
|
9 | 9 | |
|
10 | * Merged 1071-1076 from banches/0.7.1 | |
|
11 | ||
|
12 | 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu> | |
|
13 | ||
|
14 | * tools/release (daystamp): Fix build tools to use the new | |
|
15 | eggsetup.py script to build lightweight eggs. | |
|
16 | ||
|
17 | * Applied changesets 1062 and 1064 before 0.7.1 release. | |
|
18 | ||
|
19 | * IPython/Magic.py (magic_history): Add '-r' option to %hist, to | |
|
20 | see the raw input history (without conversions like %ls -> | |
|
21 | ipmagic("ls")). After a request from W. Stein, SAGE | |
|
22 | (http://modular.ucsd.edu/sage) developer. This information is | |
|
23 | stored in the input_hist_raw attribute of the IPython instance, so | |
|
24 | developers can access it if needed (it's an InputList instance). | |
|
25 | ||
|
26 | * Versionstring = 0.7.2.svn | |
|
27 | ||
|
28 | * eggsetup.py: A separate script for constructing eggs, creates | |
|
29 | proper launch scripts even on Windows (an .exe file in | |
|
30 | \python24\scripts). | |
|
31 | ||
|
32 | * ipapi.py: launch_new_instance, launch entry point needed for the | |
|
33 | egg. | |
|
34 | ||
|
10 | 35 | 2006-01-23 Ville Vainio <vivainio@gmail.com> |
|
11 | 36 | |
|
12 | 37 | * Added %cpaste magic for pasting python code |
@@ -69,7 +69,7 b'' | |||
|
69 | 69 | \quotes_language english |
|
70 | 70 | \quotes_times 2 |
|
71 | 71 | \papercolumns 1 |
|
72 |
\papersides |
|
|
72 | \papersides 2 | |
|
73 | 73 | \paperpagestyle fancy |
|
74 | 74 | |
|
75 | 75 | \layout Title |
@@ -87,6 +87,20 b' User Manual, v.' | |||
|
87 | 87 | \layout Author |
|
88 | 88 | |
|
89 | 89 | Fernando P�rez |
|
90 | \begin_inset Foot | |
|
91 | collapsed true | |
|
92 | ||
|
93 | \layout Standard | |
|
94 | ||
|
95 | ||
|
96 | \size scriptsize | |
|
97 | Department of Applied Mathematics, University of Colorado at Boulder. | |
|
98 | ||
|
99 | \family typewriter | |
|
100 | <Fernando.Perez@colorado.edu> | |
|
101 | \end_inset | |
|
102 | ||
|
103 | ||
|
90 | 104 | \layout Standard |
|
91 | 105 | |
|
92 | 106 | |
@@ -8905,7 +8919,7 b' status Collapsed' | |||
|
8905 | 8919 | |
|
8906 | 8920 | rez |
|
8907 | 8921 | \family typewriter |
|
8908 |
< |
|
|
8922 | <Fernando.Perez@colorado.edu> | |
|
8909 | 8923 | \family default |
|
8910 | 8924 | , but the project was born from mixing in Fernando's code with the IPP project |
|
8911 | 8925 | by Janko Hauser |
@@ -8921,7 +8935,7 b' rez' | |||
|
8921 | 8935 | |
|
8922 | 8936 | \layout Standard |
|
8923 | 8937 | |
|
8924 |
As of |
|
|
8938 | As of early 2006, the following developers have joined the core team: | |
|
8925 | 8939 | \layout List |
|
8926 | 8940 | \labelwidthstring 00.00.0000 |
|
8927 | 8941 | |
@@ -8956,7 +8970,7 b' Vainio' | |||
|
8956 | 8970 | \family typewriter |
|
8957 | 8971 | <vivainio-AT-gmail.com> |
|
8958 | 8972 | \family default |
|
8959 |
: Ville is the new maintainer for the main trunk of IPython a |
|
|
8973 | : Ville is the new maintainer for the main trunk of IPython after version | |
|
8960 | 8974 | 0.7.1. |
|
8961 | 8975 | \layout Standard |
|
8962 | 8976 |
@@ -51,8 +51,8 b' python2.3 ./setup.py bdist_rpm --release=py23 --python=/usr/bin/python2.3' | |||
|
51 | 51 | python2.4 ./setup.py bdist_rpm --release=py24 --python=/usr/bin/python2.4 |
|
52 | 52 | |
|
53 | 53 | # Build eggs |
|
54 |
python2.3 ./ |
|
|
55 |
python2.4 ./ |
|
|
54 | python2.3 ./eggsetup.py bdist_egg | |
|
55 | python2.4 ./eggsetup.py bdist_egg | |
|
56 | 56 | |
|
57 | 57 | # Call the windows build separately, so that the extra Windows scripts don't |
|
58 | 58 | # get pulled into Unix builds (setup.py has code which checks for |
@@ -64,7 +64,6 b' python2.4 ./setup_bdist_egg.py' | |||
|
64 | 64 | $HOME/tmp/local/bin/python2.3 setup.py bdist_wininst \ |
|
65 | 65 | --install-script=ipython_win_post_install.py |
|
66 | 66 | |
|
67 | ||
|
68 | 67 | # Register with the Python Package Index (PyPI) |
|
69 | 68 | echo "Registering with PyPI..." |
|
70 | 69 | cd $ipdir |
@@ -15,8 +15,8 b' python2.3 ./setup.py bdist_rpm --release=py23 --python=/usr/bin/python2.3' | |||
|
15 | 15 | python2.4 ./setup.py bdist_rpm --release=py24 --python=/usr/bin/python2.4 |
|
16 | 16 | |
|
17 | 17 | # Build eggs |
|
18 |
python2.3 ./ |
|
|
19 |
python2.4 ./ |
|
|
18 | python2.3 ./eggsetup.py bdist_egg | |
|
19 | python2.4 ./eggsetup.py bdist_egg | |
|
20 | 20 | |
|
21 | 21 | # Call the windows build separately, so that the extra Windows scripts don't |
|
22 | 22 | # get pulled into Unix builds (setup.py has code which checks for |
General Comments 0
You need to be logged in to leave comments.
Login now