MCPcopy Create free account
hub / github.com/Syncplay/syncplay / truncateText

Function truncateText

syncplay/utils.py:281–291  ·  view source on GitHub ↗
(unicodeText, maxLength)

Source from the content-addressed store, hash-verified

279
280
281def truncateText(unicodeText, maxLength):
282 try:
283 unicodeText = unicodeText.decode('utf-8')
284 except:
285 pass
286
287 try:
288 return str(unicodeText.encode("utf-8"), "utf-8", errors="ignore")[:maxLength]
289 except:
290 pass
291 return ""
292
293
294def splitText(unicodeText, maxLength):

Callers 7

addWatcherMethod · 0.90
setWatcherRoomMethod · 0.90
sendChatMethod · 0.90
loadRoomsMethod · 0.90
moveWatcherMethod · 0.90
findFreeUsernameMethod · 0.90
setFileMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected