##// END OF EJS Templates
Cosmetic cleanups: put all imports in a single line, and sort them...
fperez -
Show More
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Configuration loader
2 """Configuration loader
3
3
4 $Id: ConfigLoader.py 525 2005-02-19 10:53:12Z fperez $"""
4 $Id: ConfigLoader.py 958 2005-12-27 23:17:51Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
7 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
@@ -14,9 +14,9 b' from IPython import Release'
14 __author__ = '%s <%s>' % Release.authors['Fernando']
14 __author__ = '%s <%s>' % Release.authors['Fernando']
15 __license__ = Release.license
15 __license__ = Release.license
16
16
17 import exceptions
17 import os
18 import os
18 from pprint import pprint
19 from pprint import pprint
19 import exceptions
20
20
21 from IPython import ultraTB
21 from IPython import ultraTB
22 from IPython.Struct import Struct
22 from IPython.Struct import Struct
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """sys.excepthook for IPython itself, leaves a detailed report on disk.
2 """sys.excepthook for IPython itself, leaves a detailed report on disk.
3
3
4 $Id: CrashHandler.py 951 2005-12-25 00:57:24Z fperez $"""
4 $Id: CrashHandler.py 958 2005-12-27 23:17:51Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
7 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
@@ -19,7 +19,8 b' __version__ = Release.version'
19 # Required modules
19 # Required modules
20
20
21 # From the standard library
21 # From the standard library
22 import os,sys
22 import os
23 import sys
23 from pprint import pprint,pformat
24 from pprint import pprint,pformat
24
25
25 # Homebrewed
26 # Homebrewed
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """DPyGetOpt -- Demiurge Python GetOptions Module
2 """DPyGetOpt -- Demiurge Python GetOptions Module
3
3
4 $Id: DPyGetOpt.py 389 2004-10-09 07:59:30Z fperez $
4 $Id: DPyGetOpt.py 958 2005-12-27 23:17:51Z fperez $
5
5
6 This module is modeled after perl's Getopt::Long module-- which
6 This module is modeled after perl's Getopt::Long module-- which
7 is, in turn, modeled after GNU's extended getopt() function.
7 is, in turn, modeled after GNU's extended getopt() function.
@@ -33,7 +33,7 b' and -baz options that appear on within the parsed argument list'
33 must have a real number argument and that the accumulated list
33 must have a real number argument and that the accumulated list
34 of values will be available under the name 'foo'
34 of values will be available under the name 'foo'
35
35
36 $Id: DPyGetOpt.py 389 2004-10-09 07:59:30Z fperez $"""
36 $Id: DPyGetOpt.py 958 2005-12-27 23:17:51Z fperez $"""
37
37
38 #*****************************************************************************
38 #*****************************************************************************
39 #
39 #
@@ -69,8 +69,8 b" __version__ = '1.2'"
69 # Modified to use re instead of regex and regsub modules.
69 # Modified to use re instead of regex and regsub modules.
70 # 2001/5/7, Jonathan Hogg <jonathan@onegoodidea.com>
70 # 2001/5/7, Jonathan Hogg <jonathan@onegoodidea.com>
71
71
72 import string
73 import re
72 import re
73 import string
74 import sys
74 import sys
75 import types
75 import types
76
76
@@ -15,13 +15,19 b' details on the PSF (Python Software Foundation) standard license, see:'
15
15
16 http://www.python.org/2.2.3/license.html
16 http://www.python.org/2.2.3/license.html
17
17
18 $Id: Debugger.py 951 2005-12-25 00:57:24Z fperez $"""
18 $Id: Debugger.py 958 2005-12-27 23:17:51Z fperez $"""
19
19
20 from IPython import Release
20 from IPython import Release
21 __author__ = '%s <%s>' % Release.authors['Fernando']
21 __author__ = '%s <%s>' % Release.authors['Fernando']
22 __license__ = 'Python'
22 __license__ = 'Python'
23
23
24 import pdb,bdb,cmd,os,sys,linecache
24 import bdb
25 import cmd
26 import linecache
27 import os
28 import pdb
29 import sys
30
25 from IPython import PyColorize, ColorANSI
31 from IPython import PyColorize, ColorANSI
26 from IPython.genutils import Term
32 from IPython.genutils import Term
27 from IPython.excolors import ExceptionColors
33 from IPython.excolors import ExceptionColors
@@ -13,14 +13,19 b' Gnuplot, so it should be safe to do:'
13
13
14 import IPython.Gnuplot2 as Gnuplot
14 import IPython.Gnuplot2 as Gnuplot
15
15
16 $Id: Gnuplot2.py 392 2004-10-09 22:01:51Z fperez $"""
16 $Id: Gnuplot2.py 958 2005-12-27 23:17:51Z fperez $"""
17
17
18 import string,os,time,types
19 import cStringIO
18 import cStringIO
19 import os
20 import string
20 import sys
21 import sys
21 import tempfile
22 import tempfile
22 import Numeric
23 import time
24 import types
25
23 import Gnuplot as Gnuplot_ori
26 import Gnuplot as Gnuplot_ori
27 import Numeric
28
24 from IPython.genutils import popkey,xsys
29 from IPython.genutils import popkey,xsys
25
30
26 # needed by hardcopy():
31 # needed by hardcopy():
@@ -44,7 +44,7 b' each time the instance is evaluated with str(instance). For example:'
44 foo = "bar"
44 foo = "bar"
45 print str(s)
45 print str(s)
46
46
47 $Id: Itpl.py 638 2005-07-18 03:01:41Z fperez $
47 $Id: Itpl.py 958 2005-12-27 23:17:51Z fperez $
48 """ # ' -> close an open quote for stupid emacs
48 """ # ' -> close an open quote for stupid emacs
49
49
50 #*****************************************************************************
50 #*****************************************************************************
@@ -77,9 +77,10 b' $Id: Itpl.py 638 2005-07-18 03:01:41Z fperez $'
77 __author__ = 'Ka-Ping Yee <ping@lfw.org>'
77 __author__ = 'Ka-Ping Yee <ping@lfw.org>'
78 __license__ = 'MIT'
78 __license__ = 'MIT'
79
79
80 import sys, string
80 import string
81 from types import StringType
81 import sys
82 from tokenize import tokenprog
82 from tokenize import tokenprog
83 from types import StringType
83
84
84 class ItplError(ValueError):
85 class ItplError(ValueError):
85 def __init__(self, text, pos):
86 def __init__(self, text, pos):
@@ -2,7 +2,7 b''
2 """
2 """
3 Logger class for IPython's logging facilities.
3 Logger class for IPython's logging facilities.
4
4
5 $Id: Logger.py 430 2004-11-30 08:52:05Z fperez $
5 $Id: Logger.py 958 2005-12-27 23:17:51Z fperez $
6 """
6 """
7
7
8 #*****************************************************************************
8 #*****************************************************************************
@@ -22,7 +22,9 b" __author__ = '%s <%s>\\n%s <%s>' % \\"
22 __license__ = Release.license
22 __license__ = Release.license
23
23
24 # Python standard modules
24 # Python standard modules
25 import os,sys,glob
25 import glob
26 import os
27 import sys
26
28
27 # Homebrewed
29 # Homebrewed
28 from IPython.genutils import *
30 from IPython.genutils import *
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Magic functions for InteractiveShell.
2 """Magic functions for InteractiveShell.
3
3
4 $Id: Magic.py 951 2005-12-25 00:57:24Z fperez $"""
4 $Id: Magic.py 958 2005-12-27 23:17:51Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
@@ -21,11 +21,18 b' __license__ = Release.license'
21
21
22 # Python standard modules
22 # Python standard modules
23 import __builtin__
23 import __builtin__
24 import os,sys,inspect,pydoc,re,tempfile,pdb,bdb,time
24 import bdb
25 import Debugger
25 import inspect
26 import os
27 import pdb
28 import pydoc
29 import sys
30 import re
31 import tempfile
32 import time
33 from cStringIO import StringIO
26 from getopt import getopt
34 from getopt import getopt
27 from pprint import pprint, pformat
35 from pprint import pprint, pformat
28 from cStringIO import StringIO
29
36
30 # profile isn't bundled by default in Debian for license reasons
37 # profile isn't bundled by default in Debian for license reasons
31 try:
38 try:
@@ -34,12 +41,11 b' except ImportError:'
34 profile = pstats = None
41 profile = pstats = None
35
42
36 # Homebrewed
43 # Homebrewed
37 from IPython.Struct import Struct
44 from IPython import Debugger, OInspect, wildcard
38 from IPython.Itpl import Itpl, itpl, printpl,itplns
39 from IPython.FakeModule import FakeModule
45 from IPython.FakeModule import FakeModule
46 from IPython.Itpl import Itpl, itpl, printpl,itplns
40 from IPython.PyColorize import Parser
47 from IPython.PyColorize import Parser
41 from IPython import OInspect
48 from IPython.Struct import Struct
42 from IPython import wildcard
43 from IPython.genutils import *
49 from IPython.genutils import *
44
50
45 # Globals to be set later by Magic constructor
51 # Globals to be set later by Magic constructor
@@ -6,7 +6,7 b' Uses syntax highlighting for presenting the various information elements.'
6 Similar in spirit to the inspect module, but all calls take a name argument to
6 Similar in spirit to the inspect module, but all calls take a name argument to
7 reference the name under which an object is being read.
7 reference the name under which an object is being read.
8
8
9 $Id: OInspect.py 923 2005-11-15 08:51:15Z fperez $
9 $Id: OInspect.py 958 2005-12-27 23:17:51Z fperez $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
@@ -24,13 +24,17 b" __all__ = ['Inspector','InspectColors']"
24
24
25 # stdlib modules
25 # stdlib modules
26 import __builtin__
26 import __builtin__
27 import inspect,linecache,types,StringIO,string
27 import inspect
28 import linecache
29 import string
30 import StringIO
31 import types
28
32
29 # IPython's own
33 # IPython's own
30 from IPython import PyColorize
34 from IPython import PyColorize
35 from IPython.genutils import page,indent,Term,mkdict
31 from IPython.Itpl import itpl
36 from IPython.Itpl import itpl
32 from IPython.wildcard import list_namespace
37 from IPython.wildcard import list_namespace
33 from IPython.genutils import page,indent,Term,mkdict
34 from IPython.ColorANSI import *
38 from IPython.ColorANSI import *
35
39
36 #****************************************************************************
40 #****************************************************************************
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Class to trap stdout and stderr and log them separately.
2 """Class to trap stdout and stderr and log them separately.
3
3
4 $Id: OutputTrap.py 542 2005-03-18 09:16:04Z fperez $"""
4 $Id: OutputTrap.py 958 2005-12-27 23:17:51Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
7 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
@@ -14,7 +14,8 b' from IPython import Release'
14 __author__ = '%s <%s>' % Release.authors['Fernando']
14 __author__ = '%s <%s>' % Release.authors['Fernando']
15 __license__ = Release.license
15 __license__ = Release.license
16
16
17 import exceptions,sys
17 import exceptions
18 import sys
18 from cStringIO import StringIO
19 from cStringIO import StringIO
19
20
20 class OutputTrapError(exceptions.Exception):
21 class OutputTrapError(exceptions.Exception):
@@ -2,7 +2,7 b''
2 """
2 """
3 Classes for handling input/output prompts.
3 Classes for handling input/output prompts.
4
4
5 $Id: Prompts.py 951 2005-12-25 00:57:24Z fperez $"""
5 $Id: Prompts.py 958 2005-12-27 23:17:51Z fperez $"""
6
6
7 #*****************************************************************************
7 #*****************************************************************************
8 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
8 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
@@ -19,7 +19,9 b' __version__ = Release.version'
19 #****************************************************************************
19 #****************************************************************************
20 # Required modules
20 # Required modules
21 import __builtin__
21 import __builtin__
22 import os,sys,socket
22 import os
23 import socket
24 import sys
23 import time
25 import time
24 from pprint import pprint,pformat
26 from pprint import pprint,pformat
25
27
@@ -28,15 +28,20 b''
28 scan Python source code and re-emit it with no changes to its original
28 scan Python source code and re-emit it with no changes to its original
29 formatting (which is the hard part).
29 formatting (which is the hard part).
30
30
31 $Id: PyColorize.py 485 2005-01-27 19:15:39Z fperez $"""
31 $Id: PyColorize.py 958 2005-12-27 23:17:51Z fperez $"""
32
32
33 __all__ = ['ANSICodeColors','Parser']
33 __all__ = ['ANSICodeColors','Parser']
34
34
35 _scheme_default = 'Linux'
35 _scheme_default = 'Linux'
36
36
37 # Imports
37 # Imports
38 import string, sys, os, cStringIO
38 import cStringIO
39 import keyword, token, tokenize
39 import keyword
40 import os
41 import string
42 import sys
43 import token
44 import tokenize
40
45
41 from IPython.ColorANSI import *
46 from IPython.ColorANSI import *
42
47
@@ -4,7 +4,7 b''
4 All the matplotlib support code was co-developed with John Hunter,
4 All the matplotlib support code was co-developed with John Hunter,
5 matplotlib's author.
5 matplotlib's author.
6
6
7 $Id: Shell.py 952 2005-12-26 17:51:33Z fperez $"""
7 $Id: Shell.py 958 2005-12-27 23:17:51Z fperez $"""
8
8
9 #*****************************************************************************
9 #*****************************************************************************
10 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
10 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
@@ -20,19 +20,18 b' __license__ = Release.license'
20 # Code begins
20 # Code begins
21 import __main__
21 import __main__
22 import __builtin__
22 import __builtin__
23 import sys
24 import os
23 import os
25 import code
24 import sys
26 import threading
27 import signal
25 import signal
26 import threading
28
27
29 import IPython
28 import IPython
29 from IPython import ultraTB
30 from IPython.genutils import Term,warn,error,flag_calls
30 from IPython.iplib import InteractiveShell
31 from IPython.iplib import InteractiveShell
31 from IPython.ipmaker import make_IPython
32 from IPython.ipmaker import make_IPython
32 from IPython.genutils import Term,warn,error,flag_calls
33 from IPython.Struct import Struct
34 from IPython.Magic import Magic
33 from IPython.Magic import Magic
35 from IPython import ultraTB
34 from IPython.Struct import Struct
36
35
37 # global flag to pass around information about Ctrl-C without exceptions
36 # global flag to pass around information about Ctrl-C without exceptions
38 KBINT = False
37 KBINT = False
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Mimic C structs with lots of extra functionality.
2 """Mimic C structs with lots of extra functionality.
3
3
4 $Id: Struct.py 638 2005-07-18 03:01:41Z fperez $"""
4 $Id: Struct.py 958 2005-12-27 23:17:51Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
7 # Copyright (C) 2001-2004 Fernando Perez <fperez@colorado.edu>
@@ -17,6 +17,7 b' __license__ = Release.license'
17 __all__ = ['Struct']
17 __all__ = ['Struct']
18
18
19 import types
19 import types
20
20 from IPython.genutils import list2dict2
21 from IPython.genutils import list2dict2
21
22
22 class Struct:
23 class Struct:
@@ -18,7 +18,7 b' http://folk.uio.no/hpl/scripting'
18 (although ultimately no code from this text was used, as IPython's system is a
18 (although ultimately no code from this text was used, as IPython's system is a
19 separate implementation).
19 separate implementation).
20
20
21 $Id: background_jobs.py 638 2005-07-18 03:01:41Z fperez $
21 $Id: background_jobs.py 958 2005-12-27 23:17:51Z fperez $
22 """
22 """
23
23
24 #*****************************************************************************
24 #*****************************************************************************
@@ -33,7 +33,8 b" __author__ = '%s <%s>' % Release.authors['Fernando']"
33 __license__ = Release.license
33 __license__ = Release.license
34
34
35 # Code begins
35 # Code begins
36 import threading,sys
36 import sys
37 import threading
37
38
38 from IPython.ultraTB import AutoFormattedTB
39 from IPython.ultraTB import AutoFormattedTB
39 from IPython.genutils import warn,error
40 from IPython.genutils import warn,error
@@ -77,10 +77,10 b' from IPython.genutils import shlex_split'
77
77
78 __all__ = ['Completer','IPCompleter']
78 __all__ = ['Completer','IPCompleter']
79
79
80 def get_class_members(klass):
80 def get_class_members(cls):
81 ret = dir(klass)
81 ret = dir(cls)
82 if hasattr(klass,'__bases__'):
82 if hasattr(cls,'__bases__'):
83 for base in klass.__bases__:
83 for base in cls.__bases__:
84 ret.extend(get_class_members(base))
84 ret.extend(get_class_members(base))
85 return ret
85 return ret
86
86
@@ -12,7 +12,7 b' Alternatively, you can add a dreload builtin alongside normal reload with:'
12
12
13 This code is almost entirely based on knee.py from the standard library.
13 This code is almost entirely based on knee.py from the standard library.
14
14
15 $Id: deep_reload.py 410 2004-11-04 07:58:17Z fperez $"""
15 $Id: deep_reload.py 958 2005-12-27 23:17:51Z fperez $"""
16
16
17 #*****************************************************************************
17 #*****************************************************************************
18 # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu>
18 # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu>
@@ -27,7 +27,9 b' __license__ = Release.license'
27 __version__ = "0.5"
27 __version__ = "0.5"
28 __date__ = "21 August 2001"
28 __date__ = "21 August 2001"
29
29
30 import sys, imp, __builtin__
30 import __builtin__
31 import imp
32 import sys
31
33
32 # Replacement for __import__()
34 # Replacement for __import__()
33 def deep_import_hook(name, globals=None, locals=None, fromlist=None):
35 def deep_import_hook(name, globals=None, locals=None, fromlist=None):
@@ -107,9 +107,9 b' environments.'
107 #
107 #
108 #*****************************************************************************
108 #*****************************************************************************
109
109
110 import sys
111 import exceptions
110 import exceptions
112 import re
111 import re
112 import sys
113
113
114 from IPython.PyColorize import Parser
114 from IPython.PyColorize import Parser
115 from IPython.genutils import marquee, shlex_split, file_read
115 from IPython.genutils import marquee, shlex_split, file_read
@@ -5,7 +5,7 b' General purpose utilities.'
5 This is a grab-bag of stuff I find useful in most programs I write. Some of
5 This is a grab-bag of stuff I find useful in most programs I write. Some of
6 these things are also convenient when working at the command line.
6 these things are also convenient when working at the command line.
7
7
8 $Id: genutils.py 908 2005-09-26 16:05:48Z fperez $"""
8 $Id: genutils.py 958 2005-12-27 23:17:51Z fperez $"""
9
9
10 #*****************************************************************************
10 #*****************************************************************************
11 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
11 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
@@ -21,11 +21,19 b" __author__ = '%s <%s>' % Release.authors['Fernando']"
21 __license__ = Release.license
21 __license__ = Release.license
22
22
23 #****************************************************************************
23 #****************************************************************************
24 # required modules
24 # required modules from the Python standard library
25 import __main__
25 import __main__
26 import types,commands,time,sys,os,re,shutil
26 import commands
27 import os
28 import re
27 import shlex
29 import shlex
30 import shutil
31 import sys
28 import tempfile
32 import tempfile
33 import time
34 import types
35
36 # Other IPython utilities
29 from IPython.Itpl import Itpl,itpl,printpl
37 from IPython.Itpl import Itpl,itpl,printpl
30 from IPython import DPyGetOpt
38 from IPython import DPyGetOpt
31
39
@@ -6,7 +6,7 b' Requires Python 2.1 or newer.'
6
6
7 This file contains all the classes and helper functions specific to IPython.
7 This file contains all the classes and helper functions specific to IPython.
8
8
9 $Id: iplib.py 957 2005-12-27 22:33:22Z fperez $
9 $Id: iplib.py 958 2005-12-27 23:17:51Z fperez $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
@@ -64,18 +64,15 b' from pprint import pprint, pformat'
64 import IPython
64 import IPython
65 from IPython import OInspect,PyColorize,ultraTB
65 from IPython import OInspect,PyColorize,ultraTB
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
66 from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names
67 from IPython.FakeModule import FakeModule
68 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
67 from IPython.Logger import Logger
69 from IPython.Logger import Logger
68 from IPython.Magic import Magic,magic2python
70 from IPython.Magic import Magic,magic2python
69 from IPython.usage import cmd_line_usage,interactive_usage
70 from IPython.Struct import Struct
71 from IPython.Struct import Struct
71 from IPython.Itpl import Itpl,itpl,printpl,ItplNS,itplns
72 from IPython.FakeModule import FakeModule
73 from IPython.background_jobs import BackgroundJobManager
72 from IPython.background_jobs import BackgroundJobManager
74 from IPython.PyColorize import Parser
73 from IPython.usage import cmd_line_usage,interactive_usage
75 from IPython.genutils import *
74 from IPython.genutils import *
76
75
77 # Global pointer to the running
78
79 # store the builtin raw_input globally, and use this always, in case user code
76 # store the builtin raw_input globally, and use this always, in case user code
80 # overwrites it (like wx.py.PyShell does)
77 # overwrites it (like wx.py.PyShell does)
81 raw_input_original = raw_input
78 raw_input_original = raw_input
@@ -421,7 +418,7 b' class InteractiveShell(Logger, Magic):'
421 Magic.set_shell(self,self)
418 Magic.set_shell(self,self)
422
419
423 # Python source parser/formatter for syntax highlighting
420 # Python source parser/formatter for syntax highlighting
424 pyformat = Parser().format
421 pyformat = PyColorize.Parser().format
425 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
422 self.pycolorize = lambda src: pyformat(src,'str',self.rc['colors'])
426
423
427 # hooks holds pointers used for user-side customizations
424 # hooks holds pointers used for user-side customizations
@@ -553,9 +550,9 b' class InteractiveShell(Logger, Magic):'
553 self.set_custom_exc(*custom_exceptions)
550 self.set_custom_exc(*custom_exceptions)
554
551
555 # Object inspector
552 # Object inspector
556 ins_colors = OInspect.InspectColors
553 self.inspector = OInspect.Inspector(OInspect.InspectColors,
557 code_colors = PyColorize.ANSICodeColors
554 PyColorize.ANSICodeColors,
558 self.inspector = OInspect.Inspector(ins_colors,code_colors,'NoColor')
555 'NoColor')
559 self.autoindent = False
556 self.autoindent = False
560
557
561 # Make some aliases automatically
558 # Make some aliases automatically
@@ -1440,8 +1437,7 b' want to merge them back into the new files.""" % locals()'
1440
1437
1441 """
1438 """
1442 self.buffer.append(line)
1439 self.buffer.append(line)
1443 source = "\n".join(self.buffer)
1440 more = self.runsource('\n'.join(self.buffer), self.filename)
1444 more = self.runsource(source, self.filename)
1445 if not more:
1441 if not more:
1446 self.resetbuffer()
1442 self.resetbuffer()
1447 return more
1443 return more
@@ -6,7 +6,7 b' Requires Python 2.1 or better.'
6
6
7 This file contains the main make_IPython() starter function.
7 This file contains the main make_IPython() starter function.
8
8
9 $Id: ipmaker.py 925 2005-11-15 20:39:39Z fperez $"""
9 $Id: ipmaker.py 958 2005-12-27 23:17:51Z fperez $"""
10
10
11 #*****************************************************************************
11 #*****************************************************************************
12 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
12 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
@@ -36,8 +36,12 b' All Rights Reserved."""'
36 # Required modules
36 # Required modules
37
37
38 # From the standard library
38 # From the standard library
39 import __main__, __builtin__
39 import __main__
40 import os,sys,types,re
40 import __builtin__
41 import os
42 import re
43 import sys
44 import types
41 from pprint import pprint,pformat
45 from pprint import pprint,pformat
42
46
43 # Our own
47 # Our own
@@ -5,7 +5,7 b' A set of convenient utilities for numerical work.'
5 Most of this module requires Numerical Python or is meant to be used with it.
5 Most of this module requires Numerical Python or is meant to be used with it.
6 See http://www.pfdubois.com/numpy for details.
6 See http://www.pfdubois.com/numpy for details.
7
7
8 $Id: numutils.py 486 2005-01-27 19:34:21Z fperez $"""
8 $Id: numutils.py 958 2005-12-27 23:17:51Z fperez $"""
9
9
10 #*****************************************************************************
10 #*****************************************************************************
11 # Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
11 # Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
@@ -29,8 +29,10 b" __all__ = ['sum_flat','mean_flat','rms_flat','base_repr','binary_repr',"
29 #****************************************************************************
29 #****************************************************************************
30 # required modules
30 # required modules
31 import __main__
31 import __main__
32 import sys,operator
33 import math
32 import math
33 import operator
34 import sys
35
34 import Numeric
36 import Numeric
35 from Numeric import *
37 from Numeric import *
36
38
@@ -60,7 +60,7 b' You can implement other color schemes easily, the syntax is fairly'
60 self-explanatory. Please send back new schemes you develop to the author for
60 self-explanatory. Please send back new schemes you develop to the author for
61 possible inclusion in future releases.
61 possible inclusion in future releases.
62
62
63 $Id: ultraTB.py 954 2005-12-26 19:40:50Z fperez $"""
63 $Id: ultraTB.py 958 2005-12-27 23:17:51Z fperez $"""
64
64
65 #*****************************************************************************
65 #*****************************************************************************
66 # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu>
66 # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu>
@@ -76,17 +76,24 b" __author__ = '%s <%s>\\n%s <%s>' % (Release.authors['Nathan']+"
76 __license__ = Release.license
76 __license__ = Release.license
77
77
78 # Required modules
78 # Required modules
79 import sys, os, traceback, types, string, time
79 import inspect
80 import keyword, tokenize, linecache, inspect, pydoc
80 import keyword
81 from UserDict import UserDict
81 import linecache
82 import os
83 import pydoc
84 import string
85 import sys
86 import time
87 import tokenize
88 import traceback
89 import types
82
90
83 # IPython's own modules
91 # IPython's own modules
84 # Modified pdb which doesn't damage IPython's readline handling
92 # Modified pdb which doesn't damage IPython's readline handling
85 from IPython import Debugger
93 from IPython import Debugger
86
87 from IPython.Struct import Struct
94 from IPython.Struct import Struct
88 from IPython.genutils import Term,uniq_stable,error,info
89 from IPython.excolors import ExceptionColors
95 from IPython.excolors import ExceptionColors
96 from IPython.genutils import Term,uniq_stable,error,info
90
97
91 #---------------------------------------------------------------------------
98 #---------------------------------------------------------------------------
92 # Code begins
99 # Code begins
@@ -16,11 +16,11 b' __author__ = "J\xc3\xb6rgen Stenarson <jorgen.stenarson@bostream.nu>"'
16 __license__ = Release.license
16 __license__ = Release.license
17
17
18 import __builtin__
18 import __builtin__
19 import types
20 import re
21 import pprint
22 import exceptions
19 import exceptions
23 import pdb
20 import pdb
21 import pprint
22 import re
23 import types
24
24
25 def create_typestr2type_dicts(dont_include_in_type2type2str=["lambda"]):
25 def create_typestr2type_dicts(dont_include_in_type2type2str=["lambda"]):
26 """Return dictionaries mapping lower case typename to type objects, from
26 """Return dictionaries mapping lower case typename to type objects, from
General Comments 0
You need to be logged in to leave comments. Login now