From 6cf12d3c83ad4e9b0bac7d47c96b9c0590bff701 Mon Sep 17 00:00:00 2001 From: anders_k Date: Thu, 15 Dec 2011 23:35:40 +0000 Subject: [PATCH] SCons options display hack: Fix ListVariable to generate comma separated (quoted if required) list of allowed names git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6212 212acab6-be3b-0410-9dea-997c60f758d6 --- SConstruct | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SConstruct b/SConstruct index 66c28000..f271f672 100644 --- a/SConstruct +++ b/SConstruct @@ -107,6 +107,17 @@ SConscript('SCons/config.py') opts.Update(defenv) Help(opts.GenerateHelpText(defenv)) +#Fix ListVariable to generate comma separated (quoted if required) list of allowed names: +org_ListVariable = ListVariable +def ListVariable(key, help, default, names, map={}): + r = list(org_ListVariable(key, help, default, names, map)) + if len(r) == 5 and isinstance(r[1], str): + fmt = 'allowed names: %s' + repl = fmt % ', '.join( ((' ' in s) and ('"%s"' % s) or s) for s in names ) + r[1] = r[1].replace(fmt % ' '.join(names), repl) + return r + + install_dirs = { 'relocatable': { 'dest': '',