summaryrefslogtreecommitdiffstats
path: root/Mac/Lib
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2002-06-26 15:14:48 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2002-06-26 15:14:48 (GMT)
commit09c73432734ac28d481141d54fcda0c164625641 (patch)
tree3d02f07dfcc8f41c438e33a2ca9dfa98cf7004ed /Mac/Lib
parent96cad2ea473a8415f1732bdcd4f266ec84d80e5f (diff)
downloadcpython-09c73432734ac28d481141d54fcda0c164625641.zip
cpython-09c73432734ac28d481141d54fcda0c164625641.tar.gz
cpython-09c73432734ac28d481141d54fcda0c164625641.tar.bz2
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.
Diffstat (limited to 'Mac/Lib')
-rw-r--r--Mac/Lib/EasyDialogs.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Mac/Lib/EasyDialogs.py b/Mac/Lib/EasyDialogs.py
index fa980cc..394e912 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(()):