comparison profilemanager/command.py @ 5:ca57920aa223

adding better formatting for list
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 06 Apr 2010 08:04:24 -0700
parents 35dc297efa25
children 81500171fda8
comparison
equal deleted inserted replaced
4:35dc297efa25 5:ca57920aa223
159 commandparser.error("Not enough arguments given") 159 commandparser.error("Not enough arguments given")
160 if len(command_args) != len(command['args']) and not command['varargs']: 160 if len(command_args) != len(command['args']) and not command['varargs']:
161 commandparser.error("Too many arguments given") 161 commandparser.error("Too many arguments given")
162 162
163 # invoke the command 163 # invoke the command
164 pprint(getattr(_object, name)(*command_args, **command_options.__dict__)) 164 retval = getattr(_object, name)(*command_args, **command_options.__dict__)
165 if isinstance(retval, basestring):
166 print retval
167 else:
168 pprint(retval)
169 return retval
165 170