From: Jack Jansen Date: Wed, 26 Jun 2002 15:14:48 +0000 (+0000) Subject: Turns out GetArgv() options can be 4-tuples too, with the last value being the defaul... X-Git-Tag: v2.3c1~5208 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09c73432734ac28d481141d54fcda0c164625641;p=thirdparty%2FPython%2Fcpython.git Turns out GetArgv() options can be 4-tuples too, with the last value being the default (or something like that). Cater for this. Also put in a safeguard against very long help strings. --- diff --git a/Mac/Lib/EasyDialogs.py b/Mac/Lib/EasyDialogs.py index fa980cc11e5d..394e9123d36e 100644 --- a/Mac/Lib/EasyDialogs.py +++ b/Mac/Lib/EasyDialogs.py @@ -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(()):