##// END OF EJS Templates
Add new decorator magic_arguments.defaults
Takafumi Arakaki -
Show More
@@ -191,6 +191,24 b' class argument(ArgDecorator):'
191 return None
191 return None
192
192
193
193
194 class defaults(ArgDecorator):
195 """ Store arguments and keywords to pass to set_defaults().
196
197 Instances also serve to decorate command methods.
198 """
199 def __init__(self, *args, **kwds):
200 self.args = args
201 self.kwds = kwds
202
203 def add_to_parser(self, parser, group):
204 """ Add this object's information to the parser.
205 """
206 if group is not None:
207 parser = group
208 parser.set_defaults(*self.args, **self.kwds)
209 return None
210
211
194 class argument_group(ArgDecorator):
212 class argument_group(ArgDecorator):
195 """ Store arguments and keywords to pass to add_argument_group().
213 """ Store arguments and keywords to pass to add_argument_group().
196
214
General Comments 0
You need to be logged in to leave comments. Login now