Show More
@@ -1,7 +1,7 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """Magic functions for InteractiveShell. |
|
3 | 3 | |
|
4 |
$Id: Magic.py 242 |
|
|
4 | $Id: Magic.py 2426 2007-06-11 17:12:29Z vivainio $""" | |
|
5 | 5 | |
|
6 | 6 | #***************************************************************************** |
|
7 | 7 | # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and |
@@ -35,6 +35,7 b' import textwrap' | |||
|
35 | 35 | from cStringIO import StringIO |
|
36 | 36 | from getopt import getopt,GetoptError |
|
37 | 37 | from pprint import pprint, pformat |
|
38 | from sets import Set | |
|
38 | 39 | |
|
39 | 40 | # cProfile was added in Python2.5 |
|
40 | 41 | try: |
@@ -70,7 +71,7 b' def compress_dhist(dh):' | |||
|
70 | 71 | head, tail = dh[:-10], dh[-10:] |
|
71 | 72 | |
|
72 | 73 | newhead = [] |
|
73 |
done = |
|
|
74 | done = Set() | |
|
74 | 75 | for h in head: |
|
75 | 76 | if h in done: |
|
76 | 77 | continue |
@@ -2480,7 +2481,7 b' Defaulting color scheme to \'NoColor\'"""' | |||
|
2480 | 2481 | cwd = os.getcwd() |
|
2481 | 2482 | dhist = self.shell.user_ns['_dh'] |
|
2482 | 2483 | dhist.append(cwd) |
|
2483 |
self.db['dhist'] = compress_dhist(dhist[-100:] |
|
|
2484 | self.db['dhist'] = compress_dhist(dhist)[-100:] | |
|
2484 | 2485 | |
|
2485 | 2486 | else: |
|
2486 | 2487 | os.chdir(self.shell.home_dir) |
@@ -2489,7 +2490,7 b' Defaulting color scheme to \'NoColor\'"""' | |||
|
2489 | 2490 | cwd = os.getcwd() |
|
2490 | 2491 | dhist = self.shell.user_ns['_dh'] |
|
2491 | 2492 | dhist.append(cwd) |
|
2492 |
self.db['dhist'] = dhist[- |
|
|
2493 | self.db['dhist'] = compress_dhist(dhist)[-100:] | |
|
2493 | 2494 | if not 'q' in opts: |
|
2494 | 2495 | print self.shell.user_ns['_dh'][-1] |
|
2495 | 2496 |
General Comments 0
You need to be logged in to leave comments.
Login now