Commit 2407af42 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent 84f1e5b7
......@@ -440,8 +440,8 @@ class MultiParameter(dict, AbstractParameter):
self.help = self.global_help + self.type.get_help()
param.flag = param_flag
self.sub_parameters.append(param)
class MultiParameterList(list, AbstractParameter):
def __init__(self, name, help, required=False, flag=None, group="default", display_name=None, cmd_format="", argpos=-1):
......@@ -476,6 +476,17 @@ class MultiParameterList(list, AbstractParameter):
self.help = self.global_help + self.type.get_help()
param.flag = param_flag
self.sub_parameters.append(param)
def __getitem__(self, key):
getitem = self.__dict__.get("__getitem__", list.__getitem__)
if isinstance(key, int):
return getitem(self, key)
else :
if getitem(self, 0).has_key(key):
res=[]
for mparam in self :
res.append(mparam[key])
return res
class ParameterFactory(object):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment