diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-26 23:41:51 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-26 23:41:51 +0000 |
commit | 031daabcc4bb023ff54bd76dd1418bbe3bcff022 (patch) | |
tree | da41158fafadd4db7ff69e6137a9315cbd7827bc /ipalib/frontend.py | |
parent | 7bbd81d83171c4711a78616688349622ac309b0b (diff) | |
download | freeipa-031daabcc4bb023ff54bd76dd1418bbe3bcff022.tar.gz freeipa-031daabcc4bb023ff54bd76dd1418bbe3bcff022.tar.xz freeipa-031daabcc4bb023ff54bd76dd1418bbe3bcff022.zip |
371: Added examples to parse_param_spec() docstring and changed syntax guide into a reStructuredText table
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r-- | ipalib/frontend.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py index afc02066..5fd27116 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -152,10 +152,25 @@ def parse_param_spec(spec): required, and whether the param is multivalue according the following syntax: - name => required=True, multivalue=False - name? => required=False, multivalue=False - name+ => required=True, multivalue=True - name* => required=False, multivalue=True + ====== ===== ======== ========== + Spec Name Required Multivalue + ====== ===== ======== ========== + 'var' 'var' True False + 'var?' 'var' False False + 'var*' 'var' False True + 'var+' 'var' True True + ====== ===== ======== ========== + + For example, + + >>> parse_param_spec('login') + ('login', {'required': True, 'multivalue': False}) + >>> parse_param_spec('gecos?') + ('gecos', {'required': False, 'multivalue': False}) + >>> parse_param_spec('telephone_numbers*') + ('telephone_numbers', {'required': False, 'multivalue': True}) + >>> parse_param_spec('group+') + ('group', {'required': True, 'multivalue': True}) :param spec: A spec string. """ |