mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-133346: Make theming support in _colorize extensible (GH-133347)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
parent
9cc77aaf9d
commit
f610bbdf74
20 changed files with 585 additions and 371 deletions
|
@ -28,7 +28,7 @@ from contextlib import contextmanager
|
|||
from dataclasses import dataclass, field, fields
|
||||
|
||||
from . import commands, console, input
|
||||
from .utils import wlen, unbracket, disp_str, gen_colors
|
||||
from .utils import wlen, unbracket, disp_str, gen_colors, THEME
|
||||
from .trace import trace
|
||||
|
||||
|
||||
|
@ -491,11 +491,8 @@ class Reader:
|
|||
prompt = self.ps1
|
||||
|
||||
if self.can_colorize:
|
||||
prompt = (
|
||||
f"{_colorize.theme["PROMPT"]}"
|
||||
f"{prompt}"
|
||||
f"{_colorize.theme["RESET"]}"
|
||||
)
|
||||
t = THEME()
|
||||
prompt = f"{t.prompt}{prompt}{t.reset}"
|
||||
return prompt
|
||||
|
||||
def push_input_trans(self, itrans: input.KeymapTranslator) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue