~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to utilities/script_commands.py

  • Committer: Aaron Bentley
  • Date: 2011-08-05 16:14:18 UTC
  • mto: This revision was merged to the branch mainline in revision 13619.
  • Revision ID: aaron@canonical.com-20110805161418-hmwatwddpfd8wv31
Updates from review.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    if defaults is None:
52
52
        defaults = [None] * len(args)
53
53
    arg_types = getattr(function, '_types', {})
 
54
    arg_helps = getattr(function, '_helps', {})
54
55
    for arg, default in zip(args, defaults):
55
56
        arg_type = arg_types.get(arg)
56
57
        if arg_type is None:
57
58
            if default is None:
58
59
                continue
59
60
            arg_type = type(default)
60
 
        arg_help = getattr(function, '_helps', {}).get(arg)
 
61
        arg_help = arg_helps.get(arg)
61
62
        if arg_help is not None:
62
63
            arg_help += ' Default: %default.'
63
64
        parser.add_option(