scapy.themes module

Color themes for the interactive console.

class scapy.themes.AnsiColorTheme

Bases: scapy.themes.ColorTheme

style_active = ''
style_closed = ''
style_emph_field_name = ''
style_emph_field_value = ''
style_even = ''
style_fail = ''
style_field_name = ''
style_field_value = ''
style_id = ''
style_layer_name = ''
style_left = ''
style_normal = ''
style_not_printable = ''
style_odd = ''
style_opening = ''
style_packetlist_name = ''
style_packetlist_proto = ''
style_packetlist_value = ''
style_prompt = ''
style_punct = ''
style_right = ''
style_success = ''
class scapy.themes.BlackAndWhite

Bases: scapy.themes.AnsiColorTheme, scapy.themes.NoTheme

class scapy.themes.BrightTheme

Bases: scapy.themes.AnsiColorTheme

style_emph_field_name = '\x1b[33m\x1b[1m'
style_emph_field_value = '\x1b[32m\x1b[1m'
style_even = '\x1b[30m\x1b[1m'
style_fail = '\x1b[31m\x1b[1m'
style_field_name = '\x1b[33m\x1b[1m'
style_field_value = '\x1b[35m\x1b[1m'
style_id = '\x1b[33m\x1b[1m'
style_layer_name = '\x1b[31m\x1b[1m'
style_left = '\x1b[36m\x1b[7m'
style_normal = '\x1b[0m'
style_odd = '\x1b[30m'
style_packetlist_name = '\x1b[31m\x1b[1m'
style_packetlist_proto = '\x1b[33m\x1b[1m'
style_packetlist_value = '\x1b[35m\x1b[1m'
style_punct = '\x1b[0m'
style_right = '\x1b[35m\x1b[7m'
style_success = '\x1b[34m\x1b[1m'
class scapy.themes.ColorOnBlackTheme

Bases: scapy.themes.AnsiColorTheme

Color theme for black backgrounds

style_active = '\x1b[37m\x1b[1m'
style_closed = '\x1b[30m\x1b[1m'
style_emph_field_name = '\x1b[36m\x1b[1m'
style_emph_field_value = '\x1b[31m\x1b[1m'
style_even = '\x1b[30m\x1b[1m'
style_fail = '\x1b[31m\x1b[1m'
style_field_name = '\x1b[36m'
style_field_value = '\x1b[35m\x1b[1m'
style_id = '\x1b[32m'
style_layer_name = '\x1b[33m\x1b[1m'
style_left = '\x1b[36m\x1b[1m'
style_normal = '\x1b[0m'
style_not_printable = '\x1b[30m\x1b[1m'
style_odd = '\x1b[37m'
style_opening = '\x1b[33m'
style_packetlist_name = '\x1b[30m\x1b[1m'
style_packetlist_proto = '\x1b[33m\x1b[1m'
style_packetlist_value = '\x1b[35m\x1b[1m'
style_prompt = '\x1b[32m\x1b[1m'
style_punct = '\x1b[0m'
style_right = '\x1b[31m\x1b[1m'
style_success = '\x1b[32m'
class scapy.themes.ColorTable

Bases: object

ansi_to_pygments(x)
colors = {'bg_black': ('\x1b[40m', 'bg:#ansiblack'), 'bg_blue': ('\x1b[44m', 'bg:#ansiblue'), 'bg_cyan': ('\x1b[46m', 'bg:#ansicyan'), 'bg_green': ('\x1b[42m', 'bg:#ansigreen'), 'bg_grey': ('\x1b[47m', 'bg:#ansiwhite'), 'bg_purple': ('\x1b[45m', 'bg:#ansipurple'), 'bg_red': ('\x1b[41m', 'bg:#ansired'), 'bg_reset': ('\x1b[49m', 'noinherit'), 'bg_yellow': ('\x1b[43m', 'bg:#ansiyellow'), 'black': ('\x1b[30m', '#ansiblack'), 'blink': ('\x1b[5m', ''), 'blue': ('\x1b[34m', '#ansiblue'), 'bold': ('\x1b[1m', 'bold'), 'cyan': ('\x1b[36m', '#ansicyan'), 'green': ('\x1b[32m', '#ansigreen'), 'grey': ('\x1b[37m', '#ansiwhite'), 'invert': ('\x1b[7m', ''), 'normal': ('\x1b[0m', 'noinherit'), 'purple': ('\x1b[35m', '#ansipurple'), 'red': ('\x1b[31m', '#ansired'), 'reset': ('\x1b[39m', 'noinherit'), 'uline': ('\x1b[4m', 'underline'), 'yellow': ('\x1b[33m', '#ansiyellow')}
class scapy.themes.ColorTheme

Bases: object

format(string, fmt)
class scapy.themes.DefaultTheme

Bases: scapy.themes.AnsiColorTheme

style_active = '\x1b[30m'
style_closed = '\x1b[37m'
style_emph_field_name = '\x1b[34m\x1b[4m\x1b[1m'
style_emph_field_value = '\x1b[35m\x1b[4m\x1b[1m'
style_even = '\x1b[30m\x1b[1m'
style_fail = '\x1b[31m\x1b[1m'
style_field_name = '\x1b[34m'
style_field_value = '\x1b[35m'
style_id = '\x1b[34m\x1b[1m'
style_layer_name = '\x1b[31m\x1b[1m'
style_left = '\x1b[34m\x1b[7m'
style_normal = '\x1b[0m'
style_not_printable = '\x1b[37m'
style_odd = '\x1b[30m'
style_opening = '\x1b[33m'
style_packetlist_name = '\x1b[31m\x1b[1m'
style_packetlist_proto = '\x1b[34m'
style_packetlist_value = '\x1b[35m'
style_prompt = '\x1b[34m\x1b[1m'
style_punct = '\x1b[0m'
style_right = '\x1b[31m\x1b[7m'
style_success = '\x1b[34m\x1b[1m'
class scapy.themes.FormatTheme

Bases: scapy.themes.ColorTheme

class scapy.themes.HTMLTheme

Bases: scapy.themes.FormatTheme

style_emph_field_name = '<span class=emph_field_name>%s</span>'
style_emph_field_value = '<span class=emph_field_value>%s</span>'
style_even = '<span class=even>%s</span>'
style_fail = '<span class=fail>%s</span>'
style_field_name = '<span class=field_name>%s</span>'
style_field_value = '<span class=field_value>%s</span>'
style_layer_name = '<span class=layer_name>%s</span>'
style_left = '<span class=left>%s</span>'
style_not_printable = '<span class=not_printable>%s</span>'
style_odd = '<span class=odd>%s</span>'
style_packetlist_name = '<span class=packetlist_name>%s</span>'
style_packetlist_proto = '<span class=packetlist_proto>%s</span>'
style_packetlist_value = '<span class=packetlist_value>%s</span>'
style_prompt = '<span class=prompt>%s</span>'
style_right = '<span class=right>%s</span>'
style_success = '<span class=success>%s</span>'
class scapy.themes.HTMLTheme2

Bases: scapy.themes.HTMLTheme

style_emph_field_name = '#[#span class=emph_field_name#]#%s#[#/span#]#'
style_emph_field_value = '#[#span class=emph_field_value#]#%s#[#/span#]#'
style_even = '#[#span class=even#]#%s#[#/span#]#'
style_fail = '#[#span class=fail#]#%s#[#/span#]#'
style_field_name = '#[#span class=field_name#]#%s#[#/span#]#'
style_field_value = '#[#span class=field_value#]#%s#[#/span#]#'
style_layer_name = '#[#span class=layer_name#]#%s#[#/span#]#'
style_left = '#[#span class=left#]#%s#[#/span#]#'
style_not_printable = '#[#span class=not_printable#]#%s#[#/span#]#'
style_odd = '#[#span class=odd#]#%s#[#/span#]#'
style_packetlist_name = '#[#span class=packetlist_name#]#%s#[#/span#]#'
style_packetlist_proto = '#[#span class=packetlist_proto#]#%s#[#/span#]#'
style_packetlist_value = '#[#span class=packetlist_value#]#%s#[#/span#]#'
style_prompt = '#[#span class=prompt#]#%s#[#/span#]#'
style_right = '#[#span class=right#]#%s#[#/span#]#'
style_success = '#[#span class=success#]#%s#[#/span#]#'
class scapy.themes.LatexTheme

Bases: scapy.themes.FormatTheme

style_emph_field_name = '\\textcolor{blue}{\\underline{%s}}'
style_emph_field_value = '\\textcolor{purple}{\\underline{%s}}'
style_fail = '\\textcolor{red}{\\bf %s}'
style_field_name = '\\textcolor{blue}{%s}'
style_field_value = '\\textcolor{purple}{%s}'
style_layer_name = '\\textcolor{red}{\\bf %s}'
style_left = '\\textcolor{blue}{%s}'
style_not_printable = '\\textcolor{gray}{%s}'
style_packetlist_name = '\\textcolor{red}{\\bf %s}'
style_packetlist_proto = '\\textcolor{blue}{%s}'
style_packetlist_value = '\\textcolor{purple}{%s}'
style_prompt = '\\textcolor{blue}{%s}'
style_right = '\\textcolor{red}{%s}'
style_success = '\\textcolor{blue}{\\bf %s}'
class scapy.themes.LatexTheme2

Bases: scapy.themes.FormatTheme

style_emph_field_name = '@`@textcolor@[@blue@]@@[@@`@underline@[@%s@]@@]@'
style_emph_field_value = '@`@textcolor@[@purple@]@@[@@`@underline@[@%s@]@@]@'
style_even = '@`@textcolor@[@gray@]@@[@@`@bfseries@[@@]@%s@]@'
style_fail = '@`@textcolor@[@red@]@@[@@`@bfseries@[@@]@%s@]@'
style_field_name = '@`@textcolor@[@blue@]@@[@%s@]@'
style_field_value = '@`@textcolor@[@purple@]@@[@%s@]@'
style_layer_name = '@`@textcolor@[@red@]@@[@@`@bfseries@[@@]@%s@]@'
style_left = '@`@textcolor@[@blue@]@@[@%s@]@'
style_not_printable = '@`@textcolor@[@gray@]@@[@%s@]@'
style_packetlist_name = '@`@textcolor@[@red@]@@[@@`@bfseries@[@@]@%s@]@'
style_packetlist_proto = '@`@textcolor@[@blue@]@@[@%s@]@'
style_packetlist_value = '@`@textcolor@[@purple@]@@[@%s@]@'
style_prompt = '@`@textcolor@[@blue@]@@[@%s@]@'
style_right = '@`@textcolor@[@red@]@@[@%s@]@'
style_success = '@`@textcolor@[@blue@]@@[@@`@bfserices@[@@]@%s@]@'
class scapy.themes.NoTheme

Bases: scapy.themes.ColorTheme

class scapy.themes.RastaTheme

Bases: scapy.themes.AnsiColorTheme

style_emph_field_name = '\x1b[32m'
style_emph_field_value = '\x1b[32m'
style_even = '\x1b[33m'
style_fail = '\x1b[31m'
style_field_name = '\x1b[33m\x1b[1m'
style_field_value = '\x1b[32m\x1b[1m'
style_id = '\x1b[32m\x1b[1m'
style_layer_name = '\x1b[31m\x1b[1m'
style_left = '\x1b[33m\x1b[7m'
style_normal = '\x1b[0m\x1b[32m\x1b[1m'
style_not_printable = '\x1b[32m'
style_odd = '\x1b[32m'
style_packetlist_name = '\x1b[31m\x1b[1m'
style_packetlist_proto = '\x1b[33m\x1b[1m'
style_packetlist_value = '\x1b[32m\x1b[1m'
style_prompt = '\x1b[33m\x1b[1m'
style_punct = '\x1b[31m'
style_right = '\x1b[31m\x1b[7m'
style_success = '\x1b[31m\x1b[1m'
scapy.themes.apply_ipython_style(shell)

Updates the specified IPython console shell with the conf.color_theme scapy theme.

scapy.themes.create_styler(fmt=None, before='', after='', fmt2='%s')