##// END OF EJS Templates
Remove outdated colors_force attribute
Thomas Kluyver -
Show More
@@ -254,15 +254,6 b' class InteractiveShell(SingletonConfigurable):'
254 default_value=get_default_colors(),
254 default_value=get_default_colors(),
255 help="Set the color scheme (NoColor, Linux, or LightBG)."
255 help="Set the color scheme (NoColor, Linux, or LightBG)."
256 ).tag(config=True)
256 ).tag(config=True)
257 colors_force = Bool(False, help=
258 """
259 Force use of ANSI color codes, regardless of OS and readline
260 availability.
261 """
262 # FIXME: This is essentially a hack to allow ZMQShell to show colors
263 # without readline on Win32. When the ZMQ formatting system is
264 # refactored, this should be removed.
265 )
266 debug = Bool(False).tag(config=True)
257 debug = Bool(False).tag(config=True)
267 deep_reload = Bool(False, help=
258 deep_reload = Bool(False, help=
268 """
259 """
@@ -335,31 +335,16 b' Currently the magic system has the following functions:""",'
335 # local shortcut
335 # local shortcut
336 shell = self.shell
336 shell = self.shell
337
337
338
338 # Set shell colour scheme
339
339 try:
340 if not shell.colors_force:
340 shell.colors = new_scheme
341 if sys.platform in {'win32', 'cli'}:
341 shell.refresh_style()
342 import IPython.utils.rlineimpl as readline
342 except:
343 if not readline.have_readline:
343 color_switch_err('shell')
344 msg = """\
345 Proper color support under MS Windows requires the pyreadline library.
346 You can find it at:
347 http://ipython.org/pyreadline.html
348
349 Defaulting color scheme to 'NoColor'"""
350 new_scheme = 'NoColor'
351 warn(msg)
352
353 elif not shell.has_readline:
354 # Coloured prompts get messed up without readline
355 # Will remove this check after switching to prompt_toolkit
356 new_scheme = 'NoColor'
357
344
358 # Set exception colors
345 # Set exception colors
359 try:
346 try:
360 shell.InteractiveTB.set_colors(scheme = new_scheme)
347 shell.InteractiveTB.set_colors(scheme = new_scheme)
361 shell.colors = new_scheme
362 shell.refresh_style()
363 shell.SyntaxTB.set_colors(scheme = new_scheme)
348 shell.SyntaxTB.set_colors(scheme = new_scheme)
364 except:
349 except:
365 color_switch_err('exception')
350 color_switch_err('exception')
@@ -87,8 +87,6 b' else:'
87 _use_simple_prompt = ('IPY_TEST_SIMPLE_PROMPT' in os.environ) or (not _is_tty)
87 _use_simple_prompt = ('IPY_TEST_SIMPLE_PROMPT' in os.environ) or (not _is_tty)
88
88
89 class TerminalInteractiveShell(InteractiveShell):
89 class TerminalInteractiveShell(InteractiveShell):
90 colors_force = True
91
92 space_for_menu = Integer(6, help='Number of line at the bottom of the screen '
90 space_for_menu = Integer(6, help='Number of line at the bottom of the screen '
93 'to reserve for the completion menu'
91 'to reserve for the completion menu'
94 ).tag(config=True)
92 ).tag(config=True)
General Comments 0
You need to be logged in to leave comments. Login now