def params(self):
def fmt_param(el):<EOL><INDENT>if isinstance(el, str) or isinstance(el, unicode):<EOL><INDENT>return el<EOL><DEDENT>else:<EOL><INDENT>return '<STR_LIT>' % ('<STR_LIT:U+002CU+0020>'.join(map(fmt_param, el)))<EOL><DEDENT><DEDENT>try:<EOL><INDENT>getspec = getattr(inspect, '<STR_LIT>', inspect.getargspec)<EOL>s = getspec(self.func)<EOL><DEDENT>except TypeError:<EOL><INDENT>return ['<STR_LIT>']<EOL><DEDENT>params = []<EOL>for i, param in enumerate(s.args):<EOL><INDENT>if param.lower() == '<STR_LIT>':<EOL><INDENT>continue<EOL><DEDENT>if s.defaults is not None and len(s.args) - i <= len(s.defaults):<EOL><INDENT>defind = len(s.defaults) - (len(s.args) - i)<EOL>default_value = s.defaults[defind]<EOL>value = repr(default_value).strip()<EOL>if value[<NUM_LIT:0>] == '<STR_LIT:<>' and value[-<NUM_LIT:1>] == '<STR_LIT:>>':<EOL><INDENT>if type(default_value) == types.TypeType:<EOL><INDENT>value = default_value.__name__<EOL><DEDENT>elif type(default_value) == types.ObjectType:<EOL><INDENT>value = '<STR_LIT>'%(default_value.__class__.__name__)<EOL><DEDENT><DEDENT>params.append('<STR_LIT>' % (param, value))<EOL><DEDENT>else:<EOL><INDENT>params.append(fmt_param(param))<EOL><DEDENT><DEDENT>if s.varargs is not None:<EOL><INDENT>params.append('<STR_LIT>' % s.varargs)<EOL><DEDENT>keywords = getattr(s, '<STR_LIT>', getattr(s, '<STR_LIT>', None))<EOL>if keywords is not None:<EOL><INDENT>params.append('<STR_LIT>' % keywords)<EOL><DEDENT>return params<EOL>
Returns a list where each element is a nicely formatted
parameter of this function. This includes argument lists,
keyword arguments and default values.