Skip to content

Commit

Permalink
Merge branch 'master' of github.com:static-frame/static-frame
Browse files Browse the repository at this point in the history
  • Loading branch information
flexatone committed Jan 18, 2024
2 parents 88dc47f + d90fff1 commit 69d46ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion static_frame/core/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,13 @@ class Display:
ELLIPSIS = '...' # this string is appended to truncated entries
CELL_ELLIPSIS = DisplayCell(FORMAT_EMPTY, ELLIPSIS)
ELLIPSIS_CENTER_SENTINEL = object()
ANSI_ESCAPE = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
ANSI_ESCAPE = re.compile(
r'\x1B'
r'\['
r'(\d{1,2}(;\d{1,2})*)?' # Optional numeric codes separated by ;
r'[A-Za-z]' # Letter indicating the type of code; most often "m" for colors
)


#---------------------------------------------------------------------------
# utility methods
Expand Down
2 changes: 1 addition & 1 deletion static_frame/core/display_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _diff(cls, color1: int, color2: int) -> int:
@staticmethod
def _get_ansi_to_hex_map() -> tp.Dict[int, int]:
'''
Called once (lazzily) to get the ANSI to hex color mapping. This will return a dictionary mapping integers 0 to 255 to corresponding hex values (as integers).
Called once (lazily) to get the ANSI to hex color mapping. This will return a dictionary mapping integers 0 to 255 to corresponding hex values (as integers).
'''
primary = (
0x000000,
Expand Down

0 comments on commit 69d46ca

Please sign in to comment.