Esempio n. 1
0
def exception_colors():
    ex_colors = exception_colors_orig()

    ex_colors.add_scheme(
        coloransi.ColorScheme(
            colorLabel,

            # The color to be used for the top line
            topline=C.Base08,

            # The colors to be used in the traceback
            filename=C.Base0F,
            lineno=C.Base03,
            name=C.Normal,
            vName=C.Normal,
            val=C.Normal,
            em=C.Normal,

            # Emphasized colors for the last frame of the traceback
            normalEm=C.Normal,
            filenameEm=C.Base0F,
            linenoEm=C.Base07,
            nameEm=C.Normal,
            valEm=C.Normal,

            # Colors for printing the exception
            excName=C.Base08,
            line=C.Normal,
            caret=C.Normal,
            Normal=C.Normal,
        ))
    return ex_colors
Esempio n. 2
0
def exception_colors():

    ex_colors = exception_colors_orig()

    ex_colors.add_scheme(
        coloransi.ColorScheme(
            colorLabel,

            # The color to be used for the top line
            topline=C.gb_bright_orange,

            # The colors to be used in the traceback
            filename=C.gb_neutral_red,
            lineno=C.gb_dark3,  #non active line numbers
            name=C.gb_neutral_orange,
            vName=C.gb_neutral_purple,  #header <module>
            val=C.gb_neutral_yellow,
            em=C.gb_neutral_aqua,

            # Emphasized colors for the last frame of the traceback
            normalEm=C.gb_bright_red,  #no change seen
            filenameEm=C.gb_gray,
            linenoEm=C.gb_dark4,  # active line numbers and arrow ---->
            nameEm=C.LightPurple,
            valEm=C.
            gb_neutral_purple,  #affects parentheses n *.py(2)<module>()

            # Colors for printing the exception
            excName=C.gb_bright_orange,  #no change seen
            line=C.gb_bright_orange,
            caret=C.gb_bright_orange,  #no change seen
            Normal=C.
            gb_gray  # comment """ and current line number in initial header, e.g *.py(2)
        ))
    return ex_colors
Esempio n. 3
0
excolors.exception_colors = exception_colors
ultratb.exception_colors = exception_colors
debugger.exception_colors = exception_colors

# Create another color scheme, used for pdb highlighting and object inspection
PyColorize.ANSICodeColors[colorLabel] = coloransi.ColorScheme(
    colorLabel,
    {
        'header': C.Base0A,
        token.NUMBER: C.Base09,
        token.OP: C.Normal,
        token.STRING: C.Base0B,
        tokenize.COMMENT: C.Base03,
        token.NAME: C.Normal,
        token.ERRORTOKEN: C.Base08,
        PyColorize._KEYWORD: C.Base0E,
        PyColorize._TEXT: C.Normal,

        ## Keep IC here, you can use other colors
        'in_prompt': IC.Green,
        'in_number': IC.Green,
        'in_prompt2': IC.Green,
        'in_normal': IC.Normal,  # color off (usu. Colors.Normal)
        'out_prompt': C.Base08,
        'out_number': C.Base08,
        'normal': C.Normal  # color off (usu. Colors.Normal)
    })

c.InteractiveShell.colors = colorLabel
Esempio n. 4
0
#-----------------------------------------------------------------------------
# Color schemes for prompts
#-----------------------------------------------------------------------------

InputColors = coloransi.InputTermColors  # just a shorthand
Colors = coloransi.TermColors  # just a shorthand

color_lists = dict(normal=Colors(),
                   inp=InputColors(),
                   nocolor=coloransi.NoColors())

PColNoColors = 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)
)

# make some schemes as instances so we can copy them for modification easily:
PColLinux = coloransi.ColorScheme(
    'Linux',
    in_prompt=InputColors.Green,
    in_number=InputColors.LightGreen,
    in_prompt2=InputColors.Green,
    in_normal=InputColors.Normal,  # color off (usu. Colors.Normal)
    out_prompt=Colors.Red,
    out_number=Colors.LightRed,
    normal=Colors.Normal)
Esempio n. 5
0
PyColorize.ANSICodeColors[colorLabel] = coloransi.ColorScheme(
    colorLabel,
    {
        'header': C.gb_bright_purple,  # no change seen
        token.NUMBER: C.gb_bright_purple,
        token.OP: C.gb_light1,
        token.STRING: C.gb_bright_green,
        tokenize.COMMENT: C.gb_light3,
        token.NAME: C.gb_light1,
        token.ERRORTOKEN: C.gb_bright_purple,
        #
        PyColorize._KEYWORD: C.gb_bright_red,  # e.g. print, def, etc.
        PyColorize._TEXT: C.gb_bright_blue,
        #
        #        ## Keep IC here, you can use other colors
        ### MP as far as i can tell, these do nothing
        #
        'in_prompt': IC.gb_bright_yellow,
        'in_number': IC.gb_bright_yellow,
        'in_prompt2': IC.gb_neutral_aqua,
        'in_normal': IC.gb_bright_aqua,  # color off (usu. Colors.Normal)
        #
        'out_prompt': C.gb_bright_yellow,
        'out_number': C.gb_bright_yellow,
        #
        'normal': C.gb_bright_yellow,  # color off (usu. Colors.Normal)
        #
        'normal': C.gb_bright_yellow  # color off (usu. Colors.Normal)
    })
Esempio n. 6
0
import IPython.utils.generics

#****************************************************************************
#Color schemes for Prompts.

PromptColors = coloransi.ColorSchemeTable()
InputColors = coloransi.InputTermColors  # just a shorthand
Colors = coloransi.TermColors  # just a shorthand


__PColNoColor = 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)
    )

PromptColors.add_scheme(__PColNoColor)

# make some schemes as instances so we can copy them for modification easily:
__PColLinux  = __PColNoColor.copy('Linux')
# Don't forget to enter it into the table!
PromptColors.add_scheme(__PColLinux)
__PColLightBG  = __PColLinux.copy('LightBG')
PromptColors.add_scheme(__PColLightBG)