Skip to content

Commit

Permalink
Add italic support
Browse files Browse the repository at this point in the history
  • Loading branch information
Vosjedev committed Jul 10, 2024
1 parent 4c898d7 commit 3246ed7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions curtsies/fmtfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

bold = _partial(fmtstr, style="bold")
dark = _partial(fmtstr, style="dark")
italic = _partial(fmtstr, style="italic")
underline = _partial(fmtstr, style="underline")
blink = _partial(fmtstr, style="blink")
invert = _partial(fmtstr, style="invert")
Expand Down
1 change: 1 addition & 0 deletions curtsies/formatstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
one_arg_xforms: Mapping[str, Callable[[str], str]] = {
"bold": lambda s: seq(STYLES["bold"]) + s + seq(RESET_ALL),
"dark": lambda s: seq(STYLES["dark"]) + s + seq(RESET_ALL),
"italic": lambda s: seq(STYLES["italic"]) + s + seq(RESET_ALL),
"underline": lambda s: seq(STYLES["underline"]) + s + seq(RESET_ALL),
"blink": lambda s: seq(STYLES["blink"]) + s + seq(RESET_ALL),
"invert": lambda s: seq(STYLES["invert"]) + s + seq(RESET_ALL),
Expand Down
2 changes: 1 addition & 1 deletion curtsies/termformatconstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
FG_COLORS: Mapping[str, int] = dict(zip(colors, range(30, 38)))
BG_COLORS: Mapping[str, int] = dict(zip(colors, range(40, 48)))
STYLES: Mapping[str, int] = dict(
zip(("bold", "dark", "underline", "blink", "invert"), (1, 2, 4, 5, 7))
zip(("bold", "dark", "italic", "underline", "blink", "invert"), (1, 2, 3, 4, 5, 7))
)
FG_NUMBER_TO_COLOR: Mapping[int, str] = dict(zip(FG_COLORS.values(), FG_COLORS.keys()))
BG_NUMBER_TO_COLOR: Mapping[int, str] = dict(zip(BG_COLORS.values(), BG_COLORS.keys()))
Expand Down

0 comments on commit 3246ed7

Please sign in to comment.