Exemple #1
0
 def wrapper(self, **kw):
     for name, default in params.iteritems():
         if name in kw:
             value = str(kw[name])
         elif default is None:
             raise MissingParameterError(str(name)) 
         else:
             value = default
         kw[name] = value
     return weak_signature_call(func, self, **kw)
Exemple #2
0
 def wrapper(self, **kw):
     for name, default in params.iteritems():
         if name in kw:
             if not isinstance(kw[name], list):
                 value = [memberType(kw[name])]
             else:
                 value = [ memberType(x) for x in kw[name] ]
         elif default is None:
             raise MissingParameterError(name)
         else:
             value = default
         kw[name] = value
     return weak_signature_call(func, self, **kw)
Exemple #3
0
 def wrapper(self, **kw):
     for name, default in params.iteritems():
         if name in kw:
             try:
                 value = int(kw[name])
             except ValueError:
                 raise BadParameterError(param=name, badvalue=kw[name])
         elif default is None:
             raise MissingParameterError(str(name))
         else:
             value = default
         kw[name] = value
     return weak_signature_call(func, self, **kw)
Exemple #4
0
 def wrapper(self, **kw):
     for key in kw.keys():
         parts = key.split('.')
         if len(parts) > 1 and parts[0] in params:
             d = kw
             d.setdefault(parts[0], {}) 
             while len(parts) > 1:
                 d.setdefault(parts[0], {}) 
                 d = d[parts[0]]
                 parts = parts[1:]
             value = kw[key]
             d[parts[0]] = str(value)
             del kw[key]
     return weak_signature_call(func, self, **kw)