Allow specifying variable options with the params argument.

This commit is contained in:
Bastian Kleineidam 2010-03-06 12:30:42 +01:00
parent 4cee825589
commit 60e5077969
1 changed files with 4 additions and 1 deletions

View File

@ -185,9 +185,12 @@ class Baker(object):
# If the user didn't specify # If the user didn't specify
shortopts = shortopts or {} shortopts = shortopts or {}
# Zip up the keyword argument names with their defaults
if defaults: if defaults:
# Zip up the keyword argument names with their defaults
keywords = dict(zip(arglist[0-len(defaults):], defaults)) keywords = dict(zip(arglist[0-len(defaults):], defaults))
elif has_kwargs:
# allow keyword arguments specified by params
keywords = dict(zip(params.keys(), [""]*len(params)))
else: else:
keywords = {} keywords = {}