]> granicus.if.org Git - python/commitdiff
Turns out GetArgv() options can be 4-tuples too, with the last value being the defaul...
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 26 Jun 2002 15:14:48 +0000 (15:14 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 26 Jun 2002 15:14:48 +0000 (15:14 +0000)
Also put in a safeguard against very long help strings.

Mac/Lib/EasyDialogs.py

index fa980cc11e5da9d06c5a7dc444f7906f74f96556..394e9123d36e049d3c588dc7b136f4b44510b3ce 100644 (file)
@@ -361,12 +361,18 @@ def _selectoption(d, optionlist, idx):
                MacOS.SysBeep()
                return
        option = optionlist[idx]
-       if type(option) == type(()) and \
-                       len(option) > 1:
-               help = option[-1]
+       if type(option) == type(()):
+               if len(option) == 4:
+                       help = option[2]
+               elif len(option) > 1:
+                       help = option[-1]
+               else:
+                       help = ''
        else:
                help = ''
        h = d.GetDialogItemAsControl(ARGV_OPTION_EXPLAIN)
+       if help and len(help) > 250:
+               help = help[:250] + '...'
        Dlg.SetDialogItemText(h, help)
        hasvalue = 0
        if type(option) == type(()):