예제 #1
0
LightBGColors = ColorScheme(
    'LightBG',
    {
        'instance': Colors.Cyan,
        'collapsed': Colors.LightGreen,
        'tree': Colors.Blue,
        'transform': Colors.DarkGray,
        'shape': Colors.Black,
        'nonunique': Colors.Red,
        'nonunique_transform': Colors.LightRed,
        'normal': Colors.Normal  # color off (usu. Colors.Normal)
    })

# Build table of color schemes (needed by the dag_parser)
color_table = ColorSchemeTable([NoColor, LinuxColors, LightBGColors],
                               _scheme_default)


def finalPipe(obj):
    """
    DAG nodes with children should end in a pipe (|), so that each successive pressing
    of TAB will take you further down the DAG hierarchy.  this is analagous to TAB
    completion of directories, which always places a final slash (/) after a directory.
    """

    if cmds.listRelatives(obj):
        return obj + "|"
    return obj


def splitDag(obj):
예제 #2
0
#       Copyright (C) 2005-2006 Fernando Perez <*****@*****.**>
#
#  Distributed under the terms of the BSD License.  The full license is in
#  the file COPYING, distributed as part of this software.
#*****************************************************************************

from IPython import Release
__author__  = '%s <%s>' % Release.authors['Fernando']
__license__ = Release.license
__version__ = Release.version

#****************************************************************************
# Required modules
from IPython.ColorANSI import ColorSchemeTable, TermColors, ColorScheme

ExceptionColors = ColorSchemeTable()

# Populate it with color schemes
C = TermColors # shorthand and local lookup
ExceptionColors.add_scheme(ColorScheme(
    'NoColor',
    # The color to be used for the top line
    topline = C.NoColor,

    # The colors to be used in the traceback
    filename = C.NoColor,
    lineno = C.NoColor,
    name = C.NoColor,
    vName = C.NoColor,
    val = C.NoColor,
    em = C.NoColor,
예제 #3
0
파일: excolors.py 프로젝트: FrankBian/kuma
def exception_colors():
    """Return a color table with fields for exception reporting.

    The table is an instance of ColorSchemeTable with schemes added for
    'Linux', 'LightBG' and 'NoColor' and fields for exception handling filled
    in.

    Examples:

    >>> ec = exception_colors()
    >>> ec.active_scheme_name
    ''
    >>> print ec.active_colors
    None

    Now we activate a color scheme:    
    >>> ec.set_active_scheme('NoColor')
    >>> ec.active_scheme_name
    'NoColor'
    >>> ec.active_colors.keys()
    ['em', 'caret', '__allownew', 'name', 'val', 'vName', 'Normal', 'normalEm',
    'filename', 'linenoEm', 'excName', 'lineno', 'valEm', 'filenameEm',
    'nameEm', 'line', 'topline']
    """
    
    ex_colors = ColorSchemeTable()

    # Populate it with color schemes
    C = TermColors # shorthand and local lookup
    ex_colors.add_scheme(ColorScheme(
        'NoColor',
        # The color to be used for the top line
        topline = C.NoColor,

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

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

        # Colors for printing the exception
        excName = C.NoColor,
        line = C.NoColor,
        caret = C.NoColor,
        Normal = C.NoColor
        ))

    # make some schemes as instances so we can copy them for modification easily
    ex_colors.add_scheme(ColorScheme(
        'Linux',
        # The color to be used for the top line
        topline = C.LightRed,

        # The colors to be used in the traceback
        filename = C.Green,
        lineno = C.Green,
        name = C.Purple,
        vName = C.Cyan,
        val = C.Green,
        em = C.LightCyan,

        # Emphasized colors for the last frame of the traceback
        normalEm = C.LightCyan,
        filenameEm = C.LightGreen,
        linenoEm = C.LightGreen,
        nameEm = C.LightPurple,
        valEm = C.LightBlue,

        # Colors for printing the exception
        excName = C.LightRed,
        line = C.Yellow,
        caret = C.White,
        Normal = C.Normal
        ))

    # For light backgrounds, swap dark/light colors
    ex_colors.add_scheme(ColorScheme(
        'LightBG',
        # The color to be used for the top line
        topline = C.Red,

        # The colors to be used in the traceback
        filename = C.LightGreen,
        lineno = C.LightGreen,
        name = C.LightPurple,
        vName = C.Cyan,
        val = C.LightGreen,
        em = C.Cyan,

        # Emphasized colors for the last frame of the traceback
        normalEm = C.Cyan,
        filenameEm = C.Green,
        linenoEm = C.Green,
        nameEm = C.Purple,
        valEm = C.Blue,

        # Colors for printing the exception
        excName = C.Red,
        #line = C.Brown,  # brown often is displayed as yellow
        line = C.Red,
        caret = C.Normal,
        Normal = C.Normal,
        ))

    return ex_colors
#       Copyright (C) 2005-2006 Fernando Perez <*****@*****.**>
#
#  Distributed under the terms of the BSD License.  The full license is in
#  the file COPYING, distributed as part of this software.
#*****************************************************************************

from IPython import Release
__author__ = '%s <%s>' % Release.authors['Fernando']
__license__ = Release.license
__version__ = Release.version

#****************************************************************************
# Required modules
from IPython.ColorANSI import ColorSchemeTable, TermColors, ColorScheme

ExceptionColors = ColorSchemeTable()

# Populate it with color schemes
C = TermColors  # shorthand and local lookup
ExceptionColors.add_scheme(
    ColorScheme(
        'NoColor',
        # The color to be used for the top line
        topline=C.NoColor,

        # The colors to be used in the traceback
        filename=C.NoColor,
        lineno=C.NoColor,
        name=C.NoColor,
        vName=C.NoColor,
        val=C.NoColor,
예제 #5
0
def exception_colors():
    """Return a color table with fields for exception reporting.

    The table is an instance of ColorSchemeTable with schemes added for
    'Linux', 'LightBG' and 'NoColor' and fields for exception handling filled
    in.

    Examples:

    >>> ec = exception_colors()
    >>> ec.active_scheme_name
    ''
    >>> print ec.active_colors
    None

    Now we activate a color scheme:    
    >>> ec.set_active_scheme('NoColor')
    >>> ec.active_scheme_name
    'NoColor'
    >>> ec.active_colors.keys()
    ['em', 'caret', '__allownew', 'name', 'val', 'vName', 'Normal', 'normalEm',
    'filename', 'linenoEm', 'excName', 'lineno', 'valEm', 'filenameEm',
    'nameEm', 'line', 'topline']
    """

    ex_colors = ColorSchemeTable()

    # Populate it with color schemes
    C = TermColors  # shorthand and local lookup
    ex_colors.add_scheme(
        ColorScheme(
            'NoColor',
            # The color to be used for the top line
            topline=C.NoColor,

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

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

            # Colors for printing the exception
            excName=C.NoColor,
            line=C.NoColor,
            caret=C.NoColor,
            Normal=C.NoColor))

    # make some schemes as instances so we can copy them for modification easily
    ex_colors.add_scheme(
        ColorScheme(
            'Linux',
            # The color to be used for the top line
            topline=C.LightRed,

            # The colors to be used in the traceback
            filename=C.Green,
            lineno=C.Green,
            name=C.Purple,
            vName=C.Cyan,
            val=C.Green,
            em=C.LightCyan,

            # Emphasized colors for the last frame of the traceback
            normalEm=C.LightCyan,
            filenameEm=C.LightGreen,
            linenoEm=C.LightGreen,
            nameEm=C.LightPurple,
            valEm=C.LightBlue,

            # Colors for printing the exception
            excName=C.LightRed,
            line=C.Yellow,
            caret=C.White,
            Normal=C.Normal))

    # For light backgrounds, swap dark/light colors
    ex_colors.add_scheme(
        ColorScheme(
            'LightBG',
            # The color to be used for the top line
            topline=C.Red,

            # The colors to be used in the traceback
            filename=C.LightGreen,
            lineno=C.LightGreen,
            name=C.LightPurple,
            vName=C.Cyan,
            val=C.LightGreen,
            em=C.Cyan,

            # Emphasized colors for the last frame of the traceback
            normalEm=C.Cyan,
            filenameEm=C.Green,
            linenoEm=C.Green,
            nameEm=C.Purple,
            valEm=C.Blue,

            # Colors for printing the exception
            excName=C.Red,
            #line = C.Brown,  # brown often is displayed as yellow
            line=C.Red,
            caret=C.Normal,
            Normal=C.Normal,
        ))

    return ex_colors