[Python-checkins] python/dist/src/Mac/Lib EasyDialogs.py,1.36,1.37

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Wed, 26 Jun 2002 08:14:51 -0700


Update of /cvsroot/python/python/dist/src/Mac/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv5295

Modified Files:
	EasyDialogs.py 
Log Message:
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.

Index: EasyDialogs.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Lib/EasyDialogs.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** EasyDialogs.py	9 Sep 2001 00:36:01 -0000	1.36
--- EasyDialogs.py	26 Jun 2002 15:14:48 -0000	1.37
***************
*** 362,371 ****
  		return
  	option = optionlist[idx]
! 	if type(option) == type(()) and \
! 			len(option) > 1:
! 		help = option[-1]
  	else:
  		help = ''
  	h = d.GetDialogItemAsControl(ARGV_OPTION_EXPLAIN)
  	Dlg.SetDialogItemText(h, help)
  	hasvalue = 0
--- 362,377 ----
  		return
  	option = optionlist[idx]
! 	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