Skip to content

Commit

Permalink
Add docstring for _shorten_with_ellipsis method
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor-chaban committed Dec 13, 2024
1 parent 1289f8e commit 4d99103
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tgtg_scanner/notifiers/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,4 +533,5 @@ def __repr__(self) -> str:

@staticmethod
def _shorten_with_ellipsis(text: str, length: int = MAX_BUTTON_TEXT_LENGTH) -> str:
"""Shorten text to length and add ellipsis in the middle"""
return text if len(text) <= length else text[: (length - 3) // 2] + "..." + text[-(length - 3) // 2 :]

0 comments on commit 4d99103

Please sign in to comment.