Show More
@@ -21,13 +21,12 b' Authors' | |||
|
21 | 21 | # From the standard library |
|
22 | 22 | import os |
|
23 | 23 | import sys |
|
24 |
from pprint import |
|
|
24 | from pprint import pformat | |
|
25 | 25 | |
|
26 | 26 | # Our own |
|
27 | 27 | from IPython import Release |
|
28 | 28 | from IPython import ultraTB |
|
29 | from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names | |
|
30 | from IPython.Itpl import Itpl,itpl,printpl | |
|
29 | from IPython.Itpl import itpl | |
|
31 | 30 | |
|
32 | 31 | from IPython.genutils import * |
|
33 | 32 |
@@ -31,7 +31,8 b' import linecache' | |||
|
31 | 31 | import os |
|
32 | 32 | import sys |
|
33 | 33 | |
|
34 |
from IPython import PyColorize, |
|
|
34 | from IPython import PyColorize, ipapi | |
|
35 | from IPython.utils import coloransi | |
|
35 | 36 | from IPython.genutils import Term |
|
36 | 37 | from IPython.excolors import exception_colors |
|
37 | 38 | |
@@ -114,7 +115,7 b' class Tracer(object):' | |||
|
114 | 115 | def_colors = 'NoColor' |
|
115 | 116 | try: |
|
116 | 117 | # Limited tab completion support |
|
117 |
import |
|
|
118 | import readline | |
|
118 | 119 | readline.parse_and_bind('tab: complete') |
|
119 | 120 | except ImportError: |
|
120 | 121 | pass |
@@ -207,7 +208,7 b' class Pdb(OldPdb):' | |||
|
207 | 208 | self.color_scheme_table = exception_colors() |
|
208 | 209 | |
|
209 | 210 | # shorthands |
|
210 |
C = |
|
|
211 | C = coloransi.TermColors | |
|
211 | 212 | cst = self.color_scheme_table |
|
212 | 213 | |
|
213 | 214 | cst['NoColor'].colors.breakpoint_enabled = C.NoColor |
@@ -254,7 +255,7 b' class Pdb(OldPdb):' | |||
|
254 | 255 | self.color_scheme_table = exception_colors() |
|
255 | 256 | |
|
256 | 257 | # shorthands |
|
257 |
C = |
|
|
258 | C = coloransi.TermColors | |
|
258 | 259 | cst = self.color_scheme_table |
|
259 | 260 | |
|
260 | 261 | cst['NoColor'].colors.breakpoint_enabled = C.NoColor |
@@ -31,7 +31,7 b' from IPython import PyColorize' | |||
|
31 | 31 | from IPython.genutils import page,indent,Term |
|
32 | 32 | from IPython.Itpl import itpl |
|
33 | 33 | from IPython.wildcard import list_namespace |
|
34 |
from IPython. |
|
|
34 | from IPython.utils.coloransi import * | |
|
35 | 35 | |
|
36 | 36 | #**************************************************************************** |
|
37 | 37 | # HACK!!! This is a crude fix for bugs in python 2.3's inspect module. We |
@@ -20,7 +20,7 b' import sys' | |||
|
20 | 20 | import time |
|
21 | 21 | |
|
22 | 22 | # IPython's own |
|
23 |
from IPython import |
|
|
23 | from IPython.utils import coloransi | |
|
24 | 24 | from IPython import Release |
|
25 | 25 | from IPython.external.Itpl import ItplNS |
|
26 | 26 | from IPython.ipapi import TryNext |
@@ -32,11 +32,11 b' from IPython.genutils import *' | |||
|
32 | 32 | #**************************************************************************** |
|
33 | 33 | #Color schemes for Prompts. |
|
34 | 34 | |
|
35 |
PromptColors = |
|
|
36 |
InputColors = |
|
|
37 |
Colors = |
|
|
35 | PromptColors = coloransi.ColorSchemeTable() | |
|
36 | InputColors = coloransi.InputTermColors # just a shorthand | |
|
37 | Colors = coloransi.TermColors # just a shorthand | |
|
38 | 38 | |
|
39 |
PromptColors.add_scheme( |
|
|
39 | PromptColors.add_scheme(coloransi.ColorScheme( | |
|
40 | 40 | 'NoColor', |
|
41 | 41 | in_prompt = InputColors.NoColor, # Input prompt |
|
42 | 42 | in_number = InputColors.NoColor, # Input prompt number |
@@ -50,7 +50,7 b' PromptColors.add_scheme(ColorANSI.ColorScheme(' | |||
|
50 | 50 | )) |
|
51 | 51 | |
|
52 | 52 | # make some schemes as instances so we can copy them for modification easily: |
|
53 |
__PColLinux = |
|
|
53 | __PColLinux = coloransi.ColorScheme( | |
|
54 | 54 | 'Linux', |
|
55 | 55 | in_prompt = InputColors.Green, |
|
56 | 56 | in_number = InputColors.LightGreen, |
@@ -185,7 +185,7 b" prompt_specials_nocolor[r'\\#'] = '${self.cache.prompt_count}'" | |||
|
185 | 185 | # with a color name which may begin with a letter used by any other of the |
|
186 | 186 | # allowed specials. This of course means that \\C will never be allowed for |
|
187 | 187 | # anything else. |
|
188 |
input_colors = |
|
|
188 | input_colors = coloransi.InputTermColors | |
|
189 | 189 | for _color in dir(input_colors): |
|
190 | 190 | if _color[0] != '_': |
|
191 | 191 | c_name = r'\C_'+_color |
@@ -38,12 +38,11 b' import cStringIO' | |||
|
38 | 38 | import keyword |
|
39 | 39 | import os |
|
40 | 40 | import optparse |
|
41 | import string | |
|
42 | 41 | import sys |
|
43 | 42 | import token |
|
44 | 43 | import tokenize |
|
45 | 44 | |
|
46 |
from IPython. |
|
|
45 | from IPython.utils.coloransi import * | |
|
47 | 46 | |
|
48 | 47 | ############################################################################# |
|
49 | 48 | ### Python Source Parser (does Hilighting) |
@@ -1,4 +1,4 b'' | |||
|
1 | # -*- coding: utf-8 -*- | |
|
1 | # -*- coding: utf-8 -*- | |
|
2 | 2 | """ |
|
3 | 3 | IPython -- An enhanced Interactive Python |
|
4 | 4 |
@@ -12,7 +12,7 b' Color schemes for exception handling code in IPython.' | |||
|
12 | 12 | |
|
13 | 13 | #**************************************************************************** |
|
14 | 14 | # Required modules |
|
15 |
from IPython. |
|
|
15 | from IPython.utils.coloransi import ColorSchemeTable, TermColors, ColorScheme | |
|
16 | 16 | |
|
17 | 17 | def exception_colors(): |
|
18 | 18 | """Return a color table with fields for exception reporting. |
@@ -105,8 +105,8 b" ANSI_STYLES = {'0;30': [0, 'BLACK'], '0;31': [1, 'RED']," | |||
|
105 | 105 | [13, 'MEDIUM VIOLET RED'], |
|
106 | 106 | '1;36': [14, 'LIGHT STEEL BLUE'], '1;37': [15, 'YELLOW']} |
|
107 | 107 | |
|
108 |
# XXX: Maybe one day we should factor this code with |
|
|
109 |
# |
|
|
108 | # XXX: Maybe one day we should factor this code with coloransi. Right now | |
|
109 | # coloransi is hard to reuse and makes our code more complex. | |
|
110 | 110 | |
|
111 | 111 | #we define platform specific fonts |
|
112 | 112 | if wx.Platform == '__WXMSW__': |
@@ -31,37 +31,29 b' import __main__' | |||
|
31 | 31 | import __builtin__ |
|
32 | 32 | import StringIO |
|
33 | 33 | import bdb |
|
34 | import cPickle as pickle | |
|
35 | 34 | import codeop |
|
36 | 35 | import exceptions |
|
37 | 36 | import glob |
|
38 | import inspect | |
|
39 | 37 | import keyword |
|
40 | 38 | import new |
|
41 | 39 | import os |
|
42 | import pydoc | |
|
43 | 40 | import re |
|
44 | 41 | import shutil |
|
45 | 42 | import string |
|
46 | 43 | import sys |
|
47 | 44 | import tempfile |
|
48 | import traceback | |
|
49 | import types | |
|
50 | from pprint import pprint, pformat | |
|
51 | 45 | |
|
52 | 46 | # IPython's own modules |
|
53 | 47 | #import IPython |
|
54 | 48 | from IPython import Debugger,OInspect,PyColorize,ultraTB |
|
55 | from IPython.ColorANSI import ColorScheme,ColorSchemeTable # too long names | |
|
56 | 49 | from IPython.Extensions import pickleshare |
|
57 | 50 | from IPython.FakeModule import FakeModule, init_fakemod_dict |
|
58 |
from IPython.Itpl import |
|
|
51 | from IPython.Itpl import ItplNS | |
|
59 | 52 | from IPython.Logger import Logger |
|
60 | 53 | from IPython.Magic import Magic |
|
61 | 54 | from IPython.Prompts import CachedOutput |
|
62 | 55 | from IPython.ipstruct import Struct |
|
63 | 56 | from IPython.background_jobs import BackgroundJobManager |
|
64 | from IPython.usage import cmd_line_usage,interactive_usage | |
|
65 | 57 | from IPython.genutils import * |
|
66 | 58 | from IPython.strdispatch import StrDispatch |
|
67 | 59 | import IPython.ipapi |
@@ -21,30 +21,26 b' __docformat__ = "restructuredtext en"' | |||
|
21 | 21 | |
|
22 | 22 | # Required modules |
|
23 | 23 | import __builtin__ |
|
24 | import os | |
|
25 | 24 | import socket |
|
26 | 25 | import sys |
|
27 | import time | |
|
28 | 26 | |
|
29 | 27 | # IPython's own |
|
30 | 28 | from IPython.external.Itpl import ItplNS |
|
31 | from macro import Macro | |
|
32 | 29 | |
|
33 |
from IPython import |
|
|
30 | from IPython.utils import coloransi | |
|
34 | 31 | from IPython import Release |
|
35 | 32 | from IPython.ipapi import TryNext |
|
36 | from IPython.ipstruct import Struct | |
|
37 | 33 | from IPython.genutils import * |
|
38 | 34 | |
|
39 | 35 | #**************************************************************************** |
|
40 | 36 | #Color schemes for Prompts. |
|
41 | 37 | |
|
42 |
PromptColors = |
|
|
43 |
InputColors = |
|
|
44 |
Colors = |
|
|
38 | PromptColors = coloransi.ColorSchemeTable() | |
|
39 | InputColors = coloransi.InputTermColors # just a shorthand | |
|
40 | Colors = coloransi.TermColors # just a shorthand | |
|
45 | 41 | |
|
46 | 42 | |
|
47 |
__PColNoColor = |
|
|
43 | __PColNoColor = coloransi.ColorScheme( | |
|
48 | 44 | 'NoColor', |
|
49 | 45 | in_prompt = InputColors.NoColor, # Input prompt |
|
50 | 46 | in_number = InputColors.NoColor, # Input prompt number |
@@ -172,7 +168,7 b" prompt_specials_nocolor[r'\\#'] = '${self.cache.prompt_count}'" | |||
|
172 | 168 | # with a color name which may begin with a letter used by any other of the |
|
173 | 169 | # allowed specials. This of course means that \\C will never be allowed for |
|
174 | 170 | # anything else. |
|
175 |
input_colors = |
|
|
171 | input_colors = coloransi.InputTermColors | |
|
176 | 172 | for _color in dir(input_colors): |
|
177 | 173 | if _color[0] != '_': |
|
178 | 174 | c_name = r'\C_'+_color |
@@ -17,17 +17,14 b' __docformat__ = "restructuredtext en"' | |||
|
17 | 17 | #------------------------------------------------------------------------------- |
|
18 | 18 | |
|
19 | 19 | import sys |
|
20 | import cPickle as pickle | |
|
21 | from types import FunctionType | |
|
22 | 20 | import linecache |
|
23 | 21 | import warnings |
|
24 | 22 | |
|
25 |
from twisted. |
|
|
26 | from twisted.python import components, log | |
|
23 | from twisted.python import components | |
|
27 | 24 | from twisted.python.failure import Failure |
|
28 | 25 | from zope.interface import Interface, implements, Attribute |
|
29 | 26 | |
|
30 |
from IPython. |
|
|
27 | from IPython.utils.coloransi import TermColors | |
|
31 | 28 | |
|
32 | 29 | from IPython.kernel.twistedutil import blockingCallFromThread |
|
33 | 30 | from IPython.kernel import error |
@@ -37,10 +34,8 b' from IPython.kernel.mapper import (' | |||
|
37 | 34 | IMultiEngineMapperFactory, |
|
38 | 35 | IMapper |
|
39 | 36 | ) |
|
40 | from IPython.kernel import map as Map | |
|
41 |
from IPython.kernel import |
|
|
42 | from IPython.kernel.multiengine import (IFullMultiEngine, | |
|
43 | IFullSynchronousMultiEngine) | |
|
37 | ||
|
38 | from IPython.kernel.multiengine import IFullSynchronousMultiEngine | |
|
44 | 39 | |
|
45 | 40 | |
|
46 | 41 | #------------------------------------------------------------------------------- |
@@ -311,7 +306,7 b' class InteractiveMultiEngineClient(object):' | |||
|
311 | 306 | |
|
312 | 307 | def findsource_file(self,f): |
|
313 | 308 | linecache.checkcache() |
|
314 | s = findsource(f.f_code) | |
|
309 | s = findsource(f.f_code) # findsource is not defined! | |
|
315 | 310 | lnum = f.f_lineno |
|
316 | 311 | wsource = s[0][f.f_lineno:] |
|
317 | 312 | return strip_whitespace(wsource) |
@@ -198,7 +198,7 b' def make_runners():' | |||
|
198 | 198 | # XXX: Shell.py is also ommited because of a bug in the skip_doctest |
|
199 | 199 | # decorator. See ticket https://bugs.launchpad.net/bugs/366209 |
|
200 | 200 | top_mod = \ |
|
201 |
['background_jobs.py', ' |
|
|
201 | ['background_jobs.py', 'coloransi.py', 'completer.py', 'ConfigLoader.py', | |
|
202 | 202 | 'CrashHandler.py', 'Debugger.py', 'deep_reload.py', 'demo.py', |
|
203 | 203 | 'DPyGetOpt.py', 'dtutils.py', 'excolors.py', 'FakeModule.py', |
|
204 | 204 | 'generics.py', 'genutils.py', 'history.py', 'hooks.py', 'ipapi.py', |
|
1 | NO CONTENT: file renamed from IPython/ColorANSI.py to IPython/utils/coloransi.py |
@@ -71,6 +71,17 b' We propose to create the following new sub-packages:' | |||
|
71 | 71 | standards, but that we plan on keeping. To be moved out of this sub-package |
|
72 | 72 | a module needs to have a maintainer, tests and documentation. |
|
73 | 73 | |
|
74 | Prodecure | |
|
75 | ========= | |
|
76 | ||
|
77 | 1. Move the file to its new location with its new name. | |
|
78 | 2. Rename all import statements to reflect the change. | |
|
79 | 3. Run PyFlakes on each changes module. | |
|
80 | 3. Add tests/test_imports.py to test it. | |
|
81 | ||
|
82 | Need to modify iptests to properly skip modules that are no longer top | |
|
83 | level modules. | |
|
84 | ||
|
74 | 85 | Where things will be moved |
|
75 | 86 | ========================== |
|
76 | 87 |
General Comments 0
You need to be logged in to leave comments.
Login now