def __init__(self, shell, config=None): super(PromptManager, self).__init__(shell=shell, config=config) # Prepare colour scheme table self.color_scheme_table = coloransi.ColorSchemeTable( [PColNoColors, PColLinux, PColLightBG], self.color_scheme) # Prepare templates & numbers of invisible characters self.update_prompt('in', self.in_template) self.update_prompt('in2', self.in2_template) self.update_prompt('out', self.out_template) self.update_prompt('rewrite') self.on_trait_change(self._update_prompt_trait, ['in_template', 'in2_template', 'out_template'])
def __init__(self, shell, **kwargs): super(PromptManager, self).__init__(shell=shell, **kwargs) # Prepare colour scheme table self.color_scheme_table = coloransi.ColorSchemeTable( [NoColor, LinuxColors, LightBGColors], self.color_scheme) self._formatter = UserNSFormatter(shell) # Prepare templates & numbers of invisible characters self.update_prompt('in', self.in_template) self.update_prompt('in2', self.in2_template) self.update_prompt('out', self.out_template) self.update_prompt('rewrite') self.on_trait_change(self._update_prompt_trait, ['in_template', 'in2_template', 'out_template'])
#----------------------------------------------------------------------------- import os import re import socket import sys from IPython.core import release from IPython.external.Itpl import ItplNS from IPython.utils import coloransi #----------------------------------------------------------------------------- # Color schemes for prompts #----------------------------------------------------------------------------- PromptColors = coloransi.ColorSchemeTable() InputColors = coloransi.InputTermColors # just a shorthand Colors = coloransi.TermColors # just a shorthand PromptColors.add_scheme(coloransi.ColorScheme( 'NoColor', in_prompt = InputColors.NoColor, # Input prompt in_number = InputColors.NoColor, # Input prompt number in_prompt2 = InputColors.NoColor, # Continuation prompt in_normal = InputColors.NoColor, # color off (usu. Colors.Normal) out_prompt = Colors.NoColor, # Output prompt out_number = Colors.NoColor, # Output prompt number normal = Colors.NoColor # color off (usu. Colors.Normal) ))