##// END OF EJS Templates
Simplify return form of some functions - avoid unnecessary variables.
Fernando Perez -
Show More
@@ -119,8 +119,7 b' def construct_parser(magic_func):'
119 def parse_argstring(magic_func, argstring):
119 def parse_argstring(magic_func, argstring):
120 """ Parse the string of arguments for the given magic function.
120 """ Parse the string of arguments for the given magic function.
121 """
121 """
122 args = magic_func.parser.parse_argstring(argstring)
122 return magic_func.parser.parse_argstring(argstring)
123 return args
124
123
125
124
126 def real_name(magic_func):
125 def real_name(magic_func):
@@ -129,8 +128,7 b' def real_name(magic_func):'
129 magic_name = magic_func.__name__
128 magic_name = magic_func.__name__
130 if magic_name.startswith('magic_'):
129 if magic_name.startswith('magic_'):
131 magic_name = magic_name[len('magic_'):]
130 magic_name = magic_name[len('magic_'):]
132 arg_name = getattr(magic_func, 'argcmd_name', magic_name)
131 return getattr(magic_func, 'argcmd_name', magic_name)
133 return arg_name
134
132
135
133
136 class ArgDecorator(object):
134 class ArgDecorator(object):
@@ -200,8 +198,7 b' class argument_group(ArgDecorator):'
200 def add_to_parser(self, parser, group):
198 def add_to_parser(self, parser, group):
201 """ Add this object's information to the parser.
199 """ Add this object's information to the parser.
202 """
200 """
203 group = parser.add_argument_group(*self.args, **self.kwds)
201 return parser.add_argument_group(*self.args, **self.kwds)
204 return group
205
202
206
203
207 class kwds(ArgDecorator):
204 class kwds(ArgDecorator):
General Comments 0
You need to be logged in to leave comments. Login now