change array syntax

This commit is contained in:
termie 2011-11-15 16:13:13 -08:00
parent 3479575623
commit b0733cab49
1 changed files with 5 additions and 5 deletions

10
bin/ksl
View File

@ -33,11 +33,11 @@ class BaseApp(cli.log.LoggingApp):
for x in args:
key, value = x.split('=', 1)
# make lists if there are multiple values
if key in kv:
if type(kv) is type(tuple()):
kv[key] = kv[key] + (value,)
else:
kv[key] = (kv[key], value)
if key.endswith('[]'):
key = key[:-2]
existing = kv.get(key, [])
existing.append(value)
kv[key] = existing
else:
kv[key] = value
return kv