comparison commandparser/command.py @ 5:005e073dc590

basic POC
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 30 Mar 2012 09:53:58 -0700
parents 5f31e56eebb6
children 109627b7db9f
comparison
equal deleted inserted replaced
4:5f31e56eebb6 5:005e073dc590
157 args = argspec.args[1:-len(defaults)] 157 args = argspec.args[1:-len(defaults)]
158 optional = dict(zip(argspec.args[-len(defaults):], defaults)) 158 optional = dict(zip(argspec.args[-len(defaults):], defaults))
159 else: 159 else:
160 args = argspec.args[1:] 160 args = argspec.args[1:]
161 optional = None 161 optional = None
162 command = { 'doc': doc, 162 command = {'doc': doc,
163 'name': name, 163 'name': name,
164 'args': args, 164 'args': args,
165 'optional': optional, 165 'optional': optional,
166 'varargs': argspec.varargs 166 'varargs': argspec.varargs
167 } 167 }
168 return command 168 return command
169 169
170 def commandargs2str(self, command): 170 def commandargs2str(self, command):
171 if isinstance(command, basestring): 171 if isinstance(command, basestring):
172 command = self.commands[command] 172 command = self.commands[command]