X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fstorage%2Fparameter.py;h=1545cac483f21aacce887d69f3c87d05013375a7;hb=3e6097e2d50ff322b45f53fcb22d07fc16adbdb6;hp=dc9d5b5c2dcec307095ab03a906ebc6163a6759d;hpb=30d9951e075d93127c3909dcb41be09b420b3525;p=sfa.git diff --git a/sfa/storage/parameter.py b/sfa/storage/parameter.py index dc9d5b5c..1545cac4 100644 --- a/sfa/storage/parameter.py +++ b/sfa/storage/parameter.py @@ -10,6 +10,7 @@ from sfa.util.faults import SfaAPIError from sfa.util.py23 import StringType + class Parameter: """ Typed value wrapper. Use in accepts and returns to document method @@ -17,11 +18,11 @@ class Parameter: sub-parameters (i.e., dict fields). """ - def __init__(self, type, doc = "", - min = None, max = None, - optional = None, - ro = False, - nullok = False): + def __init__(self, type, doc="", + min=None, max=None, + optional=None, + ro=False, + nullok=False): # Basic type of the parameter. Must be a builtin type # that can be marshalled by XML-RPC. self.type = type @@ -51,6 +52,7 @@ class Parameter: def __repr__(self): return repr(self.type) + class Mixed(tuple): """ A list (technically, a tuple) of types. Use in accepts and returns @@ -75,6 +77,7 @@ def python_type(arg): else: return type(arg) + def xmlrpc_type(arg): """ Returns the XML-RPC type of the specified argument, which may be a