]> granicus.if.org Git - python/commitdiff
Truncate messages if they are longer than 255 characters. Note that this is
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 28 Sep 1998 10:37:08 +0000 (10:37 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 28 Sep 1998 10:37:08 +0000 (10:37 +0000)
not really a good solution for default input strings...

Mac/Lib/EasyDialogs.py

index 1b3f5ba4342db9b81c9f1a516a37f5842ce8da21..7e94fee1ff71bce185c8fd9666ccd28b88c5af7e 100644 (file)
@@ -28,6 +28,8 @@ def cr2lf(text):
 def lf2cr(text):
        if '\n' in text:
                text = string.join(string.split(text, '\n'), '\r')
+       if len(text) > 253:
+               text = text[:253] + '\311'
        return text
 
 def Message(msg, id=256):