diff --git a/pudb/debugger.py b/pudb/debugger.py index e074dff0..eed2b714 100644 --- a/pudb/debugger.py +++ b/pudb/debugger.py @@ -190,7 +190,6 @@ def __init__(self, stdin=None, stdout=None, term_size=None, steal_output=False, if Debugger._current_debugger: raise ValueError("a Debugger instance already exists") - self._current_debugger.append(self) # Pass remaining kwargs to python debugger framework bdb.Bdb.__init__(self, **kwargs) @@ -210,6 +209,9 @@ def __init__(self, stdin=None, stdout=None, term_size=None, steal_output=False, for bpoint_descr in load_breakpoints(): self.set_break(*bpoint_descr) + # Okay, now we have a debugger + self._current_debugger.append(self) + def __del__(self): assert self._current_debugger == [self] self._current_debugger.pop() diff --git a/pudb/settings.py b/pudb/settings.py index 9c19a047..d4ab9923 100644 --- a/pudb/settings.py +++ b/pudb/settings.py @@ -302,7 +302,7 @@ def _update_config(check_box, new_state, option_newvalue): # {{{ themes - from pudb.theme import THEMES + from pudb.themes import THEMES known_theme = conf_dict["theme"] in THEMES diff --git a/pudb/theme.py b/pudb/theme.py index 482ab2d5..7bfa356c 100644 --- a/pudb/theme.py +++ b/pudb/theme.py @@ -23,21 +23,17 @@ THE SOFTWARE. """ -from dataclasses import dataclass, astuple, replace +from dataclasses import astuple, dataclass, replace from typing import Optional -from pudb.lowlevel import ui_log -THEMES = [ - "classic", - "vim", - "dark vim", - "midnight", - "solarized", - "agr-256", - "monokai", - "monokai-256", - "mono", -] +from pudb.lowlevel import ui_log +from pudb.themes import THEMES +from pudb.themes.utils import ( + add_setting, + inheritance_overrides, + link, + reset_inheritance_overrides, +) @dataclass @@ -234,8 +230,8 @@ def handle_256_colors(self): } -def get_style(palette_dict: dict, style_name: str, - inheritance_overrides: dict) -> dict: +def set_style(palette_dict: dict, style_name: str, + inheritance_overrides: dict) -> PaletteEntry: """ Recursively search up the style hierarchy for the first style which has been defined, and add it to the palette_dict under the given style_name. @@ -253,7 +249,7 @@ def get_style(palette_dict: dict, style_name: str, INHERITANCE_MAP[style_name], ) style = replace( - get_style(palette_dict, parent_name, inheritance_overrides), + set_style(palette_dict, parent_name, inheritance_overrides), name=style_name ) palette_dict[style_name] = style @@ -262,614 +258,18 @@ def get_style(palette_dict: dict, style_name: str, # }}} +# {{{ get palette + def get_palette(may_use_fancy_formats: bool, theme: str = "classic") -> list: """ Load the requested theme and return a list containing all palette entries needed to highlight the debugger UI, including syntax highlighting. """ - inheritance_overrides = {} - - if may_use_fancy_formats: - def add_setting(color, setting): - return f"{color}, {setting}" - else: - def add_setting(color, setting): - return color - - def link(child: str, parent: str): - inheritance_overrides[child] = parent - - # {{{ themes - - if theme == "classic": - # {{{ classic theme - link("current breakpoint", "current frame name") - link("focused current breakpoint", "focused current frame name") - - palette_dict = { - # {{{ base styles - "background": ("black", "light gray"), - "selectable": ("black", "dark cyan"), - "focused selectable": ("black", "light cyan"), - "highlighted": ("dark blue", "yellow"), - "hotkey": (add_setting("black", "underline"), "light gray"), - # }}} - # {{{ general ui - "header": ("dark blue", "light gray"), - "dialog title": (add_setting("white", "bold"), "dark blue"), - "warning": (add_setting("white", "bold"), "dark red"), - # }}} - # {{{ source view - "source": ("yellow", "dark blue"), - "current source": ("dark blue", "dark green"), - "breakpoint source": ( - add_setting("yellow", "bold"), "dark red"), - "line number": ("light gray", "dark blue"), - "breakpoint marker": ( - add_setting("dark red", "bold"), "dark blue"), - # }}} - # {{{ sidebar - "sidebar two": ("dark blue", "dark cyan"), - "sidebar three": ("dark gray", "dark cyan"), - "focused sidebar two": ("dark blue", "light cyan"), - "focused sidebar three": ("dark gray", "light cyan"), - # }}} - # {{{ variables view - "return label": ("white", "dark blue"), - "focused return label": ("light gray", "dark blue"), - # }}} - # {{{ stack - "current frame name": ( - add_setting("white", "bold"), "dark cyan"), - "focused current frame name": ( - add_setting("black", "bold"), "light cyan"), - # }}} - # {{{ shell - "command line output": ("light cyan", "dark blue"), - "command line prompt": ( - add_setting("white", "bold"), "dark blue"), - "command line error": ( - add_setting("light green", "bold"), "dark blue"), - "command line clear button": ( - add_setting("white", "bold"), "dark blue"), - "command line focused button": ("dark blue", "dark cyan"), - # }}} - # {{{ Code syntax - "keyword": (add_setting("white", "bold"), "dark blue"), - "function": ("light cyan", "dark blue"), - "literal": (add_setting("light green", "bold"), "dark blue"), - "punctuation": ("light gray", "dark blue"), - "comment": ("dark cyan", "dark blue"), - # }}} - } - # }}} - elif theme == "vim": - # {{{ vim theme - link("current breakpoint", "current frame name") - link("focused current breakpoint", "focused current frame name") - - palette_dict = { - # {{{ base styles - "background": ("black", "light gray"), - "selectable": ("black", "dark cyan"), - "focused selectable": ("black", "light cyan"), - "hotkey": (add_setting("black", "bold, underline"), "light gray"), - "highlighted": ("black", "yellow"), - # }}} - # {{{ general ui - "header": (add_setting("black", "bold"), "light gray"), - "group head": ("dark blue", "light gray"), - "dialog title": (add_setting("white", "bold"), "dark blue"), - "input": ("black", "dark cyan"), - "focused input": ("black", "light cyan"), - "warning": (add_setting("dark red", "bold"), "white"), - "header warning": (add_setting("dark red", "bold"), "light gray"), - # }}} - # {{{ source view - "source": ("black", "white"), - "current source": ("black", "dark cyan"), - "breakpoint source": ("dark red", "light gray"), - "line number": ("dark gray", "white"), - "current line marker": ("dark red", "white"), - "breakpoint marker": ("dark red", "white"), - # }}} - # {{{ sidebar - "sidebar one": ("black", "dark cyan"), - "sidebar two": ("dark blue", "dark cyan"), - "sidebar three": ("dark gray", "dark cyan"), - "focused sidebar one": ("black", "light cyan"), - "focused sidebar two": ("dark blue", "light cyan"), - "focused sidebar three": ("dark gray", "light cyan"), - # }}} - # {{{ variables view - "highlighted var label": ("dark blue", "yellow"), - "return label": ("white", "dark blue"), - "focused return label": ("light gray", "dark blue"), - # }}} - # {{{ stack - "current frame name": ( - add_setting("white", "bold"), "dark cyan"), - "focused current frame name": ( - add_setting("black", "bold"), "light cyan"), - # }}} - # {{{ shell - "command line output": ( - add_setting("dark gray", "bold"), "white"), - # }}} - # {{{ Code syntax - "keyword2": ("dark magenta", "white"), - "namespace": ("dark magenta", "white"), - "literal": ("dark red", "white"), - "exception": ("dark red", "white"), - "comment": ("dark gray", "white"), - "function": ("dark blue", "white"), - "pseudo": ("dark gray", "white"), - "builtin": ("light blue", "white"), - # }}} - } - # }}} - elif theme == "dark vim": - # {{{ dark vim - - link("current breakpoint", "current frame name") - link("focused current breakpoint", "focused current frame name") - palette_dict = { - # {{{ base styles - "background": ("black", "light gray"), - "selectable": ("white", "dark gray"), - "focused selectable": (add_setting("white", "bold"), "light blue"), - "highlighted": ("black", "dark green"), - "hotkey": (add_setting("dark blue", "underline"), "light gray"), - # }}} - # {{{ general ui - "header": ("dark blue", "light gray"), - "dialog title": (add_setting("white", "bold"), "black"), - "warning": (add_setting("light red", "bold"), "black"), - "header warning": (add_setting("light red", "bold"), "light gray"), - # }}} - # {{{ source view - "source": ("white", "black"), - "current source": (add_setting("white", "bold"), "dark gray"), - "line number": (add_setting("dark gray", "bold"), "black"), - "breakpoint marker": (add_setting("light red", "bold"), "black"), - "breakpoint source": (add_setting("white", "bold"), "dark red"), - # }}} - # {{{ sidebar - "sidebar two": ("yellow", "dark gray"), - "focused sidebar two": ("light cyan", "light blue"), - "sidebar three": ("light gray", "dark gray"), - "focused sidebar three": ("yellow", "light blue"), - # }}} - # {{{ stack - "current frame name": ( - add_setting("white", "bold"), "dark gray"), - # }}} - # {{{ shell - "command line output": (add_setting("yellow", "bold"), "black"), - # }}} - # {{{ Code syntax - "keyword": ("yellow", "black"), - "literal": ("light magenta", "black"), - "function": (add_setting("light cyan", "bold"), "black"), - "punctuation": ("yellow", "black"), - "comment": ("dark cyan", "black"), - "exception": ("light red", "black"), - "builtin": ("light green", "black"), - "pseudo": ("dark green", "black"), - # }}} - } - # }}} - elif theme == "midnight": - # {{{ midnight - - # Based on XCode's midnight theme - # Looks best in a console with green text against black background - link("current breakpoint", "current frame name") - link("focused current breakpoint", "focused current frame name") - palette_dict = { - # {{{ base styles - "background": ("black", "light gray"), - "selectable": ("white", "black"), - "focused selectable": ("white", "dark blue"), - "hotkey": (add_setting("black", "underline, italics"), "light gray"), - "highlighted": ("black", "dark green"), - # }}} - # {{{ general ui - "input": ("light green", "black"), - "focused input": ("light green", "black"), - "warning": (add_setting("white", "bold"), "dark red"), - "dialog title": (add_setting("white", "bold"), "dark blue"), - "group head": (add_setting("dark blue", "bold"), "light gray"), - "button": (add_setting("white", "bold"), "dark blue"), - "focused button": ("white", "black"), - "focused sidebar": ("black", "white"), - "value": (add_setting("yellow", "bold"), "dark blue"), - # }}} - # {{{ source view - "source": ("light green", "black"), - "highlighted source": ("black", "dark green"), - "current source": ("black", "brown"), - "current focused source": (add_setting("yellow", "bold"), "dark blue"), - "breakpoint source": (add_setting("yellow", "bold"), "dark red"), - "current breakpoint source": ("black", "dark red"), - - "line number": ("light gray", "black"), - "current line marker": ("dark red", "black"), - "breakpoint marker": ("dark red", "black"), - # }}} - # {{{ sidebar - "sidebar two": ("light blue", "black"), - "sidebar three": ("light cyan", "black"), - # }}} - # {{{ variables view - "return label": ("white", "dark blue"), - "return value": ("black", "dark cyan"), - "focused return label": ("light gray", "dark blue"), - # }}} - # {{{ stack - "current frame name": (add_setting("white", "bold"), "black"), - "current frame class": (add_setting("light blue", "bold"), "black"), - "current frame location": (add_setting("light cyan", "bold"), "black"), - - "focused current frame name": ( - add_setting("white", "bold"), "dark blue"), - "focused current frame class": ( - add_setting("white", "bold"), "dark blue"), - "focused current frame location": ( - add_setting("white", "bold"), "dark blue"), - # }}} - # {{{ breakpoints view - "breakpoint": ("white", "black"), - "disabled breakpoint": ("dark gray", "black"), - "focused disabled breakpoint": ("light gray", "dark blue"), - "current breakpoint": (add_setting("white", "bold"), "black"), - "disabled current breakpoint": ( - add_setting("dark gray", "bold"), "black"), - "focused current breakpoint": ( - add_setting("white", "bold"), "dark blue"), - "focused disabled current breakpoint": ( - add_setting("light gray", "bold"), "dark blue"), - # }}} - # {{{ shell - "command line edit": ("white", "black"), - "command line prompt": (add_setting("white", "bold"), "black"), - - "command line input": ("white", "black"), - "command line error": (add_setting("light red", "bold"), "black"), - - "command line clear button": (add_setting("white", "bold"), "black"), - "command line focused button": ("white", "dark blue"), - # }}} - # {{{ Code syntax - "keyword": ("dark magenta", "black"), - "operator": ("dark green", "black"), - "pseudo": ("light magenta", "black"), - "function": (add_setting("light blue", "bold"), "black"), - "builtin": ("dark gray", "black"), - "literal": ("dark cyan", "black"), - "string": ("dark red", "black"), - "docstring": ("yellow", "black"), - "backtick": ("dark green", "black"), - "punctuation": ("white", "black"), - "comment": ("white", "black"), - "exception": ("dark green", "black"), - # }}} - } - - # }}} - elif theme == "solarized": - # {{{ solarized - palette_dict = { - # {{{ base styles - "background": ("light green", "light gray"), - "selectable": ("light green", "white"), - "focused selectable": ("white", "dark blue"), - "highlighted": ("white", "dark cyan"), - "hotkey": (add_setting("black", "underline"), "light gray"), - # }}} - # {{{ general ui - "dialog title": (add_setting("white", "bold"), "dark cyan"), - "warning": (add_setting("light red", "bold"), "white"), - "header warning": (add_setting("light red", "bold"), "light gray"), - "focused sidebar": ("dark red", "light gray"), - "group head": (add_setting("yellow", "bold"), "light gray"), - # }}} - # {{{ source view - "source": ("yellow", "white"), - "breakpoint source": ("light red", "light gray"), - "current source": ("light gray", "light blue"), - "line number": ("light blue", "white"), - "current line marker": ( - add_setting("light blue", "bold"), "white"), - "breakpoint marker": ( - add_setting("light red", "bold"), "white"), - # }}} - # {{{ sidebar - "sidebar two": ("dark blue", "white"), - "sidebar three": ("light cyan", "white"), - "focused sidebar three": ("light gray", "dark blue"), - # }}} - # {{{ variables view - "return label": ("white", "yellow"), - "focused return label": ("white", "yellow"), - # }}} - # {{{ stack - "current frame name": ( - add_setting("light green", "bold"), "white"), - "focused current frame name": ( - add_setting("white", "bold"), "dark blue"), - # }}} - # {{{ shell - "command line output": ("light green", "white"), - # }}} - # {{{ Code syntax - "namespace": ("dark red", "white"), - "exception": ("light red", "white"), - "keyword": ("brown", "white"), - "keyword2": ("dark magenta", "white"), - "function": ("dark green", "white"), - "literal": ("dark cyan", "white"), - "builtin": ("dark blue", "white"), - "comment": ("light cyan", "white"), - "pseudo": ("light cyan", "white"), - # }}} - } - - # }}} - elif theme == "agr-256": - # {{{ agr-256 - - # Give the colors some comprehensible names - black = "h235" - blacker = "h233" - dark_cyan = "h24" - dark_gray = "h241" - dark_green = "h22" - dark_red = "h88" - dark_teal = "h23" - light_blue = "h111" - light_cyan = "h80" - light_gray = "h252" - light_green = "h113" - light_red = "h160" - medium_gray = "h246" - salmon = "h223" - orange = "h173" - white = "h255" - yellow = "h192" - - link("focused breakpoint", "focused selectable") - link("current breakpoint", "current frame name") - link("focused current breakpoint", "focused current frame name") - palette_dict = { - # {{{ base styles - "background": (black, light_gray), - "selectable": (white, blacker), - "focused selectable": (yellow, dark_cyan), - "hotkey": (add_setting(black, "underline"), light_gray), - "highlighted": (white, dark_green), - # }}} - # {{{ general ui - "focused sidebar": (dark_cyan, light_gray), - "group head": (add_setting(dark_cyan, "bold"), light_gray), - "dialog title": (add_setting(light_gray, "bold"), black), - "warning": (add_setting(white, "bold"), dark_red), - "fixed value": (add_setting(white, "bold"), dark_gray), - "button": (add_setting(white, "bold"), black), - "focused button": (add_setting(yellow, "bold"), dark_cyan), - # }}} - # {{{ source view - "line number": (dark_gray, black), - "current line marker": (add_setting(yellow, "bold"), black), - "breakpoint marker": (add_setting(light_red, "bold"), black), - "source": (white, black), - "breakpoint source": (add_setting(white, "bold"), dark_red), - "current source": (add_setting(light_gray, "bold"), dark_teal), - # }}} - # {{{ sidebar - "sidebar two": (light_blue, blacker), - "focused sidebar two": (light_gray, dark_cyan), - "sidebar three": (medium_gray, blacker), - "focused sidebar three": (salmon, dark_cyan), - # }}} - # {{{ variables view - "highlighted var label": (light_gray, dark_green), - "return label": (light_green, blacker), - "focused return label": ( - add_setting(light_gray, "bold"), dark_cyan), - # }}} - # {{{ stack - "current frame name": (yellow, blacker), - "focused current frame name": ( - add_setting(yellow, "bold"), dark_cyan), - # }}} - # {{{ shell - "command line prompt": (add_setting(yellow, "bold"), black), - "command line output": (light_cyan, black), - "command line error": (light_red, black), - # }}} - # {{{ Code syntax - "comment": (medium_gray, black), - "exception": (orange, black), - "function": (yellow, black), - "keyword": (light_blue, black), - "literal": (orange, black), - "operator": (yellow, black), - "pseudo": (medium_gray, black), - "punctuation": (salmon, black), - "string": (light_green, black), - # }}} - } - # }}} - elif theme == "monokai": - # {{{ monokai - link("current breakpoint", "current frame name") - link("focused current breakpoint", "focused current frame name") - palette_dict = { - # {{{ base styles - "background": ("black", "light gray"), - "selectable": ("white", "black"), - "focused selectable": ("white", "dark gray"), - "highlighted": ("black", "dark green"), - "hotkey": (add_setting("black", "underline"), "light gray"), - # }}} - # {{{ general ui - "input": ("white", "black"), - "button": (add_setting("white", "bold"), "black"), - "focused button": (add_setting("white", "bold"), "dark gray"), - "focused sidebar": ("dark blue", "light gray"), - "warning": (add_setting("white", "bold"), "dark red"), - "group head": (add_setting("black", "bold"), "light gray"), - "dialog title": (add_setting("white", "bold"), "black"), - # }}} - # {{{ source view - "current source": ("black", "dark cyan"), - "breakpoint source": (add_setting("white", "bold"), "dark red"), - "line number": ("dark gray", "black"), - "current line marker": (add_setting("dark cyan", "bold"), "black"), - "breakpoint marker": (add_setting("dark red", "bold"), "black"), - # }}} - # {{{ sidebar - "sidebar two": ("light cyan", "black"), - "focused sidebar two": ("light cyan", "dark gray"), - "sidebar three": ("light magenta", "black"), - "focused sidebar three": ("light magenta", "dark gray"), - # }}} - # {{{ variables view - "return label": ("light green", "black"), - "focused return label": ("light green", "dark gray"), - # }}} - # {{{ stack - "current frame name": ("light green", "black"), - "focused current frame name": ("light green", "dark gray"), - # }}} - # {{{ shell - "command line prompt": (add_setting("yellow", "bold"), "black"), - "command line output": ("light cyan", "black"), - "command line error": ("yellow", "black"), - "focused command line output": ("light cyan", "dark gray"), - "focused command line error": ( - add_setting("yellow", "bold"), "dark gray"), - # }}} - # {{{ Code syntax - "literal": ("light magenta", "black"), - "builtin": ("light cyan", "black"), - "exception": ("light cyan", "black"), - "keyword2": ("light cyan", "black"), - "function": ("light green", "black"), - "class": (add_setting("light green", "underline"), "black"), - "keyword": ("light red", "black"), - "operator": ("light red", "black"), - "comment": ("dark gray", "black"), - "docstring": ("dark gray", "black"), - "argument": ("brown", "black"), - "pseudo": ("brown", "black"), - "string": ("yellow", "black"), - # }}} - } + reset_inheritance_overrides() - # }}} - elif theme == "monokai-256": - # {{{ monokai-256 - - # Give the colors some comprehensible names - black = "h236" - blacker = "h234" - dark_gray = "h240" - dark_green = "h28" - dark_red = "h124" - dark_teal = "h30" - dark_magenta = "h141" - light_blue = "h111" - light_cyan = "h51" - light_gray = "h252" - light_green = "h155" - light_red = "h160" - light_magenta = "h198" - medium_gray = "h243" - orange = "h208" - white = "h255" - yellow = "h228" - link("current breakpoint", "current frame name") - link("focused current breakpoint", "focused current frame name") - palette_dict = { - - # {{{ base styles - "background": (black, light_gray), - "selectable": (white, blacker), - "focused selectable": (white, dark_gray), - "highlighted": (white, dark_green), - "hotkey": (add_setting(black, "underline"), light_gray), - # }}} - # {{{ general ui - "input": (white, black), - "button": (add_setting(white, "bold"), black), - "focused button": (add_setting(white, "bold"), dark_gray), - "focused sidebar": (dark_teal, light_gray), - "warning": (add_setting(white, "bold"), dark_red), - "group head": (add_setting(black, "bold"), light_gray), - "dialog title": (add_setting(white, "bold"), blacker), - # }}} - # {{{ source view - "source": (white, black), - "current source": (add_setting(light_gray, "bold"), dark_teal), - "breakpoint source": (add_setting(white, "bold"), dark_red), - "line number": (dark_gray, black), - "current line marker": (add_setting(light_cyan, "bold"), black), - "breakpoint marker": (add_setting(light_red, "bold"), black), - # }}} - # {{{ sidebar - "sidebar two": (light_cyan, blacker), - "focused sidebar two": (light_cyan, dark_gray), - "sidebar three": (dark_magenta, blacker), - "focused sidebar three": (dark_magenta, dark_gray), - # }}} - # {{{ variables view - "highlighted var label": (light_gray, dark_green), - "return label": (light_green, blacker), - "focused return label": (light_green, dark_gray), - # }}} - # {{{ stack - "current frame name": (light_green, blacker), - "focused current frame name": (light_green, dark_gray), - # }}} - # {{{ shell - "command line prompt": ( - add_setting(yellow, "bold"), black), - "command line output": (light_cyan, black), - "command line error": (orange, black), - "focused command line output": (light_cyan, dark_gray), - "focused command line error": ( - add_setting(orange, "bold"), dark_gray), - # }}} - # {{{ Code syntax - "literal": (dark_magenta, black), - "builtin": (light_cyan, black), - "exception": (light_cyan, black), - "keyword2": (light_cyan, black), - "function": (light_green, black), - "class": (add_setting(light_green, "underline"), black), - "keyword": (light_magenta, black), - "operator": (light_magenta, black), - "comment": (medium_gray, black), - "docstring": (medium_gray, black), - "argument": (orange, black), - "pseudo": (orange, black), - "string": (yellow, black), - # }}} - } - # }}} - elif theme == "mono": - # {{{ mono - palette_dict = { - "background": ("standout",), - "selectable": (), - "focused selectable": ("underline",), - "highlighted": ("bold",), - "hotkey": ("underline, standout",), - } - # }}} - else: + try: + palette_dict = THEMES[theme] + except KeyError: # {{{ custom try: # {{{ base styles @@ -904,11 +304,9 @@ def link(child: str, parent: str): return None # }}} - # }}} - # Apply style inheritance for style_name in set(INHERITANCE_MAP.keys()).union(BASE_STYLES.keys()): - get_style(palette_dict, style_name, inheritance_overrides) + set_style(palette_dict, style_name, inheritance_overrides) palette_list = [ astuple(entry) @@ -918,4 +316,6 @@ def link(child: str, parent: str): return palette_list +# }}} + # vim: foldmethod=marker diff --git a/pudb/themes/__init__.py b/pudb/themes/__init__.py new file mode 100644 index 00000000..eb462eb8 --- /dev/null +++ b/pudb/themes/__init__.py @@ -0,0 +1,25 @@ +from .classic import palette_dict as classic +from .agr_256 import palette_dict as agr256 +from .solarized import palette_dict as solarized +from .dark_vim import palette_dict as darkvim +from .gray_light_256 import palette_dict as graylight256 +from .midnight import palette_dict as midnight +from .mono import palette_dict as mono +from .monokai import palette_dict as monokai +from .monokai_256 import palette_dict as monokai256 +from .nord_dark_256 import palette_dict as norddark256 +from .vim import palette_dict as vim + +THEMES = { + "classic": classic, + "vim": vim, + "dark vim": darkvim, + "midnight": midnight, + "monokai": monokai, + "solarized": solarized, + "mono": mono, + "agr-256": agr256, + "gray-light-256": graylight256, + "monokai-256": monokai256, + "nord-dark-256": norddark256, +} diff --git a/pudb/themes/agr_256.py b/pudb/themes/agr_256.py new file mode 100644 index 00000000..e16cc67b --- /dev/null +++ b/pudb/themes/agr_256.py @@ -0,0 +1,84 @@ +from pudb.themes.utils import add_setting, link + +# Give the colors some comprehensible names +black = "h235" +blacker = "h233" +dark_cyan = "h24" +dark_gray = "h241" +dark_green = "h22" +dark_red = "h88" +dark_teal = "h23" +light_blue = "h111" +light_cyan = "h80" +light_gray = "h252" +light_green = "h113" +light_red = "h160" +medium_gray = "h246" +salmon = "h223" +orange = "h173" +white = "h255" +yellow = "h192" + +link("focused breakpoint", "focused selectable") +link("current breakpoint", "current frame name") +link("focused current breakpoint", "focused current frame name") + +palette_dict = { + # {{{ base styles + "background": (black, light_gray), + "selectable": (white, blacker), + "focused selectable": (yellow, dark_cyan), + "hotkey": (add_setting(black, "underline"), light_gray), + "highlighted": (white, dark_green), + # }}} + # {{{ general ui + "focused sidebar": (dark_cyan, light_gray), + "group head": (add_setting(dark_cyan, "bold"), light_gray), + "dialog title": (add_setting(light_gray, "bold"), black), + "warning": (add_setting(white, "bold"), dark_red), + "fixed value": (add_setting(white, "bold"), dark_gray), + "button": (add_setting(white, "bold"), black), + "focused button": (add_setting(yellow, "bold"), dark_cyan), + # }}} + # {{{ source view + "line number": (dark_gray, black), + "current line marker": (add_setting(yellow, "bold"), black), + "breakpoint marker": (add_setting(light_red, "bold"), black), + "source": (white, black), + "breakpoint source": (add_setting(white, "bold"), dark_red), + "current source": (add_setting(light_gray, "bold"), dark_teal), + # }}} + # {{{ sidebar + "sidebar two": (light_blue, blacker), + "focused sidebar two": (light_gray, dark_cyan), + "sidebar three": (medium_gray, blacker), + "focused sidebar three": (salmon, dark_cyan), + # }}} + # {{{ variables view + "highlighted var label": (light_gray, dark_green), + "return label": (light_green, blacker), + "focused return label": (add_setting(light_gray, "bold"), dark_cyan), + # }}} + # {{{ stack + "current frame name": (yellow, blacker), + "focused current frame name": (add_setting(yellow, "bold"), dark_cyan), + # }}} + # {{{ shell + "command line prompt": (add_setting(yellow, "bold"), black), + "command line output": (light_cyan, black), + "command line error": (light_red, black), + # }}} + # {{{ Code syntax + "comment": (medium_gray, black), + "exception": (orange, black), + "function": (yellow, black), + "keyword": (light_blue, black), + "literal": (orange, black), + "operator": (yellow, black), + "pseudo": (medium_gray, black), + "punctuation": (salmon, black), + "string": (light_green, black), + # }}} +} + +# vim: foldmethod=marker diff --git a/pudb/themes/classic.py b/pudb/themes/classic.py new file mode 100644 index 00000000..b1c584e8 --- /dev/null +++ b/pudb/themes/classic.py @@ -0,0 +1,56 @@ +from pudb.themes.utils import add_setting, link + +link("current breakpoint", "current frame name") +link("focused current breakpoint", "focused current frame name") + +palette_dict = { + # {{{ base styles + "background": ("black", "light gray"), + "selectable": ("black", "dark cyan"), + "focused selectable": ("black", "light cyan"), + "highlighted": ("dark blue", "yellow"), + "hotkey": (add_setting("black", "underline"), "light gray"), + # }}} + # {{{ general ui + "header": ("dark blue", "light gray"), + "dialog title": (add_setting("white", "bold"), "dark blue"), + "warning": (add_setting("white", "bold"), "dark red"), + # }}} + # {{{ source view + "source": ("yellow", "dark blue"), + "current source": ("dark blue", "dark green"), + "breakpoint source": (add_setting("yellow", "bold"), "dark red"), + "line number": ("light gray", "dark blue"), + "breakpoint marker": (add_setting("dark red", "bold"), "dark blue"), + # }}} + # {{{ sidebar + "sidebar two": ("dark blue", "dark cyan"), + "sidebar three": ("dark gray", "dark cyan"), + "focused sidebar two": ("dark blue", "light cyan"), + "focused sidebar three": ("dark gray", "light cyan"), + # }}} + # {{{ variables view + "return label": ("white", "dark blue"), + "focused return label": ("light gray", "dark blue"), + # }}} + # {{{ stack + "current frame name": (add_setting("white", "bold"), "dark cyan"), + "focused current frame name": (add_setting("black", "bold"), "light cyan"), + # }}} + # {{{ shell + "command line output": ("light cyan", "dark blue"), + "command line prompt": (add_setting("white", "bold"), "dark blue"), + "command line error": (add_setting("light green", "bold"), "dark blue"), + "command line clear button": (add_setting("white", "bold"), "dark blue"), + "command line focused button": ("dark blue", "dark cyan"), + # }}} + # {{{ Code syntax + "keyword": (add_setting("white", "bold"), "dark blue"), + "function": ("light cyan", "dark blue"), + "literal": (add_setting("light green", "bold"), "dark blue"), + "punctuation": ("light gray", "dark blue"), + "comment": ("dark cyan", "dark blue"), + # }}} +} + +# vim: foldmethod=marker diff --git a/pudb/themes/dark_vim.py b/pudb/themes/dark_vim.py new file mode 100644 index 00000000..bc403da6 --- /dev/null +++ b/pudb/themes/dark_vim.py @@ -0,0 +1,52 @@ +from pudb.themes.utils import add_setting, link + +link("current breakpoint", "current frame name") +link("focused current breakpoint", "focused current frame name") + +palette_dict = { + # {{{ base styles + "background": ("black", "light gray"), + "selectable": ("white", "dark gray"), + "focused selectable": (add_setting("white", "bold"), "light blue"), + "highlighted": ("black", "dark green"), + "hotkey": (add_setting("dark blue", "underline"), "light gray"), + # }}} + # {{{ general ui + "header": ("dark blue", "light gray"), + "dialog title": (add_setting("white", "bold"), "black"), + "warning": (add_setting("light red", "bold"), "black"), + "header warning": (add_setting("light red", "bold"), "light gray"), + # }}} + # {{{ source view + "source": ("white", "black"), + "current source": (add_setting("white", "bold"), "dark gray"), + "line number": (add_setting("dark gray", "bold"), "black"), + "breakpoint marker": (add_setting("light red", "bold"), "black"), + "breakpoint source": (add_setting("white", "bold"), "dark red"), + # }}} + # {{{ sidebar + "sidebar two": ("yellow", "dark gray"), + "focused sidebar two": ("light cyan", "light blue"), + "sidebar three": ("light gray", "dark gray"), + "focused sidebar three": ("yellow", "light blue"), + # }}} + # {{{ stack + "current frame name": ( + add_setting("white", "bold"), "dark gray"), + # }}} + # {{{ shell + "command line output": (add_setting("yellow", "bold"), "black"), + # }}} + # {{{ Code syntax + "keyword": ("yellow", "black"), + "literal": ("light magenta", "black"), + "function": (add_setting("light cyan", "bold"), "black"), + "punctuation": ("yellow", "black"), + "comment": ("dark cyan", "black"), + "exception": ("light red", "black"), + "builtin": ("light green", "black"), + "pseudo": ("dark green", "black"), + # }}} +} + +# vim: foldmethod=marker diff --git a/pudb/themes/gray_light_256.py b/pudb/themes/gray_light_256.py new file mode 100644 index 00000000..13f4468c --- /dev/null +++ b/pudb/themes/gray_light_256.py @@ -0,0 +1,34 @@ +from pudb.themes.utils import add_setting + +palette_dict = { + # {{{ base styles + "background": ("h232", "h248"), + "selectable": ("h232", "h252"), + "focused selectable": ("h232", "h251"), + "highlighted": (add_setting("h234", "bold, underline"), "h252"), + "hotkey": (add_setting("h232", "underline"), "h248"), + # }}} + # {{{ general ui + "focused sidebar": (add_setting("h232", "bold"), "h248"), + "warning": (add_setting("h232", "bold"), "h253"), + "group head": (add_setting("h232", "bold"), "h248"), + "dialog title": (add_setting("h232", "underline, bold"), "h248"), + # }}} + # {{{ source view + "source": ("h235", "h253"), + "current source": (add_setting("h232", "underline"), "h253"), + "line number": ("h244", "h253"), + # }}} + # {{{ sidebar + "sidebar two": (add_setting("h234", "bold"), "h252"), + "focused sidebar two": (add_setting("h234", "bold"), "h251"), + "sidebar three": ("h239", "h252"), + "focused sidebar three": ("h239", "h251"), + # }}} + # {{{ Code syntax + "exception": (add_setting("h236", "underline"), "h253"), + "class": (add_setting("h234", "bold, underline"), "h253"), + "keyword": (add_setting("h234", "bold"), "h253"), + "comment": ("h244", "h253"), + # }}} +} diff --git a/pudb/themes/midnight.py b/pudb/themes/midnight.py new file mode 100644 index 00000000..944ea171 --- /dev/null +++ b/pudb/themes/midnight.py @@ -0,0 +1,93 @@ +from pudb.themes.utils import add_setting, link + +# Based on XCode's midnight theme +# Looks best in a console with green text against black background +link("current breakpoint", "current frame name") +link("focused current breakpoint", "focused current frame name") + +palette_dict = { + # {{{ base styles + "background": ("black", "light gray"), + "selectable": ("white", "black"), + "focused selectable": ("white", "dark blue"), + "hotkey": (add_setting("black", "underline, italics"), "light gray"), + "highlighted": ("black", "dark green"), + # }}} + # {{{ general ui + "input": ("light green", "black"), + "focused input": ("light green", "black"), + "warning": (add_setting("white", "bold"), "dark red"), + "dialog title": (add_setting("white", "bold"), "dark blue"), + "group head": (add_setting("dark blue", "bold"), "light gray"), + "button": (add_setting("white", "bold"), "dark blue"), + "focused button": ("white", "black"), + "focused sidebar": ("black", "white"), + "value": (add_setting("yellow", "bold"), "dark blue"), + # }}} + # {{{ source view + "source": ("light green", "black"), + "highlighted source": ("black", "dark green"), + "current source": ("black", "brown"), + "current focused source": (add_setting("yellow", "bold"), "dark blue"), + "breakpoint source": (add_setting("yellow", "bold"), "dark red"), + "current breakpoint source": ("black", "dark red"), + + "line number": ("light gray", "black"), + "current line marker": ("dark red", "black"), + "breakpoint marker": ("dark red", "black"), + # }}} + # {{{ sidebar + "sidebar two": ("light blue", "black"), + "sidebar three": ("light cyan", "black"), + # }}} + # {{{ variables view + "return label": ("white", "dark blue"), + "return value": ("black", "dark cyan"), + "focused return label": ("light gray", "dark blue"), + # }}} + # {{{ stack + "current frame name": (add_setting("white", "bold"), "black"), + "current frame class": (add_setting("light blue", "bold"), "black"), + "current frame location": (add_setting("light cyan", "bold"), "black"), + + "focused current frame name": (add_setting("white", "bold"), "dark blue"), + "focused current frame class": (add_setting("white", "bold"), "dark blue"), + "focused current frame location": (add_setting("white", "bold"), "dark blue"), + # }}} + # {{{ breakpoints view + "breakpoint": ("white", "black"), + "disabled breakpoint": ("dark gray", "black"), + "focused disabled breakpoint": ("light gray", "dark blue"), + "current breakpoint": (add_setting("white", "bold"), "black"), + "disabled current breakpoint": (add_setting("dark gray", "bold"), "black"), + "focused current breakpoint": (add_setting("white", "bold"), "dark blue"), + "focused disabled current breakpoint": ( + add_setting("light gray", "bold"), "dark blue"), + # }}} + # {{{ shell + "command line edit": ("white", "black"), + "command line prompt": (add_setting("white", "bold"), "black"), + + "command line input": ("white", "black"), + "command line error": (add_setting("light red", "bold"), "black"), + + "command line clear button": (add_setting("white", "bold"), "black"), + "command line focused button": ("white", "dark blue"), + # }}} + # {{{ Code syntax + "keyword": ("dark magenta", "black"), + "operator": ("dark green", "black"), + "pseudo": ("light magenta", "black"), + "function": (add_setting("light blue", "bold"), "black"), + "builtin": ("dark gray", "black"), + "literal": ("dark cyan", "black"), + "string": ("dark red", "black"), + "docstring": ("yellow", "black"), + "backtick": ("dark green", "black"), + "punctuation": ("white", "black"), + "comment": ("white", "black"), + "exception": ("dark green", "black"), + # }}} +} + +# vim: foldmethod=marker diff --git a/pudb/themes/mono.py b/pudb/themes/mono.py new file mode 100644 index 00000000..cda607be --- /dev/null +++ b/pudb/themes/mono.py @@ -0,0 +1,7 @@ +palette_dict = { + "background": ("standout",), + "selectable": (), + "focused selectable": ("underline",), + "highlighted": ("bold",), + "hotkey": ("underline, standout",), +} diff --git a/pudb/themes/monokai.py b/pudb/themes/monokai.py new file mode 100644 index 00000000..13caeb36 --- /dev/null +++ b/pudb/themes/monokai.py @@ -0,0 +1,68 @@ +from pudb.themes.utils import add_setting, link + +link("current breakpoint", "current frame name") +link("focused current breakpoint", "focused current frame name") + +palette_dict = { + # {{{ base styles + "background": ("black", "light gray"), + "selectable": ("white", "black"), + "focused selectable": ("white", "dark gray"), + "highlighted": ("black", "dark green"), + "hotkey": (add_setting("black", "underline"), "light gray"), + # }}} + # {{{ general ui + "input": ("white", "black"), + "button": (add_setting("white", "bold"), "black"), + "focused button": (add_setting("white", "bold"), "dark gray"), + "focused sidebar": ("dark blue", "light gray"), + "warning": (add_setting("white", "bold"), "dark red"), + "group head": (add_setting("black", "bold"), "light gray"), + "dialog title": (add_setting("white", "bold"), "black"), + # }}} + # {{{ source view + "current source": ("black", "dark cyan"), + "breakpoint source": (add_setting("white", "bold"), "dark red"), + "line number": ("dark gray", "black"), + "current line marker": (add_setting("dark cyan", "bold"), "black"), + "breakpoint marker": (add_setting("dark red", "bold"), "black"), + # }}} + # {{{ sidebar + "sidebar two": ("light cyan", "black"), + "focused sidebar two": ("light cyan", "dark gray"), + "sidebar three": ("light magenta", "black"), + "focused sidebar three": ("light magenta", "dark gray"), + # }}} + # {{{ variables view + "return label": ("light green", "black"), + "focused return label": ("light green", "dark gray"), + # }}} + # {{{ stack + "current frame name": ("light green", "black"), + "focused current frame name": ("light green", "dark gray"), + # }}} + # {{{ shell + "command line prompt": (add_setting("yellow", "bold"), "black"), + "command line output": ("light cyan", "black"), + "command line error": ("yellow", "black"), + "focused command line output": ("light cyan", "dark gray"), + "focused command line error": (add_setting("yellow", "bold"), "dark gray"), + # }}} + # {{{ Code syntax + "literal": ("light magenta", "black"), + "builtin": ("light cyan", "black"), + "exception": ("light cyan", "black"), + "keyword2": ("light cyan", "black"), + "function": ("light green", "black"), + "class": (add_setting("light green", "underline"), "black"), + "keyword": ("light red", "black"), + "operator": ("light red", "black"), + "comment": ("dark gray", "black"), + "docstring": ("dark gray", "black"), + "argument": ("brown", "black"), + "pseudo": ("brown", "black"), + "string": ("yellow", "black"), + # }}} +} + +# vim: foldmethod=marker diff --git a/pudb/themes/monokai_256.py b/pudb/themes/monokai_256.py new file mode 100644 index 00000000..3dac7dbf --- /dev/null +++ b/pudb/themes/monokai_256.py @@ -0,0 +1,89 @@ +from pudb.themes.utils import add_setting, link + +# Give the colors some comprehensible names +black = "h236" +blacker = "h234" +dark_gray = "h240" +dark_green = "h28" +dark_red = "h124" +dark_teal = "h30" +dark_magenta = "h141" +light_blue = "h111" +light_cyan = "h51" +light_gray = "h252" +light_green = "h155" +light_red = "h160" +light_magenta = "h198" +medium_gray = "h243" +orange = "h208" +white = "h255" +yellow = "h228" + +link("current breakpoint", "current frame name") +link("focused current breakpoint", "focused current frame name") + +palette_dict = { + # {{{ base styles + "background": (black, light_gray), + "selectable": (white, blacker), + "focused selectable": (white, dark_gray), + "highlighted": (white, dark_green), + "hotkey": (add_setting(black, "underline"), light_gray), + # }}} + # {{{ general ui + "input": (white, black), + "button": (add_setting(white, "bold"), black), + "focused button": (add_setting(white, "bold"), dark_gray), + "focused sidebar": (dark_teal, light_gray), + "warning": (add_setting(white, "bold"), dark_red), + "group head": (add_setting(black, "bold"), light_gray), + "dialog title": (add_setting(white, "bold"), blacker), + # }}} + # {{{ source view + "source": (white, black), + "current source": (add_setting(light_gray, "bold"), dark_teal), + "breakpoint source": (add_setting(white, "bold"), dark_red), + "line number": (dark_gray, black), + "current line marker": (add_setting(light_cyan, "bold"), black), + "breakpoint marker": (add_setting(light_red, "bold"), black), + # }}} + # {{{ sidebar + "sidebar two": (light_cyan, blacker), + "focused sidebar two": (light_cyan, dark_gray), + "sidebar three": (dark_magenta, blacker), + "focused sidebar three": (dark_magenta, dark_gray), + # }}} + # {{{ variables view + "highlighted var label": (light_gray, dark_green), + "return label": (light_green, blacker), + "focused return label": (light_green, dark_gray), + # }}} + # {{{ stack + "current frame name": (light_green, blacker), + "focused current frame name": (light_green, dark_gray), + # }}} + # {{{ shell + "command line prompt": (add_setting(yellow, "bold"), black), + "command line output": (light_cyan, black), + "command line error": (orange, black), + "focused command line output": (light_cyan, dark_gray), + "focused command line error": (add_setting(orange, "bold"), dark_gray), + # }}} + # {{{ Code syntax + "literal": (dark_magenta, black), + "builtin": (light_cyan, black), + "exception": (light_cyan, black), + "keyword2": (light_cyan, black), + "function": (light_green, black), + "class": (add_setting(light_green, "underline"), black), + "keyword": (light_magenta, black), + "operator": (light_magenta, black), + "comment": (medium_gray, black), + "docstring": (medium_gray, black), + "argument": (orange, black), + "pseudo": (orange, black), + "string": (yellow, black), + # }}} +} + +# vim: foldmethod=marker diff --git a/pudb/themes/nord_dark_256.py b/pudb/themes/nord_dark_256.py new file mode 100644 index 00000000..430b5391 --- /dev/null +++ b/pudb/themes/nord_dark_256.py @@ -0,0 +1,148 @@ +from pudb.themes.utils import add_setting, link + +# ------------------------------------------------------------------------------ +# Colors are approximations of https://www.nordtheme.com/docs/colors-and-palettes +# ------------------------------------------------------------------------------ + +# ------------------------------------------------------------------------------ +# Polar Night is made up of four darker colors (nord 0, nord1, nord2, and nord3) +# that are commonly used for base elements like backgrounds or text color in +# bright ambiance designs. +# ------------------------------------------------------------------------------ + +# nord0 is the origin color or the Polar Night palette. +nord0 = "h236" + +# nord1 is a brighter shade color based on nord0. +nord1 = "h238" + +# nord2 is an even more brighter shade color of nord0. +nord2 = "h239" + +# nord3 is the brightest shade color based on nord0. +nord3 = "h243" + +# ------------------------------------------------------------------------------ +# Snow Storm is made up of three bright colors that are commonly used for text +# colors or base UI elements in bright ambiance designs. +# ------------------------------------------------------------------------------ + +# nord4 is the origin color or the Snow Storm palette. +nord4 = "h253" + +# nord5 is a brighter shade color of nord4. +nord5 = "h254" + +# nord6 is the brightest shade color based on nord4. +nord6 = "h255" + +# ------------------------------------------------------------------------------ +# Frost can be described as the heart palette of Nord, a group of four bluish +# colors that are commonly used for primary UI component and text highlighting +# and essential code syntax elements. +# ------------------------------------------------------------------------------ + +# nord7 is a calm and highly contrasted color reminiscent of +# frozen polar water. +nord7 = "h109" + +# nord8 is a bright and shiny primary accent color reminiscent of pure +# and clear ice. +nord8 = "h110" + +# nord9 is a more darkened and less saturated color reminiscent of +# arctic waters. +nord9 = "h111" + +# nord10 is a dark and intensive color reminiscent of the deep arctic ocean. +nord10 = "h67" + +# ------------------------------------------------------------------------------ +# Aurora consists of five colorful components reminiscent of the "Aurora +# borealis", sometimes referred to as polar lights or northern lights. +# ------------------------------------------------------------------------------ + +# nord11 is a reddish color. +nord11 = "h138" + +# nord12 is an orangey color. +nord12 = "h174" + +# nord13 is a yellowy color. +nord13 = "h216" + +# nord14 is a greenish color. +nord14 = "h150" + +# nord15 is a purplish color. +nord15 = "h139" + +link("current breakpoint", "current frame name") +link("focused current breakpoint", "focused current frame name") +palette_dict = { + + # {{{ base styles + "background": (nord0, nord7), + "selectable": (nord4, nord1), + "focused selectable": (nord4, nord2), + "highlighted": (nord14, nord1), + "hotkey": (add_setting(nord0, "underline"), nord7), + # }}} + # {{{ general ui + "input": (nord4, nord0), + "button": (add_setting(nord4, "bold"), nord0), + "focused button": (add_setting(nord4, "bold"), nord2), + "focused sidebar": (nord0, nord7), + "warning": (nord12, nord2), + "group head": (add_setting(nord0, "bold"), nord7), + "dialog title": (add_setting(nord4, "bold"), nord1), + # }}} + # {{{ source view + "source": (nord4, nord0), + "current source": (nord13, nord1), + "current focused source": (nord13, nord2), + "breakpoint source": (nord12, nord0), + "line number": (nord2, nord0), + "current line marker": (add_setting(nord13, "bold"), nord0), + "breakpoint marker": (add_setting(nord13, "bold"), nord0), + # }}} + # {{{ sidebar + "sidebar two": (nord7, nord1), + "focused sidebar two": (nord7, nord2), + "sidebar three": (nord10, nord1), + "focused sidebar three": (nord10, nord2), + # }}} + # {{{ variables view + "highlighted var label": (nord14, nord1), + "focused highlighted var label": (nord14, nord2), + "focused highlighted var value": (nord14, nord2), + "return label": (nord0, nord8), + "focused return label": (nord0, nord8), + # }}} + # {{{ stack + "current frame name": (nord14, nord1), + "focused current frame name": (nord14, nord2), + # }}} + # {{{ shell + "command line prompt": (add_setting(nord5, "bold"), nord0), + "command line output": (nord7, nord0), + "command line error": (nord12, nord0), + "focused command line output": (nord7, nord2), + "focused command line error": (nord12, nord2), + # }}} + # {{{ Code syntax + "literal": (nord15, nord0), + "builtin": (add_setting(nord7, "bold"), nord0), + "pseudo": (nord7, nord0), + "exception": (nord11, nord0), + "function": (nord7, nord0), + "class": (add_setting(nord9, "underline"), nord0), + "keyword": (nord8, nord0), + "keyword2": (nord9, nord0), + "operator": (nord8, nord0), + "comment": (nord3, nord0), + "string": (nord14, nord0), + # }}} +} + +# vim: foldmethod=marker diff --git a/pudb/themes/solarized.py b/pudb/themes/solarized.py new file mode 100644 index 00000000..1e6aa8f6 --- /dev/null +++ b/pudb/themes/solarized.py @@ -0,0 +1,55 @@ +from pudb.themes.utils import add_setting + +palette_dict = { + # {{{ base styles + "background": ("light green", "light gray"), + "selectable": ("light green", "white"), + "focused selectable": ("white", "dark blue"), + "highlighted": ("white", "dark cyan"), + "hotkey": (add_setting("black", "underline"), "light gray"), + # }}} + # {{{ general ui + "dialog title": (add_setting("white", "bold"), "dark cyan"), + "warning": (add_setting("light red", "bold"), "white"), + "header warning": (add_setting("light red", "bold"), "light gray"), + "focused sidebar": ("dark red", "light gray"), + "group head": (add_setting("yellow", "bold"), "light gray"), + # }}} + # {{{ source view + "source": ("yellow", "white"), + "breakpoint source": ("light red", "light gray"), + "current source": ("light gray", "light blue"), + "line number": ("light blue", "white"), + "current line marker": (add_setting("light blue", "bold"), "white"), + "breakpoint marker": (add_setting("light red", "bold"), "white"), + # }}} + # {{{ sidebar + "sidebar two": ("dark blue", "white"), + "sidebar three": ("light cyan", "white"), + "focused sidebar three": ("light gray", "dark blue"), + # }}} + # {{{ variables view + "return label": ("white", "yellow"), + "focused return label": ("white", "yellow"), + # }}} + # {{{ stack + "current frame name": (add_setting("light green", "bold"), "white"), + "focused current frame name": (add_setting("white", "bold"), "dark blue"), + # }}} + # {{{ shell + "command line output": ("light green", "white"), + # }}} + # {{{ Code syntax + "namespace": ("dark red", "white"), + "exception": ("light red", "white"), + "keyword": ("brown", "white"), + "keyword2": ("dark magenta", "white"), + "function": ("dark green", "white"), + "literal": ("dark cyan", "white"), + "builtin": ("dark blue", "white"), + "comment": ("light cyan", "white"), + "pseudo": ("light cyan", "white"), + # }}} +} + +# vim: foldmethod=marker diff --git a/pudb/themes/utils.py b/pudb/themes/utils.py new file mode 100644 index 00000000..44f8aea7 --- /dev/null +++ b/pudb/themes/utils.py @@ -0,0 +1,21 @@ +import urwid + + +may_use_fancy_formats = not hasattr(urwid.escape, "_fg_attr_xterm") + + +def add_setting(color, setting): + if may_use_fancy_formats: + return f"{color}, {setting}" + return color + + +inheritance_overrides = {} + + +def link(child: str, parent: str): + inheritance_overrides[child] = parent + + +def reset_inheritance_overrides(): + inheritance_overrides.clear() diff --git a/pudb/themes/vim.py b/pudb/themes/vim.py new file mode 100644 index 00000000..f154d4a4 --- /dev/null +++ b/pudb/themes/vim.py @@ -0,0 +1,64 @@ +from pudb.themes.utils import add_setting, link + +link("current breakpoint", "current frame name") +link("focused current breakpoint", "focused current frame name") + +palette_dict = { + # {{{ base styles + "background": ("black", "light gray"), + "selectable": ("black", "dark cyan"), + "focused selectable": ("black", "light cyan"), + "hotkey": (add_setting("black", "bold, underline"), "light gray"), + "highlighted": ("black", "yellow"), + # }}} + # {{{ general ui + "header": (add_setting("black", "bold"), "light gray"), + "group head": ("dark blue", "light gray"), + "dialog title": (add_setting("white", "bold"), "dark blue"), + "input": ("black", "dark cyan"), + "focused input": ("black", "light cyan"), + "warning": (add_setting("dark red", "bold"), "white"), + "header warning": (add_setting("dark red", "bold"), "light gray"), + # }}} + # {{{ source view + "source": ("black", "white"), + "current source": ("black", "dark cyan"), + "breakpoint source": ("dark red", "light gray"), + "line number": ("dark gray", "white"), + "current line marker": ("dark red", "white"), + "breakpoint marker": ("dark red", "white"), + # }}} + # {{{ sidebar + "sidebar one": ("black", "dark cyan"), + "sidebar two": ("dark blue", "dark cyan"), + "sidebar three": ("dark gray", "dark cyan"), + "focused sidebar one": ("black", "light cyan"), + "focused sidebar two": ("dark blue", "light cyan"), + "focused sidebar three": ("dark gray", "light cyan"), + # }}} + # {{{ variables view + "highlighted var label": ("dark blue", "yellow"), + "return label": ("white", "dark blue"), + "focused return label": ("light gray", "dark blue"), + # }}} + # {{{ stack + "current frame name": (add_setting("white", "bold"), "dark cyan"), + "focused current frame name": (add_setting("black", "bold"), "light cyan"), + # }}} + # {{{ shell + "command line output": ( + add_setting("dark gray", "bold"), "white"), + # }}} + # {{{ Code syntax + "keyword2": ("dark magenta", "white"), + "namespace": ("dark magenta", "white"), + "literal": ("dark red", "white"), + "exception": ("dark red", "white"), + "comment": ("dark gray", "white"), + "function": ("dark blue", "white"), + "pseudo": ("dark gray", "white"), + "builtin": ("light blue", "white"), + # }}} +} + +# vim: foldmethod=marker