summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-09-10 15:16:17 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-09-10 15:16:17 +0000
commitbde377a2da7bb264ee3188a5696bb389af51321d (patch)
tree438e6e3d855e7fb015687fdfe7fb936a2338ec70
parent7de450363bc56a747a495803d56cc7c4d1323293 (diff)
downloadfreeipa.git-bde377a2da7bb264ee3188a5696bb389af51321d.tar.gz
freeipa.git-bde377a2da7bb264ee3188a5696bb389af51321d.tar.xz
freeipa.git-bde377a2da7bb264ee3188a5696bb389af51321d.zip
283: Renamed generate_argument() to generate_option()
-rw-r--r--ipalib/public.py8
-rw-r--r--ipalib/tests/test_public.py6
2 files changed, 7 insertions, 7 deletions
diff --git a/ipalib/public.py b/ipalib/public.py
index 7dfcd176..f20ae6d3 100644
--- a/ipalib/public.py
+++ b/ipalib/public.py
@@ -198,9 +198,9 @@ class Option(plugable.ReadOnly):
)
-def generate_argument(name):
+def generate_option(name):
"""
- Returns an `Option` instance using argument ``name``.
+ Returns an `Option` instance by parsing ``name``.
"""
if name.endswith('?'):
kw = dict(required=False, multivalue=False)
@@ -248,7 +248,7 @@ class Command(plugable.Plugin):
multivalue = False
for arg in self.get_args():
if type(arg) is str:
- arg = generate_argument(arg)
+ arg = generate_option(arg)
elif not isinstance(arg, Option):
raise TypeError(
'arg: need %r or %r; got %r' % (str, Option, arg)
@@ -270,7 +270,7 @@ class Command(plugable.Plugin):
def __check_options(self):
for option in self.get_options():
if type(option) is str:
- option = generate_argument(option)
+ option = generate_option(option)
elif not isinstance(option, Option):
raise TypeError(
'option: need %r or %r; got %r' % (str, Option, option)
diff --git a/ipalib/tests/test_public.py b/ipalib/tests/test_public.py
index 1f2efe4b..f805a7a9 100644
--- a/ipalib/tests/test_public.py
+++ b/ipalib/tests/test_public.py
@@ -309,11 +309,11 @@ class test_Option(ClassChecker):
assert o.get_values() == values
-def test_generate_argument():
+def test_generate_option():
"""
- Tests the `public.generate_argument` function.
+ Tests the `public.generate_option` function.
"""
- f = public.generate_argument
+ f = public.generate_option
for name in ['arg', 'arg?', 'arg*', 'arg+']:
o = f(name)
assert type(o) is public.Option