diff options
Diffstat (limited to 'gajim/common/util/text.py')
-rw-r--r-- | gajim/common/util/text.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gajim/common/util/text.py b/gajim/common/util/text.py index 2ab79dde9..50c16d8ac 100644 --- a/gajim/common/util/text.py +++ b/gajim/common/util/text.py @@ -51,6 +51,26 @@ def jid_to_iri(jid: str) -> str: return 'xmpp:' + escape_iri_path(jid) +def remove_fallback_text(text: str, + start: int | None, + end: int | None + ) -> str: + + if start is None: + start = 0 + + if end is None: + return text[start:] + + before = text[:start] + after = text[end:] + return before + after + + +def quote_text(text: str) -> str: + return '> ' + text.replace('\n', '\n> ') + '\n' + + def format_duration(ns: float, total_ns: float) -> str: seconds = ns / 1e9 minutes = seconds / 60 |