Skip to content

Commit

Permalink
prep custom repr
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Nov 30, 2024
1 parent 5a5d0f5 commit d790be8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cat_win/src/service/helper/editorhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,20 @@ def initscr():
'A', 'B', 'C', 'D', 'E', 'F']


ESCAPE_MAP = {
'\t': r"\t",
'\n': r"\n",
'\v': r"\v",
'\f': r"\f",
'\r': r"\r",
}
def frepr(string: str) -> str:
"""
format repr
"""
return ''.join(ESCAPE_MAP.get(c, c) for c in string)


class Position:
"""
define a position in the text
Expand Down

0 comments on commit d790be8

Please sign in to comment.